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), ); } 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"); } }