1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Fixes for db::raw

This commit is contained in:
David Bomba 2023-09-04 10:34:14 +10:00
parent f7f4804e34
commit 681c38e659
4 changed files with 5 additions and 4 deletions

View File

@ -168,7 +168,7 @@ trait ChartQueries
{
$user_filter = $this->is_admin ? '' : 'AND payments.user_id = '.$this->user->id;
return DB::select(("
return DB::select("
SELECT
sum(payments.amount - payments.refunded) as paid_to_date,
payments.currency_id AS currency_id

View File

@ -139,7 +139,7 @@ trait ChartQueriesLegacy
AND invoices.is_deleted = 0
AND (invoices.date BETWEEN :start_date AND :end_date)
GROUP BY currency_id
"), ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]);
", ['company_currency' => $this->company->settings->currency_id, 'company_id' => $this->company->id, 'start_date' => $start_date, 'end_date' => $end_date]);
}
public function getInvoiceChartQuery($start_date, $end_date, $currency_id)

View File

@ -15,6 +15,7 @@ use App\Models\Client;
use App\Models\Company;
use App\Models\Expense;
use Illuminate\Support\Facades\Cache;
use App\Services\Chart\ChartQueriesLegacy;
class ChartServiceLegacy
{

View File

@ -19,11 +19,11 @@ class PurchaseOrderHistoryTransformer extends EntityTransformer
{
use MakesHash;
protected $defaultIncludes = [
protected array $defaultIncludes = [
// 'activity',
];
protected $availableIncludes = [
protected array $availableIncludes = [
'activity',
];