[aii] [patches] minor fixes

This commit is contained in:
Anand Doshi
2013-03-29 20:40:23 +05:30
parent 96a5f1dda0
commit 19acce9fa1
9 changed files with 42 additions and 11 deletions

View File

@@ -212,7 +212,8 @@ class DocType(TransactionBase):
# ***************** Get Ref rate as entered in Item Master ********************
def get_ref_rate(self, item_code, price_list_name, price_list_currency, plc_conv_rate):
ref_rate = webnotes.conn.sql("select ref_rate from `tabItem Price` where parent = %s and price_list_name = %s and ref_currency = %s", (item_code, price_list_name, price_list_currency))
ref_rate = webnotes.conn.sql("select ref_rate from `tabItem Price` where parent = %s and price_list_name = %s and ref_currency = %s and selling=1",
(item_code, price_list_name, price_list_currency))
base_ref_rate = ref_rate and flt(ref_rate[0][0]) * flt(plc_conv_rate) or 0
return base_ref_rate