AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
DAX
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 21.02.2024, 07:35   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Project intercompany invoice sales tax calculation bug in 10.0.37
Источник: http://alexvoy.blogspot.com/2024/02/...sales-tax.html
==============

While Microsoft working on this issue, let me show you how you can fix it in the current code running on 10.0.37 or lower.

Scenario

When using the project intercompany customer invoice form in Project management and accounting module , you can create a customer invoice to bill to an intercompany customer. As the customer is intercompany, there is a legal entity (LE) associated with that customer. When posting the intercompany customer invoice, a pending vendor invoice is created in the customer’s LE with the same lines from the customer invoice.




You can see calculated Sales taxes via Sales tax button































Issue


If you try to add more lines, it will be added with line number 1, and sales taxes won't be added with this newly added line. Note: If you delete any line here and then you add more, it works fine.


This bug leads to missed taxes transactions in all TaxUncommitted, TmpTaxWorkTrans, and eventually in TaxTrans tables


Fix


Create an extension class with the following code












[ExtensionOf(classStr(ProjIntercompanyCustomerInvoiceCreator))]final class mgcProjIntercompanyCustomerInvoiceCreator_Extension{ /// /// Creates a customer invoice. /// On top of standard we have to delete uncommitted taxes /// /// /// The CustInvoiceTable that was created. /// public CustInvoiceTable createInvoice() { // we need to increase the next line number to avoid duplicates in case when new lines added to initially created ones lineNum = this.mgcGetNextLineNum(); custInvoiceTable = next createInvoice(); // It is a bug presented in 10.0.37, which leads to missed taxes transactions in all TaxUncommitted, TmpTaxWorkTrans, and eventually in TaxTrans tables. // So, once any line added here, we have to delete all uncommitted tax records for the current invoice // because the standard form method for that is not triggered if(origTransList.elements()) { TaxUncommitted::deleteForDocumentHeader(tableNum(CustInvoiceTable), custInvoiceTable.RecId); } return custInvoiceTable; } /// /// Returns the next number for line if the invoice exists already /// /// /// The next LineNum. /// public LineNum mgcGetNextLineNum() { CustInvoiceLine mgcCustInvoiceLine; // It is a bug presented in 10.0.37, which leads to creation new lines with the same line number. // Down the road it leads to wrong sales tax amount summarizing based on the line number in custInvoiceLine.displayTaxAmount() select maxof(lineNum) from mgcCustInvoiceLine where mgcCustInvoiceLine.ParentRecId == custInvoiceTable.RecId; return mgcCustInvoiceLine.LineNum + 1; }}



Источник: http://alexvoy.blogspot.com/2024/02/...sales-tax.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
dynamicsaxse: November 2017 Release – Dynamics AX 2012 R3 Blog bot DAX Blogs 0 08.12.2017 10:51
emeadaxsupport: Standard sales tax (IVA) percentage increases from 21% to 22% in Italy - possible setup Blog bot DAX Blogs 0 01.10.2013 00:12
dynamicsaxtraining: Purchase Blog bot DAX Blogs 0 11.03.2012 05:25
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 10:06.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.