//Resetting and Recalculating Tax amount for sales Order in DAX
static void San_Reset_RecalculateSalesTaxValue(Args _args)
{
SalesTable salesTable;
TaxRegulation taxRegulation;
SalesTotals salesTotals;
SalesId salesId ="";
;
salesTable = SalesTable::find(SalesId);
if (salesTable)
{
salesTotals = SalesTotals::construct(salesTable, SalesUpdate::All);
salesTotals.calc();
taxRegulation = TaxRegulation::newTaxRegulation(salesTotals.tax(), null,salestable.TableId, salestable.RecId);
if (taxRegulation.taxLinesExist())
{
taxRegulation.resetTaxRegulation();
taxRegulation.saveTaxRegulation();
info("Tax Amount resetted and recalculated for new lines");
}
}
}
static void San_Reset_RecalculateSalesTaxValue(Args _args)
{
SalesTable salesTable;
TaxRegulation taxRegulation;
SalesTotals salesTotals;
SalesId salesId ="";
;
salesTable = SalesTable::find(SalesId);
if (salesTable)
{
salesTotals = SalesTotals::construct(salesTable, SalesUpdate::All);
salesTotals.calc();
taxRegulation = TaxRegulation::newTaxRegulation(salesTotals.tax(), null,salestable.TableId, salestable.RecId);
if (taxRegulation.taxLinesExist())
{
taxRegulation.resetTaxRegulation();
taxRegulation.saveTaxRegulation();
info("Tax Amount resetted and recalculated for new lines");
}
}
}
No comments:
Post a Comment