data['item'] ?? new NullItem(); $isNew = $item->id === 0; $logs = $this->data['logs'] ?? []; $itemImage = $this->data['itemImage'] ?? new NullMedia(); $allInvoices = $this->data['allInvoices'] ?? []; $topCustomers = $this->data['topCustomers'] ?? [[], []]; $languages = ISO639Enum::getConstants(); $regions = RegionEnum::getConstants(); $countries = ISO3166CharEnum::getConstants(); $currencies = ISO4217CharEnum::getConstants(); $itemStatus = ItemStatus::getConstants(); // @performance The client, supplier and item views should not use actual tabs but individual pages for better performance // Tabs require too many models to be loaded. Implement and then use a tab navigation if it doesn't already exist. // https://github.com/Karaka-Management/oms-ItemManagement/issues/13 echo $this->data['nav']->render(); ?>
request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
notes) && ($warning = $item->getEditorDocByTypeName('item_backend_warning'))->id !== 0) : ?>
printHtml($warning->plain); ?>
>
getHtml('ID', '0', '0'); ?> >
<?= $this->printHtml($itemImage->name); ?>
data['hasBilling'] ?? false) : ?>
getHtml('YTDSales'); ?>: getCurrency(SalesBillMapper::getItemNetSales($item->id, SmartDateTime::startOfYear($this->data['business_start']), new \DateTime('now')), symbol: '', format: 'medium'); ?>
getHtml('MTDSales'); ?>: getCurrency(SalesBillMapper::getItemNetSales($item->id, SmartDateTime::startOfMonth(), new \DateTime('now')), symbol: '', format: 'medium'); ?>
getHtml('ILV'); ?>: getCurrency(SalesBillMapper::getILVHistoric($item->id), symbol: '', format: 'medium'); ?>
getHtml('LastOrder'); ?>: id)?->format('Y-m-d'); ?>
getHtml('PriceChange'); ?>:
getHtml('Created'); ?>: createdAt->format('Y-m-d H:i'); ?>
getHtml('SalesPrice'); ?>: getCurrency($item->salesPrice, symbol: '', format: 'medium'); ?>
getHtml('PurchasePrice'); ?>: getCurrency($item->purchasePrice, symbol: '', format: 'medium'); ?>
getHtml('Margin'); ?>: getNumeric( $item->salesPrice->getInt() === 0 ? 0 : ($item->salesPrice->getInt() - $item->purchasePrice->getInt()) / $item->salesPrice->getInt() * 100 , 'short'); ?> %
getHtml('Notes'); ?>
notes as $note) : ++$count; $url = UriFactory::build('{/base}/editor/view?{?}&id=' . $note->id); ?>
getHtml('Title'); ?> getHtml('CreatedAt'); ?>
printHtml($note->title); ?> printHtml($note->createdAt->format('Y-m-d')); ?>
getHtml('Empty', '0', '0'); ?>
getHtml('Files'); ?>
files as $file) : ++$count; $url = UriFactory::build('{/base}/media/view?{?}&id=' . $file->id); $extensionType = FileUtils::getExtensionType($file->extension); ?> >
getHtml('Title'); ?> getHtml('CreatedAt'); ?>
printHtml($file->name); ?> printHtml($file->extension); ?> printHtml($file->createdAt->format('Y-m-d')); ?>
getHtml('Empty', '0', '0'); ?>
data['hasBilling'] ?? false) : ?>
getHtml('RecentInvoices'); ?>
id, (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'), 5); $count = 0; /** @var \Modules\Billing\Models\Bill $invoice */ foreach ($newestInvoices as $invoice) : ++$count; $url = UriFactory::build('{/base}/sales/bill/view?{?}&id=' . $invoice->id); $clientUrl = UriFactory::build('{/base}/sales/client/view?{?}&id=' . $invoice->client->id); ?>
getHtml('Number'); ?> getHtml('Type'); ?> getHtml('Name'); ?> getHtml('Net'); ?> getHtml('Date'); ?>
printHtml($invoice->getNumber()); ?> printHtml($invoice->type->getL11n()); ?> printHtml($invoice->billTo); ?> getCurrency($invoice->netSales, symbol: ''); ?> printHtml($invoice->performanceDate->format('Y-m-d')); ?>
getHtml('Empty', '0', '0'); ?>
data['hasBilling'] ?? false) : $topCustomers = SalesBillMapper::getItemTopClients($item->id, (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'), 5); ?>
getHtml('TopCustomers'); ?>
id); ?>
getHtml('Number'); ?> getHtml('Name'); ?> getHtml('Country'); ?> getHtml('Net'); ?>
printHtml($client->number); ?> printHtml($client->account->name1); ?> printHtml($client->account->name2); ?> printHtml($client->mainAddress->country); ?> getCurrency(); ?>
id], (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now')); if (!empty($monthlySalesCosts)) : ?>
getHtml('Sales'); ?>
], "datasets": [ { "label": "getHtml('Margin'); ?>", "type": "line", "data": [ ], "yAxisID": "axis2", "fill": false, "borderColor": "rgb(255, 99, 132)", "backgroundColor": "rgb(255, 99, 132)" }, { "label": "getHtml('Sales'); ?>", "type": "bar", "data": [ ], "yAxisID": "axis1", "backgroundColor": "rgb(54, 162, 235)" } ] }, "options": { "responsive": true, "scales": { "axis1": { "id": "axis1", "display": true, "position": "left", "suggestedMin": 0, "ticks": { "precision": 0 } }, "axis2": { "id": "axis2", "display": true, "position": "right", "suggestedMin": 0, "max": 100, "title": { "display": true, "text": "getHtml('Margin'); ?> %" }, "grid": { "display": false }, "beginAtZero": true, "ticks": { "stepSize": 10 } } } } }'>
id, (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'), 5); if (!empty($countrySales)) : ?>
getHtml('Countries'); ?>
], "datasets": [{ "label": "YTD", "type": "bar", "data": [ ], "yAxisID": "axis1", "backgroundColor": "rgb(54, 162, 235)" }] }, "options": { "responsive": true, "scales": { "axis1": { "id": "axis1", "display": true, "position": "left", "suggestedMin": 0, "ticks": { "precision": 0 } } } } }'>
data['l11nView']->render( $this->data['l11nValues'], $this->data['l11nTypes'] ?? [], '{/api}item/l11n?csrf={$CSRF}', (string) $item->id ); ?>
data['attributeView']->render( $item->attributes, $this->data['attributeTypes'] ?? [], $this->data['units'] ?? [], '{/api}item/attribute?csrf={$CSRF}', $item->id ); ?>
getHtml('Container'); ?>
getHtml('Container'); ?>download
data['containers'] ?? []; foreach ($containers as $key => $value) : ++$c; ?>
getHtml('ID', '0', '0'); ?>expand_lessexpand_more getHtml('Name'); ?>expand_lessexpand_more getHtml('Quantity'); ?> getHtml('Decimals'); ?> getHtml('Weight'); ?> getHtml('WidthLength'); ?> getHtml('Height'); ?> getHtml('Depth'); ?> getHtml('Volume'); ?>
settings name !== 'default') : ?> id; ?> printHtml($value->name); ?> printHtml($value->promocode); ?> printHtml($value->promocode); ?> printHtml($value->price->getAmount()); ?> printHtml($value->currency); ?> printHtml((string) $value->quantity); ?> printHtml((string) $value->discount); ?> printHtml((string) $value->discountPercentage); ?>
getHtml('Empty', '0', '0'); ?>
getHtml('Pricing'); ?>
getHtml('Prices'); ?>download
data['prices'] as $key => $value) : if ($value->type !== PriceType::SALES) { continue; } ++$c; ?>
getHtml('ID', '0', '0'); ?>expand_lessexpand_more getHtml('Name'); ?>expand_lessexpand_more getHtml('Promocode'); ?> getHtml('Price'); ?> getHtml('Quantity'); ?> getHtml('Discount'); ?> getHtml('DiscountP'); ?> getHtml('Bonus'); ?> getHtml('ItemSegment'); ?> getHtml('ItemSection'); ?> getHtml('ItemSalesGroup'); ?> getHtml('ItemProductGroup'); ?> getHtml('ItemType'); ?> getHtml('ClientSegment'); ?> getHtml('ClientSection'); ?> getHtml('ClientGroup'); ?> getHtml('ClientType'); ?> getHtml('Region'); ?> getHtml('Start'); ?> getHtml('End'); ?>
settings name !== 'default') : ?> id; ?> printHtml($value->name); ?> printHtml($value->promocode); ?> printHtml($value->priceNew->getAmount()); ?> printHtml($value->currency); ?> quantity->getAmount(); ?> discount->getAmount(); ?> getPercentage($value->discountPercentage); ?> bonus->getAmount(); ?> printHtml((string) $value->itemsegment->getL11n()); ?> printHtml((string) $value->itemsection->getL11n()); ?> printHtml((string) $value->itemsalesgroup->getL11n()); ?> printHtml((string) $value->itemproductgroup->getL11n()); ?> printHtml((string) $value->itemtype->getL11n()); ?> printHtml((string) $value->clientsegment->getL11n()); ?> printHtml((string) $value->clientsection->getL11n()); ?> printHtml((string) $value->clientgroup->getL11n()); ?> printHtml((string) $value->clienttype->getL11n()); ?> printHtml((string) $value->clientcountry); ?> start?->format('Y-m-d'); ?> end?->format('Y-m-d'); ?>
getHtml('Empty', '0', '0'); ?>
getHtml('Procurement'); ?>
getHtml('Pricing'); ?>download
getHtml('Suppliers'); ?>download
data['prices'] as $key => $value) : if ($value->type !== PriceType::PURCHASE) { continue; } ++$c; ?>
getHtml('ID', '0', '0'); ?>expand_lessexpand_more getHtml('Name'); ?>expand_lessexpand_more getHtml('Supplier'); ?> getHtml('Price'); ?> getHtml('Quantity'); ?> getHtml('Discount'); ?> getHtml('DiscountP'); ?> getHtml('Bonus'); ?> getHtml('Start'); ?> getHtml('End'); ?>
settings name !== 'default') : ?> id; ?> printHtml($value->name); ?> printHtml($value->supplier->number); ?> priceNew->getAmount(); ?> printHtml($value->currency); ?> quantity->getAmount(); ?> discount->getAmount(); ?> getPercentage($value->discountPercentage); ?> bonus->getAmount(); ?> start?->format('Y-m-d'); ?> end?->format('Y-m-d'); ?>
getHtml('Empty', '0', '0'); ?>
getHtml('Accounting'); ?>
getHtml('Stock'); ?>
data['note']->render('item-note', 'notes', $item->notes, '{/api}item/note?csrf={$CSRF}', (string) $item->id); ?>
data['media-upload']->render('item-file', 'files', '', $this->data['files'], '{/api}item/file?csrf={$CSRF}', (string) $item->id); ?>
getHtml('RecentInvoices'); ?>
id, SmartDateTime::startOfYear($this->data['business_start']), new SmartDateTime('now')); $count = 0; /** @var \Modules\Billing\Models\Bill $invoice */ foreach ($allInvoices as $invoice) : ++$count; $url = UriFactory::build('{/base}/sales/bill/view?{?}&id=' . $invoice->id); $clientUrl = UriFactory::build('{/base}/sales/client/view?{?}&id=' . $invoice->client->id); ?>
getHtml('Number'); ?> getHtml('Type'); ?> getHtml('Name'); ?> getHtml('Net'); ?> getHtml('Date'); ?> getHtml('Created'); ?>
getNumber(); ?> type->getL11n(); ?> billTo; ?> getCurrency($invoice->netSales, symbol: ''); ?> performanceDate->format('Y-m-d'); ?> createdAt->format('Y-m-d'); ?>
getHtml('Empty', '0', '0'); ?>
getHtml('Logs', 'Auditor'); ?>download
id . '&ptype=p#{\#}'; $next = empty($logs) ? HttpHeader::getAllHeaders()['Referer'] ?? 'admin/module/settings?id={?id}#{\#}' : 'admin/module/settings?{?}&audit=' . \end($logs)->id . '&ptype=n#{\#}'; foreach ($logs as $key => $audit) : ++$count; $url = UriFactory::build('{/base}/admin/audit/view?{?}&id=' . $audit->id); ?>
getHtml('ID', '0', '0'); ?> getHtml('Module', 'Auditor'); ?> getHtml('Type', 'Auditor'); ?> getHtml('Trigger', 'Auditor'); ?> getHtml('Content', 'Auditor'); ?> getHtml('By', 'Auditor'); ?> getHtml('Ref', 'Auditor'); ?> getHtml('Date', 'Auditor'); ?>
id; ?> printHtml($audit->module); ?> type; ?> printHtml($audit->trigger); ?> printHtml((string) $audit->content); ?> printHtml($audit->createdBy->login); ?> printHtml((string) $audit->ref); ?> createdAt->format('Y-m-d H:i'); ?>
getHtml('Empty', '0', '0'); ?>