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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 04.03.2019, 17:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
a33ik: Adjust tax value using X++ code
Источник: http://daxonline.org/1641-adjust-tax...ng-x-code.html
==============

Adjust tax value of purchase invoice. commonLine could be either MarkupTrans or VendInvoiceInfoLine.
static void VKTaxRegulation(Args _args){ PurchTotals purchTotals; TaxPurch taxPurch; VendInvoiceInfoTable vendInvoiceInfoTable; MarkupTrans commonLine; //VendInvoiceInfoLine commonLine; TaxRegulation taxRegulation; select firstOnly vendInvoiceInfoTable where vendInvoiceInfoTable.Num == "VKTest10"; purchTotals = PurchTotals::newParmTable( vendInvoiceInfoTable, PurchUpdate::All, AccountOrder::None, vendInvoiceInfoTable.ParmId, '', vendInvoiceInfoTable.Ordering); purchTotals.calc(); taxPurch = purchTotals.tax(); select commonLine where commonLine.RecId == 5637172328; taxRegulation = TaxRegulation::newTaxRegulation( taxPurch, null, commonLine.TableId, commonLine.RecId ); taxRegulation.allocateAmount(22); taxRegulation.saveTaxRegulation(); info('done');}


Adjust tax value for purchase order:static void VKTaxRegulationPO(Args _args){ PurchTable purchTable; PurchLine purchLine; TaxRegulation taxRegulation; purchTable = PurchTable::find('VK-001113'); purchLine = PurchLine::find('VK-001113'); taxRegulation = TaxRegulation::newTaxRegulation( PurchTotals::getTax(purchTable), null, tableNum(PurchLine), purchLine.RecId ); if(taxRegulation) { taxRegulation.allocateAmount(12); taxRegulation.saveTaxRegulation(); }}

In order to process VAT adjustments at line level, the country region should be added to the list of Consolidation Countries.
\Classes\SysCountryRegionCode\isLegalEntityInConsolidatedCountryRegion








Источник: http://daxonline.org/1641-adjust-tax...ng-x-code.html
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
dynamicsaxse: November 2018 Release – Dynamics AX2012 R3 update Blog bot DAX Blogs 0 15.11.2018 09:11
Microsoft Dynamics CRM Team Blog: Check your JavaScript code to prepare for your upgrade Blog bot Dynamics CRM: Blogs 0 24.08.2013 04:19
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23
Вопрос про Demand Planner slava09 DAX: Функционал 4 25.09.2006 11:43
при построении перекрёстных ссылок выдаётся сообщение об ошибках mmmax DAX: Программирование 10 21.01.2005 12:42
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

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