diff --git a/.gitignore b/.gitignore index a62d6bda..2ab5761c 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ yarn-error.log .qodo .camel-jbang dump/ -db/ \ No newline at end of file +db/ +composer.lock \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index d5b76d6a..e72b7409 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer WORKDIR /var/www/html # Copy ONLY composer files first -COPY composer.json composer.lock ./ +COPY composer.json ./ # Create storage and bootstrap directories needed for composer scripts RUN mkdir -p storage/framework/cache \ diff --git a/Modules/Business/App/Http/Controllers/DashboardController.php b/Modules/Business/App/Http/Controllers/DashboardController.php index 15ce0fb3..e6a10824 100644 --- a/Modules/Business/App/Http/Controllers/DashboardController.php +++ b/Modules/Business/App/Http/Controllers/DashboardController.php @@ -196,7 +196,7 @@ public function revenue() $data['loss'] = Sale::where('business_id', auth()->user()->business_id) ->whereYear('created_at', request('year') ?? date('Y')) ->where('lossProfit', '<', 0) - ->selectRaw('MONTHNAME(created_at) as month, SUM(ABS(lossProfit)) as total') + ->selectRaw("TO_CHAR(created_at, 'Month') as month, SUM(ABS(lossProfit)) as total") ->orderBy('created_at') ->groupBy('created_at') ->get(); @@ -204,7 +204,7 @@ public function revenue() $data['profit'] = Sale::where('business_id', auth()->user()->business_id) ->whereYear('created_at', request('year') ?? date('Y')) ->where('lossProfit', '>=', 0) - ->selectRaw('MONTHNAME(created_at) as month, SUM(ABS(lossProfit)) as total') + ->selectRaw("TO_CHAR(created_at, 'Month') as month, SUM(ABS(lossProfit)) as total") ->orderBy('created_at') ->groupBy('created_at') ->get(); diff --git a/Modules/MultiBranchAddon/App/Http/Controllers/AcnooBranchController.php b/Modules/MultiBranchAddon/App/Http/Controllers/AcnooBranchController.php index 7f15e5d6..ec261ef9 100644 --- a/Modules/MultiBranchAddon/App/Http/Controllers/AcnooBranchController.php +++ b/Modules/MultiBranchAddon/App/Http/Controllers/AcnooBranchController.php @@ -241,7 +241,7 @@ public function incomeExpense(Request $request) $data['expenses'] = Sale::where('business_id', auth()->user()->business_id) ->whereYear('created_at', request('year') ?? date('Y')) ->where('lossProfit', '<', 0) - ->selectRaw('MONTH(created_at) as month_number, MONTHNAME(created_at) as month, SUM(ABS(lossProfit)) as total') + ->selectRaw("EXTRACT(MONTH FROM created_at) as month_number, TO_CHAR(created_at, 'Month') as month, SUM(ABS(lossProfit)) as total") ->groupBy('month_number', 'month') ->orderBy('month_number') ->get(); @@ -249,7 +249,7 @@ public function incomeExpense(Request $request) $data['incomes'] = Sale::where('business_id', auth()->user()->business_id) ->whereYear('created_at', request('year') ?? date('Y')) ->where('lossProfit', '>=', 0) - ->selectRaw('MONTH(created_at) as month_number, MONTHNAME(created_at) as month, SUM(ABS(lossProfit)) as total') + ->selectRaw("EXTRACT(MONTH FROM created_at) as month_number, TO_CHAR(created_at, 'Month') as month, SUM(ABS(lossProfit)) as total") ->groupBy('month_number', 'month') ->orderBy('month_number') ->get();