P2-05/06 포장 단위 관리 CRUD + 이력 + 기간별 조회

- packaging_unit, packaging_unit_history 테이블 생성
- PackagingUnitModel, PackagingUnitHistoryModel
- PackagingUnit 컨트롤러 (목록/등록/수정/삭제/이력)
- 박스당팩수 x 팩당낱장수 = 총낱장수 자동 계산
- 변경 시 자동 이력 기록
- E2E 테스트 3개 전체 통과

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
javamon1174
2026-03-25 16:32:55 +09:00
parent 6949227592
commit acc9e4741e
10 changed files with 516 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<section class="border-b border-gray-300 p-2 shrink-0 bg-control-panel">
<div class="flex items-center gap-2">
<a href="<?= base_url('admin/packaging-units') ?>" class="text-blue-600 hover:underline text-sm">&larr; 포장 단위 목록</a>
<span class="text-gray-400">|</span>
<span class="text-sm font-bold text-gray-700">변경 이력 <?= esc($item->pu_bag_name) ?> (<?= esc($item->pu_bag_code) ?>)</span>
</div>
</section>
<div class="border border-gray-300 overflow-auto mt-2">
<table class="w-full data-table">
<thead>
<tr>
<th class="w-16">번호</th>
<th>변경 필드</th>
<th>이전 값</th>
<th>변경 값</th>
<th>변경일시</th>
</tr>
</thead>
<tbody class="text-right">
<?php foreach ($list as $row): ?>
<tr>
<td class="text-center"><?= esc($row->puh_idx) ?></td>
<td class="text-left pl-2"><?= esc($row->puh_field) ?></td>
<td><?= esc($row->puh_old_value) ?></td>
<td><?= esc($row->puh_new_value) ?></td>
<td class="text-center"><?= esc($row->puh_changed_at) ?></td>
</tr>
<?php endforeach; ?>
<?php if (empty($list)): ?>
<tr><td colspan="5" class="text-center text-gray-400 py-4">변경 이력이 없습니다.</td></tr>
<?php endif; ?>
</tbody>
</table>
</div>