1
0
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:
Hillel Coren 2017-03-31 09:01:07 +03:00
parent f3cf79ffee
commit 3f44620a1d
12 changed files with 18 additions and 3 deletions

View File

@ -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;

View File

@ -22,6 +22,7 @@ class AgingReport extends AbstractReport
$account = Auth::user()->account;
$clients = Client::scope()
->orderBy('name')
->withArchived()
->with('contacts')
->with(['invoices' => function ($query) {

View File

@ -19,6 +19,7 @@ class ClientReport extends AbstractReport
$account = Auth::user()->account;
$clients = Client::scope()
->orderBy('name')
->withArchived()
->with('contacts')
->with(['invoices' => function ($query) {

View File

@ -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)

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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)

View File

@ -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);
}
}
}
}

View File

@ -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);

View File

@ -20,6 +20,7 @@ class TaxRateReport extends AbstractReport
$account = Auth::user()->account;
$clients = Client::scope()
->orderBy('name')
->withArchived()
->with('contacts')
->with(['invoices' => function ($query) {

View File

@ -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}',