1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00

Show recurring invoices as 'active' rather than 'sent'

This commit is contained in:
Hillel Coren 2017-07-05 16:17:30 +03:00
parent 86527cf572
commit 834bce5eb2
2 changed files with 12 additions and 4 deletions

View File

@ -81,8 +81,12 @@ class RecurringInvoiceDatatable extends EntityDatatable
$class = Invoice::calcStatusClass($model->invoice_status_id, $model->balance, $model->due_date_sql, $model->is_recurring); $class = Invoice::calcStatusClass($model->invoice_status_id, $model->balance, $model->due_date_sql, $model->is_recurring);
$label = Invoice::calcStatusLabel($model->invoice_status_name, $class, $this->entityType, $model->quote_invoice_id); $label = Invoice::calcStatusLabel($model->invoice_status_name, $class, $this->entityType, $model->quote_invoice_id);
if ($model->invoice_status_id == INVOICE_STATUS_SENT && (! $model->last_sent_date_sql || $model->last_sent_date_sql == '0000-00-00')) { 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'); $label = trans('texts.pending');
} else {
$label = trans('texts.active');
}
} }
return "<h4><div class=\"label label-{$class}\">$label</div></h4>"; return "<h4><div class=\"label label-{$class}\">$label</div></h4>";

View File

@ -53,8 +53,12 @@
<li>{!! link_to(($entityType == ENTITY_QUOTE ? 'quotes' : 'invoices'), trans('texts.' . ($entityType == ENTITY_QUOTE ? 'quotes' : 'invoices'))) !!}</li> <li>{!! link_to(($entityType == ENTITY_QUOTE ? 'quotes' : 'invoices'), trans('texts.' . ($entityType == ENTITY_QUOTE ? 'quotes' : 'invoices'))) !!}</li>
<li class="active">{{ $invoice->invoice_number }}</li> <li class="active">{{ $invoice->invoice_number }}</li>
@endif @endif
@if ($invoice->is_recurring && $invoice->isSent() && (! $invoice->last_sent_date || $invoice->last_sent_date == '0000-00-00')) @if ($invoice->is_recurring && $invoice->isSent())
@if (! $invoice->last_sent_date || $invoice->last_sent_date == '0000-00-00')
{!! $invoice->present()->statusLabel(trans('texts.pending')) !!} {!! $invoice->present()->statusLabel(trans('texts.pending')) !!}
@else
{!! $invoice->present()->statusLabel(trans('texts.active')) !!}
@endif
@else @else
{!! $invoice->present()->statusLabel !!} {!! $invoice->present()->statusLabel !!}
@endif @endif