Skip to content

Commit

Permalink
bug(Payroll indice crashes)
Browse files Browse the repository at this point in the history
- Resolved system crash when an employee is removed from the configuration

closes #7453
  • Loading branch information
lomamech committed Feb 21, 2024
1 parent 748816c commit 20756ac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/controllers/payroll/multiplePayrollIndice/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,11 @@ async function lookUp(options) {
// let get rubric values for each employee
const stagePaymentsParams = employeeUuid ? [payConfigId, db.bid(employeeUuid)] : [payConfigId];
const stagePayments = await db.exec(stagePaymentIndiceSql, stagePaymentsParams);

stagePayments.forEach(stagePay => {
employeesMap[stagePay.employee_uuid].rubrics.push(stagePay);
if (employeesMap[stagePay.employee_uuid]) {
employeesMap[stagePay.employee_uuid].rubrics.push(stagePay);
}
});

// let get rubric for this payment period
Expand Down

0 comments on commit 20756ac

Please sign in to comment.