fix: emp disappear (#24524)

* fix: emp disappear

* fix: renamed set_totals_call to set_totals

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
This commit is contained in:
Afshan 2021-02-02 11:02:22 +05:30 committed by GitHub
parent bf97eb2d3b
commit 8676089794
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -348,7 +348,6 @@ let render_employee_attendance = function (frm, data) {
frappe.ui.form.on('Payroll Employee Detail', { frappe.ui.form.on('Payroll Employee Detail', {
employee: function(frm) { employee: function(frm) {
frm.events.clear_employee_table(frm);
if (!frm.doc.payroll_frequency) { if (!frm.doc.payroll_frequency) {
frappe.throw(__("Please set a Payroll Frequency")); frappe.throw(__("Please set a Payroll Frequency"));
} }

View File

@ -116,7 +116,7 @@ frappe.ui.form.on("Salary Slip", {
}, },
exchange_rate: function(frm) { exchange_rate: function(frm) {
calculate_totals(frm); set_totals(frm);
}, },
hide_loan_section: function(frm) { hide_loan_section: function(frm) {
@ -205,14 +205,14 @@ frappe.ui.form.on("Salary Slip", {
frappe.ui.form.on('Salary Slip Timesheet', { frappe.ui.form.on('Salary Slip Timesheet', {
time_sheet: function(frm) { time_sheet: function(frm) {
calculate_totals(frm); set_totals(frm);
}, },
timesheets_remove: function(frm) { timesheets_remove: function(frm) {
calculate_totals(frm); set_totals(frm);
} }
}); });
var calculate_totals = function(frm) { var set_totals = function(frm) {
if (frm.doc.docstatus === 0) { if (frm.doc.docstatus === 0) {
if (frm.doc.earnings || frm.doc.deductions) { if (frm.doc.earnings || frm.doc.deductions) {
frappe.call({ frappe.call({
@ -228,15 +228,15 @@ var calculate_totals = function(frm) {
frappe.ui.form.on('Salary Detail', { frappe.ui.form.on('Salary Detail', {
amount: function(frm) { amount: function(frm) {
calculate_totals(frm); set_totals(frm);
}, },
earnings_remove: function(frm) { earnings_remove: function(frm) {
calculate_totals(frm); set_totals(frm);
}, },
deductions_remove: function(frm) { deductions_remove: function(frm) {
calculate_totals(frm); set_totals(frm);
}, },
salary_component: function(frm, cdt, cdn) { salary_component: function(frm, cdt, cdn) {