calculate total leave days on load

This commit is contained in:
Anand Doshi 2013-02-19 18:52:20 +05:30
parent 64e47afec1
commit 150d98d786

View File

@ -21,7 +21,8 @@ cur_frm.cscript.onload = function(doc, dt, dn) {
if(!doc.posting_date) if(!doc.posting_date)
set_multiple(dt,dn,{posting_date:get_today()}); set_multiple(dt,dn,{posting_date:get_today()});
if(doc.__islocal) { if(doc.__islocal) {
cur_frm.set_value("status", "Open") cur_frm.set_value("status", "Open");
cur_frm.cscript.calculate_total_days(doc, dt, dn);
} }
cur_frm.set_df_property("leave_approver", "options", ""); cur_frm.set_df_property("leave_approver", "options", "");
cur_frm.call({ cur_frm.call({
@ -34,7 +35,6 @@ cur_frm.cscript.onload = function(doc, dt, dn) {
cur_frm.cscript.get_leave_balance(cur_frm.doc); cur_frm.cscript.get_leave_balance(cur_frm.doc);
} }
}); });
cur_frm.cscript.calculate_total_days(doc, dt, dn);
} }
cur_frm.cscript.refresh = function(doc, dt, dn) { cur_frm.cscript.refresh = function(doc, dt, dn) {