Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

68 rindas
3.4KB

  1. <?php
  2. use common\helpers\Price;
  3. use common\logic\Order\ProductOrder\Module\ProductOrderModule;
  4. use common\logic\Producer\Producer\Module\ProducerModule;
  5. use common\logic\Product\Product\Model\Product;
  6. use yii\helpers\Html;
  7. $documentModule = $this->getDocumentModule();
  8. $productModule = $this->getProductModule();
  9. $productOrderModule = ProductOrderModule::getInstance();
  10. $producerModule = ProducerModule::getInstance();
  11. ?>
  12. <tr class="<?php if(isset($displayOrders) && $displayOrders): ?>order<?php endif; ?>">
  13. <td class="align-left column-product">
  14. <?php if($productOrder->product): ?>
  15. <?= Html::encode($productOrder->product->name) ?>
  16. <?php endif; ?>
  17. <?php if($productOrder->unit == 'piece' && isset($productOrder->product->weight) && $productOrder->product->weight): ?>
  18. <span class="weight"> / <?= $productOrder->product->weight ?> g</span>
  19. <?php endif; ?>
  20. <?php if($productOrder->product && strlen($productOrder->product->description) && $displayProductDescription): ?>
  21. <br /><small><?= Html::encode($productOrder->product->description) ?></small>
  22. <?php endif; ?>
  23. </td>
  24. <?php
  25. $price = $productOrder->getPrice() ;
  26. if($documentModule->isInvoicePrice($document) && $productOrder->getInvoicePrice()) {
  27. $price = $productOrder->getInvoicePrice() ;
  28. }
  29. ?>
  30. <?php if($displayPrices): ?>
  31. <td class="align-center column-unit-price">
  32. <?php $displayPriceUnitReference = $producerModule->getSolver()->getConfig('option_document_display_price_unit_reference'); ?>
  33. <?php $priceUnitReference = $productOrderModule->getSolver()->getPriceUnitReference($productOrder); ?>
  34. <?php $priceUnitReferenceString = Price::format($priceUnitReference, $documentPriceDecimals).' / kg' ?>
  35. <?php if($productOrder->unit == 'piece'): ?>
  36. <?= Price::format($price, $documentPriceDecimals) ?>
  37. <?php if($displayPriceUnitReference && $priceUnitReference): ?>
  38. (<?= $priceUnitReferenceString ?>)
  39. <?php endif; ?>
  40. <?php else: ?>
  41. <?= $priceUnitReferenceString ?>
  42. <?php endif; ?>
  43. </td>
  44. <?php endif; ?>
  45. <td class="align-center column-quantity">
  46. <?= $productOrder->quantity * Product::$unitsArray[$productOrder->unit]['coefficient'] ?>
  47. <?= $productModule->getSolver()->strUnit($productOrder->product, 'wording') ?>
  48. </td>
  49. <?php if($displayPrices): ?>
  50. <?php if($producer->taxRate->value != 0): ?>
  51. <td class="align-center column-tax-rate"><?= $productOrder->taxRate->value * 100 ?> %</td>
  52. <?php endif; ?>
  53. <td class="align-center column-price">
  54. <?php if($documentModule->getClass($document) == ''): ?>
  55. <?= Price::format($price * $productOrder->quantity) ?>
  56. <?php else: ?>
  57. <?= Price::format($price * $productOrder->quantity) ?>
  58. <?php endif; ?>
  59. </td>
  60. <?php endif; ?>
  61. </tr>