From 2bf405d44ca23bb25dfeb9e5b51be42128dd7cd8 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 24 Jan 2022 15:59:38 +0530 Subject: [PATCH] fix:Add shipping charges to taxes only if applicable (cherry picked from commit e8bc4f12a734ff286a008e6b31dffa9c6c946365) --- erpnext/accounts/doctype/shipping_rule/shipping_rule.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py index 7e5129911e..792e7d21a7 100644 --- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py @@ -71,7 +71,8 @@ class ShippingRule(Document): if doc.currency != doc.company_currency: shipping_amount = flt(shipping_amount / doc.conversion_rate, 2) - self.add_shipping_rule_to_tax_table(doc, shipping_amount) + if shipping_amount: + self.add_shipping_rule_to_tax_table(doc, shipping_amount) def get_shipping_amount_from_rules(self, value): for condition in self.get("conditions"):