This article applies to Microsoft Dynamics NAV for the Spain (es) region.

Introduction

This hotfix rollup corrects the following problems for Model 340 in the Spanish version of Microsoft Dynamics NAV 2009:

  • You cannot upload the model 340 file into the validation tool that tax authorities require after you export the file.
    For more information about hotfix 2681107, click the following article number to view the article in the Microsoft Knowledge Base:

    2681107 You cannot upload the model 340 file into the validation tool that tax authorities require after you export the file from the Spanish version of Microsoft Dynamics NAV

  • The system fills in a blank value in the Operation Key field unexpectedly in the model 340 file. 
    For more information about hotfix 2681115, click the following article number to view the article in the Microsoft Knowledge Base:

    2681115 The system fills in a blank value in the Operation Key field unexpectedly in the model 340 file that you export from the Spanish version of Microsoft Dynamics NAV

  • The system exports an incorrect value to the Total Number of Register field in the model 340 file.
    For more information about hotfix 2681118, click the following article number to view the article in the Microsoft Knowledge Base:

    2681118  The system exports an incorrect value to the Total Number of Register field in the model 340 file in the Spanish version of Microsoft Dynamics NAV

  • The system requires you to fill in the Property Location field and the Property Tax. Acc. No. field in 340 declaration lines when you export the model 340 file for Purchase.
    For more information about hotfix 2684460, click the following article number to view the article in the Microsoft Knowledge Base:

    2684460 The system requires you to fill in the "Property Location" field and the "Property Tax. Acc. No." field in 340 declaration lines when you export the model 340 file for Purchase in the Spanish version of Microsoft Dynamics NAV

  • The Unrealized VAT value is incorrect if the Unrealized VAT type is Percentage when you export a model 340 file. 
    For more information about hotfix 2694254, click the following article number to view the article in the Microsoft Knowledge Base:

    2694254 The Unrealized VAT value is incorrect in model 340 in the Spanish version of Microsoft Dynamics NAV

  • The deductible amount is zero incorrectly in a model 340 file when you use the Payment in Cash  and Exclude Non. Deduct. Gen. Prod. Post. Groups functionalities together in model 340.  
    For more information about hotfix 2710184, click the following article number to view the article in the Microsoft Knowledge Base:

    2710184 The deductible amount is zero incorrectly in a model 340 file when you use the "Payment in Cash" and "Exclude Non. Deduct. Gen. Prod. Post. Groups" functionalities together in model 340 in the Spanish version of Microsoft Dynamics NAV


