diff --git a/app/Cells/Equipment/CHASSISCell.php b/app/Cells/Equipment/CHASSISCell.php index ee45b1d..fd8b162 100644 --- a/app/Cells/Equipment/CHASSISCell.php +++ b/app/Cells/Equipment/CHASSISCell.php @@ -14,6 +14,7 @@ class CHASSISCell extends EquipmentCell $template = array_key_exists('template', $params) ? $params['template'] : 'stock'; return view('cells/chassis/' . $template, [ 'partCellDatas' => [ + 'helper' => $this->getService()->getHelper(), 'entities' => $this->getService()->getEntities(), ], ]); diff --git a/app/Cells/Part/RAMCell.php b/app/Cells/Part/RAMCell.php index 276b018..27c404c 100644 --- a/app/Cells/Part/RAMCell.php +++ b/app/Cells/Part/RAMCell.php @@ -16,6 +16,7 @@ class RAMCell extends PartCell $template = array_key_exists('template', $params) ? $params['template'] : 'ram_stock'; return view('cells/part/' . $template, [ 'partCellDatas' => [ + 'helper' => $this->getService()->getHelper(), 'entities' => $this->getService()->getEntities(), ], ]); diff --git a/app/Config/Routes.php b/app/Config/Routes.php index f42a6bb..e65ce3a 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -83,6 +83,7 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au $routes->post('batchjob_delete', 'PaymentController::batchjob_delete'); $routes->get('download/(:alpha)', 'PaymentController::download/$1'); $routes->post('invoice', 'PaymentController::invoice'); + $routes->get('paid/(:num)', 'PaymentController::paid/$1'); }); //Customer 관련 $routes->group('customer', ['namespace' => 'App\Controllers\Admin\Customer'], function ($routes) { diff --git a/app/Helpers/Customer/ClientHelper.php b/app/Helpers/Customer/ClientHelper.php index 84868bf..37832fd 100644 --- a/app/Helpers/Customer/ClientHelper.php +++ b/app/Helpers/Customer/ClientHelper.php @@ -134,6 +134,45 @@ class ClientHelper extends CustomerHelper ] ); break; + case 'invoice': + $action = form_label( + $label, + 'payment_invoice', + [ + "data-src" => "/admin/payment?clientinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "text-primary form-label-sm", + ] + ); + break; + case 'addService': + $action = form_label( + '서비스추가', + 'create_service', + [ + "data-src" => "/admin/customer/service/create?clientinfo_uid={$viewDatas['entity']->getPK()}", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "btn btn-sm btn-primary form-label-sm", + ] + ); + break; + case 'unpaid': + $action = "{$label} 0원"; + if (array_key_exists($viewDatas['entity']->getPK(), $viewDatas['unPaids'])) { + $action = form_label( + sprintf("총 %s: %s건/%s원", $label, $viewDatas['unPaids'][$viewDatas['entity']->getPK()]['cnt'], number_format($viewDatas['unPaids'][$viewDatas['entity']->getPK()]['amount'])), + 'payment_unpaid', + [ + "data-src" => "/admin/payment?clientinfo_uid={$viewDatas['entity']->getPK()}&status=unpaid&ActionTemplate=popup", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "text-primary form-label-sm", + ] + ); + } + break; default: $action = parent::getListButton($action, $label, $viewDatas, $extras); break; diff --git a/app/Helpers/Customer/ServiceHelper.php b/app/Helpers/Customer/ServiceHelper.php index 966014e..c8089a4 100644 --- a/app/Helpers/Customer/ServiceHelper.php +++ b/app/Helpers/Customer/ServiceHelper.php @@ -77,6 +77,18 @@ class ServiceHelper extends CustomerHelper public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string { switch ($action) { + case 'modify': + $action = form_label( + $label, + 'modify_service', + [ + "data-src" => "/admin/customer/service/modify/{$viewDatas['entity']->getPK()}?clientinfo_uid={$viewDatas['entity']->getClientInfoUID()}", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "text-primary form-label-sm", + ] + ); + break; case 'addServer': $action = form_label( $label ? $label : ICONS['REBOOT'], diff --git a/app/Helpers/Equipment/CHASSISHelper.php b/app/Helpers/Equipment/CHASSISHelper.php index 1c7fc4e..236963a 100644 --- a/app/Helpers/Equipment/CHASSISHelper.php +++ b/app/Helpers/Equipment/CHASSISHelper.php @@ -8,4 +8,26 @@ class CHASSISHelper extends EquipmentHelper { parent::__construct(); } + + public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string + { + switch ($action) { + case 'modify': + $action = form_label( + $label, + 'disk_modify', + [ + "data-src" => "admin/equipment/chassis/modify/{$viewDatas['entity']->getPK()}", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "text-primary form-label-sm", + ] + ); + break; + default: + $action = parent::getListButton($action, $label, $viewDatas, $extras); + break; + } + return $action; + } } diff --git a/app/Helpers/Part/DISKHelper.php b/app/Helpers/Part/DISKHelper.php index d41a0b7..82d3206 100644 --- a/app/Helpers/Part/DISKHelper.php +++ b/app/Helpers/Part/DISKHelper.php @@ -8,4 +8,25 @@ class DISKHelper extends PartHelper { parent::__construct(); } + public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string + { + switch ($action) { + case 'modify': + $action = form_label( + $label, + 'disk_modify', + [ + "data-src" => "admin/part/disk/modify/{$viewDatas['entity']->getPK()}", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "text-primary form-label-sm", + ] + ); + break; + default: + $action = parent::getListButton($action, $label, $viewDatas, $extras); + break; + } + return $action; + } } diff --git a/app/Helpers/Part/RAMHelper.php b/app/Helpers/Part/RAMHelper.php index 8bac320..19cbdaa 100644 --- a/app/Helpers/Part/RAMHelper.php +++ b/app/Helpers/Part/RAMHelper.php @@ -8,4 +8,25 @@ class RAMHelper extends PartHelper { parent::__construct(); } + public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string + { + switch ($action) { + case 'modify': + $action = form_label( + $label, + 'ram_modify', + [ + "data-src" => "admin/part/ram/modify/{$viewDatas['entity']->getPK()}", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "text-primary form-label-sm", + ] + ); + break; + default: + $action = parent::getListButton($action, $label, $viewDatas, $extras); + break; + } + return $action; + } } diff --git a/app/Helpers/PaymentHelper.php b/app/Helpers/PaymentHelper.php index 02c1c34..b4a85cb 100644 --- a/app/Helpers/PaymentHelper.php +++ b/app/Helpers/PaymentHelper.php @@ -62,18 +62,18 @@ class PaymentHelper extends CommonHelper case 'delete': $action = $this->getAuthContext()->isAccessRole([ROLE['USER']['SECURITY']]) ? parent::getListButton($action, $label, $viewDatas, $extras) : ""; break; - case 'paid': - $action = form_submit($action . "_submit", $label ? $label : '결제 처리', [ - "formaction" => current_url() . '/' . $action, - "class" => "btn btn-outline btn-warning", - ]); - break; case 'invoice': $action = form_submit($action . "_submit", $label ? $label : '청구서 발행', [ "formaction" => current_url() . '/' . $action, "class" => "btn btn-outline btn-primary", ]); break; + case 'paid': + $action = form_submit($action . "_submit", $label ? $label : '결제 처리', [ + "formaction" => current_url() . '/' . $action, + "class" => "btn btn-outline btn-warning", + ]); + break; default: $action = parent::getListButton($action, $label, $viewDatas, $extras); break; diff --git a/app/Services/PaymentService.php b/app/Services/PaymentService.php index e8ac59d..bd60f5b 100644 --- a/app/Services/PaymentService.php +++ b/app/Services/PaymentService.php @@ -241,6 +241,17 @@ class PaymentService extends CommonService return $rows; } + //지불 관련 + public function setPaid(PaymentEntity $entity, array $formDatas): PaymentEntity + { + //결제 완료 처리 후 추가정보 처리 + $formDatas['status'] = STATUS['PAID']; + $entity = parent::modify_process($entity, $formDatas); + //pay방식에따른 고객 정보 처리 + service('customer_client')->setBalance($entity); + return $entity; + } + //서비스관련 private function getFormDatasByService(ServiceEntity $serviceEntity, array $formDatas = []): array { diff --git a/app/Views/admin/client/detail.php b/app/Views/admin/client/detail.php index 97223b5..d00f4a2 100644 --- a/app/Views/admin/client/detail.php +++ b/app/Views/admin/client/detail.php @@ -32,34 +32,8 @@
getTitle() ?>
-
- "/admin/payment?clientinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup", - "data-bs-toggle" => "modal", - "data-bs-target" => "#modal_action_form", - "class" => "text-primary form-label-sm", - ] - ); - ?> -
-
- "/admin/customer/service/create?clientinfo_uid={$viewDatas['entity']->getPK()}", - "data-bs-toggle" => "modal", - "data-bs-target" => "#modal_action_form", - "class" => "btn btn-sm btn-primary form-label-sm", - ] - ); - ?> -
+
getListButton('invoice', "[청구서발행]", $viewDatas) ?>
+
getListButton('addService', "서비스추가", $viewDatas) ?>
도코 치바 @@ -90,22 +64,7 @@ getListButton("account", number_format($viewDatas['entity']->getAccountBalance()) . "원", $viewDatas) ?> getListButton("point", number_format($viewDatas['entity']->getPointBalance()), $viewDatas) ?> getPK(), $viewDatas['totalAmounts']) ? number_format($viewDatas['totalAmounts'][$viewDatas['entity']->getPK()]) : 0 ?>원 - - getPK(), $viewDatas['unPaids'])): ?> - getPK()]['cnt'], number_format($viewDatas['unPaids'][$viewDatas['entity']->getPK()]['amount'])), - 'payment_unpaid', - [ - "data-src" => "/admin/payment?clientinfo_uid={$viewDatas['entity']->getPK()}&status=unpaid&ActionTemplate=popup", - "data-bs-toggle" => "modal", - "data-bs-target" => "#modal_action_form", - "class" => "text-primary form-label-sm", - ] - ); - ?> - - + getListButton('unpaid', "", $viewDatas) ?> diff --git a/app/Views/cells/chassis/stock.php b/app/Views/cells/chassis/stock.php index b8b89ba..7d52856 100644 --- a/app/Views/cells/chassis/stock.php +++ b/app/Views/cells/chassis/stock.php @@ -8,19 +8,8 @@ - - getTitle(), - 'disk_modify', - [ - "data-src" => "admin/equipment/chassis/modify/{$entity->getPK()}", - "data-bs-toggle" => "modal", - "data-bs-target" => "#modal_action_form", - "class" => "text-primary form-label-sm", - ] - ); - ?> + getListButton('modify', $entity->getTitle(), $partCellDatas) ?> + getUsed() ?> getAvailable() ?> diff --git a/app/Views/cells/part/disk_stock.php b/app/Views/cells/part/disk_stock.php index 312f237..aba9f7c 100644 --- a/app/Views/cells/part/disk_stock.php +++ b/app/Views/cells/part/disk_stock.php @@ -9,21 +9,8 @@ - - getTitle(), - 'disk_modify', - [ - "data-src" => "admin/part/disk/modify/{$entity->getPK()}", - "data-bs-toggle" => "modal", - "data-bs-target" => "#modal_action_form", - "class" => "text-primary form-label-sm", - ] - ); - ?> - - getUsed() ?> + getListButton('modify', $entity->getTitle(), $partCellDatas) ?> + getUsed() ?> getAvailable() ?> getFieldView('format', $entity->format, $partCellDatas) ?> getStock() ?> diff --git a/app/Views/cells/part/ram_stock.php b/app/Views/cells/part/ram_stock.php index 6b9816c..d859fbb 100644 --- a/app/Views/cells/part/ram_stock.php +++ b/app/Views/cells/part/ram_stock.php @@ -8,20 +8,7 @@ - - getTitle(), - 'disk_modify', - [ - "data-src" => "admin/part/ram/modify/{$entity->getPK()}", - "data-bs-toggle" => "modal", - "data-bs-target" => "#modal_action_form", - "class" => "text-primary form-label-sm", - ] - ); - ?> - + getListButton('modify', $entity->getTitle(), $partCellDatas) ?><< /td> getUsed() ?> getAvailable() ?> getStock() ?> diff --git a/app/Views/cells/payment/detail.php b/app/Views/cells/payment/detail.php index 3abece8..fefe3c8 100644 --- a/app/Views/cells/payment/detail.php +++ b/app/Views/cells/payment/detail.php @@ -7,7 +7,9 @@ 결제금액 항목 청구방식 - 처리자 + 지불방법 + 관리자 + 결제처리 @@ -17,10 +19,11 @@ getFieldView('amount', $entity->getAmount(), $serviceCellDatas) ?> getFieldView('title', $entity->getTitle(), $serviceCellDatas) ?> getFieldView('billing', $entity->getBilling(), $serviceCellDatas) ?> + getFieldView('pay', $entity->getPay(), $serviceCellDatas) ?> getFieldView('user_uid', $entity->getUserUID(), $serviceCellDatas) ?> - getFieldView('content', $entity->getTitle(), $serviceCellDatas) ?> + getFieldView('content', $entity->getTitle(), $serviceCellDatas) ?> diff --git a/app/Views/cells/service/detail.php b/app/Views/cells/service/detail.php index 1fc221e..e1204af 100644 --- a/app/Views/cells/service/detail.php +++ b/app/Views/cells/service/detail.php @@ -13,17 +13,7 @@
getFieldView('site', $entity->getSite(), $serviceCellDatas) ?> / getFieldView('location', $entity->getLocation(), $serviceCellDatas) ?>
-
getCode(), - 'modify_service', - [ - "data-src" => "/admin/customer/service/modify/{$entity->getPK()}?clientinfo_uid={$entity->getClientInfoUID()}", - "data-bs-toggle" => "modal", - "data-bs-target" => "#modal_action_form", - "class" => "text-primary form-label-sm", - ] - ); - ?>
+
getListButton('modify', $entity->getCode(), $serviceCellDatas) ?>
getTitle() ?>
상면비 : getRack()) ?>
회선비 : getLine()) ?>
diff --git a/app/Views/cells/service/payment.php b/app/Views/cells/service/payment.php index 131d488..f8bdfe9 100644 --- a/app/Views/cells/service/payment.php +++ b/app/Views/cells/service/payment.php @@ -11,18 +11,7 @@ 미납금 getPK(), $serviceCellDatas['unPaids'])): ?> - getPK()]['cnt'], number_format($serviceCellDatas['unPaids'][$serviceEntity->getPK()]['amount'])), - 'payment_unpaid', - [ - "data-src" => "/admin/payment?clientinfo_uid={$serviceEntity->getClientInfoUID()}&serviceinfo_uid={$serviceEntity->getPK()}&status=unpaid&ActionTemplate=popup", - "data-bs-toggle" => "modal", - "data-bs-target" => "#modal_action_form", - "class" => "text-primary form-label-sm", - ] - ); - ?> + getListButton('unpaid', '미납금', ['serviceCellDatas' => $serviceCellDatas, 'entity' => $serviceEntity], ['class' => 'btn btn-sm btn-primary']) ?> diff --git a/app/Views/layouts/admin/top.php b/app/Views/layouts/admin/top.php index 80bce90..237710f 100644 --- a/app/Views/layouts/admin/top.php +++ b/app/Views/layouts/admin/top.php @@ -64,7 +64,7 @@ "modify", [ "class" => "dropdown-item form-label-sm", - "data-src" => "/admin/user/profile/" . $viewDatas['authContext']->getUID(), + "data-src" => "/admin/user/modify/" . $viewDatas['authContext']->getUID(), "data-bs-toggle" => "modal", "data-bs-target" => "#modal_action_form" ]