fix: fetch tax lines within the shipping lines (#22138)

This commit is contained in:
Mangesh-Khairnar 2020-06-07 18:02:23 +05:30 committed by GitHub
parent c01b4aa2e5
commit 3031128167
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -241,14 +241,17 @@ def get_order_taxes(shopify_order, shopify_settings):
return taxes
def update_taxes_with_shipping_lines(taxes, shipping_lines, shopify_settings):
"""Shipping lines represents the shipping details,
each such shipping detail consists of a list of tax_lines"""
for shipping_charge in shipping_lines:
taxes.append({
"charge_type": _("Actual"),
"account_head": get_tax_account_head(shipping_charge),
"description": shipping_charge["title"],
"tax_amount": shipping_charge["price"],
"cost_center": shopify_settings.cost_center
})
for tax in shipping_charge.get("tax_lines"):
taxes.append({
"charge_type": _("Actual"),
"account_head": get_tax_account_head(tax),
"description": tax["title"],
"tax_amount": tax["price"],
"cost_center": shopify_settings.cost_center
})
return taxes