mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 12:12:48 +01:00
* Invoice edit view: fix date parsing View gets the date already formatted and Carbon isn't always able to parse that format automatically, so convert it back to SQL format * RecurringInvoiceDatatable: fix status label
This commit is contained in:
parent
2a290765e9
commit
5f998b0ea8
@ -3,6 +3,7 @@
|
||||
namespace App\Ninja\Datatables;
|
||||
|
||||
use Auth;
|
||||
use Carbon;
|
||||
use URL;
|
||||
use Utils;
|
||||
use App\Models\Invoice;
|
||||
@ -84,6 +85,8 @@ class RecurringInvoiceDatatable extends EntityDatatable
|
||||
if ($model->invoice_status_id == INVOICE_STATUS_SENT) {
|
||||
if (! $model->last_sent_date_sql || $model->last_sent_date_sql == '0000-00-00') {
|
||||
$label = trans('texts.pending');
|
||||
} elseif ($model->end_date_sql && Carbon::parse($model->end_date_sql)->isPast()) {
|
||||
$label = trans('texts.status_completed');
|
||||
} else {
|
||||
$label = trans('texts.active');
|
||||
}
|
||||
|
@ -76,7 +76,7 @@
|
||||
@if ($invoice->is_recurring && $invoice->isSent())
|
||||
@if (! $invoice->last_sent_date || $invoice->last_sent_date == '0000-00-00')
|
||||
{!! $invoice->present()->statusLabel(trans('texts.pending')) !!}
|
||||
@elseif ($invoice->end_date && Carbon::parse($invoice->end_date)->isPast())
|
||||
@elseif ($invoice->end_date && Carbon::parse(Utils::toSqlDate($invoice->end_date))->isPast())
|
||||
{!! $invoice->present()->statusLabel(trans('texts.status_completed')) !!}
|
||||
@else
|
||||
{!! $invoice->present()->statusLabel(trans('texts.active')) !!}
|
||||
|
Loading…
Reference in New Issue
Block a user