Update project.py

This commit is contained in:
superlack 2017-02-24 12:33:59 -08:00 committed by GitHub
parent 868ef7738f
commit f800892ec3

View File

@ -178,8 +178,8 @@ class Project(Document):
self.total_purchase_cost = total_purchase_cost and total_purchase_cost[0][0] or 0
def update_sales_costing(self):
total_sales_cost = frappe.db.sql("""select sum(base_net_amount)
from `tabSales Order Item` where project = %s and docstatus=1""", self.name)
total_sales_cost = frappe.db.sql("""select sum(total)
from `tabSales Order` where project = %s and docstatus=1""", self.name)
self.total_sales_cost = total_sales_cost and total_sales_cost[0][0] or 0