Fix: Prevent negative payment amount in EPC-QR Code (#36364)

This commit is contained in:
iLLixM 2025-11-21 18:34:24 +01:00 committed by GitHub
parent 0e1ac03fb0
commit 0e8d4461c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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');