This article applies to Microsoft Dynamics NAV for the Spanish (es) language locale.

Symptoms

Assume that you have two customers who use the same value-added tax (VAT) registration number in the Spanish version of Microsoft Dynamics NAV. The first customer has more amounts in the entries than the second customer has. In this situation, when you export a Model 347 file, the Amounts value is displayed for the first customer correctly. However, the Social Reason value is displayed for the second customer instead of for the first customer.

Note This problem also occurs if you have two vendors that use the same VAT registration number.
 
This problem occurs in the following products:

  • The Spanish version of Microsoft Dynamics NAV 2009 R2

  • The Spanish version of Microsoft Dynamics NAV 2009 Service Pack 1

  • The Spanish version of Microsoft Dynamics NAV 5.0 Service Pack 1

Resolution

Hotfix information

A supported hotfix is now available from Microsoft. However, it is only intended to correct the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft Dynamics NAV 2009 service pack or the next Microsoft Dynamics NAV version that contains this hotfix.

Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Technical Support Professional for Microsoft Dynamics and related products determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.



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.
To resolve this problem, change the code in the Make 347 Declaration report (10707). To do this, follow these steps:

  1. Change the code in Data Item Number 2 as follows:
    Existing code

    NotIn347Amt := 0;

    Replacement code

    NotIn347Amt := 0;

    // Add the following line.
    CustomerMaxAmount := 0;


  2. Change the code in Data Item Number 3 as follows:
    Existing code 1

    // Delete the following lines.
    VATEntry.RESET;
    VATEntry.SETCURRENTKEY(Type,"Posting Date","Document Type","Document No.","Bill-to/Pay-to No.");
    VATEntry.SETRANGE(Type,VATEntry.Type::Sale);
    VATEntry.SETRANGE("Document No.","Document No.");
    VATEntry.SETRANGE("Document Date","Document Date");
    VATEntry.SETRANGE("Document Type","Document Type");
    VATEntry.SETRANGE("Country/Region Code",CountryCode);
    // End of the deleted lines.

    Replacement code 1

    // Add the following line.
    FilterVATEntry(VATEntry,"Document Date","Document Type","Document No.",TRUE);

    Existing code 2

    "Document Type"::Invoice:

    // Delete the following lines.
    BEGIN
    SalesInvHeader.RESET;
    IF SalesInvHeader.GET("Document No.") THEN BEGIN
    IF SalesInvHeader."Ship-to Code" <> '' THEN BEGIN
    ShipToAddress.GET("Customer No.",SalesInvHeader."Ship-to Code");
    IF ShipToAddress."Country/Region Code" <> CountryCode THEN
    CurrReport.SKIP;
    END;
    SalesinvLine.RESET;
    SalesinvLine.SETRANGE("Document No.","Document No.");
    IF SalesinvLine.FINDSET THEN
    REPEAT
    IF SalesinvLine."VAT Calculation Type" = SalesinvLine."VAT Calculation Type"::"No Taxable VAT" THEN
    NoTaxVATFound := TRUE;
    UNTIL SalesinvLine.NEXT = 0;
    END ELSE BEGIN
    IF Customer."Country/Region Code" = CountryCode THEN
    FromJournal := TRUE;
    END;
    END;
    "Document Type"::"Credit Memo":
    BEGIN
    SalesCrMemoHeader.RESET;
    IF SalesCrMemoHeader.GET("Document No.") THEN BEGIN
    IF SalesCrMemoHeader."Ship-to Code" <> '' THEN BEGIN
    ShipToAddress.GET("Customer No.",SalesCrMemoHeader."Ship-to Code");
    IF ShipToAddress."Country/Region Code" <> CountryCode THEN
    CurrReport.SKIP;
    END;
    SalesCrMemoLine.RESET;
    SalesCrMemoLine.SETRANGE("Document No.","Document No.");
    IF SalesCrMemoLine.FINDSET THEN
    REPEAT
    IF SalesCrMemoLine."VAT Calculation Type" = SalesCrMemoLine."VAT Calculation Type"::"No Taxable VAT" THEN
    NoTaxVATFound := TRUE;
    UNTIL SalesCrMemoLine.NEXT = 0;
    END ELSE BEGIN
    IF Customer."Country/Region Code" = CountryCode THEN
    FromJournal := TRUE;
    END;
    END;
    // End of the deleted lines.

    END;

    Replacement code 2

    "Document Type"::Invoice:

    // Add the following lines.
    CheckCustDocTypeInvoice(SalesInvHeader,"Cust. Ledger Entry",Customer);
    "Document Type"::"Credit Memo":
    CheckCustDocTypeCrMemo(SalesCrMemoHeader,"Cust. Ledger Entry",Customer);
    // End of the added lines.

    END;

    Existing code 3

    SalesAmt := SalesAmt + "Amount (LCY)";
    UpdateQuarterAmount(AmountType::Sales,"Amount (LCY)","Document Date");

    Replacement code 3

    SalesAmt := SalesAmt + "Amount (LCY)";

    // Add the following line.
    CustomerMaxAmount := SalesAmt;

    UpdateQuarterAmount(AmountType::Sales,"Amount (LCY)","Document Date");

    Existing code 4

    SalesAmt := SalesAmt + NotIn347Amt + AmtSameVATRegNo;

    // Delete the following line.
    IF SalesAmt >= MinAmount THEN BEGIN

    IF PostCode347 = ' ' THEN

    Replacement code 4

    SalesAmt := SalesAmt + NotIn347Amt + AmtSameVATRegNo;

    // Add the following line.
    IF ABS(SalesAmt) >= MinAmount THEN BEGIN

    IF PostCode347 = ' ' THEN
  3. Change the code in Data Item Number 5 as follows:
    Existing code

    NotIn347Amt := 0;

    Replacement code

    NotIn347Amt := 0;

    // Add the following line.
    VendorMaxAmount := 0;
  4. Change the code in Data Item Number 6 as follows:
    Existing code 1

    // Delete the following lines.
    VATEntry.RESET;
    VATEntry.SETCURRENTKEY(Type,"Posting Date","Document Type","Document No.","Bill-to/Pay-to No.");
    VATEntry.SETRANGE(Type,VATEntry.Type::Purchase);
    VATEntry.SETRANGE("Document No.","Document No.");
    VATEntry.SETRANGE("Document Date","Document Date");
    VATEntry.SETRANGE("Document Type","Document Type");
    VATEntry.SETRANGE("Country/Region Code",CountryCode);
    // End of the deleted lines.

    Replacement code 1

    // Add the following line.
    FilterVATEntry(VATEntry,"Document Date","Document Type","Document No.",FALSE);

    Existing code 2

    "Document Type"::Invoice:

    // Delete the following lines.
    BEGIN
    PurchInvHeader.RESET;
    IF PurchInvHeader.GET("Document No.") THEN BEGIN
    IF PurchInvHeader."Order Address Code" <> '' THEN BEGIN
    OrderAddress.GET("Vendor No.",PurchInvHeader."Order Address Code");
    IF OrderAddress."Country/Region Code" <> CountryCode THEN
    CurrReport.SKIP;
    END;
    PurchInvLine.RESET;
    PurchInvLine.SETRANGE("Document No.","Document No.");
    IF PurchInvLine.FINDSET THEN
    REPEAT
    IF PurchInvLine."VAT Calculation Type" = PurchInvLine."VAT Calculation Type"::"No Taxable VAT" THEN
    NoTaxVATFound := TRUE;
    UNTIL PurchInvLine.NEXT = 0;
    END ELSE BEGIN
    IF Vendor."Country/Region Code" = CountryCode THEN
    FromJournal := TRUE;
    END;
    END;
    "Document Type"::"Credit Memo":
    BEGIN
    PurchCrMemoHeader.RESET;
    IF PurchCrMemoHeader.GET("Document No.") THEN BEGIN
    IF PurchCrMemoHeader."Order Address Code" <> '' THEN BEGIN
    OrderAddress.GET("Vendor No.",PurchCrMemoHeader."Order Address Code");
    IF OrderAddress."Country/Region Code" <> CountryCode THEN
    CurrReport.SKIP;
    END;
    PurchCrMemoLine.RESET;
    PurchCrMemoLine.SETRANGE("Document No.","Document No.");
    IF PurchCrMemoLine.FINDSET THEN
    REPEAT
    IF PurchCrMemoLine."VAT Calculation Type" = PurchCrMemoLine."VAT Calculation Type"::"No Taxable VAT" THEN
    NoTaxVATFound := TRUE;
    UNTIL PurchCrMemoLine.NEXT = 0;
    END ELSE BEGIN
    IF Vendor."Country/Region Code" = CountryCode THEN
    FromJournal := TRUE;
    END;
    END;
    // End of the deleted lines.

    END;

    Replacement code 2

    "Document Type"::Invoice:

    // Add the following lines.
    CheckVendDocTypeInvoice(PurchInvHeader,"Vendor Ledger Entry",Vendor);
    "Document Type"::"Credit Memo":
    CheckVendDocTypeCrMemo(PurchCrMemoHeader,"Vendor Ledger Entry",Vendor);
    // End of the added lines.

    END;

    Existing code 3

    PurchasesAmt := PurchasesAmt - "Amount (LCY)";
    UpdateQuarterAmount(AmountType::Purchase,-"Amount (LCY)","Document Date");

    Replacement code 3

    PurchasesAmt := PurchasesAmt - "Amount (LCY)";

    // Add the following line.
    VendorMaxAmount := PurchasesAmt;

    UpdateQuarterAmount(AmountType::Purchase,-"Amount (LCY)","Document Date");

    Existing code 4

    TotalNotIn347Amt := TotalNotIn347Amt + NotIn347Amt + AmtSameVATRegNo;

    // Delete the following lines.
    PurchasesAmt := PurchasesAmt - NotIn347Amt + AmtSameVATRegNo;
    IF PurchasesAmt >= MinAmount THEN BEGIN
    // End of the deleted lines.

    IF PostCode347 = ' ' THEN

    Replacement code 4

    TotalNotIn347Amt := TotalNotIn347Amt + NotIn347Amt + AmtSameVATRegNo;

    // Add the following lines.
    PurchasesAmt := PurchasesAmt - NotIn347Amt + AmtSameVATRegNo;
    IF ABS(PurchasesAmt) >= MinAmount THEN BEGIN
    // End of the added lines.

    IF PostCode347 = ' ' THEN
  5. Change the code in Global Variables as follows:
    Existing code

    Text1100032@1100040 : TextConst 'ENU=The process has been aborted. No file will be generated.;ESP=El proceso se ha cancelado. No se crear ning£n archivo.';

    Replacement code

    Text1100032@1100040 : TextConst 'ENU=The process has been aborted. No file will be generated.;ESP=El proceso se ha cancelado. No se crear ning£n archivo.';

    // Add the following lines.
    VendorMaxAmount@1100097 : Decimal;
    CustomerMaxAmount@1100098 : Decimal;
    // End of the added lines.
  6. Change the code in the CheckSameVATRegNo function as follows:
    Existing code

    VAR

    // Delete the following lines.
    VATEntry3@1100000 : Record 254;
    GLEntry@1100002 : Record 17;
    GLAccount@1100003 : Record 15;
    TempVATEntry@1100004 : TEMPORARY Record 254;
    BEGIN
    VATEntry3.SETCURRENTKEY(Type,"Country/Region Code","VAT Registration No.");
    VATEntry3.SETRANGE("Country/Region Code",CountryCode);
    IF IsCustomer THEN BEGIN
    VATEntry3.SETRANGE(Type,VATEntry3.Type::Sale);
    VATEntry3.SETRANGE("VAT Registration No.",Customer."VAT Registration No.");
    VATEntry3.SETFILTER("Bill-to/Pay-to No.",'<>%1',Customer."No.");
    END ELSE BEGIN
    VATEntry3.SETRANGE(Type,VATEntry3.Type::Purchase);
    VATEntry3.SETRANGE("VAT Registration No.",Vendor."VAT Registration No.");
    VATEntry3.SETFILTER("Bill-to/Pay-to No.",'<>%1',Vendor."No.");
    END;
    VATEntry3.SETRANGE("Document Date",FromDate,ToDate);
    IF VATEntry3.FINDFIRST THEN
    REPEAT
    IF IsCustomer THEN
    Amt := Amt - VATEntry3.Base - VATEntry3.Amount
    ELSE
    Amt := Amt + VATEntry3.Base + VATEntry3.Amount;
    UpdateQuarterAmount(AmountType::Sales,ABS(VATEntry3.Base) + ABS(VATEntry3.Amount),VATEntry3."Document Date");
    TempVATEntry.SETRANGE("Transaction No.",VATEntry3."Transaction No.");
    IF NOT TempVATEntry.FINDFIRST THEN BEGIN
    GLEntry.SETRANGE("Transaction No.",VATEntry3."Transaction No.");
    IF GLEntry.FINDSET THEN
    REPEAT
    UpdateNotIn347Amount(GLEntry);
    UNTIL GLEntry.NEXT = 0;
    TempVATEntry := VATEntry3;
    TempVATEntry.INSERT;
    END;
    UNTIL VATEntry3.NEXT = 0;
    // End of the deleted lines.

    EXIT(Amt);

    Replacement code

    VAR

    // Add the following lines.
    VATEntry3@1100002 : Record 254;
    GLEntry@1100003 : Record 17;
    Customer2@110000022 : Record 18;
    CustLedgEntry@1100007 : Record 21;
    SalesInvHeader@1100008 : Record 112;
    SalesCrMemoHeader@1100011 : Record 114;
    Vendor2@1100013 : Record 23;
    VendorLedgerEntry@1100014 : Record 25;
    PurchInvHeader@1100015 : Record 122;
    OrderAdress@1100017 : Record 224;
    PurchCrMemoHeader@1100018 : Record 124;
    VendorAmount@1100020 : Decimal;
    CustomerAmount@1100021 : Decimal;
    BEGIN
    IF IsCustomer THEN BEGIN
    Customer2.SETCURRENTKEY("VAT Registration No.");
    Customer2.SETFILTER("No.",'<>%1',Customer."No.");
    Customer2.SETRANGE("VAT Registration No.",Customer."VAT Registration No.");
    IF Customer2.FINDFIRST THEN
    REPEAT
    CustomerAmount := 0;
    CustLedgEntry.SETCURRENTKEY("Customer No.","Document Type");
    CustLedgEntry.SETRANGE("Customer No.", Customer2."No.");
    CustLedgEntry.SETRANGE("Document Date",FromDate,ToDate);
    CustLedgEntry.SETRANGE("Document Type",CustLedgEntry."Document Type"::Invoice,CustLedgEntry."Document Type"::"Credit Memo");
    IF CustLedgEntry.FINDFIRST THEN
    REPEAT
    FilterVATEntry(VATEntry3,CustLedgEntry."Document Date",CustLedgEntry."Document Type",
    CustLedgEntry."Document No.",IsCustomer);
    IF NOT VATEntry3.FINDFIRST THEN BEGIN
    CASE CustLedgEntry."Document Type" OF
    CustLedgEntry."Document Type"::Invoice:
    CheckCustDocTypeInvoice(SalesInvHeader,CustLedgEntry,Customer2);
    CustLedgEntry."Document Type"::"Credit Memo" :
    CheckCustDocTypeCrMemo(SalesCrMemoHeader,CustLedgEntry,Customer2);
    END;
    END ELSE
    CheckVatEntryNotIn347(VATEntry3,GLEntry);
    IF (VATEntry3."VAT Registration No." <> '') OR NoTaxVATFound OR FromJournal THEN BEGIN
    CustLedgEntry.CALCFIELDS(CustLedgEntry."Amount (LCY)");
    Amt := Amt + CustLedgEntry."Amount (LCY)";
    CustomerAmount := CustomerAmount + CustLedgEntry."Amount (LCY)";
    UpdateQuarterAmount(AmountType::SameVATNo,CustLedgEntry."Amount (LCY)",CustLedgEntry."Posting Date");
    END;
    UNTIL CustLedgEntry.NEXT = 0;
    IF CustomerMaxAmount < CustomerAmount THEN BEGIN
    CustomerMaxAmount := CustomerAmount;
    Name347 := Customer2.Name;
    END;
    UNTIL Customer2.NEXT = 0;
    Name347 := PADSTR(FormatTextName(Name347),40,' ');
    END ELSE BEGIN
    Vendor2.SETCURRENTKEY("VAT Registration No.");
    Vendor2.SETFILTER("No.",'<>%1',Vendor."No.");
    Vendor2.SETRANGE("VAT Registration No.",Vendor."VAT Registration No.");
    IF Vendor2.FINDFIRST THEN
    REPEAT
    VendorAmount := 0;
    VendorLedgerEntry.SETCURRENTKEY("Vendor No.","Document Type");
    VendorLedgerEntry.SETRANGE("Vendor No.", Vendor2."No.");
    VendorLedgerEntry.SETRANGE("Document Date",FromDate,ToDate);
    VendorLedgerEntry.SETRANGE("Document Type",VendorLedgerEntry."Document Type"::Invoice,
    VendorLedgerEntry."Document Type"::"Credit Memo");
    IF VendorLedgerEntry.FINDFIRST THEN
    REPEAT
    FilterVATEntry(VATEntry3,VendorLedgerEntry."Document Date",VendorLedgerEntry."Document Type",
    VendorLedgerEntry."Document No.",IsCustomer);
    IF NOT VATEntry3.FINDFIRST THEN BEGIN
    CASE VendorLedgerEntry."Document Type" OF
    VendorLedgerEntry."Document Type"::Invoice:
    CheckVendDocTypeInvoice(PurchInvHeader,VendorLedgerEntry,Vendor2);
    VendorLedgerEntry."Document Type"::"Credit Memo":
    CheckVendDocTypeCrMemo(PurchCrMemoHeader,VendorLedgerEntry,Vendor2);
    END;
    END ELSE
    CheckVatEntryNotIn347(VATEntry3,GLEntry);
    IF (VATEntry3."VAT Registration No." <> '') OR NoTaxVATFound OR FromJournal THEN BEGIN
    VendorLedgerEntry.CALCFIELDS(VendorLedgerEntry."Amount (LCY)");
    Amt := Amt - VendorLedgerEntry."Amount (LCY)";
    VendorAmount := VendorAmount - VendorLedgerEntry."Amount (LCY)";
    UpdateQuarterAmount(AmountType::SameVATNo,-VendorLedgerEntry."Amount (LCY)",VendorLedgerEntry."Posting Date");
    END;
    UNTIL VendorLedgerEntry.NEXT = 0;
    IF VendorMaxAmount < VendorAmount THEN BEGIN
    VendorMaxAmount := VendorAmount;
    Name347 := Vendor2.Name;
    END;
    UNTIL Vendor2.NEXT = 0;
    Name347 := PADSTR(FormatTextName(Name347),40,' ');
    END;

    // End of the added lines.

    EXIT(Amt);
  7. Change the code in the IdentifyCashPayments function as follows:
    Existing code

    THEN BEGIN

    // Delete the following lines.
    IF IsCashAccount(CustLedgerEntry."Bal. Account No.") THEN BEGIN
    CreateCashTotals(CustLedgerEntry."Entry No.",VATRegistrationNo);
    END;
    END ELSE IF ((CustLedgerEntry."Bal. Account No." = '') OR
    (CustLedgerEntry."Bal. Account Type" <> CustLedgerEntry."Bal. Account Type"::"G/L Account"))
    THEN BEGIN
    IF IdentifyCashPaymentsFromGL(CustLedgerEntry) THEN
    CreateCashTotals(CustLedgerEntry."Entry No.",VATRegistrationNo);
    // End of the deleted lines.

    END;

    Replacement code

    THEN BEGIN

    // Add the following lines.
    IF IsCashAccount(CustLedgerEntry."Bal. Account No.") THEN
    CreateCashTotals(CustLedgerEntry."Entry No.",VATRegistrationNo);
    END ELSE
    IF ((CustLedgerEntry."Bal. Account No." = '') OR
    (CustLedgerEntry."Bal. Account Type" <> CustLedgerEntry."Bal. Account Type"::"G/L Account"))
    THEN BEGIN
    IF IdentifyCashPaymentsFromGL(CustLedgerEntry) THEN
    CreateCashTotals(CustLedgerEntry."Entry No.",VATRegistrationNo);
    // End of the added lines.

    END;


  8. Change the code in the CheckVatEntryNotIn347 function as follows:
    Existing code

    BEGIN

    Replacement code

    // Add the following lines.
    LOCAL PROCEDURE CheckVatEntryNotIn347@1100098(VATEntry@1100000 : Record 254;GLEntry@1100001 : Record 17);
    VAR
    TempVATEntry@1100002 : Record 254;
    BEGIN
    REPEAT
    TempVATEntry.SETRANGE("Transaction No.",VATEntry."Transaction No.");
    IF NOT TempVATEntry.FINDFIRST THEN BEGIN
    GLEntry.SETRANGE("Transaction No.",VATEntry."Transaction No.");
    IF GLEntry.FINDSET THEN
    REPEAT
    UpdateNotIn347Amount(GLEntry);
    UNTIL GLEntry.NEXT = 0;
    TempVATEntry := VATEntry;
    TempVATEntry.INSERT;
    END;
    UNTIL VATEntry.NEXT = 0;
    END;

    LOCAL PROCEDURE FilterVATEntry@1100099(VAR VATEntry@1100000 : Record 254;DocumentDate@1100001 : Date;DocumentType@1100002 : Integer;DocumentNo@1100003 : Code[20];IsCustomer@1100004 : Boolean);
    BEGIN
    VATEntry.RESET;
    IF IsCustomer THEN
    VATEntry.SETRANGE(Type,VATEntry.Type::Sale)
    ELSE
    VATEntry.SETRANGE(Type,VATEntry.Type::Purchase);
    VATEntry.SETRANGE("Document Date",DocumentDate);
    VATEntry.SETRANGE("Document Type",DocumentType);
    VATEntry.SETRANGE("Document No.",DocumentNo);
    VATEntry.SETRANGE("Country/Region Code",CountryCode);
    END;

    LOCAL PROCEDURE CheckCustDocTypeInvoice@1100101(SalesInvHeader@1100000 : Record 112;CustLedgEntry@1100001 : Record 21;Customer@1100002 : Record 18);
    VAR
    SalesInvLine@1100003 : Record 113;
    BEGIN
    SalesInvHeader.RESET;
    IF SalesInvHeader.GET(CustLedgEntry."Document No.") THEN BEGIN
    IF SalesInvHeader."Ship-to Code" <> '' THEN
    IF SalesInvHeader."Ship-to Country/Region Code" = CountryCode THEN BEGIN
    SalesInvLine.RESET;
    SalesInvLine.SETRANGE("Document No.",CustLedgEntry."Document No.");
    IF SalesInvLine.FINDSET THEN
    REPEAT
    IF (SalesInvLine."VAT Calculation Type" = SalesInvLine."VAT Calculation Type"::"No Taxable VAT") AND
    (Customer."Country/Region Code" = CountryCode) THEN
    NoTaxVATFound := TRUE;
    UNTIL SalesInvLine.NEXT = 0;
    END;
    END;
    IF Customer."Country/Region Code" = CountryCode THEN
    FromJournal := TRUE;
    END;

    PROCEDURE CheckCustDocTypeCrMemo@1100102(SalesCrMemoHeader@1100000 : Record 114;CustLedgEntry@1100001 : Record 21;Customer@1100002 : Record 18);
    VAR
    SalesCrMemoLine@1100003 : Record 115;
    BEGIN
    SalesCrMemoHeader.RESET;
    IF SalesCrMemoHeader.GET(CustLedgEntry."Document No.") THEN BEGIN
    IF SalesCrMemoHeader."Ship-to Code" <> '' THEN
    IF SalesCrMemoHeader."Ship-to Country/Region Code" = CountryCode THEN BEGIN
    SalesCrMemoLine.RESET;
    SalesCrMemoLine.SETRANGE("Document No.",CustLedgEntry."Document No.");
    IF SalesCrMemoLine.FINDSET THEN
    REPEAT
    IF (SalesCrMemoLine."VAT Calculation Type" = SalesCrMemoLine."VAT Calculation Type"::"No Taxable VAT") AND
    (Customer."Country/Region Code" = CountryCode) THEN
    NoTaxVATFound := TRUE;
    UNTIL SalesCrMemoLine.NEXT = 0;
    END;
    END;
    IF Customer."Country/Region Code" = CountryCode THEN
    FromJournal := TRUE;
    END;

    PROCEDURE CheckVendDocTypeInvoice@1100103(PurchInvHeader@1100000 : Record 122;VendorLedgerEntry@1100001 : Record 25;Vendor@1100002 : Record 23);
    VAR
    PurchInvLine@1100003 : Record 123;
    BEGIN
    PurchInvHeader.RESET;
    IF PurchInvHeader.GET(VendorLedgerEntry."Document No.") THEN BEGIN
    IF PurchInvHeader."Ship-to Code" <> '' THEN
    IF PurchInvHeader."Ship-to Country/Region Code" = CountryCode THEN BEGIN
    PurchInvLine.RESET;
    PurchInvLine.SETRANGE("Document No.",VendorLedgerEntry."Document No.");
    IF PurchInvLine.FINDSET THEN
    REPEAT
    IF (PurchInvLine."VAT Calculation Type" = PurchInvLine."VAT Calculation Type"::"No Taxable VAT") AND
    (Vendor."Country/Region Code" = CountryCode) THEN
    NoTaxVATFound := TRUE;
    UNTIL PurchInvLine.NEXT = 0;
    END;
    END;
    IF Vendor."Country/Region Code" = CountryCode THEN
    FromJournal := TRUE;
    END;

    PROCEDURE CheckVendDocTypeCrMemo@1100104(PurchCrMemoHeader@1100000 : Record 124;VendorLedgerEntry@1100001 : Record 25;Vendor@1100002 : Record 23);
    VAR
    PurchCrMemoLine@1100003 : Record 125;
    BEGIN
    PurchCrMemoHeader.RESET;
    IF PurchCrMemoHeader.GET(VendorLedgerEntry."Document No.") THEN BEGIN
    IF PurchCrMemoHeader."Ship-to Code" <> '' THEN
    IF PurchCrMemoHeader."Ship-to Country/Region Code" = CountryCode THEN BEGIN
    PurchCrMemoLine.RESET;
    PurchCrMemoLine.SETRANGE("Document No.",VendorLedgerEntry."Document No.");
    IF PurchCrMemoLine.FINDSET THEN
    REPEAT
    IF (PurchCrMemoLine."VAT Calculation Type" = PurchCrMemoLine."VAT Calculation Type"::"No Taxable VAT") AND
    (Vendor."Country/Region Code" = CountryCode) THEN
    NoTaxVATFound := TRUE;
    UNTIL PurchCrMemoLine.NEXT = 0;
    END;
    END;
    IF Vendor."Country/Region Code" = CountryCode THEN
    FromJournal := TRUE;
    END;

    // End of the added lines.

    BEGIN

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 Service Pack 1

  • The Spanish version of Microsoft Dynamics NAV 5.0 Service Pack 1

Removal information

You cannot remove this hotfix.

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

What affected your experience?

Thank you for your feedback!

×