本文适用于西班牙 (Microsoft Dynamics NAV) 语言区域设置。
症状
假设你在 Microsoft Dynamics NAV 2009 的西班牙语版本中过帐发票使用增值税过帐组实现未实现的增值税。 接下来,从 Cartera 模块中的发票创建帐单。 然后,使用帐单中的剩余金额将帐单应用于付款。 在这种情况下,查看相应的 VAT 条目时, “金额” 值不正确。 以下产品中会出现此问题:
- Microsoft Dynamics NAV 2009 R2 的西班牙语版本
- Microsoft Dynamics NAV 2009 Service Pack 1 (SP1 的西班牙语版本)
原因
出现此问题的原因是,当您应用使用增值税过帐组进行未实现增值税的帐单时,系统会计算原始金额而不是剩余金额。
解决方法
修补程序信息
Microsoft现在提供了受支持的修补程序。 但是,它仅用于更正本文中所述的问题。 仅将其应用于遇到此特定问题的系统。 此修补程序可能会收到其他测试。 因此,如果你没有受到此问题的严重影响,我们建议你等待下一个Microsoft Dynamics NAV 2009 Service Pack 或包含此修补程序的下一Microsoft Dynamics NAV 版本。
注意 在特殊情况下,如果 Microsoft Dynamics 和相关产品的技术支持专业人员确定特定更新将解决你的问题,则通常由支持呼叫产生的费用可能会被取消。 对于相关特定升级无法解决的其他支持问题和事项,将照常收取支持费用。
安装信息
Microsoft 的编程示例仅用于说明,不做任何明示或暗示的保证。 这包括但不限于特定用途的适销性或适用性的隐含保证。 本文假定你熟悉所演示的编程语言以及用于创建和调试过程的工具。 Microsoft 支持工程师可以帮助解释特定过程的功能,但他们不会修改这些示例以提供新增功能或构建步骤以满足你的特定需要。
注意 在安装此修补程序之前,请验证所有 Microsoft Navision 客户端用户是否已从系统注销。 这包括 Microsoft Navision Application Services (NAS) 客户端用户。 实现此修补程序时,应是唯一登录的客户端用户。
若要实现此修补程序,必须具有开发人员许可证。
建议为 Windows 登录窗口或数据库登录名窗口中的用户帐户分配“SUPER”角色 ID。 如果无法为用户帐户分配“SUPER”角色 ID,则必须验证该用户帐户是否具有以下权限:
- 要更改的 对象的“修改”权限。
- 系统对象 ID 5210 对象和系统对象 ID 9015 对象的 Execute 权限。
注意 除非必须执行数据修复,否则您不必拥有数据存储的权限。
代码更改
注意 在将修补程序应用到生产计算机之前,始终在受控环境中测试代码修复。
要解决此问题,请按照下列步骤操作:
将 VAT 条目表中的全局变量 (254) 中的代码更改,如下所示:
现有代码... GLSetupRead@1004 : Boolean; VATPostingSetup@1100000 : Record 325; ...替换代码
... GLSetupRead@1004 : Boolean; // Add the following line. IsBillDoc@1100001 : Boolean; VATPostingSetup@1100000 : Record 325; ...更改 VAT 条目表中 GetUnRealizedVATPart 函数中的代码 (254) ,如下所示:
现有代码... UnrealizedVatType::Percentage: // Delete the following line. EXIT(ABS(SettledAmount) / (ABS(Full) - (ABS(Paid) - ABS(SettledAmount)))); UnrealizedVatType::First: ...替换代码
... UnrealizedVatType::Percentage: // Add the following lines. BEGIN IF IsBillDoc THEN EXIT(ABS(SettledAmount) / ABS(Full)); EXIT(ABS(SettledAmount) / (ABS(Full) - (ABS(Paid) - ABS(SettledAmount)))); END; // End of the lines. UnrealizedVatType::First: ...在 VAT 条目表中 (254) 添加新过程,如下所示:
PROCEDURE SetBillDoc@1100000(NewIsBillDoc@1100000 : Boolean); BEGIN IsBillDoc := NewIsBillDoc; END;更改“Gen”中的 CustUnrealizedVAT 函数中的代码。 Jnl.-Post Line“codeunit (12) 如下所示:
现有代码 1... END; // Delete the following lines. IF CustLedgEntry4."Document Type" = CustLedgEntry4."Document Type"::Bill THEN VATPart := VATEntry2.GetUnRealizedVATPart( ROUND(SettledAmount / CustLedgEntry3.GetOriginalCurrencyFactor), PaidAmount, CustLedgEntry3."Original Amt. (LCY)", TotalUnrealVATAmountFirst, TotalUnrealVATAmountLast) ELSE VATPart := VATEntry2.GetUnRealizedVATPart( ROUND(SettledAmount / CustLedgEntry2.GetOriginalCurrencyFactor), PaidAmount, CustLedgEntry2."Original Amt. (LCY)", TotalUnrealVATAmountFirst, TotalUnrealVATAmountLast); // End of the lines. ...替换代码 1
... END; // Add the following lines. VATEntry2.SetBillDoc(IsCustBillDoc(CustLedgEntry4)); VATPart := VATEntry2.GetUnRealizedVATPart( GetCustSettledAmount(SettledAmount,CustLedgEntry4,CustLedgEntry3,CustLedgEntry2), PaidAmount, GetCustOriginalAmtLCY(CustLedgEntry4,CustLedgEntry3,CustLedgEntry2), TotalUnrealVATAmountFirst, TotalUnrealVATAmountLast); // End of the lines. ...现有代码 2
... VATBaseAddCurr := VATEntry2."Add.-Curr. Rem. Unreal. Base"; // Delete the following lines. END ELSE BEGIN VATAmount := ROUND(VATEntry2."Unrealized Amount" * VATPart); VATBase := ROUND(VATEntry2."Unrealized Base" * VATPart); VATAmountAddCurr := ROUND( VATEntry2."Add.-Currency Unrealized Amt." * VATPart, AddCurrency."Amount Rounding Precision"); VATBaseAddCurr := ROUND( VATEntry2."Add.-Currency Unrealized Base" * VATPart, AddCurrency."Amount Rounding Precision"); END; // End of the lines. ...替换代码 2
... VATBaseAddCurr := VATEntry2."Add.-Curr. Rem. Unreal. Base"; // Add the following lines. END ELSE CalcCustRealizedVATAmt( VATBase,VATAmount, VATBaseAddCurr,VATAmountAddCurr, VATEntry2,CustLedgEntry4,VATPart); // End of the lines. ...更改“Gen”中的 VendUnrealizedVAT 函数中的代码。 Jnl.-Post Line“codeunit (12) 如下所示:
现有代码 1... IF VendLedgEntry3.FIND('-') THEN BEGIN VendLedgEntry2.Open := TRUE; ...替换代码 1
... IF VendLedgEntry3.FIND('-') THEN BEGIN // Add the following line. VendLedgEntry3.CALCFIELDS("Original Amt. (LCY)"); VendLedgEntry2.Open := TRUE; ...现有代码 2
... // Delete the following lines. VATPart := VATEntry2.GetUnRealizedVATPart( ROUND(SettledAmount / VendLedgEntry2.GetOriginalCurrencyFactor), PaidAmount, VendLedgEntry2."Original Amt. (LCY)", // End of the lines. TotalUnrealVATAmountFirst, ...替换代码 2
... // Add the following lines. VATEntry2.SetBillDoc(IsVendBillDoc(VendLedgEntry4)); VATPart := VATEntry2.GetUnRealizedVATPart( GetVendSettledAmount(SettledAmount,VendLedgEntry4,VendLedgEntry3,VendLedgEntry2), PaidAmount, GetVendOriginalAmtLCY(VendLedgEntry4,VendLedgEntry3,VendLedgEntry2), // End of the lines. TotalUnrealVATAmountFirst, ...现有代码 3
... VATBaseAddCurr := VATEntry2."Add.-Curr. Rem. Unreal. Base"; // Delete the following lines. END END ELSE BEGIN VATAmount := ROUND(VATEntry2."Remaining Unrealized Amount" * VATPart); VATBase := ROUND(VATEntry2."Remaining Unrealized Base" * VATPart); VATAmountAddCurr := ROUND( VATEntry2."Add.-Curr. Rem. Unreal. Amount" * VATPart, AddCurrency."Amount Rounding Precision"); VATBaseAddCurr := ROUND( VATEntry2."Add.-Curr. Rem. Unreal. Base" * VATPart, AddCurrency."Amount Rounding Precision"); END; // End of the lines. ...替换代码 3
... VATBaseAddCurr := VATEntry2."Add.-Curr. Rem. Unreal. Base"; // Add the following lines. END; END ELSE CalcVendRealizedVATAmt( VATBase,VATAmount, VATBaseAddCurr,VATAmountAddCurr, VATEntry2,VendLedgEntry4,VATPart); // End of the lines. ...在“Gen”中添加以下新的本地过程。 Jnl.-Post Line“codeunit (12) 如下所示:
LOCAL PROCEDURE GetVendOriginalAmtLCY@1100004(VendLedgEntry4@1100001 : Record 25;VendLedgEntry3@1100002 : Record 25;VendLedgEntry2@1100000 : Record 25) : Decimal; BEGIN WITH VendLedgEntry4 DO BEGIN IF IsVendBillDoc(VendLedgEntry4) THEN EXIT(VendLedgEntry3."Original Amt. (LCY)"); EXIT(VendLedgEntry2."Original Amt. (LCY)"); END; END; LOCAL PROCEDURE GetCustOriginalAmtLCY@1100010(CustLedgEntry4@1100001 : Record 21;CustLedgEntry3@1100002 : Record 21;CustLedgEntry2@1100000 : Record 21) : Decimal; BEGIN WITH CustLedgEntry4 DO BEGIN IF IsCustBillDoc(CustLedgEntry4) THEN EXIT(CustLedgEntry3."Original Amt. (LCY)"); EXIT(CustLedgEntry2."Original Amt. (LCY)"); END; END; LOCAL PROCEDURE GetVendSettledAmount@1100014(SettledAmt@1100000 : Decimal;VendLedgEntry4@1100003 : Record 25;VendLedgEntry3@1100002 : Record 25;VendLedgEntry2@1100001 : Record 25) : Decimal; BEGIN WITH VendLedgEntry4 DO BEGIN IF IsVendBillDoc(VendLedgEntry4) THEN EXIT(ROUND(SettledAmt / VendLedgEntry3.GetOriginalCurrencyFactor)); EXIT(ROUND(SettledAmt / VendLedgEntry2.GetOriginalCurrencyFactor)); END; END; LOCAL PROCEDURE GetCustSettledAmount@1100019(SettledAmt@1100003 : Decimal;CustLedgEntry4@1100002 : Record 21;CustLedgEntry3@1100001 : Record 21;CustLedgEntry2@1100000 : Record 21) : Decimal; BEGIN WITH CustLedgEntry4 DO BEGIN IF IsCustBillDoc(CustLedgEntry4) THEN EXIT(ROUND(SettledAmt / CustLedgEntry3.GetOriginalCurrencyFactor)); EXIT(ROUND(SettledAmt / CustLedgEntry2.GetOriginalCurrencyFactor)); END; END; LOCAL PROCEDURE IsVendBillDoc@1100015(VendLedgEntry4@1100000 : Record 25) : Boolean; BEGIN WITH VendLedgEntry4 DO EXIT("Document Type" = "Document Type"::Bill); END; LOCAL PROCEDURE IsCustBillDoc@1100016(CustLedgEntry4@1100000 : Record 21) : Boolean; BEGIN WITH CustLedgEntry4 DO EXIT("Document Type" = "Document Type"::Bill); END; LOCAL PROCEDURE CalcVendRealizedVATAmt@1100032(VAR VATBase@1100001 : Decimal;VAR VATAmount@1100000 : Decimal;VAR VATBaseAddCurr@1100005 : Decimal;VAR VATAmountAddCurr@1100006 : Decimal;VATEntry2@1100002 : Record 254;VendLedgEntry4@1100003 : Record 25;VATPart@1100004 : Decimal); BEGIN CalcRealizedVATAmt( VATBase,VATAmount, VATBaseAddCurr,VATAmountAddCurr, VATEntry2, IsVendBillDoc(VendLedgEntry4), VATPart); END; LOCAL PROCEDURE CalcCustRealizedVATAmt@1100029(VAR VATBase@1100001 : Decimal;VAR VATAmount@1100000 : Decimal;VAR VATBaseAddCurr@1100006 : Decimal;VAR VATAmountAddCurr@1100005 : Decimal;VATEntry2@1100002 : Record 254;CustLedgEntry4@1100003 : Record 21;VATPart@1100004 : Decimal); BEGIN CalcRealizedVATAmt( VATBase,VATAmount, VATBaseAddCurr,VATAmountAddCurr, VATEntry2, IsCustBillDoc(CustLedgEntry4), VATPart); END; LOCAL PROCEDURE CalcRealizedVATAmt@1100036(VAR VATBase@1100002 : Decimal;VAR VATAmount@1100001 : Decimal;VAR VATBaseAddCurr@1100008 : Decimal;VAR VATAmountAddCurr@1100007 : Decimal;VATEntry2@1100003 : Record 254;UseUnrealAmt@1100000 : Boolean;VATPart@1100004 : Decimal); VAR UnrealAmt@1100006 : Decimal; UnrealBase@1100005 : Decimal; UnrealAmtACY@1100009 : Decimal; UnrealBaseACY@1100010 : Decimal; BEGIN WITH VATEntry2 DO IF UseUnrealAmt THEN BEGIN UnrealAmt := "Unrealized Amount"; UnrealBase := "Unrealized Base"; UnrealAmtACY := "Add.-Currency Unrealized Amt."; UnrealBaseACY := "Add.-Currency Unrealized Base"; END ELSE BEGIN UnrealAmt := "Remaining Unrealized Amount"; UnrealBase := "Remaining Unrealized Base"; UnrealAmtACY := "Add.-Curr. Rem. Unreal. Amount"; UnrealBaseACY := "Add.-Curr. Rem. Unreal. Base"; END; VATAmount := ROUND(UnrealAmt * VATPart); VATBase := ROUND(UnrealBase * VATPart); VATAmountAddCurr := ROUND(UnrealAmtACY * VATPart,AddCurrency."Amount Rounding Precision"); VATBaseAddCurr := ROUND(UnrealBaseACY * VATPart,AddCurrency."Amount Rounding Precision"); END;
先决条件
必须安装以下产品之一才能应用此修补程序:
- Microsoft Dynamics NAV 2009 R2 的西班牙语版本
- Microsoft Dynamics NAV 2009 SP1 的西班牙语版本
删除信息
无法删除此修补程序。
详细信息
有关与 VAT 条目中未实现的增值税相关的问题的详细信息,请单击以下文章编号以查看Microsoft知识库中的文章:
2664615 在西班牙语版本的 Microsoft Dynamics NAV 2009 中发布应用程序时,增值税条目中的金额不正确
状态
Microsoft 已确认在 "适用于" 部分中所列的 Microsoft 产品中存在问题。
注意这是一篇由 Microsoft 支持组织直接创建的“快速发布”文章。 本文所包含的信息是按原样提供的,以应对新出现的问题。 由于发布速度较快,这些材料可能包含印刷错误,无需通知即可随时修改。 有关其他注意事项,请参阅使用条款。