fix php version, lang files, basic tpl and sales impl.

This commit is contained in:
Dennis Eichhorn 2021-03-05 21:01:37 +01:00
parent f4f2f5739f
commit 2ce633d508
13 changed files with 325 additions and 64 deletions

View File

@ -128,8 +128,8 @@
"pid": "/", "pid": "/",
"type": 2, "type": 2,
"subtype": 1, "subtype": 1,
"name": "Stock", "name": "Articles",
"uri": "{/prefix}warehouse/stock/list", "uri": "{/prefix}warehouse/item/list",
"target": "self", "target": "self",
"icon": null, "icon": null,
"order": 10, "order": 10,
@ -139,11 +139,11 @@
"children": [ "children": [
{ {
"id": 1004807101, "id": 1004807101,
"pid": "/warehouse/stock", "pid": "/warehouse/item",
"type": 3, "type": 3,
"subtype": 1, "subtype": 1,
"name": "List", "name": "List",
"uri": "{/prefix}warehouse/stock/list", "uri": "{/prefix}warehouse/item/list",
"target": "self", "target": "self",
"icon": null, "icon": null,
"order": 1, "order": 1,
@ -153,11 +153,11 @@
"children": [ "children": [
{ {
"id": 1004807301, "id": 1004807301,
"pid": "/warehouse/stock", "pid": "/warehouse/item",
"type": 3, "type": 3,
"subtype": 1, "subtype": 1,
"name": "Article", "name": "Article",
"uri": "{/prefix}warehouse/stock/single?{?}", "uri": "{/prefix}warehouse/item/single?{?}",
"target": "self", "target": "self",
"icon": null, "icon": null,
"order": 1, "order": 1,
@ -170,11 +170,11 @@
}, },
{ {
"id": 1004807201, "id": 1004807201,
"pid": "/warehouse/stock", "pid": "/warehouse/item",
"type": 3, "type": 3,
"subtype": 1, "subtype": 1,
"name": "Create", "name": "Create",
"uri": "{/prefix}warehouse/stock/create?{?}", "uri": "{/prefix}warehouse/item/create?{?}",
"target": "self", "target": "self",
"icon": null, "icon": null,
"order": 5, "order": 5,

View File

@ -295,5 +295,31 @@
"foreignKey": "media_id" "foreignKey": "media_id"
} }
} }
},
"itemmgmt_item_note": {
"name": "itemmgmt_item_note",
"fields": {
"itemmgmt_item_note_id": {
"name": "itemmgmt_item_note_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"itemmgmt_item_note_item": {
"name": "itemmgmt_item_note_item",
"type": "INT",
"null": false,
"foreignTable": "itemmgmt_item",
"foreignKey": "itemmgmt_item_id"
},
"itemmgmt_item_note_doc": {
"name": "itemmgmt_item_note_doc",
"type": "INT",
"null": false,
"foreignTable": "editor_doc",
"foreignKey": "editor_doc_id"
}
}
} }
} }

View File

@ -28,7 +28,7 @@ return [
], ],
], ],
], ],
'^.*/warehouse/stock/list.*$' => [ '^.*/warehouse/item/list.*$' => [
[ [
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementWarehousingList', 'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementWarehousingList',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -61,7 +61,7 @@ return [
], ],
], ],
], ],
'.*/warehouse/stock/create.*$' => [ '.*/warehouse/item/create.*$' => [
[ [
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementWarehousingCreate', 'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementWarehousingCreate',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -83,4 +83,26 @@ return [
], ],
], ],
], ],
'^.*/purchase/item/profile.*$' => [
[
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementPurchaseItem',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::PURCHASE_ITEM,
],
],
],
'^.*/warehouse/item/profile.*$' => [
[
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementWarehouseItem',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::STOCK_ITEM,
],
],
],
]; ];

View File

@ -607,4 +607,26 @@ final class ApiController extends Controller
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Image', 'Image successfully updated', $uploaded); $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Image', 'Image successfully updated', $uploaded);
} }
/**
* Api method to create item files
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return void
*
* @api
*
* @since 1.0.0
*/
public function apiNoteCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
{
$request->setData('virtualpath', '/Modules/ItemManagement/Articles/' . $request->getData('id'), true);
$this->app->moduleManager->get('Editor')->apiEditorCreate($request, $response, $data);
$model = $response->get($request->uri->__toString())['response'];
$this->createModelRelation($request->header->account, $request->getData('id'), $model->getId(), ItemMapper::class, 'notes', '', $request->getOrigin());
}
} }

