Merge branch 'master' of github.com:webnotes/erpnext
This commit is contained in:
commit
bc54dadd44
@ -206,7 +206,7 @@ def get_data(rows, company_abbr):
|
|||||||
if accounts:
|
if accounts:
|
||||||
total_debit = total_credit = 0
|
total_debit = total_credit = 0
|
||||||
for acc_idx in xrange(len(accounts)):
|
for acc_idx in xrange(len(accounts)):
|
||||||
col_idx = len(columns) - 1 + acc_idx
|
col_idx = len(columns) + acc_idx
|
||||||
if flt(r[col_idx]) != 0:
|
if flt(r[col_idx]) != 0:
|
||||||
if not acc_dict.get(accounts[acc_idx]):
|
if not acc_dict.get(accounts[acc_idx]):
|
||||||
acc_dict[accounts[acc_idx]] = 0
|
acc_dict[accounts[acc_idx]] = 0
|
||||||
@ -228,4 +228,8 @@ def get_data(rows, company_abbr):
|
|||||||
if not c.endswith(" - " + company_abbr)]
|
if not c.endswith(" - " + company_abbr)]
|
||||||
accounts = [c for c in rows[i+1] if c.endswith(" - " + company_abbr)]
|
accounts = [c for c in rows[i+1] if c.endswith(" - " + company_abbr)]
|
||||||
|
|
||||||
|
if accounts and (len(columns) != rows[i+1].index(accounts[0])):
|
||||||
|
raise Exception, """A non-account column cannot be after an account \
|
||||||
|
column. Please rectify it in the file and try again."""
|
||||||
|
|
||||||
return data, start_row_idx
|
return data, start_row_idx
|
||||||
@ -20,8 +20,9 @@ cur_frm.add_fetch('employee', 'employee_name', 'employee_name');
|
|||||||
cur_frm.cscript.onload = function(doc,cdt,cdn){
|
cur_frm.cscript.onload = function(doc,cdt,cdn){
|
||||||
if(!doc.status)
|
if(!doc.status)
|
||||||
set_multiple(cdt,cdn,{status:'Draft'});
|
set_multiple(cdt,cdn,{status:'Draft'});
|
||||||
if(doc.amended_from && doc.__islocal)
|
if(doc.amended_from && doc.__islocal) {
|
||||||
cur_frm.cscript.refresh_appraisal_details(doc, cdt, cdn);
|
doc.status = "Draft";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.onload_post_render = function(doc,cdt,cdn){
|
cur_frm.cscript.onload_post_render = function(doc,cdt,cdn){
|
||||||
@ -42,17 +43,6 @@ cur_frm.cscript.kra_template = function(doc, dt, dn) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cur_frm.cscript.refresh_appraisal_details = function(doc, cdt, cdn){
|
|
||||||
var val = getchildren('Appraisal Goal', doc.name, 'appraisal_details', doc.doctype);
|
|
||||||
for(var i = 0; i<val.length; i++){
|
|
||||||
set_multiple('Appraisal Goal', val[i].name, {'target_achieved':'', 'score':'', 'scored_earned':''}, 'appraisal_details');
|
|
||||||
}
|
|
||||||
doc.total_score = '';
|
|
||||||
refresh_field('appraisal_details');
|
|
||||||
refresh_field('total_score');
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_frm.cscript.calculate_total_score = function(doc,cdt,cdn){
|
cur_frm.cscript.calculate_total_score = function(doc,cdt,cdn){
|
||||||
//get_server_fields('calculate_total','','',doc,cdt,cdn,1);
|
//get_server_fields('calculate_total','','',doc,cdt,cdn,1);
|
||||||
var val = getchildren('Appraisal Goal', doc.name, 'appraisal_details', doc.doctype);
|
var val = getchildren('Appraisal Goal', doc.name, 'appraisal_details', doc.doctype);
|
||||||
@ -77,7 +67,7 @@ cur_frm.cscript.score = function(doc,cdt,cdn){
|
|||||||
refresh_field('score_earned', d.name, 'appraisal_details');
|
refresh_field('score_earned', d.name, 'appraisal_details');
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
d.score_earned = '';
|
d.score_earned = 0;
|
||||||
refresh_field('score_earned', d.name, 'appraisal_details');
|
refresh_field('score_earned', d.name, 'appraisal_details');
|
||||||
}
|
}
|
||||||
cur_frm.cscript.calculate_total(doc,cdt,cdn);
|
cur_frm.cscript.calculate_total(doc,cdt,cdn);
|
||||||
|
|||||||
@ -29,6 +29,8 @@ cur_frm.cscript.load_taxes = function(doc, cdt, cdn, callback) {
|
|||||||
if(callback) {
|
if(callback) {
|
||||||
callback(doc, cdt, cdn);
|
callback(doc, cdt, cdn);
|
||||||
}
|
}
|
||||||
|
} else if(doc.charge) {
|
||||||
|
cur_frm.cscript.get_charges(doc, cdt, cdn, callback);
|
||||||
} else {
|
} else {
|
||||||
$c_obj(make_doclist(doc.doctype, doc.name),'load_default_taxes','',function(r,rt){
|
$c_obj(make_doclist(doc.doctype, doc.name),'load_default_taxes','',function(r,rt){
|
||||||
refresh_field('other_charges');
|
refresh_field('other_charges');
|
||||||
@ -374,12 +376,14 @@ cur_frm.fields_dict.charge.get_query = function(doc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ********************* Get Charges ****************************
|
// ********************* Get Charges ****************************
|
||||||
cur_frm.cscript.get_charges = function(doc, cdt, cdn) {
|
cur_frm.cscript.get_charges = function(doc, cdt, cdn, callback) {
|
||||||
$c_obj(make_doclist(doc.doctype,doc.name),
|
$c_obj(make_doclist(doc.doctype,doc.name),
|
||||||
'get_other_charges',
|
'get_other_charges',
|
||||||
'',
|
'',
|
||||||
function(r, rt) { cur_frm.cscript.calculate_charges(doc, cdt, cdn);}
|
function(r, rt) {
|
||||||
,null,null,cur_frm.fields_dict.get_charges.input);
|
cur_frm.cscript.calculate_charges(doc, cdt, cdn);
|
||||||
|
if(callback) callback(doc, cdt, cdn);
|
||||||
|
}, null,null,cur_frm.fields_dict.get_charges.input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user