def add_tax_details(self, tax_details, tax_rate, price, discount,
                        tax_amount):
        """
        Add tax details grouped by tax_rate. Especially useful if orders
        potentially use more than one tax class. These values are not used
        for the order total calculation -- they are only needed to show the
        tax amount for different tax rates if this is necessary for your
        invoices.

        - ``tax_details``: The tax details dict, most often stored as
          ``order.data['tax_details'] = tax_details.items()``
        - ``tax_rate``: The tax rate of the current entry
        - ``price``: The price excl. tax
        - ``discount``: The discount amount (will be subtracted from the
          price before applying the tax)
        - ``tax_amount``: The exact amount; a bit redundant because this
          could be calculated using the values above as well

        See the taxes documentation or the standard invoice PDF generation
        code if you need to know more about the use of these values.
        """

        zero = Decimal('0.00')
        discount = discount or zero

        row = tax_details.setdefault(tax_rate, {
            'prices': zero,
            'discounts': zero,
            'tax_rate': tax_rate,
            'tax_amount': zero,
            'total': zero,
            })
        row['prices'] += price
        row['discounts'] += discount
        row['tax_amount'] += tax_amount

        row['total'] += price - discount + tax_amount
dataset/ETHPy150Open matthiask/plata/plata/shop/processors.py/ProcessorBase.add_tax_details/original