From 539aa6f4268dabd2665e139b8e6e2abcdd94457e Mon Sep 17 00:00:00 2001 From: "sosuke.iwabuchi" Date: Tue, 31 Oct 2023 15:32:33 +0900 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=89=95=E4=BA=88=E5=AE=9A=E3=81=AE?= =?UTF-8?q?=E7=94=BB=E9=9D=A2=E5=87=BA=E5=8A=9B=E3=81=AB=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E5=90=8D=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Kintone/Models/PaymentPlan.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Kintone/Models/PaymentPlan.php b/app/Kintone/Models/PaymentPlan.php index 55510b4..079f8fe 100644 --- a/app/Kintone/Models/PaymentPlan.php +++ b/app/Kintone/Models/PaymentPlan.php @@ -2,6 +2,7 @@ namespace App\Kintone\Models; +use App\Kintone\Models\DropDown\PaymentPlan\PaymentType; use Illuminate\Support\Carbon; /** @@ -69,6 +70,7 @@ class PaymentPlan extends KintoneModel { return [ 'payment_status' => $this->donePayment() ? "支払済み" : "未払い", + 'payment_name' => $this->getViewName(), ]; } @@ -79,4 +81,14 @@ class PaymentPlan extends KintoneModel return !!$paymentDate && $remainingAmount === 0; } + + private function getViewName(): string + { + + if ($this->paymentType === PaymentType::SEASON_TICKET) { + return sprintf("%d年%d月分 定期料金", $this->targetYear, $this->targetMonth); + } + + return $this->paymentType; + } }