View File

@ -16,7 +16,7 @@ namespace Modules\ItemManagement\Controller;
use Model\SettingsEnum; use Model\SettingsEnum;
use Modules\Admin\Models\LocalizationMapper; use Modules\Admin\Models\LocalizationMapper;
use Modules\Billing\Models\BillMapper; use Modules\Billing\Models\SalesBillMapper;
use Modules\Billing\Models\BillTypeL11n; use Modules\Billing\Models\BillTypeL11n;
use Modules\ItemManagement\Models\ItemAttributeMapper; use Modules\ItemManagement\Models\ItemAttributeMapper;
use Modules\ItemManagement\Models\ItemL11nMapper; use Modules\ItemManagement\Models\ItemL11nMapper;
@ -105,6 +105,9 @@ final class BackendController extends Controller
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/stock-list'); $view->setTemplate('/Modules/ItemManagement/Theme/Backend/stock-list');
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004807001, $request, $response)); $view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004807001, $request, $response));
$items = ItemMapper::withConditional('language', $response->getLanguage())::getAfterPivot(0, null, 25);
$view->addData('items', $items);
return $view; return $view;
} }
@ -213,16 +216,16 @@ final class BackendController extends Controller
// stats // stats
if ($this->app->moduleManager->isActive('Billing')) { if ($this->app->moduleManager->isActive('Billing')) {
$ytd = BillMapper::getSalesByItemId($item->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now')); $ytd = SalesBillMapper::getSalesByItemId($item->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'));
$mtd = BillMapper::getSalesByItemId($item->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now')); $mtd = SalesBillMapper::getSalesByItemId($item->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now'));
$avg = BillMapper::getAvgSalesPriceByItemId($item->getId(), (new SmartDateTime('now'))->smartModify(-1), new SmartDateTime('now')); $avg = SalesBillMapper::getAvgSalesPriceByItemId($item->getId(), (new SmartDateTime('now'))->smartModify(-1), new SmartDateTime('now'));
$lastOrder = BillMapper::getLastOrderDateByItemId($item->getId()); $lastOrder = SalesBillMapper::getLastOrderDateByItemId($item->getId());
// @todo: why is the conditional array necessary, shouldn't the mapper realize when it mustn't use the conditional (when the field doesn't exist in the mapper) // @todo: why is the conditional array necessary, shouldn't the mapper realize when it mustn't use the conditional (when the field doesn't exist in the mapper)
$newestInvoices = BillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestItemInvoices($item->getId(), 5); $newestInvoices = SalesBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestItemInvoices($item->getId(), 5);
$topCustomers = BillMapper::getItemTopCustomers($item->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'), 5); $topCustomers = SalesBillMapper::getItemTopCustomers($item->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'), 5);
$regionSales = BillMapper::getItemRegionSales($item->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now')); $regionSales = SalesBillMapper::getItemRegionSales($item->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'));
$countrySales = BillMapper::getItemCountrySales($item->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'), 5); $countrySales = SalesBillMapper::getItemCountrySales($item->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'), 5);
$monthlySalesCosts = BillMapper::getItemMonthlySalesCosts($item->getId(), (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now')); $monthlySalesCosts = SalesBillMapper::getItemMonthlySalesCosts($item->getId(), (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'));
} else { } else {
$ytd = new Money(); $ytd = new Money();
$mtd = new Money(); $mtd = new Money();
@ -245,6 +248,50 @@ final class BackendController extends Controller
$view->addData('countrySales', $countrySales); $view->addData('countrySales', $countrySales);
$view->addData('monthlySalesCosts', $monthlySalesCosts); $view->addData('monthlySalesCosts', $monthlySalesCosts);
return $view;
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewItemManagementPurchaseItem(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = $this->viewItemManagementSalesItem($request, $response, $data);
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/sales-item-profile');
$view->setData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004806001, $request, $response));
return $view;
}
/**
* Routing end-point for application behaviour.
*
* @param RequestAbstract $request Request
* @param ResponseAbstract $response Response
* @param mixed $data Generic data
*
* @return RenderableInterface
*
* @since 1.0.0
* @codeCoverageIgnore
*/
public function viewItemManagementWarehouseItem(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{
$view = $this->viewItemManagementSalesItem($request, $response, $data);
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/sales-item-profile');
$view->setData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004806001, $request, $response));
return $view; return $view;
} }
} }

View File

