mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add user column in reports
This commit is contained in:
parent
bb5e1d1018
commit
1a93c08a60
@ -16,6 +16,7 @@ class ClientReport extends AbstractReport
|
|||||||
'balance' => [],
|
'balance' => [],
|
||||||
'public_notes' => ['columnSelector-false'],
|
'public_notes' => ['columnSelector-false'],
|
||||||
'private_notes' => ['columnSelector-false'],
|
'private_notes' => ['columnSelector-false'],
|
||||||
|
'user' => ['columnSelector-false'],
|
||||||
];
|
];
|
||||||
|
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
@ -38,7 +39,7 @@ class ClientReport extends AbstractReport
|
|||||||
$clients = Client::scope()
|
$clients = Client::scope()
|
||||||
->orderBy('name')
|
->orderBy('name')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->with('contacts')
|
->with(['contacts', 'user'])
|
||||||
->with(['invoices' => function ($query) {
|
->with(['invoices' => function ($query) {
|
||||||
$query->where('invoice_date', '>=', $this->startDate)
|
$query->where('invoice_date', '>=', $this->startDate)
|
||||||
->where('invoice_date', '<=', $this->endDate)
|
->where('invoice_date', '<=', $this->endDate)
|
||||||
@ -63,6 +64,7 @@ class ClientReport extends AbstractReport
|
|||||||
$account->formatMoney($amount - $paid, $client),
|
$account->formatMoney($amount - $paid, $client),
|
||||||
$client->public_notes,
|
$client->public_notes,
|
||||||
$client->private_notes,
|
$client->private_notes,
|
||||||
|
$client->user->getDisplayName(),
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($account->custom_client_label1) {
|
if ($account->custom_client_label1) {
|
||||||
|
@ -13,6 +13,7 @@ class CreditReport extends AbstractReport
|
|||||||
'client' => [],
|
'client' => [],
|
||||||
'amount' => [],
|
'amount' => [],
|
||||||
'balance' => [],
|
'balance' => [],
|
||||||
|
'user' => ['columnSelector-false'],
|
||||||
];
|
];
|
||||||
|
|
||||||
return $columns;
|
return $columns;
|
||||||
@ -25,7 +26,7 @@ class CreditReport extends AbstractReport
|
|||||||
$clients = Client::scope()
|
$clients = Client::scope()
|
||||||
->orderBy('name')
|
->orderBy('name')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->with(['credits' => function ($query) {
|
->with(['user', 'credits' => function ($query) {
|
||||||
$query->where('credit_date', '>=', $this->startDate)
|
$query->where('credit_date', '>=', $this->startDate)
|
||||||
->where('credit_date', '<=', $this->endDate)
|
->where('credit_date', '<=', $this->endDate)
|
||||||
->withArchived();
|
->withArchived();
|
||||||
@ -48,6 +49,7 @@ class CreditReport extends AbstractReport
|
|||||||
$this->isExport ? $client->getDisplayName() : $client->present()->link,
|
$this->isExport ? $client->getDisplayName() : $client->present()->link,
|
||||||
$account->formatMoney($amount, $client),
|
$account->formatMoney($amount, $client),
|
||||||
$account->formatMoney($balance, $client),
|
$account->formatMoney($balance, $client),
|
||||||
|
$client->user->getDisplayName(),
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->data[] = $row;
|
$this->data[] = $row;
|
||||||
|
@ -20,6 +20,7 @@ class ExpenseReport extends AbstractReport
|
|||||||
'amount' => [],
|
'amount' => [],
|
||||||
'public_notes' => ['columnSelector-false'],
|
'public_notes' => ['columnSelector-false'],
|
||||||
'private_notes' => ['columnSelector-false'],
|
'private_notes' => ['columnSelector-false'],
|
||||||
|
'user' => ['columnSelector-false'],
|
||||||
];
|
];
|
||||||
|
|
||||||
if (TaxRate::scope()->count()) {
|
if (TaxRate::scope()->count()) {
|
||||||
@ -43,7 +44,7 @@ class ExpenseReport extends AbstractReport
|
|||||||
$expenses = Expense::scope()
|
$expenses = Expense::scope()
|
||||||
->orderBy('expense_date', 'desc')
|
->orderBy('expense_date', 'desc')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->with('client.contacts', 'vendor', 'expense_category')
|
->with('client.contacts', 'vendor', 'expense_category', 'user')
|
||||||
->where('expense_date', '>=', $this->startDate)
|
->where('expense_date', '>=', $this->startDate)
|
||||||
->where('expense_date', '<=', $this->endDate);
|
->where('expense_date', '<=', $this->endDate);
|
||||||
|
|
||||||
@ -72,6 +73,7 @@ class ExpenseReport extends AbstractReport
|
|||||||
Utils::formatMoney($amount, $expense->currency_id),
|
Utils::formatMoney($amount, $expense->currency_id),
|
||||||
$expense->public_notes,
|
$expense->public_notes,
|
||||||
$expense->private_notes,
|
$expense->private_notes,
|
||||||
|
$expense->user->getDisplayName(),
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($hasTaxRates) {
|
if ($hasTaxRates) {
|
||||||
|
@ -21,6 +21,7 @@ class InvoiceReport extends AbstractReport
|
|||||||
'paid' => [],
|
'paid' => [],
|
||||||
'method' => [],
|
'method' => [],
|
||||||
'private_notes' => ['columnSelector-false'],
|
'private_notes' => ['columnSelector-false'],
|
||||||
|
'user' => ['columnSelector-false'],
|
||||||
];
|
];
|
||||||
|
|
||||||
if (TaxRate::scope()->count()) {
|
if (TaxRate::scope()->count()) {
|
||||||
@ -49,7 +50,7 @@ class InvoiceReport extends AbstractReport
|
|||||||
$clients = Client::scope()
|
$clients = Client::scope()
|
||||||
->orderBy('name')
|
->orderBy('name')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->with('contacts')
|
->with('contacts', 'user')
|
||||||
->with(['invoices' => function ($query) use ($statusIds) {
|
->with(['invoices' => function ($query) use ($statusIds) {
|
||||||
$query->invoices()
|
$query->invoices()
|
||||||
->withArchived()
|
->withArchived()
|
||||||
@ -93,6 +94,7 @@ class InvoiceReport extends AbstractReport
|
|||||||
$payment ? $account->formatMoney($payment->getCompletedAmount(), $client) : '',
|
$payment ? $account->formatMoney($payment->getCompletedAmount(), $client) : '',
|
||||||
$payment ? $payment->present()->method : '',
|
$payment ? $payment->present()->method : '',
|
||||||
$invoice->private_notes,
|
$invoice->private_notes,
|
||||||
|
$invoice->user->getDisplayName(),
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($hasTaxRates) {
|
if ($hasTaxRates) {
|
||||||
|
@ -19,6 +19,7 @@ class PaymentReport extends AbstractReport
|
|||||||
'paid' => [],
|
'paid' => [],
|
||||||
'method' => [],
|
'method' => [],
|
||||||
'private_notes' => ['columnSelector-false'],
|
'private_notes' => ['columnSelector-false'],
|
||||||
|
'user' => ['columnSelector-false'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,7 +39,7 @@ class PaymentReport extends AbstractReport
|
|||||||
->whereHas('invoice', function ($query) {
|
->whereHas('invoice', function ($query) {
|
||||||
$query->where('is_deleted', '=', false);
|
$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->startDate)
|
||||||
->where('payment_date', '<=', $this->endDate);
|
->where('payment_date', '<=', $this->endDate);
|
||||||
|
|
||||||
@ -66,6 +67,7 @@ class PaymentReport extends AbstractReport
|
|||||||
$amount,
|
$amount,
|
||||||
$payment->present()->method,
|
$payment->present()->method,
|
||||||
$payment->private_notes,
|
$payment->private_notes,
|
||||||
|
$payment->user->getDisplayName(),
|
||||||
];
|
];
|
||||||
|
|
||||||
if (! isset($invoiceMap[$invoice->id])) {
|
if (! isset($invoiceMap[$invoice->id])) {
|
||||||
|
@ -18,6 +18,7 @@ class QuoteReport extends AbstractReport
|
|||||||
'amount' => [],
|
'amount' => [],
|
||||||
'status' => [],
|
'status' => [],
|
||||||
'private_notes' => ['columnSelector-false'],
|
'private_notes' => ['columnSelector-false'],
|
||||||
|
'user' => ['columnSelector-false'],
|
||||||
];
|
];
|
||||||
|
|
||||||
if (TaxRate::scope()->count()) {
|
if (TaxRate::scope()->count()) {
|
||||||
@ -46,7 +47,7 @@ class QuoteReport extends AbstractReport
|
|||||||
$clients = Client::scope()
|
$clients = Client::scope()
|
||||||
->orderBy('name')
|
->orderBy('name')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->with('contacts')
|
->with('contacts', 'user')
|
||||||
->with(['invoices' => function ($query) use ($statusIds) {
|
->with(['invoices' => function ($query) use ($statusIds) {
|
||||||
$query->quotes()
|
$query->quotes()
|
||||||
->withArchived()
|
->withArchived()
|
||||||
@ -80,6 +81,7 @@ class QuoteReport extends AbstractReport
|
|||||||
$account->formatMoney($invoice->amount, $client),
|
$account->formatMoney($invoice->amount, $client),
|
||||||
$invoice->present()->status(),
|
$invoice->present()->status(),
|
||||||
$invoice->private_notes,
|
$invoice->private_notes,
|
||||||
|
$invoice->user->getDisplayName(),
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($hasTaxRates) {
|
if ($hasTaxRates) {
|
||||||
|
@ -16,6 +16,7 @@ class TaskReport extends AbstractReport
|
|||||||
'description' => [],
|
'description' => [],
|
||||||
'duration' => [],
|
'duration' => [],
|
||||||
'amount' => [],
|
'amount' => [],
|
||||||
|
'user' => ['columnSelector-false'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,7 +27,7 @@ class TaskReport extends AbstractReport
|
|||||||
|
|
||||||
$tasks = Task::scope()
|
$tasks = Task::scope()
|
||||||
->orderBy('created_at', 'desc')
|
->orderBy('created_at', 'desc')
|
||||||
->with('client.contacts', 'project', 'account')
|
->with('client.contacts', 'project', 'account', 'user')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->dateRange($startDate, $endDate);
|
->dateRange($startDate, $endDate);
|
||||||
|
|
||||||
@ -45,6 +46,7 @@ class TaskReport extends AbstractReport
|
|||||||
$task->description,
|
$task->description,
|
||||||
Utils::formatTime($task->getDuration()),
|
Utils::formatTime($task->getDuration()),
|
||||||
Utils::formatMoney($amount, $currencyId),
|
Utils::formatMoney($amount, $currencyId),
|
||||||
|
$task->user->getDisplayName(),
|
||||||
];
|
];
|
||||||
|
|
||||||
$this->addToTotals($currencyId, 'duration', $task->getDuration());
|
$this->addToTotals($currencyId, 'duration', $task->getDuration());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user