Codacy fixes

This commit is contained in:
Jamsheer 2018-05-16 15:17:49 +05:30
parent c9287b5b88
commit 3cd0ad4c98
2 changed files with 5 additions and 6 deletions

View File

@ -10,8 +10,8 @@ frappe.ui.form.on('Employee Benefit Application', {
is_flexible_benefit: true, is_flexible_benefit: true,
disabled: false disabled: false
} }
} };
}) });
}, },
employee: function(frm) { employee: function(frm) {
frappe.call({ frappe.call({
@ -31,8 +31,8 @@ frappe.ui.form.on('Employee Benefit Application', {
frappe.ui.form.on("Employee Benefit Application Detail",{ frappe.ui.form.on("Employee Benefit Application Detail",{
amount: function(frm, cdt, cdn) { amount: function(frm, cdt, cdn) {
calculate_all(frm.doc, cdt, cdn); calculate_all(frm.doc, cdt, cdn);
}, }
}) });
var calculate_all = function(doc, dt, dn) { var calculate_all = function(doc, dt, dn) {
var tbl = doc.employee_benefits || []; var tbl = doc.employee_benefits || [];
@ -50,4 +50,4 @@ var calculate_all = function(doc, dt, dn) {
doc.remainig_benefits = doc.max_benefits - total_amount; doc.remainig_benefits = doc.max_benefits - total_amount;
doc.pro_rata_dispensed_amount = pro_rata_dispensed_amount; doc.pro_rata_dispensed_amount = pro_rata_dispensed_amount;
refresh_many(['pro_rata_dispensed_amount', 'total_amount','remainig_benefits']); refresh_many(['pro_rata_dispensed_amount', 'total_amount','remainig_benefits']);
} };

View File

@ -26,5 +26,4 @@ def get_payroll_period_days(start_date, end_date, company):
}) })
if len(payroll_period_dates) > 0: if len(payroll_period_dates) > 0:
print payroll_period_dates[0][0], payroll_period_dates[0][1]
return date_diff(getdate(payroll_period_dates[0][1]), getdate(payroll_period_dates[0][0])) + 1 return date_diff(getdate(payroll_period_dates[0][1]), getdate(payroll_period_dates[0][0])) + 1