| @@ -43,10 +43,12 @@ class EntryApprove extends Members | |||||
| 'use_start_date' => $entry->useStartDate ? $entry->useStartDate->format('Y/m/d') : "-", | 'use_start_date' => $entry->useStartDate ? $entry->useStartDate->format('Y/m/d') : "-", | ||||
| 'payment_method' => $entry->paymentMethod ?? "-", | 'payment_method' => $entry->paymentMethod ?? "-", | ||||
| 'amount' => number_format($entry->amount ?? 0), | 'amount' => number_format($entry->amount ?? 0), | ||||
| 'paymentExplain' => EntryMessageBuilder::getPaymentExplainStr($this->entry), | |||||
| 'taxExplain' => EntryMessageBuilder::getTaxExplain($this->plan), | |||||
| 'payment_explain' => EntryMessageBuilder::getPaymentExplainStr($this->entry), | |||||
| 'tax_explain' => EntryMessageBuilder::getTaxExplain($this->plan), | |||||
| 'can_terminate_15' => in_array(Parking::ELEMENT_CAN_TERMINATE_DATE_15, $this->parking->canTerminateDate), | 'can_terminate_15' => in_array(Parking::ELEMENT_CAN_TERMINATE_DATE_15, $this->parking->canTerminateDate), | ||||
| 'can_terminate_end_of_month' => in_array(Parking::ELEMENT_CAN_TERMINATE_DATE_END_OF_MONTH, $this->parking->canTerminateDate), | 'can_terminate_end_of_month' => in_array(Parking::ELEMENT_CAN_TERMINATE_DATE_END_OF_MONTH, $this->parking->canTerminateDate), | ||||
| 'deposit_explain' => EntryMessageBuilder::getDepositExplain($this->plan), | |||||
| 'total_payment_amount' => number_format(($entry->firstAmount ?? 0) + ($this->plan->totalDeposit ?? 0)), | |||||
| ]; | ]; | ||||
| } | } | ||||
| } | } | ||||
| @@ -44,4 +44,27 @@ abstract class EntryMessageBuilder | |||||
| number_format($plan->taxAmount ?? 0), | number_format($plan->taxAmount ?? 0), | ||||
| ); | ); | ||||
| } | } | ||||
| public static function getDepositExplain(SeasonTicketContractPlan $plan): string | |||||
| { | |||||
| $lines = collect(); | |||||
| if ($plan->deposit) { | |||||
| $lines->push(sprintf("保証金:%s円", number_format($plan->deposit))); | |||||
| } | |||||
| if ($plan->chainGateDeposit) { | |||||
| $lines->push(sprintf("チェーンゲート保証金:%s円", number_format($plan->chainGateDeposit))); | |||||
| } | |||||
| if ($plan->cardDeposit) { | |||||
| $lines->push(sprintf("パスカード保証金:%s円", number_format($plan->cardDeposit))); | |||||
| } | |||||
| if ($lines->isNotEmpty()) { | |||||
| $lines->prepend("---保証金------"); | |||||
| $lines->push(sprintf("保証金合計:%s円", number_format($plan->totalDeposit))); | |||||
| $lines->push("---------------"); | |||||
| } | |||||
| return $lines->join("\n"); | |||||
| } | |||||
| } | } | ||||
| @@ -15,6 +15,10 @@ use Illuminate\Support\Collection; | |||||
| * @property ?int taxAmount | * @property ?int taxAmount | ||||
| * @property ?int taxRate | * @property ?int taxRate | ||||
| * @property Collection<int ,CanChangePlanName> canChangePlanNameList | * @property Collection<int ,CanChangePlanName> canChangePlanNameList | ||||
| * @property ?int deposit | |||||
| * @property ?int chainGateDeposit | |||||
| * @property ?int cardDeposit | |||||
| * @property ?int totalDeposit | |||||
| */ | */ | ||||
| class SeasonTicketContractPlan extends KintoneModel | class SeasonTicketContractPlan extends KintoneModel | ||||
| { | { | ||||
| @@ -27,6 +31,10 @@ class SeasonTicketContractPlan extends KintoneModel | |||||
| const FIELD_VEHICLE_TYPE = "種別"; | const FIELD_VEHICLE_TYPE = "種別"; | ||||
| const FIELD_TAX_AMOUNT = "内税"; | const FIELD_TAX_AMOUNT = "内税"; | ||||
| const FIELD_TAX_RATE = "税率"; | const FIELD_TAX_RATE = "税率"; | ||||
| const FIELD_DEPOSIT = "保証金"; | |||||
| const FIELD_CHAIN_GATE_DEPOSIT = "チェーンゲート保証金"; | |||||
| const FIELD_CARD_DEPOSIT = "パスカード保証金"; | |||||
| const FIELD_TOTAL_DEPOSIT = "保証金合計額"; | |||||
| const FIELD_CAN_CHANGE_PLAN_NAME_LIST = "プラン変更申請にて変更可能なプラン一覧"; | const FIELD_CAN_CHANGE_PLAN_NAME_LIST = "プラン変更申請にて変更可能なプラン一覧"; | ||||
| const FIELD_CAN_CHANGE_PLAN_NAME_LIST_PLAN_NAME = "プラン変更申請にて変更可能なプラン一覧_定期_駐車場名_月額金額_駐車場備考_プラン_種別_支払パターン"; | const FIELD_CAN_CHANGE_PLAN_NAME_LIST_PLAN_NAME = "プラン変更申請にて変更可能なプラン一覧_定期_駐車場名_月額金額_駐車場備考_プラン_種別_支払パターン"; | ||||
| @@ -41,6 +49,10 @@ class SeasonTicketContractPlan extends KintoneModel | |||||
| self::FIELD_TAX_AMOUNT => FieldType::NUMBER, | self::FIELD_TAX_AMOUNT => FieldType::NUMBER, | ||||
| self::FIELD_TAX_RATE => FieldType::NUMBER, | self::FIELD_TAX_RATE => FieldType::NUMBER, | ||||
| self::FIELD_CAN_CHANGE_PLAN_NAME_LIST => FieldType::SUBTABLE, | self::FIELD_CAN_CHANGE_PLAN_NAME_LIST => FieldType::SUBTABLE, | ||||
| self::FIELD_DEPOSIT => FieldType::NUMBER, | |||||
| self::FIELD_CHAIN_GATE_DEPOSIT => FieldType::NUMBER, | |||||
| self::FIELD_CARD_DEPOSIT => FieldType::NUMBER, | |||||
| self::FIELD_TOTAL_DEPOSIT => FieldType::NUMBER, | |||||
| ]; | ]; | ||||
| protected const SUB_TABLES = [ | protected const SUB_TABLES = [ | ||||
| @@ -35,10 +35,12 @@ | |||||
| ◆◆お支払方法及び定期駐車料金 | ◆◆お支払方法及び定期駐車料金 | ||||
| お支払方法:{{ $payment_method }} | お支払方法:{{ $payment_method }} | ||||
| 定期駐車料金:{{ $amount }}円 {{ $taxExplain }} | |||||
| @if($paymentExplain) | |||||
| {{ $paymentExplain }} | |||||
| 定期駐車料金:{{ $amount }}円 {{ $tax_explain }} | |||||
| @if($payment_explain) | |||||
| {{ $payment_explain }} | |||||
| @endif | @endif | ||||
| {{ $deposit_explain }} | |||||
| お支払い合計金額 {{ $total_payment_amount }}円 | |||||
| 銀行:ゆうちょ銀行 | 銀行:ゆうちょ銀行 | ||||
| 店名:四四八(ヨンヨンハチ) | 店名:四四八(ヨンヨンハチ) | ||||