mirror of
https://github.com/Karaka-Management/oms-Sales.git
synced 2026-02-08 08:18:40 +00:00
Went through todos
This commit is contained in:
parent
5a6a9f4ccb
commit
9f44be745c
|
|
@ -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": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
56
Admin/Install/db.json
Normal file
56
Admin/Install/db.json
Normal file
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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<string, bool>
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
47
Models/NullSalesRep.php
Normal file
47
Models/NullSalesRep.php
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Sales\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Sales\Models;
|
||||
|
||||
/**
|
||||
* Null model
|
||||
*
|
||||
* @package Modules\Sales\Models
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class NullSalesRep extends SalesRep
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param int $id Model id
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __construct(int $id = 0)
|
||||
{
|
||||
$this->id = $id;
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function jsonSerialize() : mixed
|
||||
{
|
||||
return ['id' => $this->id];
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
57
Models/SalesRep.php
Normal file
57
Models/SalesRep.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Sales\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Sales\Models;
|
||||
|
||||
use Modules\Admin\Models\Account;
|
||||
use Modules\Admin\Models\NullAccount;
|
||||
use Modules\Editor\Models\EditorDoc;
|
||||
use Modules\Payment\Models\Payment;
|
||||
use Modules\Profile\Models\Profile;
|
||||
use phpOMS\Stdlib\Base\Address;
|
||||
use phpOMS\Stdlib\Base\NullAddress;
|
||||
|
||||
/**
|
||||
* Sales rep class.
|
||||
*
|
||||
* @package Modules\Sales\Models
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*/
|
||||
class SalesRep
|
||||
{
|
||||
/**
|
||||
* ID value.
|
||||
*
|
||||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public int $id = 0;
|
||||
|
||||
public string $code = '';
|
||||
|
||||
public ?Account $main = null;
|
||||
|
||||
public array $accounts = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
}
|
||||
89
Models/SalesRepMapper.php
Normal file
89
Models/SalesRepMapper.php
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Sales\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Modules\Sales\Models;
|
||||
|
||||
use Modules\Admin\Models\AccountMapper;
|
||||
use Modules\Media\Models\MediaMapper;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* SalesRep mapper class.
|
||||
*
|
||||
* @package Modules\Sales\Models
|
||||
* @license OMS License 2.0
|
||||
* @link https://jingga.app
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @template T of SalesRep
|
||||
* @extends DataMapperFactory<T>
|
||||
*/
|
||||
final class SalesRepMapper extends DataMapperFactory
|
||||
{
|
||||
/**
|
||||
* Columns.
|
||||
*
|
||||
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?: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<string, array{mapper:class-string, external:string, by?:string, column?:string, conditional?:bool}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public const OWNS_ONE = [
|
||||
'main' => [
|
||||
'mapper' => AccountMapper::class,
|
||||
'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',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'التحليلات',
|
||||
'Articles' => 'مقالات',
|
||||
'Clients' => 'عملاء',
|
||||
'Create' => 'يخلق',
|
||||
'Invoice' => 'فاتورة',
|
||||
'Invoices' => 'الفواتير',
|
||||
'Profile' => 'الملف الشخصي',
|
||||
'Sales' => 'مبيعات',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Analýza',
|
||||
'Articles' => 'Články',
|
||||
'Clients' => 'Klienti',
|
||||
'Create' => 'Vytvořit',
|
||||
'Invoice' => 'Faktura',
|
||||
'Invoices' => 'Faktury',
|
||||
'Profile' => 'Profil',
|
||||
'Sales' => 'Odbyt',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Analyse',
|
||||
'Articles' => 'Artikler',
|
||||
'Clients' => 'Klienter.',
|
||||
'Create' => 'skab',
|
||||
'Invoice' => 'Faktura',
|
||||
'Invoices' => 'Fakturaer.',
|
||||
'Profile' => 'Profil',
|
||||
'Sales' => 'SALG',
|
||||
]];
|
||||
|
|
@ -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',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Ανάλυση',
|
||||
'Articles' => 'Είδη',
|
||||
'Clients' => 'Πελάτες',
|
||||
'Create' => 'Δημιουργώ',
|
||||
'Invoice' => 'Τιμολόγιο',
|
||||
'Invoices' => 'Τιμολόγια',
|
||||
'Profile' => 'Προφίλ',
|
||||
'Sales' => 'Εκπτώσεις',
|
||||
]];
|
||||
|
|
@ -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',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Análisis',
|
||||
'Articles' => 'Artículos',
|
||||
'Clients' => 'Clientela',
|
||||
'Create' => 'Crear',
|
||||
'Invoice' => 'Factura',
|
||||
'Invoices' => 'Facturas',
|
||||
'Profile' => 'Perfil',
|
||||
'Sales' => 'Ventas',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Analyysi',
|
||||
'Articles' => 'Artikkelit',
|
||||
'Clients' => 'Asiakkaat',
|
||||
'Create' => 'Luoda',
|
||||
'Invoice' => 'Lasku',
|
||||
'Invoices' => 'Laskut',
|
||||
'Profile' => 'Profiili',
|
||||
'Sales' => 'Myynti',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Analyse',
|
||||
'Articles' => 'Des articles',
|
||||
'Clients' => 'Clients',
|
||||
'Create' => 'Créer',
|
||||
'Invoice' => 'Facture d\'achat',
|
||||
'Invoices' => 'Factures',
|
||||
'Profile' => 'Profil',
|
||||
'Sales' => 'Ventes',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Elemzés',
|
||||
'Articles' => 'Árucikkek',
|
||||
'Clients' => 'Kliensek',
|
||||
'Create' => 'Teremt',
|
||||
'Invoice' => 'Számla',
|
||||
'Invoices' => 'Számlák',
|
||||
'Profile' => 'Profil',
|
||||
'Sales' => 'Értékesítés',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Analisi',
|
||||
'Articles' => 'Artificio',
|
||||
'Clients' => 'Clienti',
|
||||
'Create' => 'Creare',
|
||||
'Invoice' => 'Fattura',
|
||||
'Invoices' => 'Fatture',
|
||||
'Profile' => 'Profilo',
|
||||
'Sales' => 'Saldi',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => '分析',
|
||||
'Articles' => 'articles',
|
||||
'Clients' => 'クライアント',
|
||||
'Create' => '作成',
|
||||
'Invoice' => '請求書',
|
||||
'Invoices' => '請求書',
|
||||
'Profile' => 'プロフィール',
|
||||
'Sales' => '売り返り',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => '분석',
|
||||
'Articles' => '조항',
|
||||
'Clients' => '클라이언트',
|
||||
'Create' => '만들다',
|
||||
'Invoice' => '송장',
|
||||
'Invoices' => '송장',
|
||||
'Profile' => '프로필',
|
||||
'Sales' => '매상',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Analyse',
|
||||
'Articles' => 'Artikler',
|
||||
'Clients' => 'Klienter',
|
||||
'Create' => 'Skape',
|
||||
'Invoice' => 'Faktura',
|
||||
'Invoices' => 'Fakturaer',
|
||||
'Profile' => 'Profil',
|
||||
'Sales' => 'Salg',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Analiza',
|
||||
'Articles' => 'Artykuły',
|
||||
'Clients' => 'Klienci.',
|
||||
'Create' => 'Tworzyć',
|
||||
'Invoice' => 'Faktura',
|
||||
'Invoices' => 'Faktury',
|
||||
'Profile' => 'Profil',
|
||||
'Sales' => 'Obroty',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Análise',
|
||||
'Articles' => 'Artigos',
|
||||
'Clients' => 'Clientes',
|
||||
'Create' => 'Crio',
|
||||
'Invoice' => 'Fatura',
|
||||
'Invoices' => 'Faturas',
|
||||
'Profile' => 'Perfil',
|
||||
'Sales' => 'Vendas',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Анализ',
|
||||
'Articles' => 'Статьи',
|
||||
'Clients' => 'Клиенты',
|
||||
'Create' => 'Создавать',
|
||||
'Invoice' => 'Счет',
|
||||
'Invoices' => 'Счета',
|
||||
'Profile' => 'Профиль',
|
||||
'Sales' => 'Продажи',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Analys',
|
||||
'Articles' => 'Artiklar',
|
||||
'Clients' => 'Klienter',
|
||||
'Create' => 'Skapa',
|
||||
'Invoice' => 'Faktura',
|
||||
'Invoices' => 'Fakturor',
|
||||
'Profile' => 'Profil',
|
||||
'Sales' => 'Försäljning',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'การวิเคราะห์',
|
||||
'Articles' => 'บทความ',
|
||||
'Clients' => 'ลูกค้า',
|
||||
'Create' => 'สร้าง',
|
||||
'Invoice' => 'ใบแจ้งหนี้',
|
||||
'Invoices' => 'ใบแจ้งหนี้',
|
||||
'Profile' => 'ประวัติโดยย่อ',
|
||||
'Sales' => 'ฝ่ายขาย',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Analiz',
|
||||
'Articles' => 'Nesne',
|
||||
'Clients' => 'Müşteriler',
|
||||
'Create' => 'Yaratmak',
|
||||
'Invoice' => 'Fatura',
|
||||
'Invoices' => 'Faturalar',
|
||||
'Profile' => 'Profil',
|
||||
'Sales' => 'Satış',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => 'Аналіз',
|
||||
'Articles' => 'Статті',
|
||||
'Clients' => 'Клієнти',
|
||||
'Create' => 'Створювати',
|
||||
'Invoice' => 'Рахунок-фактура',
|
||||
'Invoices' => 'Рахунки-фактури',
|
||||
'Profile' => 'Профіль',
|
||||
'Sales' => 'Продаж',
|
||||
]];
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return ['Navigation' => [
|
||||
'Analysis' => '分析',
|
||||
'Articles' => '文章',
|
||||
'Clients' => '客户',
|
||||
'Create' => '创建',
|
||||
'Invoice' => '发票',
|
||||
'Invoices' => '发票',
|
||||
'Profile' => '轮廓',
|
||||
'Sales' => '销售量',
|
||||
]];
|
||||
|
|
@ -103,4 +103,6 @@ return ['Sales' => [
|
|||
'Turnover' => 'Umsatz',
|
||||
'Type' => 'Typ',
|
||||
'ZipCode' => 'Postleitzahl',
|
||||
'SalesRep' => 'Verkäufer',
|
||||
'SalesReps' => 'Verkäufer',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -103,4 +103,6 @@ return ['Sales' => [
|
|||
'Turnover' => 'Turnover',
|
||||
'Type' => 'Type',
|
||||
'ZipCode' => 'ZipCode',
|
||||
'SalesRep' => 'Sales Rep',
|
||||
'SalesReps' => 'Sales Reps',
|
||||
]];
|
||||
|
|
|
|||
51
Theme/Backend/rep-list.tpl.php
Normal file
51
Theme/Backend/rep-list.tpl.php
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
<?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 phpOMS\Uri\UriFactory;
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
* @var \Modules\Sales\Models\SalesRep[] $rep
|
||||
*/
|
||||
$rep = $this->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(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('SalesReps'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||
<table class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('Code'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Name'); ?>
|
||||
<tbody>
|
||||
<?php $count = 0; foreach ($rep as $key => $value) : ++$count;
|
||||
$url = UriFactory::build('{/base}/sales/rep/view?{?}&id=' . $value->id); ?>
|
||||
<tr tabindex="0" data-href="<?= $url; ?>">
|
||||
<td data-label="<?= $this->getHtml('Code'); ?>"><a href="<?= $url; ?>">
|
||||
<?= $this->printHtml($value->code); ?></a>
|
||||
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>">
|
||||
<?= $this->printHtml($value->main->name1); ?> <?= $this->printHtml($value->main->name2); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
0
Theme/Backend/rep-view.tpl.php
Normal file
0
Theme/Backend/rep-view.tpl.php
Normal file
Loading…
Reference in New Issue
Block a user