1717 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
1818 * Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
1919 * Copyright (C) 2025 Noé Cendrier <noe.cendrier@altairis.fr>
20+ * Copyright (C) 2026 Pierre Ardoin <developpeur@lesmetiersdubatiment.fr>
2021 *
2122 * This program is free software; you can redistribute it and/or modify
2223 * it under the terms of the GNU General Public License as published by
@@ -1695,6 +1696,7 @@ public function create($user, $notrigger = 0)
16951696 $ result = $ this ->addline (
16961697 $ line ->desc ,
16971698 $ line ->subprice ,
1699+ $ line ->subprice_ttc ,
16981700 $ line ->qty ,
16991701 $ line ->tva_tx ,
17001702 $ line ->localtax1_tx ,
@@ -1713,6 +1715,7 @@ public function create($user, $notrigger = 0)
17131715 $ line ->array_options ,
17141716 $ line ->fk_unit ,
17151717 $ line ->multicurrency_subprice , // pu_ht_devise
1718+ $ line ->multicurrency_subprice_ttc , // pu_ttc_devise
17161719 $ line ->origin , // origin
17171720 $ line ->origin_id , // origin_id
17181721 $ line ->rang , // rang
@@ -2181,19 +2184,22 @@ public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txloca
21812184 // la part ht, tva et ttc, et ce au niveau de la ligne qui a son propre taux tva.
21822185
21832186 $ tabprice = calcul_price_total ((float ) $ qty , $ pu , $ remise_percent , $ txtva , (float ) $ txlocaltax1 , (float ) $ txlocaltax2 , 0 , $ price_base_type , $ info_bits , $ product_type , $ this ->thirdparty , $ localtaxes_type , 100 , $ this ->multicurrency_tx , (float ) $ pu_ht_devise );
2184-
2187+
21852188 $ total_ht = $ tabprice [0 ];
21862189 $ total_tva = $ tabprice [1 ];
21872190 $ total_ttc = $ tabprice [2 ];
21882191 $ total_localtax1 = $ tabprice [9 ];
21892192 $ total_localtax2 = $ tabprice [10 ];
21902193 $ pu = $ pu_ht = $ tabprice [3 ];
2191-
2194+ $ pu_tva = $ tabprice [4 ];
2195+ $ pu_ttc = $ tabprice [5 ];
2196+
21922197 // MultiCurrency
21932198 $ multicurrency_total_ht = $ tabprice [16 ];
21942199 $ multicurrency_total_tva = $ tabprice [17 ];
21952200 $ multicurrency_total_ttc = $ tabprice [18 ];
21962201 $ pu_ht_devise = $ tabprice [19 ];
2202+ $ multicurrency_pu_ttc = $ tabprice [21 ];
21972203
21982204 $ localtax1_type = empty ($ localtaxes_type [0 ]) ? '' : $ localtaxes_type [0 ];
21992205 $ localtax2_type = empty ($ localtaxes_type [2 ]) ? '' : $ localtaxes_type [2 ];
@@ -2223,6 +2229,8 @@ public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txloca
22232229 $ this ->line ->product_type = $ product_type ;
22242230 $ this ->line ->remise_percent = $ remise_percent ;
22252231 $ this ->line ->subprice = (float ) $ pu_ht ;
2232+ $ this ->line ->subprice_ttc = (float ) $ pu_ttc ;
2233+
22262234 $ this ->line ->rang = $ rang ;
22272235 $ this ->line ->info_bits = $ info_bits ;
22282236
@@ -2246,6 +2254,7 @@ public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txloca
22462254 $ this ->line ->fk_multicurrency = $ this ->fk_multicurrency ;
22472255 $ this ->line ->multicurrency_code = $ this ->multicurrency_code ;
22482256 $ this ->line ->multicurrency_subprice = (float ) $ pu_ht_devise ;
2257+ $ this ->line ->multicurrency_subprice_ttc = (float ) $ multicurrency_pu_ttc ;
22492258 $ this ->line ->multicurrency_total_ht = (float ) $ multicurrency_total_ht ;
22502259 $ this ->line ->multicurrency_total_tva = (float ) $ multicurrency_total_tva ;
22512260 $ this ->line ->multicurrency_total_ttc = (float ) $ multicurrency_total_ttc ;
@@ -3178,6 +3187,7 @@ public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $t
31783187 $ multicurrency_total_tva = $ tabprice [17 ];
31793188 $ multicurrency_total_ttc = $ tabprice [18 ];
31803189 $ pu_ht_devise = $ tabprice [19 ];
3190+ $ multicurrency_total_ttc = $ tabprice [21 ];
31813191
31823192 $ localtax1_type = empty ($ localtaxes_type [0 ]) ? '' : $ localtaxes_type [0 ];
31833193 $ localtax2_type = empty ($ localtaxes_type [2 ]) ? '' : $ localtaxes_type [2 ];
@@ -3219,6 +3229,7 @@ public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $t
32193229 $ this ->line ->localtax2_type = empty ($ localtaxes_type [2 ]) ? '' : $ localtaxes_type [2 ];
32203230 $ this ->line ->remise_percent = $ remise_percent ;
32213231 $ this ->line ->subprice = (float ) $ pu_ht ;
3232+ $ this ->line ->subprice_ttc = (float ) $ pu_ttc ;
32223233 $ this ->line ->info_bits = $ info_bits ;
32233234 $ this ->line ->total_ht = (float ) $ total_ht ;
32243235 $ this ->line ->total_tva = (float ) $ total_tva ;
@@ -3238,11 +3249,13 @@ public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $t
32383249 $ this ->line ->fk_multicurrency = $ this ->fk_multicurrency ;
32393250 $ this ->line ->multicurrency_code = $ this ->multicurrency_code ;
32403251 $ this ->line ->multicurrency_subprice = (float ) $ pu_ht_devise ;
3252+ $ this ->line ->multicurrency_subprice_ttc = (float ) $ multicurrency_pu_ttc ;
32413253 $ this ->line ->multicurrency_total_ht = (float ) $ multicurrency_total_ht ;
32423254 $ this ->line ->multicurrency_total_tva = (float ) $ multicurrency_total_tva ;
32433255 $ this ->line ->multicurrency_total_ttc = (float ) $ multicurrency_total_ttc ;
32443256
32453257 $ this ->line ->subprice = (float ) $ pu_ht ;
3258+ $ this ->line ->subprice_ttc = (float ) $ pu_ttc ;
32463259 $ this ->line ->price = $ this ->line ->subprice ;
32473260
32483261 $ this ->line ->remise_percent = $ remise_percent ;
0 commit comments