These problems occur in the following products:

  • The Spanish version of Microsoft Dynamics NAV 2009 R2

  • The Spanish version of Microsoft Dynamics NAV 2009 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, but 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 Navision client users are logged off the system. This includes Microsoft Navision Application Services (NAS) client users. 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 install this hotfix rollup, follow these steps:

  1. Change the code in the Properties in the Make 340 Declaration report (10743) as follows:
    Existing code 1

    ...
    ERROR(Text10707);

    // Delete the following lines.
    IF FilterString = '' THEN
    GetFilterStringFromColumnGLAcc;
    // End of the lines.
    ...

    Replacement code 1

    ...
    ERROR(Text10707);

    // Add the following lines.
    IF GLAccFilterString = '' THEN
    GLAccFilterString := GetFilterStringFromColumn(ColumnGLAcc);
    // End of the lines.
    ...

    Existing code 2

    ...
    PeriodText := GetPeriodText ;

    // Delete the following lines.
    IF FilterString = '' THEN
    GetFilterStringFromColumnGPPG;
    // End of the lines.

    CompanyVATRegNo := FORMAT(CompanyInfo."VAT Registration No.");
    ...

    Replacement code 2

    ...
    PeriodText := GetPeriodText ;

    // Add the following lines.
    IF GPPGFilterString = '' THEN
    GPPGFilterString := GetFilterStringFromColumn(ColumnGPPG);
    // End of the lines.

    CompanyVATRegNo := FORMAT(CompanyInfo."VAT Registration No.");
    ...
  2. Change the code in the Request Form in the Make 340 Declaration report (10743) as follows:
    Existing code 1

    ...
    BEGIN

    // Delete the following line.
    GPPGSelectionBuf.SetNonDedGPPGSelectMultiple340(ColumnGPPG,FilterString);

    END;
    ...

    Replacement code 1

    ...
    BEGIN

    // Add the following line.
    GPPGSelectionBuf.SetNonDedGPPGSelectMultiple340(ColumnGPPG,GPPGFilterString);

    END;
    ...

    Existing code 2

    ...
    {

    // Delete the following lines.
    }
    CONTROLS
    {
    // End of the lines.

    }
    ...

    Replacement code 2

    ...
    {

    // Add the following lines.
    SaveValues=Yes;
    OnInit=BEGIN
    PrevDeclarationNumEnable := TRUE;
    FileNameTextBoxVisible := TRUE;
    IF FiscalYear = '' THEN
    FiscalYear := '0000';
    DeclarationNum := '0000';
    Quarter := Quarter::"1T";
    END;
    OnOpenPage=BEGIN
    PrevDeclarationNumEnable := ReplaceDeclaration;
    FileNameTextBoxVisible := NOT ISSERVICETIER;
    END;
    }
    CONTROLS
    {
    { 1900000001;0;Container;
    ContainerType=ContentArea }
    { 1900000002;1;Group ;
    CaptionML=ENU=Options }
    { 1100000;2;Field ;
    CaptionML=ENU=Fiscal Year;
    Numeric=Yes;
    SourceExpr=FiscalYear;
    OnValidate=BEGIN
    FiscalYearText := FiscalYear;
    IF STRLEN(FiscalYearText) <> MAXSTRLEN(FiscalYearText) THEN
    ERROR(Text10716,MAXSTRLEN(FiscalYearText));
    IF NOT EVALUATE(NumFiscalYear,FiscalYear) OR (NumFiscalYear < 0) THEN
    ERROR(Text10716,MAXSTRLEN(FiscalYearText));
    END;
    }
    { 1100002;2;Group ;
    CaptionML=ENU=Period }
    { 1100003;3;Field ;
    CaptionML=ENU=Month;
    OptionCaptionML=ENU=" ,January,February,March,April,May,June,July,August,September,October,November,December";
    SourceExpr=Month;
    OnValidate=BEGIN
    IF Month <> Month::" " THEN
    Quarter := Quarter::" ";
    END;
    }
    { 1100005;3;Field ;
    CaptionML=ENU=Quarter;
    OptionCaptionML=ENU=" ,1st Quarter,2nd Quarter,3rd Quarter,4th Quarter";
    SourceExpr=Quarter;
    OnValidate=BEGIN
    IF Quarter <> Quarter::" " THEN
    Month := Month::" ";
    END;
    }
    { 1000000002;2;Field ;
    CaptionML=ENU=Min Payment Amount;
    Numeric=No;
    SourceExpr=MinPaymentAmount;
    OnValidate=BEGIN
    WHILE STRLEN(DeclarationNum) < MAXSTRLEN(DeclarationNum) DO
    DeclarationNum := '0' + DeclarationNum;
    END;
    }
    { 1000000000;2;Field ;
    CaptionML=ENU=GL Acc. for Payments in Cash;
    SourceExpr=ColumnGLAcc;
    Editable=FALSE;
    OnAssistEdit=VAR
    GLAccSelectionBuf@1000000001 : Record 10726;
    BEGIN
    GLAccSelectionBuf.SetGLAccSelectionMultiple(ColumnGLAcc,GLAccFilterString);
    END;
    }
    { 1100007;2;Field ;
    CaptionML=ENU=Contact Name;
    SourceExpr=ContactName }
    { 1100009;2;Field ;
    CaptionML=ENU=Telephone Number;
    Numeric=Yes;
    SourceExpr=ContactTelephone;
    OnValidate=BEGIN
    IF STRLEN(ContactTelephone) <> MAXSTRLEN(ContactTelephone) THEN
    ERROR(Text10710,MAXSTRLEN(ContactTelephone));
    END;
    }
    { 1100011;2;Field ;
    CaptionML=ENU=Non Deduct. Gen. Prod. Post. Groups;
    SourceExpr=ColumnGPPG;
    Editable=FALSE;
    OnAssistEdit=VAR
    GPPGSelectionBuf@1100000 : Record 10730;
    BEGIN
    GPPGSelectionBuf.SetNonDedGPPGSelectMultiple340(ColumnGPPG,GPPGFilterString);
    END;
    }
    { 1100015;2;Field ;
    CaptionML=ENU=Declaration Number;
    Numeric=Yes;
    SourceExpr=DeclarationNum;
    OnValidate=BEGIN
    WHILE STRLEN(DeclarationNum) < MAXSTRLEN(DeclarationNum) DO
    DeclarationNum := '0' + DeclarationNum;
    END;
    }
    { 1100017;2;Field ;
    CaptionML=ENU=Electronic Code;
    SourceExpr=ElectronicCode;
    OnValidate=BEGIN
    IF STRLEN(ElectronicCode) <> MAXSTRLEN(ElectronicCode) THEN
    ERROR(Text10714,MAXSTRLEN(ElectronicCode));
    END;
    }
    { 1100019;2;Field ;
    CaptionML=ENU=Declaration Media Type;
    OptionCaptionML=ENU=Telematic,CD-R;
    SourceExpr=DeclarationMediaType }
    { 1100021;2;Field ;
    CaptionML=ENU=Replacement Declaration;
    SourceExpr=ReplaceDeclaration;
    OnValidate=BEGIN
    ReplaceDeclarationOnPush;
    END;
    }
    { 1100023;2;Field ;
    Name=PrevDeclarationNum;
    CaptionML=ENU=Previous Declaration Number;
    Numeric=Yes;
    SourceExpr=PrevDeclareNum;
    Enabled=PrevDeclarationNumEnable;
    OnValidate=BEGIN
    IF (STRLEN(PrevDeclareNum) <> MAXSTRLEN(PrevDeclareNum)) OR (STRPOS(PrevDeclareNum, ' ') <> 0) THEN
    ERROR(Text10715,MAXSTRLEN(PrevDeclareNum));
    END;
    }
    { 1100025;2;Field ;
    Name=FileNameTextBox;
    CaptionML=ENU=File Name;
    SourceExpr=FileName;
    Visible=FileNameTextBoxVisible;
    OnAssistEdit=BEGIN
    FileName := CommonDialogMgt.OpenFile(Text10709,FileName,1,Text10708,1);
    END;
    }
    // End of the lines.

    }
    ...
  3. Change the code in the Global Variables in the Make 340 Declaration report (10743) as follows:
    Existing code 1

    ...
    Text10700@1100057 : TextConst 'ENU=Please specify the VAT Registration No. of your Company in the Company Information window.';

    // Delete the following line.
    FilterString@1100024 : Text[1024];

    PrevDeclareNumText@1100027 : Text[13];
    ...

    Replacement code 1

    ...
    Text10700@1100057 : TextConst 'ENU=Please specify the VAT Registration No. of your Company in the Company Information window.';

    // Add the following line.
    GPPGFilterString@1100024 : Text[1024];

    PrevDeclareNumText@1100027 : Text[13];
    ...

    Existing code 2

    ...
    Text10711@1100068 : TextConst 'ENU=340 Declaration has been exported successfully under %1.';
    Text10713@1100070 : TextConst 'ENU=Please specify the Period: Month or Quarter.';
    ...

    Replacement code 2

    ...
    Text10711@1100068 : TextConst 'ENU=340 Declaration has been exported successfully under %1.';

    // Add the following line.
    Text10712@1100069 : TextConst 'ENU=The declaration can include either a month or a quarter but not both at the same time.';

    Text10713@1100070 : TextConst 'ENU=Please specify the Period: Month or Quarter.';
    ...

    Existing code 3

    ...
    FilterArray@1100109 : ARRAY [50] OF Text[30];
    FileHeaderCreated@19078656 : Boolean;
    ...

    Replacement code 3

    ...
    FilterArray@1100109 : ARRAY [50] OF Text[30];

    // Add the following lines.
    FileNameTextBoxVisible@19077241 : Boolean INDATASET;
    PrevDeclarationNumEnable@19078655 : Boolean INDATASET;
    // End of the lines.

    FileHeaderCreated@19078656 : Boolean;
    ...
  4. Change the code in the CheckDeductibleVAT function in the Make 340 Declaration report (10743) as follows:
    Existing code

    ...
    VATEntries.SETRANGE("VAT Prod. Posting Group",VATEntryRec."VAT Prod. Posting Group");

    // Delete the following line.
    VATEntries.SETFILTER("Gen. Prod. Posting Group",FilterString);

    VATEntries.CALCSUMS(Amount);
    ...

    Replacement code

    ...
    VATEntries.SETRANGE("VAT Prod. Posting Group",VATEntryRec."VAT Prod. Posting Group");

    // Add the following line.
    VATEntries.SETFILTER("Gen. Prod. Posting Group",GPPGFilterString);

    VATEntries.CALCSUMS(Amount);
    ...
  5. Change the code in the GetFilterStringFromColumnGPPG function in the Make 340 Declaration report (10743) as follows:
    Existing code

    ...
    // Delete the following lines.
    PROCEDURE GetFilterStringFromColumnGPPG@1100014();
    VAR
    GPPGCode@1100003 : Text[250];
    Position@1100002 : Integer;
    BEGIN
    GPPGCode := ColumnGPPG;
    REPEAT
    Position := STRPOS(GPPGCode,';');
    IF GPPGCode <> '' THEN BEGIN
    IF Position <> 0 THEN BEGIN
    FilterString := FilterString + '<>' + COPYSTR(GPPGCode,1,Position - 1);
    GPPGCode := COPYSTR(GPPGCode,Position + 1);
    END ELSE BEGIN
    FilterString := FilterString + '<>' + COPYSTR(GPPGCode,1);
    GPPGCode := '';
    END;
    IF GPPGCode <> '' THEN
    FilterString := FilterString + '&';
    END;
    UNTIL GPPGCode = '';
    // End of the lines.

    END;
    ...

    Replacement code

    ...
    // Add the following lines.
    PROCEDURE GetFilterStringFromColumn@1100014(Columns@1100015 : Text[1024]) FilterString : Text[1024];
    VAR
    ColumnCode@1100003 : Text[1024];
    Position@1100002 : Integer;
    BEGIN
    ColumnCode := Columns;
    FilterString := '';
    REPEAT
    Position := STRPOS(ColumnCode,';');
    IF ColumnCode <> '' THEN BEGIN
    IF Position <> 0 THEN BEGIN
    FilterString := FilterString + '<>' + COPYSTR(ColumnCode,1,Position - 1);
    ColumnCode := COPYSTR(ColumnCode,Position + 1);
    END ELSE BEGIN
    FilterString := FilterString + '<>' + COPYSTR(ColumnCode,1);
    ColumnCode := '';
    END;
    IF ColumnCode <> '' THEN
    FilterString := FilterString + '&';
    END;
    UNTIL ColumnCode = '';
    // End of the lines.

    END;
    ...


  6. Change the code in the GetFilterStringFromColumnGLAcc function in the Make 340 Declaration report (10743) as follows:
    Existing code

    ...
    // Delete the following lines.
    PROCEDURE GetFilterStringFromColumnGLAcc@1100039();
    VAR
    GLAccCode@1100000 : Text[250];
    Position@1100001 : Integer;
    BEGIN
    GLAccCode := ColumnGLAcc;
    REPEAT
    Position := STRPOS(GLAccCode,';');
    IF GLAccCode <> '' THEN BEGIN
    IF Position <> 0 THEN BEGIN
    FilterString := FilterString + COPYSTR(GLAccCode,1,Position - 1);
    GLAccCode := COPYSTR(GLAccCode,Position + 1);
    END ELSE BEGIN
    FilterString := FilterString + COPYSTR(GLAccCode,1);
    GLAccCode := '';
    END;
    IF GLAccCode <> '' THEN
    FilterString := FilterString + '|';
    END;
    UNTIL GLAccCode = '';
    // End of the lines.

    END;
    ...

    Replacement code

    ...
    // Add the following lines.
    LOCAL PROCEDURE ReplaceDeclarationOnPush@1100039();
    BEGIN
    PrevDeclarationNumEnable := ReplaceDeclaration;
    // End of the lines.

    END;
    ...


  7. Change the code in the PopulateAppliedPayments function in the Make 340 Declaration report (10743) as follows:
    Existing code

    ...
    BEGIN

    // Delete the following lines.
    NoOfAccounts := RetrieveGLAccount(FilterString);
    IF FilterString <> '' THEN BEGIN
    // End of the lines.

    Customer.RESET;
    ...

    Replacement code

    ...
    BEGIN

    // Add the following lines.
    NoOfAccounts := RetrieveGLAccount(GLAccFilterString);
    IF GLAccFilterString <> '' THEN BEGIN
    // End of the lines.

    Customer.RESET;
    ...
  8. Change the code in the CheckCustomerPayment function in the Make 340 Declaration report (10743) as follows:
    Existing code

    ...
    BEGIN

    // Delete the following lines.
    CustLedgerEntry.SETCURRENTKEY("Document Type","Customer No.","Posting Date","Currency Code");
    CustLedgerEntry.SETFILTER("Document Type",'%1|%2',CustLedgerEntry."Document Type"::" ",CustLedgerEntry."Document Type"::Payment);
    CustLedgerEntry.SETRANGE("Customer No.",CustomerNo);
    CustLedgerEntry.SETRANGE("Document Date",FromDate,ToDate);
    EXIT(NOT CustLedgerEntry.ISEMPTY);
    // End of the lines.

    END;
    ...

    Replacement code

    ...
    BEGIN

    // Add the following lines.
    WITH CustLedgerEntry DO BEGIN
    SETCURRENTKEY("Document Type","Customer No.","Posting Date","Currency Code");
    SETFILTER("Document Type",'%1|%2',"Document Type"::" ","Document Type"::Payment);
    SETRANGE("Customer No.",CustomerNo);
    SETRANGE("Document Date",FromDate,ToDate);
    IF FINDSET THEN
    REPEAT
    IF CheckCustLedgEntryExists(CustLedgerEntry) THEN
    EXIT(TRUE);
    UNTIL NEXT = 0;
    END;
    // End of the lines.

    END;
    ...


  9. Change the code in the ExecuteCustomerPaymentsfunction in the Make 340 Declaration report (10743) as follows:
    Existing code

    ...
    BEGIN

    // Delete the following lines.
    CustLedgerEntry.SETCURRENTKEY("Document Type","Customer No.","Posting Date","Currency Code");
    CustLedgerEntry.SETFILTER("Document Type",'%1|%2',CustLedgerEntry."Document Type"::" ",CustLedgerEntry."Document Type"::Payment);
    CustLedgerEntry.SETRANGE("Customer No.",CustomerNo);
    CustLedgerEntry.SETRANGE("Document Date",DMY2DATE(1,1,NumFiscalYear),ToDate);
    IF CustLedgerEntry.FINDSET THEN
    REPEAT
    FillBufferFromPaymentCustLE(CustLedgerEntry,0);
    UNTIL CustLedgerEntry.NEXT = 0;
    // End of the lines.

    END;
    ...

    Replacement code

    ...
    BEGIN

    // Add the following lines.
    WITH CustLedgerEntry DO BEGIN
    SETCURRENTKEY("Document Type","Customer No.","Posting Date","Currency Code");
    SETFILTER("Document Type",'%1|%2',"Document Type"::" ","Document Type"::Payment);
    SETRANGE("Customer No.",CustomerNo);
    SETRANGE("Document Date",DMY2DATE(1,1,NumFiscalYear),ToDate);
    IF FINDSET THEN
    REPEAT
    IF CheckCustLedgEntryExists(CustLedgerEntry) THEN
    FillBufferFromPaymentCustLE(CustLedgerEntry,0);
    UNTIL NEXT = 0;
    END;
    // End of the lines.

    END;
    ...
  10. Change the code in the CheckCustLedgEntryExistsfunction in the Make 340 Declaration report (10743) as follows:
    Existing code

    ...
    BEGIN
    ...

    Replacement code

    ...
    // Add the following lines.
    PROCEDURE CheckCustLedgEntryExists@1100057(CustLedgerEntry@1000000001 : Record 21) : Boolean;
    VAR
    DtldCustLedgEntry@1000000000 : Record 379;
    ApplDtldCustLedgEntry@1000000002 : Record 379;
    BEGIN
    IF CustLedgerEntry."Document Type" = CustLedgerEntry."Document Type"::Payment THEN
    EXIT(TRUE);
    DtldCustLedgEntry.SETCURRENTKEY("Cust. Ledger Entry No.");
    DtldCustLedgEntry.SETRANGE("Cust. Ledger Entry No.",CustLedgerEntry."Entry No.");
    IF DtldCustLedgEntry.FINDFIRST THEN BEGIN
    ApplDtldCustLedgEntry.SETRANGE("Transaction No.",DtldCustLedgEntry."Transaction No.");
    ApplDtldCustLedgEntry.SETFILTER("Cust. Ledger Entry No.",'<>%1',DtldCustLedgEntry."Cust. Ledger Entry No.");
    ApplDtldCustLedgEntry.SETRANGE("Document Type",ApplDtldCustLedgEntry."Document Type"::Bill);
    EXIT(ApplDtldCustLedgEntry.ISEMPTY);
    END;
    END;
    // End of the lines.

    BEGIN
    ...

Prerequisites

You must have one of the following products installed to apply this hotfix rollup:

  • The Spanish version of Microsoft Dynamics NAV 2009 R2

  • The Spanish version of Microsoft Dynamics NAV 2009 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!

×