mirror of
https://github.com/Karaka-Management/oms-Sales.git
synced 2026-01-11 11:28:41 +00:00
bug fixes
This commit is contained in:
parent
9f44be745c
commit
984c0af12e
2
.github/workflows/greetings.yml
vendored
2
.github/workflows/greetings.yml
vendored
|
|
@ -9,5 +9,5 @@ jobs:
|
|||
- uses: actions/first-interaction@v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
issue-message: 'Thank you for createing this issue. We will check it as soon as possible.'
|
||||
issue-message: 'Thank you for creating this issue. We will check it as soon as possible.'
|
||||
pr-message: 'Thank you for your pull request. We will check it as soon as possible.'
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Sales\Controller;
|
||||
|
||||
use Modules\Sales\Models\SalesRep;
|
||||
use Modules\Sales\Models\SalesRepMapper;
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
|
|
@ -48,7 +47,7 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Sales/Theme/Backend/rep-list');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001601001, $request, $response);
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001602001, $request, $response);
|
||||
|
||||
$view->data['rep'] = SalesRepMapper::getAll()
|
||||
->with('main')
|
||||
|
|
@ -74,10 +73,11 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Sales/Theme/Backend/rep-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001601001, $request, $response);
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001602001, $request, $response);
|
||||
|
||||
$view->data['rep'] = SalesRepMapper::get()
|
||||
->with('main')
|
||||
->where('id', (int) $request->getData('id'))
|
||||
->execute();
|
||||
|
||||
return $view;
|
||||
|
|
@ -99,7 +99,7 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Sales/Theme/Backend/rep-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001601001, $request, $response);
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001602001, $request, $response);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ final class NullSalesRep extends SalesRep
|
|||
public function __construct(int $id = 0)
|
||||
{
|
||||
$this->id = $id;
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -45,13 +45,4 @@ class SalesRep
|
|||
public ?Account $main = null;
|
||||
|
||||
public array $accounts = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,19 +71,4 @@ final class SalesRepMapper extends DataMapperFactory
|
|||
'external' => 'sales_rep_main',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Has many relation.
|
||||
*
|
||||
* @var array<string, array{mapper:class-string, table:string, self?:?string, external?:?string, column?:string}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const HAS_MANY = [
|
||||
'files' => [
|
||||
'mapper' => MediaMapper::class, /* mapper of the related object */
|
||||
'table' => 'sales_rep_media', /* table of the related object, null if no relation table is used (many->1) */
|
||||
'external' => 'sales_rep_media_dst',
|
||||
'self' => 'sales_rep_media_src',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
return ['Navigation' => [
|
||||
'Sales' => 'Sales',
|
||||
'SalesReps' => 'SalesReps',
|
||||
'SalesReps' => 'Sales Reps',
|
||||
'List' => 'List',
|
||||
'Create' => 'Create',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ return ['Sales' => [
|
|||
'Turnover' => 'Umsatz',
|
||||
'Type' => 'Typ',
|
||||
'ZipCode' => 'Postleitzahl',
|
||||
'Code' => 'Kodierung',
|
||||
'SalesRep' => 'Verkäufer',
|
||||
'SalesReps' => 'Verkäufer',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -102,7 +102,8 @@ return ['Sales' => [
|
|||
'Trend' => 'Trend',
|
||||
'Turnover' => 'Turnover',
|
||||
'Type' => 'Type',
|
||||
'ZipCode' => 'ZipCode',
|
||||
'ZipCode' => 'Zip Code',
|
||||
'Code' => 'Code',
|
||||
'SalesRep' => 'Sales Rep',
|
||||
'SalesReps' => 'Sales Reps',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Accounting
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Modules\Sales\Models\NullSalesRep;
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
* @var \Modules\Sales\Models\SalesRep $rep
|
||||
*/
|
||||
$rep = $this->data['rep'] ?? new NullSalesRep();
|
||||
$isNew = $rep->id === 0;
|
||||
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<form id="iSalesRepForm"
|
||||
method="<?= $isNew ? 'PUT' : 'POST'; ?>"
|
||||
action="<?= UriFactory::build('{/api}sales/rep?csrf={$CSRF}'); ?>"
|
||||
<?= $isNew ? 'data-redirect="' . UriFactory::build('{/base}/sales/rep/view') . '?id={/0/response/id}"' : ''; ?>>
|
||||
<div class="portlet-head"><?= $this->getHtml('SalesRep'); ?></div>
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iCode"><?= $this->getHtml('Code'); ?></label>
|
||||
<input id="iCode" type="text" name="code" value="<?= $this->printHtml($rep->code); ?>" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iMainRep"><?= $this->getHtml('Name'); ?></label>
|
||||
<div id="iMainRepSelector" class="smart-input-wrapper" data-src="<?= UriFactory::build('{/api}admin/account/find?csrf={$CSRF}'); ?>">
|
||||
<div
|
||||
data-value="<?= $rep->main?->id; ?>"
|
||||
data-name="search"
|
||||
data-limit="10"
|
||||
data-container=""
|
||||
class="input-div"
|
||||
contenteditable="true"><?= $this->printHtml($rep->main?->name1); ?> <?= $this->printHtml($rep->main?->name2); ?></div>
|
||||
<template class="input-data-tpl" data-container="child-container">
|
||||
<div tabindex="0" class="child-container">
|
||||
<div data-value="" data-tpl-value="/id">
|
||||
<span data-tpl-text="/name/0"></span>
|
||||
<span data-tpl-text="/name/1"></span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="input-datalist input-datalist-body vh" data-active="true"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<?php if ($isNew) : ?>
|
||||
<input id="iCreateSubmit" type="Submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
|
||||
<?php else : ?>
|
||||
<input id="iSaveSubmit" type="Submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user