@ -14,6 +14,7 @@ declare(strict_types=1);
namespace Modules\ItemManagement\Models; namespace Modules\ItemManagement\Models;
use Modules\Editor\Models\EditorDoc;
use Modules\Media\Models\Media; use Modules\Media\Models\Media;
use Modules\Media\Models\NullMedia; use Modules\Media\Models\NullMedia;
use phpOMS\Localization\Money; use phpOMS\Localization\Money;
@ -60,6 +61,14 @@ class Item
*/ */
private array $files = []; private array $files = [];
/**
* Files.
*
* @var EditorDoc[]
* @since 1.0.0
*/
private array $notes = [];
/** /**
* Localizations. * Localizations.
* *
@ -190,6 +199,44 @@ class Item
$this->files[] = $media; $this->files[] = $media;
} }
/**
* Add doc to item
*
* @param EditorDoc $note Note
*
* @return void
*
* @since 1.0.0
*/
public function addNote(EditorDoc $note) : void
{
$this->notes[] = $note;
}
/**
* Get notes
*
* @return EditorDoc[]
*
* @since 1.0.0
*/
public function getNotes() : array
{
return $this->notes;
}
/**
* Get files
*
* @return Media[]
*
* @since 1.0.0
*/
public function getFiles() : array
{
return $this->files;
}
/** /**
* Get media file by type * Get media file by type
* *

View File

@ -15,6 +15,7 @@ declare(strict_types=1);
namespace Modules\ItemManagement\Models; namespace Modules\ItemManagement\Models;
use Modules\Media\Models\MediaMapper; use Modules\Media\Models\MediaMapper;
use Modules\Editor\Models\EditorDocMapper;
use phpOMS\DataStorage\Database\DataMapperAbstract; use phpOMS\DataStorage\Database\DataMapperAbstract;
/** /**
@ -74,6 +75,12 @@ final class ItemMapper extends DataMapperAbstract
'external' => 'itemmgmt_item_media_media', 'external' => 'itemmgmt_item_media_media',
'self' => 'itemmgmt_item_media_item', 'self' => 'itemmgmt_item_media_item',
], ],
'notes' => [
'mapper' => EditorDocMapper::class, /* mapper of the related object */
'table' => 'itemmgmt_item_note', /* table of the related object, null if no relation table is used (many->1) */
'external' => 'itemmgmt_item_note_doc',
'self' => 'itemmgmt_item_note_item',
],
'l11n' => [ 'l11n' => [
'mapper' => ItemL11nMapper::class, 'mapper' => ItemL11nMapper::class,
'table' => 'itemmgmt_item_l11n', 'table' => 'itemmgmt_item_l11n',

25
Theme/Backend/Lang/de.lang.php Executable file → Normal file
View File

@ -4,7 +4,7 @@
* *
* PHP Version 8.0 * PHP Version 8.0
* *
* @package Modules\ItemManagement * @package Modules\Localization
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0
@ -20,6 +20,7 @@ return ['ItemManagement' => [
'Attribute' => 'Attribut', 'Attribute' => 'Attribut',
'Attributes' => 'Attribute', 'Attributes' => 'Attribute',
'Available' => 'Verfügbar', 'Available' => 'Verfügbar',
'AvgPrice' => '',
'Bonus' => 'Bonus', 'Bonus' => 'Bonus',
'ClientGroup' => 'Kunde/Gruppe', 'ClientGroup' => 'Kunde/Gruppe',
'Commission' => 'Kommission', 'Commission' => 'Kommission',
@ -27,7 +28,9 @@ return ['ItemManagement' => [
'CostCenter' => 'Kostenstelle', 'CostCenter' => 'Kostenstelle',
'CostIndicator' => 'Kostenkennzeichen', 'CostIndicator' => 'Kostenkennzeichen',
'CostObject' => 'Kostenträger', 'CostObject' => 'Kostenträger',
'Countries' => '',
'Country' => 'Land', 'Country' => 'Land',
'Created' => '',
'Customer' => 'Kunde', 'Customer' => 'Kunde',
'CustomerGroup' => 'Kundengruppe', 'CustomerGroup' => 'Kundengruppe',
'CustomsID' => 'Kunden ID', 'CustomsID' => 'Kunden ID',
@ -36,50 +39,64 @@ return ['ItemManagement' => [
'Discount' => 'Rabatt', 'Discount' => 'Rabatt',
'DiscountP' => 'Rabatt in %', 'DiscountP' => 'Rabatt in %',
'Disposal' => 'Verschrottung', 'Disposal' => 'Verschrottung',
'Documents' => '',
'EarningIndicator' => 'Umsatzkennzeichen', 'EarningIndicator' => 'Umsatzkennzeichen',
'End' => 'Ende', 'End' => 'Ende',
'Files' => 'Dateien', 'Files' => 'Dateien',
'General' => 'Allgemein', 'General' => 'Allgemein',
'GrossWeight' => 'Brutto Gewicht', 'GrossWeight' => 'Brutto Gewicht',
'Group' => 'Gruppe', 'Group' => 'Gruppe',
'Groups' => '',
'Height' => 'Höhe', 'Height' => 'Höhe',
'ID' => 'ID', 'ID' => 'ID',
'ILV' => '',
'Info' => 'Info', 'Info' => 'Info',
'IsActive' => 'Aktiv?', 'IsActive' => 'Aktiv?',
'Item' => 'Artikel', 'Item' => 'Artikel',
'Items' => 'Artikel', 'Items' => 'Artikel',
'Language' => 'Sprache', 'Language' => 'Sprache',
'LastOrder' => '',
'Leadtime' => 'Lieferzeit', 'Leadtime' => 'Lieferzeit',
'Length' => 'Länge', 'Length' => 'Länge',
'Localization' => 'Lokalisierung', 'Localization' => 'Lokalisierung',
'Localizations' => '',
'Location' => 'Ort', 'Location' => 'Ort',
'Log' => 'Log', 'Log' => 'Log',
'Logs' => 'Logs', 'Logs' => 'Logs',
'Lot' => 'Charge', 'Lot' => 'Charge',
'MRR' => '',
'MTDSales' => '',
'Makespan' => 'Produktionszeit', 'Makespan' => 'Produktionszeit',
'Margin' => '',
'Master' => 'Master', 'Master' => 'Master',
'MaximumLevel' => 'Höchstwert', 'MaximumLevel' => 'Höchstwert',
'Media' => 'Media', 'Media' => 'Media',
'MinimumLevel' => 'Mindestbestand', 'MinimumLevel' => 'Mindestbestand',
'Modified' => '',
'Name' => 'Name', 'Name' => 'Name',
'Name1' => 'Name1', 'Name1' => 'Name1',
'Name2' => 'Name2', 'Name2' => 'Name2',
'Name3' => 'Name3', 'Name3' => 'Name3',
'Name4' => 'Name4', 'Name4' => 'Name4',
'Name5' => 'Name5', 'Name5' => 'Name5',
'Net' => '',
'NetWeight' => 'Netto Gewicht', 'NetWeight' => 'Netto Gewicht',
'None' => 'Keine', 'None' => 'Keine',
'Notes' => '',
'Number' => '',
'Ordered' => 'Bestellt', 'Ordered' => 'Bestellt',
'Packaging' => 'Verpackung', 'Packaging' => 'Verpackung',
'Price' => 'Preis', 'Price' => 'Preis',
'Prices' => 'Preise', 'PriceChange' => '',
'PriceUnit' => 'Stückpreis', 'PriceUnit' => 'Stückpreis',
'Prices' => 'Preise',
'Productgroup' => 'Produktgruppe', 'Productgroup' => 'Produktgruppe',
'Production' => 'Produktion', 'Production' => 'Produktion',
'Profile' => 'Profil', 'Profile' => 'Profil',
'Properties' => 'Attribute', 'Properties' => 'Attribute',
'Property' => 'Attribut', 'Property' => 'Attribut',
'Purchase' => 'Einkauf', 'Purchase' => 'Einkauf',
'PurchasePrice' => '',
'Purchasing' => 'Einkaufen', 'Purchasing' => 'Einkaufen',
'QA' => 'QS', 'QA' => 'QS',
'QM' => 'QM', 'QM' => 'QM',
@ -87,10 +104,11 @@ return ['ItemManagement' => [
'QuantityUnit' => 'Mengeneinheit', 'QuantityUnit' => 'Mengeneinheit',
'ReorderLevel' => 'Bestellgrenze', 'ReorderLevel' => 'Bestellgrenze',
'Reserved' => 'Reservierd', 'Reserved' => 'Reservierd',
'SN' => 'SN',
'Sales' => 'Umsatz', 'Sales' => 'Umsatz',
'SalesPrice' => '',
'Segment' => 'Segment', 'Segment' => 'Segment',
'ShelfLife' => 'Haltbarkeit', 'ShelfLife' => 'Haltbarkeit',
'SN' => 'SN',
'Source' => 'Quelle', 'Source' => 'Quelle',
'Start' => 'Start', 'Start' => 'Start',
'Status' => 'Status', 'Status' => 'Status',
@ -112,4 +130,5 @@ return ['ItemManagement' => [
'Volume' => 'Volumen', 'Volume' => 'Volumen',
'Warehouse' => 'Lager', 'Warehouse' => 'Lager',
'Width' => 'Breite', 'Width' => 'Breite',
'YTDSales' => '',
]]; ]];

25
Theme/Backend/Lang/en.lang.php Executable file → Normal file
View File

@ -4,7 +4,7 @@
* *
* PHP Version 8.0 * PHP Version 8.0
* *
* @package Modules\ItemManagement * @package Modules\Localization
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0
@ -20,6 +20,7 @@ return ['ItemManagement' => [
'Attribute' => 'Attribute', 'Attribute' => 'Attribute',
'Attributes' => 'Attributes', 'Attributes' => 'Attributes',
'Available' => 'Available', 'Available' => 'Available',
'AvgPrice' => 'Avg. Price',
'Bonus' => 'Bonus', 'Bonus' => 'Bonus',
'ClientGroup' => 'Client/Group', 'ClientGroup' => 'Client/Group',
'Commission' => 'Commission', 'Commission' => 'Commission',
@ -27,7 +28,9 @@ return ['ItemManagement' => [
'CostCenter' => 'CostCenter', 'CostCenter' => 'CostCenter',
'CostIndicator' => 'Cost Indicator', 'CostIndicator' => 'Cost Indicator',
'CostObject' => 'CostObject', 'CostObject' => 'CostObject',
'Countries' => 'Countries',
'Country' => 'Country', 'Country' => 'Country',
'Created' => 'Created',
'Customer' => 'Customer ', 'Customer' => 'Customer ',
'CustomerGroup' => 'Customer Group', 'CustomerGroup' => 'Customer Group',
'CustomsID' => 'Customs ID', 'CustomsID' => 'Customs ID',
@ -36,50 +39,64 @@ return ['ItemManagement' => [
'Discount' => 'Discount', 'Discount' => 'Discount',
'DiscountP' => 'Discount in %', 'DiscountP' => 'Discount in %',
'Disposal' => 'Disposal', 'Disposal' => 'Disposal',
'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' => '',
'Height' => 'Height', 'Height' => 'Height',
'ID' => 'ID', 'ID' => 'ID',
'ILV' => 'ILV',
'Info' => 'Info', 'Info' => 'Info',
'IsActive' => 'Active?', 'IsActive' => 'Active?',
'Item' => 'Item', 'Item' => 'Item',
'Items' => 'Items', 'Items' => 'Items',
'Language' => 'Language', 'Language' => 'Language',
'LastOrder' => 'Last Order',
'Leadtime' => 'Lead time', 'Leadtime' => 'Lead time',
'Length' => 'Length', 'Length' => 'Length',
'Localization' => 'Localization', 'Localization' => 'Localization',
'Localizations' => 'Localizations',
'Location' => 'Location', 'Location' => 'Location',
'Log' => 'Log', 'Log' => 'Log',
'Logs' => 'Logs', 'Logs' => 'Logs',
'Lot' => 'Lot', 'Lot' => 'Lot',
'MRR' => 'MRR',
'MTDSales' => 'MTD Sales',
'Makespan' => 'Makespan', 'Makespan' => 'Makespan',
'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',
'Name' => 'Name', 'Name' => 'Name',
'Name1' => 'Name1', 'Name1' => 'Name1',
'Name2' => 'Name2', 'Name2' => 'Name2',
'Name3' => 'Name3', 'Name3' => 'Name3',
'Name4' => 'Name4', 'Name4' => 'Name4',
'Name5' => 'Name5', 'Name5' => 'Name5',
'Net' => 'Net Weight',
'NetWeight' => 'Net Weight', 'NetWeight' => 'Net Weight',
'None' => 'None', 'None' => 'None',
'Notes' => 'Notes',
'Number' => 'Number',
'Ordered' => 'Ordered', 'Ordered' => 'Ordered',
'Packaging' => 'Packaging', 'Packaging' => 'Packaging',
'Price' => 'Price', 'Price' => 'Price',
'Prices' => 'Prices', 'PriceChange' => 'Price Change',
'PriceUnit' => 'Unit of price', 'PriceUnit' => 'Unit of price',
'Prices' => 'Prices',
'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',
'Purchasing' => 'Purchasing', 'Purchasing' => 'Purchasing',
'QA' => 'QA', 'QA' => 'QA',
'QM' => 'QM', 'QM' => 'QM',
@ -87,10 +104,11 @@ return ['ItemManagement' => [
'QuantityUnit' => 'Unit of quantity', 'QuantityUnit' => 'Unit of quantity',
'ReorderLevel' => 'Reorder level', 'ReorderLevel' => 'Reorder level',
'Reserved' => 'Reserved', 'Reserved' => 'Reserved',
'SN' => 'SN',
'Sales' => 'Sales', 'Sales' => 'Sales',
'SalesPrice' => 'Sales Price',
'Segment' => 'Segment', 'Segment' => 'Segment',
'ShelfLife' => 'Shelf life', 'ShelfLife' => 'Shelf life',
'SN' => 'SN',
'Source' => 'Source', 'Source' => 'Source',
'Start' => 'Start', 'Start' => 'Start',
'Status' => 'Status', 'Status' => 'Status',
@ -112,4 +130,5 @@ return ['ItemManagement' => [
'Volume' => 'Volume', 'Volume' => 'Volume',
'Warehouse' => 'Warehouse', 'Warehouse' => 'Warehouse',
'Width' => 'Width', 'Width' => 'Width',
'YTDSales' => 'YTD Sales',
]]; ]];

View File

@ -24,7 +24,7 @@ echo $this->getData('nav')->render(); ?>
<div class="col-xs-12"> <div class="col-xs-12">
<section class="portlet"> <section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Items'); ?><i class="fa fa-download floatRight download btn"></i></div> <div class="portlet-head"><?= $this->getHtml('Items'); ?><i class="fa fa-download floatRight download btn"></i></div>
<table id="iSalesItemList" class="default"> <table id="iPurchaseItemList" class="default">
<thead> <thead>
<tr> <tr>
<td> <td>
@ -54,7 +54,7 @@ echo $this->getData('nav')->render(); ?>
<input id="itemList-r8-desc" name="itemList-sort" type="radio"><label for="itemList-r8-desc"><i class="sort-desc fa fa-chevron-down"></i></label> <input id="itemList-r8-desc" name="itemList-sort" type="radio"><label for="itemList-r8-desc"><i class="sort-desc fa fa-chevron-down"></i></label>
<tbody> <tbody>
<?php $count = 0; foreach ($items as $key => $value) : ++$count; <?php $count = 0; foreach ($items as $key => $value) : ++$count;
$url = UriFactory::build('{/prefix}sales/item/profile?{?}&id=' . $value->getId()); $url = UriFactory::build('{/prefix}purchase/item/profile?{?}&id=' . $value->getId());
$image = $value->getFileByType('backend_image'); $image = $value->getFileByType('backend_image');
?> ?>
<tr data-href="<?= $url; ?>"> <tr data-href="<?= $url; ?>">
@ -66,7 +66,7 @@ echo $this->getData('nav')->render(); ?>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name1')->description); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name1')->description); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name2')->description); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name2')->description); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name3')->description); ?></a> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name3')->description); ?></a>
<td> <td><a href="<?= $url; ?>"><?= $this->printHtml($value->purchasePrice->getCurrency()); ?></a>
<td> <td>
<td> <td>
<td> <td>

View File

@ -25,6 +25,9 @@ $item = $this->getData('item');
$itemL11n = $this->getData('itemL11n'); $itemL11n = $this->getData('itemL11n');
$itemAttribute = $this->getData('itemAttribute'); $itemAttribute = $this->getData('itemAttribute');
$notes = $item->getNotes();
$files = $item->getFiles();
$newestInvoices = $this->getData('newestInvoices') ?? []; $newestInvoices = $this->getData('newestInvoices') ?? [];
$topCustomers = $this->getData('topCustomers') ?? []; $topCustomers = $this->getData('topCustomers') ?? [];
$regionSales = $this->getData('regionSales') ?? []; $regionSales = $this->getData('regionSales') ?? [];
@ -102,7 +105,7 @@ echo $this->getData('nav')->render();
<div class="col-xs-12 col-lg-4"> <div class="col-xs-12 col-lg-4">
<section class="portlet highlight-1"> <section class="portlet highlight-1">
<div class="portlet-body"> <div class="portlet-body">
<table> <table class="wf-100">
<tr><td><?= $this->getHtml('YTDSales'); ?>: <tr><td><?= $this->getHtml('YTDSales'); ?>:
<td><?= $this->getData('ytd')->getCurrency(); ?> <td><?= $this->getData('ytd')->getCurrency(); ?>
<tr><td><?= $this->getHtml('MTDSales'); ?>: <tr><td><?= $this->getHtml('MTDSales'); ?>:
@ -119,7 +122,7 @@ echo $this->getData('nav')->render();
<div class="col-xs-12 col-lg-4"> <div class="col-xs-12 col-lg-4">
<section class="portlet highlight-2"> <section class="portlet highlight-2">
<div class="portlet-body"> <div class="portlet-body">
<table> <table class="wf-100">
<tr><td><?= $this->getHtml('LastOrder'); ?>: <tr><td><?= $this->getHtml('LastOrder'); ?>:
<td><?= $this->getData('lastOrder') !== null ? $this->getData('lastOrder')->format('Y-m-d H:i') : ''; ?> <td><?= $this->getData('lastOrder') !== null ? $this->getData('lastOrder')->format('Y-m-d H:i') : ''; ?>
<tr><td><?= $this->getHtml('PriceChange'); ?>: <tr><td><?= $this->getHtml('PriceChange'); ?>:
@ -136,7 +139,7 @@ echo $this->getData('nav')->render();
<div class="col-xs-12 col-lg-4"> <div class="col-xs-12 col-lg-4">
<section class="portlet highlight-3"> <section class="portlet highlight-3">
<div class="portlet-body"> <div class="portlet-body">
<table> <table class="wf-100">
<tr><td><?= $this->getHtml('SalesPrice'); ?>: <tr><td><?= $this->getHtml('SalesPrice'); ?>:
<td><?= $item->salesPrice->getCurrency(); ?> <td><?= $item->salesPrice->getCurrency(); ?>
<tr><td><?= $this->getHtml('PurchasePrice'); ?>: <tr><td><?= $this->getHtml('PurchasePrice'); ?>:
@ -155,14 +158,42 @@ echo $this->getData('nav')->render();
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-6">
<section class="portlet"> <section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Notes'); ?></div> <div class="portlet-head"><?= $this->getHtml('Notes'); ?></div>
<div class="portlet-body"></div> <table id="iNotesItemList" class="default">
<thead>
<tr>
<td class="wf-100"><?= $this->getHtml('Title'); ?>
<td><?= $this->getHtml('CreatedAt'); ?>
<tbody>
<?php foreach ($notes as $note) :
$url = UriFactory::build('{/prefix}editor/single?{?}&id=' . $note->getId());
?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $note->title; ?></a>
<td><a href="<?= $url; ?>"><?= $note->createdAt->format('Y-m-d'); ?></a>
<?php endforeach; ?>
</table>
</section> </section>
</div> </div>
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-6">
<section class="portlet"> <section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Documents'); ?></div> <div class="portlet-head"><?= $this->getHtml('Documents'); ?></div>
<div class="portlet-body"></div> <table id="iFilesItemList" class="default">
<thead>
<tr>
<td class="wf-100"><?= $this->getHtml('Title'); ?>
<td>
<td><?= $this->getHtml('CreatedAt'); ?>
<tbody>
<?php foreach ($files as $file) :
$url = UriFactory::build('{/prefix}media/single?{?}&id=' . $file->getId());
?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $file->name; ?></a>
<td><a href="<?= $url; ?>"><?= $file->extension; ?></a>
<td><a href="<?= $url; ?>"><?= $file->createdAt->format('Y-m-d'); ?></a>
<?php endforeach; ?>
</table>
</section> </section>
</div> </div>
</div> </div>

View File

@ -12,45 +12,65 @@
*/ */
declare(strict_types=1); declare(strict_types=1);
/** use Modules\Media\Models\NullMedia;
* @var \phpOMS\Views\View $this use phpOMS\Uri\UriFactory;
*/
$footerView = new \phpOMS\Views\PaginationView($this->l11nManager, $this->request, $this->response); /** @var \phpOMS\Views\View $this */
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig'); $items = $this->getData('items');
$footerView->setPages(25);
$footerView->setPage(1);
$footerView->setResults(1);
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="box wf-100"> <section class="portlet">
<table class="default"> <div class="portlet-head"><?= $this->getHtml('Items'); ?><i class="fa fa-download floatRight download btn"></i></div>
<caption><?= $this->getHtml('Stock'); ?><i class="fa fa-download floatRight download btn"></i></caption> <table id="iWarehouseItemList" class="default">
<thead> <thead>
<tr> <tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?> <td><?= $this->getHtml('ID', '0', '0'); ?>
<td class="wf-100"><?= $this->getHtml('Article'); ?> <input id="itemList-r1-asc" name="itemList-sort" type="radio"><label for="itemList-r1-asc"><i class="sort-asc fa fa-chevron-up"></i></label>
<td><?= $this->getHtml('Quantity'); ?> <input id="itemList-r1-desc" name="itemList-sort" type="radio"><label for="itemList-r1-desc"><i class="sort-desc fa fa-chevron-down"></i></label>
<tfoot> <td><?= $this->getHtml('Name'); ?>
<tr><td colspan="8"> <input id="itemList-r2-asc" name="itemList-sort" type="radio"><label for="itemList-r2-asc"><i class="sort-asc fa fa-chevron-up"></i></label>
<input id="itemList-r2-desc" name="itemList-sort" type="radio"><label for="itemList-r2-desc"><i class="sort-desc fa fa-chevron-down"></i></label>
<td><?= $this->getHtml('Name'); ?>
<input id="itemList-r3-asc" name="itemList-sort" type="radio"><label for="itemList-r3-asc"><i class="sort-asc fa fa-chevron-up"></i></label>
<input id="itemList-r3-desc" name="itemList-sort" type="radio"><label for="itemList-r3-desc"><i class="sort-desc fa fa-chevron-down"></i></label>
<td class="wf-100"><?= $this->getHtml('Name'); ?>
<input id="itemList-r4-asc" name="itemList-sort" type="radio"><label for="itemList-r4-asc"><i class="sort-asc fa fa-chevron-up"></i></label>
<input id="itemList-r4-desc" name="itemList-sort" type="radio"><label for="itemList-r4-desc"><i class="sort-desc fa fa-chevron-down"></i></label>
<td><?= $this->getHtml('Available'); ?>
<input id="itemList-r6-asc" name="itemList-sort" type="radio"><label for="itemList-r6-asc"><i class="sort-asc fa fa-chevron-up"></i></label>
<input id="itemList-r6-desc" name="itemList-sort" type="radio"><label for="itemList-r6-desc"><i class="sort-desc fa fa-chevron-down"></i></label>
<td><?= $this->getHtml('Reserved'); ?>
<input id="itemList-r7-asc" name="itemList-sort" type="radio"><label for="itemList-r7-asc"><i class="sort-asc fa fa-chevron-up"></i></label>
<input id="itemList-r7-desc" name="itemList-sort" type="radio"><label for="itemList-r7-desc"><i class="sort-desc fa fa-chevron-down"></i></label>
<td><?= $this->getHtml('Ordered'); ?>
<input id="itemList-r8-asc" name="itemList-sort" type="radio"><label for="itemList-r8-asc"><i class="sort-asc fa fa-chevron-up"></i></label>
<input id="itemList-r8-desc" name="itemList-sort" type="radio"><label for="itemList-r8-desc"><i class="sort-desc fa fa-chevron-down"></i></label>
<tbody> <tbody>
<?php $c = 0; foreach ([] as $key => $value) : ++$c; <?php $count = 0; foreach ($items as $key => $value) : ++$count;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}business/department/profile?{?}&id=' . $value->getId()); ?> $url = UriFactory::build('{/prefix}warehouse/item/profile?{?}&id=' . $value->getId());
<tr> $image = $value->getFileByType('backend_image');
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a> ?>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a> <tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->parent); ?></a> <td><a href="<?= $url; ?>"><img width="30" loading="lazy" class="item-image"
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getUnit()); ?></a> src="<?= $image instanceof NullMedia ?
UriFactory::build('Web/Backend/img/user_default_' . \mt_rand(1, 6) .'.png') :
UriFactory::build('{/prefix}' . $image->getPath()); ?>"></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->number); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name1')->description); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name2')->description); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getL11n('name3')->description); ?></a>
<td>
<td>
<td>
<?php endforeach; ?> <?php endforeach; ?>
<?php if ($c === 0) : ?> <?php if ($count === 0) : ?>
<tr> <tr><td colspan="9" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?> <?php endif; ?>
</table> </table>
</div> </section>
</div> </div>
</div> </div>

View File

@ -17,7 +17,8 @@
"description": "Event Management module.", "description": "Event Management module.",
"directory": "ItemManagement", "directory": "ItemManagement",
"dependencies": { "dependencies": {
"Admin": "1.0.0" "Admin": "1.0.0",
"Editor": "1.0.0"
}, },
"providing": { "providing": {
"Navigation": "*", "Navigation": "*",