P2-15~18, P5-04~11, CT-05~06 웹 미구현 기능 전체 구현

P2-15: 지정판매소 다조건 조회 (이름/구군/상태 필터)
P2-17: 지정판매소 지도 표시 (Kakao Maps)
P2-18: 지정판매소 현황 (연도별 신규/취소 통계)
P5-04: 년 판매 현황 (월별 피벗 테이블)
P5-05: 지정판매소별 판매현황 (판매소별 수량/금액)
P5-06: 홈택스 세금계산서 엑셀 내보내기
P5-08: 반품/파기 현황 (기간별 조회)
P5-10: LOT 수불 조회 (LOT 번호 검색)
P5-11: 기타 입출고 (등록 + 재고 연동)
CT-05: CRUD 로깅 (activity_log 테이블 + audit_helper)
CT-06: 대시보드 실 데이터 (발주/판매/재고/불출 통계)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
javamon1174
2026-03-26 16:50:28 +09:00
parent 704141a1f0
commit 1e8bf1eeeb
20 changed files with 1216 additions and 14 deletions

View File

@@ -9,6 +9,29 @@
</div>
</div>
</section>
<!-- P2-15: 다조건 검색 -->
<section class="p-2 bg-white border-b border-gray-200 no-print">
<form method="GET" action="<?= base_url('admin/designated-shops') ?>" class="flex flex-wrap items-center gap-2">
<label class="text-sm text-gray-600">상호명</label>
<input type="text" name="ds_name" value="<?= esc($dsName ?? '') ?>" placeholder="상호명 검색" class="border border-gray-300 rounded px-2 py-1 text-sm w-40"/>
<label class="text-sm text-gray-600">구군코드</label>
<select name="ds_gugun_code" class="border border-gray-300 rounded px-2 py-1 text-sm">
<option value="">전체</option>
<?php foreach (($gugunCodes ?? []) as $gc): ?>
<option value="<?= esc($gc->ds_gugun_code) ?>" <?= ($dsGugunCode ?? '') === $gc->ds_gugun_code ? 'selected' : '' ?>><?= esc($gc->ds_gugun_code) ?></option>
<?php endforeach; ?>
</select>
<label class="text-sm text-gray-600">상태</label>
<select name="ds_state" class="border border-gray-300 rounded px-2 py-1 text-sm">
<option value="">전체</option>
<option value="1" <?= ($dsState ?? '') === '1' ? 'selected' : '' ?>>정상</option>
<option value="2" <?= ($dsState ?? '') === '2' ? 'selected' : '' ?>>폐업</option>
<option value="3" <?= ($dsState ?? '') === '3' ? 'selected' : '' ?>>직권해지</option>
</select>
<button type="submit" class="bg-btn-search text-white px-4 py-1 rounded-sm text-sm">조회</button>
<a href="<?= base_url('admin/designated-shops') ?>" class="border border-gray-300 text-gray-600 px-3 py-1 rounded-sm text-sm hover:bg-gray-50">초기화</a>
</form>
</section>
<div class="border border-gray-300 overflow-auto mt-2">
<table class="w-full data-table">
<thead>

View File

@@ -0,0 +1,56 @@
<?= view('components/print_header', ['printTitle' => '지정판매소 지도']) ?>
<section class="border-b border-gray-300 p-2 shrink-0 bg-control-panel">
<div class="flex flex-wrap items-center justify-between gap-y-2">
<span class="text-sm font-bold text-gray-700">지정판매소 지도</span>
<a href="<?= base_url('admin/designated-shops') ?>" class="border border-gray-300 text-gray-600 px-3 py-1 rounded-sm text-sm hover:bg-gray-50">목록으로</a>
</div>
</section>
<div id="kakao-map" class="w-full border border-gray-300 mt-2" style="height:600px;"></div>
<div class="mt-2 text-sm text-gray-500">총 <?= count($shops) ?>개 판매소 표시</div>
<script src="//dapi.kakao.com/v2/maps/sdk.js?appkey=KAKAO_APP_KEY&libraries=services"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
var mapContainer = document.getElementById('kakao-map');
if (typeof kakao === 'undefined' || typeof kakao.maps === 'undefined') {
mapContainer.innerHTML = '<div class="flex items-center justify-center h-full text-gray-400">카카오맵 API 키를 설정해 주세요.</div>';
return;
}
var mapOption = {
center: new kakao.maps.LatLng(35.8714, 128.6014), // 대구 기본 좌표
level: 8
};
var map = new kakao.maps.Map(mapContainer, mapOption);
var geocoder = new kakao.maps.services.Geocoder();
var shops = <?= json_encode(array_map(function($s) {
return ['name' => $s->ds_name, 'addr' => $s->ds_addr ?? '', 'rep' => $s->ds_rep_name ?? '', 'tel' => $s->ds_tel ?? ''];
}, $shops), JSON_UNESCAPED_UNICODE) ?>;
var bounds = new kakao.maps.LatLngBounds();
var markerCount = 0;
shops.forEach(function(shop) {
if (!shop.addr) return;
geocoder.addressSearch(shop.addr, function(result, status) {
if (status === kakao.maps.services.Status.OK) {
var coords = new kakao.maps.LatLng(result[0].y, result[0].x);
var marker = new kakao.maps.Marker({ map: map, position: coords });
var infoContent = '<div style="padding:5px;font-size:12px;min-width:150px;">' +
'<strong>' + shop.name + '</strong><br/>' +
(shop.rep ? '대표: ' + shop.rep + '<br/>' : '') +
(shop.tel ? 'TEL: ' + shop.tel + '<br/>' : '') +
'<span style="color:#888;">' + shop.addr + '</span></div>';
var infowindow = new kakao.maps.InfoWindow({ content: infoContent });
kakao.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
bounds.extend(coords);
markerCount++;
if (markerCount > 0) map.setBounds(bounds);
}
});
});
});
</script>

