Files
jongryangje/app/Views/bag/purchase_inbound.php

72 lines
3.4 KiB
PHP
Raw Normal View History

<div class="space-y-1">
<!-- 필터 -->
<form method="get" class="flex items-center gap-3 text-sm mb-3">
<label class="font-bold text-gray-700">조회기간</label>
<input type="date" name="start_date" value="<?= esc($startDate ?? '') ?>" class="border border-gray-300 rounded px-2 py-1 text-sm"/>
<span>~</span>
<input type="date" name="end_date" value="<?= esc($endDate ?? '') ?>" class="border border-gray-300 rounded px-2 py-1 text-sm"/>
<button type="submit" class="bg-btn-search text-white px-4 py-1.5 rounded-sm text-sm">조회</button>
<a href="<?= base_url('bag/purchase-inbound') ?>" class="text-sm text-gray-500 hover:text-gray-700">초기화</a>
</form>
<!-- 발주 현황 -->
<section>
<h3 class="text-base font-bold text-gray-700 mb-2 border-b pb-1">발주 현황</h3>
<table class="data-table">
<thead><tr>
<th class="w-16">번호</th><th>LOT번호</th><th>발주일</th><th>품목수</th><th>총수량(낱장)</th><th>총금액</th><th>상태</th>
</tr></thead>
<tbody>
<?php if (! empty($orders)): ?>
<?php foreach ($orders as $i => $row): ?>
<?php $summary = $itemSummary[$row->bo_idx] ?? ['qty' => 0, 'amount' => 0, 'count' => 0]; ?>
<tr>
<td class="text-center"><?= $i + 1 ?></td>
<td class="text-center"><?= esc($row->bo_lot_number ?? '') ?></td>
<td class="text-center"><?= esc($row->bo_order_date ?? '') ?></td>
<td class="text-right"><?= number_format($summary['count']) ?></td>
<td class="text-right"><?= number_format($summary['qty']) ?></td>
<td class="text-right"><?= number_format($summary['amount']) ?></td>
<td class="text-center">
<?php
$st = $row->bo_status ?? 'normal';
echo match($st) { 'normal' => '정상', 'cancelled' => '<span class="text-orange-600">취소</span>', 'deleted' => '<span class="text-red-600">삭제</span>', default => esc($st) };
?>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr><td colspan="7" class="text-center text-gray-400 py-4">등록된 발주가 없습니다.</td></tr>
<?php endif; ?>
</tbody>
</table>
</section>
<!-- 입고 현황 -->
<section class="mt-4">
<h3 class="text-base font-bold text-gray-700 mb-2 border-b pb-1">입고 현황</h3>
<table class="data-table">
<thead><tr>
<th class="w-16">번호</th><th>봉투코드</th><th>봉투명</th><th>박스수</th><th>낱장수</th><th>입고일</th><th>구분</th>
</tr></thead>
<tbody>
<?php if (! empty($receivings)): ?>
<?php foreach ($receivings as $i => $row): ?>
<tr>
<td class="text-center"><?= $i + 1 ?></td>
<td class="text-center"><?= esc($row->br_bag_code ?? '') ?></td>
<td><?= esc($row->br_bag_name ?? '') ?></td>
<td class="text-right"><?= number_format((int)($row->br_qty_box ?? 0)) ?></td>
<td class="text-right"><?= number_format((int)($row->br_qty_sheet ?? 0)) ?></td>
<td class="text-center"><?= esc($row->br_receive_date ?? '') ?></td>
<td class="text-center"><?= esc($row->br_type ?? '정상입고') ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr><td colspan="7" class="text-center text-gray-400 py-4">등록된 입고가 없습니다.</td></tr>
<?php endif; ?>
</tbody>
</table>
</section>
</div>