@php($assist = App\Services\Logic\Assist::class) @php($isShow = ($mode ?? 'create') === 'show') @php($hasAllocations = !empty($this->allocations)) @php($difference = $this->getDifference()) @php($isBalanced = $this->isBalanced())
{{-- セクションヘッダー --}}

振分情報 @if($hasAllocations) ({{ count($this->allocations) }}件の請求得意先) @endif

@if(!$isShow && $hasAllocations)
@endif
@if(!$hasAllocations) {{-- 得意先未選択時のメッセージ --}}
入金得意先を選択すると、振分候補が表示されます
@else {{-- 振分テーブル --}} {{-- No --}} {{-- コード --}} {{-- 得意先名(残りスペース使用) --}} {{-- 売掛残高 --}} {{-- 振分金額 --}} @if(false) {{-- 消込機能一時非表示 --}} {{-- 消込 --}} @endif @if(false) {{-- 消込機能一時非表示 --}} @endif @foreach($this->allocations as $index => $row) @php($matchingStatus = $this->getAllocationMatchingStatus($index)) @php($rowKey = 'alloc-' . $index . '-' . ($row['customer_id'] ?? '0')) @php($totalRemaining = $row['total_remaining'] ?? 0) {{-- No --}} {{-- 得意先コード --}} {{-- 得意先名 --}} {{-- 売掛残高 --}} {{-- 振分金額 --}} @if(false) {{-- 消込機能一時非表示 --}} {{-- 消込ステータス --}} @endif @endforeach @if(false) {{-- 消込機能一時非表示 --}} @endif @if(false) {{-- 消込機能一時非表示 --}} @endif
No コード 得意先名 売掛残高 振分金額消込
{{ $index + 1 }} {{ $row['customer_code'] ?? '' }} {{ $row['customer_name'] ?? '' }} @if($totalRemaining > 0) {{ num_format($totalRemaining) }} @else - @endif @if($isShow) @else @endif
{{-- ステータスアイコン --}} {{ $matchingStatus['icon'] ?? '⚪' }} {{-- 消込ボタン(編集モードのみ & 金額が入力されている場合) --}} @if(!$isShow && ($row['amount'] ?? 0) > 0) @endif {{-- 消込済み金額サマリー --}} @if(($matchingStatus['matchedTotal'] ?? 0) > 0) ({{ num_format($matchingStatus['matchedTotal']) }}) @endif
{{-- hidden field for matchings --}}
振分合計 {{ num_format($this->allocationTotal) }}
差額 (入金合計 - 振分合計) @if($isBalanced) 0 @else {{ num_format($difference) }} @endif @if(!$isBalanced && !$isShow) 差額が0になるよう振分金額を調整してください @endif
@endif