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
diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py
index d1c42b8..d1a75a9 100644
--- a/erpnext/controllers/taxes_and_totals.py
+++ b/erpnext/controllers/taxes_and_totals.py
@@ -164,9 +164,10 @@
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