fix(qris): selaras skema hangus, satu tagihan terbaru
All checks were successful
CI / test (push) Successful in 5m10s

- batalkan pelunasan multi-tagihan: tagihan lama otomatis void saat tagihan baru terbit
- QRIS manual memakai tagihan terbaru, bukan total tunggakan
- versi 0.5.6
This commit is contained in:
oxpoe
2026-11-05 13:19:14 +07:00
parent a78e6b766a
commit d68cc1d664
7 changed files with 22 additions and 30 deletions

View File

@@ -30,11 +30,10 @@ function isQrisAmountTaken(amount, opts = {}) {
return false;
}
function ensureInvoiceQris(inv, baseAmountOverride) {
function ensureInvoiceQris(inv) {
const settings = getSettings() || {};
const invId = Number((inv && inv.id) || 0);
// baseAmountOverride dipakai bila nominal QRIS = total beberapa tagihan
const base = Number(baseAmountOverride || (inv && inv.amount) || 0);
const base = Number((inv && inv.amount) || 0);
if (!invId || base <= 0) return { uniqueCode: 0, amount: base, payload: '' };
let code = Number(inv.qris_unique_code || 0);