@php($isShow = ($mode ?? 'create') === 'show') @php($statusInfo = $this->getMatchingStatusInfo()) @php($isNoMatching = $this->isNoMatchingType()) @php($matchedTotal = $this->getMatchedTotal()) @php($difference = $this->getDifference())
{{-- ステータスアイコンと消込ボタン --}}
{{-- 消込ステータスアイコン --}} {{ $statusInfo['icon'] }} {{-- 消込ボタン(消込不要でない場合のみ表示) --}} @if(!$isNoMatching && !$isShow) @endif {{-- 消込済み金額サマリー --}} @if($matchedTotal > 0) (消込: {{ num_format($matchedTotal) }}円) @endif
{{-- 消込詳細パネル(展開時のみ表示) --}} @if($isExpanded && !$isNoMatching)
{{-- パネルヘッダー --}}

消込詳細

{{-- 金額サマリー --}}
入金額: {{ num_format($breakdownAmount) }}円
消込合計: {{ num_format($matchedTotal) }}円
差額: {{ num_format($difference) }}円 @if($difference < 0) (過入金) @elseif($difference > 0) (未消込残) @endif
{{-- 過入金メッセージ --}} @if($difference < 0)
過入金です。差額 {{ num_format(abs($difference)) }}円 は前受金として処理してください。
@endif {{-- 操作ボタン --}}
@if(count($matchings) > 0) @endif
{{-- 消込候補一覧 --}} @if(count($billingCandidates) > 0)
@foreach($billingCandidates as $candidate) @php($existingMatching = collect($matchings)->firstWhere('billing_id', $candidate['billing_id'])) @php($matchedAmount = $existingMatching ? (float)$existingMatching['matched_amount'] : 0) @php($remainingAmount = (float)($candidate['remaining_amount'] ?? 0)) @endforeach
請求番号 請求日 得意先 請求金額 未消込残高 消込金額
{{ $candidate['billing_number'] ?? '-' }} {{ $candidate['billing_date'] ?? '-' }} {{ $candidate['customer_name'] ?? '-' }} {{ num_format($candidate['billing_amount_total'] ?? 0) }} {{ num_format($remainingAmount) }}
@endif @if(count($billingCandidates) === 0)
消込可能な請求がありません
@endif {{-- 既存消込情報(データがある場合) --}} @if(count($matchings) > 0 && count($billingCandidates) === 0)
登録済み消込
@foreach($matchings as $matching)
請求ID: {{ $matching['billing_id'] ?? '-' }} {{ num_format($matching['matched_amount'] ?? 0) }}円
@endforeach
@endif
@endif