mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix for #859
This commit is contained in:
parent
1777f467f0
commit
110af6f28b
@ -248,11 +248,13 @@ class ReportController extends BaseController
|
|||||||
->withArchived()
|
->withArchived()
|
||||||
->with('contacts')
|
->with('contacts')
|
||||||
->with(['invoices' => function($query) use ($startDate, $endDate, $dateField) {
|
->with(['invoices' => function($query) use ($startDate, $endDate, $dateField) {
|
||||||
$query->withArchived();
|
$query->with('invoice_items')->withArchived();
|
||||||
if ($dateField == FILTER_PAYMENT_DATE) {
|
if ($dateField == FILTER_INVOICE_DATE) {
|
||||||
$query->where('invoice_date', '>=', $startDate)
|
$query->where('invoice_date', '>=', $startDate)
|
||||||
->where('invoice_date', '<=', $endDate)
|
->where('invoice_date', '<=', $endDate)
|
||||||
->whereHas('payments', function($query) use ($startDate, $endDate) {
|
->with('payments');
|
||||||
|
} else {
|
||||||
|
$query->whereHas('payments', function($query) use ($startDate, $endDate) {
|
||||||
$query->where('payment_date', '>=', $startDate)
|
$query->where('payment_date', '>=', $startDate)
|
||||||
->where('payment_date', '<=', $endDate)
|
->where('payment_date', '<=', $endDate)
|
||||||
->withArchived();
|
->withArchived();
|
||||||
@ -260,9 +262,8 @@ class ReportController extends BaseController
|
|||||||
->with(['payments' => function($query) use ($startDate, $endDate) {
|
->with(['payments' => function($query) use ($startDate, $endDate) {
|
||||||
$query->where('payment_date', '>=', $startDate)
|
$query->where('payment_date', '>=', $startDate)
|
||||||
->where('payment_date', '<=', $endDate)
|
->where('payment_date', '<=', $endDate)
|
||||||
->withArchived()
|
->withArchived();
|
||||||
->with('payment_type', 'account_gateway.gateway');
|
}]);
|
||||||
}, 'invoice_items']);
|
|
||||||
}
|
}
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user