mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Include archived records in JSON export
This commit is contained in:
parent
dafb867dc3
commit
d3372680cf
@ -42,8 +42,17 @@ class ExportController extends BaseController
|
||||
$manager = new Manager();
|
||||
$manager->setSerializer(new ArraySerializer());
|
||||
|
||||
// eager load data, include archived but exclude deleted
|
||||
$account = Auth::user()->account;
|
||||
$account->load(['clients.contacts', 'clients.invoices.payments', 'clients.invoices.invoice_items']);
|
||||
$account->load(['clients' => function($query) {
|
||||
$query->withArchived()
|
||||
->with(['contacts', 'invoices' => function($query) {
|
||||
$query->withArchived()
|
||||
->with(['invoice_items', 'payments' => function($query) {
|
||||
$query->withArchived();
|
||||
}]);
|
||||
}]);
|
||||
}]);
|
||||
|
||||
$resource = new Item($account, new AccountTransformer);
|
||||
$data = $manager->parseIncludes('clients.invoices.payments')
|
||||
|
Loading…
Reference in New Issue
Block a user