fix: [finance] 전체 하드코딩 계정코드 3자리→5자리 수정
- 급여전표: 801→80100, 207→20700, 205→20500 - 카드전표: 135→13500, 826→82600, 205→20500 - 홈택스분개: 108→10800, 401→40100, 208→20800, 501→50100, 117→11700, 201→20100 - 일반전표: 135→13500, 253→25300, 103→10300
This commit is contained in:
@@ -842,11 +842,11 @@ public function generateJournalEntry(Request $request): JsonResponse
|
||||
}
|
||||
|
||||
// 계정과목 조회
|
||||
$accountCodes = AccountCode::whereIn('code', ['801', '207', '205'])
|
||||
$accountCodes = AccountCode::whereIn('code', ['80100', '20700', '20500'])
|
||||
->where('is_active', true)
|
||||
->pluck('name', 'code');
|
||||
|
||||
$missingCodes = array_diff(['801', '207', '205'], $accountCodes->keys()->toArray());
|
||||
$missingCodes = array_diff(['80100', '20700', '20500'], $accountCodes->keys()->toArray());
|
||||
if (! empty($missingCodes)) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
@@ -885,12 +885,12 @@ public function generateJournalEntry(Request $request): JsonResponse
|
||||
}
|
||||
}
|
||||
|
||||
// 1. 차변: 801 급여 / 임직원 — 총지급액
|
||||
// 1. 차변: 80100 급여 / 임직원 — 총지급액
|
||||
if ($grossAmount > 0) {
|
||||
$lines[] = [
|
||||
'dc_type' => 'debit',
|
||||
'account_code' => '801',
|
||||
'account_name' => $accountCodes['801'],
|
||||
'account_code' => '80100',
|
||||
'account_name' => $accountCodes['80100'],
|
||||
'trading_partner_id' => $partners['임직원'],
|
||||
'trading_partner_name' => '임직원',
|
||||
'debit_amount' => $grossAmount,
|
||||
@@ -916,8 +916,8 @@ public function generateJournalEntry(Request $request): JsonResponse
|
||||
} else {
|
||||
$creditLines[$mergeKey] = [
|
||||
'dc_type' => 'credit',
|
||||
'account_code' => '207',
|
||||
'account_name' => $accountCodes['207'],
|
||||
'account_code' => '20700',
|
||||
'account_name' => $accountCodes['20700'],
|
||||
'trading_partner_id' => $partners[$partnerName],
|
||||
'trading_partner_name' => $partnerName,
|
||||
'debit_amount' => 0,
|
||||
@@ -935,12 +935,12 @@ public function generateJournalEntry(Request $request): JsonResponse
|
||||
$lines[] = $creditLine;
|
||||
}
|
||||
|
||||
// 최종: 대변 205 미지급비용 / 임직원 — 실수령액 (DB 값)
|
||||
// 최종: 대변 20500 미지급비용 / 임직원 — 실수령액 (DB 값)
|
||||
if ($netSalary > 0) {
|
||||
$lines[] = [
|
||||
'dc_type' => 'credit',
|
||||
'account_code' => '205',
|
||||
'account_name' => $accountCodes['205'],
|
||||
'account_code' => '20500',
|
||||
'account_name' => $accountCodes['20500'],
|
||||
'trading_partner_id' => $partners['임직원'],
|
||||
'trading_partner_name' => '임직원',
|
||||
'debit_amount' => 0,
|
||||
|
||||
Reference in New Issue
Block a user