Catch no refund date

This commit is contained in:
David Bomba 2024-03-05 11:27:53 +11:00
parent 1878829851
commit e7ae3f81cb

View File

@ -717,7 +717,7 @@ class TemplateService
return collect($payment->refund_meta) return collect($payment->refund_meta)
->map(function ($refund) use ($payment) { ->map(function ($refund) use ($payment) {
$date = \Carbon\Carbon::parse($refund['date'])->addSeconds($payment->client->timezone_offset()); $date = \Carbon\Carbon::parse($refund['date'] ?? $payment->date)->addSeconds($payment->client->timezone_offset());
$date = $this->translateDate($date, $payment->client->date_format(), $payment->client->locale()); $date = $this->translateDate($date, $payment->client->date_format(), $payment->client->locale());
$entity = ctrans('texts.invoice'); $entity = ctrans('texts.invoice');