fix: [journal] 계좌 출처 전표 일반전표에서 수정 허용
- 카드/세금계산서 출처 → 잠금 유지 (원본에서 수정) - 계좌(bank_transaction) 출처 → 일반전표에서 수정 허용 - 프론트엔드 UI + 백엔드 update 메서드 동시 수정
This commit is contained in:
@@ -239,11 +239,13 @@ public function update(Request $request, int $id): JsonResponse
|
||||
$tenantId = session('selected_tenant_id', 1);
|
||||
$entry = JournalEntry::forTenant($tenantId)->findOrFail($id);
|
||||
|
||||
// 출처 연결 전표는 수정 불가 (카드/은행/홈택스 등)
|
||||
if ($entry->source_type && $entry->source_type !== 'manual') {
|
||||
// 출처 연결 전표 수정 제한 (카드/홈택스는 원본에서 수정, 계좌는 허용)
|
||||
if ($entry->source_type && ! in_array($entry->source_type, ['manual', 'bank_transaction'])) {
|
||||
$sourceLabel = $entry->source_type === 'ecard_transaction' ? '카드사용내역' : '홈택스 매출/매입';
|
||||
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => '카드/은행/홈택스 출처 전표는 직접 수정할 수 없습니다. 원본 거래에서 분개를 수정해주세요.',
|
||||
'message' => "이 전표는 {$sourceLabel}에서 수정해주세요.",
|
||||
], 403);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user