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:
@@ -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}`
|
||||
|
||||
Reference in New Issue
Block a user