fix: test cases for pricing rule
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index 452246e..1f50e9c 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -624,8 +624,8 @@
for d in get_applied_pricing_rules(item.pricing_rules):
pricing_rule = frappe.get_cached_doc('Pricing Rule', d)
- if (pricing_rule.margin_rate_or_amount and pricing_rule.currency == self.doc.currency and
- pricing_rule.margin_type in ['Amount', 'Percentage']):
+ if pricing_rule.margin_rate_or_amount and ((pricing_rule.currency == self.doc.currency and
+ pricing_rule.margin_type in ['Amount', 'Percentage']) or pricing_rule.margin_type == 'Percentage'):
item.margin_type = pricing_rule.margin_type
item.margin_rate_or_amount = pricing_rule.margin_rate_or_amount
has_margin = True