fix(skr.classes.account): Remove incorrect SKR04 automatic account 3300; improve VAT posting validation and test isolation; update readme hints and CI settings

This commit is contained in:
2025-10-28 08:50:32 +00:00
parent d21876c14f
commit 119c12901a
7 changed files with 94 additions and 8 deletions

View File

@@ -85,9 +85,14 @@ export function validatePostingKey(
}
// Validate VAT requirement
// Skip VAT amount requirement if posting TO a VAT account (the line itself IS the VAT)
// Skip VAT amount requirement if:
// 1. Posting TO a VAT account (the line itself IS the VAT)
// 2. Posting TO a debtor/creditor account (receivable/payable settlement - VAT was already recorded)
const isVATAccount = accountNumber === '1571' || accountNumber === '1771' || accountNumber === '1576';
if (rule.requiresVAT && !vatAmount && !isVATAccount) {
const accountNum = parseInt(accountNumber);
const isDebtorCreditorAccount = (accountNum >= 10000 && accountNum <= 69999) || (accountNum >= 70000 && accountNum <= 99999);
if (rule.requiresVAT && !vatAmount && !isVATAccount && !isDebtorCreditorAccount) {
errors.push(
`Posting key ${postingKey} requires VAT amount, but none provided. ` +
`Description: ${rule.description}`