diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index a39071fbc52..ef1e43b17df 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -46,7 +46,22 @@ * @param int $info_bits Miscellanous informations on line * @param int $type 0/1=Product/service * @param string $seller Thirdparty seller (we need $seller->country_code property). Provided only if seller is the supplier. - * @return result[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount, ...) + * @return result[ 0=total_ht, + * 1=total_vat, + * 2=total_ttc, + * 3=pu_ht, + * 4=pu_tva, + * 5=pu_ttc, + * 6=total_ht_without_discount, + * 7=total_vat_without_discount, + * 8=total_ttc_without_discount, + * 9=amount tax1 for total_ht, + * 10=amount tax2 for total_ht, + * 11=amount tax1 for pu_ht, + * 12=amount tax2 for pu_ht, + * 13=not used???, + * 14=amount tax1 for total_ht_without_discount, + * 15=amount tax1 for total_ht_without_discount] */ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocaltax1_rate, $uselocaltax2_rate, $remise_percent_global, $price_base_type, $info_bits, $type, $seller = '') { @@ -183,6 +198,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt { $tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU'); $tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU'); + $pu = price2num($pu / (1 + ($txtva / 100)),'MU'); } $apply_tax = false;