feat(postingkeys): allow VAT account postings to skip VAT amount validation
This commit is contained in:
@@ -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}`
|
||||
|
||||
Reference in New Issue
Block a user