Applies ToDynamics NAV 2009

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 = '' THENGetFilterStringFromColumnGLAcc;// End of the lines....

    Replacement code 1

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

    Existing code 2

    ...PeriodText := GetPeriodText ;// Delete the following lines.IF FilterString = '' THENGetFilterStringFromColumnGPPG;// End of the lines.CompanyVATRegNo := FORMAT(CompanyInfo."VAT Registration No.");...

    Replacement code 2

    ...PeriodText := GetPeriodText ;// Add the following lines.IF GPPGFilterString = '' THENGPPGFilterString := 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=BEGINPrevDeclarationNumEnable := TRUE;FileNameTextBoxVisible := TRUE;IF FiscalYear = '' THENFiscalYear := '0000';DeclarationNum := '0000';Quarter := Quarter::"1T";END;OnOpenPage=BEGINPrevDeclarationNumEnable := 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=BEGINFiscalYearText := FiscalYear;IF STRLEN(FiscalYearText) <> MAXSTRLEN(FiscalYearText) THENERROR(Text10716,MAXSTRLEN(FiscalYearText));IF NOT EVALUATE(NumFiscalYear,FiscalYear) OR (NumFiscalYear < 0) THENERROR(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=BEGINIF Month <> Month::" " THENQuarter := Quarter::" ";END;}{ 1100005;3;Field ;CaptionML=ENU=Quarter;OptionCaptionML=ENU=" ,1st Quarter,2nd Quarter,3rd Quarter,4th Quarter";SourceExpr=Quarter;OnValidate=BEGINIF Quarter <> Quarter::" " THENMonth := Month::" ";END;}{ 1000000002;2;Field ;CaptionML=ENU=Min Payment Amount;Numeric=No;SourceExpr=MinPaymentAmount;OnValidate=BEGINWHILE STRLEN(DeclarationNum) < MAXSTRLEN(DeclarationNum) DODeclarationNum := '0' + DeclarationNum;END;}{ 1000000000;2;Field ;CaptionML=ENU=GL Acc. for Payments in Cash;SourceExpr=ColumnGLAcc;Editable=FALSE;OnAssistEdit=VARGLAccSelectionBuf@1000000001 : Record 10726;BEGINGLAccSelectionBuf.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=BEGINIF STRLEN(ContactTelephone) <> MAXSTRLEN(ContactTelephone) THENERROR(Text10710,MAXSTRLEN(ContactTelephone));END;}{ 1100011;2;Field ;CaptionML=ENU=Non Deduct. Gen. Prod. Post. Groups;SourceExpr=ColumnGPPG;Editable=FALSE;OnAssistEdit=VARGPPGSelectionBuf@1100000 : Record 10730;BEGINGPPGSelectionBuf.SetNonDedGPPGSelectMultiple340(ColumnGPPG,GPPGFilterString);END;}{ 1100015;2;Field ;CaptionML=ENU=Declaration Number;Numeric=Yes;SourceExpr=DeclarationNum;OnValidate=BEGINWHILE STRLEN(DeclarationNum) < MAXSTRLEN(DeclarationNum) DODeclarationNum := '0' + DeclarationNum;END;}{ 1100017;2;Field ;CaptionML=ENU=Electronic Code;SourceExpr=ElectronicCode;OnValidate=BEGINIF STRLEN(ElectronicCode) <> MAXSTRLEN(ElectronicCode) THENERROR(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=BEGINReplaceDeclarationOnPush;END;}{ 1100023;2;Field ;Name=PrevDeclarationNum;CaptionML=ENU=Previous Declaration Number;Numeric=Yes;SourceExpr=PrevDeclareNum;Enabled=PrevDeclarationNumEnable;OnValidate=BEGINIF (STRLEN(PrevDeclareNum) <> MAXSTRLEN(PrevDeclareNum)) OR (STRPOS(PrevDeclareNum, ' ') <> 0) THENERROR(Text10715,MAXSTRLEN(PrevDeclareNum));END;}{ 1100025;2;Field ;Name=FileNameTextBox;CaptionML=ENU=File Name;SourceExpr=FileName;Visible=FileNameTextBoxVisible;OnAssistEdit=BEGINFileName := 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();VARGPPGCode@1100003 : Text[250];Position@1100002 : Integer;BEGINGPPGCode := ColumnGPPG;REPEATPosition := STRPOS(GPPGCode,';');IF GPPGCode <> '' THEN BEGINIF Position <> 0 THEN BEGINFilterString := FilterString + '<>' + COPYSTR(GPPGCode,1,Position - 1);GPPGCode := COPYSTR(GPPGCode,Position + 1);END ELSE BEGINFilterString := FilterString + '<>' + COPYSTR(GPPGCode,1);GPPGCode := '';END;IF GPPGCode <> '' THENFilterString := 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];VARColumnCode@1100003 : Text[1024];Position@1100002 : Integer;BEGINColumnCode := Columns;FilterString := '';REPEATPosition := STRPOS(ColumnCode,';');IF ColumnCode <> '' THEN BEGINIF Position <> 0 THEN BEGINFilterString := FilterString + '<>' + COPYSTR(ColumnCode,1,Position - 1);ColumnCode := COPYSTR(ColumnCode,Position + 1);END ELSE BEGINFilterString := FilterString + '<>' + COPYSTR(ColumnCode,1);ColumnCode := '';END;IF ColumnCode <> '' THENFilterString := 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();VARGLAccCode@1100000 : Text[250];Position@1100001 : Integer;BEGINGLAccCode := ColumnGLAcc;REPEATPosition := STRPOS(GLAccCode,';');IF GLAccCode <> '' THEN BEGINIF Position <> 0 THEN BEGINFilterString := FilterString + COPYSTR(GLAccCode,1,Position - 1);GLAccCode := COPYSTR(GLAccCode,Position + 1);END ELSE BEGINFilterString := FilterString + COPYSTR(GLAccCode,1);GLAccCode := '';END;IF GLAccCode <> '' THENFilterString := FilterString + '|';END;UNTIL GLAccCode = '';// End of the lines.END;...

    Replacement code

    ...// Add the following lines.LOCAL PROCEDURE ReplaceDeclarationOnPush@1100039();BEGINPrevDeclarationNumEnable := 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 BEGINSETCURRENTKEY("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 THENREPEATIF CheckCustLedgEntryExists(CustLedgerEntry) THENEXIT(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 THENREPEATFillBufferFromPaymentCustLE(CustLedgerEntry,0);UNTIL CustLedgerEntry.NEXT = 0;// End of the lines.END;...

    Replacement code

    ...BEGIN// Add the following lines.WITH CustLedgerEntry DO BEGINSETCURRENTKEY("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 THENREPEATIF CheckCustLedgEntryExists(CustLedgerEntry) THENFillBufferFromPaymentCustLE(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;VARDtldCustLedgEntry@1000000000 : Record 379;ApplDtldCustLedgEntry@1000000002 : Record 379;BEGINIF CustLedgerEntry."Document Type" = CustLedgerEntry."Document Type"::Payment THENEXIT(TRUE);DtldCustLedgEntry.SETCURRENTKEY("Cust. Ledger Entry No.");DtldCustLedgEntry.SETRANGE("Cust. Ledger Entry No.",CustLedgerEntry."Entry No.");IF DtldCustLedgEntry.FINDFIRST THEN BEGINApplDtldCustLedgEntry.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?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.