mirror of
https://github.com/Karaka-Management/oms-ItemManagement.git
synced 2026-02-15 11:48:40 +00:00
auto fixes + some impl.
This commit is contained in:
parent
e95dcdbd2a
commit
a5ce0aea7d
|
|
@ -93,7 +93,7 @@
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "Item",
|
"name": "Item",
|
||||||
"uri": "{/base}/item/profile?{?}",
|
"uri": "{/base}/item/view?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 1,
|
"order": 1,
|
||||||
|
|
@ -172,7 +172,7 @@
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "Item",
|
"name": "Item",
|
||||||
"uri": "{/base}/sales/item/single?{?}",
|
"uri": "{/base}/sales/item/view?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 1,
|
"order": 1,
|
||||||
|
|
@ -234,7 +234,7 @@
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "Item",
|
"name": "Item",
|
||||||
"uri": "{/base}/purchase/item/single?{?}",
|
"uri": "{/base}/purchase/item/view?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 1,
|
"order": 1,
|
||||||
|
|
@ -296,7 +296,7 @@
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "Item",
|
"name": "Item",
|
||||||
"uri": "{/base}/warehouse/item/single?{?}",
|
"uri": "{/base}/warehouse/item/view?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 1,
|
"order": 1,
|
||||||
|
|
@ -358,7 +358,7 @@
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "Item",
|
"name": "Item",
|
||||||
"uri": "{/base}/production/item/single?{?}",
|
"uri": "{/base}/production/item/view?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 1,
|
"order": 1,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,30 @@
|
||||||
[
|
[
|
||||||
|
{
|
||||||
|
"name": "default_sales_container",
|
||||||
|
"l11n": {
|
||||||
|
"en": "Default sales container",
|
||||||
|
"de": "Standard Verkaufsgebinde"
|
||||||
|
},
|
||||||
|
"value_type": 1,
|
||||||
|
"is_custom_allowed": true,
|
||||||
|
"validation_pattern": "",
|
||||||
|
"is_required": true,
|
||||||
|
"default_value": "",
|
||||||
|
"values": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "default_purchase_container",
|
||||||
|
"l11n": {
|
||||||
|
"en": "Default purchase container",
|
||||||
|
"de": "Standard Einkaufsgebinde"
|
||||||
|
},
|
||||||
|
"value_type": 1,
|
||||||
|
"is_custom_allowed": true,
|
||||||
|
"validation_pattern": "",
|
||||||
|
"is_required": true,
|
||||||
|
"default_value": "",
|
||||||
|
"values": []
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "primary_supplier",
|
"name": "primary_supplier",
|
||||||
"l11n": {
|
"l11n": {
|
||||||
|
|
@ -1373,5 +1399,33 @@
|
||||||
"value": "III"
|
"value": "III"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "costcenter",
|
||||||
|
"l11n": {
|
||||||
|
"en": "Cost Center",
|
||||||
|
"de": "Kostenstelle"
|
||||||
|
},
|
||||||
|
"value_type": 2,
|
||||||
|
"is_custom_allowed": false,
|
||||||
|
"validation_pattern": "",
|
||||||
|
"is_required": false,
|
||||||
|
"internal": true,
|
||||||
|
"default_value": "",
|
||||||
|
"values": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "costobject",
|
||||||
|
"l11n": {
|
||||||
|
"en": "Cost Center",
|
||||||
|
"de": "Kostenstelle"
|
||||||
|
},
|
||||||
|
"value_type": 2,
|
||||||
|
"is_custom_allowed": false,
|
||||||
|
"validation_pattern": "",
|
||||||
|
"is_required": false,
|
||||||
|
"internal": true,
|
||||||
|
"default_value": "",
|
||||||
|
"values": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -128,11 +128,21 @@
|
||||||
"type": "VARCHAR(255)",
|
"type": "VARCHAR(255)",
|
||||||
"null": false
|
"null": false
|
||||||
},
|
},
|
||||||
|
"itemmgmt_item_container_unit": {
|
||||||
|
"name": "itemmgmt_item_container_unit",
|
||||||
|
"type": "VARCHAR(255)",
|
||||||
|
"null": false
|
||||||
|
},
|
||||||
"itemmgmt_item_container_quantity": {
|
"itemmgmt_item_container_quantity": {
|
||||||
"name": "itemmgmt_item_container_quantity",
|
"name": "itemmgmt_item_container_quantity",
|
||||||
"type": "INT",
|
"type": "INT",
|
||||||
"null": false
|
"null": false
|
||||||
},
|
},
|
||||||
|
"itemmgmt_item_container_decimals": {
|
||||||
|
"name": "itemmgmt_item_container_decimals",
|
||||||
|
"type": "TINYINT(1)",
|
||||||
|
"null": false
|
||||||
|
},
|
||||||
"itemmgmt_item_container_weight": {
|
"itemmgmt_item_container_weight": {
|
||||||
"name": "itemmgmt_item_container_weight",
|
"name": "itemmgmt_item_container_weight",
|
||||||
"type": "INT",
|
"type": "INT",
|
||||||
|
|
@ -362,6 +372,11 @@
|
||||||
"type": "TINYINT(1)",
|
"type": "TINYINT(1)",
|
||||||
"null": false
|
"null": false
|
||||||
},
|
},
|
||||||
|
"itemmgmt_attr_type_internal": {
|
||||||
|
"name": "itemmgmt_attr_type_internal",
|
||||||
|
"type": "TINYINT(1)",
|
||||||
|
"null": false
|
||||||
|
},
|
||||||
"itemmgmt_attr_type_required": {
|
"itemmgmt_attr_type_required": {
|
||||||
"description": "Every item must have this attribute type if set to true.",
|
"description": "Every item must have this attribute type if set to true.",
|
||||||
"name": "itemmgmt_attr_type_required",
|
"name": "itemmgmt_attr_type_required",
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ use phpOMS\Message\Http\HttpRequest;
|
||||||
use phpOMS\Message\Http\HttpResponse;
|
use phpOMS\Message\Http\HttpResponse;
|
||||||
use phpOMS\Module\InstallerAbstract;
|
use phpOMS\Module\InstallerAbstract;
|
||||||
use phpOMS\Module\ModuleInfo;
|
use phpOMS\Module\ModuleInfo;
|
||||||
use phpOMS\Uri\HttpUri;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Installer class.
|
* Installer class.
|
||||||
|
|
@ -50,8 +49,6 @@ final class Installer extends InstallerAbstract
|
||||||
{
|
{
|
||||||
parent::install($app, $info, $cfgHandler);
|
parent::install($app, $info, $cfgHandler);
|
||||||
|
|
||||||
\Modules\Admin\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Install/Admin.install.json']);
|
|
||||||
|
|
||||||
/* Attributes */
|
/* Attributes */
|
||||||
$fileContent = \file_get_contents(__DIR__ . '/Install/attributes.json');
|
$fileContent = \file_get_contents(__DIR__ . '/Install/attributes.json');
|
||||||
if ($fileContent === false) {
|
if ($fileContent === false) {
|
||||||
|
|
@ -63,6 +60,16 @@ final class Installer extends InstallerAbstract
|
||||||
$attrTypes = self::createAttributeTypes($app, $attributes);
|
$attrTypes = self::createAttributeTypes($app, $attributes);
|
||||||
$attrValues = self::createAttributeValues($app, $attrTypes, $attributes);
|
$attrValues = self::createAttributeValues($app, $attrTypes, $attributes);
|
||||||
|
|
||||||
|
$data = \json_decode(\file_get_contents(__DIR__ . '/Install/Admin.install.json'), true);
|
||||||
|
$content = \json_decode($data[0]['content'], true);
|
||||||
|
|
||||||
|
foreach ($content as $type => $_) {
|
||||||
|
$content[$type] = \reset($attrValues[$type])['id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$data[0]['content'] = \json_encode($content);
|
||||||
|
\Modules\Admin\Admin\Installer::createSettings($app, $data[0]);
|
||||||
|
|
||||||
/* Localizations */
|
/* Localizations */
|
||||||
$fileContent = \file_get_contents(__DIR__ . '/Install/localizations.json');
|
$fileContent = \file_get_contents(__DIR__ . '/Install/localizations.json');
|
||||||
if ($fileContent === false) {
|
if ($fileContent === false) {
|
||||||
|
|
@ -100,7 +107,7 @@ final class Installer extends InstallerAbstract
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var array $types */
|
/** @var array $types */
|
||||||
$types = \json_decode($fileContent, true);
|
$types = \json_decode($fileContent, true);
|
||||||
$materialTypeArray = self::createMaterialTypes($app, $types);
|
$materialTypeArray = self::createMaterialTypes($app, $types);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -141,7 +148,7 @@ final class Installer extends InstallerAbstract
|
||||||
|
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('number', (string) $item['number']);
|
$request->setData('number', (string) $item['number']);
|
||||||
|
|
@ -164,13 +171,13 @@ final class Installer extends InstallerAbstract
|
||||||
|
|
||||||
foreach ($l11ns as $language => $l11n) {
|
foreach ($l11ns as $language => $l11n) {
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('item', $itemId);
|
$request->setData('item', $itemId);
|
||||||
$request->setData('type', $l11nType->id);
|
$request->setData('type', $l11nType->id);
|
||||||
|
$request->setData('content', (string) $l11n);
|
||||||
$request->setData('language', (string) $language);
|
$request->setData('language', (string) $language);
|
||||||
$request->setData('description', (string) $l11n);
|
|
||||||
|
|
||||||
$module->apiItemL11nCreate($request, $response);
|
$module->apiItemL11nCreate($request, $response);
|
||||||
}
|
}
|
||||||
|
|
@ -180,7 +187,7 @@ final class Installer extends InstallerAbstract
|
||||||
$attrType = $attributeTypes[$attribute['type']];
|
$attrType = $attributeTypes[$attribute['type']];
|
||||||
|
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('ref', $itemId);
|
$request->setData('ref', $itemId);
|
||||||
|
|
@ -243,7 +250,7 @@ final class Installer extends InstallerAbstract
|
||||||
|
|
||||||
foreach ($l11ns as $l11n) {
|
foreach ($l11ns as $l11n) {
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('title', $l11n['name']);
|
$request->setData('title', $l11n['name']);
|
||||||
|
|
@ -284,7 +291,7 @@ final class Installer extends InstallerAbstract
|
||||||
|
|
||||||
foreach ($rels as $rel) {
|
foreach ($rels as $rel) {
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('title', $rel['name']);
|
$request->setData('title', $rel['name']);
|
||||||
|
|
@ -325,12 +332,14 @@ final class Installer extends InstallerAbstract
|
||||||
/** @var array $attribute */
|
/** @var array $attribute */
|
||||||
foreach ($attributes as $attribute) {
|
foreach ($attributes as $attribute) {
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('name', $attribute['name'] ?? '');
|
$request->setData('name', $attribute['name'] ?? '');
|
||||||
$request->setData('title', \reset($attribute['l11n']));
|
$request->setData('title', \reset($attribute['l11n']));
|
||||||
$request->setData('language', \array_keys($attribute['l11n'])[0] ?? 'en');
|
$request->setData('language', \array_keys($attribute['l11n'])[0] ?? 'en');
|
||||||
|
$request->setData('repeatable', $attribute['repeatable'] ?? false);
|
||||||
|
$request->setData('internal', $attribute['internal'] ?? false);
|
||||||
$request->setData('is_required', $attribute['is_required'] ?? false);
|
$request->setData('is_required', $attribute['is_required'] ?? false);
|
||||||
$request->setData('custom', $attribute['is_custom_allowed'] ?? false);
|
$request->setData('custom', $attribute['is_custom_allowed'] ?? false);
|
||||||
$request->setData('validation_pattern', $attribute['validation_pattern'] ?? '');
|
$request->setData('validation_pattern', $attribute['validation_pattern'] ?? '');
|
||||||
|
|
@ -355,7 +364,7 @@ final class Installer extends InstallerAbstract
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('title', $l11n);
|
$request->setData('title', $l11n);
|
||||||
|
|
@ -394,7 +403,7 @@ final class Installer extends InstallerAbstract
|
||||||
/** @var array $value */
|
/** @var array $value */
|
||||||
foreach ($attribute['values'] as $value) {
|
foreach ($attribute['values'] as $value) {
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('value', $value['value'] ?? '');
|
$request->setData('value', $value['value'] ?? '');
|
||||||
|
|
@ -428,7 +437,7 @@ final class Installer extends InstallerAbstract
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('title', $l11n);
|
$request->setData('title', $l11n);
|
||||||
|
|
@ -464,7 +473,7 @@ final class Installer extends InstallerAbstract
|
||||||
/** @var array $type */
|
/** @var array $type */
|
||||||
foreach ($types as $type) {
|
foreach ($types as $type) {
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('name', $type['name'] ?? '');
|
$request->setData('name', $type['name'] ?? '');
|
||||||
|
|
@ -489,7 +498,7 @@ final class Installer extends InstallerAbstract
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('title', $l11n);
|
$request->setData('title', $l11n);
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType;
|
||||||
use phpOMS\Router\RouteVerb;
|
use phpOMS\Router\RouteVerb;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'^.*/item/find.*$' => [
|
'^.*/item/find(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\ApiController:apiItemFind',
|
'dest' => '\Modules\ItemManagement\Controller\ApiController:apiItemFind',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType;
|
||||||
use phpOMS\Router\RouteVerb;
|
use phpOMS\Router\RouteVerb;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'^.*/item/attribute/type/list.*$' => [
|
'^.*/item/attribute/type/list(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementAttributeTypeList',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementAttributeTypeList',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -29,7 +29,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/item/attribute/type\?.*$' => [
|
'^.*/item/attribute/type(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementAttributeType',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementAttributeType',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -40,7 +40,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/item/attribute/value.*$' => [
|
'^.*/item/attribute/value(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementAttributeValues',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementAttributeValues',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -51,7 +51,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^/item/list.*$' => [
|
'^/item/list(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementItemList',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementItemList',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -62,7 +62,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^/item/create.*$' => [
|
'^/item/create(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementItemCreate',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementItemCreate',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -73,7 +73,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^/item/profile.*$' => [
|
'^/item/view(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementItem',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementItem',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -85,7 +85,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
'^.*/sales/item/list.*$' => [
|
'^.*/sales/item/list(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementSalesList',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementSalesList',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -96,7 +96,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/sales/item/create.*$' => [
|
'^.*/sales/item/create(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementSalesCreate',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementSalesCreate',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -107,7 +107,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/sales/item/profile.*$' => [
|
'^.*/sales/item/view(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementSalesItem',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementSalesItem',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -119,7 +119,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
'^.*/purchase/item/list.*$' => [
|
'^.*/purchase/item/list(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementPurchaseList',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementPurchaseList',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -130,7 +130,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/purchase/item/create.*$' => [
|
'^.*/purchase/item/create(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementPurchaseCreate',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementPurchaseCreate',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -141,7 +141,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/purchase/item/profile.*$' => [
|
'^.*/purchase/item/view(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementPurchaseItem',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementPurchaseItem',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -153,7 +153,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
'^.*/warehouse/item/list.*$' => [
|
'^.*/warehouse/item/list(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementWarehousingList',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementWarehousingList',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -164,7 +164,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'.*/warehouse/item/create.*$' => [
|
'.*/warehouse/item/create(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementWarehousingCreate',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementWarehousingCreate',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -175,7 +175,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/warehouse/item/profile.*$' => [
|
'^.*/warehouse/item/view(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementWarehouseItem',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementWarehouseItem',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -186,7 +186,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/purchase/analysis/item(\?.*|$)$' => [
|
'^.*/purchase/analysis/item(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemPurchaseAnalysis',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemPurchaseAnalysis',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -197,7 +197,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/item/material/list\?.*$' => [
|
'^.*/item/material/list(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemMaterialList',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemMaterialList',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -208,7 +208,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/item/material/view\?.*$' => [
|
'^.*/item/material/view(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemMaterialView',
|
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemMaterialView',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
|
||||||
|
|
@ -61,12 +61,15 @@ final class ApiAttributeController extends Controller
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$type = ItemAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('type'))->execute();
|
$type = ItemAttributeTypeMapper::get()
|
||||||
|
->with('defaults')
|
||||||
|
->where('id', (int) $request->getData('type'))
|
||||||
|
->execute();
|
||||||
|
|
||||||
if (!$type->repeatable) {
|
if (!$type->repeatable) {
|
||||||
$attr = ItemAttributeMapper::count()
|
$attr = ItemAttributeMapper::count()
|
||||||
->with('type')
|
->with('type')
|
||||||
->where('type/id', (int) $request->getData('type'))
|
->where('type/id', $type->id)
|
||||||
->where('ref', (int) $request->getData('ref'))
|
->where('ref', (int) $request->getData('ref'))
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
|
|
@ -164,13 +167,20 @@ final class ApiAttributeController extends Controller
|
||||||
->where('id', $request->getDataInt('type') ?? 0)
|
->where('id', $request->getDataInt('type') ?? 0)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
|
if ($type->isInternal) {
|
||||||
|
$response->header->status = RequestStatusCode::R_403;
|
||||||
|
$this->createInvalidCreateResponse($request, $response, $val);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$attrValue = $this->createAttributeValueFromRequest($request, $type);
|
$attrValue = $this->createAttributeValueFromRequest($request, $type);
|
||||||
$this->createModel($request->header->account, $attrValue, ItemAttributeValueMapper::class, 'attr_value', $request->getOrigin());
|
$this->createModel($request->header->account, $attrValue, ItemAttributeValueMapper::class, 'attr_value', $request->getOrigin());
|
||||||
|
|
||||||
if ($attrValue->isDefault) {
|
if ($attrValue->isDefault) {
|
||||||
$this->createModelRelation(
|
$this->createModelRelation(
|
||||||
$request->header->account,
|
$request->header->account,
|
||||||
(int) $request->getData('type'),
|
$type->id,
|
||||||
$attrValue->id,
|
$attrValue->id,
|
||||||
ItemAttributeTypeMapper::class, 'defaults', '', $request->getOrigin()
|
ItemAttributeTypeMapper::class, 'defaults', '', $request->getOrigin()
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,13 @@ declare(strict_types=1);
|
||||||
namespace Modules\ItemManagement\Controller;
|
namespace Modules\ItemManagement\Controller;
|
||||||
|
|
||||||
use Modules\Admin\Models\NullAccount;
|
use Modules\Admin\Models\NullAccount;
|
||||||
|
use Modules\Billing\Models\Price\PriceType;
|
||||||
use Modules\ItemManagement\Models\Attribute\ItemAttributeTypeMapper;
|
use Modules\ItemManagement\Models\Attribute\ItemAttributeTypeMapper;
|
||||||
|
use Modules\ItemManagement\Models\Container;
|
||||||
use Modules\ItemManagement\Models\Item;
|
use Modules\ItemManagement\Models\Item;
|
||||||
use Modules\ItemManagement\Models\ItemL11nMapper;
|
use Modules\ItemManagement\Models\ItemL11nMapper;
|
||||||
use Modules\ItemManagement\Models\ItemL11nTypeMapper;
|
use Modules\ItemManagement\Models\ItemL11nTypeMapper;
|
||||||
use Modules\ItemManagement\Models\ItemMapper;
|
use Modules\ItemManagement\Models\ItemMapper;
|
||||||
use Modules\ItemManagement\Models\ItemPrice;
|
|
||||||
use Modules\ItemManagement\Models\ItemPriceStatus;
|
|
||||||
use Modules\ItemManagement\Models\ItemRelationType;
|
use Modules\ItemManagement\Models\ItemRelationType;
|
||||||
use Modules\ItemManagement\Models\ItemRelationTypeMapper;
|
use Modules\ItemManagement\Models\ItemRelationTypeMapper;
|
||||||
use Modules\ItemManagement\Models\ItemStatus;
|
use Modules\ItemManagement\Models\ItemStatus;
|
||||||
|
|
@ -38,7 +38,6 @@ use Modules\Media\Models\PathSettings;
|
||||||
use phpOMS\Account\PermissionType;
|
use phpOMS\Account\PermissionType;
|
||||||
use phpOMS\Localization\BaseStringL11n;
|
use phpOMS\Localization\BaseStringL11n;
|
||||||
use phpOMS\Localization\BaseStringL11nType;
|
use phpOMS\Localization\BaseStringL11nType;
|
||||||
use phpOMS\Localization\ISO4217CharEnum;
|
|
||||||
use phpOMS\Localization\ISO639x1Enum;
|
use phpOMS\Localization\ISO639x1Enum;
|
||||||
use phpOMS\Localization\NullBaseStringL11nType;
|
use phpOMS\Localization\NullBaseStringL11nType;
|
||||||
use phpOMS\Message\Http\HttpRequest;
|
use phpOMS\Message\Http\HttpRequest;
|
||||||
|
|
@ -50,7 +49,6 @@ use phpOMS\Message\ResponseAbstract;
|
||||||
use phpOMS\Model\Message\FormValidation;
|
use phpOMS\Model\Message\FormValidation;
|
||||||
use phpOMS\Stdlib\Base\FloatInt;
|
use phpOMS\Stdlib\Base\FloatInt;
|
||||||
use phpOMS\System\MimeType;
|
use phpOMS\System\MimeType;
|
||||||
use phpOMS\Uri\HttpUri;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ItemManagement class.
|
* ItemManagement class.
|
||||||
|
|
@ -165,22 +163,52 @@ final class ApiController extends Controller
|
||||||
$this->createModel($request->header->account, $item, ItemMapper::class, 'item', $request->getOrigin());
|
$this->createModel($request->header->account, $item, ItemMapper::class, 'item', $request->getOrigin());
|
||||||
$this->app->dbPool->get()->con->commit();
|
$this->app->dbPool->get()->con->commit();
|
||||||
|
|
||||||
if ($this->app->moduleManager->isActive('Billing')) {
|
// Define default item containers
|
||||||
$billing = $this->app->moduleManager->get('Billing');
|
$types = ItemAttributeTypeMapper::getAll()
|
||||||
|
->where('name', ['default_sales_container', 'default_purchase_container'], 'IN')
|
||||||
|
->execute();
|
||||||
|
|
||||||
$internalRequest = new HttpRequest(new HttpUri(''));
|
foreach ($types as $type) {
|
||||||
|
$internalResponse = clone $response;
|
||||||
|
$internalRequest = new HttpRequest();
|
||||||
|
|
||||||
|
$internalRequest->header->account = $request->header->account;
|
||||||
|
$internalRequest->setData('ref', $item->id);
|
||||||
|
$internalRequest->setData('type', $type->id);
|
||||||
|
$internalRequest->setData('value', \reset($item->container)->id);
|
||||||
|
|
||||||
|
$this->app->moduleManager->get('ItemManagement', 'ApiAttribute')->apiItemAttributeCreate($internalRequest, $internalResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->app->moduleManager->isActive('Billing')) {
|
||||||
|
$billing = $this->app->moduleManager->get('Billing', 'ApiPrice');
|
||||||
|
|
||||||
|
// Sales price
|
||||||
|
$internalRequest = new HttpRequest();
|
||||||
$internalResponse = new HttpResponse();
|
$internalResponse = new HttpResponse();
|
||||||
|
|
||||||
$internalRequest->header->account = $request->header->account;
|
$internalRequest->header->account = $request->header->account;
|
||||||
$internalRequest->setData('name', 'base');
|
$internalRequest->setData('name', 'default');
|
||||||
|
$internalRequest->setData('type', PriceType::SALES);
|
||||||
$internalRequest->setData('item', $item->id);
|
$internalRequest->setData('item', $item->id);
|
||||||
$internalRequest->setData('price_new', $request->getDataInt('salesprice') ?? 0);
|
$internalRequest->setData('price_new', $request->getDataString('salesprice') ?? 0);
|
||||||
|
|
||||||
|
$billing->apiPriceCreate($internalRequest, $internalResponse);
|
||||||
|
|
||||||
|
// Purchase price
|
||||||
|
$internalRequest = new HttpRequest();
|
||||||
|
$internalResponse = new HttpResponse();
|
||||||
|
|
||||||
|
$internalRequest->header->account = $request->header->account;
|
||||||
|
$internalRequest->setData('name', 'default');
|
||||||
|
$internalRequest->setData('type', PriceType::PURCHASE);
|
||||||
|
$internalRequest->setData('item', $item->id);
|
||||||
|
$internalRequest->setData('price_new', $request->getDataString('purchaseprice') ?? 0);
|
||||||
|
|
||||||
$billing->apiPriceCreate($internalRequest, $internalResponse);
|
$billing->apiPriceCreate($internalRequest, $internalResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->createMediaDirForItem($item->number, $request->header->account);
|
$this->createMediaDirForItem($item->number, $request->header->account);
|
||||||
|
|
||||||
$path = $this->createItemDir($item);
|
$path = $this->createItemDir($item);
|
||||||
|
|
||||||
$uploadedFiles = $request->files['item_profile_image'] ?? [];
|
$uploadedFiles = $request->files['item_profile_image'] ?? [];
|
||||||
|
|
@ -239,13 +267,13 @@ final class ApiController extends Controller
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$types = ItemAttributeTypeMapper::get()
|
$types = ItemAttributeTypeMapper::getAll()
|
||||||
->where('name', \array_keys($segmentation), 'IN')
|
->where('name', \array_keys($segmentation), 'IN')
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
foreach ($types as $type) {
|
foreach ($types as $type) {
|
||||||
$internalResponse = clone $response;
|
$internalResponse = clone $response;
|
||||||
$internalRequest = new HttpRequest(new HttpUri(''));
|
$internalRequest = new HttpRequest();
|
||||||
|
|
||||||
$internalRequest->header->account = $request->header->account;
|
$internalRequest->header->account = $request->header->account;
|
||||||
$internalRequest->setData('ref', $item->id);
|
$internalRequest->setData('ref', $item->id);
|
||||||
|
|
@ -290,15 +318,21 @@ final class ApiController extends Controller
|
||||||
*/
|
*/
|
||||||
private function createItemFromRequest(RequestAbstract $request) : Item
|
private function createItemFromRequest(RequestAbstract $request) : Item
|
||||||
{
|
{
|
||||||
$item = new Item();
|
$item = new Item();
|
||||||
$item->number = $request->getDataString('number') ?? '';
|
$item->number = $request->getDataString('number') ?? '';
|
||||||
$item->stockIdentifier = $request->getDataInt('stockidentifier') ?? StockIdentifierType::NONE;
|
$item->stockIdentifier = $request->getDataInt('stockidentifier') ?? StockIdentifierType::NONE;
|
||||||
$item->salesPrice = new FloatInt($request->getDataInt('salesprice') ?? 0);
|
$item->salesPrice = new FloatInt($request->getDataString('salesprice') ?? 0);
|
||||||
$item->purchasePrice = new FloatInt($request->getDataInt('purchaseprice') ?? 0);
|
$item->purchasePrice = new FloatInt($request->getDataString('purchaseprice') ?? 0);
|
||||||
$item->info = $request->getDataString('info') ?? '';
|
$item->info = $request->getDataString('info') ?? '';
|
||||||
$item->parent = $request->getDataInt('parent');
|
$item->parent = $request->getDataInt('parent');
|
||||||
$item->unit = $request->getDataInt('unit');
|
$item->unit = $request->getDataInt('unit');
|
||||||
$item->setStatus($request->getDataInt('status') ?? ItemStatus::ACTIVE);
|
$item->status = ItemStatus::tryFromValue($request->getDataInt('status')) ?? ItemStatus::ACTIVE;
|
||||||
|
|
||||||
|
$container = new Container();
|
||||||
|
$container->name = 'default';
|
||||||
|
$container->quantity = \pow(10, FloatInt::MAX_DECIMALS);
|
||||||
|
|
||||||
|
$item->container[] = $container;
|
||||||
|
|
||||||
return $item;
|
return $item;
|
||||||
}
|
}
|
||||||
|
|
@ -322,81 +356,6 @@ final class ApiController extends Controller
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Api method to create item
|
|
||||||
*
|
|
||||||
* @param RequestAbstract $request Request
|
|
||||||
* @param ResponseAbstract $response Response
|
|
||||||
* @param array $data Generic data
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @api
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function apiItemPriceCreate(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void
|
|
||||||
{
|
|
||||||
if (!empty($val = $this->validateItemPriceCreate($request))) {
|
|
||||||
$response->header->status = RequestStatusCode::R_400;
|
|
||||||
$this->createInvalidCreateResponse($request, $response, $val);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$item = $this->createItemPriceFromRequest($request);
|
|
||||||
$this->createModel($request->header->account, $item, ItemMapper::class, 'item', $request->getOrigin());
|
|
||||||
$this->createStandardCreateResponse($request, $response, $item);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Method to create item from request.
|
|
||||||
*
|
|
||||||
* @param RequestAbstract $request Request
|
|
||||||
*
|
|
||||||
* @return ItemPrice
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private function createItemPriceFromRequest(RequestAbstract $request) : ItemPrice
|
|
||||||
{
|
|
||||||
$item = new ItemPrice();
|
|
||||||
$item->currency = $request->getDataString('currency') ?? '';
|
|
||||||
$item->price = new FloatInt($request->getDataInt('price') ?? 0);
|
|
||||||
$item->minQuantity = $request->getDataInt('minquantity') ?? 0;
|
|
||||||
$item->relativeDiscount = $request->getDataInt('relativediscount') ?? 0;
|
|
||||||
$item->absoluteDiscount = $request->getDataInt('absolutediscount') ?? 0;
|
|
||||||
$item->relativeUnitDiscount = $request->getDataInt('relativeunitdiscount') ?? 0;
|
|
||||||
$item->absoluteUnitDiscount = $request->getDataInt('absoluteunitdiscount') ?? 0;
|
|
||||||
$item->promocode = $request->getDataString('promocode') ?? '';
|
|
||||||
$item->start = $request->getDataDateTime('start');
|
|
||||||
$item->end = $request->getDataDateTime('end');
|
|
||||||
$item->setStatus($request->getDataInt('status') ?? ItemPriceStatus::ACTIVE);
|
|
||||||
|
|
||||||
return $item;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate item create request
|
|
||||||
*
|
|
||||||
* @param RequestAbstract $request Request
|
|
||||||
*
|
|
||||||
* @return array<string, bool>
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private function validateItemPriceCreate(RequestAbstract $request) : array
|
|
||||||
{
|
|
||||||
$val = [];
|
|
||||||
if (($val['price_new'] = !$request->hasData('price_new'))
|
|
||||||
|| ($val['currency'] = !ISO4217CharEnum::isValidValue($request->getData('currency')))
|
|
||||||
) {
|
|
||||||
return $val;
|
|
||||||
}
|
|
||||||
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Api method to create item attribute
|
* Api method to create item attribute
|
||||||
*
|
*
|
||||||
|
|
@ -648,13 +607,11 @@ final class ApiController extends Controller
|
||||||
*/
|
*/
|
||||||
private function createItemL11nFromRequest(RequestAbstract $request) : BaseStringL11n
|
private function createItemL11nFromRequest(RequestAbstract $request) : BaseStringL11n
|
||||||
{
|
{
|
||||||
$itemL11n = new BaseStringL11n();
|
$itemL11n = new BaseStringL11n();
|
||||||
$itemL11n->ref = $request->getDataInt('item') ?? 0;
|
$itemL11n->ref = $request->getDataInt('item') ?? 0;
|
||||||
$itemL11n->type = new NullBaseStringL11nType($request->getDataInt('type') ?? 0);
|
$itemL11n->type = new NullBaseStringL11nType($request->getDataInt('type') ?? 0);
|
||||||
$itemL11n->setLanguage(
|
$itemL11n->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $request->header->l11n->language;
|
||||||
$request->getDataString('language') ?? $request->header->l11n->language
|
$itemL11n->content = $request->getDataString('content') ?? '';
|
||||||
);
|
|
||||||
$itemL11n->content = $request->getDataString('content') ?? '';
|
|
||||||
|
|
||||||
return $itemL11n;
|
return $itemL11n;
|
||||||
}
|
}
|
||||||
|
|
@ -952,8 +909,11 @@ final class ApiController extends Controller
|
||||||
*/
|
*/
|
||||||
private function createMaterialTypeFromRequest(RequestAbstract $request) : BaseStringL11nType
|
private function createMaterialTypeFromRequest(RequestAbstract $request) : BaseStringL11nType
|
||||||
{
|
{
|
||||||
$materialType = new BaseStringL11nType($request->getDataString('name') ?? '');
|
$materialType = new BaseStringL11nType($request->getDataString('name') ?? '');
|
||||||
$materialType->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN);
|
$materialType->setL11n(
|
||||||
|
$request->getDataString('title') ?? '',
|
||||||
|
ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN
|
||||||
|
);
|
||||||
|
|
||||||
return $materialType;
|
return $materialType;
|
||||||
}
|
}
|
||||||
|
|
@ -1017,12 +977,10 @@ final class ApiController extends Controller
|
||||||
*/
|
*/
|
||||||
private function createMaterialTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n
|
private function createMaterialTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n
|
||||||
{
|
{
|
||||||
$materialL11n = new BaseStringL11n();
|
$materialL11n = new BaseStringL11n();
|
||||||
$materialL11n->ref = $request->getDataInt('type') ?? 0;
|
$materialL11n->ref = $request->getDataInt('type') ?? 0;
|
||||||
$materialL11n->setLanguage(
|
$materialL11n->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $request->header->l11n->language;
|
||||||
$request->getDataString('language') ?? $request->header->l11n->language
|
$materialL11n->content = $request->getDataString('title') ?? '';
|
||||||
);
|
|
||||||
$materialL11n->content = $request->getDataString('title') ?? '';
|
|
||||||
|
|
||||||
return $materialL11n;
|
return $materialL11n;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,22 +14,20 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\ItemManagement\Controller;
|
namespace Modules\ItemManagement\Controller;
|
||||||
|
|
||||||
use Modules\Admin\Models\LocalizationMapper;
|
|
||||||
use Modules\Admin\Models\SettingsEnum;
|
|
||||||
use Modules\Auditor\Models\AuditMapper;
|
use Modules\Auditor\Models\AuditMapper;
|
||||||
use Modules\Billing\Models\Price\PriceMapper;
|
|
||||||
use Modules\Billing\Models\Price\PriceType;
|
|
||||||
use Modules\ClientManagement\Models\Attribute\ClientAttributeTypeMapper;
|
use Modules\ClientManagement\Models\Attribute\ClientAttributeTypeMapper;
|
||||||
use Modules\ClientManagement\Models\Attribute\ClientAttributeValueL11nMapper;
|
use Modules\ClientManagement\Models\Attribute\ClientAttributeValueL11nMapper;
|
||||||
use Modules\ItemManagement\Models\Attribute\ItemAttributeTypeL11nMapper;
|
use Modules\ItemManagement\Models\Attribute\ItemAttributeTypeL11nMapper;
|
||||||
use Modules\ItemManagement\Models\Attribute\ItemAttributeTypeMapper;
|
use Modules\ItemManagement\Models\Attribute\ItemAttributeTypeMapper;
|
||||||
use Modules\ItemManagement\Models\Attribute\ItemAttributeValueL11nMapper;
|
use Modules\ItemManagement\Models\Attribute\ItemAttributeValueL11nMapper;
|
||||||
use Modules\ItemManagement\Models\Attribute\ItemAttributeValueMapper;
|
use Modules\ItemManagement\Models\Attribute\ItemAttributeValueMapper;
|
||||||
|
use Modules\ItemManagement\Models\Item;
|
||||||
use Modules\ItemManagement\Models\ItemL11nMapper;
|
use Modules\ItemManagement\Models\ItemL11nMapper;
|
||||||
use Modules\ItemManagement\Models\ItemL11nTypeMapper;
|
use Modules\ItemManagement\Models\ItemL11nTypeMapper;
|
||||||
use Modules\ItemManagement\Models\ItemMapper;
|
use Modules\ItemManagement\Models\ItemMapper;
|
||||||
use Modules\ItemManagement\Models\MaterialTypeL11nMapper;
|
use Modules\ItemManagement\Models\MaterialTypeL11nMapper;
|
||||||
use Modules\ItemManagement\Models\MaterialTypeMapper;
|
use Modules\ItemManagement\Models\MaterialTypeMapper;
|
||||||
|
use Modules\ItemManagement\Models\StockIdentifierType;
|
||||||
use Modules\Media\Models\MediaMapper;
|
use Modules\Media\Models\MediaMapper;
|
||||||
use Modules\Media\Models\MediaTypeMapper;
|
use Modules\Media\Models\MediaTypeMapper;
|
||||||
use Modules\Organization\Models\Attribute\UnitAttributeMapper;
|
use Modules\Organization\Models\Attribute\UnitAttributeMapper;
|
||||||
|
|
@ -200,6 +198,7 @@ final class BackendController extends Controller
|
||||||
|
|
||||||
/** @var \Modules\ItemManagement\Models\Item[] $items */
|
/** @var \Modules\ItemManagement\Models\Item[] $items */
|
||||||
$items = ItemMapper::getAll()
|
$items = ItemMapper::getAll()
|
||||||
|
->with('container') // @todo change to only get the default sales container
|
||||||
->with('l11n')
|
->with('l11n')
|
||||||
->with('l11n/type')
|
->with('l11n/type')
|
||||||
->with('files')
|
->with('files')
|
||||||
|
|
@ -212,6 +211,73 @@ final class BackendController extends Controller
|
||||||
|
|
||||||
$view->data['items'] = $items;
|
$view->data['items'] = $items;
|
||||||
|
|
||||||
|
// Stock distribution
|
||||||
|
$dists = [];
|
||||||
|
$reserved = [];
|
||||||
|
$ordered = [];
|
||||||
|
if ($this->app->moduleManager->isActive('WarehouseManagement')) {
|
||||||
|
$itemIds = \array_map(function (Item $item) { return $item->id;
|
||||||
|
}, $items);
|
||||||
|
$itemIdsString = \implode(',', $itemIds);
|
||||||
|
|
||||||
|
// @todo only select sales stock. Therefore we need a place to define the sales stock(s)
|
||||||
|
$temp = \Modules\WarehouseManagement\Models\StockDistributionMapper::getAll()
|
||||||
|
->where('item', $itemIds, 'IN')
|
||||||
|
->execute();
|
||||||
|
|
||||||
|
foreach ($temp as $t) {
|
||||||
|
if (!isset($dists[$t->item])) {
|
||||||
|
$dists[$t->item] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// @todo These numbers might need adjustments for delivery notes/invoices depending on
|
||||||
|
// how we implement them in the warehouse management (maybe flag them in the transaction protocol as reserved?)
|
||||||
|
// also remember the SD issue where delivery notes can be technically still in stock -> stock value still belongs to company
|
||||||
|
// solution: "just" do a soft adjust of the available numbers?! but don't change the actual stock in the db
|
||||||
|
// the SD solution where actually delivered delivery notes can be adjusted after "archiving" will not be allowed
|
||||||
|
// to allow them to see what happened with such a delivery note maybe we can implement a view shows how many of the items are
|
||||||
|
// actually still outstanding. This shouldn't be anything special since we need importing of delivery notes anyways and marking
|
||||||
|
// old delivery note elements in a way to show which line items or even sub-line items got invoiced/returned etc.
|
||||||
|
$dists[$t->item][] = $t;
|
||||||
|
}
|
||||||
|
|
||||||
|
$stockIdentifier = StockIdentifierType::NONE;
|
||||||
|
|
||||||
|
$sql = <<<SQL
|
||||||
|
SELECT billing_bill_element.billing_bill_element_item,
|
||||||
|
billing_type.billing_type_name,
|
||||||
|
SUM(billing_bill_element.billing_bill_element_quantity) AS quantity
|
||||||
|
FROM billing_bill_element
|
||||||
|
LEFT JOIN itemmgmt_item ON billing_bill_element.billing_bill_element_item = itemmgmt_item.itemmgmt_item_id
|
||||||
|
LEFT JOIN billing_bill ON billing_bill_element.billing_bill_element_bill = billing_bill.billing_bill_id
|
||||||
|
LEFT JOIN billing_type ON billing_bill.billing_bill_type = billing_type.billing_type_id
|
||||||
|
WHERE billing_bill_element.billing_bill_element_item IN ({$itemIdsString})
|
||||||
|
AND itemmgmt_item.itemmgmt_item_stockidentifier != {$stockIdentifier}
|
||||||
|
AND billing_type.billing_type_name IN ('sales_order_confirmation', 'purchase_order')
|
||||||
|
GROUP BY billing_bill_element.billing_bill_element_item, billing_type.billing_type_name;
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
$query = new Builder($this->app->dbPool->get());
|
||||||
|
$results = $query->raw($sql)->execute()->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
foreach ($results as $result) {
|
||||||
|
if (!isset($reserved[(int) $result['billing_bill_element_item']])) {
|
||||||
|
$reserved[$t->item] = 0;
|
||||||
|
$ordered[$t->item] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($result['billing_type_name'] === 'sales_order_confirmation') {
|
||||||
|
$reserved[(int) $result['billing_bill_element_item']] += (int) $result['quantity'];
|
||||||
|
} else {
|
||||||
|
$ordered[(int) $result['billing_bill_element_item']] += (int) $result['quantity'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$view->data['dists'] = $dists;
|
||||||
|
$view->data['reserved'] = $reserved;
|
||||||
|
$view->data['ordered'] = $ordered;
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -368,11 +434,11 @@ final class BackendController extends Controller
|
||||||
$head->addAsset(AssetType::JSLATE, 'Modules/ItemManagement/Controller.js', ['nonce' => $nonce, 'type' => 'module']);
|
$head->addAsset(AssetType::JSLATE, 'Modules/ItemManagement/Controller.js', ['nonce' => $nonce, 'type' => 'module']);
|
||||||
|
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/item-profile');
|
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/item-view');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004803001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004803001, $request, $response);
|
||||||
|
|
||||||
/** @var \Modules\ItemManagement\Models\Item $item */
|
/** @var \Modules\ItemManagement\Models\Item */
|
||||||
$item = ItemMapper::get()
|
$view->data['item'] = ItemMapper::get()
|
||||||
->with('l11n')
|
->with('l11n')
|
||||||
->with('l11n/type')
|
->with('l11n/type')
|
||||||
->with('files')->limit(5, 'files')->sort('files/id', OrderType::DESC)
|
->with('files')->limit(5, 'files')->sort('files/id', OrderType::DESC)
|
||||||
|
|
@ -382,14 +448,14 @@ final class BackendController extends Controller
|
||||||
->with('attributes/type')
|
->with('attributes/type')
|
||||||
->with('attributes/type/l11n')
|
->with('attributes/type/l11n')
|
||||||
->with('attributes/value')
|
->with('attributes/value')
|
||||||
|
//->with('attributes/value/l11n')
|
||||||
->where('id', (int) $request->getData('id'))
|
->where('id', (int) $request->getData('id'))
|
||||||
->where('l11n/language', $response->header->l11n->language)
|
->where('l11n/language', $response->header->l11n->language)
|
||||||
->where('l11n/type/title', ['name1', 'name2', 'name3'], 'IN')
|
->where('l11n/type/title', ['name1', 'name2', 'name3'], 'IN')
|
||||||
->where('attributes/type/l11n/language', $response->header->l11n->language)
|
->where('attributes/type/l11n/language', $response->header->l11n->language)
|
||||||
|
//->where('attributes/value/l11n/language', $response->header->l11n->language)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$view->data['item'] = $item;
|
|
||||||
|
|
||||||
// Get item profile image
|
// Get item profile image
|
||||||
// It might not be part of the 5 newest item files from above
|
// It might not be part of the 5 newest item files from above
|
||||||
// @todo It would be nice to have something like this as a default method in the model e.g.
|
// @todo It would be nice to have something like this as a default method in the model e.g.
|
||||||
|
|
@ -406,18 +472,16 @@ final class BackendController extends Controller
|
||||||
->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['self'])
|
->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['self'])
|
||||||
->leftJoin(MediaTypeMapper::TABLE)
|
->leftJoin(MediaTypeMapper::TABLE)
|
||||||
->on(MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['external'], '=', MediaTypeMapper::TABLE . '.' . MediaTypeMapper::PRIMARYFIELD)
|
->on(MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['external'], '=', MediaTypeMapper::TABLE . '.' . MediaTypeMapper::PRIMARYFIELD)
|
||||||
->where(ItemMapper::HAS_MANY['files']['self'], '=', $item->id)
|
->where(ItemMapper::HAS_MANY['files']['self'], '=', $view->data['item']->id)
|
||||||
->where(MediaTypeMapper::TABLE . '.' . MediaTypeMapper::getColumnByMember('name'), '=', 'item_profile_image');
|
->where(MediaTypeMapper::TABLE . '.' . MediaTypeMapper::getColumnByMember('name'), '=', 'item_profile_image');
|
||||||
|
|
||||||
/** @var \Modules\Media\Models\Media $itemImage */
|
/** @var \Modules\Media\Models\Media */
|
||||||
$itemImage = MediaMapper::get()
|
$view->data['itemImage'] = MediaMapper::get()
|
||||||
->with('types')
|
->with('types')
|
||||||
->where('id', $results)
|
->where('id', $results)
|
||||||
->limit(1)
|
->limit(1)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$view->data['itemImage'] = $itemImage;
|
|
||||||
|
|
||||||
$businessStart = UnitAttributeMapper::get()
|
$businessStart = UnitAttributeMapper::get()
|
||||||
->with('type')
|
->with('type')
|
||||||
->with('value')
|
->with('value')
|
||||||
|
|
@ -427,61 +491,40 @@ final class BackendController extends Controller
|
||||||
|
|
||||||
$view->data['business_start'] = $businessStart->id === 0 ? 1 : $businessStart->value->getValue();
|
$view->data['business_start'] = $businessStart->id === 0 ? 1 : $businessStart->value->getValue();
|
||||||
|
|
||||||
// @todo this one should already be loaded in the backend application no?????????
|
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
|
||||||
/** @var \Model\Setting $settings */
|
$view->data['attributeView']->data['default_localization'] = $this->app->l11nServer;
|
||||||
$settings = $this->app->appSettings->get(null, SettingsEnum::DEFAULT_LOCALIZATION);
|
|
||||||
|
|
||||||
$view->data['default_localization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute();
|
|
||||||
|
|
||||||
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
|
|
||||||
$view->data['attributeView']->data['default_localization'] = $view->data['default_localization'];
|
|
||||||
|
|
||||||
$view->data['l11nView'] = new \Web\Backend\Views\L11nView($this->app->l11nManager, $request, $response);
|
$view->data['l11nView'] = new \Web\Backend\Views\L11nView($this->app->l11nManager, $request, $response);
|
||||||
|
|
||||||
/** @var \phpOMS\Localization\BaseStringL11nType[] $l11nTypes */
|
/** @var \phpOMS\Localization\BaseStringL11nType[] */
|
||||||
$l11nTypes = ItemL11nTypeMapper::getAll()
|
$view->data['l11nTypes'] = ItemL11nTypeMapper::getAll()
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$view->data['l11nTypes'] = $l11nTypes;
|
/** @var \phpOMS\Localization\BaseStringL11n[] */
|
||||||
|
$view->data['l11nValues'] = ItemL11nMapper::getAll()
|
||||||
/** @var \phpOMS\Localization\BaseStringL11n[] $l11nValues */
|
|
||||||
$l11nValues = ItemL11nMapper::getAll()
|
|
||||||
->with('type')
|
->with('type')
|
||||||
->where('ref', $item->id)
|
->where('ref', $view->data['item']->id)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$view->data['l11nValues'] = $l11nValues;
|
/** @var \Modules\Attribute\Models\AttributeType[] */
|
||||||
|
$view->data['attributeTypes'] = ItemAttributeTypeMapper::getAll()
|
||||||
/** @var \Modules\Attribute\Models\AttributeType[] $attributeTypes */
|
|
||||||
$attributeTypes = ItemAttributeTypeMapper::getAll()
|
|
||||||
->with('l11n')
|
->with('l11n')
|
||||||
->where('l11n/language', $response->header->l11n->language)
|
->where('l11n/language', $response->header->l11n->language)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$view->data['attributeTypes'] = $attributeTypes;
|
/** @var \Modules\Organization\Models\Unit[] */
|
||||||
|
$view->data['units'] = UnitMapper::getAll()
|
||||||
/** @var \Modules\Organization\Models\Unit[] $units */
|
|
||||||
$units = UnitMapper::getAll()
|
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$view->data['units'] = $units;
|
$view->data['hasBilling'] = $this->app->moduleManager->isActive('Billing');
|
||||||
|
|
||||||
/** @var \Modules\Billing\Models\Price\Price[] $prices */
|
/** @var \Modules\Billing\Models\Price\Price[] */
|
||||||
$prices = PriceMapper::getAll()
|
$view->data['prices'] = $view->data['hasBilling']
|
||||||
->where('item', $item->id)
|
? \Modules\Billing\Models\Price\PriceMapper::getAll()
|
||||||
->where('type', PriceType::SALES)
|
->where('item', $view->data['item']->id)
|
||||||
->where('client', null)
|
->where('client', null)
|
||||||
->execute();
|
->execute()
|
||||||
|
: [];
|
||||||
$view->data['prices'] = $prices;
|
|
||||||
|
|
||||||
/** @var \Modules\Billing\Models\Price\Price[] $prices */
|
|
||||||
$prices = PriceMapper::getAll()
|
|
||||||
->where('item', $item->id)
|
|
||||||
->where('type', PriceType::PURCHASE)
|
|
||||||
->execute();
|
|
||||||
|
|
||||||
$view->data['purchase_prices'] = $prices;
|
|
||||||
|
|
||||||
$tmp = ItemAttributeTypeMapper::getAll()
|
$tmp = ItemAttributeTypeMapper::getAll()
|
||||||
->with('defaults')
|
->with('defaults')
|
||||||
|
|
@ -519,30 +562,24 @@ final class BackendController extends Controller
|
||||||
|
|
||||||
$view->data['clientSegmentationTypes'] = $clientSegmentationTypes;
|
$view->data['clientSegmentationTypes'] = $clientSegmentationTypes;
|
||||||
|
|
||||||
/** @var \Modules\Auditor\Models\Audit[] $audits */
|
/** @var \Modules\Auditor\Models\Audit[] */
|
||||||
$audits = AuditMapper::getAll()
|
$view->data['audits'] = AuditMapper::getAll()
|
||||||
->where('type', StringUtils::intHash(ItemMapper::class))
|
->where('type', StringUtils::intHash(ItemMapper::class))
|
||||||
->where('module', 'ItemManagement')
|
->where('module', 'ItemManagement')
|
||||||
->where('ref', (string) $item->id)
|
->where('ref', (string) $view->data['item']->id)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
// @todo join audit with files, attributes, localization, prices, notes, ...
|
// @todo join audit with files, attributes, localization, prices, notes, ...
|
||||||
|
|
||||||
$view->data['audits'] = $audits;
|
/** @var \Modules\Media\Models\Media[] */
|
||||||
|
$view->data['files'] = MediaMapper::getAll()
|
||||||
/** @var \Modules\Media\Models\Media[] $files */
|
|
||||||
$files = MediaMapper::getAll()
|
|
||||||
->with('types')
|
->with('types')
|
||||||
->join('id', ItemMapper::class, 'files') // id = media id, files = item relations
|
->join('id', ItemMapper::class, 'files') // id = media id, files = item relations
|
||||||
->on('id', $item->id, relation: 'files') // id = item id
|
->on('id', $view->data['item']->id, relation: 'files') // id = item id
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$view->data['files'] = $files;
|
|
||||||
|
|
||||||
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
||||||
$view->data['note'] = new \Modules\Editor\Theme\Backend\Components\Note\BaseView($this->app->l11nManager, $request, $response);
|
$view->data['note'] = new \Modules\Editor\Theme\Backend\Components\Note\BaseView($this->app->l11nManager, $request, $response);
|
||||||
|
|
||||||
$view->data['hasBilling'] = $this->app->moduleManager->isActive('Billing');
|
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,8 @@ final class ItemAttributeTypeMapper extends DataMapperFactory
|
||||||
'itemmgmt_attr_type_datatype' => ['name' => 'itemmgmt_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'],
|
'itemmgmt_attr_type_datatype' => ['name' => 'itemmgmt_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'],
|
||||||
'itemmgmt_attr_type_fields' => ['name' => 'itemmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
|
'itemmgmt_attr_type_fields' => ['name' => 'itemmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
|
||||||
'itemmgmt_attr_type_custom' => ['name' => 'itemmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
|
'itemmgmt_attr_type_custom' => ['name' => 'itemmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
|
||||||
'itemmgmt_attr_type_repeatable' => ['name' => 'itemmgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'],
|
'itemmgmt_attr_type_repeatable' => ['name' => 'itemmgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'],
|
||||||
|
'itemmgmt_attr_type_internal' => ['name' => 'itemmgmt_attr_type_internal', 'type' => 'bool', 'internal' => 'isInternal'],
|
||||||
'itemmgmt_attr_type_pattern' => ['name' => 'itemmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
|
'itemmgmt_attr_type_pattern' => ['name' => 'itemmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
|
||||||
'itemmgmt_attr_type_required' => ['name' => 'itemmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
|
'itemmgmt_attr_type_required' => ['name' => 'itemmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,10 @@ final class ItemAttributeValueL11nMapper extends DataMapperFactory
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const COLUMNS = [
|
public const COLUMNS = [
|
||||||
'itemmgmt_attr_value_l11n_id' => ['name' => 'itemmgmt_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'],
|
'itemmgmt_attr_value_l11n_id' => ['name' => 'itemmgmt_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
'itemmgmt_attr_value_l11n_title' => ['name' => 'itemmgmt_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
|
'itemmgmt_attr_value_l11n_title' => ['name' => 'itemmgmt_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
|
||||||
'itemmgmt_attr_value_l11n_value' => ['name' => 'itemmgmt_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'],
|
'itemmgmt_attr_value_l11n_value' => ['name' => 'itemmgmt_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'],
|
||||||
'itemmgmt_attr_value_l11n_lang' => ['name' => 'itemmgmt_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'],
|
'itemmgmt_attr_value_l11n_lang' => ['name' => 'itemmgmt_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -37,15 +37,15 @@ final class ItemAttributeValueMapper extends DataMapperFactory
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const COLUMNS = [
|
public const COLUMNS = [
|
||||||
'itemmgmt_attr_value_id' => ['name' => 'itemmgmt_attr_value_id', 'type' => 'int', 'internal' => 'id'],
|
'itemmgmt_attr_value_id' => ['name' => 'itemmgmt_attr_value_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
'itemmgmt_attr_value_default' => ['name' => 'itemmgmt_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'],
|
'itemmgmt_attr_value_default' => ['name' => 'itemmgmt_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'],
|
||||||
'itemmgmt_attr_value_valueStr' => ['name' => 'itemmgmt_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'],
|
'itemmgmt_attr_value_valueStr' => ['name' => 'itemmgmt_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'],
|
||||||
'itemmgmt_attr_value_valueInt' => ['name' => 'itemmgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'],
|
'itemmgmt_attr_value_valueInt' => ['name' => 'itemmgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'],
|
||||||
'itemmgmt_attr_value_valueDec' => ['name' => 'itemmgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'],
|
'itemmgmt_attr_value_valueDec' => ['name' => 'itemmgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'],
|
||||||
'itemmgmt_attr_value_valueDat' => ['name' => 'itemmgmt_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'],
|
'itemmgmt_attr_value_valueDat' => ['name' => 'itemmgmt_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'],
|
||||||
'itemmgmt_attr_value_unit' => ['name' => 'itemmgmt_attr_value_unit', 'type' => 'string', 'internal' => 'unit'],
|
'itemmgmt_attr_value_unit' => ['name' => 'itemmgmt_attr_value_unit', 'type' => 'string', 'internal' => 'unit'],
|
||||||
'itemmgmt_attr_value_deptype' => ['name' => 'itemmgmt_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'],
|
'itemmgmt_attr_value_deptype' => ['name' => 'itemmgmt_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'],
|
||||||
'itemmgmt_attr_value_depvalue' => ['name' => 'itemmgmt_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'],
|
'itemmgmt_attr_value_depvalue' => ['name' => 'itemmgmt_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,12 @@ class Container implements \JsonSerializable
|
||||||
|
|
||||||
public string $name = '';
|
public string $name = '';
|
||||||
|
|
||||||
|
public string $unit = 'pcs';
|
||||||
|
|
||||||
public int $quantity = 0;
|
public int $quantity = 0;
|
||||||
|
|
||||||
|
public int $quantityDecimals = 0;
|
||||||
|
|
||||||
public int $weight = 0;
|
public int $weight = 0;
|
||||||
|
|
||||||
public int $width = 0;
|
public int $width = 0;
|
||||||
|
|
|
||||||
|
|
@ -36,15 +36,17 @@ final class ContainerMapper extends DataMapperFactory
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const COLUMNS = [
|
public const COLUMNS = [
|
||||||
'itemmgmt_item_container_id' => ['name' => 'itemmgmt_item_container_id', 'type' => 'int', 'internal' => 'id'],
|
'itemmgmt_item_container_id' => ['name' => 'itemmgmt_item_container_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
'itemmgmt_item_container_name' => ['name' => 'itemmgmt_item_container_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true],
|
'itemmgmt_item_container_name' => ['name' => 'itemmgmt_item_container_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true],
|
||||||
'itemmgmt_item_container_quantity' => ['name' => 'itemmgmt_item_container_quantity', 'type' => 'int', 'internal' => 'quantity'],
|
'itemmgmt_item_container_unit' => ['name' => 'itemmgmt_item_container_unit', 'type' => 'string', 'internal' => 'unit'],
|
||||||
'itemmgmt_item_container_weight' => ['name' => 'itemmgmt_item_container_weight', 'type' => 'int', 'internal' => 'weight'],
|
'itemmgmt_item_container_quantity' => ['name' => 'itemmgmt_item_container_quantity', 'type' => 'int', 'internal' => 'quantity'],
|
||||||
'itemmgmt_item_container_width' => ['name' => 'itemmgmt_item_container_width', 'type' => 'int', 'internal' => 'width'],
|
'itemmgmt_item_container_decimals' => ['name' => 'itemmgmt_item_container_decimals', 'type' => 'int', 'internal' => 'quantityDecimals'],
|
||||||
'itemmgmt_item_container_height' => ['name' => 'itemmgmt_item_container_height', 'type' => 'int', 'internal' => 'height'],
|
'itemmgmt_item_container_weight' => ['name' => 'itemmgmt_item_container_weight', 'type' => 'int', 'internal' => 'weight'],
|
||||||
'itemmgmt_item_container_length' => ['name' => 'itemmgmt_item_container_length', 'type' => 'int', 'internal' => 'length'],
|
'itemmgmt_item_container_width' => ['name' => 'itemmgmt_item_container_width', 'type' => 'int', 'internal' => 'width'],
|
||||||
'itemmgmt_item_container_volume' => ['name' => 'itemmgmt_item_container_volume', 'type' => 'int', 'internal' => 'volume'],
|
'itemmgmt_item_container_height' => ['name' => 'itemmgmt_item_container_height', 'type' => 'int', 'internal' => 'height'],
|
||||||
'itemmgmt_item_container_item' => ['name' => 'itemmgmt_item_container_item', 'type' => 'int', 'internal' => 'item'],
|
'itemmgmt_item_container_length' => ['name' => 'itemmgmt_item_container_length', 'type' => 'int', 'internal' => 'length'],
|
||||||
|
'itemmgmt_item_container_volume' => ['name' => 'itemmgmt_item_container_volume', 'type' => 'int', 'internal' => 'volume'],
|
||||||
|
'itemmgmt_item_container_item' => ['name' => 'itemmgmt_item_container_item', 'type' => 'int', 'internal' => 'item'],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,12 @@ class Item implements \JsonSerializable
|
||||||
*/
|
*/
|
||||||
public ?int $unit = null;
|
public ?int $unit = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Containers
|
||||||
|
*
|
||||||
|
* @var Container[]
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
public array $container = [];
|
public array $container = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -148,18 +154,6 @@ class Item implements \JsonSerializable
|
||||||
$this->purchasePrice = new FloatInt();
|
$this->purchasePrice = new FloatInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get id.
|
|
||||||
*
|
|
||||||
* @return int Model id
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getId() : int
|
|
||||||
{
|
|
||||||
return $this->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add item l11n
|
* Add item l11n
|
||||||
*
|
*
|
||||||
|
|
@ -189,7 +183,7 @@ class Item implements \JsonSerializable
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function getL11n(string $type = null) : BaseStringL11n
|
public function getL11n(?string $type = null) : BaseStringL11n
|
||||||
{
|
{
|
||||||
foreach ($this->l11n as $l11n) {
|
foreach ($this->l11n as $l11n) {
|
||||||
if ($l11n->type?->title === $type) {
|
if ($l11n->type?->title === $type) {
|
||||||
|
|
@ -212,32 +206,6 @@ class Item implements \JsonSerializable
|
||||||
return $this->l11n;
|
return $this->l11n;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get status.
|
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getStatus() : int
|
|
||||||
{
|
|
||||||
return $this->status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set status.
|
|
||||||
*
|
|
||||||
* @param int $status Status
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function setStatus(int $status) : void
|
|
||||||
{
|
|
||||||
$this->status = $status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -43,15 +43,15 @@ final class ItemMapper extends DataMapperFactory
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const COLUMNS = [
|
public const COLUMNS = [
|
||||||
'itemmgmt_item_id' => ['name' => 'itemmgmt_item_id', 'type' => 'int', 'internal' => 'id'],
|
'itemmgmt_item_id' => ['name' => 'itemmgmt_item_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
'itemmgmt_item_no' => ['name' => 'itemmgmt_item_no', 'type' => 'string', 'internal' => 'number', 'autocomplete' => true],
|
'itemmgmt_item_no' => ['name' => 'itemmgmt_item_no', 'type' => 'string', 'internal' => 'number', 'autocomplete' => true],
|
||||||
'itemmgmt_item_status' => ['name' => 'itemmgmt_item_status', 'type' => 'int', 'internal' => 'status'],
|
'itemmgmt_item_status' => ['name' => 'itemmgmt_item_status', 'type' => 'int', 'internal' => 'status'],
|
||||||
'itemmgmt_item_stockidentifier' => ['name' => 'itemmgmt_item_stockidentifier', 'type' => 'int', 'internal' => 'stockIdentifier'],
|
'itemmgmt_item_stockidentifier' => ['name' => 'itemmgmt_item_stockidentifier', 'type' => 'int', 'internal' => 'stockIdentifier'],
|
||||||
'itemmgmt_item_info' => ['name' => 'itemmgmt_item_info', 'type' => 'string', 'internal' => 'info'],
|
'itemmgmt_item_info' => ['name' => 'itemmgmt_item_info', 'type' => 'string', 'internal' => 'info'],
|
||||||
'itemmgmt_item_salesprice' => ['name' => 'itemmgmt_item_salesprice', 'type' => 'Serializable', 'internal' => 'salesPrice'],
|
'itemmgmt_item_salesprice' => ['name' => 'itemmgmt_item_salesprice', 'type' => 'Serializable', 'internal' => 'salesPrice'],
|
||||||
'itemmgmt_item_purchaseprice' => ['name' => 'itemmgmt_item_purchaseprice', 'type' => 'Serializable', 'internal' => 'purchasePrice'],
|
'itemmgmt_item_purchaseprice' => ['name' => 'itemmgmt_item_purchaseprice', 'type' => 'Serializable', 'internal' => 'purchasePrice'],
|
||||||
'itemmgmt_item_parent' => ['name' => 'itemmgmt_item_parent', 'type' => 'int', 'internal' => 'parent'],
|
'itemmgmt_item_parent' => ['name' => 'itemmgmt_item_parent', 'type' => 'int', 'internal' => 'parent'],
|
||||||
'itemmgmt_item_unit' => ['name' => 'itemmgmt_item_unit', 'type' => 'int', 'internal' => 'unit'],
|
'itemmgmt_item_unit' => ['name' => 'itemmgmt_item_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -102,10 +102,10 @@ final class ItemMapper extends DataMapperFactory
|
||||||
'external' => null,
|
'external' => null,
|
||||||
],
|
],
|
||||||
'container' => [
|
'container' => [
|
||||||
'mapper' => ContainerMapper::class,
|
'mapper' => ContainerMapper::class,
|
||||||
'table' => 'itemmgmt_item_container',
|
'table' => 'itemmgmt_item_container',
|
||||||
'self' => 'itemmgmt_item_container_item',
|
'self' => 'itemmgmt_item_container_item',
|
||||||
'external' => null,
|
'external' => null,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -198,12 +198,12 @@ final class ItemMapper extends DataMapperFactory
|
||||||
$l11nType->id = $res['itemmgmt_item_l11n_typeref'];
|
$l11nType->id = $res['itemmgmt_item_l11n_typeref'];
|
||||||
$l11nType->title = $res['itemmgmt_item_l11n_type_title'];
|
$l11nType->title = $res['itemmgmt_item_l11n_type_title'];
|
||||||
|
|
||||||
$l11n = new BaseStringL11n();
|
$l11n = new BaseStringL11n();
|
||||||
$l11n->id = $res['itemmgmt_item_l11n_id'];
|
$l11n->id = $res['itemmgmt_item_l11n_id'];
|
||||||
$l11n->ref = $res['itemmgmt_item_id'];
|
$l11n->ref = $res['itemmgmt_item_id'];
|
||||||
$l11n->type = $l11nType;
|
$l11n->type = $l11nType;
|
||||||
$l11n->content = $res['itemmgmt_item_l11n_description'];
|
$l11n->content = $res['itemmgmt_item_l11n_description'];
|
||||||
$l11n->setLanguage($res['itemmgmt_item_l11n_lang']);
|
$l11n->language = $res['itemmgmt_item_l11n_lang'];
|
||||||
|
|
||||||
$items[$l11n->ref]->addL11n($l11n);
|
$items[$l11n->ref]->addL11n($l11n);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,132 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Jingga
|
|
||||||
*
|
|
||||||
* PHP Version 8.1
|
|
||||||
*
|
|
||||||
* @package Modules\ItemManagement\Models
|
|
||||||
* @copyright Dennis Eichhorn
|
|
||||||
* @license OMS License 2.0
|
|
||||||
* @version 1.0.0
|
|
||||||
* @link https://jingga.app
|
|
||||||
*/
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Modules\ItemManagement\Models;
|
|
||||||
|
|
||||||
use phpOMS\Stdlib\Base\Exception\InvalidEnumValue;
|
|
||||||
use phpOMS\Stdlib\Base\FloatInt;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Account class.
|
|
||||||
*
|
|
||||||
* @package Modules\ItemManagement\Models
|
|
||||||
* @license OMS License 2.0
|
|
||||||
* @link https://jingga.app
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
class ItemPrice implements \JsonSerializable
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* ID.
|
|
||||||
*
|
|
||||||
* @var int
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public int $id = 0;
|
|
||||||
|
|
||||||
public string $name = '';
|
|
||||||
|
|
||||||
public string $currency = '';
|
|
||||||
|
|
||||||
public FloatInt $price;
|
|
||||||
|
|
||||||
public int $status = ItemPriceStatus::ACTIVE;
|
|
||||||
|
|
||||||
public int $minQuantity = 0;
|
|
||||||
|
|
||||||
public int $relativeDiscount = 0;
|
|
||||||
|
|
||||||
public int $absoluteDiscount = 0;
|
|
||||||
|
|
||||||
public int $relativeUnitDiscount = 0;
|
|
||||||
|
|
||||||
public int $absoluteUnitDiscount = 0;
|
|
||||||
|
|
||||||
public string $promocode = '';
|
|
||||||
|
|
||||||
public ?\DateTime $start = null;
|
|
||||||
|
|
||||||
public ?\DateTime $end = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor.
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get status
|
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getStatus() : int
|
|
||||||
{
|
|
||||||
return $this->status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set status
|
|
||||||
*
|
|
||||||
* @param int $status Price status
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @throws InvalidEnumValue
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function setStatus(int $status) : void
|
|
||||||
{
|
|
||||||
if (!ItemPriceStatus::isValidValue($status)) {
|
|
||||||
throw new InvalidEnumValue((string) $status);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->status = $status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function toArray() : array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'id' => $this->id,
|
|
||||||
'name' => $this->name,
|
|
||||||
'currency' => $this->currency,
|
|
||||||
'price' => $this->price,
|
|
||||||
'status' => $this->status,
|
|
||||||
'minQuantity' => $this->minQuantity,
|
|
||||||
'relativeDiscount' => $this->relativeDiscount,
|
|
||||||
'absoluteDiscount' => $this->absoluteDiscount,
|
|
||||||
'relativeUnitDiscount' => $this->relativeUnitDiscount,
|
|
||||||
'absoluteUnitDiscount' => $this->absoluteUnitDiscount,
|
|
||||||
'promocode' => $this->promocode,
|
|
||||||
'start' => $this->start,
|
|
||||||
'end' => $this->end,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function jsonSerialize() : mixed
|
|
||||||
{
|
|
||||||
return $this->toArray();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -63,7 +63,7 @@ class ItemRelation implements \JsonSerializable
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function __construct(ItemRelationType $type = null)
|
public function __construct(?ItemRelationType $type = null)
|
||||||
{
|
{
|
||||||
$this->type = $type ?? new ItemRelationType();
|
$this->type = $type ?? new ItemRelationType();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,10 @@ final class ItemRelationMapper extends DataMapperFactory
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const COLUMNS = [
|
public const COLUMNS = [
|
||||||
'itemmgmt_item_relation_id' => ['name' => 'itemmgmt_item_relation_id', 'type' => 'int', 'internal' => 'id'],
|
'itemmgmt_item_relation_id' => ['name' => 'itemmgmt_item_relation_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
'itemmgmt_item_relation_src' => ['name' => 'itemmgmt_item_relation_src', 'type' => 'int', 'internal' => 'source'],
|
'itemmgmt_item_relation_src' => ['name' => 'itemmgmt_item_relation_src', 'type' => 'int', 'internal' => 'source'],
|
||||||
'itemmgmt_item_relation_dst' => ['name' => 'itemmgmt_item_relation_dst', 'type' => 'int', 'internal' => 'destination'],
|
'itemmgmt_item_relation_dst' => ['name' => 'itemmgmt_item_relation_dst', 'type' => 'int', 'internal' => 'destination'],
|
||||||
'itemmgmt_item_relation_type' => ['name' => 'itemmgmt_item_relation_type', 'type' => 'int', 'internal' => 'type'],
|
'itemmgmt_item_relation_type' => ['name' => 'itemmgmt_item_relation_type', 'type' => 'int', 'internal' => 'type'],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@ final class ItemRelationTypeMapper extends DataMapperFactory
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const COLUMNS = [
|
public const COLUMNS = [
|
||||||
'itemmgmt_item_relation_type_id' => ['name' => 'itemmgmt_item_relation_type_id', 'type' => 'int', 'internal' => 'id'],
|
'itemmgmt_item_relation_type_id' => ['name' => 'itemmgmt_item_relation_type_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
'itemmgmt_item_relation_type_title' => ['name' => 'itemmgmt_item_relation_type_title', 'type' => 'string', 'internal' => 'title'],
|
'itemmgmt_item_relation_type_title' => ['name' => 'itemmgmt_item_relation_type_title', 'type' => 'string', 'internal' => 'title'],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ declare(strict_types=1);
|
||||||
namespace Modules\ItemManagement\Models;
|
namespace Modules\ItemManagement\Models;
|
||||||
|
|
||||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||||
use phpOMS\Localization\BaseStringL11nType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Item mapper class.
|
* Item mapper class.
|
||||||
|
|
@ -37,12 +36,12 @@ final class MaterialMapper extends DataMapperFactory
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const COLUMNS = [
|
public const COLUMNS = [
|
||||||
'itemmgmt_material_id' => ['name' => 'itemmgmt_material_id', 'type' => 'int', 'internal' => 'id'],
|
'itemmgmt_material_id' => ['name' => 'itemmgmt_material_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
'itemmgmt_material_category' => ['name' => 'itemmgmt_material_category', 'type' => 'int', 'internal' => 'category'],
|
'itemmgmt_material_category' => ['name' => 'itemmgmt_material_category', 'type' => 'int', 'internal' => 'category'],
|
||||||
'itemmgmt_material_subcategory' => ['name' => 'itemmgmt_material_subcategory', 'type' => 'int', 'internal' => 'subcategory'],
|
'itemmgmt_material_subcategory' => ['name' => 'itemmgmt_material_subcategory', 'type' => 'int', 'internal' => 'subcategory'],
|
||||||
'itemmgmt_material_type' => ['name' => 'itemmgmt_material_type', 'type' => 'int', 'internal' => 'type'],
|
'itemmgmt_material_type' => ['name' => 'itemmgmt_material_type', 'type' => 'int', 'internal' => 'type'],
|
||||||
'itemmgmt_material_unit' => ['name' => 'itemmgmt_material_unit', 'type' => 'int', 'internal' => 'unit'],
|
'itemmgmt_material_unit' => ['name' => 'itemmgmt_material_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||||
'itemmgmt_material_item' => ['name' => 'itemmgmt_material_item', 'type' => 'int', 'internal' => 'item'],
|
'itemmgmt_material_item' => ['name' => 'itemmgmt_material_item', 'type' => 'int', 'internal' => 'item'],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -42,5 +42,4 @@ abstract class MaterialSubcategory extends Enum
|
||||||
public const AUXILIARY_MATERIAL = 101;
|
public const AUXILIARY_MATERIAL = 101;
|
||||||
|
|
||||||
public const SUPPLIES = 102;
|
public const SUPPLIES = 102;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,10 +37,10 @@ final class MaterialTypeL11nMapper extends DataMapperFactory
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const COLUMNS = [
|
public const COLUMNS = [
|
||||||
'itemmgmt_material_type_l11n_id' => ['name' => 'itemmgmt_material_type_l11n_id', 'type' => 'int', 'internal' => 'id'],
|
'itemmgmt_material_type_l11n_id' => ['name' => 'itemmgmt_material_type_l11n_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
'itemmgmt_material_type_l11n_title' => ['name' => 'itemmgmt_material_type_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
|
'itemmgmt_material_type_l11n_title' => ['name' => 'itemmgmt_material_type_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
|
||||||
'itemmgmt_material_type_l11n_type' => ['name' => 'itemmgmt_material_type_l11n_type', 'type' => 'int', 'internal' => 'ref'],
|
'itemmgmt_material_type_l11n_type' => ['name' => 'itemmgmt_material_type_l11n_type', 'type' => 'int', 'internal' => 'ref'],
|
||||||
'itemmgmt_material_type_l11n_language' => ['name' => 'itemmgmt_material_type_l11n_language', 'type' => 'string', 'internal' => 'language'],
|
'itemmgmt_material_type_l11n_language' => ['name' => 'itemmgmt_material_type_l11n_language', 'type' => 'string', 'internal' => 'language'],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ final class MaterialTypeMapper extends DataMapperFactory
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public const COLUMNS = [
|
public const COLUMNS = [
|
||||||
'itemmgmt_material_type_id' => ['name' => 'itemmgmt_material_type_id', 'type' => 'int', 'internal' => 'id'],
|
'itemmgmt_material_type_id' => ['name' => 'itemmgmt_material_type_id', 'type' => 'int', 'internal' => 'id'],
|
||||||
'itemmgmt_material_type_name' => ['name' => 'itemmgmt_material_type_name', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true],
|
'itemmgmt_material_type_name' => ['name' => 'itemmgmt_material_type_name', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -54,7 +54,7 @@ final class MaterialTypeMapper extends DataMapperFactory
|
||||||
'self' => 'itemmgmt_material_type_l11n_type',
|
'self' => 'itemmgmt_material_type_l11n_type',
|
||||||
'column' => 'content',
|
'column' => 'content',
|
||||||
'external' => null,
|
'external' => null,
|
||||||
]
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
46
Models/NullContainer.php
Normal file
46
Models/NullContainer.php
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Jingga
|
||||||
|
*
|
||||||
|
* PHP Version 8.1
|
||||||
|
*
|
||||||
|
* @package Modules\ItemManagement\Models
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 2.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://jingga.app
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\ItemManagement\Models;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Null model
|
||||||
|
*
|
||||||
|
* @package Modules\ItemManagement\Models
|
||||||
|
* @license OMS License 2.0
|
||||||
|
* @link https://jingga.app
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
final class NullContainer extends Container
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param int $id Model id
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function __construct(int $id = 0)
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function jsonSerialize() : mixed
|
||||||
|
{
|
||||||
|
return ['id' => $this->id];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -23,5 +23,5 @@ return ['Navigation' => [
|
||||||
'List' => 'Liste',
|
'List' => 'Liste',
|
||||||
'Types' => 'Arten',
|
'Types' => 'Arten',
|
||||||
'Values' => 'Werte',
|
'Values' => 'Werte',
|
||||||
'Materials' => 'Materialien',
|
'Materials' => 'Materialien',
|
||||||
]];
|
]];
|
||||||
|
|
|
||||||
|
|
@ -23,5 +23,5 @@ return ['Navigation' => [
|
||||||
'List' => 'List',
|
'List' => 'List',
|
||||||
'Types' => 'Types',
|
'Types' => 'Types',
|
||||||
'Values' => 'Values',
|
'Values' => 'Values',
|
||||||
'Materials' => 'Materials',
|
'Materials' => 'Materials',
|
||||||
]];
|
]];
|
||||||
|
|
|
||||||
|
|
@ -13,150 +13,150 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
return ['ItemManagement' => [
|
return ['ItemManagement' => [
|
||||||
'Accounting' => 'Buchhaltung',
|
'Accounting' => 'Buchhaltung',
|
||||||
'Address' => 'Adresse',
|
'Address' => 'Adresse',
|
||||||
'Articlegroup' => 'ArtikelGroup.',
|
'Articlegroup' => 'ArtikelGroup.',
|
||||||
'Attribute' => 'Attribut',
|
'Attribute' => 'Attribut',
|
||||||
'AttributeTypes' => 'Attributtypen',
|
'AttributeTypes' => 'Attributtypen',
|
||||||
'Attributes' => 'Attribute',
|
'Attributes' => 'Attribute',
|
||||||
'Available' => 'Erhältlich',
|
'Available' => 'Erhältlich',
|
||||||
'AvgPrice' => 'Durchschn. Preis',
|
'AvgPrice' => 'Durchschn. Preis',
|
||||||
'Bills' => 'Rechnungen',
|
'Bills' => 'Rechnungen',
|
||||||
'Bonus' => 'Bonus',
|
'Bonus' => 'Bonus',
|
||||||
'ClientGroup' => 'Client / Gruppe.',
|
'ClientGroup' => 'Client / Gruppe.',
|
||||||
'ClientSection' => 'Kundensparte',
|
'ClientSection' => 'Kundensparte',
|
||||||
'ClientSegment' => 'Kundensegment',
|
'ClientSegment' => 'Kundensegment',
|
||||||
'ClientType' => 'Kundentyp',
|
'ClientType' => 'Kundentyp',
|
||||||
'Commission' => 'Kommission',
|
'Commission' => 'Kommission',
|
||||||
'Container' => 'Container',
|
'Container' => 'Container',
|
||||||
'CostCenter' => 'Kostenstelle',
|
'CostCenter' => 'Kostenstelle',
|
||||||
'CostIndicator' => 'Kostenindikator',
|
'CostIndicator' => 'Kostenindikator',
|
||||||
'CostObject' => 'Kostenträger',
|
'CostObject' => 'Kostenträger',
|
||||||
'Countries' => 'Länder',
|
'Countries' => 'Länder',
|
||||||
'Country' => 'Land',
|
'Country' => 'Land',
|
||||||
'Created' => 'Erstellt',
|
'Created' => 'Erstellt',
|
||||||
'CreatedAt' => 'Erstellt',
|
'CreatedAt' => 'Erstellt',
|
||||||
'CustomerGroup' => 'Kundengruppe',
|
'CustomerGroup' => 'Kundengruppe',
|
||||||
'CustomsID' => 'Zoll-ID.',
|
'CustomsID' => 'Zoll-ID.',
|
||||||
'Date' => 'Datum',
|
'Date' => 'Datum',
|
||||||
'Description' => 'Beschreibung',
|
'Description' => 'Beschreibung',
|
||||||
'Discount' => 'Rabatt',
|
'Discount' => 'Rabatt',
|
||||||
'DiscountP' => 'Rabatt in%',
|
'DiscountP' => 'Rabatt in%',
|
||||||
'Disposal' => 'Entsorgung',
|
'Disposal' => 'Entsorgung',
|
||||||
'Documents' => 'Unterlagen',
|
'Documents' => 'Unterlagen',
|
||||||
'EarningIndicator' => 'Indikator verdienen',
|
'EarningIndicator' => 'Indikator verdienen',
|
||||||
'End' => 'Ende',
|
'End' => 'Ende',
|
||||||
'Files' => 'Dateien',
|
'Files' => 'Dateien',
|
||||||
'General' => 'Allgemein',
|
'General' => 'Allgemein',
|
||||||
'GrossWeight' => 'Bruttogewicht',
|
'GrossWeight' => 'Bruttogewicht',
|
||||||
'Group' => 'Gruppe',
|
'Group' => 'Gruppe',
|
||||||
'Groups' => 'Gruppen',
|
'Groups' => 'Gruppen',
|
||||||
'Height' => 'Höhe',
|
'Height' => 'Höhe',
|
||||||
'ID' => 'ID',
|
'ID' => 'ID',
|
||||||
'ILV' => 'ILV',
|
'ILV' => 'ILV',
|
||||||
'Info' => 'Die Info',
|
'Info' => 'Die Info',
|
||||||
'Item' => 'Artikel',
|
'Item' => 'Artikel',
|
||||||
'ItemSection' => 'Artikelsparte',
|
'ItemSection' => 'Artikelsparte',
|
||||||
'ItemSegment' => 'Artikelsegment',
|
'ItemSegment' => 'Artikelsegment',
|
||||||
'ItemType' => 'Artikeltyp',
|
'ItemType' => 'Artikeltyp',
|
||||||
'Items' => 'Produkte',
|
'Items' => 'Produkte',
|
||||||
'Language' => 'Sprache',
|
'Language' => 'Sprache',
|
||||||
'LastOrder' => 'Letzte Bestellung',
|
'LastOrder' => 'Letzte Bestellung',
|
||||||
'Leadtime' => 'Vorlaufzeit',
|
'Leadtime' => 'Vorlaufzeit',
|
||||||
'Length' => 'Länge',
|
'Length' => 'Länge',
|
||||||
'Localization' => 'Lokalisierung',
|
'Localization' => 'Lokalisierung',
|
||||||
'Localizations' => 'Lokalisierungen',
|
'Localizations' => 'Lokalisierungen',
|
||||||
'Location' => 'Ort',
|
'Location' => 'Ort',
|
||||||
'Log' => 'Protokoll',
|
'Log' => 'Protokoll',
|
||||||
'Logs' => 'Protokoll',
|
'Logs' => 'Protokoll',
|
||||||
'Lot' => 'Viel',
|
'Lot' => 'Viel',
|
||||||
'MRR' => 'Mrr.',
|
'MRR' => 'Mrr.',
|
||||||
'MTDSales' => 'MTD-Verkäufe.',
|
'MTDSales' => 'MTD-Verkäufe.',
|
||||||
'Makespan' => 'Makespan',
|
'Makespan' => 'Makespan',
|
||||||
'Margin' => 'Rand',
|
'Margin' => 'Rand',
|
||||||
'Master' => 'Meister',
|
'Master' => 'Meister',
|
||||||
'MaximumLevel' => 'Maximaler Lagerstand',
|
'MaximumLevel' => 'Maximaler Lagerstand',
|
||||||
'Media' => 'Medien',
|
'Media' => 'Medien',
|
||||||
'MinimumLevel' => 'Mindestbestandstufe',
|
'MinimumLevel' => 'Mindestbestandstufe',
|
||||||
'Modified' => 'Geändert',
|
'Modified' => 'Geändert',
|
||||||
'Name' => 'Name',
|
'Name' => 'Name',
|
||||||
'Name1' => 'Name1.',
|
'Name1' => 'Name1.',
|
||||||
'Name2' => 'Name2.',
|
'Name2' => 'Name2.',
|
||||||
'Name3' => 'Name3.',
|
'Name3' => 'Name3.',
|
||||||
'Net' => 'Netto',
|
'Net' => 'Netto',
|
||||||
'NetWeight' => 'Reingewicht',
|
'NetWeight' => 'Reingewicht',
|
||||||
'None' => 'Keiner',
|
'None' => 'Keiner',
|
||||||
'Notes' => 'Anmerkungen',
|
'Notes' => 'Anmerkungen',
|
||||||
'Number' => 'Nummer',
|
'Number' => 'Nummer',
|
||||||
'Ordered' => 'Bestellt',
|
'Ordered' => 'Bestellt',
|
||||||
'Packaging' => 'Verpackung',
|
'Packaging' => 'Verpackung',
|
||||||
'Price' => 'Preis',
|
'Price' => 'Preis',
|
||||||
'PriceChange' => 'Preisänderung',
|
'PriceChange' => 'Preisänderung',
|
||||||
'PriceUnit' => 'Preiseinheit.',
|
'PriceUnit' => 'Preiseinheit.',
|
||||||
'Prices' => 'Preise',
|
'Prices' => 'Preise',
|
||||||
'Pricing' => 'Preise',
|
'Pricing' => 'Preise',
|
||||||
'Procurement' => 'Beschaffung',
|
'Procurement' => 'Beschaffung',
|
||||||
'Productgroup' => 'Produktgruppe',
|
'Productgroup' => 'Produktgruppe',
|
||||||
'Production' => 'Produktion',
|
'Production' => 'Produktion',
|
||||||
'Profile' => 'Profil',
|
'Profile' => 'Profil',
|
||||||
'Properties' => 'Eigenschaften',
|
'Properties' => 'Eigenschaften',
|
||||||
'Property' => 'Eigentum',
|
'Property' => 'Eigentum',
|
||||||
'Purchase' => 'Kaufen',
|
'Purchase' => 'Kaufen',
|
||||||
'PurchasePrice' => 'Kaufpreis',
|
'PurchasePrice' => 'Kaufpreis',
|
||||||
'Purchasing' => 'Einkauf',
|
'Purchasing' => 'Einkauf',
|
||||||
'QA' => 'Qualitätssicherung',
|
'QA' => 'Qualitätssicherung',
|
||||||
'QM' => 'Qualitätsmanagement',
|
'QM' => 'Qualitätsmanagement',
|
||||||
'Quantity' => 'Menge',
|
'Quantity' => 'Menge',
|
||||||
'QuantityUnit' => 'Einheit der Menge.',
|
'QuantityUnit' => 'Einheit der Menge.',
|
||||||
'RecentInvoices' => 'Neuste Rechnungen',
|
'RecentInvoices' => 'Neuste Rechnungen',
|
||||||
'ReorderLevel' => 'Neuordnungspegel',
|
'ReorderLevel' => 'Neuordnungspegel',
|
||||||
'Reserved' => 'Reserviert',
|
'Reserved' => 'Reserviert',
|
||||||
'SN' => 'SN',
|
'SN' => 'SN',
|
||||||
'Sales' => 'Umsatz',
|
'Sales' => 'Umsatz',
|
||||||
'SalesPrice' => 'Verkaufspreis',
|
'SalesPrice' => 'Verkaufspreis',
|
||||||
'SalesPricing' => 'Verkaufspreise',
|
'SalesPricing' => 'Verkaufspreise',
|
||||||
'Segment' => 'Segment',
|
'Segment' => 'Segment',
|
||||||
'ShelfLife' => 'Haltbarkeit.',
|
'ShelfLife' => 'Haltbarkeit.',
|
||||||
'Start' => 'Start',
|
'Start' => 'Start',
|
||||||
'Status' => 'Status',
|
'Status' => 'Status',
|
||||||
'Stock' => 'Aktie',
|
'Stock' => 'Aktie',
|
||||||
'StockList' => 'Lagerliste',
|
'StockList' => 'Lagerliste',
|
||||||
'Successor' => 'Nachfolger',
|
'Successor' => 'Nachfolger',
|
||||||
'Supplier' => 'Anbieter',
|
'Supplier' => 'Anbieter',
|
||||||
'Text' => 'Text',
|
'Text' => 'Text',
|
||||||
'TimeUnit' => 'Zeiteinheit',
|
'TimeUnit' => 'Zeiteinheit',
|
||||||
'Title' => 'Titel',
|
'Title' => 'Titel',
|
||||||
'TopCustomers' => 'Top Kunden',
|
'TopCustomers' => 'Top Kunden',
|
||||||
'Tracking' => 'Verfolgung',
|
'Tracking' => 'Verfolgung',
|
||||||
'TradingUnit' => 'Handelseinheit',
|
'TradingUnit' => 'Handelseinheit',
|
||||||
'Translation' => 'Übersetzung',
|
'Translation' => 'Übersetzung',
|
||||||
'Type' => 'Typ',
|
'Type' => 'Typ',
|
||||||
'Unit' => 'Einheit',
|
'Unit' => 'Einheit',
|
||||||
'Value' => 'Wert',
|
'Value' => 'Wert',
|
||||||
'Volume' => 'Volumen',
|
'Volume' => 'Volumen',
|
||||||
'Warehouse' => 'Lagerhaus',
|
'Warehouse' => 'Lagerhaus',
|
||||||
'Width' => 'Breite',
|
'Width' => 'Breite',
|
||||||
'YTDSales' => 'Ytd Sales',
|
'YTDSales' => 'Ytd Sales',
|
||||||
'ItemProductGroup' => 'Artikel Produktgruppe',
|
'ItemProductGroup' => 'Artikel Produktgruppe',
|
||||||
'ItemSalesGroup' => 'Artikel Umsatzgruppe',
|
'ItemSalesGroup' => 'Artikel Umsatzgruppe',
|
||||||
'Promocode' => 'Promocode',
|
'Promocode' => 'Promocode',
|
||||||
'Region' => 'Region',
|
'Region' => 'Region',
|
||||||
'Materials' => 'Materialien',
|
'Materials' => 'Materialien',
|
||||||
'Weight' => 'Gewicht',
|
'Weight' => 'Gewicht',
|
||||||
'Depth' => 'Tiefe',
|
'Depth' => 'Tiefe',
|
||||||
'WidthLength' => 'Breite/Länge',
|
'WidthLength' => 'Breite/Länge',
|
||||||
'MaximumOrderInterval' => 'Maximales Bestellintervall',
|
'MaximumOrderInterval' => 'Maximales Bestellintervall',
|
||||||
'MinimumOrderQuantity' => 'Mindestbestellmenge',
|
'MinimumOrderQuantity' => 'Mindestbestellmenge',
|
||||||
'PrimarySupplier' => 'Hauptlieferant',
|
'PrimarySupplier' => 'Hauptlieferant',
|
||||||
'LeadTime' => 'Lieferzeit',
|
'LeadTime' => 'Lieferzeit',
|
||||||
'UnitQuantity' => 'Einheitsmenge',
|
'UnitQuantity' => 'Einheitsmenge',
|
||||||
'UnitPrice' => 'Einheitspreis',
|
'UnitPrice' => 'Einheitspreis',
|
||||||
'Lieferanten' => 'Lieferanten',
|
'Lieferanten' => 'Lieferanten',
|
||||||
'CostCenter' => 'Kostenstelle',
|
'CostCenter' => 'Kostenstelle',
|
||||||
'CostObject' => 'Kostenträger',
|
'CostObject' => 'Kostenträger',
|
||||||
'DefaultStock' => 'Standard Lager',
|
'DefaultStock' => 'Standard Lager',
|
||||||
'DefaultStockLocation' => 'Standard Lagerplatz',
|
'DefaultStockLocation' => 'Standard Lagerplatz',
|
||||||
'Inventory' => 'Bestandsführung',
|
'Inventory' => 'Bestandsführung',
|
||||||
'Identifier' => 'Identifizierung',
|
'Identifier' => 'Identifizierung',
|
||||||
'Stocktaking' => 'Inventur',
|
'Stocktaking' => 'Inventur',
|
||||||
]];
|
]];
|
||||||
|
|
|
||||||
|
|
@ -13,150 +13,150 @@
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
return ['ItemManagement' => [
|
return ['ItemManagement' => [
|
||||||
'Accounting' => 'Accounting',
|
'Accounting' => 'Accounting',
|
||||||
'Address' => 'Address',
|
'Address' => 'Address',
|
||||||
'Articlegroup' => 'Articlegroup',
|
'Articlegroup' => 'Articlegroup',
|
||||||
'Attribute' => 'Attribute',
|
'Attribute' => 'Attribute',
|
||||||
'AttributeTypes' => 'Attribute types',
|
'AttributeTypes' => 'Attribute types',
|
||||||
'Attributes' => 'Attributes',
|
'Attributes' => 'Attributes',
|
||||||
'Available' => 'Available',
|
'Available' => 'Available',
|
||||||
'AvgPrice' => 'Avg. Price',
|
'AvgPrice' => 'Avg. Price',
|
||||||
'Bills' => 'Bills',
|
'Bills' => 'Bills',
|
||||||
'Bonus' => 'Bonus',
|
'Bonus' => 'Bonus',
|
||||||
'ClientGroup' => 'Client Group',
|
'ClientGroup' => 'Client Group',
|
||||||
'ClientSection' => 'Client Section',
|
'ClientSection' => 'Client Section',
|
||||||
'ClientSegment' => 'Client Segment',
|
'ClientSegment' => 'Client Segment',
|
||||||
'ClientType' => 'Client Type',
|
'ClientType' => 'Client Type',
|
||||||
'Commission' => 'Commission',
|
'Commission' => 'Commission',
|
||||||
'Container' => 'Container',
|
'Container' => 'Container',
|
||||||
'CostCenter' => 'CostCenter',
|
'CostCenter' => 'CostCenter',
|
||||||
'CostIndicator' => 'Cost Indicator',
|
'CostIndicator' => 'Cost Indicator',
|
||||||
'CostObject' => 'CostObject',
|
'CostObject' => 'CostObject',
|
||||||
'Countries' => 'Countries',
|
'Countries' => 'Countries',
|
||||||
'Country' => 'Country',
|
'Country' => 'Country',
|
||||||
'Created' => 'Created',
|
'Created' => 'Created',
|
||||||
'CreatedAt' => 'Created',
|
'CreatedAt' => 'Created',
|
||||||
'CustomerGroup' => 'Customer Group',
|
'CustomerGroup' => 'Customer Group',
|
||||||
'CustomsID' => 'Customs ID',
|
'CustomsID' => 'Customs ID',
|
||||||
'Date' => 'Date',
|
'Date' => 'Date',
|
||||||
'Description' => 'Description',
|
'Description' => 'Description',
|
||||||
'Discount' => 'Discount',
|
'Discount' => 'Discount',
|
||||||
'DiscountP' => 'Discount in %',
|
'DiscountP' => 'Discount in %',
|
||||||
'Disposal' => 'Disposal',
|
'Disposal' => 'Disposal',
|
||||||
'Documents' => 'Documents',
|
'Documents' => 'Documents',
|
||||||
'EarningIndicator' => 'Earning Indicator',
|
'EarningIndicator' => 'Earning Indicator',
|
||||||
'End' => 'End',
|
'End' => 'End',
|
||||||
'Files' => 'Files',
|
'Files' => 'Files',
|
||||||
'General' => 'General',
|
'General' => 'General',
|
||||||
'GrossWeight' => 'Gross Weight',
|
'GrossWeight' => 'Gross Weight',
|
||||||
'Group' => 'Group',
|
'Group' => 'Group',
|
||||||
'Groups' => 'Groups',
|
'Groups' => 'Groups',
|
||||||
'Height' => 'Height',
|
'Height' => 'Height',
|
||||||
'ID' => 'ID',
|
'ID' => 'ID',
|
||||||
'ILV' => 'ILV',
|
'ILV' => 'ILV',
|
||||||
'Info' => 'Info',
|
'Info' => 'Info',
|
||||||
'Item' => 'Item',
|
'Item' => 'Item',
|
||||||
'ItemSection' => 'Item Section',
|
'ItemSection' => 'Item Section',
|
||||||
'ItemSegment' => 'Item Segment',
|
'ItemSegment' => 'Item Segment',
|
||||||
'ItemType' => 'Item Type',
|
'ItemType' => 'Item Type',
|
||||||
'Items' => 'Items',
|
'Items' => 'Items',
|
||||||
'Language' => 'Language',
|
'Language' => 'Language',
|
||||||
'LastOrder' => 'Last Order',
|
'LastOrder' => 'Last Order',
|
||||||
'Leadtime' => 'Lead time',
|
'Leadtime' => 'Lead time',
|
||||||
'Length' => 'Length',
|
'Length' => 'Length',
|
||||||
'Localization' => 'Localization',
|
'Localization' => 'Localization',
|
||||||
'Localizations' => 'Localizations',
|
'Localizations' => 'Localizations',
|
||||||
'Location' => 'Location',
|
'Location' => 'Location',
|
||||||
'Log' => 'Log',
|
'Log' => 'Log',
|
||||||
'Logs' => 'Logs',
|
'Logs' => 'Logs',
|
||||||
'Lot' => 'Lot',
|
'Lot' => 'Lot',
|
||||||
'MRR' => 'MRR',
|
'MRR' => 'MRR',
|
||||||
'MTDSales' => 'MTD Sales',
|
'MTDSales' => 'MTD Sales',
|
||||||
'Makespan' => 'Makespan',
|
'Makespan' => 'Makespan',
|
||||||
'Margin' => 'Margin',
|
'Margin' => 'Margin',
|
||||||
'Master' => 'Master',
|
'Master' => 'Master',
|
||||||
'MaximumLevel' => 'Maximum stock level',
|
'MaximumLevel' => 'Maximum stock level',
|
||||||
'Media' => 'Media',
|
'Media' => 'Media',
|
||||||
'MinimumLevel' => 'Minimum stock level',
|
'MinimumLevel' => 'Minimum stock level',
|
||||||
'Modified' => 'Modified',
|
'Modified' => 'Modified',
|
||||||
'Name' => 'Name',
|
'Name' => 'Name',
|
||||||
'Name1' => 'Name1',
|
'Name1' => 'Name1',
|
||||||
'Name2' => 'Name2',
|
'Name2' => 'Name2',
|
||||||
'Name3' => 'Name3',
|
'Name3' => 'Name3',
|
||||||
'Net' => 'Net',
|
'Net' => 'Net',
|
||||||
'NetWeight' => 'Net Weight',
|
'NetWeight' => 'Net Weight',
|
||||||
'None' => 'None',
|
'None' => 'None',
|
||||||
'Notes' => 'Notes',
|
'Notes' => 'Notes',
|
||||||
'Number' => 'Number',
|
'Number' => 'Number',
|
||||||
'Ordered' => 'Ordered',
|
'Ordered' => 'Ordered',
|
||||||
'Packaging' => 'Packaging',
|
'Packaging' => 'Packaging',
|
||||||
'Price' => 'Price',
|
'Price' => 'Price',
|
||||||
'PriceChange' => 'Price Change',
|
'PriceChange' => 'Price Change',
|
||||||
'PriceUnit' => 'Unit of price',
|
'PriceUnit' => 'Unit of price',
|
||||||
'Prices' => 'Prices',
|
'Prices' => 'Prices',
|
||||||
'Pricing' => 'Pricing',
|
'Pricing' => 'Pricing',
|
||||||
'Procurement' => 'Procurement',
|
'Procurement' => 'Procurement',
|
||||||
'Productgroup' => 'Productgroup',
|
'Productgroup' => 'Productgroup',
|
||||||
'Production' => 'Production',
|
'Production' => 'Production',
|
||||||
'Profile' => 'Profile',
|
'Profile' => 'Profile',
|
||||||
'Properties' => 'Properties',
|
'Properties' => 'Properties',
|
||||||
'Property' => 'Property',
|
'Property' => 'Property',
|
||||||
'Purchase' => 'Purchase',
|
'Purchase' => 'Purchase',
|
||||||
'PurchasePrice' => 'Purchase Price',
|
'PurchasePrice' => 'Purchase Price',
|
||||||
'Purchasing' => 'Purchasing',
|
'Purchasing' => 'Purchasing',
|
||||||
'QA' => 'QA',
|
'QA' => 'QA',
|
||||||
'QM' => 'QM',
|
'QM' => 'QM',
|
||||||
'Quantity' => 'Quantity',
|
'Quantity' => 'Quantity',
|
||||||
'QuantityUnit' => 'Unit of quantity',
|
'QuantityUnit' => 'Unit of quantity',
|
||||||
'RecentInvoices' => 'Recent invoices',
|
'RecentInvoices' => 'Recent invoices',
|
||||||
'ReorderLevel' => 'Reorder level',
|
'ReorderLevel' => 'Reorder level',
|
||||||
'Reserved' => 'Reserved',
|
'Reserved' => 'Reserved',
|
||||||
'SN' => 'SN',
|
'SN' => 'SN',
|
||||||
'Sales' => 'Sales',
|
'Sales' => 'Sales',
|
||||||
'SalesPrice' => 'Sales Price',
|
'SalesPrice' => 'Sales Price',
|
||||||
'SalesPricing' => 'Sales Pricing',
|
'SalesPricing' => 'Sales Pricing',
|
||||||
'Segment' => 'Segment',
|
'Segment' => 'Segment',
|
||||||
'ShelfLife' => 'Shelf life',
|
'ShelfLife' => 'Shelf life',
|
||||||
'Start' => 'Start',
|
'Start' => 'Start',
|
||||||
'Status' => 'Status',
|
'Status' => 'Status',
|
||||||
'Stock' => 'Stock',
|
'Stock' => 'Stock',
|
||||||
'StockList' => 'Stock list',
|
'StockList' => 'Stock list',
|
||||||
'Successor' => 'Successor',
|
'Successor' => 'Successor',
|
||||||
'Supplier' => 'Supplier',
|
'Supplier' => 'Supplier',
|
||||||
'Text' => 'Text',
|
'Text' => 'Text',
|
||||||
'TimeUnit' => 'Unit of time',
|
'TimeUnit' => 'Unit of time',
|
||||||
'Title' => 'Title',
|
'Title' => 'Title',
|
||||||
'TopCustomers' => 'Top Customers',
|
'TopCustomers' => 'Top Customers',
|
||||||
'Tracking' => 'Tracking',
|
'Tracking' => 'Tracking',
|
||||||
'TradingUnit' => 'Trading Unit',
|
'TradingUnit' => 'Trading Unit',
|
||||||
'Translation' => 'Translation',
|
'Translation' => 'Translation',
|
||||||
'Type' => 'Type',
|
'Type' => 'Type',
|
||||||
'Unit' => 'Unit',
|
'Unit' => 'Unit',
|
||||||
'Value' => 'Value',
|
'Value' => 'Value',
|
||||||
'Volume' => 'Volume',
|
'Volume' => 'Volume',
|
||||||
'Warehouse' => 'Warehouse',
|
'Warehouse' => 'Warehouse',
|
||||||
'Width' => 'Width',
|
'Width' => 'Width',
|
||||||
'YTDSales' => 'YTD Sales',
|
'YTDSales' => 'YTD Sales',
|
||||||
'ItemProductGroup' => 'Item Product Group',
|
'ItemProductGroup' => 'Item Product Group',
|
||||||
'ItemSalesGroup' => 'Item Sales Group',
|
'ItemSalesGroup' => 'Item Sales Group',
|
||||||
'Promocode' => 'Promocode',
|
'Promocode' => 'Promocode',
|
||||||
'Region' => 'Region',
|
'Region' => 'Region',
|
||||||
'Materials' => 'Materials',
|
'Materials' => 'Materials',
|
||||||
'Weight' => 'Weight',
|
'Weight' => 'Weight',
|
||||||
'Depth' => 'Depth',
|
'Depth' => 'Depth',
|
||||||
'WidthLength' => 'Width/Length',
|
'WidthLength' => 'Width/Length',
|
||||||
'MaximumOrderInterval' => 'Maximum Order Interval',
|
'MaximumOrderInterval' => 'Maximum Order Interval',
|
||||||
'MinimumOrderQuantity' => 'Minimum Order Quantity',
|
'MinimumOrderQuantity' => 'Minimum Order Quantity',
|
||||||
'PrimarySupplier' => 'Primary Supplier',
|
'PrimarySupplier' => 'Primary Supplier',
|
||||||
'LeadTime' => 'Lead Time',
|
'LeadTime' => 'Lead Time',
|
||||||
'UnitQuantity' => 'Unit Quantity',
|
'UnitQuantity' => 'Unit Quantity',
|
||||||
'UnitPrice' => 'Unit Price',
|
'UnitPrice' => 'Unit Price',
|
||||||
'Suppliers' => 'Suppliers',
|
'Suppliers' => 'Suppliers',
|
||||||
'CostCenter' => 'Cost Center',
|
'CostCenter' => 'Cost Center',
|
||||||
'CostObject' => 'Cost Object',
|
'CostObject' => 'Cost Object',
|
||||||
'DefaultStock' => 'Default stock',
|
'DefaultStock' => 'Default stock',
|
||||||
'DefaultStockLocation' => 'Default stock location',
|
'DefaultStockLocation' => 'Default stock location',
|
||||||
'Inventory' => 'Inventory',
|
'Inventory' => 'Inventory',
|
||||||
'Identifier' => 'Identifier',
|
'Identifier' => 'Identifier',
|
||||||
'Stocktaking' => 'Stocktaking',
|
'Stocktaking' => 'Stocktaking',
|
||||||
]];
|
]];
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="#"><i class="g-icon">close</i></a>
|
<td><a href="#"><i class="g-icon">close</i></a>
|
||||||
<td><a href="#"><i class="g-icon">settings</i></a>
|
<td><a href="#"><i class="g-icon">settings</i></a>
|
||||||
<td><?= ISO639Enum::getByName('_' . \strtoupper($value->getLanguage())); ?>
|
<td><?= ISO639Enum::getByName('_' . \strtoupper($value->language)); ?>
|
||||||
<td><?= $value->content; ?>
|
<td><?= $value->content; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php if ($c === 0) : ?>
|
<?php if ($c === 0) : ?>
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@
|
||||||
*/
|
*/
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Modules\ItemManagement\Models\StockIdentifierType;
|
||||||
|
use phpOMS\Stdlib\Base\FloatInt;
|
||||||
use phpOMS\Uri\UriFactory;
|
use phpOMS\Uri\UriFactory;
|
||||||
|
|
||||||
/** @var \phpOMS\Views\View $this */
|
/** @var \phpOMS\Views\View $this */
|
||||||
|
|
@ -128,7 +130,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $count = 0; foreach ($items as $key => $value) : ++$count;
|
<?php $count = 0; foreach ($items as $key => $value) : ++$count;
|
||||||
$url = UriFactory::build('{/base}/item/profile?{?}&id=' . $value->id);
|
$url = UriFactory::build('{/base}/item/view?{?}&id=' . $value->id);
|
||||||
$image = $value->getFileByTypeName('item_profile_image');
|
$image = $value->getFileByTypeName('item_profile_image');
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
|
|
@ -140,10 +142,37 @@ echo $this->data['nav']->render(); ?>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name1')->content); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name1')->content); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name2')->content); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name2')->content); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name3')->content); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name3')->content); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->getCurrency($value->salesPrice); ?></a>
|
<td class="rightText"><a href="<?= $url; ?>"><?= $this->getCurrency($value->salesPrice, symbol: ''); ?></a>
|
||||||
<td>
|
<?php if ($value->stockIdentifier === StockIdentifierType::NONE) : ?>
|
||||||
<td>
|
<td>
|
||||||
<td>
|
<td>
|
||||||
|
<td>
|
||||||
|
<?php else : ?>
|
||||||
|
<td class="rightText"><a href="<?= $url; ?>">
|
||||||
|
<?php
|
||||||
|
$sum = 0;
|
||||||
|
foreach ($this->data['dists'][$value->id] ?? [] as $dist) {
|
||||||
|
$sum += $dist->quantity;
|
||||||
|
}
|
||||||
|
$total = new FloatInt($sum);
|
||||||
|
|
||||||
|
echo $total->getAmount(\reset($value->container)->quantityDecimals);
|
||||||
|
?></a>
|
||||||
|
|
||||||
|
<td class="rightText"><a href="<?= $url; ?>">
|
||||||
|
<?php
|
||||||
|
$total = new FloatInt($this->data['reserved'][$value->id] ?? 0);
|
||||||
|
|
||||||
|
echo $total->getAmount(\reset($value->container)->quantityDecimals);
|
||||||
|
?></a>
|
||||||
|
|
||||||
|
<td class="rightText"><a href="<?= $url; ?>">
|
||||||
|
<?php
|
||||||
|
$total = new FloatInt($this->data['ordered'][$value->id] ?? 0);
|
||||||
|
|
||||||
|
echo $total->getAmount(\reset($value->container)->quantityDecimals);
|
||||||
|
?></a>
|
||||||
|
<?php endif; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php if ($count === 0) : ?>
|
<?php if ($count === 0) : ?>
|
||||||
<tr><td colspan="9" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
<tr><td colspan="9" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
|
|
|
||||||
201
Theme/Backend/item-profile.tpl.php → Theme/Backend/item-view.tpl.php
Executable file → Normal file
201
Theme/Backend/item-profile.tpl.php → Theme/Backend/item-view.tpl.php
Executable file → Normal file
|
|
@ -24,7 +24,6 @@ use phpOMS\Localization\ISO3166NameEnum;
|
||||||
use phpOMS\Localization\ISO4217CharEnum;
|
use phpOMS\Localization\ISO4217CharEnum;
|
||||||
use phpOMS\Localization\ISO639Enum;
|
use phpOMS\Localization\ISO639Enum;
|
||||||
use phpOMS\Localization\Money;
|
use phpOMS\Localization\Money;
|
||||||
use phpOMS\Localization\NullLocalization;
|
|
||||||
use phpOMS\Localization\RegionEnum;
|
use phpOMS\Localization\RegionEnum;
|
||||||
use phpOMS\Message\Http\HttpHeader;
|
use phpOMS\Message\Http\HttpHeader;
|
||||||
use phpOMS\Stdlib\Base\SmartDateTime;
|
use phpOMS\Stdlib\Base\SmartDateTime;
|
||||||
|
|
@ -37,18 +36,15 @@ $notes = $item->notes;
|
||||||
$files = $item->files;
|
$files = $item->files;
|
||||||
$itemImage = $this->getData('itemImage') ?? new NullMedia();
|
$itemImage = $this->getData('itemImage') ?? new NullMedia();
|
||||||
|
|
||||||
$allInvoices = $this->data['allInvoices'] ?? [];
|
$allInvoices = $this->data['allInvoices'] ?? [];
|
||||||
$topCustomers = $this->getData('topCustomers') ?? [[], []];
|
$topCustomers = $this->getData('topCustomers') ?? [[], []];
|
||||||
$attributeView = $this->data['attributeView'];
|
$attributeView = $this->data['attributeView'];
|
||||||
$l11nView = $this->data['l11nView'];
|
$l11nView = $this->data['l11nView'];
|
||||||
|
|
||||||
$languages = ISO639Enum::getConstants();
|
$languages = ISO639Enum::getConstants();
|
||||||
|
|
||||||
/** @var \phpOMS\Localization\Localization $l11n */
|
$regions = RegionEnum::getConstants();
|
||||||
$l11n = $this->getData('default_localization') ?? new NullLocalization();
|
$countries = ISO3166CharEnum::getConstants();
|
||||||
|
|
||||||
$regions = RegionEnum::getConstants();
|
|
||||||
$countries = ISO3166CharEnum::getConstants();
|
|
||||||
$currencies = ISO4217CharEnum::getConstants();
|
$currencies = ISO4217CharEnum::getConstants();
|
||||||
|
|
||||||
echo $this->data['nav']->render();
|
echo $this->data['nav']->render();
|
||||||
|
|
@ -94,7 +90,7 @@ echo $this->data['nav']->render();
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<table class="layout wf-100">
|
<table class="layout wf-100">
|
||||||
<tr><td><label for="iId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
<tr><td><label for="iId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
||||||
<tr><td><span class="input"><button type="button" formaction=""><i class="g-icon">book</i></button><input type="number" id="iId" min="1" name="id" value="<?= $this->printHtml($item->number); ?>" disabled></span>
|
<tr><td><span class="input"><button type="button" formaction=""><i class="g-icon">book</i></button><input type="text" id="iId" min="1" name="id" value="<?= $this->printHtml($item->number); ?>" disabled></span>
|
||||||
<tr><td><label for="iName1"><?= $this->getHtml('Name1'); ?></label>
|
<tr><td><label for="iName1"><?= $this->getHtml('Name1'); ?></label>
|
||||||
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($item->getL11n('name1')->content); ?>" spellcheck="false" required>
|
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($item->getL11n('name1')->content); ?>" spellcheck="false" required>
|
||||||
<tr><td><label for="iName2"><?= $this->getHtml('Name2'); ?></label>
|
<tr><td><label for="iName2"><?= $this->getHtml('Name2'); ?></label>
|
||||||
|
|
@ -133,11 +129,11 @@ echo $this->data['nav']->render();
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<table class="wf-100">
|
<table class="wf-100">
|
||||||
<tr><td><?= $this->getHtml('YTDSales'); ?>:
|
<tr><td><?= $this->getHtml('YTDSales'); ?>:
|
||||||
<td><?= $this->getCurrency(SalesBillMapper::getItemNetSales($item->id, SmartDateTime::startOfYear($this->data['business_start']), new \DateTime('now')), format: 'medium'); ?>
|
<td><?= $this->getCurrency(SalesBillMapper::getItemNetSales($item->id, SmartDateTime::startOfYear($this->data['business_start']), new \DateTime('now')), symbol: '', format: 'medium'); ?>
|
||||||
<tr><td><?= $this->getHtml('MTDSales'); ?>:
|
<tr><td><?= $this->getHtml('MTDSales'); ?>:
|
||||||
<td><?= $this->getCurrency(SalesBillMapper::getItemNetSales($item->id, SmartDateTime::startOfMonth(), new \DateTime('now')), format: 'medium'); ?>
|
<td><?= $this->getCurrency(SalesBillMapper::getItemNetSales($item->id, SmartDateTime::startOfMonth(), new \DateTime('now')), symbol: '', format: 'medium'); ?>
|
||||||
<tr><td><?= $this->getHtml('ILV'); ?>:
|
<tr><td><?= $this->getHtml('ILV'); ?>:
|
||||||
<td><?= $this->getCurrency(SalesBillMapper::getILVHistoric($item->id), format: 'medium'); ?>
|
<td><?= $this->getCurrency(SalesBillMapper::getILVHistoric($item->id), symbol: '', format: 'medium'); ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -163,9 +159,9 @@ echo $this->data['nav']->render();
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<table class="wf-100">
|
<table class="wf-100">
|
||||||
<tr><td><?= $this->getHtml('SalesPrice'); ?>:
|
<tr><td><?= $this->getHtml('SalesPrice'); ?>:
|
||||||
<td><?= $this->getCurrency($item->salesPrice, format: 'medium'); ?>
|
<td><?= $this->getCurrency($item->salesPrice, symbol: '', format: 'medium'); ?>
|
||||||
<tr><td><?= $this->getHtml('PurchasePrice'); ?>:
|
<tr><td><?= $this->getHtml('PurchasePrice'); ?>:
|
||||||
<td><?= $this->getCurrency($item->purchasePrice, format: 'medium'); ?>
|
<td><?= $this->getCurrency($item->purchasePrice, symbol: '', format: 'medium'); ?>
|
||||||
<tr><td><?= $this->getHtml('Margin'); ?>:
|
<tr><td><?= $this->getHtml('Margin'); ?>:
|
||||||
<td><?= $this->getNumeric(
|
<td><?= $this->getNumeric(
|
||||||
$item->salesPrice->getInt() === 0
|
$item->salesPrice->getInt() === 0
|
||||||
|
|
@ -193,13 +189,19 @@ echo $this->data['nav']->render();
|
||||||
<td class="wf-100"><?= $this->getHtml('Title'); ?>
|
<td class="wf-100"><?= $this->getHtml('Title'); ?>
|
||||||
<td><?= $this->getHtml('CreatedAt'); ?>
|
<td><?= $this->getHtml('CreatedAt'); ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($notes as $note) :
|
<?php
|
||||||
$url = UriFactory::build('{/base}/editor/single?{?}&id=' . $note->id);
|
$count = 0;
|
||||||
?>
|
foreach ($notes as $note) :
|
||||||
|
++$count;
|
||||||
|
$url = UriFactory::build('{/base}/editor/view?{?}&id=' . $note->id);
|
||||||
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($note->title); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($note->title); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($note->createdAt->format('Y-m-d')); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($note->createdAt->format('Y-m-d')); ?></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
<?php if ($count === 0) : ?>
|
||||||
|
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
|
<?php endif; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -219,14 +221,20 @@ echo $this->data['nav']->render();
|
||||||
<td>
|
<td>
|
||||||
<td><?= $this->getHtml('CreatedAt'); ?>
|
<td><?= $this->getHtml('CreatedAt'); ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($files as $file) :
|
<?php
|
||||||
$url = UriFactory::build('{/base}/media/single?{?}&id=' . $file->id);
|
$count = 0;
|
||||||
?>
|
foreach ($files as $file) :
|
||||||
|
++$count;
|
||||||
|
$url = UriFactory::build('{/base}/media/view?{?}&id=' . $file->id);
|
||||||
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($file->name); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($file->name); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($file->extension); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($file->extension); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($file->createdAt->format('Y-m-d')); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($file->createdAt->format('Y-m-d')); ?></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
<?php if ($count === 0) : ?>
|
||||||
|
<tr><td colspan="3" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
|
<?php endif; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -258,17 +266,23 @@ echo $this->data['nav']->render();
|
||||||
->limit(5)
|
->limit(5)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
|
$count = 0;
|
||||||
|
|
||||||
/** @var \Modules\Billing\Models\Bill $invoice */
|
/** @var \Modules\Billing\Models\Bill $invoice */
|
||||||
foreach ($newestInvoices as $invoice) :
|
foreach ($newestInvoices as $invoice) :
|
||||||
|
++$count;
|
||||||
$url = UriFactory::build('{/base}/sales/bill?{?}&id=' . $invoice->id);
|
$url = UriFactory::build('{/base}/sales/bill?{?}&id=' . $invoice->id);
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($invoice->getNumber()); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($invoice->getNumber()); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($invoice->type->getL11n()); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($invoice->type->getL11n()); ?></a>
|
||||||
<td><a class="content" href="<?= UriFactory::build('{/base}/sales/client/profile?{?}&id=' . $invoice->client->id); ?>"><?= $this->printHtml($invoice->billTo); ?></a>
|
<td><a class="content" href="<?= UriFactory::build('{/base}/sales/client/view?{?}&id=' . $invoice->client->id); ?>"><?= $this->printHtml($invoice->billTo); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->getCurrency($invoice->netSales); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->getCurrency($invoice->netSales, symbol: ''); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($invoice->createdAt->format('Y-m-d')); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($invoice->createdAt->format('Y-m-d')); ?></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
<?php if ($count === 0) : ?>
|
||||||
|
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
|
<?php endif; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -293,12 +307,12 @@ echo $this->data['nav']->render();
|
||||||
<td><?= $this->getHtml('Net'); ?>
|
<td><?= $this->getHtml('Net'); ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $i = -1; foreach (($topCustomers[0] ?? []) as $client) : ++$i;
|
<?php $i = -1; foreach (($topCustomers[0] ?? []) as $client) : ++$i;
|
||||||
$url = UriFactory::build('{/base}/sales/client/profile?id=' . $client->id);
|
$url = UriFactory::build('{/base}/sales/client/view?id=' . $client->id);
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($client->number); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($client->number); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($client->account->name1); ?> <?= $this->printHtml($client->account->name2); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($client->account->name1); ?> <?= $this->printHtml($client->account->name2); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($client->mainAddress->getCountry()); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($client->mainAddress->country); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= (new Money((int) $topCustomers[1][$i]['net_sales']))->getCurrency(); ?></a>
|
<td><a href="<?= $url; ?>"><?= (new Money((int) $topCustomers[1][$i]['net_sales']))->getCurrency(); ?></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
</table>
|
||||||
|
|
@ -333,7 +347,7 @@ echo $this->data['nav']->render();
|
||||||
<?php
|
<?php
|
||||||
$temp = [];
|
$temp = [];
|
||||||
foreach ($monthlySalesCosts as $monthly) {
|
foreach ($monthlySalesCosts as $monthly) {
|
||||||
$temp[] = \round(((((int) $monthly['net_sales']) - ((int) $monthly['net_costs'])) / ((int) $monthly['net_sales'])) * 100, 2);
|
$temp[] = \round(((int) $monthly['net_sales']) === 0 ? 0 : ((((int) $monthly['net_sales']) - ((int) $monthly['net_costs'])) / ((int) $monthly['net_sales'])) * 100, 2);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<?= \implode(',', $temp); ?>
|
<?= \implode(',', $temp); ?>
|
||||||
|
|
@ -394,9 +408,7 @@ echo $this->data['nav']->render();
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<?php
|
<?php
|
||||||
$regionSales = [];
|
$regionSales = [];
|
||||||
if (!empty($regionSales)) : ?>
|
if (!empty($regionSales)) : ?>
|
||||||
|
|
@ -585,6 +597,7 @@ echo $this->data['nav']->render();
|
||||||
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
<td><?= $this->getHtml('ID', '0', '0'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
||||||
<td><?= $this->getHtml('Name'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
<td><?= $this->getHtml('Name'); ?><i class="sort-asc g-icon">expand_less</i><i class="sort-desc g-icon">expand_more</i>
|
||||||
<td><?= $this->getHtml('Quantity'); ?>
|
<td><?= $this->getHtml('Quantity'); ?>
|
||||||
|
<td><?= $this->getHtml('Decimals'); ?>
|
||||||
<td><?= $this->getHtml('Weight'); ?>
|
<td><?= $this->getHtml('Weight'); ?>
|
||||||
<td><?= $this->getHtml('WidthLength'); ?>
|
<td><?= $this->getHtml('WidthLength'); ?>
|
||||||
<td><?= $this->getHtml('Height'); ?>
|
<td><?= $this->getHtml('Height'); ?>
|
||||||
|
|
@ -604,6 +617,7 @@ echo $this->data['nav']->render();
|
||||||
<td data-tpl-text="/id" data-tpl-value="/id"></td>
|
<td data-tpl-text="/id" data-tpl-value="/id"></td>
|
||||||
<td data-tpl-text="/name" data-tpl-value="/name" data-value=""></td>
|
<td data-tpl-text="/name" data-tpl-value="/name" data-value=""></td>
|
||||||
<td data-tpl-text="/quantity" data-tpl-value="/quantity"></td>
|
<td data-tpl-text="/quantity" data-tpl-value="/quantity"></td>
|
||||||
|
<td data-tpl-text="/decimals" data-tpl-value="/decimals"></td>
|
||||||
<td data-tpl-text="/weight" data-tpl-value="/weight"></td>
|
<td data-tpl-text="/weight" data-tpl-value="/weight"></td>
|
||||||
<td data-tpl-text="/width" data-tpl-value="/width"></td>
|
<td data-tpl-text="/width" data-tpl-value="/width"></td>
|
||||||
<td data-tpl-text="/height" data-tpl-value="/height"></td>
|
<td data-tpl-text="/height" data-tpl-value="/height"></td>
|
||||||
|
|
@ -612,14 +626,14 @@ echo $this->data['nav']->render();
|
||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
<?php
|
<?php
|
||||||
$c = 0;
|
$c = 0;
|
||||||
$containers = $this->data['containers'] ?? [];
|
$containers = $this->data['containers'] ?? [];
|
||||||
foreach ($containers as $key => $value) : ++$c;
|
foreach ($containers as $key => $value) : ++$c;
|
||||||
?>
|
?>
|
||||||
<tr data-id="<?= $value->id; ?>">
|
<tr data-id="<?= $value->id; ?>">
|
||||||
<td>
|
<td>
|
||||||
<i class="g-icon btn update-form">settings</i>
|
<i class="g-icon btn update-form">settings</i>
|
||||||
<?php if ($value->name !== 'base') : ?>
|
<?php if ($value->name !== 'default') : ?>
|
||||||
<input id="itemContainerTable-remove-<?= $value->id; ?>" type="checkbox" class="hidden">
|
<input id="itemContainerTable-remove-<?= $value->id; ?>" type="checkbox" class="hidden">
|
||||||
<label for="itemContainerTable-remove-<?= $value->id; ?>" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
|
<label for="itemContainerTable-remove-<?= $value->id; ?>" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
|
||||||
<span class="checked-visibility">
|
<span class="checked-visibility">
|
||||||
|
|
@ -630,6 +644,7 @@ echo $this->data['nav']->render();
|
||||||
<td data-tpl-text="/id" data-tpl-value="/id"><?= $value->id; ?>
|
<td data-tpl-text="/id" data-tpl-value="/id"><?= $value->id; ?>
|
||||||
<td data-tpl-text="/name" data-tpl-value="/name"><?= $this->printHtml($value->name); ?>
|
<td data-tpl-text="/name" data-tpl-value="/name"><?= $this->printHtml($value->name); ?>
|
||||||
<td data-tpl-text="/quantity" data-tpl-value="/quantity"><?= $this->printHtml($value->promocode); ?>
|
<td data-tpl-text="/quantity" data-tpl-value="/quantity"><?= $this->printHtml($value->promocode); ?>
|
||||||
|
<td data-tpl-text="/decimals" data-tpl-value="/decimals"><?= $this->printHtml($value->promocode); ?>
|
||||||
<td data-tpl-text="/weight" data-tpl-value="/weight"><?= $this->printHtml($value->price->getAmount()); ?>
|
<td data-tpl-text="/weight" data-tpl-value="/weight"><?= $this->printHtml($value->price->getAmount()); ?>
|
||||||
<td data-tpl-text="/width" data-tpl-value="/width"><?= $this->printHtml($value->currency); ?>
|
<td data-tpl-text="/width" data-tpl-value="/width"><?= $this->printHtml($value->currency); ?>
|
||||||
<td data-tpl-text="/height" data-tpl-value="/height"><?= $this->printHtml((string) $value->quantity); ?>
|
<td data-tpl-text="/height" data-tpl-value="/height"><?= $this->printHtml((string) $value->quantity); ?>
|
||||||
|
|
@ -682,7 +697,7 @@ echo $this->data['nav']->render();
|
||||||
<div class="fixed">
|
<div class="fixed">
|
||||||
<select id="iPriceCurrency" name="currency" data-tpl-text="/currency" data-tpl-value="/currency">
|
<select id="iPriceCurrency" name="currency" data-tpl-text="/currency" data-tpl-value="/currency">
|
||||||
<?php foreach ($currencies as $currency) : ?>
|
<?php foreach ($currencies as $currency) : ?>
|
||||||
<option value="<?= $currency; ?>"<?= $this->data['default_localization']->currency === $currency ? ' selected' : ''; ?>><?= $this->printHtml($currency); ?>
|
<option value="<?= $currency; ?>"<?= $this->data['attributeView']->data['default_localization']->currency === $currency ? ' selected' : ''; ?>><?= $this->printHtml($currency); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -947,14 +962,17 @@ echo $this->data['nav']->render();
|
||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
<?php
|
<?php
|
||||||
$c = 0;
|
$c = 0;
|
||||||
$prices = $this->data['prices'];
|
foreach ($this->data['prices'] as $key => $value) :
|
||||||
foreach ($prices as $key => $value) : ++$c;
|
if ($value->type !== PriceType::SALES) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
++$c;
|
||||||
?>
|
?>
|
||||||
<tr data-id="<?= $value->id; ?>">
|
<tr data-id="<?= $value->id; ?>">
|
||||||
<td>
|
<td>
|
||||||
<i class="g-icon btn update-form">settings</i>
|
<i class="g-icon btn update-form">settings</i>
|
||||||
<?php if ($value->name !== 'base') : ?>
|
<?php if ($value->name !== 'default') : ?>
|
||||||
<input id="itemSalesPriceTable-remove-<?= $value->id; ?>" type="checkbox" class="hidden">
|
<input id="itemSalesPriceTable-remove-<?= $value->id; ?>" type="checkbox" class="hidden">
|
||||||
<label for="itemSalesPriceTable-remove-<?= $value->id; ?>" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
|
<label for="itemSalesPriceTable-remove-<?= $value->id; ?>" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
|
||||||
<span class="checked-visibility">
|
<span class="checked-visibility">
|
||||||
|
|
@ -965,12 +983,12 @@ echo $this->data['nav']->render();
|
||||||
<td data-tpl-text="/id" data-tpl-value="/id"><?= $value->id; ?>
|
<td data-tpl-text="/id" data-tpl-value="/id"><?= $value->id; ?>
|
||||||
<td data-tpl-text="/name" data-tpl-value="/name"><?= $this->printHtml($value->name); ?>
|
<td data-tpl-text="/name" data-tpl-value="/name"><?= $this->printHtml($value->name); ?>
|
||||||
<td data-tpl-text="/promocode" data-tpl-value="/promocode"><?= $this->printHtml($value->promocode); ?>
|
<td data-tpl-text="/promocode" data-tpl-value="/promocode"><?= $this->printHtml($value->promocode); ?>
|
||||||
<td data-tpl-text="/price" data-tpl-value="/price"><?= $this->printHtml($value->price->getAmount()); ?>
|
<td data-tpl-text="/price" data-tpl-value="/price"><?= $this->printHtml($value->priceNew->getAmount()); ?>
|
||||||
<td data-tpl-text="/currency" data-tpl-value="/currency"><?= $this->printHtml($value->currency); ?>
|
<td data-tpl-text="/currency" data-tpl-value="/currency"><?= $this->printHtml($value->currency); ?>
|
||||||
<td data-tpl-text="/quantity" data-tpl-value="/quantity"><?= $this->printHtml((string) $value->quantity); ?>
|
<td data-tpl-text="/quantity" data-tpl-value="/quantity"><?= $value->quantity->getAmount(); ?>
|
||||||
<td data-tpl-text="/discount" data-tpl-value="/discount"><?= $this->printHtml((string) $value->discount); ?>
|
<td data-tpl-text="/discount" data-tpl-value="/discount"><?= $value->discount->getAmount(); ?>
|
||||||
<td data-tpl-text="/discountp" data-tpl-value="/discountp"><?= $this->printHtml((string) $value->discountPercentage); ?>
|
<td data-tpl-text="/discountp" data-tpl-value="/discountp"><?= $this->getPercentage($value->discountPercentage->value / 10000 / 100); ?>
|
||||||
<td data-tpl-text="/bonus" data-tpl-value="/bonus"><?= $this->printHtml((string) $value->bonus); ?>
|
<td data-tpl-text="/bonus" data-tpl-value="/bonus"><?= $value->bonus->getAmount(); ?>
|
||||||
<td data-tpl-text="/item_segment" data-tpl-value="/item_segment"><?= $this->printHtml((string) $value->itemsegment->getL11n()); ?>
|
<td data-tpl-text="/item_segment" data-tpl-value="/item_segment"><?= $this->printHtml((string) $value->itemsegment->getL11n()); ?>
|
||||||
<td data-tpl-text="/item_section" data-tpl-value="/item_section"><?= $this->printHtml((string) $value->itemsection->getL11n()); ?>
|
<td data-tpl-text="/item_section" data-tpl-value="/item_section"><?= $this->printHtml((string) $value->itemsection->getL11n()); ?>
|
||||||
<td data-tpl-text="/item_salesgroup" data-tpl-value="/item_salesgroup"><?= $this->printHtml((string) $value->itemsalesgroup->getL11n()); ?>
|
<td data-tpl-text="/item_salesgroup" data-tpl-value="/item_salesgroup"><?= $this->printHtml((string) $value->itemsalesgroup->getL11n()); ?>
|
||||||
|
|
@ -1084,7 +1102,7 @@ echo $this->data['nav']->render();
|
||||||
<div class="fixed">
|
<div class="fixed">
|
||||||
<select id="iPurchasePriceCurrency" name="currency" data-tpl-text="/currency" data-tpl-value="/currency">
|
<select id="iPurchasePriceCurrency" name="currency" data-tpl-text="/currency" data-tpl-value="/currency">
|
||||||
<?php foreach ($currencies as $currency) : ?>
|
<?php foreach ($currencies as $currency) : ?>
|
||||||
<option value="<?= $currency; ?>"<?= $this->data['default_localization']->currency === $currency ? ' selected' : ''; ?>><?= $this->printHtml($currency); ?>
|
<option value="<?= $currency; ?>"<?= $this->data['attributeView']->data['default_localization']->currency === $currency ? ' selected' : ''; ?>><?= $this->printHtml($currency); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1196,47 +1214,40 @@ echo $this->data['nav']->render();
|
||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
<?php
|
<?php
|
||||||
$c = 0;
|
$c = 0;
|
||||||
$prices = $this->data['purchase_prices'];
|
foreach ($this->data['prices'] as $key => $value) :
|
||||||
foreach ($prices as $key => $value) : ++$c;
|
if ($value->type !== PriceType::PURCHASE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
++$c;
|
||||||
?>
|
?>
|
||||||
<tr data-id="<?= $value->id; ?>">
|
<tr data-id="<?= $value->id; ?>">
|
||||||
<td>
|
<td>
|
||||||
<i class="g-icon btn update-form">settings</i>
|
<i class="g-icon btn update-form">settings</i>
|
||||||
<?php if ($value->name !== 'base') : ?>
|
<?php if ($value->name !== 'default') : ?>
|
||||||
<input id="itemPurchasePriceTable-remove-<?= $value->id; ?>" type="checkbox" class="hidden">
|
<input id="itemPurchasePriceTable-remove-<?= $value->id; ?>" type="checkbox" class="hidden">
|
||||||
<label for="itemPurchasePriceTable-remove-<?= $value->id; ?>" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
|
<label for="itemPurchasePriceTable-remove-<?= $value->id; ?>" class="checked-visibility-alt"><i class="g-icon btn form-action">close</i></label>
|
||||||
<span class="checked-visibility">
|
<span class="checked-visibility">
|
||||||
<label for="itemPurchasePriceTable-remove-<?= $value->id; ?>" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
|
<label for="itemPurchasePriceTable-remove-<?= $value->id; ?>" class="link default"><?= $this->getHtml('Cancel', '0', '0'); ?></label>
|
||||||
<label for="itemPurchasePriceTable-remove-<?= $value->id; ?>" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
|
<label for="itemPurchasePriceTable-remove-<?= $value->id; ?>" class="remove-form link cancel"><?= $this->getHtml('Delete', '0', '0'); ?></label>
|
||||||
</span>
|
</span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<td data-tpl-text="/id" data-tpl-value="/id"><?= $value->id; ?>
|
<td data-tpl-text="/id" data-tpl-value="/id"><?= $value->id; ?>
|
||||||
<td data-tpl-text="/name" data-tpl-value="/name"><?= $this->printHtml($value->name); ?>
|
<td data-tpl-text="/name" data-tpl-value="/name"><?= $this->printHtml($value->name); ?>
|
||||||
<td data-tpl-text="/promocode" data-tpl-value="/promocode"><?= $this->printHtml($value->promocode); ?>
|
<td data-tpl-text="/supplier" data-tpl-value="/supplier"><?= $this->printHtml($value->supplier->number); ?>
|
||||||
<td data-tpl-text="/price" data-tpl-value="/price"><?= $this->printHtml($value->price->getAmount()); ?>
|
<td data-tpl-text="/price" data-tpl-value="/price"><?= $value->priceNew->getAmount(); ?>
|
||||||
<td data-tpl-text="/currency" data-tpl-value="/currency"><?= $this->printHtml($value->currency); ?>
|
<td data-tpl-text="/currency" data-tpl-value="/currency"><?= $this->printHtml($value->currency); ?>
|
||||||
<td data-tpl-text="/quantity" data-tpl-value="/quantity"><?= $this->printHtml((string) $value->quantity); ?>
|
<td data-tpl-text="/quantity" data-tpl-value="/quantity"><?= $value->quantity->getAmount(); ?>
|
||||||
<td data-tpl-text="/discount" data-tpl-value="/discount"><?= $this->printHtml((string) $value->discount); ?>
|
<td data-tpl-text="/discount" data-tpl-value="/discount"><?= $value->discount->getAmount(); ?>
|
||||||
<td data-tpl-text="/discountp" data-tpl-value="/discountp"><?= $this->printHtml((string) $value->discountPercentage); ?>
|
<td data-tpl-text="/discountp" data-tpl-value="/discountp"><?= $this->getPercentage($value->discountPercentage->value / 10000 / 100); ?>
|
||||||
<td data-tpl-text="/bonus" data-tpl-value="/bonus"><?= $this->printHtml((string) $value->bonus); ?>
|
<td data-tpl-text="/bonus" data-tpl-value="/bonus"><?= $value->bonus->getAmount(); ?>
|
||||||
<td data-tpl-text="/item_segment" data-tpl-value="/item_segment"><?= $this->printHtml((string) $value->itemsegment->getL11n()); ?>
|
<td data-tpl-text="/item_start" data-tpl-value="/item_start"><?= $value->start?->format('Y-m-d'); ?>
|
||||||
<td data-tpl-text="/item_section" data-tpl-value="/item_section"><?= $this->printHtml((string) $value->itemsection->getL11n()); ?>
|
<td data-tpl-text="/item_end" data-tpl-value="/item_end"><?= $value->end?->format('Y-m-d'); ?>
|
||||||
<td data-tpl-text="/item_salesgroup" data-tpl-value="/item_salesgroup"><?= $this->printHtml((string) $value->itemsalesgroup->getL11n()); ?>
|
<?php endforeach; ?>
|
||||||
<td data-tpl-text="/item_productgroup" data-tpl-value="/item_productgroup"><?= $this->printHtml((string) $value->itemproductgroup->getL11n()); ?>
|
<?php if ($c === 0) : ?>
|
||||||
<td data-tpl-text="/item_producttype" data-tpl-value="/item_producttype"><?= $this->printHtml((string) $value->itemtype->getL11n()); ?>
|
<tr>
|
||||||
<td data-tpl-text="/item_account_segment" data-tpl-value="/item_account_segment"><?= $this->printHtml((string) $value->clientsegment->getL11n()); ?>
|
<td colspan="22" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
<td data-tpl-text="/item_account_section" data-tpl-value="/item_account_section"><?= $this->printHtml((string) $value->clientsection->getL11n()); ?>
|
<?php endif; ?>
|
||||||
<td data-tpl-text="/item_account_group" data-tpl-value="/item_account_group"><?= $this->printHtml((string) $value->clientgroup->getL11n()); ?>
|
|
||||||
<td data-tpl-text="/item_account_type" data-tpl-value="/item_account_type"><?= $this->printHtml((string) $value->clienttype->getL11n()); ?>
|
|
||||||
<td data-tpl-text="/item_account_region" data-tpl-value="/item_account_region"><?= $this->printHtml((string) $value->clientcountry); ?>
|
|
||||||
<td data-tpl-text="/item_start" data-tpl-value="/item_start"><?= $value->start?->format('Y-m-d'); ?>
|
|
||||||
<td data-tpl-text="/item_end" data-tpl-value="/item_end"><?= $value->end?->format('Y-m-d'); ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php if ($c === 0) : ?>
|
|
||||||
<tr>
|
|
||||||
<td colspan="22" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -1263,7 +1274,7 @@ echo $this->data['nav']->render();
|
||||||
<?php
|
<?php
|
||||||
$attr = $this->data['defaultAttributeTypes']['sales_tax_code'] ?? null;
|
$attr = $this->data['defaultAttributeTypes']['sales_tax_code'] ?? null;
|
||||||
foreach ($attr?->defaults ?? [] as $value) : ?>
|
foreach ($attr?->defaults ?? [] as $value) : ?>
|
||||||
<option value="<?= $value->id ?>"><?= $this->printHtml($value->getValue()); ?>
|
<option value="<?= $value->id; ?>"><?= $this->printHtml($value->getValue()); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1275,7 +1286,7 @@ echo $this->data['nav']->render();
|
||||||
<?php
|
<?php
|
||||||
$attr = $this->data['defaultAttributeTypes']['purchase_tax_code'] ?? null;
|
$attr = $this->data['defaultAttributeTypes']['purchase_tax_code'] ?? null;
|
||||||
foreach ($attr?->defaults ?? [] as $value) : ?>
|
foreach ($attr?->defaults ?? [] as $value) : ?>
|
||||||
<option value="<?= $value->id ?>"><?= $this->printHtml($value->getValue()); ?>
|
<option value="<?= $value->id; ?>"><?= $this->printHtml($value->getValue()); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1290,7 +1301,7 @@ echo $this->data['nav']->render();
|
||||||
->where('l11n/language', $this->response->header->l11n->language)
|
->where('l11n/language', $this->response->header->l11n->language)
|
||||||
->execute();
|
->execute();
|
||||||
foreach ($costcenters as $cc) : ?>
|
foreach ($costcenters as $cc) : ?>
|
||||||
<option value="<?= $cc->id ?>"><?= $this->printHtml($cc->code . ' ' . $cc->getL11n()); ?>
|
<option value="<?= $cc->id; ?>"><?= $this->printHtml($cc->code . ' ' . $cc->getL11n()); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1305,7 +1316,7 @@ echo $this->data['nav']->render();
|
||||||
->where('l11n/language', $this->response->header->l11n->language)
|
->where('l11n/language', $this->response->header->l11n->language)
|
||||||
->execute();
|
->execute();
|
||||||
foreach ($costobjects as $co) : ?>
|
foreach ($costobjects as $co) : ?>
|
||||||
<option value="<?= $co->id ?>"><?= $this->printHtml($co->code . ' ' . $co->getL11n()); ?>
|
<option value="<?= $co->id; ?>"><?= $this->printHtml($co->code . ' ' . $co->getL11n()); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1360,7 +1371,7 @@ echo $this->data['nav']->render();
|
||||||
<?php
|
<?php
|
||||||
$attr = $this->data['defaultAttributeTypes']['has_inventory'] ?? null;
|
$attr = $this->data['defaultAttributeTypes']['has_inventory'] ?? null;
|
||||||
foreach ($attr?->defaults ?? [] as $value) : ?>
|
foreach ($attr?->defaults ?? [] as $value) : ?>
|
||||||
<option value="<?= $value->id ?>"><?= $this->printHtml($value->getValue()); ?>
|
<option value="<?= $value->id; ?>"><?= $this->printHtml($value->getValue()); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1371,7 +1382,7 @@ echo $this->data['nav']->render();
|
||||||
<?php
|
<?php
|
||||||
$attr = $this->data['defaultAttributeTypes']['inventory_identifier'] ?? null;
|
$attr = $this->data['defaultAttributeTypes']['inventory_identifier'] ?? null;
|
||||||
foreach ($attr?->defaults ?? [] as $value) : ?>
|
foreach ($attr?->defaults ?? [] as $value) : ?>
|
||||||
<option value="<?= $value->id ?>"><?= $this->printHtml($value->getValue()); ?>
|
<option value="<?= $value->id; ?>"><?= $this->printHtml($value->getValue()); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1382,7 +1393,7 @@ echo $this->data['nav']->render();
|
||||||
<?php
|
<?php
|
||||||
$attr = $this->data['defaultAttributeTypes']['stocktaking_type'] ?? null;
|
$attr = $this->data['defaultAttributeTypes']['stocktaking_type'] ?? null;
|
||||||
foreach ($attr?->defaults ?? [] as $value) : ?>
|
foreach ($attr?->defaults ?? [] as $value) : ?>
|
||||||
<option value="<?= $value->id ?>"><?= $this->printHtml($value->getValue()); ?>
|
<option value="<?= $value->id; ?>"><?= $this->printHtml($value->getValue()); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1425,17 +1436,23 @@ echo $this->data['nav']->render();
|
||||||
<?php
|
<?php
|
||||||
$allInvoices = SalesBillMapper::getItemBills($item->id, SmartDateTime::startOfYear($this->data['business_start']), new SmartDateTime('now'));
|
$allInvoices = SalesBillMapper::getItemBills($item->id, SmartDateTime::startOfYear($this->data['business_start']), new SmartDateTime('now'));
|
||||||
|
|
||||||
|
$count = 0;
|
||||||
|
|
||||||
/** @var \Modules\Billing\Models\Bill $invoice */
|
/** @var \Modules\Billing\Models\Bill $invoice */
|
||||||
foreach ($allInvoices as $invoice) :
|
foreach ($allInvoices as $invoice) :
|
||||||
|
++$count;
|
||||||
$url = UriFactory::build('{/base}/sales/bill?{?}&id=' . $invoice->id);
|
$url = UriFactory::build('{/base}/sales/bill?{?}&id=' . $invoice->id);
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td><a href="<?= $url; ?>"><?= $invoice->getNumber(); ?></a>
|
<td><a href="<?= $url; ?>"><?= $invoice->getNumber(); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $invoice->type->getL11n(); ?></a>
|
<td><a href="<?= $url; ?>"><?= $invoice->type->getL11n(); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $invoice->billTo; ?></a>
|
<td><a href="<?= $url; ?>"><?= $invoice->billTo; ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->getCurrency($invoice->netSales); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->getCurrency($invoice->netSales, symbol: ''); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $invoice->createdAt->format('Y-m-d'); ?></a>
|
<td><a href="<?= $url; ?>"><?= $invoice->createdAt->format('Y-m-d'); ?></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
<?php if ($count === 0) : ?>
|
||||||
|
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
|
<?php endif; ?>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -1448,7 +1465,7 @@ echo $this->data['nav']->render();
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="portlet">
|
<div class="portlet">
|
||||||
<div class="portlet-head"><?= $this->getHtml('Audits', 'Auditor'); ?><i class="g-icon download btn end-xs">download</i></div>
|
<div class="portlet-head"><?= $this->getHtml('Logs', 'Auditor'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||||
<div class="slider">
|
<div class="slider">
|
||||||
<table class="default sticky">
|
<table class="default sticky">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
|
|
@ -1479,7 +1496,7 @@ echo $this->data['nav']->render();
|
||||||
$next = empty($audits) ? HttpHeader::getAllHeaders()['Referer'] ?? 'admin/module/settings?id={?id}#{\#}' : 'admin/module/settings?{?}&audit=' . \end($audits)->id . '&ptype=n#{\#}';
|
$next = empty($audits) ? HttpHeader::getAllHeaders()['Referer'] ?? 'admin/module/settings?id={?id}#{\#}' : 'admin/module/settings?{?}&audit=' . \end($audits)->id . '&ptype=n#{\#}';
|
||||||
|
|
||||||
foreach ($audits as $key => $audit) : ++$count;
|
foreach ($audits as $key => $audit) : ++$count;
|
||||||
$url = UriFactory::build('{/base}/admin/audit/single?{?}&id=' . $audit->id); ?>
|
$url = UriFactory::build('{/base}/admin/audit/view?{?}&id=' . $audit->id); ?>
|
||||||
<tr tabindex="0" data-href="<?= $url; ?>">
|
<tr tabindex="0" data-href="<?= $url; ?>">
|
||||||
<td><?= $audit->id; ?>
|
<td><?= $audit->id; ?>
|
||||||
<td><?= $this->printHtml($audit->module); ?>
|
<td><?= $this->printHtml($audit->module); ?>
|
||||||
|
|
@ -15,7 +15,7 @@ declare(strict_types=1);
|
||||||
use phpOMS\Uri\UriFactory;
|
use phpOMS\Uri\UriFactory;
|
||||||
|
|
||||||
/** @var \phpOMS\Localization\BaseStringL11nType */
|
/** @var \phpOMS\Localization\BaseStringL11nType */
|
||||||
$type = $this->data['type'];
|
$type = $this->data['type'];
|
||||||
|
|
||||||
/** @var \phpOMS\Views\View $this */
|
/** @var \phpOMS\Views\View $this */
|
||||||
echo $this->data['nav']->render(); ?>
|
echo $this->data['nav']->render(); ?>
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
</label>
|
</label>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $count = 0; foreach ($items as $key => $value) : ++$count;
|
<?php $count = 0; foreach ($items as $key => $value) : ++$count;
|
||||||
$url = UriFactory::build('{/base}/purchase/item/profile?{?}&id=' . $value->id);
|
$url = UriFactory::build('{/base}/purchase/item/view?{?}&id=' . $value->id);
|
||||||
$image = $value->getFileByType('backend_image');
|
$image = $value->getFileByType('backend_image');
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $count = 0; foreach ($items as $key => $value) : ++$count;
|
<?php $count = 0; foreach ($items as $key => $value) : ++$count;
|
||||||
$url = UriFactory::build('{/base}/sales/item/profile?{?}&id=' . $value->id);
|
$url = UriFactory::build('{/base}/sales/item/view?{?}&id=' . $value->id);
|
||||||
$image = $value->getFileByTypeName('item_profile_image');
|
$image = $value->getFileByTypeName('item_profile_image');
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
|
|
|
||||||
20
Theme/Backend/sales-item-profile.tpl.php → Theme/Backend/sales-item-view.tpl.php
Executable file → Normal file
20
Theme/Backend/sales-item-profile.tpl.php → Theme/Backend/sales-item-view.tpl.php
Executable file → Normal file
|
|
@ -20,8 +20,8 @@ use phpOMS\Uri\UriFactory;
|
||||||
/** @var \Modules\ItemManagement\Models\Item $item */
|
/** @var \Modules\ItemManagement\Models\Item $item */
|
||||||
$item = $this->data['item'];
|
$item = $this->data['item'];
|
||||||
|
|
||||||
$itemL11n = $item->getL11ns();
|
$itemL11n = $item->getL11ns();
|
||||||
$Attribute = $item->attributes;
|
$Attribute = $item->attributes;
|
||||||
|
|
||||||
$notes = $item->notes;
|
$notes = $item->notes;
|
||||||
$files = $item->files;
|
$files = $item->files;
|
||||||
|
|
@ -143,9 +143,9 @@ echo $this->data['nav']->render();
|
||||||
<div class="portlet-body">
|
<div class="portlet-body">
|
||||||
<table class="wf-100">
|
<table class="wf-100">
|
||||||
<tr><td><?= $this->getHtml('SalesPrice'); ?>:
|
<tr><td><?= $this->getHtml('SalesPrice'); ?>:
|
||||||
<td><?= $item->salesPrice->getCurrency(); ?>
|
<td><?= $item->salesPrice->getAmount(); ?>
|
||||||
<tr><td><?= $this->getHtml('PurchasePrice'); ?>:
|
<tr><td><?= $this->getHtml('PurchasePrice'); ?>:
|
||||||
<td><?= $item->purchasePrice->getCurrency(); ?>
|
<td><?= $item->purchasePrice->getAmount(); ?>
|
||||||
<tr><td><?= $this->getHtml('Margin'); ?>:
|
<tr><td><?= $this->getHtml('Margin'); ?>:
|
||||||
<td><?= $item->salesPrice->getInt() === 0
|
<td><?= $item->salesPrice->getInt() === 0
|
||||||
? '0.00'
|
? '0.00'
|
||||||
|
|
@ -170,7 +170,7 @@ echo $this->data['nav']->render();
|
||||||
<td><?= $this->getHtml('CreatedAt'); ?>
|
<td><?= $this->getHtml('CreatedAt'); ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($notes as $note) :
|
<?php foreach ($notes as $note) :
|
||||||
$url = UriFactory::build('{/base}/editor/single?{?}&id=' . $note->id);
|
$url = UriFactory::build('{/base}/editor/view?{?}&id=' . $note->id);
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($note->title); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($note->title); ?></a>
|
||||||
|
|
@ -193,7 +193,7 @@ echo $this->data['nav']->render();
|
||||||
<td><?= $this->getHtml('CreatedAt'); ?>
|
<td><?= $this->getHtml('CreatedAt'); ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($files as $file) :
|
<?php foreach ($files as $file) :
|
||||||
$url = UriFactory::build('{/base}/media/single?{?}&id=' . $file->id);
|
$url = UriFactory::build('{/base}/media/view?{?}&id=' . $file->id);
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($file->name); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($file->name); ?></a>
|
||||||
|
|
@ -228,8 +228,8 @@ echo $this->data['nav']->render();
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($invoice->getNumber()); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($invoice->getNumber()); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($invoice->type->getL11n()); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($invoice->type->getL11n()); ?></a>
|
||||||
<td><a class="content" href="<?= UriFactory::build('{/base}/sales/client/profile?{?}&id=' . $invoice->client->id); ?>"><?= $this->printHtml($invoice->billTo); ?></a>
|
<td><a class="content" href="<?= UriFactory::build('{/base}/sales/client/view?{?}&id=' . $invoice->client->id); ?>"><?= $this->printHtml($invoice->billTo); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($invoice->netSales->getCurrency()); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($invoice->netSales->getAmount()); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($invoice->createdAt->format('Y-m-d')); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($invoice->createdAt->format('Y-m-d')); ?></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
</table>
|
||||||
|
|
@ -251,12 +251,12 @@ echo $this->data['nav']->render();
|
||||||
<td><?= $this->getHtml('Net'); ?>
|
<td><?= $this->getHtml('Net'); ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $i = -1; foreach ($topCustomers as $client) : ++$i;
|
<?php $i = -1; foreach ($topCustomers as $client) : ++$i;
|
||||||
$url = UriFactory::build('{/base}/sales/client/profile?id=' . $client->id);
|
$url = UriFactory::build('{/base}/sales/client/view?id=' . $client->id);
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($client->number); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($client->number); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($client->profile->account->name1); ?> <?= $this->printHtml($client->profile->account->name2); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($client->profile->account->name1); ?> <?= $this->printHtml($client->profile->account->name2); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($client->mainAddress->getCountry()); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($client->mainAddress->country); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= (new Money((int) $topCustomers[1][$i]['net_sales']))->getCurrency(); ?></a>
|
<td><a href="<?= $url; ?>"><?= (new Money((int) $topCustomers[1][$i]['net_sales']))->getCurrency(); ?></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
</table>
|
||||||
|
|
@ -116,7 +116,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $count = 0; foreach ($items as $key => $value) : ++$count;
|
<?php $count = 0; foreach ($items as $key => $value) : ++$count;
|
||||||
$url = UriFactory::build('{/base}/item/profile?{?}&id=' . $value->id);
|
$url = UriFactory::build('{/base}/item/view?{?}&id=' . $value->id);
|
||||||
$image = $value->getFileByTypeName('item_profile_image');
|
$image = $value->getFileByTypeName('item_profile_image');
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,8 @@ final class Autoloader
|
||||||
*/
|
*/
|
||||||
public static function defaultAutoloader(string $class) : void
|
public static function defaultAutoloader(string $class) : void
|
||||||
{
|
{
|
||||||
$class = \ltrim($class, '\\');
|
$class = \ltrim($class, '\\');
|
||||||
$class = \strtr($class, '_\\', '//');
|
$class = \strtr($class, '_\\', '//');
|
||||||
|
|
||||||
if (\stripos($class, 'Web/Backend') !== false || \stripos($class, 'Web/Api') !== false) {
|
if (\stripos($class, 'Web/Backend') !== false || \stripos($class, 'Web/Api') !== false) {
|
||||||
$class = \is_dir(__DIR__ . '/Web') ? $class : \str_replace('Web/', 'MainRepository/Web/', $class);
|
$class = \is_dir(__DIR__ . '/Web') ? $class : \str_replace('Web/', 'MainRepository/Web/', $class);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,15 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Jingga
|
||||||
|
*
|
||||||
|
* PHP Version 8.1
|
||||||
|
*
|
||||||
|
* @package Modules\ItemManagement\tests
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 2.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://jingga.app
|
||||||
|
*/
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
\ini_set('memory_limit', '2048M');
|
\ini_set('memory_limit', '2048M');
|
||||||
|
|
@ -67,10 +78,10 @@ $GLOBALS['is_github'] = $IS_GITHUB;
|
||||||
$tmp = FileLogger::getInstance(__DIR__ . '/../Logs');
|
$tmp = FileLogger::getInstance(__DIR__ . '/../Logs');
|
||||||
|
|
||||||
$CONFIG = [
|
$CONFIG = [
|
||||||
'db' => [
|
'db' => [
|
||||||
'core' => [
|
'core' => [
|
||||||
'masters' => [
|
'masters' => [
|
||||||
'admin' => [
|
'admin' => [
|
||||||
'db' => 'mysql', /* db type */
|
'db' => 'mysql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '3306', /* db host port */
|
'port' => '3306', /* db host port */
|
||||||
|
|
@ -80,7 +91,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'insert' => [
|
'insert' => [
|
||||||
'db' => 'mysql', /* db type */
|
'db' => 'mysql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '3306', /* db host port */
|
'port' => '3306', /* db host port */
|
||||||
|
|
@ -90,7 +101,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'select' => [
|
'select' => [
|
||||||
'db' => 'mysql', /* db type */
|
'db' => 'mysql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '3306', /* db host port */
|
'port' => '3306', /* db host port */
|
||||||
|
|
@ -100,7 +111,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'update' => [
|
'update' => [
|
||||||
'db' => 'mysql', /* db type */
|
'db' => 'mysql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '3306', /* db host port */
|
'port' => '3306', /* db host port */
|
||||||
|
|
@ -110,7 +121,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'delete' => [
|
'delete' => [
|
||||||
'db' => 'mysql', /* db type */
|
'db' => 'mysql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '3306', /* db host port */
|
'port' => '3306', /* db host port */
|
||||||
|
|
@ -120,7 +131,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'schema' => [
|
'schema' => [
|
||||||
'db' => 'mysql', /* db type */
|
'db' => 'mysql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '3306', /* db host port */
|
'port' => '3306', /* db host port */
|
||||||
|
|
@ -132,7 +143,7 @@ $CONFIG = [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'postgresql' => [
|
'postgresql' => [
|
||||||
'admin' => [
|
'admin' => [
|
||||||
'db' => 'pgsql', /* db type */
|
'db' => 'pgsql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '5432', /* db host port */
|
'port' => '5432', /* db host port */
|
||||||
|
|
@ -142,7 +153,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'insert' => [
|
'insert' => [
|
||||||
'db' => 'pgsql', /* db type */
|
'db' => 'pgsql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '5432', /* db host port */
|
'port' => '5432', /* db host port */
|
||||||
|
|
@ -152,7 +163,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'select' => [
|
'select' => [
|
||||||
'db' => 'pgsql', /* db type */
|
'db' => 'pgsql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '5432', /* db host port */
|
'port' => '5432', /* db host port */
|
||||||
|
|
@ -162,7 +173,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'update' => [
|
'update' => [
|
||||||
'db' => 'pgsql', /* db type */
|
'db' => 'pgsql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '5432', /* db host port */
|
'port' => '5432', /* db host port */
|
||||||
|
|
@ -172,7 +183,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'delete' => [
|
'delete' => [
|
||||||
'db' => 'pgsql', /* db type */
|
'db' => 'pgsql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '5432', /* db host port */
|
'port' => '5432', /* db host port */
|
||||||
|
|
@ -182,7 +193,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'schema' => [
|
'schema' => [
|
||||||
'db' => 'pgsql', /* db type */
|
'db' => 'pgsql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '5432', /* db host port */
|
'port' => '5432', /* db host port */
|
||||||
|
|
@ -194,37 +205,37 @@ $CONFIG = [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'sqlite' => [
|
'sqlite' => [
|
||||||
'admin' => [
|
'admin' => [
|
||||||
'db' => 'sqlite', /* db type */
|
'db' => 'sqlite', /* db type */
|
||||||
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'insert' => [
|
'insert' => [
|
||||||
'db' => 'sqlite', /* db type */
|
'db' => 'sqlite', /* db type */
|
||||||
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'select' => [
|
'select' => [
|
||||||
'db' => 'sqlite', /* db type */
|
'db' => 'sqlite', /* db type */
|
||||||
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'update' => [
|
'update' => [
|
||||||
'db' => 'sqlite', /* db type */
|
'db' => 'sqlite', /* db type */
|
||||||
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'delete' => [
|
'delete' => [
|
||||||
'db' => 'sqlite', /* db type */
|
'db' => 'sqlite', /* db type */
|
||||||
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'schema' => [
|
'schema' => [
|
||||||
'db' => 'sqlite', /* db type */
|
'db' => 'sqlite', /* db type */
|
||||||
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
|
|
@ -232,7 +243,7 @@ $CONFIG = [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'mssql' => [
|
'mssql' => [
|
||||||
'admin' => [
|
'admin' => [
|
||||||
'db' => 'mssql', /* db type */
|
'db' => 'mssql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '1433', /* db host port */
|
'port' => '1433', /* db host port */
|
||||||
|
|
@ -242,7 +253,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'insert' => [
|
'insert' => [
|
||||||
'db' => 'mssql', /* db type */
|
'db' => 'mssql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '1433', /* db host port */
|
'port' => '1433', /* db host port */
|
||||||
|
|
@ -252,7 +263,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'select' => [
|
'select' => [
|
||||||
'db' => 'mssql', /* db type */
|
'db' => 'mssql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '1433', /* db host port */
|
'port' => '1433', /* db host port */
|
||||||
|
|
@ -262,7 +273,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'update' => [
|
'update' => [
|
||||||
'db' => 'mssql', /* db type */
|
'db' => 'mssql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '1433', /* db host port */
|
'port' => '1433', /* db host port */
|
||||||
|
|
@ -272,7 +283,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'delete' => [
|
'delete' => [
|
||||||
'db' => 'mssql', /* db type */
|
'db' => 'mssql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '1433', /* db host port */
|
'port' => '1433', /* db host port */
|
||||||
|
|
@ -282,7 +293,7 @@ $CONFIG = [
|
||||||
'weight' => 1000, /* db table prefix */
|
'weight' => 1000, /* db table prefix */
|
||||||
'datetimeformat' => 'Y-m-d H:i:s',
|
'datetimeformat' => 'Y-m-d H:i:s',
|
||||||
],
|
],
|
||||||
'schema' => [
|
'schema' => [
|
||||||
'db' => 'mssql', /* db type */
|
'db' => 'mssql', /* db type */
|
||||||
'host' => '127.0.0.1', /* db host address */
|
'host' => '127.0.0.1', /* db host address */
|
||||||
'port' => '1433', /* db host port */
|
'port' => '1433', /* db host port */
|
||||||
|
|
@ -322,16 +333,16 @@ $CONFIG = [
|
||||||
'password' => '123456',
|
'password' => '123456',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'log' => [
|
'log' => [
|
||||||
'file' => [
|
'file' => [
|
||||||
'path' => __DIR__ . '/Logs',
|
'path' => __DIR__ . '/Logs',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'page' => [
|
'page' => [
|
||||||
'root' => '/',
|
'root' => '/',
|
||||||
'https' => false,
|
'https' => false,
|
||||||
],
|
],
|
||||||
'app' => [
|
'app' => [
|
||||||
'path' => __DIR__,
|
'path' => __DIR__,
|
||||||
'default' => [
|
'default' => [
|
||||||
'app' => 'Backend',
|
'app' => 'Backend',
|
||||||
|
|
@ -350,7 +361,7 @@ $CONFIG = [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'socket' => [
|
'socket' => [
|
||||||
'master' => [
|
'master' => [
|
||||||
'host' => '127.0.0.1',
|
'host' => '127.0.0.1',
|
||||||
'limit' => 300,
|
'limit' => 300,
|
||||||
|
|
@ -360,7 +371,7 @@ $CONFIG = [
|
||||||
'language' => [
|
'language' => [
|
||||||
'en',
|
'en',
|
||||||
],
|
],
|
||||||
'apis' => [
|
'apis' => [
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ use phpOMS\Localization\ISO639x1Enum;
|
||||||
use phpOMS\Message\Http\HttpRequest;
|
use phpOMS\Message\Http\HttpRequest;
|
||||||
use phpOMS\Message\Http\HttpResponse;
|
use phpOMS\Message\Http\HttpResponse;
|
||||||
use phpOMS\Message\Http\RequestStatusCode;
|
use phpOMS\Message\Http\RequestStatusCode;
|
||||||
use phpOMS\Uri\HttpUri;
|
|
||||||
|
|
||||||
trait ApiControllerAttributeTrait
|
trait ApiControllerAttributeTrait
|
||||||
{
|
{
|
||||||
|
|
@ -30,7 +29,7 @@ trait ApiControllerAttributeTrait
|
||||||
public function testApiItemAttributeTypeCreate() : void
|
public function testApiItemAttributeTypeCreate() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('name', 'test_attribute');
|
$request->setData('name', 'test_attribute');
|
||||||
|
|
@ -48,7 +47,7 @@ trait ApiControllerAttributeTrait
|
||||||
public function testApiItemAttributeTypeL11nCreate() : void
|
public function testApiItemAttributeTypeL11nCreate() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('title', 'DE:2');
|
$request->setData('title', 'DE:2');
|
||||||
|
|
@ -66,7 +65,7 @@ trait ApiControllerAttributeTrait
|
||||||
public function testApiItemAttributeValueIntCreate() : void
|
public function testApiItemAttributeValueIntCreate() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('default', '1');
|
$request->setData('default', '1');
|
||||||
|
|
@ -86,7 +85,7 @@ trait ApiControllerAttributeTrait
|
||||||
public function testApiItemAttributeValueStrCreate() : void
|
public function testApiItemAttributeValueStrCreate() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('type', '1');
|
$request->setData('type', '1');
|
||||||
|
|
@ -105,7 +104,7 @@ trait ApiControllerAttributeTrait
|
||||||
public function testApiItemAttributeValueFloatCreate() : void
|
public function testApiItemAttributeValueFloatCreate() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('type', '1');
|
$request->setData('type', '1');
|
||||||
|
|
@ -124,7 +123,7 @@ trait ApiControllerAttributeTrait
|
||||||
public function testApiItemAttributeValueDatCreate() : void
|
public function testApiItemAttributeValueDatCreate() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('type', '1');
|
$request->setData('type', '1');
|
||||||
|
|
@ -143,7 +142,7 @@ trait ApiControllerAttributeTrait
|
||||||
public function testApiItemAttributeCreate() : void
|
public function testApiItemAttributeCreate() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('ref', '1');
|
$request->setData('ref', '1');
|
||||||
|
|
@ -161,7 +160,7 @@ trait ApiControllerAttributeTrait
|
||||||
public function testApiItemAttributeValueCreateInvalidData() : void
|
public function testApiItemAttributeValueCreateInvalidData() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('invalid', '1');
|
$request->setData('invalid', '1');
|
||||||
|
|
@ -177,7 +176,7 @@ trait ApiControllerAttributeTrait
|
||||||
public function testApiItemAttributeTypeCreateInvalidData() : void
|
public function testApiItemAttributeTypeCreateInvalidData() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('invalid', '1');
|
$request->setData('invalid', '1');
|
||||||
|
|
@ -193,7 +192,7 @@ trait ApiControllerAttributeTrait
|
||||||
public function testApiItemAttributeTypeL11nCreateInvalidData() : void
|
public function testApiItemAttributeTypeL11nCreateInvalidData() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('invalid', '1');
|
$request->setData('invalid', '1');
|
||||||
|
|
@ -209,7 +208,7 @@ trait ApiControllerAttributeTrait
|
||||||
public function testApiItemAttributeCreateInvalidData() : void
|
public function testApiItemAttributeCreateInvalidData() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('invalid', '1');
|
$request->setData('invalid', '1');
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ use phpOMS\Message\Http\HttpRequest;
|
||||||
use phpOMS\Message\Http\HttpResponse;
|
use phpOMS\Message\Http\HttpResponse;
|
||||||
use phpOMS\Message\Http\RequestStatusCode;
|
use phpOMS\Message\Http\RequestStatusCode;
|
||||||
use phpOMS\System\MimeType;
|
use phpOMS\System\MimeType;
|
||||||
use phpOMS\Uri\HttpUri;
|
|
||||||
use phpOMS\Utils\TestUtils;
|
use phpOMS\Utils\TestUtils;
|
||||||
|
|
||||||
trait ApiControllerItemTrait
|
trait ApiControllerItemTrait
|
||||||
|
|
@ -41,7 +40,7 @@ trait ApiControllerItemTrait
|
||||||
public function testApiItemCreate() : void
|
public function testApiItemCreate() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('number', '123456');
|
$request->setData('number', '123456');
|
||||||
|
|
@ -58,7 +57,7 @@ trait ApiControllerItemTrait
|
||||||
public function testApiItemCreateInvalidData() : void
|
public function testApiItemCreateInvalidData() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('invalid', '1');
|
$request->setData('invalid', '1');
|
||||||
|
|
@ -74,7 +73,7 @@ trait ApiControllerItemTrait
|
||||||
public function testApiItemProfileImageCreate() : void
|
public function testApiItemProfileImageCreate() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
\copy(__DIR__ . '/m_icon.png', __DIR__ . '/m_icon_tmp.png');
|
\copy(__DIR__ . '/m_icon.png', __DIR__ . '/m_icon_tmp.png');
|
||||||
|
|
||||||
|
|
@ -105,7 +104,7 @@ trait ApiControllerItemTrait
|
||||||
public function testApiItemFileCreate() : void
|
public function testApiItemFileCreate() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
\copy(__DIR__ . '/Test file.txt', __DIR__ . '/Test file_tmp.txt');
|
\copy(__DIR__ . '/Test file.txt', __DIR__ . '/Test file_tmp.txt');
|
||||||
|
|
||||||
|
|
@ -135,7 +134,7 @@ trait ApiControllerItemTrait
|
||||||
public function testApiItemNoteCreate() : void
|
public function testApiItemNoteCreate() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
|
|
||||||
|
|
@ -156,7 +155,7 @@ trait ApiControllerItemTrait
|
||||||
public function testApiFileCreateInvalidData() : void
|
public function testApiFileCreateInvalidData() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('invalid', '1');
|
$request->setData('invalid', '1');
|
||||||
|
|
@ -172,7 +171,7 @@ trait ApiControllerItemTrait
|
||||||
public function testApiNoteCreateInvalidData() : void
|
public function testApiNoteCreateInvalidData() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('invalid', '1');
|
$request->setData('invalid', '1');
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ use phpOMS\Localization\ISO639x1Enum;
|
||||||
use phpOMS\Message\Http\HttpRequest;
|
use phpOMS\Message\Http\HttpRequest;
|
||||||
use phpOMS\Message\Http\HttpResponse;
|
use phpOMS\Message\Http\HttpResponse;
|
||||||
use phpOMS\Message\Http\RequestStatusCode;
|
use phpOMS\Message\Http\RequestStatusCode;
|
||||||
use phpOMS\Uri\HttpUri;
|
|
||||||
|
|
||||||
trait ApiControllerL11nTrait
|
trait ApiControllerL11nTrait
|
||||||
{
|
{
|
||||||
|
|
@ -29,7 +28,7 @@ trait ApiControllerL11nTrait
|
||||||
public function testApiItemL11nTypeCreate() : void
|
public function testApiItemL11nTypeCreate() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('title', 'TestItemL11nType');
|
$request->setData('title', 'TestItemL11nType');
|
||||||
|
|
@ -47,7 +46,7 @@ trait ApiControllerL11nTrait
|
||||||
public function testApiItemL11nCreate() : void
|
public function testApiItemL11nCreate() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('item', '1');
|
$request->setData('item', '1');
|
||||||
|
|
@ -65,7 +64,7 @@ trait ApiControllerL11nTrait
|
||||||
public function testApiItemL11nTypeCreateInvalidData() : void
|
public function testApiItemL11nTypeCreateInvalidData() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('invalid', '1');
|
$request->setData('invalid', '1');
|
||||||
|
|
@ -81,7 +80,7 @@ trait ApiControllerL11nTrait
|
||||||
public function testApiItemL11nCreateInvalidData() : void
|
public function testApiItemL11nCreateInvalidData() : void
|
||||||
{
|
{
|
||||||
$response = new HttpResponse();
|
$response = new HttpResponse();
|
||||||
$request = new HttpRequest(new HttpUri(''));
|
$request = new HttpRequest();
|
||||||
|
|
||||||
$request->header->account = 1;
|
$request->header->account = 1;
|
||||||
$request->setData('invalid', '1');
|
$request->setData('invalid', '1');
|
||||||
|
|
|
||||||
|
|
@ -58,13 +58,13 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
|
||||||
protected string $appName = 'Api';
|
protected string $appName = 'Api';
|
||||||
};
|
};
|
||||||
|
|
||||||
$this->app->dbPool = $GLOBALS['dbpool'];
|
$this->app->dbPool = $GLOBALS['dbpool'];
|
||||||
$this->app->unitId = 1;
|
$this->app->unitId = 1;
|
||||||
$this->app->accountManager = new AccountManager($GLOBALS['session']);
|
$this->app->accountManager = new AccountManager($GLOBALS['session']);
|
||||||
$this->app->appSettings = new CoreSettings();
|
$this->app->appSettings = new CoreSettings();
|
||||||
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');
|
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');
|
||||||
$this->app->dispatcher = new Dispatcher($this->app);
|
$this->app->dispatcher = new Dispatcher($this->app);
|
||||||
$this->app->eventManager = new EventManager($this->app->dispatcher);
|
$this->app->eventManager = new EventManager($this->app->dispatcher);
|
||||||
$this->app->eventManager->importFromFile(__DIR__ . '/../../../../Web/Api/Hooks.php');
|
$this->app->eventManager->importFromFile(__DIR__ . '/../../../../Web/Api/Hooks.php');
|
||||||
$this->app->sessionManager = new HttpSession(36000);
|
$this->app->sessionManager = new HttpSession(36000);
|
||||||
$this->app->l11nManager = new L11nManager();
|
$this->app->l11nManager = new L11nManager();
|
||||||
|
|
|
||||||
|
|
@ -44,24 +44,14 @@ final class ItemTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertEquals('', $this->item->number);
|
self::assertEquals('', $this->item->number);
|
||||||
self::assertEquals(0, $this->item->successor);
|
self::assertEquals(0, $this->item->successor);
|
||||||
self::assertEquals('', $this->item->info);
|
self::assertEquals('', $this->item->info);
|
||||||
self::assertEquals(ItemStatus::ACTIVE, $this->item->getStatus());
|
self::assertEquals(ItemStatus::ACTIVE, $this->item->status);
|
||||||
self::assertEquals([], $this->item->files);
|
self::assertEquals([], $this->item->files);
|
||||||
self::assertEquals([], $this->item->getAttributes());
|
self::assertEquals([], $this->item->attributes);
|
||||||
self::assertInstanceOf(BaseStringL11n::class, $this->item->getL11n(''));
|
self::assertInstanceOf(BaseStringL11n::class, $this->item->getL11n(''));
|
||||||
self::assertInstanceOf('\phpOMS\Stdlib\Base\FloatInt', $this->item->salesPrice);
|
self::assertInstanceOf('\phpOMS\Stdlib\Base\FloatInt', $this->item->salesPrice);
|
||||||
self::assertInstanceOf('\phpOMS\Stdlib\Base\FloatInt', $this->item->purchasePrice);
|
self::assertInstanceOf('\phpOMS\Stdlib\Base\FloatInt', $this->item->purchasePrice);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers Modules\ItemManagement\Models\Item
|
|
||||||
* @group module
|
|
||||||
*/
|
|
||||||
public function testStatusInputOutput() : void
|
|
||||||
{
|
|
||||||
$this->item->setStatus(ItemStatus::INACTIVE);
|
|
||||||
self::assertEquals(ItemStatus::INACTIVE, $this->item->getStatus());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers Modules\ItemManagement\Models\Item
|
* @covers Modules\ItemManagement\Models\Item
|
||||||
* @group module
|
* @group module
|
||||||
|
|
@ -69,7 +59,7 @@ final class ItemTest extends \PHPUnit\Framework\TestCase
|
||||||
public function testAttributeInputOutput() : void
|
public function testAttributeInputOutput() : void
|
||||||
{
|
{
|
||||||
$this->item->addAttribute(new Attribute());
|
$this->item->addAttribute(new Attribute());
|
||||||
self::assertCount(1, $this->item->getAttributes());
|
self::assertCount(1, $this->item->attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -88,17 +78,17 @@ final class ItemTest extends \PHPUnit\Framework\TestCase
|
||||||
*/
|
*/
|
||||||
public function testSerialize() : void
|
public function testSerialize() : void
|
||||||
{
|
{
|
||||||
$this->item->number = '123456';
|
$this->item->number = '123456';
|
||||||
$this->item->setStatus(ItemStatus::INACTIVE);
|
$this->item->status = ItemStatus::INACTIVE;
|
||||||
$this->item->info = 'Test info';
|
$this->item->info = 'Test info';
|
||||||
|
|
||||||
self::assertEquals(
|
self::assertEquals(
|
||||||
[
|
[
|
||||||
'id' => 0,
|
'id' => 0,
|
||||||
'number' => '123456',
|
'number' => '123456',
|
||||||
'status' => ItemStatus::INACTIVE,
|
'status' => ItemStatus::INACTIVE,
|
||||||
'info' => 'Test info',
|
'info' => 'Test info',
|
||||||
'l11n' => [],
|
'l11n' => [],
|
||||||
],
|
],
|
||||||
$this->item->jsonSerialize()
|
$this->item->jsonSerialize()
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user