fix: [payroll] 급여등록 용어 및 공제항목 순서 변경
- 초과근무수당 → 고정연장근로수당 명칭 변경 - 소득세 → 근로소득세, 주민세 → 지방소득세 명칭 변경 - 공제항목 순서: 국민연금-건강보험-고용보험-근로소득세-지방소득세 - CSV 내보내기 헤더 및 데이터 순서 동일 적용
This commit is contained in:
@@ -291,7 +291,7 @@ public function export(Request $request): StreamedResponse
|
|||||||
$file = fopen('php://output', 'w');
|
$file = fopen('php://output', 'w');
|
||||||
fwrite($file, "\xEF\xBB\xBF"); // UTF-8 BOM
|
fwrite($file, "\xEF\xBB\xBF"); // UTF-8 BOM
|
||||||
|
|
||||||
fputcsv($file, ['사원명', '부서', '기본급', '초과근무수당', '상여금', '총지급액', '소득세', '주민세', '건강보험', '국민연금', '고용보험', '총공제액', '실수령액', '상태']);
|
fputcsv($file, ['사원명', '부서', '기본급', '고정연장근로수당', '상여금', '총지급액', '국민연금', '건강보험', '고용보험', '근로소득세', '지방소득세', '총공제액', '실수령액', '상태']);
|
||||||
|
|
||||||
foreach ($payrolls as $payroll) {
|
foreach ($payrolls as $payroll) {
|
||||||
$profile = $payroll->user?->tenantProfiles?->first();
|
$profile = $payroll->user?->tenantProfiles?->first();
|
||||||
@@ -306,11 +306,11 @@ public function export(Request $request): StreamedResponse
|
|||||||
$payroll->overtime_pay,
|
$payroll->overtime_pay,
|
||||||
$payroll->bonus,
|
$payroll->bonus,
|
||||||
$payroll->gross_salary,
|
$payroll->gross_salary,
|
||||||
|
$payroll->pension,
|
||||||
|
$payroll->health_insurance,
|
||||||
|
$payroll->employment_insurance,
|
||||||
$payroll->income_tax,
|
$payroll->income_tax,
|
||||||
$payroll->resident_tax,
|
$payroll->resident_tax,
|
||||||
$payroll->health_insurance,
|
|
||||||
$payroll->pension,
|
|
||||||
$payroll->employment_insurance,
|
|
||||||
$payroll->total_deductions,
|
$payroll->total_deductions,
|
||||||
$payroll->net_salary,
|
$payroll->net_salary,
|
||||||
$statusLabel,
|
$statusLabel,
|
||||||
|
|||||||
@@ -377,9 +377,9 @@ public function calculateAmounts(array $data, ?PayrollSetting $settings = null):
|
|||||||
$pension = $this->calculatePension($grossSalary, $settings);
|
$pension = $this->calculatePension($grossSalary, $settings);
|
||||||
$employmentInsurance = $this->calculateEmploymentInsurance($grossSalary, $settings);
|
$employmentInsurance = $this->calculateEmploymentInsurance($grossSalary, $settings);
|
||||||
|
|
||||||
// 소득세 (간이세액표)
|
// 근로소득세 (간이세액표)
|
||||||
$incomeTax = $this->calculateIncomeTax($grossSalary);
|
$incomeTax = $this->calculateIncomeTax($grossSalary);
|
||||||
// 주민세 (소득세의 10%)
|
// 지방소득세 (근로소득세의 10%)
|
||||||
$residentTax = (int) floor($incomeTax * ($settings->resident_tax_rate / 100));
|
$residentTax = (int) floor($incomeTax * ($settings->resident_tax_rate / 100));
|
||||||
|
|
||||||
// 추가 공제 합계
|
// 추가 공제 합계
|
||||||
@@ -410,7 +410,7 @@ public function calculateAmounts(array $data, ?PayrollSetting $settings = null):
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 소득세 계산 (간이세액표 기준, 부양가족 1인)
|
* 근로소득세 계산 (간이세액표 기준, 부양가족 1인)
|
||||||
*/
|
*/
|
||||||
public function calculateIncomeTax(float $grossSalary, int $dependents = 1): int
|
public function calculateIncomeTax(float $grossSalary, int $dependents = 1): int
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 f
|
|||||||
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-xs text-gray-500 mb-1">초과근무수당</label>
|
<label class="block text-xs text-gray-500 mb-1">고정연장근로수당</label>
|
||||||
<input type="number" id="payrollOvertimePay" name="overtime_pay" min="0" step="1000" value="0"
|
<input type="number" id="payrollOvertimePay" name="overtime_pay" min="0" step="1000" value="0"
|
||||||
onchange="recalculate()"
|
onchange="recalculate()"
|
||||||
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
|
||||||
@@ -212,11 +212,11 @@ class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 f
|
|||||||
<div>
|
<div>
|
||||||
<h4 class="text-sm font-medium text-gray-700 mb-2">공제 항목 (자동 계산)</h4>
|
<h4 class="text-sm font-medium text-gray-700 mb-2">공제 항목 (자동 계산)</h4>
|
||||||
<div class="bg-gray-50 rounded-lg p-3 space-y-1 text-sm">
|
<div class="bg-gray-50 rounded-lg p-3 space-y-1 text-sm">
|
||||||
<div class="flex justify-between"><span class="text-gray-500">소득세</span><span id="calcIncomeTax" class="text-gray-700">0</span></div>
|
|
||||||
<div class="flex justify-between"><span class="text-gray-500">주민세</span><span id="calcResidentTax" class="text-gray-700">0</span></div>
|
|
||||||
<div class="flex justify-between"><span class="text-gray-500">건강보험</span><span id="calcHealth" class="text-gray-700">0</span></div>
|
|
||||||
<div class="flex justify-between"><span class="text-gray-500">국민연금</span><span id="calcPension" class="text-gray-700">0</span></div>
|
<div class="flex justify-between"><span class="text-gray-500">국민연금</span><span id="calcPension" class="text-gray-700">0</span></div>
|
||||||
|
<div class="flex justify-between"><span class="text-gray-500">건강보험</span><span id="calcHealth" class="text-gray-700">0</span></div>
|
||||||
<div class="flex justify-between"><span class="text-gray-500">고용보험</span><span id="calcEmployment" class="text-gray-700">0</span></div>
|
<div class="flex justify-between"><span class="text-gray-500">고용보험</span><span id="calcEmployment" class="text-gray-700">0</span></div>
|
||||||
|
<div class="flex justify-between"><span class="text-gray-500">근로소득세</span><span id="calcIncomeTax" class="text-gray-700">0</span></div>
|
||||||
|
<div class="flex justify-between"><span class="text-gray-500">지방소득세</span><span id="calcResidentTax" class="text-gray-700">0</span></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -701,7 +701,7 @@ function openPayrollDetail(id, data) {
|
|||||||
html += '<div class="border rounded-lg overflow-hidden"><table class="w-full text-sm">';
|
html += '<div class="border rounded-lg overflow-hidden"><table class="w-full text-sm">';
|
||||||
html += '<tr class="bg-blue-50"><th class="px-4 py-2 text-left text-blue-800 font-medium" colspan="2">지급 항목</th></tr>';
|
html += '<tr class="bg-blue-50"><th class="px-4 py-2 text-left text-blue-800 font-medium" colspan="2">지급 항목</th></tr>';
|
||||||
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">기본급</td><td class="px-4 py-2 text-right">${numberFormat(data.base_salary)}</td></tr>`;
|
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">기본급</td><td class="px-4 py-2 text-right">${numberFormat(data.base_salary)}</td></tr>`;
|
||||||
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">초과근무수당</td><td class="px-4 py-2 text-right">${numberFormat(data.overtime_pay)}</td></tr>`;
|
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">고정연장근로수당</td><td class="px-4 py-2 text-right">${numberFormat(data.overtime_pay)}</td></tr>`;
|
||||||
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">상여금</td><td class="px-4 py-2 text-right">${numberFormat(data.bonus)}</td></tr>`;
|
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">상여금</td><td class="px-4 py-2 text-right">${numberFormat(data.bonus)}</td></tr>`;
|
||||||
|
|
||||||
if (data.allowances && data.allowances.length > 0) {
|
if (data.allowances && data.allowances.length > 0) {
|
||||||
@@ -713,11 +713,11 @@ function openPayrollDetail(id, data) {
|
|||||||
html += `<tr class="border-t bg-blue-50"><td class="px-4 py-2 font-medium text-blue-800">총 지급액</td><td class="px-4 py-2 text-right font-bold text-blue-700">${numberFormat(data.gross_salary)}</td></tr>`;
|
html += `<tr class="border-t bg-blue-50"><td class="px-4 py-2 font-medium text-blue-800">총 지급액</td><td class="px-4 py-2 text-right font-bold text-blue-700">${numberFormat(data.gross_salary)}</td></tr>`;
|
||||||
|
|
||||||
html += '<tr class="bg-red-50"><th class="px-4 py-2 text-left text-red-800 font-medium" colspan="2">공제 항목</th></tr>';
|
html += '<tr class="bg-red-50"><th class="px-4 py-2 text-left text-red-800 font-medium" colspan="2">공제 항목</th></tr>';
|
||||||
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">소득세</td><td class="px-4 py-2 text-right">${numberFormat(data.income_tax)}</td></tr>`;
|
|
||||||
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">주민세</td><td class="px-4 py-2 text-right">${numberFormat(data.resident_tax)}</td></tr>`;
|
|
||||||
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">건강보험</td><td class="px-4 py-2 text-right">${numberFormat(data.health_insurance)}</td></tr>`;
|
|
||||||
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">국민연금</td><td class="px-4 py-2 text-right">${numberFormat(data.pension)}</td></tr>`;
|
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">국민연금</td><td class="px-4 py-2 text-right">${numberFormat(data.pension)}</td></tr>`;
|
||||||
|
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">건강보험</td><td class="px-4 py-2 text-right">${numberFormat(data.health_insurance)}</td></tr>`;
|
||||||
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">고용보험</td><td class="px-4 py-2 text-right">${numberFormat(data.employment_insurance)}</td></tr>`;
|
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">고용보험</td><td class="px-4 py-2 text-right">${numberFormat(data.employment_insurance)}</td></tr>`;
|
||||||
|
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">근로소득세</td><td class="px-4 py-2 text-right">${numberFormat(data.income_tax)}</td></tr>`;
|
||||||
|
html += `<tr class="border-t"><td class="px-4 py-2 text-gray-500">지방소득세</td><td class="px-4 py-2 text-right">${numberFormat(data.resident_tax)}</td></tr>`;
|
||||||
|
|
||||||
if (data.deductions && data.deductions.length > 0) {
|
if (data.deductions && data.deductions.length > 0) {
|
||||||
data.deductions.forEach(d => {
|
data.deductions.forEach(d => {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
{{ number_format($payroll->base_salary) }}
|
{{ number_format($payroll->base_salary) }}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
{{-- 수당 (초과근무+상여+기타) --}}
|
{{-- 수당 (고정연장근로+상여+기타) --}}
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-right text-sm text-gray-500">
|
<td class="px-6 py-4 whitespace-nowrap text-right text-sm text-gray-500">
|
||||||
{{ $overtimeBonus > 0 ? number_format($overtimeBonus) : '-' }}
|
{{ $overtimeBonus > 0 ? number_format($overtimeBonus) : '-' }}
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user