2013-08-05 09:29:54 +00:00
|
|
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
|
|
|
|
# License: GNU General Public License v3. See license.txt
|
|
|
|
|
2013-05-10 12:38:32 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
import webnotes
|
2013-05-21 14:05:06 +00:00
|
|
|
from webnotes.utils import cint
|
2013-05-10 12:38:32 +00:00
|
|
|
|
|
|
|
def execute():
|
|
|
|
for module, doctype in (("Accounts", "Sales Invoice"), ("Selling", "Sales Order"), ("Selling", "Quotation"),
|
|
|
|
("Stock", "Delivery Note")):
|
|
|
|
webnotes.reload_doc(module, "DocType", doctype)
|
|
|
|
webnotes.conn.sql("""update `tab%s`
|
2013-05-21 14:05:06 +00:00
|
|
|
set net_total_export = round(net_total / if(conversion_rate=0, 1, ifnull(conversion_rate, 1)), 2),
|
|
|
|
other_charges_total_export = round(grand_total_export - net_total_export, 2)""" %
|
|
|
|
(doctype,))
|
|
|
|
|
|
|
|
for module, doctype in (("Accounts", "Sales Invoice Item"), ("Selling", "Sales Order Item"), ("Selling", "Quotation Item"),
|
|
|
|
("Stock", "Delivery Note Item")):
|
|
|
|
webnotes.reload_doc(module, "DocType", doctype)
|