mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on bulk list changes
This commit is contained in:
parent
12fd825de5
commit
ae28c3c5c3
@ -115,13 +115,13 @@ class ClientController extends BaseController
|
|||||||
'client' => $client,
|
'client' => $client,
|
||||||
'credit' => $client->getTotalCredit(),
|
'credit' => $client->getTotalCredit(),
|
||||||
'title' => trans('texts.view_client'),
|
'title' => trans('texts.view_client'),
|
||||||
'hasRecurringInvoices' => Invoice::scope()->where('is_recurring', '=', true)->whereClientId($client->id)->count() > 0,
|
'hasRecurringInvoices' => Invoice::scope()->recurring()->withArchived()->whereClientId($client->id)->count() > 0,
|
||||||
'hasQuotes' => Invoice::scope()->invoiceType(INVOICE_TYPE_QUOTE)->whereClientId($client->id)->count() > 0,
|
'hasQuotes' => Invoice::scope()->quotes()->withArchived()->whereClientId($client->id)->count() > 0,
|
||||||
'hasTasks' => Task::scope()->whereClientId($client->id)->count() > 0,
|
'hasTasks' => Task::scope()->withArchived()->whereClientId($client->id)->count() > 0,
|
||||||
'gatewayLink' => $token ? $token->gatewayLink() : false,
|
'gatewayLink' => $token ? $token->gatewayLink() : false,
|
||||||
'gatewayName' => $token ? $token->gatewayName() : false,
|
'gatewayName' => $token ? $token->gatewayName() : false,
|
||||||
];
|
];
|
||||||
|
|
||||||
return View::make('clients.show', $data);
|
return View::make('clients.show', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,6 +101,6 @@ class CreditController extends BaseController
|
|||||||
Session::flash('message', $message);
|
Session::flash('message', $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Redirect::to('credits');
|
return $this->returnBulk(ENTITY_CREDIT, $action, $ids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,6 +192,6 @@ class PaymentController extends BaseController
|
|||||||
Session::flash('message', $message);
|
Session::flash('message', $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->to('payments');
|
return $this->returnBulk(ENTITY_PAYMENT, $action, $ids);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -353,6 +353,16 @@ class Invoice extends EntityModel implements BalanceAffecting
|
|||||||
->where('is_recurring', '=', false);
|
->where('is_recurring', '=', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $query
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function scopeRecurring($query)
|
||||||
|
{
|
||||||
|
return $query->where('invoice_type_id', '=', INVOICE_TYPE_STANDARD)
|
||||||
|
->where('is_recurring', '=', true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $query
|
* @param $query
|
||||||
* @return mixed
|
* @return mixed
|
||||||
|
@ -19,9 +19,9 @@ class ClientDatatable extends EntityDatatable
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'first_name',
|
'contact',
|
||||||
function ($model) {
|
function ($model) {
|
||||||
return link_to("clients/{$model->public_id}", $model->first_name.' '.$model->last_name)->toHtml();
|
return link_to("clients/{$model->public_id}", $model->contact ?: '')->toHtml();
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -35,6 +35,7 @@ class ClientRepository extends BaseRepository
|
|||||||
->select(
|
->select(
|
||||||
DB::raw('COALESCE(clients.currency_id, accounts.currency_id) currency_id'),
|
DB::raw('COALESCE(clients.currency_id, accounts.currency_id) currency_id'),
|
||||||
DB::raw('COALESCE(clients.country_id, accounts.country_id) country_id'),
|
DB::raw('COALESCE(clients.country_id, accounts.country_id) country_id'),
|
||||||
|
DB::raw("CONCAT(contacts.first_name, ' ', contacts.last_name) contact"),
|
||||||
'clients.public_id',
|
'clients.public_id',
|
||||||
'clients.name',
|
'clients.name',
|
||||||
'contacts.first_name',
|
'contacts.first_name',
|
||||||
|
@ -107,10 +107,9 @@ class InvoiceRepository extends BaseRepository
|
|||||||
$query->where(function ($query) use ($filter) {
|
$query->where(function ($query) use ($filter) {
|
||||||
$query->where('clients.name', 'like', '%'.$filter.'%')
|
$query->where('clients.name', 'like', '%'.$filter.'%')
|
||||||
->orWhere('invoices.invoice_number', 'like', '%'.$filter.'%')
|
->orWhere('invoices.invoice_number', 'like', '%'.$filter.'%')
|
||||||
->orWhere('invoice_statuses.name', 'like', '%'.$filter.'%')
|
->orWhere('contacts.first_name', 'like', '%'.$filter.'%')
|
||||||
->orWhere('contacts.first_name', 'like', '%'.$filter.'%')
|
->orWhere('contacts.last_name', 'like', '%'.$filter.'%')
|
||||||
->orWhere('contacts.last_name', 'like', '%'.$filter.'%')
|
->orWhere('contacts.email', 'like', '%'.$filter.'%');
|
||||||
->orWhere('contacts.email', 'like', '%'.$filter.'%');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2226,7 +2226,7 @@ $LANG = array(
|
|||||||
'vendor_name' => 'Vendor',
|
'vendor_name' => 'Vendor',
|
||||||
'entity_state' => 'State',
|
'entity_state' => 'State',
|
||||||
'payment_status_name' => 'Status',
|
'payment_status_name' => 'Status',
|
||||||
'client_created_at' => 'Created At',
|
'client_created_at' => 'Date Created',
|
||||||
);
|
);
|
||||||
|
|
||||||
return $LANG;
|
return $LANG;
|
||||||
|
@ -193,7 +193,7 @@
|
|||||||
|
|
||||||
<ul class="nav nav-tabs nav-justified">
|
<ul class="nav nav-tabs nav-justified">
|
||||||
{!! Form::tab_link('#activity', trans('texts.activity'), true) !!}
|
{!! Form::tab_link('#activity', trans('texts.activity'), true) !!}
|
||||||
@if ($hasTasks)
|
@if ($hasTasks && Utils::isPro())
|
||||||
{!! Form::tab_link('#tasks', trans('texts.tasks')) !!}
|
{!! Form::tab_link('#tasks', trans('texts.tasks')) !!}
|
||||||
@endif
|
@endif
|
||||||
@if ($hasQuotes && Utils::isPro())
|
@if ($hasQuotes && Utils::isPro())
|
||||||
|
@ -141,8 +141,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleRefundClicked(){
|
function handleRefundClicked(){
|
||||||
$('#public_id').val(paymentId);
|
submitForm_{{ $entityType }}('refund', paymentId);
|
||||||
submitForm_{{ $entityType }}('refund');
|
|
||||||
}
|
}
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@ -219,6 +218,20 @@
|
|||||||
// Setup state/status filter
|
// Setup state/status filter
|
||||||
$('#statuses_{{ $entityType }}').select2({
|
$('#statuses_{{ $entityType }}').select2({
|
||||||
placeholder: "{{ trans('texts.status') }}",
|
placeholder: "{{ trans('texts.status') }}",
|
||||||
|
templateSelection: function(data, container) {
|
||||||
|
console.log(data);
|
||||||
|
console.log(container);
|
||||||
|
if (data.id == 'archived') {
|
||||||
|
$(container).css('color', '#fff');
|
||||||
|
$(container).css('background-color', '#f0ad4e');
|
||||||
|
$(container).css('border-color', '#eea236');
|
||||||
|
} else if (data.id == 'deleted') {
|
||||||
|
$(container).css('color', '#fff');
|
||||||
|
$(container).css('background-color', '#d9534f');
|
||||||
|
$(container).css('border-color', '#d43f3a');
|
||||||
|
}
|
||||||
|
return data.text;
|
||||||
|
}
|
||||||
}).val('{{ session('entity_state_filter:' . $entityType, STATUS_ACTIVE) . ',' . session('entity_status_filter:' . $entityType) }}'.split(','))
|
}).val('{{ session('entity_state_filter:' . $entityType, STATUS_ACTIVE) . ',' . session('entity_status_filter:' . $entityType) }}'.split(','))
|
||||||
.trigger('change')
|
.trigger('change')
|
||||||
.on('change', function() {
|
.on('change', function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user