dbmsv3 init...1
This commit is contained in:
parent
a36382ad18
commit
66fb3bdd2e
@ -3,8 +3,8 @@
|
||||
namespace App\Controllers\Admin\Customer;
|
||||
|
||||
use App\Entities\Customer\ClientEntity;
|
||||
use App\Entities\PaymentEntity;
|
||||
use App\Entities\Customer\ServiceEntity;
|
||||
use App\Entities\PaymentEntity;
|
||||
use App\Services\Customer\ClientService;
|
||||
use App\Services\PaymentService;
|
||||
use CodeIgniter\HTTP\RedirectResponse;
|
||||
@ -74,40 +74,38 @@ class PaymentController extends CustomerController
|
||||
throw new \Exception("청구서에 적용될 리스트를 선택하셔야합니다.");
|
||||
}
|
||||
$rows = [];
|
||||
$clientEntities = [];
|
||||
$serviceEntities = [];
|
||||
foreach ($uids as $uid) {
|
||||
//기존 Entity 가져오기
|
||||
$entity = $this->getService()->getEntity($uid);
|
||||
if (!$entity instanceof PaymentEntity) {
|
||||
throw new \Exception(__METHOD__ . "에서 {$uid}에 대한 결제정보를 찾을수 없습니다.");
|
||||
}
|
||||
if ($entity->getStatus() === STATUS['UNPAID']) { //미지급인경우
|
||||
//entities에 고객 설정
|
||||
//지급기한일이 오늘보다 작거나 같고 미지급인경우
|
||||
if ($entity->getBillingAt() <= date("Y-m-d") && $entity->getStatus() === STATUS['UNPAID']) {
|
||||
//고객 정보가져오기
|
||||
if (array_key_exists($entity->getClientInfoUID(), $clientEntities)) {
|
||||
$clientEntity = $clientEntities[$entity->getClientInfoUID()];
|
||||
} else {
|
||||
$clientEntity = $this->getClientService()->getEntity($entity->getClientInfoUID());
|
||||
if (!$clientEntity instanceof ClientEntity) {
|
||||
throw new \Exception(__METHOD__ . "에서 {$entity->getClientInfoUID()}에 대한 고객정보를 찾을수 없습니다.");
|
||||
}
|
||||
if (!array_key_exists($clientEntity->getPK(), $rows)) {
|
||||
$rows[$clientEntity->getPK()] = [
|
||||
'name' => $clientEntity->getName(),
|
||||
'total_amount' => 0,
|
||||
'services' => [],
|
||||
];
|
||||
$clientEntities[$entity->getClientInfoUID()] = $clientEntity;
|
||||
}
|
||||
//entities에 서비스 설정
|
||||
//서비스 정보가져오기
|
||||
if (array_key_exists($entity->getServiceInfoUid(), $serviceEntities)) {
|
||||
$serviceEntity = $serviceEntities[$entity->getServiceInfoUid()];
|
||||
} else {
|
||||
$serviceEntity = $this->getService()->getServiceService()->getEntity($entity->getServiceInfoUid());
|
||||
if (!$serviceEntity instanceof ServiceEntity) {
|
||||
throw new \Exception(__METHOD__ . "에서 {$entity->getServiceInfoUid()}에 대한 서비스정보를 찾을수 없습니다.");
|
||||
}
|
||||
if (!array_key_exists($serviceEntity->getPK(), $rows[$clientEntity->getPK()]['services'])) {
|
||||
$rows[$clientEntity->getPK()]['services'][$serviceEntity->getPK()] = [
|
||||
'code' => $serviceEntity->getCode(),
|
||||
'billing_at' => $serviceEntity->getBillingAt(),
|
||||
'items' => [],
|
||||
];
|
||||
$serviceEntities[$entity->getServiceInfoUid()] = $serviceEntity;
|
||||
}
|
||||
//entities에 총 결제금액 설정
|
||||
$rows[$clientEntity->getPK()]['services'][$serviceEntity->getPK()]['items'][] = ['title' => $entity->getTitle(), 'amount' => $entity->getAmount()];
|
||||
$rows[$clientEntity->getPK()]['total_amount'] += $entity->getAmount();
|
||||
//Invoice Data 가져오기
|
||||
$rows = $this->getService()->getInvoiceData($clientEntity, $serviceEntity, $entity, $rows);
|
||||
}
|
||||
}
|
||||
// dd($rows);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -31,10 +31,6 @@ abstract class CommonEntity extends Entity
|
||||
{
|
||||
return $this->getTitle();
|
||||
}
|
||||
final public function getCode(): string
|
||||
{
|
||||
return $this->attributes['code'] ?? "";
|
||||
}
|
||||
public function getStatus(): string
|
||||
{
|
||||
return $this->attributes['status'] ?? "";
|
||||
|
||||
@ -9,13 +9,17 @@ class AccountEntity extends CustomerEntity
|
||||
const PK = AccountModel::PK;
|
||||
const TITLE = AccountModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['DEPOSIT'];
|
||||
final public function getUserUID(): string
|
||||
final public function getUserUID(): int
|
||||
{
|
||||
return $this->attributes['user_uid'];
|
||||
}
|
||||
final public function getClientInfoUID(): string
|
||||
final public function getClientInfoUID(): int
|
||||
{
|
||||
return $this->attributes['clientinfo_uid'];
|
||||
}
|
||||
//기본기능
|
||||
public function getContent(): string|null
|
||||
{
|
||||
return $this->attributes['content'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,37 +9,45 @@ class ClientEntity extends CustomerEntity
|
||||
const PK = ClientModel::PK;
|
||||
const TITLE = ClientModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||
final public function getUserUID(): string
|
||||
final public function getUserUID(): int|null
|
||||
{
|
||||
return $this->attributes['user_uid'];
|
||||
}
|
||||
//기본기능
|
||||
public function getCustomTitle(string $field = ClientModel::TITLE): string
|
||||
{
|
||||
return sprintf("[%s]%s", $this->getCode(), $this->$field);
|
||||
}
|
||||
final public function getCode(): string
|
||||
{
|
||||
return $this->attributes['code'];
|
||||
}
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->attributes['name'] ?? "";
|
||||
return $this->attributes['name'];
|
||||
}
|
||||
public function getSite(): string
|
||||
{
|
||||
return $this->attributes['site'] ?? "";
|
||||
return $this->attributes['site'];
|
||||
}
|
||||
public function getRole(): string
|
||||
{
|
||||
return $this->attributes['role'] ?? "";
|
||||
return $this->attributes['role'];
|
||||
}
|
||||
public function getAccountBalance(): int
|
||||
{
|
||||
return $this->attributes['account_balance'] ?? 0;
|
||||
return $this->attributes['account_balance'];
|
||||
}
|
||||
public function getCouponBalance(): int
|
||||
{
|
||||
return $this->attributes['coupon_balance'] ?? 0;
|
||||
return $this->attributes['coupon_balance'];
|
||||
}
|
||||
public function getPointBalance(): int
|
||||
{
|
||||
return $this->attributes['point_balance'] ?? 0;
|
||||
return $this->attributes['point_balance'];
|
||||
}
|
||||
public function getHistory(): string
|
||||
public function getHistory(): string|null
|
||||
{
|
||||
return $this->attributes['history'] ?? "";
|
||||
return $this->attributes['history'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,13 +9,17 @@ class CouponEntity extends CustomerEntity
|
||||
const PK = CouponModel::PK;
|
||||
const TITLE = CouponModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['DEPOSIT'];
|
||||
final public function getUserUID(): string
|
||||
final public function getUserUID(): int|null
|
||||
{
|
||||
return $this->attributes['user_uid'];
|
||||
}
|
||||
final public function getClientInfoUID(): string
|
||||
final public function getClientInfoUID(): int|null
|
||||
{
|
||||
return $this->attributes['clientinfo_uid'];
|
||||
}
|
||||
//기본기능
|
||||
public function getContent(): string|null
|
||||
{
|
||||
return $this->attributes['content'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,13 +9,17 @@ class PointEntity extends CustomerEntity
|
||||
const PK = PointModel::PK;
|
||||
const TITLE = PointModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['DEPOSIT'];
|
||||
final public function getUserUID(): string
|
||||
final public function getUserUID(): int|null
|
||||
{
|
||||
return $this->attributes['user_uid'];
|
||||
}
|
||||
final public function getClientInfoUID(): string
|
||||
final public function getClientInfoUID(): int|null
|
||||
{
|
||||
return $this->attributes['clientinfo_uid'];
|
||||
}
|
||||
//기본기능
|
||||
public function getContent(): string|null
|
||||
{
|
||||
return $this->attributes['content'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@ namespace App\Entities\Customer;
|
||||
|
||||
use App\Entities\Equipment\ServerEntity;
|
||||
use App\Entities\PaymentEntity;
|
||||
use App\Entities\UserEntity;
|
||||
use App\Models\Customer\ServiceModel;
|
||||
|
||||
class ServiceEntity extends CustomerEntity
|
||||
@ -19,7 +18,7 @@ class ServiceEntity extends CustomerEntity
|
||||
}
|
||||
final public function getServerEntity(): ServerEntity|null
|
||||
{
|
||||
return $this->attributes['serverEntity'] ?? null;
|
||||
return $this->attributes['serverEntity'];
|
||||
}
|
||||
final public function setPaymentEntity(PaymentEntity $entity): self
|
||||
{
|
||||
@ -28,66 +27,70 @@ class ServiceEntity extends CustomerEntity
|
||||
}
|
||||
final public function getPaymentEntity(): PaymentEntity|null
|
||||
{
|
||||
return $this->attributes['paymentEntity'] ?? null;
|
||||
return $this->attributes['paymentEntity'];
|
||||
}
|
||||
final public function getUserUID(): string
|
||||
final public function getUserUID(): int|null
|
||||
{
|
||||
return $this->attributes['user_uid'];
|
||||
}
|
||||
final public function getClientInfoUID(): string
|
||||
final public function getClientInfoUID(): int
|
||||
{
|
||||
return $this->attributes['clientinfo_uid'];
|
||||
}
|
||||
final public function getServerInfoUID(): string
|
||||
final public function getServerInfoUID(): int
|
||||
{
|
||||
return $this->attributes['serverinfo_uid'];
|
||||
}
|
||||
final public function getPaymentUID(): string|null
|
||||
{
|
||||
return $this->attributes['payment_uid'] ?? null;
|
||||
return $this->attributes['payment_uid'];
|
||||
}
|
||||
//기본기능용
|
||||
public function getCustomTitle(): string
|
||||
public function getCustomTitle(string $field = ServiceModel::TITLE): string
|
||||
{
|
||||
return sprintf("[%s] %s", $this->getCode(), $this->getServerEntity()->getTitle());
|
||||
return sprintf("[%s]%s", $this->getCode(), $this->$field);
|
||||
}
|
||||
final public function getCode(): string
|
||||
{
|
||||
return $this->attributes['code'];
|
||||
}
|
||||
final public function getSite(): string
|
||||
{
|
||||
return $this->attributes['site'] ?? "";
|
||||
return $this->attributes['site'];
|
||||
}
|
||||
final public function getLocation(): string
|
||||
{
|
||||
return $this->attributes['location'] ?? "";
|
||||
return $this->attributes['location'];
|
||||
}
|
||||
final public function getBillingAt(): string
|
||||
{
|
||||
return $this->attributes['billing_at'] ?? "";
|
||||
return $this->attributes['billing_at'];
|
||||
}
|
||||
//청구금액->기본:상면비+회선비+서버금액(price)+서버파트연결(월비용)-할인액
|
||||
final public function getSale(): int
|
||||
{
|
||||
return $this->attributes['sale'] ?? 0;
|
||||
return $this->attributes['sale'];
|
||||
}
|
||||
final public function getAmount(): int
|
||||
{
|
||||
return $this->attributes['amount'] ?? 0;
|
||||
return $this->attributes['amount'];
|
||||
}
|
||||
//상면비
|
||||
final public function getRack(): int
|
||||
{
|
||||
return $this->attributes['rack'] ?? 0;
|
||||
return $this->attributes['rack'];
|
||||
}
|
||||
//회선비
|
||||
final public function getLine(): int
|
||||
{
|
||||
return $this->attributes['line'] ?? 0;
|
||||
return $this->attributes['line'];
|
||||
}
|
||||
final public function getStartAt(): string
|
||||
{
|
||||
return $this->attributes['start_at'] ?? "";
|
||||
return $this->attributes['start_at'];
|
||||
}
|
||||
public function getHistory(): string
|
||||
public function getHistory(): string|null
|
||||
{
|
||||
return $this->attributes['history'] ?? "";
|
||||
return $this->attributes['history'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,18 +9,22 @@ class ServerEntity extends EquipmentEntity
|
||||
const PK = ServerModel::PK;
|
||||
const TITLE = ServerModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||
final public function getClientInfoUID(): string|null
|
||||
final public function getClientInfoUID(): int|null
|
||||
{
|
||||
return $this->attributes['clientinfo_uid'] ?? null;
|
||||
return $this->attributes['clientinfo_uid'];
|
||||
}
|
||||
final public function getServiceInfoUID(): string|null
|
||||
final public function getServiceInfoUID(): int|null
|
||||
{
|
||||
return $this->attributes['serviceinfo_uid'] ?? null;
|
||||
return $this->attributes['serviceinfo_uid'];
|
||||
}
|
||||
//기본기능용
|
||||
public function getCustomTitle(): string
|
||||
public function getCustomTitle(string $field = ServerModel::TITLE): string
|
||||
{
|
||||
return sprintf("[%s] %s", $this->getCode(), $this->getTitle());
|
||||
return sprintf("[%s]%s", $this->getCode(), $this->$field);
|
||||
}
|
||||
final public function getCode(): string
|
||||
{
|
||||
return $this->attributes['code'] ?? "";
|
||||
}
|
||||
public function getPrice(): int
|
||||
{
|
||||
|
||||
@ -17,7 +17,7 @@ class ServerPartEntity extends EquipmentEntity
|
||||
//여러클래스존재가능
|
||||
public function getPartEntity(): mixed
|
||||
{
|
||||
return $this->attributes['partEntity'] ?? null;
|
||||
return $this->attributes['partEntity'];
|
||||
}
|
||||
final public function setPaymentEntity(PaymentEntity $entity): self
|
||||
{
|
||||
@ -26,29 +26,26 @@ class ServerPartEntity extends EquipmentEntity
|
||||
}
|
||||
final public function getPaymentEntity(): PaymentEntity|null
|
||||
{
|
||||
return $this->attributes['paymentEntity'] ?? null;
|
||||
return $this->attributes['paymentEntity'];
|
||||
}
|
||||
public function getPartUID(): int
|
||||
{
|
||||
return intval($this->attributes['part_uid']) ?? 0;
|
||||
}
|
||||
final public function getUserUID(): string|null
|
||||
{
|
||||
return $this->attributes['user_uid'];
|
||||
}
|
||||
final public function getClientInfoUID(): string|null
|
||||
{
|
||||
return $this->attributes['clientinfo_uid'];
|
||||
}
|
||||
final public function getServiceInfoUID(): string|null
|
||||
{
|
||||
return $this->attributes['serviceinfo_uid'];
|
||||
}
|
||||
final public function getServerInfoUID(): string
|
||||
final public function getServerInfoUID(): int
|
||||
{
|
||||
return $this->attributes['serverinfo_uid'];
|
||||
}
|
||||
final public function getPaymentUID(): string|null
|
||||
|
||||
public function getPartUID(): int
|
||||
{
|
||||
return intval($this->attributes['part_uid']);
|
||||
}
|
||||
final public function getClientInfoUID(): int|null
|
||||
{
|
||||
return $this->attributes['clientinfo_uid'];
|
||||
}
|
||||
final public function getServiceInfoUID(): int|null
|
||||
{
|
||||
return $this->attributes['serviceinfo_uid'];
|
||||
}
|
||||
final public function getPaymentUID(): int|null
|
||||
{
|
||||
return $this->attributes['payment_uid'] ?? null;
|
||||
}
|
||||
@ -64,24 +61,25 @@ class ServerPartEntity extends EquipmentEntity
|
||||
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->attributes['type'] ?? "";
|
||||
return $this->attributes['type'];
|
||||
}
|
||||
public function getBilling(): string
|
||||
{
|
||||
return $this->attributes['billing'] ?? "";
|
||||
return $this->attributes['billing'];
|
||||
}
|
||||
public function getAmount(): int
|
||||
{
|
||||
return $this->attributes['amount'] ?? 0;
|
||||
return $this->attributes['amount'];
|
||||
}
|
||||
public function getCnt(): int
|
||||
{
|
||||
return $this->attributes['cnt'] ?? 0;
|
||||
return $this->attributes['cnt'];
|
||||
}
|
||||
public function getExtra(): string
|
||||
public function getExtra(): string|null
|
||||
{
|
||||
return $this->attributes['extra'] ?? "";
|
||||
return $this->attributes['extra'];
|
||||
}
|
||||
//리스트에서 상태표시용
|
||||
public function getStatus(): string
|
||||
{
|
||||
return self::DEFAULT_STATUS;
|
||||
|
||||
@ -9,4 +9,9 @@ class CPUEntity extends PartEntity
|
||||
const PK = CPUModel::PK;
|
||||
const TITLE = CPUModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||
//기본기능
|
||||
final public function getStock(): int
|
||||
{
|
||||
return $this->attributes['stock'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,4 +9,18 @@ class CSEntity extends PartEntity
|
||||
const PK = CSModel::PK;
|
||||
const TITLE = CSModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||
//기본기능
|
||||
public function getIP(): string
|
||||
{
|
||||
return $this->attributes['ip'];
|
||||
}
|
||||
//기본기능
|
||||
public function getAccountID(): string|null
|
||||
{
|
||||
return $this->attributes['accountid'];
|
||||
}
|
||||
public function getDomain(): string|null
|
||||
{
|
||||
return $this->attributes['domain'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,11 @@ class DISKEntity extends PartEntity
|
||||
const PK = DISKModel::PK;
|
||||
const TITLE = DISKModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||
|
||||
//기본기능
|
||||
final public function getStock(): int
|
||||
{
|
||||
return $this->attributes['stock'];
|
||||
}
|
||||
public function getFormat(): int
|
||||
{
|
||||
return intval($this->attributes['format'] ?? 0);
|
||||
|
||||
@ -9,6 +9,10 @@ class IPEntity extends PartEntity
|
||||
const PK = IPModel::PK;
|
||||
const TITLE = IPModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||
final public function getLineInfoUID(): string
|
||||
{
|
||||
return $this->attributes['lineinfo_uid'];
|
||||
}
|
||||
final public function getOldClientInfoUID(): string|null
|
||||
{
|
||||
return $this->attributes['old_clientinfo_uid'];
|
||||
|
||||
@ -9,4 +9,9 @@ class OSEntity extends PartEntity
|
||||
const PK = OSModel::PK;
|
||||
const TITLE = OSModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||
//기본기능
|
||||
final public function getStock(): int
|
||||
{
|
||||
return $this->attributes['stock'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,20 +22,13 @@ abstract class PartEntity extends CommonEntity
|
||||
{
|
||||
return $this->attributes['serverinfo_uid'];
|
||||
}
|
||||
final public function getLineInfoUID(): string
|
||||
//기본기능용
|
||||
final public function getCustomTitle(): string
|
||||
{
|
||||
return $this->attributes['lineinfo_uid'];
|
||||
return $this->getTitle() . " " . number_format($this->getPrice()) . "원";
|
||||
}
|
||||
final public function getPrice(): int
|
||||
{
|
||||
return $this->attributes['price'];
|
||||
}
|
||||
final public function getStock(): int
|
||||
{
|
||||
return $this->attributes['stock'];
|
||||
}
|
||||
final public function getCustomTitle(): string
|
||||
{
|
||||
return $this->getTitle() . " " . number_format($this->getPrice()) . "원";
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,4 +9,9 @@ class RAMEntity extends PartEntity
|
||||
const PK = RAMModel::PK;
|
||||
const TITLE = RAMModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||
//기본기능
|
||||
final public function getStock(): int
|
||||
{
|
||||
return $this->attributes['stock'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,4 +9,9 @@ class SOFTWAREEntity extends PartEntity
|
||||
const PK = SOFTWAREModel::PK;
|
||||
const TITLE = SOFTWAREModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||
//기본기능
|
||||
final public function getStock(): int
|
||||
{
|
||||
return $this->attributes['stock'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,4 +9,9 @@ class SWITCHEntity extends PartEntity
|
||||
const PK = SWITCHModel::PK;
|
||||
const TITLE = SWITCHModel::TITLE;
|
||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||
|
||||
final public function getCode(): string
|
||||
{
|
||||
return $this->attributes['code'] ?? "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,34 +14,34 @@ class PaymentEntity extends CommonEntity
|
||||
{
|
||||
return $this->attributes['user_uid'];
|
||||
}
|
||||
final public function getClientInfoUID(): int|null
|
||||
final public function getClientInfoUID(): int
|
||||
{
|
||||
return $this->attributes['clientinfo_uid'] ?? null;
|
||||
return $this->attributes['clientinfo_uid'];
|
||||
}
|
||||
final public function getServiceInfoUID(): int|null
|
||||
final public function getServiceInfoUID(): int
|
||||
{
|
||||
return $this->attributes['serviceinfo_uid'] ?? null;
|
||||
return $this->attributes['serviceinfo_uid'];
|
||||
}
|
||||
//기본기능
|
||||
public function getBilling(): string
|
||||
{
|
||||
return $this->attributes['billing'] ?? "";
|
||||
return $this->attributes['billing'];
|
||||
}
|
||||
public function getAmount(): int
|
||||
{
|
||||
return $this->attributes['amount'] ?? 0;
|
||||
return $this->attributes['amount'];
|
||||
}
|
||||
public function getBillingAt(): string
|
||||
{
|
||||
return $this->attributes['billing_at'] ?? "";
|
||||
return $this->attributes['billing_at'];
|
||||
}
|
||||
public function getPay(): string
|
||||
public function getPay(): string|null
|
||||
{
|
||||
return $this->attributes['pay'] ?? "";
|
||||
return $this->attributes['pay'];
|
||||
}
|
||||
public function getContent(): string
|
||||
public function getContent(): string|null
|
||||
{
|
||||
return $this->attributes['content'] ?? "";
|
||||
return $this->attributes['content'];
|
||||
}
|
||||
public function getCountDueAt(): string
|
||||
{
|
||||
|
||||
@ -13,14 +13,14 @@ class UserEntity extends CommonEntity
|
||||
|
||||
public function getID(): string
|
||||
{
|
||||
return $this->attributes['id'] ?? "";
|
||||
return $this->attributes['id'];
|
||||
}
|
||||
public function getPassword(): string
|
||||
{
|
||||
return $this->attributes['passwd'] ?? "";
|
||||
return $this->attributes['passwd'];
|
||||
}
|
||||
public function getRole(): string
|
||||
{
|
||||
return $this->attributes['role'] ?? "";
|
||||
return $this->attributes['role'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,14 +17,14 @@ class UserSNSEntity extends CommonEntity
|
||||
}
|
||||
public function getID(): string
|
||||
{
|
||||
return $this->attributes['id'] ?? "";
|
||||
return $this->attributes['id'];
|
||||
}
|
||||
public function getSite(): string
|
||||
{
|
||||
return $this->attributes['site'] ?? "";
|
||||
return $this->attributes['site'];
|
||||
}
|
||||
public function getEmail(): string
|
||||
{
|
||||
return $this->attributes['email'] ?? "";
|
||||
return $this->attributes['email'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,6 +96,7 @@ class ClientHelper extends CustomerHelper
|
||||
break;
|
||||
case 'coupon':
|
||||
case 'account':
|
||||
case 'point':
|
||||
$extras = [
|
||||
"class" => "btn btn-sm btn-outline btn-circle btn-link form-label-sm",
|
||||
"target" => "_self",
|
||||
|
||||
@ -6,6 +6,7 @@ return [
|
||||
'clientinfo_uid' => "고객명",
|
||||
'bank' => "은행",
|
||||
'title' => "제목",
|
||||
'content' => "내용",
|
||||
'alias' => "입출금자명",
|
||||
'amount' => "금액",
|
||||
'status' => "상태",
|
||||
|
||||
@ -4,6 +4,7 @@ return [
|
||||
'label' => [
|
||||
'clientinfo_uid' => "고객명",
|
||||
'title' => "제목",
|
||||
'content' => "내용",
|
||||
'cnt' => "갯수",
|
||||
'status' => "추가/사용",
|
||||
'updated_at' => "수정일",
|
||||
|
||||
@ -4,6 +4,7 @@ return [
|
||||
'label' => [
|
||||
'clientinfo_uid' => "고객명",
|
||||
'title' => "제목",
|
||||
'content' => "내용",
|
||||
'amount' => "금액",
|
||||
'status' => "입/출금",
|
||||
'updated_at' => "수정일",
|
||||
|
||||
@ -18,6 +18,7 @@ class AccountModel extends CustomerModel
|
||||
"clientinfo_uid",
|
||||
"bank",
|
||||
"title",
|
||||
"content",
|
||||
"alias",
|
||||
"issue_at",
|
||||
"amount",
|
||||
@ -48,6 +49,9 @@ class AccountModel extends CustomerModel
|
||||
case "issue_at":
|
||||
$rule = "required|valid_date";
|
||||
break;
|
||||
case "content":
|
||||
$rule = "permit_empty|trim|string";
|
||||
break;
|
||||
default:
|
||||
$rule = parent::getFormRule($action, $field);
|
||||
break;
|
||||
|
||||
@ -17,6 +17,7 @@ class CouponModel extends CustomerModel
|
||||
"user_uid",
|
||||
"clientinfo_uid",
|
||||
"title",
|
||||
"content",
|
||||
"cnt",
|
||||
"status",
|
||||
"updated_at"
|
||||
@ -40,6 +41,9 @@ class CouponModel extends CustomerModel
|
||||
case "status":
|
||||
$rule = "required|trim|string";
|
||||
break;
|
||||
case "content":
|
||||
$rule = "permit_empty|trim|string";
|
||||
break;
|
||||
default:
|
||||
$rule = parent::getFormRule($action, $field);
|
||||
break;
|
||||
|
||||
@ -17,6 +17,7 @@ class PointModel extends CustomerModel
|
||||
"user_uid",
|
||||
"clientinfo_uid",
|
||||
"title",
|
||||
"content",
|
||||
"amount",
|
||||
"status",
|
||||
"updated_at"
|
||||
@ -40,6 +41,9 @@ class PointModel extends CustomerModel
|
||||
case "status":
|
||||
$rule = "required|trim|string";
|
||||
break;
|
||||
case "content":
|
||||
$rule = "permit_empty|trim|string";
|
||||
break;
|
||||
default:
|
||||
$rule = parent::getFormRule($action, $field);
|
||||
break;
|
||||
|
||||
@ -54,7 +54,7 @@ class ServerPartModel extends EquipmentModel
|
||||
$rule = "required|trim|string";
|
||||
break;
|
||||
case "extra":
|
||||
$rule = "permit_empty|string";
|
||||
$rule = "permit_empty|trim|string";
|
||||
break;
|
||||
default:
|
||||
$rule = parent::getFormRule($action, $field);
|
||||
|
||||
@ -27,6 +27,7 @@ class AccountService extends CustomerService implements PaymentInterface
|
||||
"issue_at",
|
||||
"amount",
|
||||
"status",
|
||||
"content"
|
||||
];
|
||||
}
|
||||
public function getFormFilters(): array
|
||||
|
||||
@ -21,6 +21,7 @@ class CouponService extends CustomerService
|
||||
"title",
|
||||
"cnt",
|
||||
"status",
|
||||
"content"
|
||||
];
|
||||
}
|
||||
public function getFormFilters(): array
|
||||
|
||||
@ -22,6 +22,7 @@ class PointService extends CustomerService
|
||||
"title",
|
||||
"amount",
|
||||
"status",
|
||||
"content"
|
||||
];
|
||||
}
|
||||
public function getFormFilters(): array
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Entities\Customer\ClientEntity;
|
||||
use App\Entities\Customer\ServiceEntity;
|
||||
use App\Entities\Equipment\ServerPartEntity;
|
||||
use App\Entities\PaymentEntity;
|
||||
@ -199,6 +200,28 @@ class PaymentService extends CommonService implements ServiceInterface, ServerPa
|
||||
}
|
||||
return $serverPartEntity->setPaymentEntity($entity);
|
||||
}
|
||||
//Invoice 관련
|
||||
public function getInvoiceData(ClientEntity $clientEntity, ServiceEntity $serviceEntity, PaymentEntity $entity, array $rows): array
|
||||
{
|
||||
if (!array_key_exists($clientEntity->getPK(), $rows)) {
|
||||
$rows[$clientEntity->getPK()] = [
|
||||
'name' => $clientEntity->getName(),
|
||||
'total_amount' => 0,
|
||||
'services' => [],
|
||||
];
|
||||
}
|
||||
if (!array_key_exists($serviceEntity->getPK(), $rows[$clientEntity->getPK()]['services'])) {
|
||||
$rows[$clientEntity->getPK()]['services'][$serviceEntity->getPK()] = [
|
||||
'ip' => $serviceEntity->getServerEntity()->getIP(),
|
||||
'billing_at' => $serviceEntity->getBillingAt(),
|
||||
'items' => [],
|
||||
];
|
||||
}
|
||||
//entities에 총 결제금액 설정
|
||||
$rows[$clientEntity->getPK()]['services'][$serviceEntity->getPK()]['items'][] = ['title' => $entity->getTitle(), 'amount' => $entity->getAmount()];
|
||||
$rows[$clientEntity->getPK()]['total_amount'] += $entity->getAmount();
|
||||
return $rows;
|
||||
}
|
||||
//기본 기능부분
|
||||
//FieldForm관련용
|
||||
final public function getFormOption(string $field, array $options = []): array
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
<th>대체</th>
|
||||
<th>쿠폰</th>
|
||||
<th>예치금</th>
|
||||
<th>포인트</th>
|
||||
<th>전체요금</th>
|
||||
<th>전체미납금</th>
|
||||
</tr>
|
||||
@ -50,6 +51,7 @@
|
||||
<td><?= $viewDatas['totalCounts']['alternative']['summary'] ?></td>
|
||||
<td><?= $viewDatas['service']->getHelper()->getListButton("coupon", $viewDatas['entity']->getCouponBalance(), $viewDatas) ?></td>
|
||||
<td><?= $viewDatas['service']->getHelper()->getListButton("account", number_format($viewDatas['entity']->getAccountBalance()) . "원", $viewDatas) ?></td>
|
||||
<td><?= $viewDatas['service']->getHelper()->getListButton("point", number_format($viewDatas['entity']->getPointBalance()), $viewDatas) ?></td>
|
||||
<td><?= array_key_exists($viewDatas['entity']->getPK(), $viewDatas['totalAmounts']) ? number_format($viewDatas['totalAmounts'][$viewDatas['entity']->getPK()]) : 0 ?>원</td>
|
||||
<td>
|
||||
<?php if (array_key_exists($viewDatas['entity']->getPK(), $viewDatas['unPaids'])): ?>
|
||||
|
||||
@ -33,13 +33,13 @@
|
||||
<td colspan="2">
|
||||
<table class="table table-sm table-bordered">
|
||||
<tr>
|
||||
<th class="p-0">코드</th>
|
||||
<th class="p-0">서버 IP</th>
|
||||
<th class="p-0">항목</th>
|
||||
<th class="p-0">결제일</th>
|
||||
</tr>
|
||||
<?php foreach ($row['services'] as $service): ?>
|
||||
<tr>
|
||||
<td class="p-0"><?= $service['code'] ?></td>
|
||||
<td class="p-0"><?= $service['ip'] ?></td>
|
||||
<td class="p-0">
|
||||
<ol>
|
||||
<?php foreach ($service['items'] as $item): ?>
|
||||
|
||||
@ -3,11 +3,11 @@
|
||||
안녕하세요 Prime IDC 입니다.<BR>
|
||||
항상 저희 IDC를 이용해 주셔서 감사합니다.<BR>
|
||||
서버비 안내 드립니다.<BR>
|
||||
<div class="p-0">고객명: <?= $row['name'] ?> , 총 납부금액: <?= number_format($row['total_amount']) ?>원</div>
|
||||
<div class="p-0">고객명: <?= $row['name'] ?> , 총 결제금액: <?= number_format($row['total_amount']) ?>원</div>
|
||||
===========================<BR>
|
||||
<ol>
|
||||
<?php foreach ($row['services'] as $service): ?>
|
||||
<li class="p-0">서비스:<?= $service['code'] ?> , 결제일:<?= $service['billing_at'] ?></li>
|
||||
<li class="p-0">서버 IP:<?= $service['ip'] ?> , 결제일:<?= $service['billing_at'] ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
===========================<BR>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user