From 9f44be745c959ea81eec961ce55b4f3551b91168 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 2 May 2024 22:54:39 +0000 Subject: [PATCH] Went through todos --- Admin/Install/Navigation.install.json | 49 ++++++++++++- Admin/Install/db.json | 56 ++++++++++++++ Admin/Routes/Web/Backend.php | 41 +++++++++++ Controller/ApiController.php | 72 ++++++++++++++++++ Controller/BackendController.php | 78 ++++++++++++++++++++ Models/NullSalesRep.php | 47 ++++++++++++ Models/PermissionCategory.php | 2 +- Models/SalesRep.php | 57 +++++++++++++++ Models/SalesRepMapper.php | 89 +++++++++++++++++++++++ Theme/Backend/Lang/Navigation.ar.lang.php | 24 ------ Theme/Backend/Lang/Navigation.cs.lang.php | 24 ------ Theme/Backend/Lang/Navigation.da.lang.php | 24 ------ Theme/Backend/Lang/Navigation.de.lang.php | 12 +-- Theme/Backend/Lang/Navigation.el.lang.php | 24 ------ Theme/Backend/Lang/Navigation.en.lang.php | 10 +-- Theme/Backend/Lang/Navigation.es.lang.php | 24 ------ Theme/Backend/Lang/Navigation.fi.lang.php | 24 ------ Theme/Backend/Lang/Navigation.fr.lang.php | 24 ------ Theme/Backend/Lang/Navigation.hu.lang.php | 24 ------ Theme/Backend/Lang/Navigation.it.lang.php | 24 ------ Theme/Backend/Lang/Navigation.ja.lang.php | 24 ------ Theme/Backend/Lang/Navigation.ko.lang.php | 24 ------ Theme/Backend/Lang/Navigation.no.lang.php | 24 ------ Theme/Backend/Lang/Navigation.pl.lang.php | 24 ------ Theme/Backend/Lang/Navigation.pt.lang.php | 24 ------ Theme/Backend/Lang/Navigation.ru.lang.php | 24 ------ Theme/Backend/Lang/Navigation.sv.lang.php | 24 ------ Theme/Backend/Lang/Navigation.th.lang.php | 24 ------ Theme/Backend/Lang/Navigation.tr.lang.php | 24 ------ Theme/Backend/Lang/Navigation.uk.lang.php | 24 ------ Theme/Backend/Lang/Navigation.zh.lang.php | 24 ------ Theme/Backend/Lang/de.lang.php | 2 + Theme/Backend/Lang/en.lang.php | 2 + Theme/Backend/rep-list.tpl.php | 51 +++++++++++++ Theme/Backend/rep-view.tpl.php | 0 35 files changed, 551 insertions(+), 497 deletions(-) create mode 100644 Admin/Install/db.json create mode 100644 Models/NullSalesRep.php create mode 100644 Models/SalesRep.php create mode 100644 Models/SalesRepMapper.php delete mode 100755 Theme/Backend/Lang/Navigation.ar.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.cs.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.da.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.el.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.es.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.fi.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.fr.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.hu.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.it.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.ja.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.ko.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.no.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.pl.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.pt.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.ru.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.sv.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.th.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.tr.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.uk.lang.php delete mode 100755 Theme/Backend/Lang/Navigation.zh.lang.php create mode 100644 Theme/Backend/rep-list.tpl.php create mode 100644 Theme/Backend/rep-view.tpl.php diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 4a3b4eb..5c022ee 100755 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -12,6 +12,53 @@ "from": "Sales", "permission": { "permission": 2, "category": null, "element": null }, "parent": 0, - "children": [] + "children": [ + { + "id": 1001602001, + "pid": "/", + "type": 2, + "subtype": 1, + "name": "SalesReps", + "uri": "{/base}/sales/rep/list", + "target": "self", + "icon": null, + "order": 1, + "from": "Sales", + "permission": { "permission": 2, "category": null, "element": null }, + "parent": 1001601001, + "children": [ + { + "id": 1001602002, + "pid": "/sales/rep", + "type": 3, + "subtype": 1, + "name": "List", + "uri": "{/base}/sales/rep/list", + "target": "self", + "icon": null, + "order": 1, + "from": "Sales", + "permission": { "permission": 2, "category": null, "element": null }, + "parent": 1001602001, + "children": [] + }, + { + "id": 1001602003, + "pid": "/sales/rep", + "type": 3, + "subtype": 1, + "name": "Create", + "uri": "{/base}/sales/rep/create", + "target": "self", + "icon": null, + "order": 1, + "from": "Sales", + "permission": { "permission": 2, "category": null, "element": null }, + "parent": 1001602001, + "children": [] + } + ] + } + ] } ] diff --git a/Admin/Install/db.json b/Admin/Install/db.json new file mode 100644 index 0000000..38193e1 --- /dev/null +++ b/Admin/Install/db.json @@ -0,0 +1,56 @@ +{ + "sales_rep": { + "name": "sales_rep", + "fields": { + "sales_rep_id": { + "name": "sales_rep_id", + "type": "INT", + "null": false, + "primary": true, + "autoincrement": true + }, + "sales_rep_code": { + "name": "sales_rep_code", + "type": "VARCHAR(255)", + "null": false + }, + "sales_rep_main": { + "name": "sales_rep_main", + "type": "INT", + "null": true, + "default": false, + "foreignTable": "account", + "foreignKey": "account_id" + } + } + }, + "sales_rep_account": { + "name": "sales_rep_account", + "fields": { + "sales_rep_account_id": { + "name": "sales_rep_account_id", + "type": "INT", + "null": false, + "primary": true, + "autoincrement": true + }, + "sales_rep_account_account": { + "name": "sales_rep_account_account", + "type": "INT", + "null": false, + "foreignTable": "account", + "foreignKey": "account_id" + }, + "sales_rep_account_start": { + "name": "sales_rep_account_start", + "type": "DATETIME", + "null": false + }, + "sales_rep_account_end": { + "name": "sales_rep_account_end", + "type": "DATETIME", + "null": false + } + } + } +} \ No newline at end of file diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index 0bf3609..063e24e 100755 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -12,5 +12,46 @@ */ declare(strict_types=1); +use Modules\Sales\Controller\BackendController; +use Modules\Sales\Models\PermissionCategory; +use phpOMS\Account\PermissionType; +use phpOMS\Router\RouteVerb; + return [ + '^/sales/rep/list(\?.*$|$)' => [ + [ + 'dest' => '\Modules\Sales\Controller\BackendController:viewRepList', + 'verb' => RouteVerb::GET, + 'active' => true, + 'permission' => [ + 'module' => BackendController::NAME, + 'type' => PermissionType::READ, + 'state' => PermissionCategory::SALES_REP, + ], + ], + ], + '^/sales/rep/view(\?.*$|$)' => [ + [ + 'dest' => '\Modules\Sales\Controller\BackendController:viewRepView', + 'verb' => RouteVerb::GET, + 'active' => true, + 'permission' => [ + 'module' => BackendController::NAME, + 'type' => PermissionType::READ, + 'state' => PermissionCategory::SALES_REP, + ], + ], + ], + '^/sales/rep/create(\?.*$|$)' => [ + [ + 'dest' => '\Modules\Sales\Controller\BackendController:viewRepCreate', + 'verb' => RouteVerb::GET, + 'active' => true, + 'permission' => [ + 'module' => BackendController::NAME, + 'type' => PermissionType::CREATE, + 'state' => PermissionCategory::SALES_REP, + ], + ], + ], ]; diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 6b4e95c..5363b44 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -14,6 +14,13 @@ declare(strict_types=1); namespace Modules\Sales\Controller; +use Modules\Admin\Models\NullAccount; +use Modules\Sales\Models\SalesRep; +use Modules\Sales\Models\SalesRepMapper; +use phpOMS\Message\Http\RequestStatusCode; +use phpOMS\Message\RequestAbstract; +use phpOMS\Message\ResponseAbstract; + /** * Sales api controller class. * @@ -24,4 +31,69 @@ namespace Modules\Sales\Controller; */ final class ApiController extends Controller { + /** + * Api method to create an cost center + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param array $data Generic data + * + * @return void + * + * @api + * + * @since 1.0.0 + */ + public function apiRepCreate(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void + { + if (!empty($val = $this->validateRepCreate($request))) { + $response->header->status = RequestStatusCode::R_400; + $this->createInvalidCreateResponse($request, $response, $val); + + return; + } + + $rep = $this->createRepFromRequest($request); + $this->createModel($request->header->account, $rep, SalesRepMapper::class, 'rep', $request->getOrigin()); + + $this->createStandardCreateResponse($request, $response, $rep); + } + + /** + * Validate cost center create request + * + * @param RequestAbstract $request Request + * + * @return array + * + * @since 1.0.0 + */ + private function validateRepCreate(RequestAbstract $request) : array + { + $val = []; + if (($val['code'] = !$request->hasData('code')) + ) { + return $val; + } + + return []; + } + + /** + * Method to create cost center from request. + * + * @param RequestAbstract $request Request + * + * @return SalesRep + * + * @since 1.0.0 + */ + private function createRepFromRequest(RequestAbstract $request) : SalesRep + { + $rep = new SalesRep(); + $rep->code = $request->getDataString('code') ?? ''; + $rep->main = $request->hasData('main') ? new NullAccount((int) $request->getData('main')) : null;; + + return $rep; + } } diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 6d7d54d..d46efde 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -14,6 +14,13 @@ 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; +use phpOMS\Message\ResponseAbstract; +use phpOMS\Views\View; + /** * Sales class. * @@ -25,4 +32,75 @@ namespace Modules\Sales\Controller; */ final class BackendController extends Controller { + /** + * Routing end-point for application behavior. + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param array $data Generic data + * + * @return RenderableInterface + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + public function viewRepList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface + { + $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['rep'] = SalesRepMapper::getAll() + ->with('main') + ->limit(50) + ->executeGetArray(); + + return $view; + } + + /** + * Routing end-point for application behavior. + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param array $data Generic data + * + * @return RenderableInterface + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + public function viewRepView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface + { + $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['rep'] = SalesRepMapper::get() + ->with('main') + ->execute(); + + return $view; + } + + /** + * Routing end-point for application behavior. + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param array $data Generic data + * + * @return RenderableInterface + * + * @since 1.0.0 + * @codeCoverageIgnore + */ + public function viewRepCreate(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface + { + $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); + + return $view; + } } diff --git a/Models/NullSalesRep.php b/Models/NullSalesRep.php new file mode 100644 index 0000000..2f1b4ed --- /dev/null +++ b/Models/NullSalesRep.php @@ -0,0 +1,47 @@ +id = $id; + parent::__construct(); + } + + /** + * {@inheritdoc} + */ + public function jsonSerialize() : mixed + { + return ['id' => $this->id]; + } +} diff --git a/Models/PermissionCategory.php b/Models/PermissionCategory.php index 43cd327..4788044 100755 --- a/Models/PermissionCategory.php +++ b/Models/PermissionCategory.php @@ -26,7 +26,7 @@ use phpOMS\Stdlib\Base\Enum; */ abstract class PermissionCategory extends Enum { - public const ARCHIVE = 1; + public const SALES_REP = 1; public const ANALYSIS = 2; } diff --git a/Models/SalesRep.php b/Models/SalesRep.php new file mode 100644 index 0000000..da76504 --- /dev/null +++ b/Models/SalesRep.php @@ -0,0 +1,57 @@ + + */ +final class SalesRepMapper extends DataMapperFactory +{ + /** + * Columns. + * + * @var array + * @since 1.0.0 + */ + public const COLUMNS = [ + 'sales_rep_id' => ['name' => 'sales_rep_id', 'type' => 'int', 'internal' => 'id'], + 'sales_rep_code' => ['name' => 'sales_rep_code', 'type' => 'string', 'internal' => 'code'], + 'sales_rep_main' => ['name' => 'sales_rep_main', 'type' => 'int', 'internal' => 'main'], + ]; + + /** + * Primary table. + * + * @var string + * @since 1.0.0 + */ + public const TABLE = 'sales_rep'; + + /** + * Primary field name. + * + * @var string + * @since 1.0.0 + */ + public const PRIMARYFIELD = 'sales_rep_id'; + + /** + * Has one relation. + * + * @var array + * @since 1.0.0 + */ + public const OWNS_ONE = [ + 'main' => [ + 'mapper' => AccountMapper::class, + 'external' => 'sales_rep_main', + ], + ]; + + /** + * Has many relation. + * + * @var array + * @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', + ], + ]; +} diff --git a/Theme/Backend/Lang/Navigation.ar.lang.php b/Theme/Backend/Lang/Navigation.ar.lang.php deleted file mode 100755 index c45bb52..0000000 --- a/Theme/Backend/Lang/Navigation.ar.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'التحليلات', - 'Articles' => 'مقالات', - 'Clients' => 'عملاء', - 'Create' => 'يخلق', - 'Invoice' => 'فاتورة', - 'Invoices' => 'الفواتير', - 'Profile' => 'الملف الشخصي', - 'Sales' => 'مبيعات', -]]; diff --git a/Theme/Backend/Lang/Navigation.cs.lang.php b/Theme/Backend/Lang/Navigation.cs.lang.php deleted file mode 100755 index 08f10c2..0000000 --- a/Theme/Backend/Lang/Navigation.cs.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Analýza', - 'Articles' => 'Články', - 'Clients' => 'Klienti', - 'Create' => 'Vytvořit', - 'Invoice' => 'Faktura', - 'Invoices' => 'Faktury', - 'Profile' => 'Profil', - 'Sales' => 'Odbyt', -]]; diff --git a/Theme/Backend/Lang/Navigation.da.lang.php b/Theme/Backend/Lang/Navigation.da.lang.php deleted file mode 100755 index 234cd8b..0000000 --- a/Theme/Backend/Lang/Navigation.da.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Analyse', - 'Articles' => 'Artikler', - 'Clients' => 'Klienter.', - 'Create' => 'skab', - 'Invoice' => 'Faktura', - 'Invoices' => 'Fakturaer.', - 'Profile' => 'Profil', - 'Sales' => 'SALG', -]]; diff --git a/Theme/Backend/Lang/Navigation.de.lang.php b/Theme/Backend/Lang/Navigation.de.lang.php index 1ea88e7..16e3d1a 100755 --- a/Theme/Backend/Lang/Navigation.de.lang.php +++ b/Theme/Backend/Lang/Navigation.de.lang.php @@ -13,12 +13,8 @@ declare(strict_types=1); return ['Navigation' => [ - 'Analysis' => 'Analyse', - 'Articles' => 'Artikel', - 'Clients' => 'Kunden', - 'Create' => 'Erstellen', - 'Invoice' => 'Rechnung', - 'Invoices' => 'Rechnungen', - 'Profile' => 'Profil', - 'Sales' => 'Umsatz', + 'Sales' => 'Verkauf', + 'SalesReps' => 'Verkäufer', + 'List' => 'Liste', + 'Create' => 'Erstellen', ]]; diff --git a/Theme/Backend/Lang/Navigation.el.lang.php b/Theme/Backend/Lang/Navigation.el.lang.php deleted file mode 100755 index 6863231..0000000 --- a/Theme/Backend/Lang/Navigation.el.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Ανάλυση', - 'Articles' => 'Είδη', - 'Clients' => 'Πελάτες', - 'Create' => 'Δημιουργώ', - 'Invoice' => 'Τιμολόγιο', - 'Invoices' => 'Τιμολόγια', - 'Profile' => 'Προφίλ', - 'Sales' => 'Εκπτώσεις', -]]; diff --git a/Theme/Backend/Lang/Navigation.en.lang.php b/Theme/Backend/Lang/Navigation.en.lang.php index ea53571..519f9c9 100755 --- a/Theme/Backend/Lang/Navigation.en.lang.php +++ b/Theme/Backend/Lang/Navigation.en.lang.php @@ -13,12 +13,8 @@ declare(strict_types=1); return ['Navigation' => [ - 'Analysis' => 'Analysis', - 'Articles' => 'Articles', - 'Clients' => 'Clients', - 'Create' => 'Create', - 'Invoice' => 'Invoice', - 'Invoices' => 'Invoices', - 'Profile' => 'Profile', 'Sales' => 'Sales', + 'SalesReps' => 'SalesReps', + 'List' => 'List', + 'Create' => 'Create', ]]; diff --git a/Theme/Backend/Lang/Navigation.es.lang.php b/Theme/Backend/Lang/Navigation.es.lang.php deleted file mode 100755 index 1afa369..0000000 --- a/Theme/Backend/Lang/Navigation.es.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Análisis', - 'Articles' => 'Artículos', - 'Clients' => 'Clientela', - 'Create' => 'Crear', - 'Invoice' => 'Factura', - 'Invoices' => 'Facturas', - 'Profile' => 'Perfil', - 'Sales' => 'Ventas', -]]; diff --git a/Theme/Backend/Lang/Navigation.fi.lang.php b/Theme/Backend/Lang/Navigation.fi.lang.php deleted file mode 100755 index dff984c..0000000 --- a/Theme/Backend/Lang/Navigation.fi.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Analyysi', - 'Articles' => 'Artikkelit', - 'Clients' => 'Asiakkaat', - 'Create' => 'Luoda', - 'Invoice' => 'Lasku', - 'Invoices' => 'Laskut', - 'Profile' => 'Profiili', - 'Sales' => 'Myynti', -]]; diff --git a/Theme/Backend/Lang/Navigation.fr.lang.php b/Theme/Backend/Lang/Navigation.fr.lang.php deleted file mode 100755 index d18130e..0000000 --- a/Theme/Backend/Lang/Navigation.fr.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Analyse', - 'Articles' => 'Des articles', - 'Clients' => 'Clients', - 'Create' => 'Créer', - 'Invoice' => 'Facture d\'achat', - 'Invoices' => 'Factures', - 'Profile' => 'Profil', - 'Sales' => 'Ventes', -]]; diff --git a/Theme/Backend/Lang/Navigation.hu.lang.php b/Theme/Backend/Lang/Navigation.hu.lang.php deleted file mode 100755 index f7e5baf..0000000 --- a/Theme/Backend/Lang/Navigation.hu.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Elemzés', - 'Articles' => 'Árucikkek', - 'Clients' => 'Kliensek', - 'Create' => 'Teremt', - 'Invoice' => 'Számla', - 'Invoices' => 'Számlák', - 'Profile' => 'Profil', - 'Sales' => 'Értékesítés', -]]; diff --git a/Theme/Backend/Lang/Navigation.it.lang.php b/Theme/Backend/Lang/Navigation.it.lang.php deleted file mode 100755 index 783a7e2..0000000 --- a/Theme/Backend/Lang/Navigation.it.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Analisi', - 'Articles' => 'Artificio', - 'Clients' => 'Clienti', - 'Create' => 'Creare', - 'Invoice' => 'Fattura', - 'Invoices' => 'Fatture', - 'Profile' => 'Profilo', - 'Sales' => 'Saldi', -]]; diff --git a/Theme/Backend/Lang/Navigation.ja.lang.php b/Theme/Backend/Lang/Navigation.ja.lang.php deleted file mode 100755 index 95909d5..0000000 --- a/Theme/Backend/Lang/Navigation.ja.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => '分析', - 'Articles' => 'articles', - 'Clients' => 'クライアント', - 'Create' => '作成', - 'Invoice' => '請求書', - 'Invoices' => '請求書', - 'Profile' => 'プロフィール', - 'Sales' => '売り返り', -]]; diff --git a/Theme/Backend/Lang/Navigation.ko.lang.php b/Theme/Backend/Lang/Navigation.ko.lang.php deleted file mode 100755 index 994b0a8..0000000 --- a/Theme/Backend/Lang/Navigation.ko.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => '분석', - 'Articles' => '조항', - 'Clients' => '클라이언트', - 'Create' => '만들다', - 'Invoice' => '송장', - 'Invoices' => '송장', - 'Profile' => '프로필', - 'Sales' => '매상', -]]; diff --git a/Theme/Backend/Lang/Navigation.no.lang.php b/Theme/Backend/Lang/Navigation.no.lang.php deleted file mode 100755 index 23da4f8..0000000 --- a/Theme/Backend/Lang/Navigation.no.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Analyse', - 'Articles' => 'Artikler', - 'Clients' => 'Klienter', - 'Create' => 'Skape', - 'Invoice' => 'Faktura', - 'Invoices' => 'Fakturaer', - 'Profile' => 'Profil', - 'Sales' => 'Salg', -]]; diff --git a/Theme/Backend/Lang/Navigation.pl.lang.php b/Theme/Backend/Lang/Navigation.pl.lang.php deleted file mode 100755 index 9e97b5f..0000000 --- a/Theme/Backend/Lang/Navigation.pl.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Analiza', - 'Articles' => 'Artykuły', - 'Clients' => 'Klienci.', - 'Create' => 'Tworzyć', - 'Invoice' => 'Faktura', - 'Invoices' => 'Faktury', - 'Profile' => 'Profil', - 'Sales' => 'Obroty', -]]; diff --git a/Theme/Backend/Lang/Navigation.pt.lang.php b/Theme/Backend/Lang/Navigation.pt.lang.php deleted file mode 100755 index d842851..0000000 --- a/Theme/Backend/Lang/Navigation.pt.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Análise', - 'Articles' => 'Artigos', - 'Clients' => 'Clientes', - 'Create' => 'Crio', - 'Invoice' => 'Fatura', - 'Invoices' => 'Faturas', - 'Profile' => 'Perfil', - 'Sales' => 'Vendas', -]]; diff --git a/Theme/Backend/Lang/Navigation.ru.lang.php b/Theme/Backend/Lang/Navigation.ru.lang.php deleted file mode 100755 index e5d6496..0000000 --- a/Theme/Backend/Lang/Navigation.ru.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Анализ', - 'Articles' => 'Статьи', - 'Clients' => 'Клиенты', - 'Create' => 'Создавать', - 'Invoice' => 'Счет', - 'Invoices' => 'Счета', - 'Profile' => 'Профиль', - 'Sales' => 'Продажи', -]]; diff --git a/Theme/Backend/Lang/Navigation.sv.lang.php b/Theme/Backend/Lang/Navigation.sv.lang.php deleted file mode 100755 index 5850b09..0000000 --- a/Theme/Backend/Lang/Navigation.sv.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Analys', - 'Articles' => 'Artiklar', - 'Clients' => 'Klienter', - 'Create' => 'Skapa', - 'Invoice' => 'Faktura', - 'Invoices' => 'Fakturor', - 'Profile' => 'Profil', - 'Sales' => 'Försäljning', -]]; diff --git a/Theme/Backend/Lang/Navigation.th.lang.php b/Theme/Backend/Lang/Navigation.th.lang.php deleted file mode 100755 index d9c237c..0000000 --- a/Theme/Backend/Lang/Navigation.th.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'การวิเคราะห์', - 'Articles' => 'บทความ', - 'Clients' => 'ลูกค้า', - 'Create' => 'สร้าง', - 'Invoice' => 'ใบแจ้งหนี้', - 'Invoices' => 'ใบแจ้งหนี้', - 'Profile' => 'ประวัติโดยย่อ', - 'Sales' => 'ฝ่ายขาย', -]]; diff --git a/Theme/Backend/Lang/Navigation.tr.lang.php b/Theme/Backend/Lang/Navigation.tr.lang.php deleted file mode 100755 index aa186e3..0000000 --- a/Theme/Backend/Lang/Navigation.tr.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Analiz', - 'Articles' => 'Nesne', - 'Clients' => 'Müşteriler', - 'Create' => 'Yaratmak', - 'Invoice' => 'Fatura', - 'Invoices' => 'Faturalar', - 'Profile' => 'Profil', - 'Sales' => 'Satış', -]]; diff --git a/Theme/Backend/Lang/Navigation.uk.lang.php b/Theme/Backend/Lang/Navigation.uk.lang.php deleted file mode 100755 index 7c1b8b0..0000000 --- a/Theme/Backend/Lang/Navigation.uk.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => 'Аналіз', - 'Articles' => 'Статті', - 'Clients' => 'Клієнти', - 'Create' => 'Створювати', - 'Invoice' => 'Рахунок-фактура', - 'Invoices' => 'Рахунки-фактури', - 'Profile' => 'Профіль', - 'Sales' => 'Продаж', -]]; diff --git a/Theme/Backend/Lang/Navigation.zh.lang.php b/Theme/Backend/Lang/Navigation.zh.lang.php deleted file mode 100755 index d35cb42..0000000 --- a/Theme/Backend/Lang/Navigation.zh.lang.php +++ /dev/null @@ -1,24 +0,0 @@ - [ - 'Analysis' => '分析', - 'Articles' => '文章', - 'Clients' => '客户', - 'Create' => '创建', - 'Invoice' => '发票', - 'Invoices' => '发票', - 'Profile' => '轮廓', - 'Sales' => '销售量', -]]; diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php index 8e9663e..81037a5 100755 --- a/Theme/Backend/Lang/de.lang.php +++ b/Theme/Backend/Lang/de.lang.php @@ -103,4 +103,6 @@ return ['Sales' => [ 'Turnover' => 'Umsatz', 'Type' => 'Typ', 'ZipCode' => 'Postleitzahl', + 'SalesRep' => 'Verkäufer', + 'SalesReps' => 'Verkäufer', ]]; diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 40cddf0..0eaf2cc 100755 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -103,4 +103,6 @@ return ['Sales' => [ 'Turnover' => 'Turnover', 'Type' => 'Type', 'ZipCode' => 'ZipCode', + 'SalesRep' => 'Sales Rep', + 'SalesReps' => 'Sales Reps', ]]; diff --git a/Theme/Backend/rep-list.tpl.php b/Theme/Backend/rep-list.tpl.php new file mode 100644 index 0000000..dab70f3 --- /dev/null +++ b/Theme/Backend/rep-list.tpl.php @@ -0,0 +1,51 @@ +data['rep']; + +$previous = empty($rep) ? '{/base}/sales/rep/list' : '{/base}/sales/rep/list?{?}&offset=' . \reset($rep)->id . '&ptype=p'; +$next = empty($rep) ? '{/base}/sales/rep/list' : '{/base}/sales/rep/list?{?}&offset=' . \end($rep)->id . '&ptype=n'; + +echo $this->data['nav']->render(); ?> +
+
+
+
getHtml('SalesReps'); ?>download
+ + + + + $value) : ++$count; + $url = UriFactory::build('{/base}/sales/rep/view?{?}&id=' . $value->id); ?> + +
getHtml('Code'); ?> + getHtml('Name'); ?> +
+ printHtml($value->code); ?> + + printHtml($value->main->name1); ?> printHtml($value->main->name2); ?> + + +
getHtml('Empty', '0', '0'); ?> + +
+
+
+
diff --git a/Theme/Backend/rep-view.tpl.php b/Theme/Backend/rep-view.tpl.php new file mode 100644 index 0000000..e69de29