Im folgenden Beispiel möchte ich zeigen, wie der „item tax amount“ berechnet wird:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ### order_item datas ### qty_ordered -- 5 row_total_incl_tax -- 171.0000 discount_amount -- 17.1000 discount_percent -- 10% price_incl_tax -- 34.2000 tax_percent -- 19% ### order_item table ### //tax (price_incl_tax - discount_amount) / ((tax_percent/10)+1) = netto (price_incl_tax - discount_amount) - netto = tax_amount //tax example 171 - ((171/100)*10) = 153,9 // if discount 153,9 / 1,19 = 129,3277 // to netto 129,3277 - 153,9 = 24.57 // tax_amount five 34,20 - ((34,20/100)*10) = 30,78 // if discount 30,78 / 1,19 = 25,8655 // to netto 30,78 - 25,8655 = 4,9145 // tax_amount one //row_total row_total_incl_tax / ((tax_percent/100)+1) = row_total ### order table ### ((price_incl_tax - discount_amount) of all positions) + shipping_amount = grand_total (tax_amount of all positions) + shipping_tax_amount = tax_amount |