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; $user_filter = $this->is_admin ? '' : 'AND payments.user_id = '.$this->user->id;
return DB::select((" return DB::select("
SELECT SELECT
sum(payments.amount - payments.refunded) as paid_to_date, sum(payments.amount - payments.refunded) as paid_to_date,
payments.currency_id AS currency_id payments.currency_id AS currency_id

View File

@ -139,7 +139,7 @@ trait ChartQueriesLegacy
AND invoices.is_deleted = 0 AND invoices.is_deleted = 0
AND (invoices.date BETWEEN :start_date AND :end_date) AND (invoices.date BETWEEN :start_date AND :end_date)
GROUP BY currency_id 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) 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\Company;
use App\Models\Expense; use App\Models\Expense;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
use App\Services\Chart\ChartQueriesLegacy;
class ChartServiceLegacy class ChartServiceLegacy
{ {

View File

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