사이트·관리자 봉투 물류 기능(수불·통계·레포트·재고·발주)과 DB·메뉴·E2E를 운영 반영한다.

통계 분석(전년대비·월별·계절별), 수급계획·LOT 수불, 지정판매소·실사·메뉴 링크 등을 포함한다.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
taekyoungc
2026-06-01 16:15:15 +09:00
parent 21e7b91871
commit 0f1d414f37
129 changed files with 18068 additions and 1585 deletions

View File

@@ -0,0 +1,90 @@
<?php
$inspection = is_array($inspection ?? null) ? $inspection : [];
$items = is_array($items ?? null) ? $items : [];
$status = (string) ($inspection['bis_status'] ?? '');
?>
<div class="space-y-3">
<section class="border border-gray-300 bg-white p-3">
<div class="flex flex-wrap items-center justify-between gap-2">
<div class="text-sm text-gray-700">
<span class="font-bold">실사번호:</span> <?= esc((string) ($inspection['bis_idx'] ?? '')) ?>
<span class="mx-2">|</span>
<span class="font-bold">작업일자:</span> <?= esc((string) ($inspection['bis_work_date'] ?? '')) ?>
<span class="mx-2">|</span>
<span class="font-bold">상태:</span> <?= esc($status) ?>
</div>
<a href="<?= base_url('bag/inventory/inspection-select') ?>" class="text-sm text-blue-700 hover:underline">실사 선별 조회로 돌아가기</a>
</div>
</section>
<section class="border border-gray-300 bg-white p-3">
<form method="post" action="<?= base_url('bag/inventory/inspection/' . (int) ($inspection['bis_idx'] ?? 0) . '/save') ?>" class="space-y-3">
<?= csrf_field() ?>
<div class="overflow-auto">
<table class="w-full data-table text-sm">
<thead>
<tr>
<th class="w-14">번호</th>
<th>품목명</th>
<th class="w-24">전산수량</th>
<th class="w-24">실사수량</th>
<th class="w-24">차이수량</th>
<th class="w-20">반영여부</th>
</tr>
</thead>
<tbody>
<?php if ($items !== []): ?>
<?php foreach ($items as $i => $row): ?>
<?php
$itemId = (int) ($row['bisi_idx'] ?? 0);
$systemQty = (int) ($row['bisi_system_qty'] ?? 0);
$actualQty = $row['bisi_actual_qty'];
$actualQty = $actualQty === null ? '' : (string) ((int) $actualQty);
$diffQty = (int) ($row['bisi_diff_qty'] ?? 0);
?>
<tr>
<td class="text-center"><?= $i + 1 ?></td>
<td class="pl-2"><?= esc((string) ($row['bisi_bag_name'] ?? '')) ?> <span class="text-xs text-gray-400">(<?= esc((string) ($row['bisi_bag_code'] ?? '')) ?>)</span></td>
<td class="text-right pr-2"><?= number_format($systemQty) ?></td>
<td class="text-right pr-2">
<input type="number" min="0" name="actual_qty[<?= esc((string) $itemId, 'attr') ?>]" value="<?= esc($actualQty) ?>" class="border border-gray-300 rounded px-1 py-0.5 w-24 text-right">
</td>
<td class="text-right pr-2 <?= $diffQty === 0 ? '' : ($diffQty > 0 ? 'text-blue-700' : 'text-red-700') ?>"><?= number_format($diffQty) ?></td>
<td class="text-center"><?= ((string) ($row['bisi_apply_yn'] ?? 'N')) === 'Y' ? 'Y' : 'N' ?></td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr><td colspan="6" class="text-center text-gray-400 py-4">실사 품목이 없습니다.</td></tr>
<?php endif; ?>
</tbody>
</table>
</div>
<div class="flex justify-end gap-2">
<button type="submit" class="bg-btn-search text-white px-5 py-1.5 rounded-sm text-sm">실사 저장</button>
</div>
</form>
</section>
<section class="border border-gray-300 bg-white p-3">
<form method="post" action="<?= base_url('bag/inventory/inspection/' . (int) ($inspection['bis_idx'] ?? 0) . '/apply') ?>" id="inspection-apply-form">
<?= csrf_field() ?>
<div class="flex items-center justify-between">
<p class="text-sm text-gray-600">실사 저장 후 확정 시 차이수량이 현재 재고에 반영됩니다.</p>
<button type="submit" class="bg-green-600 text-white px-5 py-1.5 rounded-sm text-sm">실사 확정(재고 반영)</button>
</div>
</form>
</section>
</div>
<script>
(() => {
const form = document.getElementById('inspection-apply-form');
if (!form) return;
form.addEventListener('submit', (event) => {
const ok = window.confirm('실사 결과를 재고에 반영하시겠습니까?');
if (!ok) {
event.preventDefault();
}
});
})();
</script>