From 96639d76b2a75ffae7a2d0f520ec86aa0d080849 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 1 Mar 2012 18:11:27 +0530 Subject: [PATCH] fixed indentation issue for custom script --- .../doctype/sales_common/sales_common.py | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/erpnext/selling/doctype/sales_common/sales_common.py b/erpnext/selling/doctype/sales_common/sales_common.py index a5017c2ef0..a57c33d00b 100644 --- a/erpnext/selling/doctype/sales_common/sales_common.py +++ b/erpnext/selling/doctype/sales_common/sales_common.py @@ -32,6 +32,21 @@ convert_to_lists = webnotes.conn.convert_to_lists from utilities.transaction_base import TransactionBase + +@webnotes.whitelist() +def get_comp_base_currency(arg=None): + """ get default currency of company""" + return webnotes.conn.sql("select default_currency from `tabCompany` where name = %s", webnotes.form_dict['company'])[0][0] + +@webnotes.whitelist() +def get_price_list_currency(arg=None): + """ Get all currency in which price list is maintained""" + plc = webnotes.conn.sql("select distinct ref_currency from `tabRef Rate Detail` where price_list_name = %s", webnotes.form_dict['price_list']) + plc = [d[0] for d in plc] + base_currency = get_comp_base_currency(webnotes.form_dict['company']) + return plc, base_currency + + class DocType(TransactionBase): def __init__(self,d,dl): self.doc, self.doclist = d,dl @@ -770,16 +785,3 @@ class StatusUpdater: name="%(name)s" """ % args) - -@webnotes.whitelist() -def get_comp_base_currency(arg=None): - """ get default currency of company""" - return webnotes.conn.sql("select default_currency from `tabCompany` where name = %s", webnotes.form_dict['company'])[0][0] - -@webnotes.whitelist() -def get_price_list_currency(arg=None): - """ Get all currency in which price list is maintained""" - plc = webnotes.conn.sql("select distinct ref_currency from `tabRef Rate Detail` where price_list_name = %s", webnotes.form_dict['price_list']) - plc = [d[0] for d in plc] - base_currency = get_comp_base_currency(webnotes.form_dict['company']) - return plc, base_currency