allow expense claim sanctioned amount to have 0 value
This commit is contained in:
parent
48d253fec7
commit
d871145346
@ -46,6 +46,13 @@ cur_frm.cscript.refresh = function(doc,cdt,cdn){
|
|||||||
if (doc.docstatus == 0) unhide_field('calculate_total_amount');
|
if (doc.docstatus == 0) unhide_field('calculate_total_amount');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cur_frm.cscript.validate = function(doc) {
|
||||||
|
if(cint(doc.docstatus) == 0) {
|
||||||
|
doc.approval_status = "Draft";
|
||||||
|
}
|
||||||
|
cur_frm.cscript.calculate_total(doc);
|
||||||
|
}
|
||||||
|
|
||||||
cur_frm.cscript.employee = function(doc,cdt,cdn){
|
cur_frm.cscript.employee = function(doc,cdt,cdn){
|
||||||
if(doc.employee){
|
if(doc.employee){
|
||||||
$c_obj(make_doclist(doc.doctype, doc.name),'set_approver','', function(r,rt){
|
$c_obj(make_doclist(doc.doctype, doc.name),'set_approver','', function(r,rt){
|
||||||
|
@ -77,9 +77,12 @@ class DocType:
|
|||||||
set(self.doc, 'remark', self.doc.remark)
|
set(self.doc, 'remark', self.doc.remark)
|
||||||
|
|
||||||
def approve_voucher(self):
|
def approve_voucher(self):
|
||||||
|
missing_count = 0
|
||||||
for d in getlist(self.doclist, 'expense_voucher_details'):
|
for d in getlist(self.doclist, 'expense_voucher_details'):
|
||||||
if not d.sanctioned_amount:
|
if not d.sanctioned_amount:
|
||||||
msgprint("Please add 'Sanctioned Amount' for all expenses")
|
missing_count += 1
|
||||||
|
if missing_count == len(getlist(self.doclist, 'expense_voucher_details')):
|
||||||
|
msgprint("Please add 'Sanctioned Amount' for atleast one expense")
|
||||||
return cstr('Incomplete')
|
return cstr('Incomplete')
|
||||||
|
|
||||||
if not self.doc.total_sanctioned_amount:
|
if not self.doc.total_sanctioned_amount:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user