mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
fixed get_server_values to make them utf-8 friendly
This commit is contained in:
@@ -72,16 +72,6 @@ cur_frm.fields_dict['master_name'].get_query=function(doc){
|
||||
else alert("Please select master type");
|
||||
}
|
||||
|
||||
/*
|
||||
// Get customer/supplier address
|
||||
// -----------------------------------------
|
||||
cur_frm.cscript.master_name = function(doc,cdt,cdn){
|
||||
if(doc.master_name){
|
||||
get_server_fields('get_address','','',doc,cdt,cdn);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// parent account get query
|
||||
// -----------------------------------------
|
||||
cur_frm.fields_dict['parent_account'].get_query = function(doc){
|
||||
|
||||
@@ -31,7 +31,7 @@ class DocType:
|
||||
ret = {
|
||||
'company_abbr' : abbr
|
||||
}
|
||||
return cstr(ret)
|
||||
return ret
|
||||
|
||||
def validate(self):
|
||||
# Cost Center name must be unique
|
||||
|
||||
@@ -39,7 +39,7 @@ class DocType(TransactionBase):
|
||||
'company_address': cstr(comp_det[0][0]),
|
||||
'registration_details': cstr(comp_det[0][1])
|
||||
}
|
||||
return cstr(ret)
|
||||
return ret
|
||||
|
||||
# Get party details
|
||||
#------------------
|
||||
|
||||
@@ -38,9 +38,9 @@ class DocType:
|
||||
args = eval(args)
|
||||
o_s = sql("select outstanding_amount from `tab%s` where name = '%s'" % (args['doctype'],args['docname']))
|
||||
if args['doctype'] == 'Payable Voucher':
|
||||
return cstr({'debit': o_s and flt(o_s[0][0]) or 0})
|
||||
return {'debit': o_s and flt(o_s[0][0]) or 0}
|
||||
if args['doctype'] == 'Receivable Voucher':
|
||||
return cstr({'credit': o_s and flt(o_s[0][0]) or 0})
|
||||
return {'credit': o_s and flt(o_s[0][0]) or 0}
|
||||
|
||||
#--------------------------------------------------------------------------------------------------------
|
||||
# Create remarks
|
||||
|
||||
@@ -48,14 +48,14 @@ class DocType(TransactionBase):
|
||||
ret['due_date'] = add_days(cstr(self.doc.posting_date), acc_head and cint(acc_head[0][1]) or 0)
|
||||
elif not acc_head:
|
||||
msgprint("%s does not have an Account Head in %s. You must first create it from the Supplier Master" % (self.doc.supplier, self.doc.company))
|
||||
return cstr(ret)
|
||||
return ret
|
||||
|
||||
def get_cust(self):
|
||||
ret = {}
|
||||
if self.doc.credit_to:
|
||||
ret['supplier'] = get_value('Account',self.doc.credit_to,'master_name')
|
||||
|
||||
return cstr(ret)
|
||||
return ret
|
||||
|
||||
|
||||
# Get Default Cost Center and Expense Head from Item Master
|
||||
@@ -70,7 +70,7 @@ class DocType(TransactionBase):
|
||||
if not args['cost_center'] or args['cost_center'] == 'undefined':
|
||||
cost_center = sql("select cost_center from `tabItem` where name = '%s'" % args['item_code'])
|
||||
ret['cost_center'] = cost_center and cost_center[0][0] or ''
|
||||
return cstr(ret)
|
||||
return ret
|
||||
|
||||
|
||||
# Get Items based on PO or PR
|
||||
@@ -115,7 +115,7 @@ class DocType(TransactionBase):
|
||||
'cost_center' : item_det and item_det[0]['cost_center'] or '',
|
||||
'item_tax_rate' : str(t)
|
||||
}
|
||||
return cstr(ret)
|
||||
return ret
|
||||
|
||||
# Advance Allocation
|
||||
# -------------------
|
||||
@@ -139,7 +139,7 @@ class DocType(TransactionBase):
|
||||
def get_rate1(self,acc):
|
||||
rate = sql("select tax_rate from `tabAccount` where name='%s'"%(acc))
|
||||
ret={'add_tax_rate' :rate and flt(rate[0][0]) or 0 }
|
||||
return cstr(ret)
|
||||
return ret
|
||||
|
||||
|
||||
# *************************** Server Utility Functions *****************************
|
||||
|
||||
@@ -90,7 +90,7 @@ class DocType(TransactionBase):
|
||||
def get_debit_to(self):
|
||||
acc_head = self.get_customer_account()
|
||||
if acc_head:
|
||||
return cstr({ 'debit_to' : acc_head })
|
||||
return { 'debit_to' : acc_head }
|
||||
|
||||
|
||||
# Set Due Date = Posting Date + Credit Days
|
||||
@@ -515,7 +515,7 @@ class DocType(TransactionBase):
|
||||
ret = {
|
||||
'actual_qty' : actual_qty and flt(actual_qty[0]['actual_qty']) or 0
|
||||
}
|
||||
return cstr(ret)
|
||||
return ret
|
||||
|
||||
# Make GL Entries
|
||||
# -------------------------
|
||||
|
||||
@@ -34,7 +34,7 @@ class DocType:
|
||||
else:
|
||||
ret = { 'registration_details': cstr(comp_det[0][0])}
|
||||
|
||||
return cstr(ret)
|
||||
return ret
|
||||
|
||||
# Get default bank and tds account
|
||||
#------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user