mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-17 16:42:48 +01:00
Improved options when exporting data
This commit is contained in:
parent
81898338e0
commit
979690d116
@ -10,8 +10,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
### Changed
|
||||
- Removed `invoiceninja.komodoproject` from Git #932
|
||||
- `APP_CIPHER` changed from `rinjdael-128` to `AES-256-CBC` #898
|
||||
- `APP_CIPHER` changed from `rinjdael-128` to `AES-256-CBC` #898
|
||||
- Improved options when exporting data
|
||||
|
||||
### Fixed
|
||||
- "Manual entry" untranslatable #562
|
||||
- Using a database table prefix breaks the dashboard #203
|
||||
- Using a database table prefix breaks the dashboard #203
|
||||
|
@ -150,44 +150,52 @@ class ExportController extends BaseController
|
||||
'multiUser' => $account->users->count() > 1
|
||||
];
|
||||
|
||||
if ($request->input(ENTITY_CLIENT)) {
|
||||
if ($request->input('include') === 'all' || $request->input('clients')) {
|
||||
$data['clients'] = Client::scope()
|
||||
->with('user', 'contacts', 'country')
|
||||
->withArchived()
|
||||
->get();
|
||||
}
|
||||
|
||||
if ($request->input('include') === 'all' || $request->input('contacts')) {
|
||||
$data['contacts'] = Contact::scope()
|
||||
->with('user', 'client.contacts')
|
||||
->withTrashed()
|
||||
->get();
|
||||
}
|
||||
|
||||
if ($request->input('include') === 'all' || $request->input('credits')) {
|
||||
$data['credits'] = Credit::scope()
|
||||
->with('user', 'client.contacts')
|
||||
->get();
|
||||
}
|
||||
|
||||
if ($request->input(ENTITY_TASK)) {
|
||||
if ($request->input('include') === 'all' || $request->input('tasks')) {
|
||||
$data['tasks'] = Task::scope()
|
||||
->with('user', 'client.contacts')
|
||||
->withArchived()
|
||||
->get();
|
||||
}
|
||||
|
||||
if ($request->input(ENTITY_INVOICE)) {
|
||||
if ($request->input('include') === 'all' || $request->input('invoices')) {
|
||||
$data['invoices'] = Invoice::scope()
|
||||
->invoiceType(INVOICE_TYPE_STANDARD)
|
||||
->with('user', 'client.contacts', 'invoice_status')
|
||||
->withArchived()
|
||||
->where('is_recurring', '=', false)
|
||||
->get();
|
||||
}
|
||||
|
||||
if ($request->input('include') === 'all' || $request->input('quotes')) {
|
||||
$data['quotes'] = Invoice::scope()
|
||||
->invoiceType(INVOICE_TYPE_QUOTE)
|
||||
->with('user', 'client.contacts', 'invoice_status')
|
||||
->withArchived()
|
||||
->where('is_recurring', '=', false)
|
||||
->get();
|
||||
}
|
||||
|
||||
if ($request->input('include') === 'all' || $request->input('recurring')) {
|
||||
$data['recurringInvoices'] = Invoice::scope()
|
||||
->invoiceType(INVOICE_TYPE_STANDARD)
|
||||
->with('user', 'client.contacts', 'invoice_status', 'frequency')
|
||||
@ -196,20 +204,21 @@ class ExportController extends BaseController
|
||||
->get();
|
||||
}
|
||||
|
||||
if ($request->input(ENTITY_PAYMENT)) {
|
||||
if ($request->input('include') === 'all' || $request->input('payments')) {
|
||||
$data['payments'] = Payment::scope()
|
||||
->withArchived()
|
||||
->with('user', 'client.contacts', 'payment_type', 'invoice', 'account_gateway.gateway')
|
||||
->get();
|
||||
}
|
||||
|
||||
|
||||
if ($request->input(ENTITY_VENDOR)) {
|
||||
$data['clients'] = Vendor::scope()
|
||||
if ($request->input('include') === 'all' || $request->input('vendors')) {
|
||||
$data['vendors'] = Vendor::scope()
|
||||
->with('user', 'vendor_contacts', 'country')
|
||||
->withArchived()
|
||||
->get();
|
||||
}
|
||||
|
||||
if ($request->input('include') === 'all' || $request->input('vendor_contacts')) {
|
||||
$data['vendor_contacts'] = VendorContact::scope()
|
||||
->with('user', 'vendor.vendor_contacts')
|
||||
->withTrashed()
|
||||
|
@ -119,6 +119,7 @@ return [
|
||||
*/
|
||||
'Illuminate\Auth\AuthServiceProvider',
|
||||
'Collective\Html\HtmlServiceProvider',
|
||||
'Collective\Bus\BusServiceProvider',
|
||||
'Illuminate\Cache\CacheServiceProvider',
|
||||
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
|
||||
'Illuminate\Cookie\CookieServiceProvider',
|
||||
|
@ -2006,6 +2006,10 @@ $LANG = array(
|
||||
|
||||
'view_client_portal' => 'View client portal',
|
||||
'view_portal' => 'View Portal',
|
||||
'vendor_contacts' => 'Vendor Contacts',
|
||||
'all' => 'All',
|
||||
'selected' => 'Selected',
|
||||
|
||||
);
|
||||
|
||||
return $LANG;
|
||||
|
@ -56,15 +56,33 @@
|
||||
->style('max-width: 200px')
|
||||
->inlineHelp('export_help') !!}
|
||||
|
||||
{!! Former::checkbox('entity_types')
|
||||
->label('include')
|
||||
->addGroupClass('entity-types')
|
||||
->checkboxes([
|
||||
trans('texts.clients') => array('name' => ENTITY_CLIENT, 'value' => 1),
|
||||
trans('texts.tasks') => array('name' => ENTITY_TASK, 'value' => 1),
|
||||
trans('texts.invoices') => array('name' => ENTITY_INVOICE, 'value' => 1),
|
||||
trans('texts.payments') => array('name' => ENTITY_PAYMENT, 'value' => 1),
|
||||
])->check(ENTITY_CLIENT)->check(ENTITY_TASK)->check(ENTITY_INVOICE)->check(ENTITY_PAYMENT) !!}
|
||||
|
||||
{!! Former::inline_radios('include_radio')
|
||||
->onchange('onIncludeChange()')
|
||||
->label(trans('texts.include'))
|
||||
->radios([
|
||||
trans('texts.all') => ['value' => 'all', 'name' => 'include'],
|
||||
trans('texts.selected') => ['value' => 'selected', 'name' => 'include'],
|
||||
])->check('all') !!}
|
||||
|
||||
|
||||
<div class="form-group entity-types">
|
||||
<label class="control-label col-lg-4 col-sm-4"></label>
|
||||
<div class="col-lg-3 col-sm-2">
|
||||
@include('partials/checkbox', ['field' => 'clients'])
|
||||
@include('partials/checkbox', ['field' => 'contacts'])
|
||||
@include('partials/checkbox', ['field' => 'credits'])
|
||||
@include('partials/checkbox', ['field' => 'tasks'])
|
||||
@include('partials/checkbox', ['field' => 'invoices'])
|
||||
</div>
|
||||
<div class="col-lg-3 col-sm-3">
|
||||
@include('partials/checkbox', ['field' => 'quotes'])
|
||||
@include('partials/checkbox', ['field' => 'recurring'])
|
||||
@include('partials/checkbox', ['field' => 'payments'])
|
||||
@include('partials/checkbox', ['field' => 'vendors'])
|
||||
@include('partials/checkbox', ['field' => 'vendor_contacts'])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!! Former::actions( Button::primary(trans('texts.download'))->submit()->large()->appendIcon(Icon::create('download-alt'))) !!}
|
||||
</div>
|
||||
@ -75,6 +93,7 @@
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
setFileTypesVisible();
|
||||
onIncludeChange();
|
||||
});
|
||||
|
||||
function setEntityTypesVisible() {
|
||||
@ -109,6 +128,16 @@
|
||||
@endforeach
|
||||
}
|
||||
|
||||
function onIncludeChange() {
|
||||
var $checkboxes = $('input[type=checkbox]');
|
||||
var val = $('input[name=include]:checked').val()
|
||||
if (val == 'all') {
|
||||
$checkboxes.attr('disabled', true);
|
||||
} else {
|
||||
$checkboxes.removeAttr('disabled');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@stop
|
||||
|
27
resources/views/export/vendor_contacts.blade.php
Normal file
27
resources/views/export/vendor_contacts.blade.php
Normal file
@ -0,0 +1,27 @@
|
||||
<tr>
|
||||
<td>{{ trans('texts.client') }}</td>
|
||||
@if ($multiUser)
|
||||
<td>{{ trans('texts.user') }}</td>
|
||||
@endif
|
||||
<td>{{ trans('texts.first_name') }}</td>
|
||||
<td>{{ trans('texts.last_name') }}</td>
|
||||
<td>{{ trans('texts.email') }}</td>
|
||||
<td>{{ trans('texts.phone') }}</td>
|
||||
</tr>
|
||||
|
||||
@foreach ($contacts as $contact)
|
||||
@if (!$contact->client->is_deleted)
|
||||
<tr>
|
||||
<td>{{ $contact->client->getDisplayName() }}</td>
|
||||
@if ($multiUser)
|
||||
<td>{{ $contact->user->getDisplayName() }}</td>
|
||||
@endif
|
||||
<td>{{ $contact->first_name }}</td>
|
||||
<td>{{ $contact->last_name }}</td>
|
||||
<td>{{ $contact->email }}</td>
|
||||
<td>{{ $contact->phone }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
<tr><td></td></tr>
|
45
resources/views/export/vendors.blade.php
Normal file
45
resources/views/export/vendors.blade.php
Normal file
@ -0,0 +1,45 @@
|
||||
<tr>
|
||||
<td>{{ trans('texts.name') }}</td>
|
||||
@if ($multiUser)
|
||||
<td>{{ trans('texts.user') }}</td>
|
||||
@endif
|
||||
<td>{{ trans('texts.balance') }}</td>
|
||||
<td>{{ trans('texts.paid_to_date') }}</td>
|
||||
<td>{{ trans('texts.address1') }}</td>
|
||||
<td>{{ trans('texts.address2') }}</td>
|
||||
<td>{{ trans('texts.city') }}</td>
|
||||
<td>{{ trans('texts.state') }}</td>
|
||||
<td>{{ trans('texts.postal_code') }}</td>
|
||||
<td>{{ trans('texts.country') }}</td>
|
||||
@if ($account->custom_client_label1)
|
||||
<td>{{ $account->custom_client_label1 }}</td>
|
||||
@endif
|
||||
@if ($account->custom_client_label2)
|
||||
<td>{{ $account->custom_client_label2 }}</td>
|
||||
@endif
|
||||
</tr>
|
||||
|
||||
@foreach ($clients as $client)
|
||||
<tr>
|
||||
<td>{{ $client->getDisplayName() }}</td>
|
||||
@if ($multiUser)
|
||||
<td>{{ $client->user->getDisplayName() }}</td>
|
||||
@endif
|
||||
<td>{{ $account->formatMoney($client->balance, $client) }}</td>
|
||||
<td>{{ $account->formatMoney($client->paid_to_date, $client) }}</td>
|
||||
<td>{{ $client->address1 }}</td>
|
||||
<td>{{ $client->address2 }}</td>
|
||||
<td>{{ $client->city }}</td>
|
||||
<td>{{ $client->state }}</td>
|
||||
<td>{{ $client->postal_code }}</td>
|
||||
<td>{{ $client->present()->country }}</td>
|
||||
@if ($account->custom_client_label1)
|
||||
<td>{{ $client->custom_value1 }}</td>
|
||||
@endif
|
||||
@if ($account->custom_client_label2)
|
||||
<td>{{ $client->custom_value2 }}</td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
<tr><td></td></tr>
|
5
resources/views/partials/checkbox.blade.php
Normal file
5
resources/views/partials/checkbox.blade.php
Normal file
@ -0,0 +1,5 @@
|
||||
<div class="checkbox">
|
||||
<label for="{{ $field }}" class="">
|
||||
<input value="1" id="{{ $field }}" type="checkbox" name="{{ $field }}">{{ trans("texts.{$field}") }}
|
||||
</label>
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user