brotherton-erpnext/erpnext/patches/v8_0/update_sales_cost_in_project.py
Nabin Hait 84bc5601eb Total sales cost in Project should be updated based on base_grand_total (#9302)
* Total sales cost in Project should be updated based on base_grand_total

* Patch to update sales cost in Project in base currency
2017-06-16 12:13:51 +05:30

12 lines
368 B
Python

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.db.sql("""
update `tabProject` p
set total_sales_cost = (select sum(base_grand_total)
from `tabSales Order` where project=p.name and docstatus=1)
""")