1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Add user column in reports

This commit is contained in:
Hillel Coren 2018-01-26 14:11:23 +02:00
parent bb5e1d1018
commit 1a93c08a60
7 changed files with 21 additions and 7 deletions

View File

@ -16,6 +16,7 @@ class ClientReport extends AbstractReport
'balance' => [],
'public_notes' => ['columnSelector-false'],
'private_notes' => ['columnSelector-false'],
'user' => ['columnSelector-false'],
];
$user = auth()->user();
@ -38,7 +39,7 @@ class ClientReport extends AbstractReport
$clients = Client::scope()
->orderBy('name')
->withArchived()
->with('contacts')
->with(['contacts', 'user'])
->with(['invoices' => function ($query) {
$query->where('invoice_date', '>=', $this->startDate)
->where('invoice_date', '<=', $this->endDate)
@ -63,6 +64,7 @@ class ClientReport extends AbstractReport
$account->formatMoney($amount - $paid, $client),
$client->public_notes,
$client->private_notes,
$client->user->getDisplayName(),
];
if ($account->custom_client_label1) {

View File

@ -13,6 +13,7 @@ class CreditReport extends AbstractReport
'client' => [],
'amount' => [],
'balance' => [],
'user' => ['columnSelector-false'],
];
return $columns;
@ -25,7 +26,7 @@ class CreditReport extends AbstractReport
$clients = Client::scope()
->orderBy('name')
->withArchived()
->with(['credits' => function ($query) {
->with(['user', 'credits' => function ($query) {
$query->where('credit_date', '>=', $this->startDate)
->where('credit_date', '<=', $this->endDate)
->withArchived();
@ -48,6 +49,7 @@ class CreditReport extends AbstractReport
$this->isExport ? $client->getDisplayName() : $client->present()->link,
$account->formatMoney($amount, $client),
$account->formatMoney($balance, $client),
$client->user->getDisplayName(),
];
$this->data[] = $row;

View File

@ -20,6 +20,7 @@ class ExpenseReport extends AbstractReport
'amount' => [],
'public_notes' => ['columnSelector-false'],
'private_notes' => ['columnSelector-false'],
'user' => ['columnSelector-false'],
];
if (TaxRate::scope()->count()) {
@ -43,7 +44,7 @@ class ExpenseReport extends AbstractReport
$expenses = Expense::scope()
->orderBy('expense_date', 'desc')
->withArchived()
->with('client.contacts', 'vendor', 'expense_category')
->with('client.contacts', 'vendor', 'expense_category', 'user')
->where('expense_date', '>=', $this->startDate)
->where('expense_date', '<=', $this->endDate);
@ -72,6 +73,7 @@ class ExpenseReport extends AbstractReport
Utils::formatMoney($amount, $expense->currency_id),
$expense->public_notes,
$expense->private_notes,
$expense->user->getDisplayName(),
];
if ($hasTaxRates) {

View File

@ -21,6 +21,7 @@ class InvoiceReport extends AbstractReport
'paid' => [],
'method' => [],
'private_notes' => ['columnSelector-false'],
'user' => ['columnSelector-false'],
];
if (TaxRate::scope()->count()) {
@ -49,7 +50,7 @@ class InvoiceReport extends AbstractReport
$clients = Client::scope()
->orderBy('name')
->withArchived()
->with('contacts')
->with('contacts', 'user')
->with(['invoices' => function ($query) use ($statusIds) {
$query->invoices()
->withArchived()
@ -93,6 +94,7 @@ class InvoiceReport extends AbstractReport
$payment ? $account->formatMoney($payment->getCompletedAmount(), $client) : '',
$payment ? $payment->present()->method : '',
$invoice->private_notes,
$invoice->user->getDisplayName(),
];
if ($hasTaxRates) {

View File

@ -19,6 +19,7 @@ class PaymentReport extends AbstractReport
'paid' => [],
'method' => [],
'private_notes' => ['columnSelector-false'],
'user' => ['columnSelector-false'],
];
}
@ -38,7 +39,7 @@ class PaymentReport extends AbstractReport
->whereHas('invoice', function ($query) {
$query->where('is_deleted', '=', false);
})
->with('client.contacts', 'invoice', 'payment_type', 'account_gateway.gateway')
->with('client.contacts', 'invoice', 'payment_type', 'account_gateway.gateway', 'user')
->where('payment_date', '>=', $this->startDate)
->where('payment_date', '<=', $this->endDate);
@ -66,6 +67,7 @@ class PaymentReport extends AbstractReport
$amount,
$payment->present()->method,
$payment->private_notes,
$payment->user->getDisplayName(),
];
if (! isset($invoiceMap[$invoice->id])) {

View File

@ -18,6 +18,7 @@ class QuoteReport extends AbstractReport
'amount' => [],
'status' => [],
'private_notes' => ['columnSelector-false'],
'user' => ['columnSelector-false'],
];
if (TaxRate::scope()->count()) {
@ -46,7 +47,7 @@ class QuoteReport extends AbstractReport
$clients = Client::scope()
->orderBy('name')
->withArchived()
->with('contacts')
->with('contacts', 'user')
->with(['invoices' => function ($query) use ($statusIds) {
$query->quotes()
->withArchived()
@ -80,6 +81,7 @@ class QuoteReport extends AbstractReport
$account->formatMoney($invoice->amount, $client),
$invoice->present()->status(),
$invoice->private_notes,
$invoice->user->getDisplayName(),
];
if ($hasTaxRates) {

View File

@ -16,6 +16,7 @@ class TaskReport extends AbstractReport
'description' => [],
'duration' => [],
'amount' => [],
'user' => ['columnSelector-false'],
];
}
@ -26,7 +27,7 @@ class TaskReport extends AbstractReport
$tasks = Task::scope()
->orderBy('created_at', 'desc')
->with('client.contacts', 'project', 'account')
->with('client.contacts', 'project', 'account', 'user')
->withArchived()
->dateRange($startDate, $endDate);
@ -45,6 +46,7 @@ class TaskReport extends AbstractReport
$task->description,
Utils::formatTime($task->getDuration()),
Utils::formatMoney($amount, $currencyId),
$task->user->getDisplayName(),
];
$this->addToTotals($currencyId, 'duration', $task->getDuration());