fix: [payroll] 급여 수정 모달 총 지급액 계산 오류 수정
- decimal:0 캐스트로 인해 금액이 문자열로 전달되어 문자열 연결 발생 - Number()로 명시적 숫자 변환 추가
This commit is contained in:
@@ -463,11 +463,11 @@ function openEditPayrollModal(id, data) {
|
||||
});
|
||||
|
||||
// 총 지급액·과세표준 계산 표시
|
||||
const baseSalary = data.base_salary || 0;
|
||||
const overtimePay = data.overtime_pay || 0;
|
||||
const bonus = data.bonus || 0;
|
||||
const baseSalary = Number(data.base_salary) || 0;
|
||||
const overtimePay = Number(data.overtime_pay) || 0;
|
||||
const bonus = Number(data.bonus) || 0;
|
||||
let allowancesTotal = 0;
|
||||
if (data.allowances) data.allowances.forEach(a => allowancesTotal += (a.amount || 0));
|
||||
if (data.allowances) data.allowances.forEach(a => allowancesTotal += (Number(a.amount) || 0));
|
||||
const grossSalary = baseSalary + overtimePay + bonus + allowancesTotal;
|
||||
document.getElementById('calcGross').textContent = numberFormat(grossSalary);
|
||||
document.getElementById('calcTaxableBase').textContent = numberFormat(grossSalary - bonus);
|
||||
|
||||
Reference in New Issue
Block a user