feat: 판매대장 크기 필터를 봉투/음식물/폐기물 카테고리별 그룹으로

- 크기 드롭다운을 카테고리별 optgroup(봉투(일반용)/음식물/폐기물 등)으로 묶음
- 선택값을 '카테고리|크기'(예: general|3L)로 바꿔 카테고리+크기 조합 필터링
- 엑셀저장에도 size 파라미터 반영(기존 누락 수정)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
taekyoungc
2026-06-25 14:41:55 +09:00
parent d366661b4b
commit bdeef2c69d
2 changed files with 58 additions and 15 deletions

View File

@@ -41,6 +41,9 @@ $exportParams = [
if ($cats !== []) {
$exportParams['cat'] = $cats;
}
if (($size ?? '') !== '') {
$exportParams['size'] = $size;
}
$excelUrl = mgmt_url('reports/sales-ledger?' . http_build_query($exportParams));
?>
<?= view('components/print_header', [
@@ -117,10 +120,15 @@ $excelUrl = mgmt_url('reports/sales-ledger?' . http_build_query($exportParams));
<?php endforeach; ?>
<span class="inline-flex items-center gap-1 ml-2 pl-3 border-l border-gray-200">
<span class="text-xs text-gray-600">크기</span>
<select name="size" class="border border-gray-300 rounded px-2 py-1 text-sm">
<select name="size" class="border border-gray-300 rounded px-2 py-1 text-sm min-w-[10rem]">
<option value="">전체</option>
<?php foreach (($sizeOptions ?? []) as $sz): ?>
<option value="<?= esc($sz, 'attr') ?>" <?= ($size ?? '') === $sz ? 'selected' : '' ?>><?= esc($sz) ?></option>
<?php foreach (($sizeGroups ?? []) as $g): ?>
<optgroup label="<?= esc($g['label'], 'attr') ?>">
<?php foreach (($g['sizes'] ?? []) as $sz): ?>
<?php $val = $g['key'] . '|' . $sz; ?>
<option value="<?= esc($val, 'attr') ?>" <?= ($size ?? '') === $val ? 'selected' : '' ?>><?= esc($sz) ?></option>
<?php endforeach; ?>
</optgroup>
<?php endforeach; ?>
</select>
</span>