fix:일일자금일보 적요 표시 형태 개선 및 오버라이드 적용

- 입출금 내역에 오버라이드(수정된 적요/내용) 데이터 병합
- 표시 형태를 "적요 - 상대계좌예금주명"으로 변경

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-06 10:20:58 +09:00
parent 50fcffe52f
commit bca8faf850
2 changed files with 22 additions and 2 deletions

View File

@@ -6,6 +6,7 @@
use App\Models\Finance\DailyFundTransaction;
use App\Models\Finance\DailyFundMemo;
use App\Models\Barobill\BankTransaction as BarobillBankTransaction;
use App\Models\Barobill\BankTransactionOverride;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
@@ -180,6 +181,25 @@ public function periodReport(Request $request): JsonResponse
->orderBy('trans_time', 'desc')
->get();
// 오버라이드 데이터 병합 (수정된 적요/내용)
if ($transactions->isNotEmpty()) {
$uniqueKeys = $transactions->map(fn($t) => $t->unique_key)->toArray();
$overrides = BankTransactionOverride::getByUniqueKeys($tenantId, $uniqueKeys);
$transactions = $transactions->map(function ($tx) use ($overrides) {
$override = $overrides->get($tx->unique_key);
if ($override) {
if ($override->modified_summary) {
$tx->summary = $override->modified_summary;
}
if ($override->modified_cast) {
$tx->cast = $override->modified_cast;
}
}
return $tx;
});
}
// 일별로 그룹핑
$dailyData = [];
$accountBalances = []; // 계좌별 최신 잔액 추적

View File

@@ -224,7 +224,7 @@ className="px-3 py-2 border border-gray-300 rounded-lg text-sm"
{report.deposits.map((d, dIdx) => (
<tr key={dIdx} className="hover:bg-gray-50">
<td className="px-3 py-2 text-sm text-gray-800 border">
<div className="font-medium">{d.cast || d.summary}</div>
<div className="font-medium">{d.summary}{d.cast ? ` - ${d.cast}` : ''}</div>
<div className="text-xs text-gray-500">{d.bankName}</div>
</td>
<td className="px-3 py-2 text-sm text-right text-blue-600 font-medium border">
@@ -270,7 +270,7 @@ className="px-3 py-2 border border-gray-300 rounded-lg text-sm"
{report.withdrawals.map((w, wIdx) => (
<tr key={wIdx} className="hover:bg-gray-50">
<td className="px-3 py-2 text-sm text-gray-800 border">
<div className="font-medium">{w.cast || w.summary}</div>
<div className="font-medium">{w.summary}{w.cast ? ` - ${w.cast}` : ''}</div>
<div className="text-xs text-gray-500">{w.bankName}</div>
</td>
<td className="px-3 py-2 text-sm text-right text-red-600 font-medium border">