Symptoms
When you export a VAT report to the Tax Authority based on the instructions from the EU sales update in the German version of Microsoft Dynamics NAV 2009 SP1, the zero amounts are reported in the original EU sales list. This problem occurs in the following products:
-
The German version of Microsoft Dynamics NAV 2009 Service Pack 1
Zero amounts are currently allowed in the EU sales list and they should not be allowed, only for corrections.
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, follow these steps:-
Change the code in theFillCompanyInfo function in the VAT Report Header Table (740) as follows:
Existing code 1...
PROCEDURE FillCompanyInfo@1140002(); VAR CompanyInfo@1140000 : Record 79; CountryRegion@1140001 : Record 9; // Delete the following lines. BEGIN CompanyInfo.GET; // End of the deleted line. CompanyInfo.TESTFIELD("Country/Region Code"); CountryRegion.GET(CompanyInfo."Country/Region Code"); ...Replacement code 1
...
PROCEDURE FillCompanyInfo@1140002(); VAR CompanyInfo@1140000 : Record 79; CountryRegion@1140001 : Record 9; // Add the following lines. VATReportSetup@1140002 : Record 743; BEGIN CompanyInfo.GET; VATReportSetup.GET; // End of the added lines. CompanyInfo.TESTFIELD("Country/Region Code"); CountryRegion.GET(CompanyInfo."Country/Region Code"); ...Existing code 2
...
CountryRegion.GET(CompanyInfo."Country/Region Code"); VALIDATE("VAT Registration No.",CompanyInfo."VAT Registration No."); // Delete the following lines. VALIDATE("Company Name",CompanyInfo.Name); VALIDATE("Company Address",CompanyInfo.Address); VALIDATE("Country/Region Name",CountryRegion.Name); VALIDATE(City,CompanyInfo.City); // End of the deleted lines. VALIDATE("Post Code",CompanyInfo."Post Code"); VALIDATE("Tax Office ID",CompanyInfo."Tax Office Number"); END; ...Replacement code 2
...
CountryRegion.GET(CompanyInfo."Country/Region Code"); VALIDATE("VAT Registration No.",CompanyInfo."VAT Registration No."); // Add the following lines. VALIDATE("Company Name",GetCompanyName(CompanyInfo,VATReportSetup)); VALIDATE("Company Address",GetCompanyAddress(CompanyInfo,VATReportSetup)); VALIDATE("Country/Region Name",CountryRegion.Name); VALIDATE(City,GetCompanyCity(CompanyInfo,VATReportSetup)); // End of the added lines. VALIDATE("Post Code",CompanyInfo."Post Code"); VALIDATE("Tax Office ID",CompanyInfo."Tax Office Number"); END; ... -
Change the code in the GetCompanyName function in the VAT Report Header Table (740) as follows:
Existing code...
TESTFIELD(Status,Status::Submitted); END; END; BEGIN END. } } ...Replacement code
...
TESTFIELD(Status,Status::Submitted); END; END; // Add the following lines. LOCAL PROCEDURE GetCompanyName@1140004(CompanyInformation@1140001 : Record 79;VATReportSetup@1140000 : Record 743) : Text[100]; BEGIN IF VATReportSetup."Company Name" <> '' THEN EXIT(VATReportSetup."Company Name"); EXIT(CompanyInformation.Name); END; LOCAL PROCEDURE GetCompanyAddress@1140005(CompanyInformation@1140001 : Record 79;VATReportSetup@1140000 : Record 743) : Text[30]; BEGIN IF VATReportSetup."Company Address" <> '' THEN EXIT(VATReportSetup."Company Address"); EXIT(CompanyInformation.Address); END; LOCAL PROCEDURE GetCompanyCity@1140006(CompanyInformation@1140001 : Record 79;VATReportSetup@1140000 : Record 743) : Text[30]; BEGIN IF VATReportSetup."Company City" <> '' THEN EXIT(VATReportSetup."Company City"); EXIT(CompanyInformation.City); END; // End of the added lines. BEGIN END. } } ... -
Change the code in the Fields in the VAT Report Setup Table (743) as follows:
Existing code...
{ 11004; ;Registration ID ;Text6 ;CaptionML=[DEU=Registrierungs-ID; ENU=Registration ID] } { 11005; ;Export Cancellation Lines;Boolean ;CaptionML=[DEU=Stornozeilen exportieren; ENU=Export Cancellation Lines] } } KEYS { { ;Primary key ;Clustered=Yes } ...Replacement code
...
{ 11004; ;Registration ID ;Text6 ;CaptionML=[DEU=Registrierungs-ID; ENU=Registration ID] } { 11005; ;Export Cancellation Lines;Boolean ;CaptionML=[DEU=Stornozeilen exportieren; ENU=Export Cancellation Lines] } // Add the following lines. { 11006; ;Company Name ;Text100 } { 11007; ;Company Address ;Text30 } { 11008; ;Company City ;Text30 } // End of the added lines. } KEYS { { ;Primary key ;Clustered=Yes } ... -
Change the code in the Properties in the VAT Report Setup Form (743) as follows:
Existing code...
} PROPERTIES { Width=11990; // Delete the following line. Height=6490; // End of the deleted line. CaptionML=[DEU=MwSt.-Berichtseinrichtung; ENU=VAT Report Setup]; InsertAllowed=No; DeleteAllowed=No; ...Replacement code
...
} PROPERTIES { Width=11990; // Add the following lines. Height=8690; // End of the added line. CaptionML=[DEU=MwSt.-Berichtseinrichtung; ENU=VAT Report Setup]; InsertAllowed=No; DeleteAllowed=No; ... -
Change the code in the Controls in the VAT Report Setup Form (743) as follows:
Existing code 1...
} CONTROLS { // Delete the following line. { 1 ;TabControl ;220 ;220 ;11550;5280 ;HorzGlue=Both; // End of the deleted line. VertGlue=Both; PageNamesML=[DEU=Allgemein,Nummerierung; ENU=General,Numbering] } { 4 ;CheckBox ;3850 ;990 ;440 ;440 ;ParentControl=1; ...Replacement code 1
...
} CONTROLS { // Add the following line. { 1 ;TabControl ;220 ;220 ;11550;7480 ;HorzGlue=Both; // End of the added line. VertGlue=Both; PageNamesML=[DEU=Allgemein,Nummerierung; ENU=General,Numbering] } { 4 ;CheckBox ;3850 ;990 ;440 ;440 ;ParentControl=1; ...Existing code 2
...
InPage=0; ShowCaption=No; SourceExpr="Export Cancellation Lines" } { 1140013;Label ;440 ;4840 ;3300 ;440 ;ParentControl=1140012 } { 7 ;TextBox ;3850 ;990 ;2750 ;440 ;ParentControl=1; InPage=1; SourceExpr="No. Series" } { 8 ;Label ;440 ;990 ;3300 ;440 ;ParentControl=7 } ...Replacement code 2
...
InPage=0; ShowCaption=No; SourceExpr="Export Cancellation Lines" } { 1140013;Label ;440 ;4840 ;3300 ;440 ;ParentControl=1140012 } // Add the following lines. { 1140015;TextBox ;3850 ;5390 ;2750 ;440 ;Name=Company Name; ParentControl=1; InPage=0; SourceExpr="Company Name" } { 1140014;Label ;440 ;5390 ;3300 ;440 ;ParentControl=1140015 } { 1140017;TextBox ;3850 ;5940 ;2750 ;440 ;ParentControl=1; InPage=0; SourceExpr="Company Address" } { 1140016;Label ;440 ;5940 ;3300 ;440 ;ParentControl=1140017 } { 1140019;TextBox ;3850 ;6490 ;2750 ;440 ;ParentControl=1; InPage=0; SourceExpr="Company City" } { 1140018;Label ;440 ;6490 ;3300 ;440 ;ParentControl=1140019 } // End of the added lines. { 7 ;TextBox ;3850 ;990 ;2750 ;440 ;ParentControl=1; InPage=1; SourceExpr="No. Series" } { 8 ;Label ;440 ;990 ;3300 ;440 ;ParentControl=7 } ...Existing code 3
...
{ 7 ;TextBox ;3850 ;990 ;2750 ;440 ;ParentControl=1; InPage=1; SourceExpr="No. Series" } { 8 ;Label ;440 ;990 ;3300 ;440 ;ParentControl=7 } // Delete the following line. { 6 ;CommandButton;9570 ;5720 ;2200 ;550 ;HorzGlue=Right; // End of the deleted line. VertGlue=Bottom; PushAction=FormHelp } } CODE ...Replacement code 3
...
{ 7 ;TextBox ;3850 ;990 ;2750 ;440 ;ParentControl=1; InPage=1; SourceExpr="No. Series" } { 8 ;Label ;440 ;990 ;3300 ;440 ;ParentControl=7 } // Add the following line. { 6 ;CommandButton;9570 ;7920 ;2200 ;550 ;HorzGlue=Right; // End of the added line. VertGlue=Bottom; PushAction=FormHelp } } CODE ... -
Change the code in the MakeLineRecord function in the Export VIES Report Report (11008) as follows:
Existing code 1...
END; PROCEDURE MakeLineRecord@1140004(VATReportHeader@1140001 : Record 740;VATReportLine@1140000 : Record 741); BEGIN TempDataExportBuffer."Entry No." := NextLineNo; TempDataExportBuffer."Field Value" := GetRecordType('1') + PADSTR(VATReportHeader."VAT Registration No.",11) + ...Replacement code 1
...
END; PROCEDURE MakeLineRecord@1140004(VATReportHeader@1140001 : Record 740;VATReportLine@1140000 : Record 741); BEGIN // Add the following lines. IF (VATReportLine.Base = 0) AND (VATReportLine."Line Type" <> VATReportLine."Line Type"::Correction) THEN EXIT; // End of the added lines. TempDataExportBuffer."Entry No." := NextLineNo; TempDataExportBuffer."Field Value" := GetRecordType('1') + PADSTR(VATReportHeader."VAT Registration No.",11) + ...Existing code 2
...
TempDataExportBuffer."Entry No." := NextLineNo; TempDataExportBuffer."Field Value" := GetRecordType('1') + PADSTR(VATReportHeader."VAT Registration No.",11) + // Delete the following line. GetReportType(VATReportLine) + // End of the deleted line. GetReportPeriod(VATReportHeader) + PADSTR(VATReportLine.GetVATRegNo,14) + FormatBaseForExport(VATReportLine,12) + GetTurnoverType(VATReportLine) + ...Replacement code 2
...
TempDataExportBuffer."Entry No." := NextLineNo; TempDataExportBuffer."Field Value" := GetRecordType('1') + PADSTR(VATReportHeader."VAT Registration No.",11) + // Add the following line. GetReportType(VATReportLine,VATReportHeader) + // End of the added line. GetReportPeriod(VATReportHeader) + PADSTR(VATReportLine.GetVATRegNo,14) + FormatBaseForExport(VATReportLine,12) + GetTurnoverType(VATReportLine) + ... -
Change the code in the MakeTotalRecord function in the Export VIES Report Report (11008) as follows:
Existing code...
GetRecordType('2') + PADSTR(VATReportHeader."VAT Registration No.",11) + GetReportPeriod(VATReportHeader) + FormatAmountForExport(VATReportHeader."Total Base",14) + // Delete the following line. FormatAmountForExport(VATReportHeader."Total Number of Lines",5) + // End of the deleted line. PADSTR('',85); TempDataExportBuffer.INSERT; NextLineNo := NextLineNo + 1; END; ...Replacement code
...
GetRecordType('2') + PADSTR(VATReportHeader."VAT Registration No.",11) + GetReportPeriod(VATReportHeader) + FormatAmountForExport(VATReportHeader."Total Base",14) + // Add the following lines. FormatAmountForExport( VATReportHeader."Total Number of Lines" - GetZeroBaseNewLineCount(VATReportHeader."No.") + GetExportCancellationLineCount(VATReportHeader."No."),5) + // End of the added lines. PADSTR('',85); TempDataExportBuffer.INSERT; NextLineNo := NextLineNo + 1; END; ... -
Change the code in the GetReportType function in the Export VIES Report Report (11008) as follows:
Existing code...
BEGIN EXIT(RecordType); END; // Delete the following lines. PROCEDURE GetReportType@1140007(VATReportLine@1140000 : Record 741) : Text[2]; BEGIN // End of the deleted lines. CASE VATReportLine."Line Type" OF VATReportLine."Line Type"::New: EXIT('10'); VATReportLine."Line Type"::Cancellation, ...Replacement code
...
BEGIN EXIT(RecordType); END; // Add the following lines. PROCEDURE GetReportType@1140007(VATReportLine@1140000 : Record 741;VATReportHeader@1140001 : Record 740) : Text[2]; BEGIN IF VATReportHeader."VAT Report Type" = VATReportHeader."VAT Report Type"::Corrective THEN EXIT('11'); // End of the added lines. CASE VATReportLine."Line Type" OF VATReportLine."Line Type"::New: EXIT('10'); VATReportLine."Line Type"::Cancellation, ... -
Change the code in the GetZeroBaseNewLineCount function in the Export VIES Report Report (11008) as follows:
Existing code...
EXIT('p'); END; PROCEDURE FormatDate@1140002(Date@1140000 : Date) : Text[8]; BEGIN EXIT(FORMAT(Date,8,'<Year4><Month,2><Day,2>')); END; ...Replacement code
...
EXIT('p'); END; // Add the following lines. LOCAL PROCEDURE GetZeroBaseNewLineCount@1140020(ReportNo@1140001 : Code[20]) : Integer; VAR VATReportLine@1140000 : Record 741; BEGIN WITH VATReportLine DO BEGIN SETRANGE("VAT Report No.",ReportNo); SETRANGE(Base,0); SETFILTER("Line Type",'<>%1',"Line Type"::Correction); EXIT(COUNT); END; END; LOCAL PROCEDURE GetExportCancellationLineCount@1140021(ReportNo@1140001 : Code[20]) : Integer; VAR VATReportLine@1140000 : Record 741; BEGIN IF NOT VATReportSetup."Export Cancellation Lines" THEN EXIT(0); WITH VATReportLine DO BEGIN SETRANGE("VAT Report No.",ReportNo); SETRANGE("Line Type","Line Type"::Cancellation); EXIT(COUNT); END; END; // End of the added lines. PROCEDURE FormatDate@1140002(Date@1140000 : Date) : Text[8]; BEGIN EXIT(FORMAT(Date,8,'<Year4><Month,2><Day,2>')); END; ...
Prerequisites
You must have one of the following products installed to apply this hotfix:
-
The German version of Microsoft Dynamics NAV 2009 SP1
In addition, you have to updates KB2961982 and KB3013602 installed.
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.
Page 743 should be updated using Transformation Tool, from modified Form 743.
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 Usefor other considerations.