Files
javamon1174 6949227592 P2-03/04 봉투 단가 관리 CRUD + 이력 + 기간별 조회
- bag_price, bag_price_history 테이블 생성
- BagPriceModel, BagPriceHistoryModel
- BagPrice 컨트롤러 (목록/등록/수정/삭제/이력)
- 단가 변경 시 자동 이력 기록 (트랜잭션)
- 기간 필터 조회 (적용시작일/종료일)
- 봉투코드(O) 드롭다운 연동
- E2E 테스트 5개 전체 통과
- 스크린샷 2개 추가

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 16:27:42 +09:00

56 lines
3.5 KiB
PHP

<section class="border-b border-gray-300 p-2 shrink-0 bg-control-panel">
<span class="text-sm font-bold text-gray-700">봉투 단가 수정</span>
</section>
<div class="border border-gray-300 p-4 mt-2 bg-white max-w-3xl">
<form action="<?= base_url('admin/bag-prices/update/' . (int) $item->bp_idx) ?>" method="POST" class="space-y-4">
<?= csrf_field() ?>
<div class="flex flex-wrap items-center gap-2">
<label class="block text-sm font-bold text-gray-700 w-28">봉투</label>
<span class="text-sm font-mono"><?= esc($item->bp_bag_code) ?></span>
<span class="text-sm text-gray-500"><?= esc($item->bp_bag_name) ?></span>
</div>
<div class="flex flex-wrap items-center gap-2">
<label class="block text-sm font-bold text-gray-700 w-28">발주단가 <span class="text-red-500">*</span></label>
<input class="border border-gray-300 rounded px-3 py-1.5 text-sm w-40 text-right" name="bp_order_price" type="number" step="0.01" value="<?= esc(old('bp_order_price', $item->bp_order_price)) ?>" required/>
<span class="text-sm text-gray-500">원</span>
</div>
<div class="flex flex-wrap items-center gap-2">
<label class="block text-sm font-bold text-gray-700 w-28">도매가 <span class="text-red-500">*</span></label>
<input class="border border-gray-300 rounded px-3 py-1.5 text-sm w-40 text-right" name="bp_wholesale" type="number" step="0.01" value="<?= esc(old('bp_wholesale', $item->bp_wholesale)) ?>" required/>
<span class="text-sm text-gray-500">원</span>
</div>
<div class="flex flex-wrap items-center gap-2">
<label class="block text-sm font-bold text-gray-700 w-28">소비자가 <span class="text-red-500">*</span></label>
<input class="border border-gray-300 rounded px-3 py-1.5 text-sm w-40 text-right" name="bp_consumer" type="number" step="0.01" value="<?= esc(old('bp_consumer', $item->bp_consumer)) ?>" required/>
<span class="text-sm text-gray-500">원</span>
</div>
<div class="flex flex-wrap items-center gap-2">
<label class="block text-sm font-bold text-gray-700 w-28">적용시작일 <span class="text-red-500">*</span></label>
<input class="border border-gray-300 rounded px-3 py-1.5 text-sm w-44" name="bp_start_date" type="date" value="<?= esc(old('bp_start_date', $item->bp_start_date)) ?>" required/>
</div>
<div class="flex flex-wrap items-center gap-2">
<label class="block text-sm font-bold text-gray-700 w-28">적용종료일</label>
<input class="border border-gray-300 rounded px-3 py-1.5 text-sm w-44" name="bp_end_date" type="date" value="<?= esc(old('bp_end_date', $item->bp_end_date)) ?>"/>
</div>
<div class="flex flex-wrap items-center gap-2">
<label class="block text-sm font-bold text-gray-700 w-28">상태 <span class="text-red-500">*</span></label>
<select class="border border-gray-300 rounded px-3 py-1.5 text-sm w-32" name="bp_state" required>
<option value="1" <?= (int) old('bp_state', $item->bp_state) === 1 ? 'selected' : '' ?>>사용</option>
<option value="0" <?= (int) old('bp_state', $item->bp_state) === 0 ? 'selected' : '' ?>>미사용</option>
</select>
</div>
<div class="flex gap-2 pt-2">
<button type="submit" class="bg-btn-search text-white px-6 py-1.5 rounded-sm text-sm shadow hover:opacity-90 transition">수정</button>
<a href="<?= base_url('admin/bag-prices') ?>" class="bg-gray-200 text-gray-700 px-6 py-1.5 rounded-sm text-sm hover:bg-gray-300 transition">취소</a>
</div>
</form>
</div>