(self)
return taxes_dict, tax_amount, not_in_amount_total
Get the taxes for purchase invoices.

        :param self:  Single invoice record.
Get the taxes for purchase invoices.
Get the taxes for purchase invoices .
def _get_sii_in_taxes(self):
        """Get the taxes for purchase invoices.

        :param self:  Single invoice record.
        """
        self.ensure_one()
        taxes_dict = {}
        taxes_sfrs = self._get_sii_taxes_map(["SFRS"])
        taxes_sfrsa = self._get_sii_taxes_map(["SFRSA"])
        taxes_sfrisp = self._get_sii_taxes_map(["SFRISP"])
        taxes_sfrns = self._get_sii_taxes_map(["SFRNS"])
        taxes_sfrnd = self._get_sii_taxes_map(["SFRND"])
        taxes_not_in_total = self._get_sii_taxes_map(["NotIncludedInTotal"])
        taxes_not_in_total_neg = self._get_sii_taxes_map(["NotIncludedInTotalNegative"])
        base_not_in_total = self._get_sii_taxes_map(["BaseNotIncludedInTotal"])
        tax_amount = 0.0
        not_in_amount_total = 0.0
        tax_lines = self._get_tax_info()
        for tax_line in tax_lines.values():
            tax = tax_line["tax"]
            if tax in taxes_not_in_total:
                not_in_amount_total += tax_line["amount"]
            elif tax in taxes_not_in_total_neg:
                not_in_amount_total -= tax_line["amount"]
            elif tax in base_not_in_total:
                not_in_amount_total += tax_line["base"]
            if tax in taxes_sfrisp:
                base_dict = taxes_dict.setdefault(
                    "InversionSujetoPasivo",
                    {"DetalleIVA": []},
                )
            elif tax in taxes_sfrs + taxes_sfrns + taxes_sfrsa + taxes_sfrnd:
                base_dict = taxes_dict.setdefault("DesgloseIVA", {"DetalleIVA": []})
            else:
                continue
            tax_dict = self._get_sii_tax_dict(tax_line, tax_lines)
            if tax in taxes_sfrisp + taxes_sfrs:
                tax_amount += tax_line["amount"]
            if tax in taxes_sfrns:
                tax_dict.pop("TipoImpositivo")
                tax_dict.pop("CuotaSoportada")
                base_dict["DetalleIVA"].append(tax_dict)
            elif tax in taxes_sfrsa:
                tax_dict["PorcentCompensacionREAGYP"] = tax_dict.pop("TipoImpositivo")
                tax_dict["ImporteCompensacionREAGYP"] = tax_dict.pop("CuotaSoportada")
                base_dict["DetalleIVA"].append(tax_dict)
            else:
                if not self._merge_tax_dict(
                    base_dict["DetalleIVA"],
                    tax_dict,
                    "TipoImpositivo",
                    ["BaseImponible", "CuotaSoportada"],
                ):
                    base_dict["DetalleIVA"].append(tax_dict)
        return taxes_dict, tax_amount, not_in_amount_total
def _get_sii_in_taxes ( self ) : self . ensure_one ( ) taxes_dict = { } taxes_sfrs = self . _get_sii_taxes_map ( [ "SFRS" ] ) taxes_sfrsa = self . _get_sii_taxes_map ( [ "SFRSA" ] ) taxes_sfrisp = self . _get_sii_taxes_map ( [ "SFRISP" ] ) taxes_sfrns = self . _get_sii_taxes_map ( [ "SFRNS" ] ) taxes_sfrnd = self . _get_sii_taxes_map ( [ "SFRND" ] ) taxes_not_in_total = self . _get_sii_taxes_map ( [ "NotIncludedInTotal" ] ) taxes_not_in_total_neg = self . _get_sii_taxes_map ( [ "NotIncludedInTotalNegative" ] ) base_not_in_total = self . _get_sii_taxes_map ( [ "BaseNotIncludedInTotal" ] ) tax_amount = 0.0 not_in_amount_total = 0.0 tax_lines = self . _get_tax_info ( ) for tax_line in tax_lines . values ( ) : tax = tax_line [ "tax" ] if tax in taxes_not_in_total : not_in_amount_total += tax_line [ "amount" ] elif tax in taxes_not_in_total_neg : not_in_amount_total -= tax_line [ "amount" ] elif tax in base_not_in_total : not_in_amount_total += tax_line [ "base" ] if tax in taxes_sfrisp : base_dict = taxes_dict . setdefault ( "InversionSujetoPasivo" , { "DetalleIVA" : [ ] } , ) elif tax in taxes_sfrs + taxes_sfrns + taxes_sfrsa + taxes_sfrnd : base_dict = taxes_dict . setdefault ( "DesgloseIVA" , { "DetalleIVA" : [ ] } ) else : continue tax_dict = self . _get_sii_tax_dict ( tax_line , tax_lines ) if tax in taxes_sfrisp + taxes_sfrs : tax_amount += tax_line [ "amount" ] if tax in taxes_sfrns : tax_dict . pop ( "TipoImpositivo" ) tax_dict . pop ( "CuotaSoportada" ) base_dict [ "DetalleIVA" ] . append ( tax_dict ) elif tax in taxes_sfrsa : tax_dict [ "PorcentCompensacionREAGYP" ] = tax_dict . pop ( "TipoImpositivo" ) tax_dict [ "ImporteCompensacionREAGYP" ] = tax_dict . pop ( "CuotaSoportada" ) base_dict [ "DetalleIVA" ] . append ( tax_dict ) else : if not self . _merge_tax_dict ( base_dict [ "DetalleIVA" ] , tax_dict , "TipoImpositivo" , [ "BaseImponible" , "CuotaSoportada" ] , ) : base_dict [ "DetalleIVA" ] . append ( tax_dict ) return taxes_dict , tax_amount , not_in_amount_total