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.reference as produit_reference,
|
||||||
produit.description as produit_description,
|
produit.description as produit_description,
|
||||||
produit.vat as produit_vat,
|
produit.vat as produit_vat,
|
||||||
|
produit.id as fk_produit_id,
|
||||||
devis.id_client as devis_client_id,
|
devis.id_client as devis_client_id,
|
||||||
thanato.id as fk_thanato_id,
|
thanato.id as fk_thanato_id,
|
||||||
thanato.fk_thanato_type_key as fk_thanato_type_key
|
thanato.fk_thanato_type_key as fk_thanato_type_key
|
||||||
@ -2402,12 +2403,15 @@ class Bdd {
|
|||||||
$needToApplyThanatoFee = $thanatoTypeKey == ThanatoTypeConstant::THANATO_TYPE_SUBCONTRACTOR;
|
$needToApplyThanatoFee = $thanatoTypeKey == ThanatoTypeConstant::THANATO_TYPE_SUBCONTRACTOR;
|
||||||
if($needToApplyThanatoFee && $thanatoId != null){
|
if($needToApplyThanatoFee && $thanatoId != null){
|
||||||
foreach($produitList as &$produit){
|
foreach($produitList as &$produit){
|
||||||
$productPrice = $this->getProductPriceByThanatoId($thanatoId,$produit['id']);
|
$produitIsStillRattachedToDevis = $produit['fk_produit_id'] != null;
|
||||||
|
if($produitIsStillRattachedToDevis){
|
||||||
|
$productPrice = $this->getProductPriceByThanatoId($thanatoId,$produit['fk_produit_id']);
|
||||||
$productPrice = $productPrice ?? $produit['produit_price'];
|
$productPrice = $productPrice ?? $produit['produit_price'];
|
||||||
$produit['produit_price'] = $productPrice * $produit["quantite"];
|
$produit['produit_price'] = $productPrice * $produit["quantite"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $produitList;
|
return $produitList;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user