mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 14:04:40 -04: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()
|
$activities = Activity::scope()
|
||||||
->with('client.contacts', 'user', 'invoice', 'payment', 'credit', 'task', 'expense', 'account')
|
->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) {
|
foreach ($activities->get() as $activity) {
|
||||||
$client = $activity->client;
|
$client = $activity->client;
|
||||||
|
@ -22,6 +22,7 @@ class AgingReport extends AbstractReport
|
|||||||
$account = Auth::user()->account;
|
$account = Auth::user()->account;
|
||||||
|
|
||||||
$clients = Client::scope()
|
$clients = Client::scope()
|
||||||
|
->orderBy('name')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->with('contacts')
|
->with('contacts')
|
||||||
->with(['invoices' => function ($query) {
|
->with(['invoices' => function ($query) {
|
||||||
|
@ -19,6 +19,7 @@ class ClientReport extends AbstractReport
|
|||||||
$account = Auth::user()->account;
|
$account = Auth::user()->account;
|
||||||
|
|
||||||
$clients = Client::scope()
|
$clients = Client::scope()
|
||||||
|
->orderBy('name')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->with('contacts')
|
->with('contacts')
|
||||||
->with(['invoices' => function ($query) {
|
->with(['invoices' => function ($query) {
|
||||||
|
@ -21,6 +21,7 @@ class ExpenseReport extends AbstractReport
|
|||||||
$account = Auth::user()->account;
|
$account = Auth::user()->account;
|
||||||
|
|
||||||
$expenses = Expense::scope()
|
$expenses = Expense::scope()
|
||||||
|
->orderBy('expense_date', 'desc')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->with('client.contacts', 'vendor')
|
->with('client.contacts', 'vendor')
|
||||||
->where('expense_date', '>=', $this->startDate)
|
->where('expense_date', '>=', $this->startDate)
|
||||||
|
@ -24,6 +24,7 @@ class InvoiceReport extends AbstractReport
|
|||||||
$status = $this->options['invoice_status'];
|
$status = $this->options['invoice_status'];
|
||||||
|
|
||||||
$clients = Client::scope()
|
$clients = Client::scope()
|
||||||
|
->orderBy('name')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->with('contacts')
|
->with('contacts')
|
||||||
->with(['invoices' => function ($query) use ($status) {
|
->with(['invoices' => function ($query) use ($status) {
|
||||||
|
@ -22,6 +22,7 @@ class PaymentReport extends AbstractReport
|
|||||||
$account = Auth::user()->account;
|
$account = Auth::user()->account;
|
||||||
|
|
||||||
$payments = Payment::scope()
|
$payments = Payment::scope()
|
||||||
|
->orderBy('payment_date', 'desc')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->excludeFailed()
|
->excludeFailed()
|
||||||
->whereHas('client', function ($query) {
|
->whereHas('client', function ($query) {
|
||||||
|
@ -24,6 +24,7 @@ class ProductReport extends AbstractReport
|
|||||||
$status = $this->options['invoice_status'];
|
$status = $this->options['invoice_status'];
|
||||||
|
|
||||||
$clients = Client::scope()
|
$clients = Client::scope()
|
||||||
|
->orderBy('name')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->with('contacts')
|
->with('contacts')
|
||||||
->with(['invoices' => function ($query) use ($status) {
|
->with(['invoices' => function ($query) use ($status) {
|
||||||
|
@ -21,6 +21,7 @@ class ProfitAndLossReport extends AbstractReport
|
|||||||
$account = Auth::user()->account;
|
$account = Auth::user()->account;
|
||||||
|
|
||||||
$payments = Payment::scope()
|
$payments = Payment::scope()
|
||||||
|
->orderBy('payment_date', 'desc')
|
||||||
->with('client.contacts')
|
->with('client.contacts')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->excludeFailed()
|
->excludeFailed()
|
||||||
@ -43,6 +44,7 @@ class ProfitAndLossReport extends AbstractReport
|
|||||||
}
|
}
|
||||||
|
|
||||||
$expenses = Expense::scope()
|
$expenses = Expense::scope()
|
||||||
|
->orderBy('expense_date', 'desc')
|
||||||
->with('client.contacts')
|
->with('client.contacts')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->where('expense_date', '>=', $this->startDate)
|
->where('expense_date', '>=', $this->startDate)
|
||||||
|
@ -21,6 +21,7 @@ class QuoteReport extends AbstractReport
|
|||||||
$status = $this->options['invoice_status'];
|
$status = $this->options['invoice_status'];
|
||||||
|
|
||||||
$clients = Client::scope()
|
$clients = Client::scope()
|
||||||
|
->orderBy('name')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->with('contacts')
|
->with('contacts')
|
||||||
->with(['invoices' => function ($query) use ($status) {
|
->with(['invoices' => function ($query) use ($status) {
|
||||||
@ -43,9 +44,9 @@ class QuoteReport extends AbstractReport
|
|||||||
$account->formatMoney($invoice->amount, $client),
|
$account->formatMoney($invoice->amount, $client),
|
||||||
$invoice->present()->status(),
|
$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()
|
public function run()
|
||||||
{
|
{
|
||||||
$tasks = Task::scope()
|
$tasks = Task::scope()
|
||||||
|
->orderBy('created_at', 'desc')
|
||||||
->with('client.contacts')
|
->with('client.contacts')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->dateRange($this->startDate, $this->endDate);
|
->dateRange($this->startDate, $this->endDate);
|
||||||
|
@ -20,6 +20,7 @@ class TaxRateReport extends AbstractReport
|
|||||||
$account = Auth::user()->account;
|
$account = Auth::user()->account;
|
||||||
|
|
||||||
$clients = Client::scope()
|
$clients = Client::scope()
|
||||||
|
->orderBy('name')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->with('contacts')
|
->with('contacts')
|
||||||
->with(['invoices' => function ($query) {
|
->with(['invoices' => function ($query) {
|
||||||
|
@ -290,6 +290,9 @@
|
|||||||
|
|
||||||
$(function(){
|
$(function(){
|
||||||
$(".tablesorter-data").tablesorter({
|
$(".tablesorter-data").tablesorter({
|
||||||
|
@if (! request()->group_when_sorted)
|
||||||
|
sortList: [[0,0]],
|
||||||
|
@endif
|
||||||
theme: 'bootstrap',
|
theme: 'bootstrap',
|
||||||
widgets: ['zebra', 'uitheme', 'filter'{!! request()->group_when_sorted ? ", 'group'" : "" !!}, 'columnSelector'],
|
widgets: ['zebra', 'uitheme', 'filter'{!! request()->group_when_sorted ? ", 'group'" : "" !!}, 'columnSelector'],
|
||||||
headerTemplate : '{content} {icon}',
|
headerTemplate : '{content} {icon}',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user