mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04: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)
|
public function transform(RecurringInvoice $invoice)
|
||||||
{
|
{
|
||||||
return [
|
|
||||||
|
$data = [
|
||||||
'id' => $this->encodePrimaryKey($invoice->id),
|
'id' => $this->encodePrimaryKey($invoice->id),
|
||||||
'user_id' => $this->encodePrimaryKey($invoice->user_id),
|
'user_id' => $this->encodePrimaryKey($invoice->user_id),
|
||||||
'project_id' => $this->encodePrimaryKey($invoice->project_id),
|
'project_id' => $this->encodePrimaryKey($invoice->project_id),
|
||||||
@ -120,13 +121,19 @@ class RecurringInvoiceTransformer extends EntityTransformer
|
|||||||
'entity_type' => 'recurringInvoice',
|
'entity_type' => 'recurringInvoice',
|
||||||
'frequency_id' => (string) $invoice->frequency_id,
|
'frequency_id' => (string) $invoice->frequency_id,
|
||||||
'remaining_cycles' => (int) $invoice->remaining_cycles,
|
'remaining_cycles' => (int) $invoice->remaining_cycles,
|
||||||
//'recurring_dates' => (array) $invoice->recurringDates(),
|
|
||||||
'recurring_dates' => [],
|
'recurring_dates' => [],
|
||||||
'auto_bill' => (string) $invoice->auto_bill,
|
'auto_bill' => (string) $invoice->auto_bill,
|
||||||
'auto_bill_enabled' => (bool) $invoice->auto_bill_enabled,
|
'auto_bill_enabled' => (bool) $invoice->auto_bill_enabled,
|
||||||
'due_date_days' => (string) $invoice->due_date_days ?: '',
|
'due_date_days' => (string) $invoice->due_date_days ?: '',
|
||||||
'paid_to_date' => (float) $invoice->paid_to_date,
|
'paid_to_date' => (float) $invoice->paid_to_date,
|
||||||
'subscription_id' => (string)$this->encodePrimaryKey($invoice->subscription_id),
|
'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…
x
Reference in New Issue
Block a user