fix in sanctioned amount in expense claim
This commit is contained in:
parent
d68bddf416
commit
48d253fec7
@ -63,7 +63,7 @@ cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
|
|||||||
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);
|
||||||
var total_claim =0;
|
var total_claim =0;
|
||||||
for(var i = 0; i<val.length; i++){
|
for(var i = 0; i<val.length; i++){
|
||||||
if(!doc.claim_amount) val[i].sanctioned_amount = val[i].claim_amount;
|
val[i].sanctioned_amount = val[i].claim_amount;
|
||||||
total_claim = flt(total_claim)+flt(val[i].claim_amount);
|
total_claim = flt(total_claim)+flt(val[i].claim_amount);
|
||||||
refresh_field('sactioned_amount', val[i].name, 'expense_voucher_details');
|
refresh_field('sactioned_amount', val[i].name, 'expense_voucher_details');
|
||||||
}
|
}
|
||||||
@ -74,7 +74,6 @@ cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
|
|||||||
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);
|
||||||
var total_sanctioned = 0;
|
var total_sanctioned = 0;
|
||||||
for(var i = 0; i<val.length; i++){
|
for(var i = 0; i<val.length; i++){
|
||||||
if(!doc.claim_amount) val[i].sanctioned_amount = val[i].claim_amount;
|
|
||||||
total_sanctioned = flt(total_sanctioned)+flt(val[i].sanctioned_amount);
|
total_sanctioned = flt(total_sanctioned)+flt(val[i].sanctioned_amount);
|
||||||
refresh_field('sactioned_amount', val[i].name, 'expense_voucher_details');
|
refresh_field('sactioned_amount', val[i].name, 'expense_voucher_details');
|
||||||
|
|
||||||
@ -97,6 +96,7 @@ cur_frm.cscript.sanctioned_amount = function(doc,cdt,cdn){
|
|||||||
wn.require('app/setup/doctype/notification_control/notification_control.js');
|
wn.require('app/setup/doctype/notification_control/notification_control.js');
|
||||||
|
|
||||||
cur_frm.cscript.approve = function(doc,cdt,cdn){
|
cur_frm.cscript.approve = function(doc,cdt,cdn){
|
||||||
|
cur_frm.cscript.calculate_total(doc,cdt,cdn);
|
||||||
|
|
||||||
if(user == doc.exp_approver){
|
if(user == doc.exp_approver){
|
||||||
var approve_voucher_dialog;
|
var approve_voucher_dialog;
|
||||||
@ -166,6 +166,8 @@ cur_frm.cscript.approve = function(doc,cdt,cdn){
|
|||||||
}
|
}
|
||||||
|
|
||||||
cur_frm.cscript.reject = function(doc,cdt,cdn){
|
cur_frm.cscript.reject = function(doc,cdt,cdn){
|
||||||
|
cur_frm.cscript.calculate_total(doc,cdt,cdn);
|
||||||
|
|
||||||
if(user == doc.exp_approver){
|
if(user == doc.exp_approver){
|
||||||
var reject_voucher_dialog;
|
var reject_voucher_dialog;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ wn.doclistviews['Expense Claim'] = wn.views.ListView.extend({
|
|||||||
prepare_data: function(data) {
|
prepare_data: function(data) {
|
||||||
this._super(data);
|
this._super(data);
|
||||||
data.posting_date = wn.datetime.str_to_user(data.posting_date);
|
data.posting_date = wn.datetime.str_to_user(data.posting_date);
|
||||||
data.employee_name = data.employee_name + 'claimed '
|
data.employee_name = data.employee_name + ' claimed '
|
||||||
+ wn.boot.company[data.company].default_currency + ' '
|
+ wn.boot.company[data.company].default_currency + ' '
|
||||||
+ fmt_money(data.total_claimed_amount);
|
+ fmt_money(data.total_claimed_amount);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user