Selaa lähdekoodia

[Backend] Adaptation export Evoliz : inclure TVA #913

feature/souke
Guillaume Bourgeois 1 vuosi sitten
vanhempi
commit
13ff6efd81
1 muutettua tiedostoa jossa 11 lisäystä ja 2 poistoa
  1. +11
    -2
      backend/controllers/DocumentController.php

+ 11
- 2
backend/controllers/DocumentController.php Näytä tiedosto

@@ -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
];
}

Loading…
Peruuta
Tallenna