Merge branch 'master' of github.com:webnotes/erpnext

This commit is contained in:
Nabin Hait 2012-07-31 12:08:00 +05:30
commit d8959bfecd
2 changed files with 1 additions and 22 deletions

View File

@ -69,17 +69,6 @@ cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
} }
doc.total_claimed_amount = flt(total_claim); doc.total_claimed_amount = flt(total_claim);
refresh_field('total_claimed_amount'); refresh_field('total_claimed_amount');
$c_obj(make_doclist(doc.doctype, doc.name),'validate_approver','', function(r,rt){
if(r.message){
if(r.message['valid_approver'] == 'No'){
doc.exp_approver ='';
}
get_field(doc.doctype, 'exp_approver' , doc.name).options = '';
get_field(doc.doctype, 'exp_approver' , doc.name).options = r.message['app_lst'];
refresh_field('exp_approver');
}
});
} }
else if(doc.approval_status == 'Submitted'){ else if(doc.approval_status == 'Submitted'){
var val = getchildren('Expense Claim Detail', doc.name, 'expense_voucher_details', doc.doctype); var val = getchildren('Expense Claim Detail', doc.name, 'expense_voucher_details', doc.doctype);

View File

@ -127,17 +127,7 @@ class DocType:
if not self.doc.exp_approver: if not self.doc.exp_approver:
msgprint("Please select Expense Claim approver") msgprint("Please select Expense Claim approver")
raise Exception raise Exception
def validate_approver(self):
app_lst = self.get_approver_lst()
if self.doc.exp_approver and self.doc.exp_approver not in app_lst:
msgprint("Approver "+self.doc.exp_approver+" is not authorized to approve this expense voucher. Please select another approver")
valid_app = 'No'
else:
valid_app = 'Yes'
ret = {'app_lst':("\n" + "\n".join(app_lst)), 'valid_approver':valid_app}
return ret
def on_submit(self): def on_submit(self):
self.validate_exp_details() self.validate_exp_details()
set(self.doc, 'approval_status', 'Submitted') set(self.doc, 'approval_status', 'Submitted')