fix order total price
This commit is contained in:
parent
b436552769
commit
88149b4ef5
@ -2383,6 +2383,7 @@ class Bdd {
|
||||
produit.reference as produit_reference,
|
||||
produit.description as produit_description,
|
||||
produit.vat as produit_vat,
|
||||
produit.id as fk_produit_id,
|
||||
devis.id_client as devis_client_id,
|
||||
thanato.id as fk_thanato_id,
|
||||
thanato.fk_thanato_type_key as fk_thanato_type_key
|
||||
@ -2402,9 +2403,12 @@ class Bdd {
|
||||
$needToApplyThanatoFee = $thanatoTypeKey == ThanatoTypeConstant::THANATO_TYPE_SUBCONTRACTOR;
|
||||
if($needToApplyThanatoFee && $thanatoId != null){
|
||||
foreach($produitList as &$produit){
|
||||
$productPrice = $this->getProductPriceByThanatoId($thanatoId,$produit['id']);
|
||||
$productPrice = $productPrice ?? $produit['produit_price'];
|
||||
$produit['produit_price'] = $productPrice * $produit["quantite"];
|
||||
$produitIsStillRattachedToDevis = $produit['fk_produit_id'] != null;
|
||||
if($produitIsStillRattachedToDevis){
|
||||
$productPrice = $this->getProductPriceByThanatoId($thanatoId,$produit['fk_produit_id']);
|
||||
$productPrice = $productPrice ?? $produit['produit_price'];
|
||||
$produit['produit_price'] = $productPrice * $produit["quantite"];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user