mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Selectively show recurring dates schedule
This commit is contained in:
parent
320646ae22
commit
37aec1689d
@ -64,7 +64,8 @@ class RecurringInvoiceTransformer extends EntityTransformer
|
||||
|
||||
public function transform(RecurringInvoice $invoice)
|
||||
{
|
||||
return [
|
||||
|
||||
$data = [
|
||||
'id' => $this->encodePrimaryKey($invoice->id),
|
||||
'user_id' => $this->encodePrimaryKey($invoice->user_id),
|
||||
'project_id' => $this->encodePrimaryKey($invoice->project_id),
|
||||
@ -120,13 +121,19 @@ class RecurringInvoiceTransformer extends EntityTransformer
|
||||
'entity_type' => 'recurringInvoice',
|
||||
'frequency_id' => (string) $invoice->frequency_id,
|
||||
'remaining_cycles' => (int) $invoice->remaining_cycles,
|
||||
//'recurring_dates' => (array) $invoice->recurringDates(),
|
||||
'recurring_dates' => [],
|
||||
'auto_bill' => (string) $invoice->auto_bill,
|
||||
'auto_bill_enabled' => (bool) $invoice->auto_bill_enabled,
|
||||
'due_date_days' => (string) $invoice->due_date_days ?: '',
|
||||
'paid_to_date' => (float) $invoice->paid_to_date,
|
||||
'subscription_id' => (string)$this->encodePrimaryKey($invoice->subscription_id),
|
||||
|
||||
];
|
||||
|
||||
|
||||
if(request()->has('show_dates') && request()->query('show_dates') == 'true')
|
||||
$data['recurring_dates'] = (array) $invoice->recurringDates();
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user