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