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(); ?>
| = $this->getHtml('YTDSales'); ?>: | = $this->getCurrency(SalesBillMapper::getItemNetSales($item->id, SmartDateTime::startOfYear($this->data['business_start']), new \DateTime('now')), symbol: '', format: 'medium'); ?> |
| = $this->getHtml('MTDSales'); ?>: | = $this->getCurrency(SalesBillMapper::getItemNetSales($item->id, SmartDateTime::startOfMonth(), new \DateTime('now')), symbol: '', format: 'medium'); ?> |
| = $this->getHtml('ILV'); ?>: | = $this->getCurrency(SalesBillMapper::getILVHistoric($item->id), symbol: '', format: 'medium'); ?> |
| = $this->getHtml('LastOrder'); ?>: | = SalesBillMapper::getItemLastOrder($item->id)?->format('Y-m-d'); ?> |
| = $this->getHtml('PriceChange'); ?>: | |
| = $this->getHtml('Created'); ?>: | = $item->createdAt->format('Y-m-d H:i'); ?> |
| = $this->getHtml('SalesPrice'); ?>: | = $this->getCurrency($item->salesPrice, symbol: '', format: 'medium'); ?> |
| = $this->getHtml('PurchasePrice'); ?>: | = $this->getCurrency($item->purchasePrice, symbol: '', format: 'medium'); ?> |
| = $this->getHtml('Margin'); ?>: | = $this->getNumeric( $item->salesPrice->getInt() === 0 ? 0 : ($item->salesPrice->getInt() - $item->purchasePrice->getInt()) / $item->salesPrice->getInt() * 100 , 'short'); ?> % |
| = $this->getHtml('Number'); ?> | = $this->getHtml('Name'); ?> | = $this->getHtml('Country'); ?> | = $this->getHtml('Net'); ?> |
| = $this->printHtml($client->number); ?> | = $this->printHtml($client->account->name1); ?> = $this->printHtml($client->account->name2); ?> | = $this->printHtml($client->mainAddress->country); ?> | = (new Money((int) $topCustomers[1][$i]['net_sales']))->getCurrency(); ?> |