data['client'] ?? new NullClient(); $isNew = $client->id === 0; $clientImage = $this->data['clientImage'] ?? new NullMedia(); $clientStatus = ClientStatus::getConstants(); $logs = $this->data['logs'] ?? []; // @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 /** * @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($clientImage->name); ?>
notes) && ($warning = $client->getEditorDocByTypeName('client_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('CLV'); ?>: 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); $extensionType = FileUtils::getExtensionType($file->extension); ?> >
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('client') ->where('client', $client->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}/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'); ?>
getNumber(); ?> type->getL11n(); ?> billTo; ?> getCurrency($invoice->netSales, symbol: ''); ?> performanceDate->format('Y-m-d'); ?>
getHtml('Empty', '0', '0'); ?>
data['hasBilling'] ?? false) : $monthlySalesCosts = SalesBillMapper::getClientMonthlySalesCosts($client->id, (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now')); if (!empty($monthlySalesCosts)) : ?>
id, 'segment', 'en', (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now')); ?>
getHtml('Segments'); ?>
], "datasets": [ { "label": "getHtml('Sales'); ?>", "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('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", "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('client-contact', 'contacts', $client->account->contacts); ?> data['address-component']->render('client-address', 'addresses', $client->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('Promocode'); ?> getHtml('Price'); ?> getHtml('Quantity'); ?> getHtml('Discount'); ?> getHtml('DiscountP'); ?> getHtml('Bonus'); ?> getHtml('Item'); ?> 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); ?> price->getAmount(); ?> printHtml($value->currency); ?> quantity->getAmount(); ?> discount->getAmount(); ?> getPercentage($value->discountPercentage); ?> bonus->getAmount(); ?> printHtml((string) $value->item->id); ?> 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'); ?>
request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>>
data['attributeView']->render( $client->attributes, $this->data['attributeTypes'] ?? [], $this->data['units'] ?? [], '{/api}client/attribute?csrf={$CSRF}', $client->id ); ?>
request->uri->fragment === 'c-tab-8' ? ' checked' : ''; ?>>
data['media-upload']->render('client-file', 'files', '', $client->files, '{/api}client/file?csrf={$CSRF}', (string) $client->id); ?>
request->uri->fragment === 'c-tab-9' ? ' checked' : ''; ?>>
getHtml('RecentInvoices'); ?>
with('type') ->with('type/l11n') ->where('client', $client->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('client-note', 'notes', $client->notes, '{/api}client/note?csrf={$CSRF}', (string) $client->id); ?>
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'); ?>