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

View File

@ -295,5 +295,31 @@
"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',
'verb' => RouteVerb::GET,
@ -61,7 +61,7 @@ return [
],
],
],
'.*/warehouse/stock/create.*$' => [
'.*/warehouse/item/create.*$' => [
[
'dest' => '\Modules\ItemManagement\Controller\BackendController:viewItemManagementWarehousingCreate',
'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);
}
/**
* 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 Modules\Admin\Models\LocalizationMapper;
use Modules\Billing\Models\BillMapper;
use Modules\Billing\Models\SalesBillMapper;
use Modules\Billing\Models\BillTypeL11n;
use Modules\ItemManagement\Models\ItemAttributeMapper;
use Modules\ItemManagement\Models\ItemL11nMapper;
@ -105,6 +105,9 @@ final class BackendController extends Controller
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/stock-list');
$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;
}
@ -213,16 +216,16 @@ final class BackendController extends Controller
// stats
if ($this->app->moduleManager->isActive('Billing')) {
$ytd = BillMapper::getSalesByItemId($item->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'));
$mtd = BillMapper::getSalesByItemId($item->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now'));
$avg = BillMapper::getAvgSalesPriceByItemId($item->getId(), (new SmartDateTime('now'))->smartModify(-1), new SmartDateTime('now'));
$lastOrder = BillMapper::getLastOrderDateByItemId($item->getId());
$ytd = SalesBillMapper::getSalesByItemId($item->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'));
$mtd = SalesBillMapper::getSalesByItemId($item->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now'));
$avg = SalesBillMapper::getAvgSalesPriceByItemId($item->getId(), (new SmartDateTime('now'))->smartModify(-1), new SmartDateTime('now'));
$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)
$newestInvoices = BillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestItemInvoices($item->getId(), 5);
$topCustomers = BillMapper::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'));
$countrySales = BillMapper::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'));
$newestInvoices = SalesBillMapper::withConditional('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestItemInvoices($item->getId(), 5);
$topCustomers = SalesBillMapper::getItemTopCustomers($item->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'), 5);
$regionSales = SalesBillMapper::getItemRegionSales($item->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'));
$countrySales = SalesBillMapper::getItemCountrySales($item->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'), 5);
$monthlySalesCosts = SalesBillMapper::getItemMonthlySalesCosts($item->getId(), (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'));
} else {
$ytd = new Money();
$mtd = new Money();
@ -245,6 +248,50 @@ final class BackendController extends Controller
$view->addData('countrySales', $countrySales);
$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;
}
}

View File

@ -14,6 +14,7 @@ declare(strict_types=1);
namespace Modules\ItemManagement\Models;
use Modules\Editor\Models\EditorDoc;
use Modules\Media\Models\Media;
use Modules\Media\Models\NullMedia;
use phpOMS\Localization\Money;
@ -60,6 +61,14 @@ class Item
*/
private array $files = [];
/**
* Files.
*
* @var EditorDoc[]
* @since 1.0.0
*/
private array $notes = [];
/**
* Localizations.
*
@ -190,6 +199,44 @@ class Item
$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
*

View File

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

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

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

View File

@ -24,7 +24,7 @@ echo $this->getData('nav')->render(); ?>
<div class="col-xs-12">
<section class="portlet">
<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>
<tr>
<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>
<tbody>
<?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');
?>
<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('name2')->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>

View File

@ -25,6 +25,9 @@ $item = $this->getData('item');
$itemL11n = $this->getData('itemL11n');
$itemAttribute = $this->getData('itemAttribute');
$notes = $item->getNotes();
$files = $item->getFiles();
$newestInvoices = $this->getData('newestInvoices') ?? [];
$topCustomers = $this->getData('topCustomers') ?? [];
$regionSales = $this->getData('regionSales') ?? [];
@ -102,7 +105,7 @@ echo $this->getData('nav')->render();
<div class="col-xs-12 col-lg-4">
<section class="portlet highlight-1">
<div class="portlet-body">
<table>
<table class="wf-100">
<tr><td><?= $this->getHtml('YTDSales'); ?>:
<td><?= $this->getData('ytd')->getCurrency(); ?>
<tr><td><?= $this->getHtml('MTDSales'); ?>:
@ -119,7 +122,7 @@ echo $this->getData('nav')->render();
<div class="col-xs-12 col-lg-4">
<section class="portlet highlight-2">
<div class="portlet-body">
<table>
<table class="wf-100">
<tr><td><?= $this->getHtml('LastOrder'); ?>:
<td><?= $this->getData('lastOrder') !== null ? $this->getData('lastOrder')->format('Y-m-d H:i') : ''; ?>
<tr><td><?= $this->getHtml('PriceChange'); ?>:
@ -136,7 +139,7 @@ echo $this->getData('nav')->render();
<div class="col-xs-12 col-lg-4">
<section class="portlet highlight-3">
<div class="portlet-body">
<table>
<table class="wf-100">
<tr><td><?= $this->getHtml('SalesPrice'); ?>:
<td><?= $item->salesPrice->getCurrency(); ?>
<tr><td><?= $this->getHtml('PurchasePrice'); ?>:
@ -155,14 +158,42 @@ echo $this->getData('nav')->render();
<div class="col-xs-12 col-md-6">
<section class="portlet">
<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>
</div>
<div class="col-xs-12 col-md-6">
<section class="portlet">
<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>
</div>
</div>

View File

@ -12,45 +12,65 @@
*/
declare(strict_types=1);
/**
* @var \phpOMS\Views\View $this
*/
use Modules\Media\Models\NullMedia;
use phpOMS\Uri\UriFactory;
$footerView = new \phpOMS\Views\PaginationView($this->l11nManager, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(25);
$footerView->setPage(1);
$footerView->setResults(1);
/** @var \phpOMS\Views\View $this */
$items = $this->getData('items');
echo $this->getData('nav')->render(); ?>
<div class="row">
<div class="col-xs-12">
<div class="box wf-100">
<table class="default">
<caption><?= $this->getHtml('Stock'); ?><i class="fa fa-download floatRight download btn"></i></caption>
<section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Items'); ?><i class="fa fa-download floatRight download btn"></i></div>
<table id="iWarehouseItemList" class="default">
<thead>
<tr>
<td>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<td class="wf-100"><?= $this->getHtml('Article'); ?>
<td><?= $this->getHtml('Quantity'); ?>
<tfoot>
<tr><td colspan="8">
<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>
<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>
<td><?= $this->getHtml('Name'); ?>
<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>
<?php $c = 0; foreach ([] as $key => $value) : ++$c;
$url = \phpOMS\Uri\UriFactory::build('{/prefix}business/department/profile?{?}&id=' . $value->getId()); ?>
<tr>
<td><a href="<?= $url; ?>"><?= $value->getId(); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->name); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->parent); ?></a>
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getUnit()); ?></a>
<?php endforeach; ?>
<?php if ($c === 0) : ?>
<tr>
<td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
<?php $count = 0; foreach ($items as $key => $value) : ++$count;
$url = UriFactory::build('{/prefix}warehouse/item/profile?{?}&id=' . $value->getId());
$image = $value->getFileByType('backend_image');
?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><img width="30" loading="lazy" class="item-image"
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 if ($count === 0) : ?>
<tr><td colspan="9" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</section>
</div>
</div>

View File

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