Files
jongryangje/app/Views/bag/sales.php
javamon1174 0a982aae96 사이트 /bag/* 페이지에 관리 버튼 추가 + 중구청 시드 데이터
- 발주/입고/불출/판매 페이지에 등록/취소 버튼 추가
- 기본정보 페이지에 admin 관리 링크 추가
- 불출 뷰 컬럼명 수정 (bi2_type→bi2_issue_type, bi2_destination→bi2_dest_name)
- 발주 LOT번호 컬럼명 수정 (bo_lot_number→bo_lot_no)
- 중구청(lg_idx=1) 시드 데이터 삽입 (tester_local 계정 연동)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 14:57:30 +09:00

83 lines
4.0 KiB
PHP

<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/sales') ?>" class="text-sm text-gray-500 hover:text-gray-700">초기화</a>
</form>
<!-- 주문 접수 -->
<section>
<div class="flex items-center justify-between mb-2 border-b pb-1">
<h3 class="text-base font-bold text-gray-700">주문 접수</h3>
<a href="<?= base_url('admin/shop-orders/create') ?>" class="bg-btn-search text-white px-3 py-1.5 rounded-sm text-sm">주문 등록</a>
</div>
<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($orderList)): ?>
<?php foreach ($orderList as $i => $row): ?>
<tr>
<td class="text-center"><?= $i + 1 ?></td>
<td><?= esc($row->so_shop_name ?? '') ?></td>
<td class="text-center"><?= esc($row->so_order_date ?? '') ?></td>
<td class="text-center"><?= esc($row->so_delivery_date ?? '') ?></td>
<td class="text-right"><?= number_format((int)($row->so_qty ?? 0)) ?></td>
<td class="text-right"><?= number_format((float)($row->so_amount ?? 0)) ?></td>
<td class="text-center">
<?php
$st = $row->so_status ?? 'normal';
echo match($st) { 'normal' => '정상', 'cancelled' => '<span class="text-orange-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">
<div class="flex items-center justify-between mb-2 border-b pb-1">
<h3 class="text-base font-bold text-gray-700">판매/반품</h3>
<a href="<?= base_url('admin/bag-sales/create') ?>" class="bg-btn-search text-white px-3 py-1.5 rounded-sm text-sm">판매 등록</a>
</div>
<table class="data-table">
<thead><tr>
<th class="w-16">번호</th><th>판매소</th><th>판매일</th><th>봉투코드</th><th>봉투명</th><th>수량</th><th>단가</th><th>금액</th><th>구분</th>
</tr></thead>
<tbody>
<?php if (! empty($salesList)): ?>
<?php foreach ($salesList as $i => $row): ?>
<tr>
<td class="text-center"><?= $i + 1 ?></td>
<td><?= esc($row->bs_shop_name ?? '') ?></td>
<td class="text-center"><?= esc($row->bs_sale_date ?? '') ?></td>
<td class="text-center"><?= esc($row->bs_bag_code ?? '') ?></td>
<td><?= esc($row->bs_bag_name ?? '') ?></td>
<td class="text-right"><?= number_format((int)($row->bs_qty ?? 0)) ?></td>
<td class="text-right"><?= number_format((float)($row->bs_unit_price ?? 0)) ?></td>
<td class="text-right"><?= number_format((float)($row->bs_amount ?? 0)) ?></td>
<td class="text-center">
<?php
$t = $row->bs_type ?? 'sale';
echo match($t) { 'sale' => '판매', 'return' => '<span class="text-blue-600">반품</span>', 'cancel' => '<span class="text-red-600">취소</span>', default => esc($t) };
?>
</td>
</tr>
<?php endforeach; ?>
<?php else: ?>
<tr><td colspan="9" class="text-center text-gray-400 py-4">등록된 판매/반품이 없습니다.</td></tr>
<?php endif; ?>
</tbody>
</table>
</section>
</div>