dbmsv2 init...1
This commit is contained in:
parent
f2b2388da3
commit
6df8db1fa1
@ -28,18 +28,8 @@ class ServiceCell extends CustomerCell
|
|||||||
$this->getService()->setFormFilters();
|
$this->getService()->setFormFilters();
|
||||||
$this->getService()->setFormRules();
|
$this->getService()->setFormRules();
|
||||||
$this->getService()->setFormOptions();
|
$this->getService()->setFormOptions();
|
||||||
$unPaids = [];
|
$unPaids = $this->getPaymentService()->getUnPaids('serviceinfo_uid', ['clientinfo_uid' => $params['clientinfo_uid']]);
|
||||||
$entities = [];
|
$entities = $this->getService()->getEntities(['clientinfo_uid' => $params['clientinfo_uid']]);
|
||||||
foreach ($this->getService()->getEntities(['clientinfo_uid' => $params['clientinfo_uid']]) as $entity) {
|
|
||||||
if (!array_key_exists($entity->getPK(), $unPaids)) {
|
|
||||||
$unPaids[$entity->getPK()] = ['cnt' => 0, 'amount' => 0];
|
|
||||||
}
|
|
||||||
foreach ($this->getPaymentService()->getUnPaids('serviceinfo_uid', ['serviceinfo_uid' => $entity->getPK()]) as $unPaid) {
|
|
||||||
$unPaids[$entity->getPK()]['cnt'] += $unPaid->cnt;
|
|
||||||
$unPaids[$entity->getPK()]['amount'] += $unPaid->amount;
|
|
||||||
}
|
|
||||||
$entities[] = $entity;
|
|
||||||
}
|
|
||||||
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
|
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
|
||||||
return view('cells/service/' . $template, [
|
return view('cells/service/' . $template, [
|
||||||
'serviceCellDatas' => [
|
'serviceCellDatas' => [
|
||||||
|
|||||||
@ -77,9 +77,9 @@ class Home extends AdminController
|
|||||||
//서비스별 미납 Count
|
//서비스별 미납 Count
|
||||||
$totalUnPaidCount = 0;
|
$totalUnPaidCount = 0;
|
||||||
$totalUnPaidAmount = 0;
|
$totalUnPaidAmount = 0;
|
||||||
foreach ($this->getPaymentService()->getUnPaids('serviceinfo_uid') as $unPaid) {
|
foreach ($this->getPaymentService()->getUnPaids('serviceinfo_uid') as $key => $datas) {
|
||||||
$totalUnPaidCount += $unPaid->cnt;
|
$totalUnPaidCount += $datas['cnt'];
|
||||||
$totalUnPaidAmount += $unPaid->amount;
|
$totalUnPaidAmount += $datas['amount'];
|
||||||
}
|
}
|
||||||
$this->totalUnPaidCount = $totalUnPaidCount;
|
$this->totalUnPaidCount = $totalUnPaidCount;
|
||||||
$this->totalUnPaidAmount = $totalUnPaidAmount;
|
$this->totalUnPaidAmount = $totalUnPaidAmount;
|
||||||
|
|||||||
@ -272,11 +272,11 @@ class CommonHelper
|
|||||||
// create, modify, create_form, modify_form일때 checkbox로 표시
|
// create, modify, create_form, modify_form일때 checkbox로 표시
|
||||||
if (in_array($viewDatas['control']['action'], ['create_form', 'modify_form'])) {
|
if (in_array($viewDatas['control']['action'], ['create_form', 'modify_form'])) {
|
||||||
$forms = [];
|
$forms = [];
|
||||||
foreach ($viewDatas['control']['field_optons'][$field] as $key => $filterEntity) {
|
foreach ($viewDatas['control']['field_optons'][$field] as $key => $label) {
|
||||||
if ($key !== '') { // 빈값은 제외
|
if ($key !== '') { // 빈값은 제외
|
||||||
$values = is_array($value) ? $value : explode(DEFAULTS["DELIMITER_ROLE"], $value);
|
$values = is_array($value) ? $value : explode(DEFAULTS["DELIMITER_ROLE"], $value);
|
||||||
//form_check에는 "class" => "form-control" 쓰면 않되거나 form-check를 써야함
|
//form_check에는 "class" => "form-control" 쓰면 않되거나 form-check를 써야함
|
||||||
$forms[] = form_checkbox("{$field}[]", $key, in_array($key, $values), $extras) . $filterEntity->getTitle();
|
$forms[] = form_checkbox("{$field}[]", $key, in_array($key, $values), $extras) . $label;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$form = implode(" ", $forms);
|
$form = implode(" ", $forms);
|
||||||
|
|||||||
@ -73,7 +73,7 @@ class ClientHelper extends CustomerHelper
|
|||||||
if (!$this->getMyAuth()->isAccessRole(['security'])) {
|
if (!$this->getMyAuth()->isAccessRole(['security'])) {
|
||||||
$action = $viewDatas['entity']->getCode();
|
$action = $viewDatas['entity']->getCode();
|
||||||
} else {
|
} else {
|
||||||
$action = parent::getListButton($action, $label ? $label : $viewDatas['entity']->getCode(), $viewDatas, $extras);
|
$action = parent::getListButton($action, $label, $viewDatas, $extras);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'create':
|
case 'create':
|
||||||
|
|||||||
@ -64,6 +64,9 @@ class ServiceHelper extends CustomerHelper
|
|||||||
$attributes = ['data-price' => 'getPrice'];
|
$attributes = ['data-price' => 'getPrice'];
|
||||||
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
|
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
|
||||||
break;
|
break;
|
||||||
|
case 'amount':
|
||||||
|
$form = form_input($field, 0, ["readonly" => "readonly", ...$extras]);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||||
break;
|
break;
|
||||||
@ -79,11 +82,12 @@ class ServiceHelper extends CustomerHelper
|
|||||||
case 'billing_at':
|
case 'billing_at':
|
||||||
if (array_key_exists('unPaids', $viewDatas)) {
|
if (array_key_exists('unPaids', $viewDatas)) {
|
||||||
if (array_key_exists($viewDatas['entity']->getPK(), $viewDatas['unPaids'])) {
|
if (array_key_exists($viewDatas['entity']->getPK(), $viewDatas['unPaids'])) {
|
||||||
foreach ($viewDatas['unPaids'] as $unPaid) {
|
$value .= sprintf(
|
||||||
if ($unPaid->serviceinfo_uid = $viewDatas['entity']->getPK()) {
|
"<div><a href=\"/admin/customer/payment?serviceinfo_uid=%s\">미지급: <span style=\"color:red;\">%s개,총 %s원</span></a></div>",
|
||||||
$value .= "<div><a href=\"/admin/customer/payment?={$viewDatas['entity']->getPK()}\">미지급: <span style=\"color:red;\">" . $unPaid->cnt . "개,총 " . number_format($unPaid->amount) . "원</span></a></div>";
|
$viewDatas['entity']->getPK(),
|
||||||
}
|
$viewDatas['unPaids'][$viewDatas['entity']->getPK()]['cnt'],
|
||||||
}
|
number_format($viewDatas['unPaids'][$viewDatas['entity']->getPK()]['amount'])
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -101,7 +105,7 @@ class ServiceHelper extends CustomerHelper
|
|||||||
{
|
{
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'modify':
|
case 'modify':
|
||||||
$action = parent::getListButton($action, $label ? $label : $viewDatas['entity']->getCode(), $viewDatas, $extras);
|
$action = parent::getListButton($action, $label, $viewDatas, $extras);
|
||||||
break;
|
break;
|
||||||
case 'history':
|
case 'history':
|
||||||
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
||||||
|
|||||||
@ -14,6 +14,14 @@ class ServerHelper extends EquipmentHelper
|
|||||||
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
case 'clientinfo_uid':
|
||||||
|
case 'serviceinfo_uid':
|
||||||
|
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||||
|
if (in_array($viewDatas['control']['action'], ['modify_form']) && $value) {
|
||||||
|
$form = $this->getFieldView($field, $value, $viewDatas, $extras);
|
||||||
|
$form .= form_hidden($field, (string)$value);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'code':
|
case 'code':
|
||||||
// $extras['readonly'] = in_array($viewDatas['control']['action'], ['modify_form']) ? ' readonly' : '';
|
// $extras['readonly'] = in_array($viewDatas['control']['action'], ['modify_form']) ? ' readonly' : '';
|
||||||
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||||
@ -57,7 +65,7 @@ class ServerHelper extends EquipmentHelper
|
|||||||
{
|
{
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'modify':
|
case 'modify':
|
||||||
$action = parent::getListButton($action, $viewDatas['entity']->getCode(), $viewDatas, $extras);
|
$action = parent::getListButton($action, $label ? $label : $viewDatas['entity']->getCode(), $viewDatas, $extras);
|
||||||
break;
|
break;
|
||||||
case 'history':
|
case 'history':
|
||||||
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
||||||
|
|||||||
@ -57,6 +57,18 @@ class ServerPartHelper extends EquipmentHelper
|
|||||||
$attributes = ['data-title' => 'getTitle', 'data-price' => 'getPrice'];
|
$attributes = ['data-title' => 'getTitle', 'data-price' => 'getPrice'];
|
||||||
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
|
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
|
||||||
break;
|
break;
|
||||||
|
case 'billing':
|
||||||
|
//결제방식이 항상 매월지급으로 설정되는 항목형식(IP,CS)
|
||||||
|
if (array_key_exists('type', $viewDatas['control']['form_datas'])) {
|
||||||
|
switch ($viewDatas['control']['form_datas']['type']) {
|
||||||
|
case 'IP':
|
||||||
|
case 'CS':
|
||||||
|
$value = PAYMENT['BILLING']['MONTH'];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);;
|
||||||
|
break;
|
||||||
case 'extra':
|
case 'extra':
|
||||||
if (array_key_exists('type', $viewDatas['control']['form_datas']) && $viewDatas['control']['form_datas']['type'] === 'DISK') {
|
if (array_key_exists('type', $viewDatas['control']['form_datas']) && $viewDatas['control']['form_datas']['type'] === 'DISK') {
|
||||||
$options = ["" => lang("{$viewDatas['class_path']}.label.{$field}") . " 선택", ...lang("{$viewDatas['class_path']}.EXTRA.{$viewDatas['control']['form_datas']['type']}")];
|
$options = ["" => lang("{$viewDatas['class_path']}.label.{$field}") . " 선택", ...lang("{$viewDatas['class_path']}.EXTRA.{$viewDatas['control']['form_datas']['type']}")];
|
||||||
|
|||||||
@ -19,7 +19,7 @@ class SwitchHelper extends EquipmentHelper
|
|||||||
if (!$this->getMyAuth()->isAccessRole(['security'])) {
|
if (!$this->getMyAuth()->isAccessRole(['security'])) {
|
||||||
$action = $viewDatas['entity']->getCode();
|
$action = $viewDatas['entity']->getCode();
|
||||||
} else {
|
} else {
|
||||||
$action = parent::getListButton($action, $viewDatas['entity']->getCode(), $viewDatas, $extras);
|
$action = parent::getListButton($action, $label ? $label : $viewDatas['entity']->getCode(), $viewDatas, $extras);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@ -44,8 +44,25 @@ class PaymentHelper extends CommonHelper
|
|||||||
case 'batchjob_delete':
|
case 'batchjob_delete':
|
||||||
$action = "";
|
$action = "";
|
||||||
break;
|
break;
|
||||||
|
case 'modify':
|
||||||
|
$oldBatchJobUids = old("batchjob_uids", null);
|
||||||
|
$oldBatchJobUids = is_array($oldBatchJobUids) ? $oldBatchJobUids : [$oldBatchJobUids];
|
||||||
|
$action = form_checkbox([
|
||||||
|
"id" => "checkbox_uid_{$viewDatas['entity']->getPK()}",
|
||||||
|
"name" => "batchjob_uids[]",
|
||||||
|
"value" => $label ? $label : $viewDatas['entity']->getPK(),
|
||||||
|
"class" => "batchjobuids_checkboxs",
|
||||||
|
"checked" => in_array($viewDatas['entity']->getPK(), $oldBatchJobUids)
|
||||||
|
]);
|
||||||
|
if ($this->getMyAuth()->isAccessRole(['security'])) {
|
||||||
|
$action = parent::getListButton($action, $label, $viewDatas, $extras);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'delete':
|
case 'delete':
|
||||||
$action = $viewDatas['entity']->getStatus() !== $viewDatas['entity']::DEFAULT_STATUS ? "" : parent::getListButton($action, $label, $viewDatas, $extras);
|
$action = "";
|
||||||
|
if ($this->getMyAuth()->isAccessRole(['security'])) {
|
||||||
|
$action = $viewDatas['entity']->getStatus() !== $viewDatas['entity']::DEFAULT_STATUS ? "" : parent::getListButton($action, $label, $viewDatas, $extras);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'invoice':
|
case 'invoice':
|
||||||
$action = form_submit($action . "_submit", $label ? $label : '청구서 발행', [
|
$action = form_submit($action . "_submit", $label ? $label : '청구서 발행', [
|
||||||
|
|||||||
10
app/Interfaces/Customer/ServiceInterface.php
Normal file
10
app/Interfaces/Customer/ServiceInterface.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Interfaces\Customer;
|
||||||
|
|
||||||
|
use App\Entities\Equipment\ServerPartEntity;
|
||||||
|
|
||||||
|
interface ServiceInterface extends CustomerInterface
|
||||||
|
{
|
||||||
|
public function setServiceAmount(array $formDatas): ServerPartEntity;
|
||||||
|
}
|
||||||
@ -17,8 +17,8 @@ return [
|
|||||||
'countdown' => "납부기한",
|
'countdown' => "납부기한",
|
||||||
],
|
],
|
||||||
"BILLING" => [
|
"BILLING" => [
|
||||||
"month" => "매월",
|
PAYMENT['BILLING']['MONTH'] => "매월",
|
||||||
"onetime" => "일회성",
|
PAYMENT['BILLING']['ONETIME'] => "일회성",
|
||||||
],
|
],
|
||||||
"PAY" => [
|
"PAY" => [
|
||||||
"account" => "예치금",
|
"account" => "예치금",
|
||||||
|
|||||||
@ -73,7 +73,6 @@ abstract class CommonModel extends Model
|
|||||||
$data[8] = chr(ord($data[8]) & 0x3f | 0x80); // variant 10
|
$data[8] = chr(ord($data[8]) & 0x3f | 0x80); // variant 10
|
||||||
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
|
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));
|
||||||
}
|
}
|
||||||
//기본 기능
|
|
||||||
public function getFormRule(string $action, string $field): string
|
public function getFormRule(string $action, string $field): string
|
||||||
{
|
{
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
@ -111,7 +110,6 @@ abstract class CommonModel extends Model
|
|||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
}
|
}
|
||||||
// create, modify 직전 작업용 작업
|
|
||||||
protected function convertFormDatas(string $action, string $field, array $formDatas): mixed
|
protected function convertFormDatas(string $action, string $field, array $formDatas): mixed
|
||||||
{
|
{
|
||||||
// 필드 값 존재 여부 확인
|
// 필드 값 존재 여부 확인
|
||||||
@ -143,6 +141,7 @@ abstract class CommonModel extends Model
|
|||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
//기본 기능
|
||||||
public function create(array $formDatas): mixed
|
public function create(array $formDatas): mixed
|
||||||
{
|
{
|
||||||
$convertedFormDatas = [];
|
$convertedFormDatas = [];
|
||||||
|
|||||||
@ -61,6 +61,24 @@ class ServerModel extends EquipmentModel
|
|||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
}
|
}
|
||||||
|
protected function convertFormDatas(string $action, string $field, array $formDatas): mixed
|
||||||
|
{
|
||||||
|
// 필드 값 존재 여부 확인
|
||||||
|
$value = array_key_exists($field, $formDatas) ? $formDatas[$field] : null;
|
||||||
|
switch ($field) {
|
||||||
|
case 'clientinfo_uid':
|
||||||
|
case 'serviceinfo_uid':
|
||||||
|
if ($value === '') {
|
||||||
|
$value = null;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$value = parent::convertFormDatas($action, $field, $formDatas);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
//기본기능
|
||||||
//create용 장비코드 마지막번호 가져오기
|
//create용 장비코드 마지막번호 가져오기
|
||||||
final public function getLastestCode(string $format, int $default): string
|
final public function getLastestCode(string $format, int $default): string
|
||||||
{
|
{
|
||||||
|
|||||||
@ -122,15 +122,20 @@ class PaymentService extends CommonService implements ServerPartInterface
|
|||||||
$this->getModel()->orderBy('billing_at ASC');
|
$this->getModel()->orderBy('billing_at ASC');
|
||||||
parent::setOrderBy($field, $value);
|
parent::setOrderBy($field, $value);
|
||||||
}
|
}
|
||||||
//총 미납건수, 금액
|
//당일 기준으로 총 미납건수, 금액
|
||||||
final public function getUnPaids(string $group, array $where = []): array
|
final public function getUnPaids(string $group, array $where = []): array
|
||||||
{
|
{
|
||||||
return $this->getModel()->groupBy($group)
|
$rows = $this->getModel()->groupBy($group)
|
||||||
->select("serviceinfo_uid,COUNT(uid) as cnt, SUM(amount) as amount")
|
->select("{$group},COUNT(uid) as cnt, SUM(amount) as amount")
|
||||||
->where(['billing_at <=' => date('Y-m-d')])
|
->where(['billing_at <=' => date('Y-m-d')])
|
||||||
->where(['status' => STATUS['UNPAID']])
|
->where(['status' => STATUS['UNPAID']])
|
||||||
->where($where)
|
->where($where)
|
||||||
->get()->getResult();
|
->get()->getResult();
|
||||||
|
$unPaids = [];
|
||||||
|
foreach ($rows as $row) {
|
||||||
|
$unPaids[$row->$group] = ['cnt' => $row->cnt, 'amount' => $row->amount];
|
||||||
|
}
|
||||||
|
return $unPaids;
|
||||||
}
|
}
|
||||||
//생성
|
//생성
|
||||||
final public function create(array $formDatas): PaymentEntity
|
final public function create(array $formDatas): PaymentEntity
|
||||||
@ -152,32 +157,46 @@ class PaymentService extends CommonService implements ServerPartInterface
|
|||||||
}
|
}
|
||||||
public function setServerPart(ServerPartEntity $serverPartEntity, array $formDatas = []): ServerPartEntity
|
public function setServerPart(ServerPartEntity $serverPartEntity, array $formDatas = []): ServerPartEntity
|
||||||
{
|
{
|
||||||
if ($serverPartEntity->getServiceInfoUID() === null) {
|
switch ($serverPartEntity->getBilling()) {
|
||||||
throw new \Exception("서비스정보가 정의된 후에만 가능합니다.");
|
case PAYMENT['BILLING']['MONTH']:
|
||||||
}
|
if ($serverPartEntity->getServiceInfoUID() === null) {
|
||||||
//Service Entity 가져오기
|
throw new \Exception(lang("{$this->getClassName()}.BILLING." . PAYMENT['BILLING']['MONTH']) . "지급 상품은 서비스정보가 정의된 후에만 가능합니다.");
|
||||||
$serviceEntity = $this->getServiceService()->getEntity($serverPartEntity->getServiceInfoUID());
|
}
|
||||||
if (!$serviceEntity) {
|
//Service Entity 가져오기
|
||||||
throw new \Exception("[{$serverPartEntity->getServiceInfoUID()}]에 대한 서비스정보를 찾을수 없습니다.");
|
$serviceEntity = $this->getServiceService()->getEntity($serverPartEntity->getServiceInfoUID());
|
||||||
}
|
if (!$serviceEntity) {
|
||||||
//월비용인경우 서비스 제공가에 서버연결정보 제공가 합산금액으로 설정
|
throw new \Exception("[{$serverPartEntity->getServiceInfoUID()}]에 대한 서비스정보를 찾을수 없습니다.");
|
||||||
if ($serverPartEntity->getBilling() === PAYMENT['BILLING']['MONTH']) {
|
}
|
||||||
$formDatas['serverinfo_uid'] = $serviceEntity->getServerInfoUID();
|
//월비용인경우 서비스 제공가에 서버연결정보 제공가 합산금액으로 설정
|
||||||
$formDatas['billing_at'] = $serviceEntity->getBillingAt();
|
if ($serverPartEntity->getBilling() === PAYMENT['BILLING']['MONTH']) {
|
||||||
$formDatas['amount'] = $serviceEntity->getAmount() + $serverPartEntity->getAmount();
|
$formDatas['serverinfo_uid'] = $serviceEntity->getServerInfoUID();
|
||||||
$this->getServiceService()->modify($serviceEntity, $formDatas);
|
$formDatas['billing_at'] = $serviceEntity->getBillingAt();
|
||||||
}
|
$formDatas['amount'] = $serviceEntity->getAmount() + $serverPartEntity->getAmount();
|
||||||
//일회성인경우
|
$this->getServiceService()->modify($serviceEntity, $formDatas);
|
||||||
if ($serverPartEntity->getBilling() === PAYMENT['BILLING']['ONETIME']) {
|
}
|
||||||
$formDatas['clientinfo_uid'] = $serverPartEntity->getClientInfoUID();
|
break;
|
||||||
$formDatas['serviceinfo_uid'] = $serverPartEntity->getServiceInfoUID();
|
case PAYMENT['BILLING']['ONETIME']:
|
||||||
$formDatas['serverinfo_uid'] = $serverPartEntity->getServerInfoUID();
|
if ($serverPartEntity->getServiceInfoUID() === null) {
|
||||||
$formDatas['serverpartinfo_uid'] = $serverPartEntity->getPK();
|
throw new \Exception(lang("{$this->getClassName()}.BILLING." . PAYMENT['BILLING']['ONETIME']) . "지급 상품은 서비스정보가 정의된 후에만 가능합니다.");
|
||||||
$formDatas['title'] = $serverPartEntity->getType() === 'ETC' ? $serverPartEntity->getTitle() : $serverPartEntity->getPartEntity()->getTitle();
|
}
|
||||||
$formDatas['amount'] = $serverPartEntity->getAmount();
|
//Service Entity 가져오기
|
||||||
$formDatas['billing'] = $serverPartEntity->getBilling();
|
$serviceEntity = $this->getServiceService()->getEntity($serverPartEntity->getServiceInfoUID());
|
||||||
$formDatas['billing_at'] = $serverPartEntity->getBilling() === PAYMENT['BILLING']['ONETIME'] ? date("Y-m-d") : $serviceEntity->getBillingAT();
|
if (!$serviceEntity) {
|
||||||
$serverPartEntity = $this->setServerPart_process($serverPartEntity, $serviceEntity, $formDatas);
|
throw new \Exception("[{$serverPartEntity->getServiceInfoUID()}]에 대한 서비스정보를 찾을수 없습니다.");
|
||||||
|
}
|
||||||
|
//일회성인경우
|
||||||
|
if ($serverPartEntity->getBilling() === PAYMENT['BILLING']['ONETIME']) {
|
||||||
|
$formDatas['clientinfo_uid'] = $serverPartEntity->getClientInfoUID();
|
||||||
|
$formDatas['serviceinfo_uid'] = $serverPartEntity->getServiceInfoUID();
|
||||||
|
$formDatas['serverinfo_uid'] = $serverPartEntity->getServerInfoUID();
|
||||||
|
$formDatas['serverpartinfo_uid'] = $serverPartEntity->getPK();
|
||||||
|
$formDatas['title'] = $serverPartEntity->getType() === 'ETC' ? $serverPartEntity->getTitle() : $serverPartEntity->getPartEntity()->getTitle();
|
||||||
|
$formDatas['amount'] = $serverPartEntity->getAmount();
|
||||||
|
$formDatas['billing'] = $serverPartEntity->getBilling();
|
||||||
|
$formDatas['billing_at'] = $serverPartEntity->getBilling() === PAYMENT['BILLING']['ONETIME'] ? date("Y-m-d") : $serviceEntity->getBillingAT();
|
||||||
|
$serverPartEntity = $this->setServerPart_process($serverPartEntity, $serviceEntity, $formDatas);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return $serverPartEntity;
|
return $serverPartEntity;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -63,7 +63,7 @@
|
|||||||
<td><?= $viewDatas['entity']->getSaleRate() ?>%</td>
|
<td><?= $viewDatas['entity']->getSaleRate() ?>%</td>
|
||||||
<td><?= $viewDatas['entity']->getAccountBalance() ?></td>
|
<td><?= $viewDatas['entity']->getAccountBalance() ?></td>
|
||||||
<td><?= array_key_exists($viewDatas['entity']->getPK(), $viewDatas['totalAmounts']) ? number_format($viewDatas['totalAmounts'][$viewDatas['entity']->getPK()]) : 0 ?></td>
|
<td><?= array_key_exists($viewDatas['entity']->getPK(), $viewDatas['totalAmounts']) ? number_format($viewDatas['totalAmounts'][$viewDatas['entity']->getPK()]) : 0 ?></td>
|
||||||
<td><?= array_key_exists($viewDatas['entity']->getPK(), $viewDatas['unPaids']) ? number_format($viewDatas['unPaids'][$viewDatas['entity']->getPK()]['amount']) : 0 ?></td>
|
<td><?= array_key_exists($viewDatas['entity']->getPK(), $viewDatas['unPaids']) ? "총:" . $viewDatas['unPaids'][$viewDatas['entity']->getPK()]['cnt'] . "건/" . number_format($viewDatas['unPaids'][$viewDatas['entity']->getPK()]['amount']) : 0 ?>원</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
<?= $viewDatas['service']->getHelper()->getListLabel('type', lang("{$viewDatas['class_path']}.label.type"), $viewDatas) ?>/
|
<?= $viewDatas['service']->getHelper()->getListLabel('type', lang("{$viewDatas['class_path']}.label.type"), $viewDatas) ?>/
|
||||||
<?= $viewDatas['service']->getHelper()->getListLabel('title', lang("{$viewDatas['class_path']}.label.title"), $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getListLabel('title', lang("{$viewDatas['class_path']}.label.title"), $viewDatas) ?>
|
||||||
</th>
|
</th>
|
||||||
<th class="index_head_short_column">
|
<th class="index_head_short_column" style="width:900px;">
|
||||||
부품정보<div class="float-end rounded border border-primary" style="cursor:pointer;" onclick="copyServerPartsToClipboard()">All COPY</div>
|
부품정보<div class="float-end rounded border border-primary" style="cursor:pointer;" onclick="copyServerPartsToClipboard()">All COPY</div>
|
||||||
</th>
|
</th>
|
||||||
<th class="index_head_short_column">
|
<th class="index_head_short_column">
|
||||||
@ -65,7 +65,7 @@
|
|||||||
<?php $viewDatas['entity'] = $entity; ?>
|
<?php $viewDatas['entity'] = $entity; ?>
|
||||||
<tr <?= $entity->getStatus() === $entity::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
|
<tr <?= $entity->getStatus() === $entity::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
|
||||||
<?php $num = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
<?php $num = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||||
<td nowrap><?= $viewDatas['service']->getHelper()->getListButton('modify', $num, $viewDatas) ?></td>
|
<td nowrap><?= $viewDatas['service']->getHelper()->getListButton('modify', "", $viewDatas) ?></td>
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
<?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->getClientInfoUID(), $viewDatas) ?><BR>
|
<?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->getClientInfoUID(), $viewDatas) ?><BR>
|
||||||
<?= $viewDatas['service']->getHelper()->getFieldView('serviceinfo_uid', $entity->getServiceInfoUID(), $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getFieldView('serviceinfo_uid', $entity->getServiceInfoUID(), $viewDatas) ?>
|
||||||
@ -74,7 +74,7 @@
|
|||||||
<?= $viewDatas['service']->getHelper()->getFieldView('type', $entity->type, $viewDatas) ?><BR>
|
<?= $viewDatas['service']->getHelper()->getFieldView('type', $entity->type, $viewDatas) ?><BR>
|
||||||
<?= $viewDatas['service']->getHelper()->getFieldView('title', $entity->getTitle(), $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getFieldView('title', $entity->getTitle(), $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
<td nowrap>
|
<td>
|
||||||
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
|
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
|
||||||
'serverinfo_uid' => $entity->getPK(),
|
'serverinfo_uid' => $entity->getPK(),
|
||||||
'types' => SERVERPART['SERVER_PARTTYPES'],
|
'types' => SERVERPART['SERVER_PARTTYPES'],
|
||||||
|
|||||||
@ -3,36 +3,29 @@
|
|||||||
<?php if ($error = session('error')): echo $viewDatas['service']->getHelper()->alert($error) ?><?php endif ?>
|
<?php if ($error = session('error')): echo $viewDatas['service']->getHelper()->alert($error) ?><?php endif ?>
|
||||||
<div id="container" class="content">
|
<div id="container" class="content">
|
||||||
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
|
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<table class="table table-bordered">
|
||||||
<div class="action_form">
|
<tr>
|
||||||
<table class="table table-bordered">
|
<th>서버정보</th>
|
||||||
<tr>
|
<th>추가정보</th>
|
||||||
<th>서버정보</th>
|
</tr>
|
||||||
<th>추가정보</th>
|
<tr>
|
||||||
</tr>
|
<td nowrap>
|
||||||
<tr>
|
<table class="table table-bordered">
|
||||||
<td nowrap>
|
<?php foreach (["code", "type", "title", "price", "manufactur_at", "format_at", "status",] as $field): ?>
|
||||||
<table class="table table-bordered">
|
<tr>
|
||||||
<?php foreach (["code", "type", "title", "price", "manufactur_at", "format_at", "status",] as $field): ?>
|
<th nowrap class="text-end"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
|
||||||
<tr>
|
<td nowrap class="text-start"><?= $viewDatas['service']->getHelper()->getFieldView($field, $viewDatas['entity']->$field ?? null, $viewDatas) ?></td>
|
||||||
<th nowrap class="text-end"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
|
</tr>
|
||||||
<td nowrap class="text-start">
|
<?php endforeach ?>
|
||||||
<?= $viewDatas['service']->getHelper()->getFieldView($field, $viewDatas['entity']->$field ?? null, $viewDatas) ?>
|
</table>
|
||||||
<span><?= validation_show_error($field); ?></span>
|
</td>
|
||||||
</td>
|
<td><?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
|
||||||
</tr>
|
'serverinfo_uid' => $viewDatas['entity']->getPK(),
|
||||||
<?php endforeach ?>
|
'types' => SERVERPART['ALL_PARTTYPES']
|
||||||
</table>
|
]) ?></td>>
|
||||||
</td>
|
</tr>
|
||||||
<td><?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
|
</table>
|
||||||
'serverinfo_uid' => $viewDatas['entity']->getPK(),
|
</div>
|
||||||
'types' => SERVERPART['ALL_PARTTYPES']
|
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
|
||||||
]) ?></td>>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<div class="text-center"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></div>
|
|
||||||
<?= form_close(); ?>
|
|
||||||
</div>
|
|
||||||
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
|
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -46,7 +46,7 @@
|
|||||||
<th class="index_head_short_column">
|
<th class="index_head_short_column">
|
||||||
<?= $viewDatas['service']->getHelper()->getListLabel('clientinfo_uid', lang("{$viewDatas['class_path']}.label.clientinfo_uid"), $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getListLabel('clientinfo_uid', lang("{$viewDatas['class_path']}.label.clientinfo_uid"), $viewDatas) ?>
|
||||||
</th>
|
</th>
|
||||||
<th class="index_head_short_column">
|
<th class="index_head_short_column" style="width:500px;">
|
||||||
서버정보<div class="float-end rounded border border-primary" style="cursor:pointer;" onclick="copyServerPartsToClipboard()">All COPY</div>
|
서버정보<div class="float-end rounded border border-primary" style="cursor:pointer;" onclick="copyServerPartsToClipboard()">All COPY</div>
|
||||||
</th>
|
</th>
|
||||||
<th class="index_head_short_column">
|
<th class="index_head_short_column">
|
||||||
@ -82,7 +82,7 @@
|
|||||||
<td nowrap>
|
<td nowrap>
|
||||||
<?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->clientinfo_uid, $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->clientinfo_uid, $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
<td nowrap>
|
<td>
|
||||||
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
|
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
|
||||||
'serverinfo_uid' => $entity->getServerEntity()->getPK(),
|
'serverinfo_uid' => $entity->getServerEntity()->getPK(),
|
||||||
'types' => SERVERPART['SERVICE_PARTTYPES'],
|
'types' => SERVERPART['SERVICE_PARTTYPES'],
|
||||||
@ -98,7 +98,7 @@
|
|||||||
<td nowrap>
|
<td nowrap>
|
||||||
<?= $viewDatas['service']->getHelper()->getFieldView('status', $entity->status, $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getFieldView('status', $entity->status, $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
<td><?= $viewDatas['service']->getHelper()->getFieldView('start_at', $entity->start_at, $viewDatas) ?></td>
|
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('start_at', $entity->start_at, $viewDatas) ?></td>
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>
|
||||||
<?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?>
|
||||||
|
|||||||
@ -132,7 +132,7 @@
|
|||||||
<i class="fa fa-support fa-5x"></i>
|
<i class="fa fa-support fa-5x"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8 text-end">
|
<div class="col-8 text-end">
|
||||||
<div class="huge"><?= number_format($viewDatas['totalUnPaidCount']) ?>건/<?= number_format($viewDatas['totalUnPaidAmount']) ?>원</div>
|
<div class="fs-2"><?= number_format($viewDatas['totalUnPaidCount']) ?>건/<?= number_format($viewDatas['totalUnPaidAmount']) ?>원</div>
|
||||||
<div><?= date("Y-m-d") ?> 금일 기준 미납 서비스</div>
|
<div><?= date("Y-m-d") ?> 금일 기준 미납 서비스</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -58,7 +58,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="fw-bold">미납금</th>
|
<th class="fw-bold">미납금</th>
|
||||||
<td class="amount-red">총: <?= $serviceCellDatas['unPaids'][$entity->getPK()]['cnt'] ?>건,<?= number_format($serviceCellDatas['unPaids'][$entity->getPK()]['amount']) ?>원</td>
|
<td class="amount-red">
|
||||||
|
<?php if (array_key_exists($entity->getPK(), $serviceCellDatas['unPaids'])): ?>
|
||||||
|
총: <?= $serviceCellDatas['unPaids'][$entity->getPK()]['cnt'] ?>건/<?= number_format($serviceCellDatas['unPaids'][$entity->getPK()]['amount']) ?>원
|
||||||
|
<?php endif ?>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="text-center"><a href="/admin/customer/payment?clientinfo_uid=<?= $entity->getClientInfoUID() ?>"><button class="btn btn-success">결제내역</button></a></td>
|
<td colspan="2" class="text-center"><a href="/admin/customer/payment?clientinfo_uid=<?= $entity->getClientInfoUID() ?>"><button class="btn btn-success">결제내역</button></a></td>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user