This commit is contained in:
2026-05-06 14:39:13 -05:00
parent 55d9d803e0
commit 1ea750d001
2 changed files with 8 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ let plAccountingMethod = 'Accrual';
let bsAsOfDate = null;
let bsAccountingMethod = 'Accrual';
let registerLoadSeq = 0;
// ────────────────────────────────────────────────────────────────────
// Helpers
// ────────────────────────────────────────────────────────────────────
@@ -252,11 +253,16 @@ export async function loadRegister() {
const slot = 'accounting-register-table';
showLoading(slot, 'Loading register from QBO…');
const mySeq = ++registerLoadSeq; // ← merken, welcher Call das ist
try {
const result = await window.API.accounting.getRegister(
registerAccountId, registerStartDate, registerEndDate
);
// Wenn inzwischen ein neuerer Call gestartet wurde → Result verwerfen
if (mySeq !== registerLoadSeq) return;
if (result.error) {
showError(slot, result.error);
return;
@@ -264,6 +270,7 @@ export async function loadRegister() {
renderRegisterTable(result);
} catch (err) {
if (mySeq !== registerLoadSeq) return;
console.error('Register load failed:', err);
showError(slot, err.message || 'Failed to load register');
}