View File

@@ -0,0 +1,80 @@
<?= view('components/print_header', ['printTitle' => '지정판매소 현황']) ?>
<section class="border-b border-gray-300 p-2 shrink-0 bg-control-panel">
<div class="flex flex-wrap items-center justify-between gap-y-2">
<span class="text-sm font-bold text-gray-700">지정판매소 현황 (신규/취소)</span>
<div class="flex items-center gap-2">
<button onclick="window.print()" class="no-print border border-btn-print-border text-gray-600 px-3 py-1 rounded-sm text-sm hover:bg-gray-50 transition">인쇄</button>
<a href="<?= base_url('admin/designated-shops') ?>" class="border border-gray-300 text-gray-600 px-3 py-1 rounded-sm text-sm hover:bg-gray-50">목록으로</a>
</div>
</div>
</section>
<!-- 전체 현황 요약 -->
<div class="flex gap-4 mt-2 mb-2">
<div class="border border-gray-300 p-3 flex-1 text-center">
<div class="text-sm text-gray-500">활성 판매소</div>
<div class="text-2xl font-bold text-green-600"><?= number_format($totalActive) ?></div>
</div>
<div class="border border-gray-300 p-3 flex-1 text-center">
<div class="text-sm text-gray-500">비활성/취소 판매소</div>
<div class="text-2xl font-bold text-red-600"><?= number_format($totalInactive) ?></div>
</div>
<div class="border border-gray-300 p-3 flex-1 text-center">
<div class="text-sm text-gray-500">전체</div>
<div class="text-2xl font-bold text-gray-700"><?= number_format($totalActive + $totalInactive) ?></div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 mt-2">
<!-- 연도별 신규등록 -->
<div>
<h3 class="text-sm font-bold text-gray-700 mb-1">연도별 신규등록 건수</h3>
<div class="border border-gray-300 overflow-auto">
<table class="w-full data-table">
<thead>
<tr>
<th>연도</th>
<th>신규등록 건수</th>
</tr>
</thead>
<tbody class="text-right">
<?php foreach ($newByYear as $row): ?>
<tr>
<td class="text-center"><?= esc($row->yr) ?>년</td>
<td><?= number_format((int) $row->cnt) ?></td>
</tr>
<?php endforeach; ?>
<?php if (empty($newByYear)): ?>
<tr><td colspan="2" class="text-center text-gray-400 py-4">데이터가 없습니다.</td></tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
<!-- 연도별 취소/비활성 -->
<div>
<h3 class="text-sm font-bold text-gray-700 mb-1">연도별 취소/비활성 건수</h3>
<div class="border border-gray-300 overflow-auto">
<table class="w-full data-table">
<thead>
<tr>
<th>연도</th>
<th>취소/비활성 건수</th>
</tr>
</thead>
<tbody class="text-right">
<?php foreach ($cancelByYear as $row): ?>
<tr>
<td class="text-center"><?= esc($row->yr) ?>년</td>
<td><?= number_format((int) $row->cnt) ?></td>
</tr>
<?php endforeach; ?>
<?php if (empty($cancelByYear)): ?>
<tr><td colspan="2" class="text-center text-gray-400 py-4">데이터가 없습니다.</td></tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>