Installation information
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. Note Before you install this hotfix, verify that all Microsoft Dynamics NAV client users are logged off the system. This includes Microsoft Dynamics NAV Application Server (NAS) services. You should be the only client user who is logged on when you implement this hotfix.To implement this hotfix, you must have a developer license.
We recommend that the user account in the Windows Logins window or in the Database Logins window be assigned the "SUPER" role ID. If the user account cannot be assigned the "SUPER" role ID, you must verify that the user account has the following permissions: - The Modify permission for the object that you will be changing.
- The Execute permission for the System Object ID 5210 object and for the System Object ID 9015
object.
Note You do not have to have rights to the data stores unless you have to perform data repair.
Code changes
Note Always test code fixes in a controlled environment before you apply the fixes to your production computers. Before applying the change, please import all SEPA updates.
To resolve this problem, change the code in the
VendUnrealizedVAT function in the CarteraManagement Codeunit (7000000) as follows:
Existing code 1
...
PurchVATAccount@1100016 : Code[20];
PurchVATUnrealAccount@1100017 : Code[20];
LastConnectionNo@1100018 : Integer;
Test1@1100019 : Boolean;
Test2@1100020 : Boolean;
BEGIN
VendLedgEntry2.CALCFIELDS(
Amount,
"Amount (LCY)",
"Remaining Amount",
...
Replacement code 1
...
PurchVATAccount@1100016 : Code[20];
PurchVATUnrealAccount@1100017 : Code[20];
LastConnectionNo@1100018 : Integer;
Test1@1100019 : Boolean;
Test2@1100020 : Boolean;
// Add the following lines.
ReverseChrgVATAcc@1000000000 : Code[20];
ReverseChrgVATUnrealAcc@1000000001 : Code[20];
// End of the added lines.
BEGIN
VendLedgEntry2.CALCFIELDS(
Amount,
"Amount (LCY)",
"Remaining Amount",
...
Existing code 2
...
VATEntry2."VAT Calculation Type"::"Reverse Charge VAT",
VATEntry2."VAT Calculation Type"::"Full VAT":
BEGIN
VATPostingSetup.TESTFIELD("Purchase VAT Account");
VATPostingSetup.TESTFIELD("Purch. VAT Unreal. Account");
PurchVATAccount := VATPostingSetup."Purchase VAT Account";
PurchVATUnrealAccount := VATPostingSetup."Purch. VAT Unreal. Account";
END;
END;
...
Replacement code 2
...
VATEntry2."VAT Calculation Type"::"Reverse Charge VAT",
VATEntry2."VAT Calculation Type"::"Full VAT":
BEGIN
VATPostingSetup.TESTFIELD("Purchase VAT Account");
VATPostingSetup.TESTFIELD("Purch. VAT Unreal. Account");
// Add the following lines.
IF VATEntry2."VAT Calculation Type" = VATEntry2."VAT Calculation Type"::"Reverse Charge VAT" THEN BEGIN
VATPostingSetup.TESTFIELD("Reverse Chrg. VAT Acc.");
VATPostingSetup.TESTFIELD("Reverse Chrg. VAT Unreal. Acc.");
ReverseChrgVATAcc := VATPostingSetup."Reverse Chrg. VAT Acc.";
ReverseChrgVATUnrealAcc := VATPostingSetup."Reverse Chrg. VAT Unreal. Acc.";
END;
// End of the added lines.
PurchVATAccount := VATPostingSetup."Purchase VAT Account";
PurchVATUnrealAccount := VATPostingSetup."Purch. VAT Unreal. Account";
END;
END;
...
Existing code 3
...
NoRealVATBuffer.Amount := TotalVATAmount;
NoRealVATBuffer."Entry No." := VATEntry2."Entry No.";
NoRealVATBuffer.INSERT;
END;
VATEntry := VATEntry2;
VATEntry."Entry No." := VATEntryNo;
VATEntry."Posting Date" := GenJnlLine."Posting Date";
VATEntry."Document No." := GenJnlLine."Document No.";
VATEntry."External Document No." := GenJnlLine."External Document No.";
...
Replacement code 3
...
NoRealVATBuffer.Amount := TotalVATAmount;
NoRealVATBuffer."Entry No." := VATEntry2."Entry No.";
NoRealVATBuffer.INSERT;
END;
// Add the following lines.
IF VATEntry2."VAT Calculation Type" = VATEntry2."VAT Calculation Type"::"Reverse Charge VAT" THEN BEGIN
IF NoRealVATBuffer.GET(ReverseChrgVATAcc,ReverseChrgVATUnrealAcc,VATEntry2."Entry No.") THEN
NoRealVATBuffer.Amount := NoRealVATBuffer.Amount + TotalVATAmount
ELSE BEGIN
NoRealVATBuffer.INIT;
NoRealVATBuffer.Account := ReverseChrgVATAcc;
NoRealVATBuffer."Balance Account" := ReverseChrgVATUnrealAcc;
NoRealVATBuffer.Amount := TotalVATAmount;
NoRealVATBuffer."Entry No." := VATEntry2."Entry No.";
NoRealVATBuffer.INSERT;
END;
END;
// End of the added lines.
VATEntry := VATEntry2;
VATEntry."Entry No." := VATEntryNo;
VATEntry."Posting Date" := GenJnlLine."Posting Date";
VATEntry."Document No." := GenJnlLine."Document No.";
VATEntry."External Document No." := GenJnlLine."External Document No.";
...
Prerequisites
You must have one of the following products installed to apply this hotfix:
- The Spanish version of Microsoft Dynamics NAV 2009 R2
- The Spanish version of Microsoft Dynamics NAV 2009 SP1
Removal information
You cannot remove this hotfix.