|
|
@@ -38,6 +38,7 @@ |
|
|
|
|
|
|
|
namespace backend\controllers; |
|
|
|
|
|
|
|
use common\helpers\Price; |
|
|
|
use common\models\DeliveryNote; |
|
|
|
use common\models\Invoice; |
|
|
|
use common\models\PointSale; |
|
|
@@ -252,6 +253,14 @@ class DocumentController extends BackendController |
|
|
|
$price = $productOrder->getInvoicePrice() ; |
|
|
|
} |
|
|
|
|
|
|
|
$typeTotal = $document->isInvoicePrice() ? Order::INVOICE_AMOUNT_TOTAL : Order::AMOUNT_TOTAL; |
|
|
|
$priceTotal = $productOrder->getPriceByTypeTotal($typeTotal) * $productOrder->quantity; |
|
|
|
$tva = Price::getVat( |
|
|
|
$priceTotal, |
|
|
|
$productOrder->taxRate->value, |
|
|
|
$document->tax_calculation_method |
|
|
|
); |
|
|
|
|
|
|
|
$datas[] = [ |
|
|
|
$document->reference, // N° facture externe * |
|
|
|
date('d/m/Y', strtotime($document->date)), // Date facture * |
|
|
@@ -286,8 +295,8 @@ class DocumentController extends BackendController |
|
|
|
$price, // PU HT * |
|
|
|
'', // Remise |
|
|
|
$productOrder->taxRate->value * 100, // TVA |
|
|
|
'', // Total TVA |
|
|
|
'', // Total HT |
|
|
|
$tva, // Total TVA |
|
|
|
$priceTotal, // Total HT |
|
|
|
'', // Créateur |
|
|
|
]; |
|
|
|
} |