Total Quantity in Sales and Purchase DocTypes (#14114)

* Add  field to all sales and purchase doctypes

* Add patch to update existing records

* Modify taxes_and_totals.py
This commit is contained in:
Shreya Shah
2018-05-28 11:49:08 +05:30
committed by Nabin Hait
parent 3eb235a53b
commit e329038aaa
11 changed files with 287 additions and 12 deletions

View File

@@ -164,9 +164,10 @@ class calculate_taxes_and_totals(object):
return tax.rate
def calculate_net_total(self):
self.doc.total = self.doc.base_total = self.doc.net_total = self.doc.base_net_total = 0.0
self.doc.total_qty = self.doc.total = self.doc.base_total = self.doc.net_total = self.doc.base_net_total = 0.0
for item in self.doc.get("items"):
self.doc.total += item.amount
self.doc.total_qty += item.qty
self.doc.base_total += item.base_amount
self.doc.net_total += item.net_amount
self.doc.base_net_total += item.base_net_amount