fix: [journal] 급여 전표 수정 허용 및 source_type 라벨 개선

- payroll source_type 전표 수정 허용 (기존: manual, bank_transaction만)
- source_type별 정확한 라벨 매핑 (카드사용내역, 홈택스 매출/매입)
- 프론트/백엔드 양쪽 수정
This commit is contained in:
김보곤
2026-03-10 11:37:45 +09:00
parent 764ae09615
commit 129b383ed5
2 changed files with 17 additions and 5 deletions

View File

@@ -239,9 +239,15 @@ public function update(Request $request, int $id): JsonResponse
$tenantId = session('selected_tenant_id', 1);
$entry = JournalEntry::forTenant($tenantId)->findOrFail($id);
// 출처 연결 전표 수정 제한 (카드/홈택스는 원본에서 수정, 계좌는 허용)
if ($entry->source_type && ! in_array($entry->source_type, ['manual', 'bank_transaction'])) {
$sourceLabel = $entry->source_type === 'ecard_transaction' ? '카드사용내역' : '홈택스 매출/매입';
// 출처 연결 전표 수정 제한 (카드/홈택스는 원본에서 수정, 계좌/급여는 허용)
$editableTypes = ['manual', 'bank_transaction', 'payroll'];
if ($entry->source_type && ! in_array($entry->source_type, $editableTypes)) {
$sourceLabels = [
'ecard_transaction' => '카드사용내역',
'hometax_sales' => '홈택스 매출',
'hometax_purchase' => '홈택스 매입',
];
$sourceLabel = $sourceLabels[$entry->source_type] ?? '홈택스 매출/매입';
return response()->json([
'success' => false,