Thursday, June 22, 2023

How to get sales tax and Purch tax percentage X++

private TaxValue getTaxPercent(TaxGroup _taxGroup, TaxItemGroup _taxItemGroup)

{

    TaxGroupData    taxGroupData ;

    TaxOnItem       taxOnItem;

    TaxData         taxData;


    select firstonly TaxCode from taxGroupData

        index hint TaxGroupIdx

            where taxGroupData.TaxGroup == _taxGroup

            join taxOnItem

            where taxOnItem.TaxItemGroup == _taxItemGroup &&

                    taxOnItem.TaxCode == taxGroupData.TaxCode;


    select firstonly TaxValue from taxData where taxData.TaxCode == taxGroupData.TaxCode;

    return taxData.TaxValue;


ref

}

No comments:

Post a Comment