Skip to content

Commit

Permalink
fix: fetch tax lines within the shipping lines (#22138) (#22140)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3031128)

Co-authored-by: Mangesh-Khairnar <mkhairnar10@gmail.com>
  • Loading branch information
mergify[bot] and Mangesh-Khairnar committed Jun 7, 2020
1 parent 348d10c commit 2382312
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions erpnext/erpnext_integrations/connectors/shopify_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,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

Expand Down

0 comments on commit 2382312

Please sign in to comment.