2017-06-16 06:43:51 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
import frappe
|
|
|
|
|
|
|
|
def execute():
|
2017-12-14 06:51:00 +00:00
|
|
|
frappe.reload_doc("projects", "doctype", "project")
|
|
|
|
|
2017-06-16 06:43:51 +00:00
|
|
|
frappe.db.sql("""
|
|
|
|
update `tabProject` p
|
2017-12-14 06:51:00 +00:00
|
|
|
set total_sales_amount = ifnull((select sum(base_grand_total)
|
2017-11-16 08:37:55 +00:00
|
|
|
from `tabSales Order` where project=p.name and docstatus=1), 0)
|
2017-11-17 06:42:34 +00:00
|
|
|
""")
|