From 1953f04e680d5b962cb73b2a06c878c08d602526 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 19 Sep 2012 12:12:07 +0530 Subject: [PATCH 1/7] added validation that abbreviation should not be more than 5 characters when creating company --- erpnext/setup/doctype/company/company.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 38c689e0bc..cfa32bb0b9 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -37,6 +37,11 @@ convert_to_lists = webnotes.conn.convert_to_lists class DocType: def __init__(self,d,dl): self.doc, self.doclist = d,dl + + def validate(self): + if self.doc.__islocal and len(self.doc.abbr) > 5: + webnotes.msgprint("Abbreviation cannot have more than 5 characters", + raise_exception=1) # Create default accounts # --------------------------------------------------- From cdd5cfefd5ab38cd8d72c8a6c8255cb5e543a3fc Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 19 Sep 2012 12:17:41 +0530 Subject: [PATCH 2/7] make item code read-only after saving --- erpnext/stock/doctype/item/item.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 0a255d1291..96c03399f1 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -18,6 +18,10 @@ cur_frm.cscript.refresh = function(doc) { // make sensitive fields(has_serial_no, is_stock_item, valuation_method) // read only if any stock ledger entry exists + if (!doc.__islocal) { + set_field_permlevel("item_code", 1); + } + if ((!doc.__islocal) && (doc.is_stock_item == 'Yes')) { var callback = function(r, rt) { if (r.message == 'exists') permlevel = 1; From 6a1e40bb4666602317187d21f0a1b7e1cb6cd987 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 19 Sep 2012 12:21:59 +0530 Subject: [PATCH 3/7] Date validation in bank reco --- .../doctype/bank_reconciliation/bank_reconciliation.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py index 03acc0af65..4bf5e976e9 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py @@ -63,6 +63,13 @@ class DocType: vouchers = [] for d in getlist(self.doclist, 'entries'): if d.clearance_date: + if getdate(d.clearance_date) < getdate(d.cheque_date): + msgprint("Clearance Date can not be before Cheque Date (Row #%s)" % + d.idx, raise_exception=1) + if getdate(d.clearance_date) < getdate(d.posting_date): + msgprint("Clearance Date can not be before Posting Date (Row #%s)" % + d.idx, raise_exception=1) + sql("update `tabJournal Voucher` set clearance_date = %s, modified = %s where name=%s", (d.clearance_date, nowdate(), d.voucher_id)) vouchers.append(d.voucher_id) From 86096ff0b4a47ec2a567e70227fae8d2855dae0c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 19 Sep 2012 12:23:35 +0530 Subject: [PATCH 4/7] syntax error fix --- erpnext/patches/september_2012/add_stock_ledger_entry_index.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/september_2012/add_stock_ledger_entry_index.py b/erpnext/patches/september_2012/add_stock_ledger_entry_index.py index bac9a086df..7153a7c330 100644 --- a/erpnext/patches/september_2012/add_stock_ledger_entry_index.py +++ b/erpnext/patches/september_2012/add_stock_ledger_entry_index.py @@ -3,7 +3,8 @@ import webnotes def execute(): webnotes.conn.commit() try: - webnotes.conn.sql("""alter table `tabStock Ledger Entry` add index posting_sort_index(posting_date, posting_time, name)""")webnotes.conn.commit() + webnotes.conn.sql("""alter table `tabStock Ledger Entry` add index posting_sort_index(posting_date, posting_time, name)""") + webnotes.conn.commit() except Exception, e: if e.args[0]!=1061: raise e webnotes.conn.begin() From 8bdfaa34387f5a495b603b2b9a9c93fcbd345c3c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 19 Sep 2012 12:41:06 +0530 Subject: [PATCH 5/7] msgprint fix, company abbreviation length validation --- erpnext/accounts/doctype/account/account.py | 2 +- erpnext/setup/doctype/company/company.py | 2 +- public/js/all-app.js | 4 ++-- public/js/all-web.js | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index 466b2f9b21..79ca322cac 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -83,7 +83,7 @@ class DocType: # Account name must be unique def validate_duplicate_account(self): - if (self.doc.__islocal or (not self.doc.name)) and sql("select name from tabAccount where account_name=%s and company=%s", (self.doc.account_name, self.doc.company)): + if (self.doc.fields.get('__islocal') or (not self.doc.name)) and sql("select name from tabAccount where account_name=%s and company=%s", (self.doc.account_name, self.doc.company)): msgprint("Account Name already exists, please rename", raise_exception=1) # validate root details diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index cfa32bb0b9..4386f2e60a 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -39,7 +39,7 @@ class DocType: self.doc, self.doclist = d,dl def validate(self): - if self.doc.__islocal and len(self.doc.abbr) > 5: + if self.doc.fields.get('__islocal') and len(self.doc.abbr) > 5: webnotes.msgprint("Abbreviation cannot have more than 5 characters", raise_exception=1) diff --git a/public/js/all-app.js b/public/js/all-app.js index 6c564045b9..7fef076408 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -603,14 +603,14 @@ document.body.appendChild(temp);temp.submit();return temp;} /* * lib/js/legacy/utils/msgprint.js */ -var msg_dialog;function msgprint(msg,title){if(!msg)return;if(msg instanceof Array){$.each(msg,function(i,v){if(v)msgprint(v);}) +var msg_dialog;function msgprint(msg,title){if(!msg)return;if(msg instanceof Array){$.each(msg,function(i,v){if(v){msgprint(v);}}) return;} if(typeof(msg)!='string') msg=JSON.stringify(msg);if(msg.substr(0,8)=='__small:'){show_alert(msg.substr(8));return;} if(!msg_dialog){msg_dialog=new wn.ui.Dialog({title:"Message",onhide:function(){msg_dialog.msg_area.empty();}});msg_dialog.msg_area=$('
').appendTo(msg_dialog.body);} if(msg.search(/
|

