Fix: Prevent negative payment amount in EPC-QR Code (#36364)
This commit is contained in:
parent
0e1ac03fb0
commit
0e8d4461c4
1 changed files with 3 additions and 0 deletions
|
|
@ -1669,6 +1669,9 @@ abstract class CommonInvoice extends CommonObject
|
|||
$amount_to_pay = $this->total_ttc;
|
||||
}
|
||||
|
||||
// Prevent negative values (e.g. overpayments)
|
||||
$amount_to_pay = max(0, $amount_to_pay);
|
||||
|
||||
// Ensure numeric formatting for EPC QR code
|
||||
$amount_to_pay = price2num($amount_to_pay, 'MT');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue