Merge pull request #32525 from hregis/fix_20_broken_feature_pa_ht_is_float
FIX broken feature with check $pa_ht_isemptystring
This commit is contained in:
commit
a32ae3cd37
1 changed files with 2 additions and 4 deletions
|
|
@ -1535,7 +1535,7 @@ class Commande extends CommonOrder
|
|||
$pu_ht = price2num($pu_ht);
|
||||
$pu_ht_devise = price2num($pu_ht_devise);
|
||||
$pu_ttc = price2num($pu_ttc);
|
||||
$pa_ht = (float) price2num($pa_ht);
|
||||
$pa_ht = price2num($pa_ht); // do not convert to float here, it breaks the functioning of $pa_ht_isemptystring
|
||||
if (!preg_match('/\((.*)\)/', (string) $txtva)) {
|
||||
$txtva = price2num($txtva); // $txtva can have format '5,1' or '5.1' or '5.1(XXX)', we must clean only if '5,1'
|
||||
}
|
||||
|
|
@ -4466,6 +4466,7 @@ class OrderLine extends CommonOrderLine
|
|||
$error = 0;
|
||||
|
||||
$pa_ht_isemptystring = (empty($this->pa_ht) && $this->pa_ht == ''); // If true, we can use a default value. If this->pa_ht = '0', we must use '0'.
|
||||
$this->pa_ht = (float) $this->pa_ht; // convert to float after check if empty value
|
||||
|
||||
dol_syslog(get_class($this)."::insert rang=".$this->rang);
|
||||
|
||||
|
|
@ -4506,9 +4507,6 @@ class OrderLine extends CommonOrderLine
|
|||
if (empty($this->fk_parent_line)) {
|
||||
$this->fk_parent_line = 0;
|
||||
}
|
||||
if (empty($this->pa_ht)) {
|
||||
$this->pa_ht = 0;
|
||||
}
|
||||
if (empty($this->ref_ext)) {
|
||||
$this->ref_ext = '';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue