TaxGroupData

static TaxGroupData findTaxGroupData(    TaxGroup        _taxGroup,
                                            TaxItemGroup    _taxItemGroup,
                                            boolean         _update = false)
{
    TaxOnItem       taxOnItem;
    TaxGroupData    taxGroupData;
    ;
    taxGroupData.selectForUpdate(_update);
 
    while select taxCode
        from taxOnItem
        where taxOnItem.TaxItemGroup    == _taxItemGroup
    {
        select firstOnly taxGroupData
            where   taxGroupData.TaxGroup    == _taxGroup &&
                    taxGroupData.TaxCode           == taxOnItem.TaxCode;
 
        if(taxGroupData)
        {
            return taxGroupData;
        }
 
    }
    return taxGroupData;
}
Advertisements