mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Set default report sorting
This commit is contained in:
parent
f3cf79ffee
commit
3f44620a1d
@ -23,7 +23,8 @@ class ActivityReport extends AbstractReport
|
||||
|
||||
$activities = Activity::scope()
|
||||
->with('client.contacts', 'user', 'invoice', 'payment', 'credit', 'task', 'expense', 'account')
|
||||
->whereRaw("DATE(created_at) >= \"{$startDate}\" and DATE(created_at) <= \"$endDate\"");
|
||||
->whereRaw("DATE(created_at) >= \"{$startDate}\" and DATE(created_at) <= \"$endDate\"")
|
||||
->orderBy('id', 'desc');
|
||||
|
||||
foreach ($activities->get() as $activity) {
|
||||
$client = $activity->client;
|
||||
|
@ -22,6 +22,7 @@ class AgingReport extends AbstractReport
|
||||
$account = Auth::user()->account;
|
||||
|
||||
$clients = Client::scope()
|
||||
->orderBy('name')
|
||||
->withArchived()
|
||||
->with('contacts')
|
||||
->with(['invoices' => function ($query) {
|
||||
|
@ -19,6 +19,7 @@ class ClientReport extends AbstractReport
|
||||
$account = Auth::user()->account;
|
||||
|
||||
$clients = Client::scope()
|
||||
->orderBy('name')
|
||||
->withArchived()
|
||||
->with('contacts')
|
||||
->with(['invoices' => function ($query) {
|
||||
|
@ -21,6 +21,7 @@ class ExpenseReport extends AbstractReport
|
||||
$account = Auth::user()->account;
|
||||
|
||||
$expenses = Expense::scope()
|
||||
->orderBy('expense_date', 'desc')
|
||||
->withArchived()
|
||||
->with('client.contacts', 'vendor')
|
||||
->where('expense_date', '>=', $this->startDate)
|
||||
|
@ -24,6 +24,7 @@ class InvoiceReport extends AbstractReport
|
||||
$status = $this->options['invoice_status'];
|
||||
|
||||
$clients = Client::scope()
|
||||
->orderBy('name')
|
||||
->withArchived()
|
||||
->with('contacts')
|
||||
->with(['invoices' => function ($query) use ($status) {
|
||||
|
@ -22,6 +22,7 @@ class PaymentReport extends AbstractReport
|
||||
$account = Auth::user()->account;
|
||||
|
||||
$payments = Payment::scope()
|
||||
->orderBy('payment_date', 'desc')
|
||||
->withArchived()
|
||||
->excludeFailed()
|
||||
->whereHas('client', function ($query) {
|
||||
|
@ -24,6 +24,7 @@ class ProductReport extends AbstractReport
|
||||
$status = $this->options['invoice_status'];
|
||||
|
||||
$clients = Client::scope()
|
||||
->orderBy('name')
|
||||
->withArchived()
|
||||
->with('contacts')
|
||||
->with(['invoices' => function ($query) use ($status) {
|
||||
|
@ -21,6 +21,7 @@ class ProfitAndLossReport extends AbstractReport
|
||||
$account = Auth::user()->account;
|
||||
|
||||
$payments = Payment::scope()
|
||||
->orderBy('payment_date', 'desc')
|
||||
->with('client.contacts')
|
||||
->withArchived()
|
||||
->excludeFailed()
|
||||
@ -43,6 +44,7 @@ class ProfitAndLossReport extends AbstractReport
|
||||
}
|
||||
|
||||
$expenses = Expense::scope()
|
||||
->orderBy('expense_date', 'desc')
|
||||
->with('client.contacts')
|
||||
->withArchived()
|
||||
->where('expense_date', '>=', $this->startDate)
|
||||
|
@ -21,6 +21,7 @@ class QuoteReport extends AbstractReport
|
||||
$status = $this->options['invoice_status'];
|
||||
|
||||
$clients = Client::scope()
|
||||
->orderBy('name')
|
||||
->withArchived()
|
||||
->with('contacts')
|
||||
->with(['invoices' => function ($query) use ($status) {
|
||||
@ -43,9 +44,9 @@ class QuoteReport extends AbstractReport
|
||||
$account->formatMoney($invoice->amount, $client),
|
||||
$invoice->present()->status(),
|
||||
];
|
||||
}
|
||||
|
||||
$this->addToTotals($client->currency_id, 'amount', $invoice->amount);
|
||||
$this->addToTotals($client->currency_id, 'amount', $invoice->amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ class TaskReport extends AbstractReport
|
||||
public function run()
|
||||
{
|
||||
$tasks = Task::scope()
|
||||
->orderBy('created_at', 'desc')
|
||||
->with('client.contacts')
|
||||
->withArchived()
|
||||
->dateRange($this->startDate, $this->endDate);
|
||||
|
@ -20,6 +20,7 @@ class TaxRateReport extends AbstractReport
|
||||
$account = Auth::user()->account;
|
||||
|
||||
$clients = Client::scope()
|
||||
->orderBy('name')
|
||||
->withArchived()
|
||||
->with('contacts')
|
||||
->with(['invoices' => function ($query) {
|
||||
|
@ -290,6 +290,9 @@
|
||||
|
||||
$(function(){
|
||||
$(".tablesorter-data").tablesorter({
|
||||
@if (! request()->group_when_sorted)
|
||||
sortList: [[0,0]],
|
||||
@endif
|
||||
theme: 'bootstrap',
|
||||
widgets: ['zebra', 'uitheme', 'filter'{!! request()->group_when_sorted ? ", 'group'" : "" !!}, 'columnSelector'],
|
||||
headerTemplate : '{content} {icon}',
|
||||
|
Loading…
Reference in New Issue
Block a user