Browse Source

[Backend] Adaptation export Evoliz : inclure TVA #913

prodstable
Guillaume Bourgeois 1 year ago
parent
commit
13ff6efd81
1 changed files with 11 additions and 2 deletions
  1. +11
    -2
      backend/controllers/DocumentController.php

+ 11
- 2
backend/controllers/DocumentController.php View File



namespace backend\controllers; namespace backend\controllers;


use common\helpers\Price;
use common\models\DeliveryNote; use common\models\DeliveryNote;
use common\models\Invoice; use common\models\Invoice;
use common\models\PointSale; use common\models\PointSale;
$price = $productOrder->getInvoicePrice() ; $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[] = [ $datas[] = [
$document->reference, // N° facture externe * $document->reference, // N° facture externe *
date('d/m/Y', strtotime($document->date)), // Date facture * date('d/m/Y', strtotime($document->date)), // Date facture *
$price, // PU HT * $price, // PU HT *
'', // Remise '', // Remise
$productOrder->taxRate->value * 100, // TVA $productOrder->taxRate->value * 100, // TVA
'', // Total TVA
'', // Total HT
$tva, // Total TVA
$priceTotal, // Total HT
'', // Créateur '', // Créateur
]; ];
} }

Loading…
Cancel
Save