|
- <?php
-
- namespace App\Email\Members;
-
- use App\Kintone\Models\SeasonTicketContractEntry;
- use App\Kintone\Models\SeasonTicketContractPlan;
-
- abstract class EntryMessageBuilder
- {
- public static function getPaymentExplainStr(SeasonTicketContractEntry $entry): string
- {
- if (!$entry->paymentLimitDate) {
- return "";
- }
- if (!$entry->firstAmount) {
- return "";
- }
-
- $hiwariStr = !!$entry->hiwariAmount ? sprintf(
- "%d月分日割分%s円と",
- $entry->hiwariMonth,
- number_format($entry->hiwariAmount)
- ) : "";
-
- return sprintf(
- "※料金は利用日までの前払いのため、%s%d月分%s円 (合計%s円)を%sまでにお振込下さい。(手数料は振込者負担でお願い致します。)",
- $hiwariStr,
- $entry->targetMonth,
- number_format($entry->targetAmount),
- number_format($entry->firstAmount),
- $entry->paymentLimitDate->format("Y年m月d日")
- );
- }
-
- public static function getTaxExplain(SeasonTicketContractPlan $plan): string
- {
- // if (!$plan->taxRate || !$plan->taxAmount) {
- // return "";
- // }
-
- return sprintf(
- "(消費税等含む,適用税率%d%% 消費税額 %s円)",
- $plan->taxRate ?? 0,
- number_format($plan->taxAmount ?? 0),
- );
- }
- }
|