You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When retained warranty is 0 on the first situation invoice, the next is equal to the default value set into $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT.
The controls inside the code use "empty" function whilst it should use " != '' test.
File compta/facture/card.php starting at line 3868
Old code
if (empty($retained_warranty)) {
if (!empty($objectsrc->retained_warranty)) { // use previous situation value
$retained_warranty = $objectsrc->retained_warranty;
}
}
$retained_warranty_js_default = !empty($retained_warranty) ? $retained_warranty : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT;
New code
if ($retained_warranty == '') {
if ($objectsrc->retained_warranty != '') { // use previous situation value
$retained_warranty = $objectsrc->retained_warranty;
}
}
$retained_warranty_js_default = $retained_warranty != '' ? $retained_warranty : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT;
Dolibarr Version
18.0, 19.0
Environment PHP
No response
Environment Database
No response
Steps to reproduce the behavior and expected behavior
Use Situation invoice and retained warranty, with a default value to 5%, options
Create the first situation invoice with a retained warranty set to 0
Create the second situation invoice
Attached files
No response
The text was updated successfully, but these errors were encountered:
Bug
When retained warranty is 0 on the first situation invoice, the next is equal to the default value set into $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT.
The controls inside the code use "empty" function whilst it should use " != '' test.
File compta/facture/card.php starting at line 3868
Old code
if (empty($retained_warranty)) {
if (!empty($objectsrc->retained_warranty)) { // use previous situation value
$retained_warranty = $objectsrc->retained_warranty;
}
}
$retained_warranty_js_default = !empty($retained_warranty) ? $retained_warranty : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT;
New code
Dolibarr Version
18.0, 19.0
Environment PHP
No response
Environment Database
No response
Steps to reproduce the behavior and expected behavior
Use Situation invoice and retained warranty, with a default value to 5%, options
Create the first situation invoice with a retained warranty set to 0
Create the second situation invoice
Attached files
No response
The text was updated successfully, but these errors were encountered: