feat: 회계 시스템 확장 — 계정과목·전표·세금계산서·카드·바로빌

- 계정과목 확장 및 더존 Smart A 표준 시딩 (전 테넌트)
- 전표 연동 시스템 구현 (JournalSyncService, SyncsExpenseAccounts)
- 세금계산서 매입/매출 필수값 조건 분리 + null 방어
- 카드거래 대시보드 리다이렉트 + 악성채권 집계 수정
- 바로빌 연동 API 엔드포인트 추가
- 복리후생 날짜 필터 + 바로빌 조인 컬럼 수정
- codebridge DB 커넥션 설정 추가
This commit is contained in:
2026-03-10 11:29:39 +09:00
parent 7ff9206f93
commit c46b950fde
24 changed files with 1850 additions and 96 deletions

View File

@@ -5,11 +5,13 @@
use App\Models\Tenants\AccountCode;
use App\Models\Tenants\JournalEntry;
use App\Models\Tenants\JournalEntryLine;
use App\Traits\SyncsExpenseAccounts;
use Illuminate\Support\Facades\DB;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
class GeneralJournalEntryService extends Service
{
use SyncsExpenseAccounts;
/**
* 일반전표입력 통합 목록 (입금 + 출금 + 수기전표)
* deposits/withdrawals는 계좌이체 건만, LEFT JOIN journal_entries로 분개 여부 표시
@@ -326,6 +328,9 @@ public function store(array $data): JournalEntry
// 분개 행 생성
$this->createLines($entry, $data['rows'], $tenantId);
// expense_accounts 동기화 (복리후생비/접대비 → CEO 대시보드)
$this->syncExpenseAccounts($entry);
return $entry->load('lines');
});
}
@@ -373,6 +378,9 @@ public function updateJournal(int $id, array $data): JournalEntry
$entry->save();
// expense_accounts 동기화 (복리후생비/접대비 → CEO 대시보드)
$this->syncExpenseAccounts($entry);
return $entry->load('lines');
});
}
@@ -389,6 +397,9 @@ public function destroyJournal(int $id): bool
->where('tenant_id', $tenantId)
->findOrFail($id);
// expense_accounts 정리 (복리후생비/접대비 → CEO 대시보드)
$this->cleanupExpenseAccounts($tenantId, $entry->id);
// lines 먼저 삭제 (soft delete가 아니므로 물리 삭제)
JournalEntryLine::query()
->where('journal_entry_id', $entry->id)
@@ -503,6 +514,9 @@ private function resolveVendorName(?int $vendorId): string
return $vendor ? $vendor->name : '';
}
// syncExpenseAccounts, cleanupExpenseAccounts, getExpenseAccountType
// → SyncsExpenseAccounts 트레이트로 이관
/**
* 원본 거래 정보 조회 (입금/출금)
*/