floating point issue in percentage delivered/billed

This commit is contained in:
Nabin Hait
2012-12-07 14:43:06 +05:30
parent c842f79811
commit 2ce027fc9f
5 changed files with 11 additions and 11 deletions

View File

@@ -49,9 +49,9 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
if(doc.docstatus == 1 && doc.status != 'Stopped'){
cur_frm.add_custom_button('Send SMS', cur_frm.cscript['Send SMS']);
if(doc.per_received < 100) cur_frm.add_custom_button('Make Purchase Receipt', cur_frm.cscript['Make Purchase Receipt']);
if(doc.per_billed < 100) cur_frm.add_custom_button('Make Invoice', cur_frm.cscript['Make Purchase Invoice']);
if(doc.per_billed < 100 || doc.per_received < 100) cur_frm.add_custom_button('Stop', cur_frm.cscript['Stop Purchase Order']);
if(flt(doc.per_received, 2) < 100) cur_frm.add_custom_button('Make Purchase Receipt', cur_frm.cscript['Make Purchase Receipt']);
if(flt(doc.per_billed, 2) < 100) cur_frm.add_custom_button('Make Invoice', cur_frm.cscript['Make Purchase Invoice']);
if(flt(doc.per_billed, 2) < 100 || doc.per_received < 100) cur_frm.add_custom_button('Stop', cur_frm.cscript['Stop Purchase Order']);
}
if(doc.docstatus == 1 && doc.status == 'Stopped')

View File

@@ -50,7 +50,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
erpnext.hide_naming_series();
if(doc.docstatus == 1 && doc.status != 'Stopped'){
if(doc.per_ordered < 100) {
if(flt(doc.per_ordered, 2) < 100) {
cur_frm.add_custom_button('Make Purchase Order', cur_frm.cscript['Make Purchase Order']);
cur_frm.add_custom_button('Stop Purchase Request', cur_frm.cscript['Stop Purchase Request']);
}