diff --git a/app/Config/Routes.php b/app/Config/Routes.php
index a39fb77..6f6538e 100644
--- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -27,6 +27,19 @@ $routes->get('bag/analytics', 'Bag::analytics');
$routes->get('bag/window', 'Bag::window');
$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
$routes->get('login', 'Auth::showLoginForm');
$routes->post('login', 'Auth::login');
diff --git a/app/Controllers/Bag.php b/app/Controllers/Bag.php
index 88a26b0..f6bee95 100644
--- a/app/Controllers/Bag.php
+++ b/app/Controllers/Bag.php
@@ -17,6 +17,7 @@ use App\Models\CompanyModel;
use App\Models\PackagingUnitModel;
use App\Models\SalesAgencyModel;
use App\Models\ShopOrderModel;
+use App\Models\DesignatedShopModel;
class Bag extends BaseController
{
@@ -247,4 +248,124 @@ class Bag extends BaseController
{
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', '주문 접수되었습니다.');
+ }
}
diff --git a/app/Views/bag/create_bag_issue.php b/app/Views/bag/create_bag_issue.php
new file mode 100644
index 0000000..91ea400
--- /dev/null
+++ b/app/Views/bag/create_bag_issue.php
@@ -0,0 +1,70 @@
+
+
diff --git a/app/Views/bag/create_bag_order.php b/app/Views/bag/create_bag_order.php
new file mode 100644
index 0000000..8125ffb
--- /dev/null
+++ b/app/Views/bag/create_bag_order.php
@@ -0,0 +1,83 @@
+
+
diff --git a/app/Views/bag/create_bag_receiving.php b/app/Views/bag/create_bag_receiving.php
new file mode 100644
index 0000000..c80f00f
--- /dev/null
+++ b/app/Views/bag/create_bag_receiving.php
@@ -0,0 +1,53 @@
+
+
diff --git a/app/Views/bag/create_bag_sale.php b/app/Views/bag/create_bag_sale.php
new file mode 100644
index 0000000..3193633
--- /dev/null
+++ b/app/Views/bag/create_bag_sale.php
@@ -0,0 +1,56 @@
+
+
diff --git a/app/Views/bag/create_shop_order.php b/app/Views/bag/create_shop_order.php
new file mode 100644
index 0000000..6e145c7
--- /dev/null
+++ b/app/Views/bag/create_shop_order.php
@@ -0,0 +1,74 @@
+
+
diff --git a/app/Views/bag/issue.php b/app/Views/bag/issue.php
index 787eeef..292b069 100644
--- a/app/Views/bag/issue.php
+++ b/app/Views/bag/issue.php
@@ -8,7 +8,7 @@
초기화
- 불출 처리
+ 불출 처리
@@ -36,7 +36,7 @@
bi2_status ?? '') === 'normal'): ?>
-
diff --git a/app/Views/bag/purchase_inbound.php b/app/Views/bag/purchase_inbound.php
index 10d31df..e6fa18a 100644
--- a/app/Views/bag/purchase_inbound.php
+++ b/app/Views/bag/purchase_inbound.php
@@ -13,7 +13,7 @@
@@ -37,9 +37,9 @@
?>
- 상세
+ 상세
bo_status ?? '') === 'normal'): ?>
-
@@ -58,7 +58,7 @@
diff --git a/app/Views/bag/sales.php b/app/Views/bag/sales.php
index ec48e62..39ae55e 100644
--- a/app/Views/bag/sales.php
+++ b/app/Views/bag/sales.php
@@ -12,7 +12,7 @@
@@ -47,7 +47,7 @@
diff --git a/playwright.production.config.js b/playwright.production.config.js
new file mode 100644
index 0000000..57cc4fb
--- /dev/null
+++ b/playwright.production.config.js
@@ -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' },
+ },
+ ],
+});
| |