Avoid php errors if negative var in Receipt Module
Solved in develop branch with PR https://github.com/Dolibarr/dolibarr/pull/15994/files After testing we introduce it in version 13
This commit is contained in:
parent
b8bd5cd0ee
commit
15cc0f8775
@ -634,7 +634,7 @@ class dolReceiptPrinter extends Printer
|
||||
if ($line->fk_product)
|
||||
{
|
||||
$spacestoadd = $nbcharactbyline - strlen($line->ref) - strlen($line->qty) - 10 - 1;
|
||||
$spaces = str_repeat(' ', $spacestoadd);
|
||||
$spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0);
|
||||
$this->printer->text($line->ref.$spaces.$line->qty.' '.str_pad(price($line->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
|
||||
$this->printer->text(strip_tags(htmlspecialchars_decode($line->product_label))."\n");
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user