mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 20:29:09 +00:00
fix: removed unused lines
This commit is contained in:
@@ -42,9 +42,6 @@ class Opportunity(TransactionBase):
|
|||||||
if not self.with_items:
|
if not self.with_items:
|
||||||
self.items = []
|
self.items = []
|
||||||
|
|
||||||
else:
|
|
||||||
self.calculate_totals()
|
|
||||||
|
|
||||||
def map_fields(self):
|
def map_fields(self):
|
||||||
for field in self.meta.fields:
|
for field in self.meta.fields:
|
||||||
if not self.get(field.fieldname):
|
if not self.get(field.fieldname):
|
||||||
@@ -54,20 +51,6 @@ class Opportunity(TransactionBase):
|
|||||||
except Exception:
|
except Exception:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
def calculate_totals(self):
|
|
||||||
total = base_total = 0
|
|
||||||
for item in self.get('items'):
|
|
||||||
item.amount = flt(item.rate) * flt(item.qty)
|
|
||||||
item.base_rate = flt(self.conversion_rate * item.rate)
|
|
||||||
item.base_amount = flt(self.conversion_rate * item.amount)
|
|
||||||
total += item.amount
|
|
||||||
base_total += item.base_amount
|
|
||||||
|
|
||||||
self.total = flt(total)
|
|
||||||
self.base_total = flt(base_total)
|
|
||||||
self.grand_total = flt(self.total) + flt(self.opportunity_amount)
|
|
||||||
self.base_grand_total = flt(self.base_total) + flt(self.base_opportunity_amount)
|
|
||||||
|
|
||||||
def make_new_lead_if_required(self):
|
def make_new_lead_if_required(self):
|
||||||
"""Set lead against new opportunity"""
|
"""Set lead against new opportunity"""
|
||||||
if (not self.get("party_name")) and self.contact_email:
|
if (not self.get("party_name")) and self.contact_email:
|
||||||
|
|||||||
Reference in New Issue
Block a user