feat: enhance order sales inventory workflows

This commit is contained in:
taekyoungc
2026-04-08 00:20:09 +09:00
parent 984ddb403e
commit c2dc2fd38a
42 changed files with 764 additions and 459 deletions

View File

@@ -1,13 +1,20 @@
<?php
helper('admin');
$siteNavTree = get_site_nav_tree();
$effectiveLgIdx = admin_effective_lg_idx();
$effectiveLgName = null;
if ($effectiveLgIdx) {
$lgRow = model(\App\Models\LocalGovernmentModel::class)->find($effectiveLgIdx);
$effectiveLgName = $lgRow ? $lgRow->lg_name : null;
}
$userNav = session_user_nav_display();
?>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>쓰레기봉투 물류시스템</title>
<title>종량제 시스템</title>
<!-- Tailwind CSS v3 with Plugins -->
<script src="https://cdn.tailwindcss.com?plugins=forms,container-queries"></script>
<!-- Font: Noto Sans KR -->
@@ -90,16 +97,8 @@ $siteNavTree = get_site_nav_tree();
<!-- BEGIN: Top Navigation -->
<header class="bg-white border-b border-gray-300 h-12 flex items-center justify-between px-4 shrink-0 z-20">
<div class="flex items-center gap-4">
<!-- Logo: 파란색 사각형에 흰색 사각형 두 개 겹친 형태 (데스크톱 앱 아이콘 스타일) -->
<div class="flex items-center gap-2">
<div class="w-6 h-6 flex items-center justify-center shrink-0">
<svg class="h-5 w-5" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<rect width="16" height="16" fill="#2563eb"/>
<rect x="2" y="2" width="7" height="7" fill="white"/>
<rect x="5" y="5" width="9" height="9" fill="white"/>
</svg>
</div>
<a href="<?= base_url() ?>" class="text-base font-semibold text-gray-800 tracking-tight hover:text-blue-600">쓰레기봉투 물류시스템</a>
<?= view('components/header_brand') ?>
</div>
</div>
<!-- Nav Links -->
@@ -113,20 +112,42 @@ $siteNavTree = get_site_nav_tree();
}
?>
<?php foreach ($siteNavTree as $navItem): ?>
<?php $isActive = ($currentPath === trim((string) $navItem->mm_link, '/')); ?>
<?php
$dashboardPathAliases = ['dashboard', 'dashboard/blend'];
$navLink = menu_link_preferred_href_path($navItem->mm_link ?? null, $currentPath);
$isActive = site_nav_link_matches_current($navItem->mm_link ?? null, $currentPath, $dashboardPathAliases);
if (! $isActive && ! empty($navItem->children)) {
foreach ($navItem->children as $ch) {
if (site_nav_link_matches_current($ch->mm_link ?? null, $currentPath, $dashboardPathAliases)) {
$isActive = true;
break;
}
}
}
?>
<div class="relative group">
<a class="<?= $isActive ? 'text-blue-700 font-bold border-b-2 border-blue-700 pb-3 -mb-3' : 'hover:text-blue-600' ?>"
href="<?= base_url($navItem->mm_link) ?>">
href="<?= $navLink !== '' ? base_url($navLink) : '#' ?>">
<?= esc($navItem->mm_name) ?>
</a>
<?php if (! empty($navItem->children)): ?>
<div class="absolute left-0 top-full hidden group-hover:block bg-white border border-gray-200 rounded shadow-lg min-w-[10rem] z-30">
<div class="absolute left-0 top-full z-[200] -mt-1 pt-2 hidden group-hover:block group-focus-within:block min-w-[12rem]">
<div class="bg-white border border-gray-200 rounded shadow-lg py-1">
<?php foreach ($navItem->children as $child): ?>
<a href="<?= base_url($child->mm_link) ?>"
class="block px-3 py-1.5 text-sm text-gray-700 hover:bg-blue-50 whitespace-nowrap">
<?php
$childLink = site_nav_resolved_link_path($child->mm_link ?? null, $child->mm_name ?? null);
$childCurrent = menu_link_matches_request($child->mm_link ?? null, $currentPath, $dashboardPathAliases);
?>
<?php if ($childLink !== ''): ?>
<a href="<?= base_url($childLink) ?>"
class="block px-3 py-1.5 text-sm hover:bg-blue-50 whitespace-nowrap <?= $childCurrent ? 'text-blue-700 font-semibold bg-blue-50' : 'text-gray-700' ?>">
<?= esc($child->mm_name) ?>
</a>
<?php else: ?>
<span class="block px-3 py-1.5 text-sm text-gray-400 cursor-default whitespace-nowrap" title="경로 미매핑 — 메뉴 관리에서 링크를 넣어 주세요"><?= esc($child->mm_name) ?></span>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</div>
@@ -148,18 +169,13 @@ $siteNavTree = get_site_nav_tree();
<?php
$mbLevel = (int) session()->get('mb_level');
$isAdmin = (\Config\Roles::isSuperAdminEquivalent($mbLevel) || $mbLevel === \Config\Roles::LEVEL_LOCAL_ADMIN);
echo view('components/header_user_tools', [
'userNav' => $userNav,
'effectiveLgName' => $effectiveLgName,
'showSiteLink' => false,
'showAdminLink' => $isAdmin,
]);
?>
<!-- 관리자 이동 버튼(관리자만) · 종료 -->
<div class="flex items-center gap-2">
<?php if ($isAdmin): ?>
<a href="<?= base_url('admin') ?>" class="bg-btn-search text-white px-3 py-1.5 rounded-sm flex items-center gap-1 text-sm shadow hover:opacity-90 transition border border-transparent" title="관리자">관리자</a>
<?php endif; ?>
<a href="<?= base_url('logout') ?>" class="text-gray-500 hover:text-red-600 transition-colors inline-block p-1 rounded hover:bg-red-50" title="로그아웃">
<svg class="h-5 w-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M6 18L18 6M6 6l12 12" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>
</a>
</div>
</header>
<!-- END: Top Navigation -->
<?php if (session()->getFlashdata('success')): ?>