updates for charts

This commit is contained in:
David Bomba 2023-05-12 09:01:54 +10:00
parent 964791921e
commit bf2475d0ee
2 changed files with 2 additions and 1 deletions

View File

@ -63,7 +63,7 @@ class ChartController extends BaseController
* @OA\JsonContent(ref="#/components/schemas/Error"), * @OA\JsonContent(ref="#/components/schemas/Error"),
* ), * ),
* ) * )
* @param Request $request * @param ShowChartRequest $request
*/ */
public function totals(ShowChartRequest $request) public function totals(ShowChartRequest $request)
{ {

View File

@ -108,6 +108,7 @@ trait ChartQueries
return DB::select(DB::raw(" return DB::select(DB::raw("
SELECT SELECT
sum(invoices.balance) as amount, sum(invoices.balance) as amount,
count(invoices.id) as outstanding_count,
IFNULL(JSON_EXTRACT( settings, '$.currency_id' ), :company_currency) AS currency_id IFNULL(JSON_EXTRACT( settings, '$.currency_id' ), :company_currency) AS currency_id
FROM clients FROM clients
JOIN invoices JOIN invoices