Merged in afiqhamzah/chore/improve-query-performance-on-kawalanstok (pull request #97)

Afiqhamzah/chore/improve query performance on kawalanstok
This commit is contained in:
Afiq Hamzah
2024-01-18 06:52:08 +00:00
4 changed files with 214 additions and 90 deletions
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Reports;
use App\Helper;
use App\Http\Controllers\Controller;
use App\Services\Reports\KawalanStokService;
use App\Services\Reports\RingkasanHarianService as ReportRingkasanHarianService;
use Illuminate\Http\Request;
@@ -12,8 +13,15 @@ class RingkasanHarianController extends Controller
public function getLaporanCawangan(string $kod_cawangan, Request $request)
{
$reportGadaianService = new ReportRingkasanHarianService($kod_cawangan, $request);
return $reportGadaianService->getLaporanCawangan();
$reportRingkasanHarianService = new ReportRingkasanHarianService($kod_cawangan, $request);
$reportKawalanStokService = new KawalanStokService($kod_cawangan, $request);
$reports = [
'reportRingkasanHarian' => $reportRingkasanHarianService->getLaporanCawangan(),
'reportKawalanStok' => $reportKawalanStokService->getLaporanCawangan(),
];
return response()->json($reports);
}
public function getSummaryLaporanRingkasanHarian()