- <?php
-
- use common\helpers\Price;
- use domain\Config\Unit\UnitModule;
- use domain\Order\ProductOrder\ProductOrderModule;
- use domain\Producer\Producer\ProducerModule;
- use domain\Product\Product\Product;
- use yii\helpers\Html;
-
- $documentModule = $this->getDocumentModule();
- $productModule = $this->getProductModule();
- $productOrderModule = ProductOrderModule::getInstance();
- $producerModule = ProducerModule::getInstance();
- $unitModule = UnitModule::getInstance();
-
- ?>
-
- <tr class="<?php if(isset($displayOrders) && $displayOrders): ?>order<?php endif; ?>">
- <td class="align-left column-product">
- <?php if($productOrder->product): ?>
- <?= Html::encode($productOrder->product->name) ?>
- <?php endif; ?>
- <?php if($productOrder->unit == 'piece' && isset($productOrder->product->weight) && $productOrder->product->weight): ?>
- <span class="weight"> / <?= $productOrder->product->weight ?> g</span>
- <?php endif; ?>
- <?php if($productOrder->product && strlen($productOrder->product->description) && $displayProductDescription): ?>
- <br /><small><?= Html::encode($productOrder->product->description) ?></small>
- <?php endif; ?>
- </td>
-
- <?php
- $price = $productOrder->getPrice() ;
- if($documentModule->isInvoicePrice($document) && $productOrder->getInvoicePrice()) {
- $price = $productOrder->getInvoicePrice() ;
- }
- ?>
-
- <?php if($displayPrices): ?>
- <td class="align-center column-unit-price">
- <?php $displayPriceUnitReference = $producerModule->getSolver()->getConfig('option_document_display_price_unit_reference'); ?>
- <?php $priceUnitReference = $productOrderModule->getSolver()->getPriceUnitReference($productOrder, true); ?>
- <?php $priceUnitReferenceString = Price::format($priceUnitReference, $documentPriceDecimals).' / kg' ?>
- <?php if($productOrder->unit == 'piece'): ?>
- <?= Price::format($price, $documentPriceDecimals) ?>
- <?php if($displayPriceUnitReference && $priceUnitReference): ?>
- (<?= $priceUnitReferenceString ?>)
- <?php endif; ?>
- <?php else: ?>
- <?= $priceUnitReferenceString ?>
- <?php endif; ?>
- </td>
- <?php endif; ?>
- <td class="align-center column-quantity">
- <?= $productOrder->quantity * Product::$unitsArray[$productOrder->unit]['coefficient'] ?>
- <?= $unitModule->getSolver()->strUnit($productOrder->unit, 'wording') ?>
- </td>
- <?php if($displayPrices): ?>
- <?php if($producer->taxRate->value != 0): ?>
- <td class="align-center column-tax-rate"><?= $productOrder->taxRate->value * 100 ?> %</td>
- <?php endif; ?>
- <td class="align-center column-price">
- <?= Price::format($price * $productOrder->quantity) ?>
- </td>
- <?php endif; ?>
- </tr>
|