I'm trying to correct a Purchase Invoice on an BC26 India Localization.
I get the following error.
My Amount Inc VAT and Remaining amount is not the same.
Based off the code in codeunit 18153 "GST Canc Corr Purch Inv Credit" - TestGSTTDSTCSPurchaseInvoiceIsPaid
The there should be a transaction for Amount INR 5 in the TaxTransactionValue Table (ID: 20261), but Instead its part of TDS Payable
(I created another Puchase Invoice and Preview Posted)
Unfortunately the "Tax Transaction Value" does not have a record relating to the Posted Purchase Invoice, Which I expect to have a value of INR 5
I believe my setups for the tax Engine is not correct.
At which stage does a record get inserted in the "Tax Transaction Value" or what setups can I check in order to correct the Posted Sales Invoice?
codeunit 18153 "GST Canc Corr Purch Inv Credit" - TestGSTTDSTCSPurchaseInvoiceIsPaid
var
PurchInvLine: Record "Purch. Inv. Line";
TaxTransactionValue: Decimal;
IsPaid: Boolean;
begin
if PurchInvHeader."GST Vendor Type" = PurchInvHeader."GST Vendor Type"::" " then
exit;
Error(CorrectCancellPurchInvErr);
PurchInvLine.SetRange("Document No.", PurchInvHeader."No.");
PurchInvLine.SetFilter(Type, '<>%1', PurchInvLine.Type::" ");
if PurchInvLine.FindSet() then
repeat
TaxTransactionValue += FilterTaxTransactionValue(PurchInvLine.RecordId);
until PurchInvLine.Next() = 0;
PurchInvHeader.CalcFields("Amount Including VAT");
PurchInvHeader.CalcFields("Remaining Amount");
if not IsPaid then
if not PurchInvLine."GST Reverse Charge" then begin
if (PurchInvHeader."Amount Including VAT" + TaxTransactionValue) <> PurchInvHeader."Remaining Amount" then
Error(PostedInvoiceIsPaidCancelErr);
end else
if (PurchInvHeader."Amount Including VAT") <> PurchInvHeader."Remaining Amount" then
Error(PostedInvoiceIsPaidCancelErr);
end;
Thank you in Advance.