web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

India Tax - Tax Transaction Value is Empty, cannot correct Posted Purchase Invoice

(6) ShareShare
ReportReport
Posted on by 629
Hi, 
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
local procedure TestGSTTDSTCSPurchaseInvoiceIsPaid(var PurchInvHeader: Record "Purch. Inv. Header"; var IsHandled: Boolean)
    var
        PurchInvLine: Record "Purch. Inv. Line";
        TaxTransactionValue: Decimal;
        IsPaid: Boolean;
    begin
        if PurchInvHeader."GST Vendor Type" = PurchInvHeader."GST Vendor Type"::" " then
            exit;
        if PurchInvHeader."GST Vendor Type" in [PurchInvHeader."GST Vendor Type"::Import] then
            Error(CorrectCancellPurchInvErr);
        PurchInvLine.Reset();
        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;
        IsHandled := true;
        PurchInvHeader.CalcFields("Amount Including VAT");
        PurchInvHeader.CalcFields("Remaining Amount");
        onBeforeCheckPostedPurchaseAmountonCancellation(PurchInvHeader, PurchInvLine, TaxTransactionValue, IsPaid);
        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. 
I have the same question (0)
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,150 Super User 2025 Season 2 on at

    The issue you're facing is due to missing entries in the Tax Transaction Value table (ID 20261), which the system uses to determine if a purchase invoice can be canceled under India localization. This is particularly critical when dealing with GST and TDS logic in codeunit 18153.

     

    A record in Tax Transaction Value should be created during posting of the purchase invoice, based on:

     
    • Correct Tax Engine setup
    • Proper assignment of GST/TDS components in the Tax Group, Tax Component, and Tax Jurisdiction
    • Vendor marked correctly with GST Vendor Type
    • Valid TDS section codes and GST calculation structure
     

    In your case, the amount (INR 5) is going to TDS Payable, but the transaction isn't being tracked in the Tax Transaction Value table, which prevents reversal.

     

    Review these setups:

     
    • Go to Tax Setup, and verify Tax Type = GST and TDS are correctly configured.
    • Check if the Tax Component Code for TDS is active and mapped to correct G/L Account.
    • Verify that TDS Details are defined in the Vendor Card and linked correctly in the Purchase Invoice.
    • Use Preview Posting on a test invoice to validate if Tax Transaction Value is being populated.

     

    Correcting the Posted Invoice:

    • Since the invoice is already posted and the tax transaction entry is missing, it cannot be reversed or corrected using the standard cancellation logic.
    • You'll need to manually create a Purchase Credit Memo to reverse it.

    ​​​​​​​

    Recommended next step:

    This behavior likely results from an issue in the tax engine configuration or extension layer, which may require partner-level debugging or a patch.

     

    Contact your Microsoft Partner to help investigate why the Tax Transaction Value wasn’t generated during posting.

     

    ✅ Mark this answer as verified if it helps you.

  • Suggested answer
    Kamal Khakhkhar Profile Picture
    1,377 on at
    Hii ,
    There as per  as per base validation in that case you applied payment against that invoice so its not able to reverse direct , 


    so as per requirement advice you to create a boolean in user setup then apply validation in in below code, do some of changes as per your requirement.
    if you found answer mark it answered.
     
    Thank You,
    Kamal Khakhkhar.
     
    codeunit 18153 "GST Canc Corr Purch Inv Credit"
    Event>>
    onBeforeCheckPostedPurchaseAmountonCancellation
     
     
    [IntegrationEvent(false, false)]
        local procedure onBeforeCheckPostedPurchaseAmountonCancellation(var PurchInvHeader: Record "Purch. Inv. Header"; var PurchInvLine: Record "Purch. Inv. Line"; var TaxTransactionValue: Decimal; var IsPaid: Boolean)
        begin
        end;
     
     
     
  • Suggested answer
    Andrés Arias Profile Picture
    4,190 Super User 2025 Season 2 on at
    Hello,

    You could check the following link:

    https://learn.microsoft.com/en-us/dynamics365/business-central/finance-how-to-remove-and-reapply-item-entries
     
    I hope I can help.
     
    Regards,
     
    Andres

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,116

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Liquid error: parsing "/globalsearch/?q=installexpress+*vpnwindows+ext%3Aphp+inurl%3A%3Fcat%3D" - Nested quantifier *.