Payroll Process with timesheet: error

Hello;
If I selected in the salary structure to have salary slip based on timesheet, and if one of the employee that belongs to this salary structure was not have timesheet submitted, then it gives me this attached error.
Is it bug or the payroll is working in this way? Because I use this option (salary slip based on timesheet) for overtime, and maybe the employee did not work overtime and no time sheet for him. So why to give this error?

Regards
Bilal

@bghayad,

Please check the formula or conditions in the salary structure, there seems to be an error in the condition

I am sure there is nothing related to formula or conditions.
Simply if I selected the “Salary Slip Based on Timesheet” and there is not submitted timesheet for the employee, this error appears. Even if there is not any formula or condition.
Can u check at your version?
Regards
Bilal

@bghayad,

Can you share the traceback from browser’s console?

Yes there is error in the console. The errors are: Expectation Failed, Failed Loading and Uncaught (in promise).

I am summarizing the errors in the below lines and I paste the console log which contains all the logs:

jquery.min.js:4 POST http://192.168.43.226/ 417 (EXPECTATION FAILED)

jquery.min.js:4 XHR failed loading: POST “http://192.168.43.226/”.

ValidationError: Error in formula or condition: unsupported operand type(s) for +: ‘float’ and ‘NoneType’

jquery.min.js:2 Uncaught (in promise) {readyState: 4, getResponseHeader: ƒ, getAllResponseHeaders: ƒ, setRequestHeader: ƒ, overrideMimeType: ƒ, …}

Again, if the employee has timesheet for the period that I am generating the salary slip, then this error is not appear.

Below is the output console:

desk.min.js:2712 This function ‘$c’ has been deprecated and will be removed soon.
$c @ desk.min.js:2712
cur_frm.cscript.create_salary_slip @ VM132:107
runner @ form.min.js:2553
(anonymous) @ form.min.js:2580
Promise resolved (async)
(anonymous) @ desk.min.js:664
frappe.run_serially @ desk.min.js:662
trigger @ form.min.js:2585
onclick @ desk.min.js:4870
(anonymous) @ desk.min.js:4860
dispatch @ jquery.min.js:3
$event.dispatch @ report.min.js:2942
r.handle @ jquery.min.js:3
jquery.min.js:4 POST http://192.168.43.226/ 417 (EXPECTATION FAILED)
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
$c @ desk.min.js:2713
cur_frm.cscript.create_salary_slip @ VM132:107
runner @ form.min.js:2553
(anonymous) @ form.min.js:2580
Promise resolved (async)
(anonymous) @ desk.min.js:664
frappe.run_serially @ desk.min.js:662
trigger @ form.min.js:2585
onclick @ desk.min.js:4870
(anonymous) @ desk.min.js:4860
dispatch @ jquery.min.js:3
$event.dispatch @ report.min.js:2942
r.handle @ jquery.min.js:3
jquery.min.js:4 XHR failed loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
$c @ desk.min.js:2713
cur_frm.cscript.create_salary_slip @ VM132:107
runner @ form.min.js:2553
(anonymous) @ form.min.js:2580
Promise resolved (async)
(anonymous) @ desk.min.js:664
frappe.run_serially @ desk.min.js:662
trigger @ form.min.js:2585
onclick @ desk.min.js:4870
(anonymous) @ desk.min.js:4860
dispatch @ jquery.min.js:3
$event.dispatch @ report.min.js:2942
r.handle @ jquery.min.js:3
desk.min.js:1413 Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 56, in application
response = frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 52, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 922, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 80, in runserverobj
frappe.desk.form.run_method.runserverobj(method, docs=docs, dt=dt, dn=dn, arg=arg, args=args)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/run_method.py”, line 35, in runserverobj
r = doc.run_method(method)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 666, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 887, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 870, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 660, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/process_payroll/process_payroll.py”, line 105, in create_salary_slips
ss.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 192, in insert
self.run_before_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_before_save_methods
self.run_method(“validate”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 666, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 887, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 870, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 660, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 33, in validate
self.calculate_net_pay()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 353, in calculate_net_pay
self.calculate_component_amounts()
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 56, in calculate_component_amounts
amount = self.eval_condition_and_formula(struct_row, data)
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/salary_slip/salary_slip.py”, line 95, in eval_condition_and_formula
frappe.throw(_(“Error in formula or condition: {0}”.format(e)))
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 319, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 309, in msgprint
_raise_exception()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 282, in _raise_exception
raise raise_exception(encode(msg))
ValidationError: Error in formula or condition: unsupported operand type(s) for +: ‘float’ and ‘NoneType’

jquery.min.js:2 Uncaught (in promise) {readyState: 4, getResponseHeader: ƒ, getAllResponseHeaders: ƒ, setRequestHeader: ƒ, overrideMimeType: ƒ, …}
(anonymous) @ jquery.min.js:2
i @ jquery.min.js:2
fireWith @ jquery.min.js:2
z @ jquery.min.js:4
(anonymous) @ jquery.min.js:4
XMLHttpRequest.send (async)
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
$c @ desk.min.js:2713
cur_frm.cscript.create_salary_slip @ VM132:107
runner @ form.min.js:2553
(anonymous) @ form.min.js:2580
Promise resolved (async)
(anonymous) @ desk.min.js:664
frappe.run_serially @ desk.min.js:662
trigger @ form.min.js:2585
onclick @ desk.min.js:4870
(anonymous) @ desk.min.js:4860
dispatch @ jquery.min.js:3
$event.dispatch @ report.min.js:2942
r.handle @ jquery.min.js:3
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1317
frappe.call @ desk.min.js:1214
refresh_notifications @ desk.min.js:13032
(anonymous) @ desk.min.js:13019
jquery.min.js:4 XHR finished loading: POST “http://192.168.43.226/”.

Regards
Bilal

Any help?
Why it is must to have timesheet for the employee to be able to create salary slip for him using payroll process?

Regards
Bilal