Repository navigation
[Main]Incorrect Country/Region Code in VAT Entry after applying Alternative Customer VAT Registration on a Sales Invoice in the Belgian version. - #13315
Conversation
Co-authored-by: Shikhverma <241284522+Shikhverma@users.noreply.github.com>
|
…try' of https://github.com/microsoft/BCApps into bugs/Bug-656881--Main]IncorrectCountryRegionCodeInVATEntry
Good Sense Reviewer - Round 1Recommendation: AcceptWhat this PR doesChanges Belgian sales invoice posting to take the general journal line's Country/Region Code from the sales header's VAT Country/Region Code instead of reloading the bill-to customer's country. This removes the overwrite that caused an alternative VAT registration number to be paired with the original customer country. At the pinned head, CopyFromSalesHeader already copies the document VAT country and registration number; the changed assignment now preserves that pairing, InvoicePostingBuffer.CopyToGenJnlLine does not replace the country, and VAT Entry.CopyFromGenJnlLine copies both values into the VAT entry. The existing IsHandled event remains in the same position with the same signature and override behavior. Problem-solution fitFit: Strong The reported failure is the Belgian posting-specific replacement of the document VAT country with the customer country. The fix changes exactly that source, and the three added posting tests cover alternative registrations for domestic and foreign customers plus an ordinary invoice without an alternative registration. SuggestionsNone. Risk assessment and necessityRisk: The affected path creates financial ledger data, so incorrect country selection would affect VAT reporting. The implementation change is narrow: it changes only the default country assignment in Belgian Sales Post Invoice, leaves amounts and posting groups untouched, retains the existing event override, and changes no public signatures or schema. W1 sales, Belgian purchase, and W1 service posting already use the document VAT country. The tests assert the exact country and VAT registration number on every matching posted invoice VAT entry and require at least one entry. Necessity: The fix is needed because affected invoices otherwise retain the customer's original country in VAT entries despite using an alternative VAT registration number, producing an inconsistent country/registration pair and incorrect VAT-VIES reporting. Avoiding alternative registrations is not a suitable workaround when a transaction requires one; affected posting would need to be deferred or reporting corrected separately. The small Belgian-only change is proportionate to the defect.
|
Bug 656881: [Main] [all-e]Incorrect Country/Region Code in VAT Entry after applying Alternative Customer VAT Registration on a Sales Invoice in the Belgian version.
Fixes AB#656881