FIX #35766: Update buying price INT Float (#35769)

* FIX #35766: Update buying price INT Float
loose Decimals

.

* Fix: keep fk_product_fournisseur_price as int; treat buying price as float (no truncation) [#35766]

* Updated per feedback: keep fk_product_fournisseur_price as ?int (rowid) and  as float.
Adjusted FactureRec::updateline PHPDoc to ?int  and float|''  (model still normalizes via price2num).
Tested on a recurring line: decimals preserved, FK stored as int, CI green. Minor adjustments before v22 backport

* Delete .hooktest

* Delete dev/tools/pre-commit/README.md

* Delete test/phpunit/phpunit.xml

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Guido Schratzer
2025-10-18 12:54:09 +03:00
committed by Laurent Destailleur
parent 17e78c99a2
commit ea2543e9e4
2 changed files with 2 additions and 2 deletions

View File

@@ -1042,7 +1042,7 @@ if (empty($reshook)) {
$date_start_fill,
$date_end_fill,
(int) $fournprice,
(int) $buyingprice,
(float) $buyingprice,
(int) $fk_parent_line
);

View File

@@ -1308,7 +1308,7 @@ class FactureRec extends CommonInvoice
$sql .= ", total_ttc='".price2num($total_ttc)."'";
$sql .= ", date_start_fill=".((int) $date_start_fill);
$sql .= ", date_end_fill=".((int) $date_end_fill);
$sql .= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? $fk_fournprice : 'null');
$sql .= ", fk_product_fournisseur_price=".($fk_fournprice > 0 ? (int) $fk_fournprice : 'null');
$sql .= ", buy_price_ht=".($pa_ht ? price2num($pa_ht) : 0);
$sql .= ", info_bits=".((int) $info_bits);
$sql .= ", rang=".((int) $rang);