Been getting the following error when trying to submit the voucher:
Traceback (most recent call last):
File “/home/bench/erpnext/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 841, in submit
self._submit()
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 830, in _submit
self.save()
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 311, in _save
self.run_post_save_methods()
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 901, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 765, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 1040, in composer
return composed(self, method, *args, **kwargs)
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 1023, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 759, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/bench/erpnext/apps/oi_custom/oi_custom/customizations/doctype/payroll_voucher/payroll_voucher.py”, line 46, in on_submit
self.submit_salary_slips()
File “/home/bench/erpnext/apps/oi_custom/oi_custom/customizations/doctype/payroll_voucher/payroll_voucher.py”, line 226, in submit_salary_slips
self.register_payroll_in_gl()
File “/home/bench/erpnext/apps/oi_custom/oi_custom/customizations/doctype/payroll_voucher/payroll_voucher.py”, line 338, in register_payroll_in_gl
credit=amt
UnboundLocalError: local variable ‘amt’ referenced before assignment
Traceback (most recent call last):
File “/home/bench/erpnext/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/bench/erpnext/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/bench/erpnext/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/bench/erpnext/apps/frappe/frappe/init.py”, line 942, in call
return fn(*args, **newargs)
File “/home/bench/erpnext/apps/frappe/frappe/desk/form/save.py”, line 19, in savedocs
doc.submit()
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 841, in submit
self._submit()
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 830, in _submit
self.save()
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 311, in _save
self.run_post_save_methods()
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 901, in run_post_save_methods
self.run_method(“on_submit”)
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 765, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 1040, in composer
return composed(self, method, *args, **kwargs)
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 1023, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/bench/erpnext/apps/frappe/frappe/model/document.py”, line 759, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/bench/erpnext/apps/oi_custom/oi_custom/customizations/doctype/payroll_voucher/payroll_voucher.py”, line 46, in on_submit
self.submit_salary_slips()
File “/home/bench/erpnext/apps/oi_custom/oi_custom/customizations/doctype/payroll_voucher/payroll_voucher.py”, line 226, in submit_salary_slips
self.register_payroll_in_gl()
File “/home/bench/erpnext/apps/oi_custom/oi_custom/customizations/doctype/payroll_voucher/payroll_voucher.py”, line 338, in register_payroll_in_gl
credit=amt
UnboundLocalError: local variable ‘amt’ referenced before assignment