feat(postingkeys): allow VAT account postings to skip VAT amount validation

This commit is contained in:
2025-10-27 08:36:33 +00:00
parent 4f1066da2e
commit d21876c14f

View File

@@ -85,7 +85,9 @@ export function validatePostingKey(
}
// Validate VAT requirement
if (rule.requiresVAT && !vatAmount) {
// Skip VAT amount requirement if posting TO a VAT account (the line itself IS the VAT)
const isVATAccount = accountNumber === '1571' || accountNumber === '1771' || accountNumber === '1576';
if (rule.requiresVAT && !vatAmount && !isVATAccount) {
errors.push(
`Posting key ${postingKey} requires VAT amount, but none provided. ` +
`Description: ${rule.description}`