data['supplier'] ?? new NullSupplier(); $isNew = $supplier->id === 0; $supplierImage = $this->getData('supplierImage') ?? new NullMedia(); $supplierStatus = SupplierStatus::getConstants(); $monthlySalesCosts = $this->data['monthlySalesCosts'] ?? []; /** * @var \phpOMS\Views\View $this */ echo $this->data['nav']->render(); ?>
request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>>
data['hasBilling'] ?? false) || ($this->data['hasAccounting'] ?? false))) : ?>
data['hasBilling'] ?? false) : ?> getHtml('CreateBill'); ?> data['hasAccounting'] ?? false) : ?> getHtml('ViewAccount'); ?>
>
getHtml('Contact'); ?> mail
getHtml('Address'); ?>
mainAddress->fao)) : ?>
mainAddress->addressAddition)) : ?>
<?= $this->printHtml($supplierImage->name); ?>
notes) && ($warning = $supplier->getEditorDocByTypeName('supplier_backend_warning'))->id !== 0) : ?>
printHtml($warning->plain); ?>
data['hasBilling'] ?? false) : ?>
getHtml('YTDSales'); ?>: id, SmartDateTime::startOfYear($this->data['business_start']), new \DateTime('now'))->getAmount(); ?>
getHtml('MTDSales'); ?>: id, SmartDateTime::startOfMonth(), new \DateTime('now'))->getAmount(); ?>
getHtml('SLV'); ?>: id)->getAmount(); ?>
getHtml('LastContact'); ?>: id)?->format('Y-m-d'); ?>
getHtml('LastOrder'); ?>: id)?->format('Y-m-d'); ?>
getHtml('Created'); ?>: createdAt->format('Y-m-d H:i'); ?>
getHtml('DSO'); ?>: TBD
getHtml('Due'); ?>: TBD
getHtml('Balance'); ?>: TBD
getHtml('Notes'); ?>
notes as $note) : ++$count; $url = UriFactory::build('{/base}/editor/view?{?}&id=' . $note->id); ?>
getHtml('Title'); ?> getHtml('CreatedAt'); ?>
title; ?> createdAt->format('Y-m-d'); ?>
getHtml('Empty', '0', '0'); ?>
getHtml('Documents'); ?>
files as $file) : ++$count; $url = UriFactory::build('{/base}/media/view?{?}&id=' . $file->id); ?>
getHtml('Title'); ?> getHtml('CreatedAt'); ?>
name; ?> extension; ?> createdAt->format('Y-m-d'); ?>
getHtml('Empty', '0', '0'); ?>
data['hasBilling'] ?? false) : ?>
getHtml('RecentInvoices'); ?>
with('type') ->with('type/l11n') ->with('supplier') ->where('supplier', $supplier->id) ->where('type/l11n/language', $this->response->header->l11n->language) ->sort('id', OrderType::DESC) ->limit(5) ->executeGetArray(); $count = 0; /** @var \Modules\Billing\Models\Bill $invoice */ foreach ($newestInvoices as $invoice) : ++$count; $url = UriFactory::build('{/base}/purchase/bill/view?{?}&id=' . $invoice->id); $supplierUrl = UriFactory::build('{/base}/purchase/supplier/view?{?}&id=' . $invoice->supplier->id); ?>
getHtml('Number'); ?> getHtml('Type'); ?> getHtml('Name'); ?> getHtml('Net'); ?> getHtml('Date'); ?>
getNumber(); ?> type->getL11n(); ?> billTo; ?> getCurrency($invoice->netSales, symbol: ''); ?> performanceDate->format('Y-m-d'); ?>
getHtml('Empty', '0', '0'); ?>
data['hasBilling'] ?? false) : $monthlySalesCosts = PurchaseBillMapper::getSupplierMonthlySalesCosts($supplier->id, (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now')); // @bug I don't think this is correct. // The margin requires to calculate the sales for all items owned by the supplier // Even that is not 100% correct and more complicated due to possible supplier switches if (!empty($monthlySalesCosts)) : ?>
id, 'segment', 'en', (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now')); ?>
getHtml('Segments'); ?>
], "datasets": [ { "label": "getHtml('Purchase'); ?>", "type": "bar", "data": [ ], "yAxisID": "axis1", "backgroundColor": "rgb(54, 162, 235)" } ] }, "options": { "responsive": true, "scales": { "axis1": { "id": "axis1", "display": true, "position": "left", "ticks": { "precision": 0 } } }, "plugins": { "legend": { "display": false } } } }'>
getHtml('Purchase'); ?>
], "datasets": [ { "label": "getHtml('Margin'); ?>", "type": "line", "data": [ ], "yAxisID": "axis2", "fill": false, "borderColor": "rgb(255, 99, 132)", "backgroundColor": "rgb(255, 99, 132)" }, { "label": "getHtml('Purchase'); ?>", "type": "bar", "data": [ ], "yAxisID": "axis1", "backgroundColor": "rgb(54, 162, 235)" } ] }, "options": { "responsive": true, "scales": { "axis1": { "id": "axis1", "display": true, "position": "left", "ticks": { "precision": 0 } }, "axis2": { "id": "axis2", "display": true, "position": "right", "title": { "display": true, "text": "getHtml('Margin'); ?> %" }, "grid": { "display": false }, "beginAtZero": true, "ticks": { "min": 0, "max": 100, "stepSize": 10 } } } } }'>
request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
data['contact-component']->render('supplier-contact', 'contacts', $supplier->account->contacts); ?> data['address-component']->render('supplier-address', 'addresses', $supplier->account->addresses); ?>
request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>>
getHtml('Payment'); ?>
getHtml('PaymentTerm'); ?>
request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>>
getHtml('Pricing'); ?>
getHtml('Prices'); ?>download
data['prices']; foreach ($prices as $key => $value) : ++$c; ?>
getHtml('ID', '0', '0'); ?>expand_lessexpand_more getHtml('Name'); ?>expand_lessexpand_more getHtml('Price'); ?> getHtml('Quantity'); ?> getHtml('Discount'); ?> getHtml('DiscountP'); ?> getHtml('Bonus'); ?> getHtml('Item'); ?> getHtml('Start'); ?> getHtml('End'); ?>
settings name !== 'default') : ?> id; ?> printHtml($value->name); ?> price->getAmount(); ?> printHtml($value->currency); ?> quantity->getAmount(); ?> discount->getAmount(); ?> getPercentage($value->discountPercentage); ?> bonus->getAmount(); ?> printHtml((string) $value->item->id); ?> start?->format('Y-m-d'); ?> end?->format('Y-m-d'); ?>
getHtml('Empty', '0', '0'); ?>
request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
data['attributeView']->render( $supplier->attributes, $this->data['attributeTypes'] ?? [], $this->data['units'] ?? [], '{/api}supplier/attribute?csrf={$CSRF}', $supplier->id ); ?>
request->uri->fragment === 'c-tab-8' ? ' checked' : ''; ?>>
data['media-upload']->render('supplier-file', 'files', '', $supplier->files); ?>
request->uri->fragment === 'c-tab-9' ? ' checked' : ''; ?>>
getHtml('RecentInvoices'); ?>
with('type') ->with('type/l11n') ->where('supplier', $supplier->id) ->where('type/l11n/language', $this->response->header->l11n->language) ->where('billDate', SmartDateTime::startOfYear($this->data['business_start']), '>=') ->executeGetArray(); $count = 0; /** @var \Modules\Billing\Models\Bill $invoice */ foreach ($allInvoices as $invoice) : ++$count; $url = UriFactory::build('{/base}/sales/bill/view?{?}&id=' . $invoice->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'); ?>
request->uri->fragment === 'c-tab-6' ? ' checked' : ''; ?>>
getHtml('Accounting'); ?>
id, SmartDateTime::startOfYear($this->data['business_start']), new SmartDateTime('now')); ?>
getHtml('Items'); ?>download
$value) : ++$count; $url = UriFactory::build('{/base}/sales/bill/view?{?}&id=' . $value->bill->id); $itemUrl = UriFactory::build('{/base}/sales/item/view?{?}&id=' . $value->item->id); ?>
getHtml('Date'); ?> getHtml('Bill'); ?> getHtml('ID', '0', '0'); ?> getHtml('Name'); ?> getHtml('Quantity'); ?> getHtml('UnitPrice'); ?> getHtml('Discount'); ?> getHtml('DiscountP'); ?> getHtml('Bonus'); ?> getHtml('TotalPrice'); ?>
bill->performanceDate?->format('Y-m-d'); ?> printHtml($value->bill->getNumber()); ?> printHtml($value->itemNumber); ?> printHtml($value->itemName); ?> printHtml((string) $value->quantity->getAmount()); ?> getCurrency($value->singleSalesPriceNet, symbol: ''); ?> getCurrency($value->singleDiscountP, symbol: ''); ?> getPercentage($value->singleDiscountR); ?> getNumeric($value->discountQ?->value); ?> getCurrency($value->totalSalesPriceNet, symbol: ''); ?>
getHtml('Empty', '0', '0'); ?>
data['note']->render('supplier-note', 'notes', $supplier->notes); ?>
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'); ?>