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');
}

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();
}
}
\Classes\SysCountryRegionCode\isLegalEntityInConsolidatedCountryRegion
Support The Author
If you found value in what I share, I've set up a Buy Me a Coffee page as a way to show your support.
No comments. Be the first one to comment on this post.
DaxOnline.org is free platform that allows you to quickly store and reuse snippets, notes, articles related to Dynamics 365 FO.
Authors are allowed to set their own "buy me a coffee" link.
Join us.