사이트 메뉴 CRUD를 /bag/* 경로로 통합 — 관리자 레이아웃 혼용 해결
- Bag 컨트롤러에 create/store 메서드 추가 (불출/발주/입고/판매/주문) - bag용 create 뷰 5개 생성 (form action을 /bag/*로 변경) - 모든 등록/취소 버튼을 /admin/* → /bag/*로 변경 - 사이트 레이아웃이 CRUD 전체에서 유지됨 - playwright.production.config.js 추가 (도메인 테스트용) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,19 @@ $routes->get('bag/analytics', 'Bag::analytics');
|
|||||||
$routes->get('bag/window', 'Bag::window');
|
$routes->get('bag/window', 'Bag::window');
|
||||||
$routes->get('bag/help', 'Bag::help');
|
$routes->get('bag/help', 'Bag::help');
|
||||||
|
|
||||||
|
// 사이트 메뉴 CRUD (사이트 레이아웃)
|
||||||
|
$routes->get('bag/issue/create', 'Bag::issueCreate');
|
||||||
|
$routes->post('bag/issue/store', 'Bag::issueStore');
|
||||||
|
$routes->post('bag/issue/cancel/(:num)', 'Bag::issueCancel/$1');
|
||||||
|
$routes->get('bag/order/create', 'Bag::orderCreate');
|
||||||
|
$routes->post('bag/order/store', 'Bag::orderStore');
|
||||||
|
$routes->get('bag/receiving/create', 'Bag::receivingCreate');
|
||||||
|
$routes->post('bag/receiving/store', 'Bag::receivingStore');
|
||||||
|
$routes->get('bag/sale/create', 'Bag::saleCreate');
|
||||||
|
$routes->post('bag/sale/store', 'Bag::saleStore');
|
||||||
|
$routes->get('bag/shop-order/create', 'Bag::shopOrderCreate');
|
||||||
|
$routes->post('bag/shop-order/store', 'Bag::shopOrderStore');
|
||||||
|
|
||||||
// Auth
|
// Auth
|
||||||
$routes->get('login', 'Auth::showLoginForm');
|
$routes->get('login', 'Auth::showLoginForm');
|
||||||
$routes->post('login', 'Auth::login');
|
$routes->post('login', 'Auth::login');
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ use App\Models\CompanyModel;
|
|||||||
use App\Models\PackagingUnitModel;
|
use App\Models\PackagingUnitModel;
|
||||||
use App\Models\SalesAgencyModel;
|
use App\Models\SalesAgencyModel;
|
||||||
use App\Models\ShopOrderModel;
|
use App\Models\ShopOrderModel;
|
||||||
|
use App\Models\DesignatedShopModel;
|
||||||
|
|
||||||
class Bag extends BaseController
|
class Bag extends BaseController
|
||||||
{
|
{
|
||||||
@@ -247,4 +248,124 @@ class Bag extends BaseController
|
|||||||
{
|
{
|
||||||
return $this->render('도움말', 'bag/help', []);
|
return $this->render('도움말', 'bag/help', []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ══════════════════════════════════════════════
|
||||||
|
// CRUD — 사이트 레이아웃으로 등록/처리 폼 제공
|
||||||
|
// ══════════════════════════════════════════════
|
||||||
|
|
||||||
|
// --- 불출 등록 ---
|
||||||
|
public function issueCreate(): string
|
||||||
|
{
|
||||||
|
$kind = model(CodeKindModel::class)->where('ck_code', 'O')->first();
|
||||||
|
$bagCodes = $kind ? model(CodeDetailModel::class)->where('cd_ck_idx', $kind->ck_idx)->where('cd_state', 1)->orderBy('cd_sort')->findAll() : [];
|
||||||
|
return $this->render('불출 처리', 'bag/create_bag_issue', compact('bagCodes'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function issueStore()
|
||||||
|
{
|
||||||
|
$admin = new \App\Controllers\Admin\BagIssue();
|
||||||
|
$admin->initController($this->request, $this->response, service('logger'));
|
||||||
|
$result = $admin->store();
|
||||||
|
if ($result instanceof \CodeIgniter\HTTP\RedirectResponse) {
|
||||||
|
$to = (string) $result->getHeaderLine('Location');
|
||||||
|
$to = str_replace('/admin/bag-issues', '/bag/issue', $to);
|
||||||
|
return redirect()->to($to)->with('success', session()->getFlashdata('success'))->with('errors', session()->getFlashdata('errors'));
|
||||||
|
}
|
||||||
|
return redirect()->to(site_url('bag/issue'))->with('success', '불출 처리되었습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function issueCancel(int $id)
|
||||||
|
{
|
||||||
|
$admin = new \App\Controllers\Admin\BagIssue();
|
||||||
|
$admin->initController($this->request, $this->response, service('logger'));
|
||||||
|
$admin->cancel($id);
|
||||||
|
return redirect()->to(site_url('bag/issue'))->with('success', session()->getFlashdata('success') ?? '취소되었습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 발주 등록 ---
|
||||||
|
public function orderCreate(): string
|
||||||
|
{
|
||||||
|
helper('admin');
|
||||||
|
$lgIdx = $this->lgIdx();
|
||||||
|
$companies = $lgIdx ? model(CompanyModel::class)->where('cp_lg_idx', $lgIdx)->where('cp_type', 'manufacturer')->where('cp_state', 1)->findAll() : [];
|
||||||
|
$agencies = $lgIdx ? model(SalesAgencyModel::class)->where('sa_lg_idx', $lgIdx)->where('sa_state', 1)->findAll() : [];
|
||||||
|
$kind = model(CodeKindModel::class)->where('ck_code', 'O')->first();
|
||||||
|
$bagCodes = $kind ? model(CodeDetailModel::class)->where('cd_ck_idx', $kind->ck_idx)->where('cd_state', 1)->orderBy('cd_sort')->findAll() : [];
|
||||||
|
return $this->render('발주 등록', 'bag/create_bag_order', compact('companies', 'agencies', 'bagCodes'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function orderStore()
|
||||||
|
{
|
||||||
|
$admin = new \App\Controllers\Admin\BagOrder();
|
||||||
|
$admin->initController($this->request, $this->response, service('logger'));
|
||||||
|
$result = $admin->store();
|
||||||
|
if ($result instanceof \CodeIgniter\HTTP\RedirectResponse) {
|
||||||
|
return redirect()->to(site_url('bag/purchase-inbound'))->with('success', session()->getFlashdata('success'))->with('errors', session()->getFlashdata('errors'));
|
||||||
|
}
|
||||||
|
return redirect()->to(site_url('bag/purchase-inbound'))->with('success', '발주 등록되었습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 입고 처리 ---
|
||||||
|
public function receivingCreate(): string
|
||||||
|
{
|
||||||
|
helper('admin');
|
||||||
|
$lgIdx = $this->lgIdx();
|
||||||
|
$orders = $lgIdx ? model(BagOrderModel::class)->where('bo_lg_idx', $lgIdx)->where('bo_status', 'normal')->orderBy('bo_order_date', 'DESC')->findAll() : [];
|
||||||
|
return $this->render('입고 처리', 'bag/create_bag_receiving', compact('orders'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function receivingStore()
|
||||||
|
{
|
||||||
|
$admin = new \App\Controllers\Admin\BagReceiving();
|
||||||
|
$admin->initController($this->request, $this->response, service('logger'));
|
||||||
|
$result = $admin->store();
|
||||||
|
if ($result instanceof \CodeIgniter\HTTP\RedirectResponse) {
|
||||||
|
return redirect()->to(site_url('bag/purchase-inbound'))->with('success', session()->getFlashdata('success'))->with('errors', session()->getFlashdata('errors'));
|
||||||
|
}
|
||||||
|
return redirect()->to(site_url('bag/purchase-inbound'))->with('success', '입고 처리되었습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 판매 등록 ---
|
||||||
|
public function saleCreate(): string
|
||||||
|
{
|
||||||
|
helper('admin');
|
||||||
|
$lgIdx = $this->lgIdx();
|
||||||
|
$shops = $lgIdx ? model(DesignatedShopModel::class)->where('ds_lg_idx', $lgIdx)->where('ds_state', 1)->findAll() : [];
|
||||||
|
$kind = model(CodeKindModel::class)->where('ck_code', 'O')->first();
|
||||||
|
$bagCodes = $kind ? model(CodeDetailModel::class)->where('cd_ck_idx', $kind->ck_idx)->where('cd_state', 1)->orderBy('cd_sort')->findAll() : [];
|
||||||
|
return $this->render('판매 등록', 'bag/create_bag_sale', compact('shops', 'bagCodes'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function saleStore()
|
||||||
|
{
|
||||||
|
$admin = new \App\Controllers\Admin\BagSale();
|
||||||
|
$admin->initController($this->request, $this->response, service('logger'));
|
||||||
|
$result = $admin->store();
|
||||||
|
if ($result instanceof \CodeIgniter\HTTP\RedirectResponse) {
|
||||||
|
return redirect()->to(site_url('bag/sales'))->with('success', session()->getFlashdata('success'))->with('errors', session()->getFlashdata('errors'));
|
||||||
|
}
|
||||||
|
return redirect()->to(site_url('bag/sales'))->with('success', '판매 등록되었습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 주문 접수 ---
|
||||||
|
public function shopOrderCreate(): string
|
||||||
|
{
|
||||||
|
helper('admin');
|
||||||
|
$lgIdx = $this->lgIdx();
|
||||||
|
$shops = $lgIdx ? model(DesignatedShopModel::class)->where('ds_lg_idx', $lgIdx)->where('ds_state', 1)->findAll() : [];
|
||||||
|
$kind = model(CodeKindModel::class)->where('ck_code', 'O')->first();
|
||||||
|
$bagCodes = $kind ? model(CodeDetailModel::class)->where('cd_ck_idx', $kind->ck_idx)->where('cd_state', 1)->orderBy('cd_sort')->findAll() : [];
|
||||||
|
return $this->render('주문 접수', 'bag/create_shop_order', compact('shops', 'bagCodes'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function shopOrderStore()
|
||||||
|
{
|
||||||
|
$admin = new \App\Controllers\Admin\ShopOrder();
|
||||||
|
$admin->initController($this->request, $this->response, service('logger'));
|
||||||
|
$result = $admin->store();
|
||||||
|
if ($result instanceof \CodeIgniter\HTTP\RedirectResponse) {
|
||||||
|
return redirect()->to(site_url('bag/sales'))->with('success', session()->getFlashdata('success'))->with('errors', session()->getFlashdata('errors'));
|
||||||
|
}
|
||||||
|
return redirect()->to(site_url('bag/sales'))->with('success', '주문 접수되었습니다.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
70
app/Views/bag/create_bag_issue.php
Normal file
70
app/Views/bag/create_bag_issue.php
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
<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('bag/issue/store') ?>" 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">연도 <span class="text-red-500">*</span></label>
|
||||||
|
<input class="border border-gray-300 rounded px-3 py-1.5 text-sm w-32 text-right" name="bi2_year" type="number" min="2000" max="2099" value="<?= esc(old('bi2_year', date('Y'))) ?>" required/>
|
||||||
|
</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="bi2_quarter" required>
|
||||||
|
<option value="">선택</option>
|
||||||
|
<option value="1" <?= old('bi2_quarter') === '1' ? 'selected' : '' ?>>1</option>
|
||||||
|
<option value="2" <?= old('bi2_quarter') === '2' ? 'selected' : '' ?>>2</option>
|
||||||
|
<option value="3" <?= old('bi2_quarter') === '3' ? 'selected' : '' ?>>3</option>
|
||||||
|
<option value="4" <?= old('bi2_quarter') === '4' ? 'selected' : '' ?>>4</option>
|
||||||
|
</select>
|
||||||
|
</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-44" name="bi2_issue_type" required>
|
||||||
|
<option value="">선택</option>
|
||||||
|
<option value="무료용" <?= old('bi2_issue_type') === '무료용' ? 'selected' : '' ?>>무료용</option>
|
||||||
|
<option value="공공용" <?= old('bi2_issue_type') === '공공용' ? 'selected' : '' ?>>공공용</option>
|
||||||
|
</select>
|
||||||
|
</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="bi2_issue_date" type="date" value="<?= esc(old('bi2_issue_date', date('Y-m-d'))) ?>" 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="bi2_dest_type" type="text" placeholder="동사무소" value="<?= esc(old('bi2_dest_type')) ?>"/>
|
||||||
|
</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-60" name="bi2_dest_name" type="text" value="<?= esc(old('bi2_dest_name')) ?>" required/>
|
||||||
|
</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-60" name="bi2_bag_code" required>
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($bagCodes as $cd): ?>
|
||||||
|
<option value="<?= esc($cd->cd_code) ?>" <?= old('bi2_bag_code') === $cd->cd_code ? 'selected' : '' ?>>
|
||||||
|
<?= esc($cd->cd_code) ?> — <?= esc($cd->cd_name) ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</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-32 text-right" name="bi2_qty" type="number" min="0" value="<?= esc(old('bi2_qty', '0')) ?>" required/>
|
||||||
|
</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('bag/issue') ?>" 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>
|
||||||
83
app/Views/bag/create_bag_order.php
Normal file
83
app/Views/bag/create_bag_order.php
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<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-4xl">
|
||||||
|
<form action="<?= base_url('bag/order/store') ?>" 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">발주일 <span class="text-red-500">*</span></label>
|
||||||
|
<input class="border border-gray-300 rounded px-3 py-1.5 text-sm w-44" name="bo_order_date" type="date" value="<?= esc(old('bo_order_date', date('Y-m-d'))) ?>" 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-32 text-right" name="bo_fee_rate" type="number" step="0.01" value="<?= esc(old('bo_fee_rate', '0')) ?>"/>
|
||||||
|
<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">제작업체</label>
|
||||||
|
<select class="border border-gray-300 rounded px-3 py-1.5 text-sm w-60" name="bo_company_idx">
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($companies as $cp): ?>
|
||||||
|
<option value="<?= esc($cp->cp_idx) ?>" <?= (int) old('bo_company_idx') === (int) $cp->cp_idx ? 'selected' : '' ?>>
|
||||||
|
<?= esc($cp->cp_name) ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
|
<label class="block text-sm font-bold text-gray-700 w-28">입고처</label>
|
||||||
|
<select class="border border-gray-300 rounded px-3 py-1.5 text-sm w-60" name="bo_agency_idx">
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($agencies as $ag): ?>
|
||||||
|
<option value="<?= esc($ag->sa_idx) ?>" <?= (int) old('bo_agency_idx') === (int) $ag->sa_idx ? 'selected' : '' ?>>
|
||||||
|
<?= esc($ag->sa_name) ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-4">
|
||||||
|
<label class="block text-sm font-bold text-gray-700 mb-2">발주 품목</label>
|
||||||
|
<div class="border border-gray-300 overflow-auto">
|
||||||
|
<table class="w-full data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="w-16">순번</th>
|
||||||
|
<th>봉투</th>
|
||||||
|
<th class="w-32">박스수</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php for ($i = 0; $i < 3; $i++): ?>
|
||||||
|
<tr>
|
||||||
|
<td class="text-center"><?= $i + 1 ?></td>
|
||||||
|
<td>
|
||||||
|
<select class="border border-gray-300 rounded px-2 py-1 text-sm w-full" name="item_bag_code[]">
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($bagCodes as $cd): ?>
|
||||||
|
<option value="<?= esc($cd->cd_code) ?>">
|
||||||
|
<?= esc($cd->cd_code) ?> — <?= esc($cd->cd_name) ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input class="border border-gray-300 rounded px-2 py-1 text-sm w-full text-right" name="item_qty_box[]" type="number" min="0" value="0"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endfor; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</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('bag/purchase-inbound') ?>" 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>
|
||||||
53
app/Views/bag/create_bag_receiving.php
Normal file
53
app/Views/bag/create_bag_receiving.php
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<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('bag/receiving/store') ?>" 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>
|
||||||
|
<select class="border border-gray-300 rounded px-3 py-1.5 text-sm w-72" name="br_bo_idx">
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($orders as $od): ?>
|
||||||
|
<option value="<?= esc($od->bo_idx) ?>" <?= (int) old('br_bo_idx') === (int) $od->bo_idx ? 'selected' : '' ?>>
|
||||||
|
<?= esc($od->bo_lot_no) ?> (<?= esc($od->bo_order_date) ?>)
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</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="br_bag_code" type="text" value="<?= esc(old('br_bag_code')) ?>"/>
|
||||||
|
</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-32 text-right" name="br_qty_box" type="number" min="0" value="<?= esc(old('br_qty_box', '0')) ?>" required/>
|
||||||
|
</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="br_receive_date" type="date" value="<?= esc(old('br_receive_date', date('Y-m-d'))) ?>" 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="br_sender_name" type="text" value="<?= esc(old('br_sender_name')) ?>"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
|
<label class="block text-sm font-bold text-gray-700 w-28">구분</label>
|
||||||
|
<select class="border border-gray-300 rounded px-3 py-1.5 text-sm w-44" name="br_type">
|
||||||
|
<option value="batch" <?= old('br_type') === 'batch' ? 'selected' : '' ?>>batch</option>
|
||||||
|
<option value="scanner" <?= old('br_type') === 'scanner' ? 'selected' : '' ?>>scanner</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('bag/purchase-inbound') ?>" 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>
|
||||||
56
app/Views/bag/create_bag_sale.php
Normal file
56
app/Views/bag/create_bag_sale.php
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<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('bag/sale/store') ?>" 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">판매소 <span class="text-red-500">*</span></label>
|
||||||
|
<select class="border border-gray-300 rounded px-3 py-1.5 text-sm w-60" name="bs_ds_idx" required>
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($shops as $shop): ?>
|
||||||
|
<option value="<?= esc($shop->ds_idx) ?>" <?= (int) old('bs_ds_idx') === (int) $shop->ds_idx ? 'selected' : '' ?>>
|
||||||
|
<?= esc($shop->ds_name) ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</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-60" name="bs_bag_code" required>
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($bagCodes as $cd): ?>
|
||||||
|
<option value="<?= esc($cd->cd_code) ?>" <?= old('bs_bag_code') === $cd->cd_code ? 'selected' : '' ?>>
|
||||||
|
<?= esc($cd->cd_code) ?> — <?= esc($cd->cd_name) ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</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-32 text-right" name="bs_qty" type="number" min="0" value="<?= esc(old('bs_qty', '0')) ?>" required/>
|
||||||
|
</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="bs_sale_date" type="date" value="<?= esc(old('bs_sale_date', date('Y-m-d'))) ?>" required/>
|
||||||
|
</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-44" name="bs_type" required>
|
||||||
|
<option value="">선택</option>
|
||||||
|
<option value="sale" <?= old('bs_type') === 'sale' ? 'selected' : '' ?>>판매</option>
|
||||||
|
<option value="return" <?= old('bs_type') === 'return' ? '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('bag/sales') ?>" 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>
|
||||||
74
app/Views/bag/create_shop_order.php
Normal file
74
app/Views/bag/create_shop_order.php
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<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-4xl">
|
||||||
|
<form action="<?= base_url('bag/shop-order/store') ?>" 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">판매소 <span class="text-red-500">*</span></label>
|
||||||
|
<select class="border border-gray-300 rounded px-3 py-1.5 text-sm w-60" name="so_ds_idx" required>
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($shops as $shop): ?>
|
||||||
|
<option value="<?= esc($shop->ds_idx) ?>" <?= (int) old('so_ds_idx') === (int) $shop->ds_idx ? 'selected' : '' ?>>
|
||||||
|
<?= esc($shop->ds_name) ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</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="so_delivery_date" type="date" value="<?= esc(old('so_delivery_date', date('Y-m-d', strtotime('+1 day')))) ?>" required/>
|
||||||
|
</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-44" name="so_payment_type" required>
|
||||||
|
<option value="">선택</option>
|
||||||
|
<option value="이체" <?= old('so_payment_type') === '이체' ? 'selected' : '' ?>>이체</option>
|
||||||
|
<option value="가상계좌" <?= old('so_payment_type') === '가상계좌' ? 'selected' : '' ?>>가상계좌</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-4">
|
||||||
|
<label class="block text-sm font-bold text-gray-700 mb-2">주문 품목</label>
|
||||||
|
<div class="border border-gray-300 overflow-auto">
|
||||||
|
<table class="w-full data-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="w-16">순번</th>
|
||||||
|
<th>봉투</th>
|
||||||
|
<th class="w-32">수량</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php for ($i = 0; $i < 3; $i++): ?>
|
||||||
|
<tr>
|
||||||
|
<td class="text-center"><?= $i + 1 ?></td>
|
||||||
|
<td>
|
||||||
|
<select class="border border-gray-300 rounded px-2 py-1 text-sm w-full" name="item_bag_code[]">
|
||||||
|
<option value="">선택</option>
|
||||||
|
<?php foreach ($bagCodes as $cd): ?>
|
||||||
|
<option value="<?= esc($cd->cd_code) ?>">
|
||||||
|
<?= esc($cd->cd_code) ?> — <?= esc($cd->cd_name) ?>
|
||||||
|
</option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input class="border border-gray-300 rounded px-2 py-1 text-sm w-full text-right" name="item_qty[]" type="number" min="0" value="0"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endfor; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</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('bag/sales') ?>" 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>
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
<button type="submit" class="bg-btn-search text-white px-4 py-1.5 rounded-sm text-sm">조회</button>
|
<button type="submit" class="bg-btn-search text-white px-4 py-1.5 rounded-sm text-sm">조회</button>
|
||||||
<a href="<?= base_url('bag/issue') ?>" class="text-sm text-gray-500 hover:text-gray-700">초기화</a>
|
<a href="<?= base_url('bag/issue') ?>" class="text-sm text-gray-500 hover:text-gray-700">초기화</a>
|
||||||
</form>
|
</form>
|
||||||
<a href="<?= base_url('admin/bag-issues/create') ?>" class="bg-btn-search text-white px-3 py-1.5 rounded-sm text-sm">불출 처리</a>
|
<a href="<?= base_url('bag/issue/create') ?>" class="bg-btn-search text-white px-3 py-1.5 rounded-sm text-sm">불출 처리</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class="data-table">
|
<table class="data-table">
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<?php if (($row->bi2_status ?? '') === 'normal'): ?>
|
<?php if (($row->bi2_status ?? '') === 'normal'): ?>
|
||||||
<form method="post" action="<?= base_url('admin/bag-issues/cancel/' . $row->bi2_idx) ?>" class="inline" onsubmit="return confirm('취소하시겠습니까?')">
|
<form method="post" action="<?= base_url('bag/issue/cancel/' . $row->bi2_idx) ?>" class="inline" onsubmit="return confirm('취소하시겠습니까?')">
|
||||||
<?= csrf_field() ?>
|
<?= csrf_field() ?>
|
||||||
<button class="text-orange-600 hover:underline text-xs">취소</button>
|
<button class="text-orange-600 hover:underline text-xs">취소</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<section>
|
<section>
|
||||||
<div class="flex items-center justify-between mb-2 border-b pb-1">
|
<div class="flex items-center justify-between mb-2 border-b pb-1">
|
||||||
<h3 class="text-base font-bold text-gray-700">발주 현황</h3>
|
<h3 class="text-base font-bold text-gray-700">발주 현황</h3>
|
||||||
<a href="<?= base_url('admin/bag-orders/create') ?>" class="bg-btn-search text-white px-3 py-1.5 rounded-sm text-sm">발주 등록</a>
|
<a href="<?= base_url('bag/order/create') ?>" class="bg-btn-search text-white px-3 py-1.5 rounded-sm text-sm">발주 등록</a>
|
||||||
</div>
|
</div>
|
||||||
<table class="data-table">
|
<table class="data-table">
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
@@ -37,9 +37,9 @@
|
|||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<a href="<?= base_url('admin/bag-orders/detail/' . $row->bo_idx) ?>" class="text-blue-600 hover:underline text-xs">상세</a>
|
<a href="<?= base_url('bag/purchase-inbound?detail=' . $row->bo_idx) ?>" class="text-blue-600 hover:underline text-xs">상세</a>
|
||||||
<?php if (($row->bo_status ?? '') === 'normal'): ?>
|
<?php if (($row->bo_status ?? '') === 'normal'): ?>
|
||||||
<form method="post" action="<?= base_url('admin/bag-orders/cancel/' . $row->bo_idx) ?>" class="inline" onsubmit="return confirm('취소하시겠습니까?')">
|
<form method="post" action="<?= base_url('bag/order/cancel/' . $row->bo_idx) ?>" class="inline" onsubmit="return confirm('취소하시겠습니까?')">
|
||||||
<?= csrf_field() ?>
|
<?= csrf_field() ?>
|
||||||
<button class="text-orange-600 hover:underline text-xs ml-1">취소</button>
|
<button class="text-orange-600 hover:underline text-xs ml-1">취소</button>
|
||||||
</form>
|
</form>
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
<section class="mt-4">
|
<section class="mt-4">
|
||||||
<div class="flex items-center justify-between mb-2 border-b pb-1">
|
<div class="flex items-center justify-between mb-2 border-b pb-1">
|
||||||
<h3 class="text-base font-bold text-gray-700">입고 현황</h3>
|
<h3 class="text-base font-bold text-gray-700">입고 현황</h3>
|
||||||
<a href="<?= base_url('admin/bag-receivings/create') ?>" class="bg-btn-search text-white px-3 py-1.5 rounded-sm text-sm">입고 처리</a>
|
<a href="<?= base_url('bag/receiving/create') ?>" class="bg-btn-search text-white px-3 py-1.5 rounded-sm text-sm">입고 처리</a>
|
||||||
</div>
|
</div>
|
||||||
<table class="data-table">
|
<table class="data-table">
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
<section>
|
<section>
|
||||||
<div class="flex items-center justify-between mb-2 border-b pb-1">
|
<div class="flex items-center justify-between mb-2 border-b pb-1">
|
||||||
<h3 class="text-base font-bold text-gray-700">주문 접수</h3>
|
<h3 class="text-base font-bold text-gray-700">주문 접수</h3>
|
||||||
<a href="<?= base_url('admin/shop-orders/create') ?>" class="bg-btn-search text-white px-3 py-1.5 rounded-sm text-sm">주문 등록</a>
|
<a href="<?= base_url('bag/shop-order/create') ?>" class="bg-btn-search text-white px-3 py-1.5 rounded-sm text-sm">주문 등록</a>
|
||||||
</div>
|
</div>
|
||||||
<table class="data-table">
|
<table class="data-table">
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<section class="mt-4">
|
<section class="mt-4">
|
||||||
<div class="flex items-center justify-between mb-2 border-b pb-1">
|
<div class="flex items-center justify-between mb-2 border-b pb-1">
|
||||||
<h3 class="text-base font-bold text-gray-700">판매/반품</h3>
|
<h3 class="text-base font-bold text-gray-700">판매/반품</h3>
|
||||||
<a href="<?= base_url('admin/bag-sales/create') ?>" class="bg-btn-search text-white px-3 py-1.5 rounded-sm text-sm">판매 등록</a>
|
<a href="<?= base_url('bag/sale/create') ?>" class="bg-btn-search text-white px-3 py-1.5 rounded-sm text-sm">판매 등록</a>
|
||||||
</div>
|
</div>
|
||||||
<table class="data-table">
|
<table class="data-table">
|
||||||
<thead><tr>
|
<thead><tr>
|
||||||
|
|||||||
22
playwright.production.config.js
Normal file
22
playwright.production.config.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
// @ts-check
|
||||||
|
const { defineConfig } = require('@playwright/test');
|
||||||
|
|
||||||
|
module.exports = defineConfig({
|
||||||
|
testDir: './e2e',
|
||||||
|
fullyParallel: false,
|
||||||
|
workers: 1,
|
||||||
|
timeout: 60000,
|
||||||
|
reporter: 'list',
|
||||||
|
use: {
|
||||||
|
baseURL: 'https://trash.wxn.co.kr',
|
||||||
|
ignoreHTTPSErrors: true,
|
||||||
|
screenshot: 'only-on-failure',
|
||||||
|
locale: 'ko-KR',
|
||||||
|
},
|
||||||
|
projects: [
|
||||||
|
{
|
||||||
|
name: 'chromium',
|
||||||
|
use: { browserName: 'chromium' },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user