Skip to main content
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 591
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. 
  • Suggested answer
    Andrés Arias Profile Picture
    1,380 on at
    India Tax - Tax Transaction Value is Empty, cannot correct Posted Purchase Invoice
    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
  • Suggested answer
    Kamal Khakhkhar Profile Picture
    858 on at
    India Tax - Tax Transaction Value is Empty, cannot correct Posted Purchase Invoice
    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
    Sohail Ahmed Profile Picture
    4,829 on at
    India Tax - Tax Transaction Value is Empty, cannot correct Posted Purchase Invoice

    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.

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans