mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 09:08:09 +01:00
Fix: Prevent negative payment amount in EPC-QR Code (#36364)
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user