'Get tax fraction for calculating tax exclusive amount
from tax inclusive amount'

def get_current_tax_fraction(self, tax, item_tax_map):

    current_tax_fraction = 0
    if cint(tax.included_in_print_rate):
        tax_rate = self._get_tax_rate(tax, item_tax_map)
        if (tax.charge_type == u'On    Net    Total'):
            current_tax_fraction = (tax_rate / 100.0)
        elif (tax.charge_type == u'On    Previous    Row    Amount'):
            current_tax_fraction = ((tax_rate / 100.0) * self.doc.get(u'taxes')[(cint(tax.row_id) - 1)].tax_fraction_for_current_item)
        elif (tax.charge_type == u'On    Previous    Row    Total'):
            current_tax_fraction = ((tax_rate / 100.0) * self.doc.get(u'taxes')[(cint(tax.row_id) - 1)].grand_total_fraction_for_current_item)
    if getattr(tax, u'add_deduct_tax', None):
        current_tax_fraction *= ((-1.0) if (tax.add_deduct_tax == u'Deduct') else 1.0)
    return current_tax_fraction
