1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace Core\App\Factory;
- class ProformaItemFactory extends OrderItemFactory
- {
- public function createProformaProduct(
- $product_ids,
- $product_name,
- $ean,
- $sku,
- $currency_code,
- $price,
- $taxRate,
- $quantity,
- $taxIncluded = false
- )
- {
- $proformaProduct = new \Core\App\Entity\OrderItem();
- $taxRate = $this->getTaxRate($taxRate) ;
- $pretFtva = $this->getPretftva($price, $taxRate, 0, $taxIncluded);
- $pretCtva = $this->getPretctva($price, $taxRate, 0, $taxIncluded);
- $proformaProduct->setFacturiProdNume($this->stripSpecialChars($product_name));
- $proformaProduct->setFacturiProdMoneda($currency_code);
- $proformaProduct->setFacturiProdPretftva($pretFtva);
- $proformaProduct->setFacturiProdPretctva($pretCtva);
- $proformaProduct->setFacturiProdTva($this->getTaxName($taxRate));
- $proformaProduct->setFacturiProdCant($quantity);
- $proformaProduct->setFacturiProdVal($pretFtva * $quantity);
- $proformaProduct->setFacturiProdValTva(($pretCtva - $pretFtva) * $quantity);
- $proformaProduct->setFacturiProdValTot($pretCtva * $quantity);
- $proformaProduct->setFacturiProdUm(self::UM);
- $proformaProduct->setProdCod($ean);
- $proformaProduct->setProdSku($sku);
- $proformaProduct->setProdCod1($this->getPrefix().$product_ids);
- $proformaProduct->setProdCodCautare('all');
-
- return $proformaProduct;
-
- }
- }
|