|

  • /)==-1) msg=replace_newlines(msg);msg_dialog.set_title(title||'Message') -msg_dialog.msg_area.append(msg);msg_dialog.show();return msg_dialog;} +if(msg_dialog.msg_area.html())msg_dialog.msg_area.append("
    ");msg_dialog.msg_area.append(msg);msg_dialog.show();return msg_dialog;} var growl_area;function show_alert(txt,id){if(!growl_area){if(!$('#dialog-container').length){$('
    ').appendTo('body');} growl_area=$a($i('dialog-container'),'div','',{position:'fixed',bottom:'8px',right:'8px',width:'320px',zIndex:10});} var wrapper=$a(growl_area,'div','',{position:'relative'});var body=$a(wrapper,'div','notice');var c=$a(body,'i','icon-remove-sign',{cssFloat:'right',cursor:'pointer'});$(c).click(function(){$dh(this.wrapper)});c.wrapper=wrapper;var t=$a(body,'div','',{color:'#FFF'});$(t).html(txt);if(id){$(t).attr('id',id);} diff --git a/public/js/all-web.js b/public/js/all-web.js index c8bab897f4..5bf2dabb61 100644 --- a/public/js/all-web.js +++ b/public/js/all-web.js @@ -490,14 +490,14 @@ document.body.appendChild(temp);temp.submit();return temp;} /* * lib/js/legacy/utils/msgprint.js */ -var msg_dialog;function msgprint(msg,title){if(!msg)return;if(msg instanceof Array){$.each(msg,function(i,v){if(v)msgprint(v);}) +var msg_dialog;function msgprint(msg,title){if(!msg)return;if(msg instanceof Array){$.each(msg,function(i,v){if(v){msgprint(v);}}) return;} if(typeof(msg)!='string') msg=JSON.stringify(msg);if(msg.substr(0,8)=='__small:'){show_alert(msg.substr(8));return;} if(!msg_dialog){msg_dialog=new wn.ui.Dialog({title:"Message",onhide:function(){msg_dialog.msg_area.empty();}});msg_dialog.msg_area=$('
    ').appendTo(msg_dialog.body);} if(msg.search(/
    |

    |

  • /)==-1) msg=replace_newlines(msg);msg_dialog.set_title(title||'Message') -msg_dialog.msg_area.append(msg);msg_dialog.show();return msg_dialog;} +if(msg_dialog.msg_area.html())msg_dialog.msg_area.append("
    ");msg_dialog.msg_area.append(msg);msg_dialog.show();return msg_dialog;} var growl_area;function show_alert(txt,id){if(!growl_area){if(!$('#dialog-container').length){$('
    ').appendTo('body');} growl_area=$a($i('dialog-container'),'div','',{position:'fixed',bottom:'8px',right:'8px',width:'320px',zIndex:10});} var wrapper=$a(growl_area,'div','',{position:'relative'});var body=$a(wrapper,'div','notice');var c=$a(body,'i','icon-remove-sign',{cssFloat:'right',cursor:'pointer'});$(c).click(function(){$dh(this.wrapper)});c.wrapper=wrapper;var t=$a(body,'div','',{color:'#FFF'});$(t).html(txt);if(id){$(t).attr('id',id);} From 70f76117ac69fcf36806fdd7fbe60eee326a0426 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 19 Sep 2012 13:06:58 +0530 Subject: [PATCH 6/7] Show Create Button for link fields which are allowed for submit --- .../doctype/maintenance_visit/maintenance_visit.py | 1 + public/js/all-app.js | 8 ++++---- public/js/fields.js | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.py b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py index 5175ca90a6..89fc2f0a4d 100644 --- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.py +++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py @@ -136,6 +136,7 @@ class DocType(TransactionBase): def check_if_last_visit(self): """check if last maintenance visit against same sales order/ customer issue""" + check_for_docname = check_for_doctype = None for d in getlist(self.doclist, 'maintenance_visit_details'): if d.prevdoc_docname: check_for_docname = d.prevdoc_docname diff --git a/public/js/all-app.js b/public/js/all-app.js index 7fef076408..dc2904e70e 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -656,7 +656,7 @@ this.not_in_form=this.in_filter;if(this.not_in_form){return'Write';} if(!this.df.permlevel)this.df.permlevel=0;var p=this.perm[this.df.permlevel];var ret;if(cur_frm.editable&&p&&p[WRITE]&&!this.df.disabled)ret='Write';else if(p&&p[READ])ret='Read';else ret='None';if(this.df.fieldtype=='Binary') ret='None';if(cint(this.df.hidden)) ret='None';if(ret=='Write'&&cint(cur_frm.doc.docstatus)>0)ret='Read';var a_o_s=cint(this.df.allow_on_submit);if(a_o_s&&(this.in_grid||(this.frm&&this.frm.not_in_container))){a_o_s=null;if(this.in_grid)a_o_s=this.grid.field.df.allow_on_submit;if(this.frm&&this.frm.not_in_container){a_o_s=cur_grid.field.df.allow_on_submit;}} -if(cur_frm.editable&&a_o_s&&cint(cur_frm.doc.docstatus)>0&&!this.df.hidden){tmp_perm=get_perm(cur_frm.doctype,cur_frm.docname,1);if(tmp_perm[this.df.permlevel]&&tmp_perm[this.df.permlevel][WRITE])ret='Write';} +if(cur_frm.editable&&a_o_s&&cint(cur_frm.doc.docstatus)>0&&!this.df.hidden){tmp_perm=get_perm(cur_frm.doctype,cur_frm.docname,1);if(tmp_perm[this.df.permlevel]&&tmp_perm[this.df.permlevel][WRITE]){ret='Write';}} return ret;} Field.prototype.set_style_mandatory=function(add){if(add){$(this.txt?this.txt:this.input).addClass('input-mandatory');if(this.disp_area)$(this.disp_area).addClass('input-mandatory');}else{$(this.txt?this.txt:this.input).removeClass('input-mandatory');if(this.disp_area)$(this.disp_area).removeClass('input-mandatory');}} Field.prototype.refresh_mandatory=function(){if(this.in_filter)return;if(this.df.reqd){if(this.label_area)this.label_area.style.color="#d22";this.set_style_mandatory(1);}else{if(this.label_area)this.label_area.style.color="#222";this.set_style_mandatory(0);} @@ -727,7 +727,7 @@ DateField.prototype.validate=function(v){if(!v)return;var me=this;this.clear=fun var t=v.split('-');if(t.length!=3){return this.clear();} else if(cint(t[1])>12||cint(t[1])<1){return this.clear();} else if(cint(t[2])>31||cint(t[2])<1){return this.clear();} -return v;};function LinkField(){}LinkField.prototype=new Field();LinkField.prototype.make_input=function(){var me=this;if(me.df.no_buttons){this.txt=$a(this.input_area,'input');this.input=this.txt;}else{makeinput_popup(this,'icon-search','icon-play','icon-plus');me.setup_buttons();me.onrefresh=function(){if(me.can_create&&cur_frm.doc.docstatus==0) +return v;};function LinkField(){}LinkField.prototype=new Field();LinkField.prototype.make_input=function(){var me=this;if(me.df.no_buttons){this.txt=$a(this.input_area,'input');this.input=this.txt;}else{makeinput_popup(this,'icon-search','icon-play','icon-plus');me.setup_buttons();me.onrefresh=function(){if(me.can_create) $(me.btn2).css('display','inline-block');else $dh(me.btn2);}} me.txt.field_object=this;me.input.set_input=function(val){if(val==undefined)val='';me.txt.value=val;} me.get_value=function(){return me.txt.value;} @@ -1532,7 +1532,7 @@ this.not_in_form=this.in_filter;if(this.not_in_form){return'Write';} if(!this.df.permlevel)this.df.permlevel=0;var p=this.perm[this.df.permlevel];var ret;if(cur_frm.editable&&p&&p[WRITE]&&!this.df.disabled)ret='Write';else if(p&&p[READ])ret='Read';else ret='None';if(this.df.fieldtype=='Binary') ret='None';if(cint(this.df.hidden)) ret='None';if(ret=='Write'&&cint(cur_frm.doc.docstatus)>0)ret='Read';var a_o_s=cint(this.df.allow_on_submit);if(a_o_s&&(this.in_grid||(this.frm&&this.frm.not_in_container))){a_o_s=null;if(this.in_grid)a_o_s=this.grid.field.df.allow_on_submit;if(this.frm&&this.frm.not_in_container){a_o_s=cur_grid.field.df.allow_on_submit;}} -if(cur_frm.editable&&a_o_s&&cint(cur_frm.doc.docstatus)>0&&!this.df.hidden){tmp_perm=get_perm(cur_frm.doctype,cur_frm.docname,1);if(tmp_perm[this.df.permlevel]&&tmp_perm[this.df.permlevel][WRITE])ret='Write';} +if(cur_frm.editable&&a_o_s&&cint(cur_frm.doc.docstatus)>0&&!this.df.hidden){tmp_perm=get_perm(cur_frm.doctype,cur_frm.docname,1);if(tmp_perm[this.df.permlevel]&&tmp_perm[this.df.permlevel][WRITE]){ret='Write';}} return ret;} Field.prototype.set_style_mandatory=function(add){if(add){$(this.txt?this.txt:this.input).addClass('input-mandatory');if(this.disp_area)$(this.disp_area).addClass('input-mandatory');}else{$(this.txt?this.txt:this.input).removeClass('input-mandatory');if(this.disp_area)$(this.disp_area).removeClass('input-mandatory');}} Field.prototype.refresh_mandatory=function(){if(this.in_filter)return;if(this.df.reqd){if(this.label_area)this.label_area.style.color="#d22";this.set_style_mandatory(1);}else{if(this.label_area)this.label_area.style.color="#222";this.set_style_mandatory(0);} @@ -1603,7 +1603,7 @@ DateField.prototype.validate=function(v){if(!v)return;var me=this;this.clear=fun var t=v.split('-');if(t.length!=3){return this.clear();} else if(cint(t[1])>12||cint(t[1])<1){return this.clear();} else if(cint(t[2])>31||cint(t[2])<1){return this.clear();} -return v;};function LinkField(){}LinkField.prototype=new Field();LinkField.prototype.make_input=function(){var me=this;if(me.df.no_buttons){this.txt=$a(this.input_area,'input');this.input=this.txt;}else{makeinput_popup(this,'icon-search','icon-play','icon-plus');me.setup_buttons();me.onrefresh=function(){if(me.can_create&&cur_frm.doc.docstatus==0) +return v;};function LinkField(){}LinkField.prototype=new Field();LinkField.prototype.make_input=function(){var me=this;if(me.df.no_buttons){this.txt=$a(this.input_area,'input');this.input=this.txt;}else{makeinput_popup(this,'icon-search','icon-play','icon-plus');me.setup_buttons();me.onrefresh=function(){if(me.can_create) $(me.btn2).css('display','inline-block');else $dh(me.btn2);}} me.txt.field_object=this;me.input.set_input=function(val){if(val==undefined)val='';me.txt.value=val;} me.get_value=function(){return me.txt.value;} diff --git a/public/js/fields.js b/public/js/fields.js index 8fee1068b2..7d00562050 100644 --- a/public/js/fields.js +++ b/public/js/fields.js @@ -23,7 +23,7 @@ this.not_in_form=this.in_filter;if(this.not_in_form){return'Write';} if(!this.df.permlevel)this.df.permlevel=0;var p=this.perm[this.df.permlevel];var ret;if(cur_frm.editable&&p&&p[WRITE]&&!this.df.disabled)ret='Write';else if(p&&p[READ])ret='Read';else ret='None';if(this.df.fieldtype=='Binary') ret='None';if(cint(this.df.hidden)) ret='None';if(ret=='Write'&&cint(cur_frm.doc.docstatus)>0)ret='Read';var a_o_s=cint(this.df.allow_on_submit);if(a_o_s&&(this.in_grid||(this.frm&&this.frm.not_in_container))){a_o_s=null;if(this.in_grid)a_o_s=this.grid.field.df.allow_on_submit;if(this.frm&&this.frm.not_in_container){a_o_s=cur_grid.field.df.allow_on_submit;}} -if(cur_frm.editable&&a_o_s&&cint(cur_frm.doc.docstatus)>0&&!this.df.hidden){tmp_perm=get_perm(cur_frm.doctype,cur_frm.docname,1);if(tmp_perm[this.df.permlevel]&&tmp_perm[this.df.permlevel][WRITE])ret='Write';} +if(cur_frm.editable&&a_o_s&&cint(cur_frm.doc.docstatus)>0&&!this.df.hidden){tmp_perm=get_perm(cur_frm.doctype,cur_frm.docname,1);if(tmp_perm[this.df.permlevel]&&tmp_perm[this.df.permlevel][WRITE]){ret='Write';}} return ret;} Field.prototype.set_style_mandatory=function(add){if(add){$(this.txt?this.txt:this.input).addClass('input-mandatory');if(this.disp_area)$(this.disp_area).addClass('input-mandatory');}else{$(this.txt?this.txt:this.input).removeClass('input-mandatory');if(this.disp_area)$(this.disp_area).removeClass('input-mandatory');}} Field.prototype.refresh_mandatory=function(){if(this.in_filter)return;if(this.df.reqd){if(this.label_area)this.label_area.style.color="#d22";this.set_style_mandatory(1);}else{if(this.label_area)this.label_area.style.color="#222";this.set_style_mandatory(0);} @@ -94,7 +94,7 @@ DateField.prototype.validate=function(v){if(!v)return;var me=this;this.clear=fun var t=v.split('-');if(t.length!=3){return this.clear();} else if(cint(t[1])>12||cint(t[1])<1){return this.clear();} else if(cint(t[2])>31||cint(t[2])<1){return this.clear();} -return v;};function LinkField(){}LinkField.prototype=new Field();LinkField.prototype.make_input=function(){var me=this;if(me.df.no_buttons){this.txt=$a(this.input_area,'input');this.input=this.txt;}else{makeinput_popup(this,'icon-search','icon-play','icon-plus');me.setup_buttons();me.onrefresh=function(){if(me.can_create&&cur_frm.doc.docstatus==0) +return v;};function LinkField(){}LinkField.prototype=new Field();LinkField.prototype.make_input=function(){var me=this;if(me.df.no_buttons){this.txt=$a(this.input_area,'input');this.input=this.txt;}else{makeinput_popup(this,'icon-search','icon-play','icon-plus');me.setup_buttons();me.onrefresh=function(){if(me.can_create) $(me.btn2).css('display','inline-block');else $dh(me.btn2);}} me.txt.field_object=this;me.input.set_input=function(val){if(val==undefined)val='';me.txt.value=val;} me.get_value=function(){return me.txt.value;} From 757a7858725463fa39e27f3005c17e3268ae1156 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 19 Sep 2012 16:06:03 +0530 Subject: [PATCH 7/7] sales/ pur invoice listview fix --- .../doctype/purchase_invoice/purchase_invoice_list.js | 5 ++--- erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js index f9dd4cde9e..7bb25581f3 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js @@ -16,9 +16,8 @@ wn.doclistviews['Purchase Invoice'] = wn.views.ListView.extend({ prepare_data: function(data) { this._super(data); - data.paid = flt( - ((data.grand_total - data.outstanding_amount) / data.grand_total) * 100, - 2); + data.paid = data.docstatus == 1 ? + flt(((data.grand_total - data.outstanding_amount) / data.grand_total) * 100, 2) : 0; }, columns: [ diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js index 1c3b2d38ce..cbe1741ae3 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js @@ -14,7 +14,8 @@ wn.doclistviews['Sales Invoice'] = wn.views.ListView.extend({ }, prepare_data: function(data) { this._super(data); - data.paid = flt((data.grand_total - data.outstanding_amount) / data.grand_total * 100, 2); + data.paid = (data.docstatus == 1) ? + flt((data.grand_total - data.outstanding_amount) / data.grand_total * 100, 2) : 0; }, columns: [ {width: '3%', content: 'check'},