[minor] renamed a Total Margin field to Rate With Margin (#8720)
* [minor] renamed a Total Margin field to Rate With Margin * [minor] minor fixes in field lable
This commit is contained in:
committed by
Nabin Hait
parent
734d7795f8
commit
0e4c5c9efb
@@ -59,10 +59,10 @@ class calculate_taxes_and_totals(object):
|
||||
(1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))
|
||||
|
||||
if item.doctype in ['Quotation Item', 'Sales Order Item', 'Delivery Note Item', 'Sales Invoice Item']:
|
||||
item.total_margin = self.calculate_margin(item)
|
||||
item.rate_with_margin = self.calculate_margin(item)
|
||||
|
||||
item.rate = flt(item.total_margin * (1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))\
|
||||
if item.total_margin > 0 else item.rate
|
||||
item.rate = flt(item.rate_with_margin * (1.0 - (item.discount_percentage / 100.0)), item.precision("rate"))\
|
||||
if item.rate_with_margin > 0 else item.rate
|
||||
|
||||
item.net_rate = item.rate
|
||||
item.amount = flt(item.rate * item.qty, item.precision("amount"))
|
||||
@@ -487,7 +487,7 @@ class calculate_taxes_and_totals(object):
|
||||
self.doc.precision("base_write_off_amount"))
|
||||
|
||||
def calculate_margin(self, item):
|
||||
total_margin = 0.0
|
||||
rate_with_margin = 0.0
|
||||
if item.price_list_rate:
|
||||
if item.pricing_rule and not self.doc.ignore_pricing_rule:
|
||||
pricing_rule = frappe.get_doc('Pricing Rule', item.pricing_rule)
|
||||
@@ -496,6 +496,6 @@ class calculate_taxes_and_totals(object):
|
||||
|
||||
if item.margin_type and item.margin_rate_or_amount:
|
||||
margin_value = item.margin_rate_or_amount if item.margin_type == 'Amount' else flt(item.price_list_rate) * flt(item.margin_rate_or_amount) / 100
|
||||
total_margin = flt(item.price_list_rate) + flt(margin_value)
|
||||
rate_with_margin = flt(item.price_list_rate) + flt(margin_value)
|
||||
|
||||
return total_margin
|
||||
return rate_with_margin
|
||||
|
||||
Reference in New Issue
Block a user