Merged in izzati-addfeat-laporan-outstanding-v2 (pull request #398)
tambah field barang kes dalam laporan outstanding
This commit is contained in:
@@ -46,10 +46,17 @@ class OutstandingController extends Controller
|
||||
|
||||
// Query outstanding summary for each branch
|
||||
$summary_Outstanding_data = array_map(function ($db_connection) use ($endDate) {
|
||||
// SAG KES
|
||||
$queryKes = Gadai::on($db_connection)
|
||||
->selectRaw('COUNT(norujukan) as total_gadaian_kes, SUM(pinjaman) as sum_pinjaman_kes')
|
||||
->where('tagbaru', 0)
|
||||
->where('tagpalsu', 1)
|
||||
->where('sttebus', '');
|
||||
// SAG LAMA
|
||||
$queryLama = Gadai::on($db_connection)
|
||||
->selectRaw('COUNT(norujukan) as total_gadaian, SUM(pinjaman) as sum_pinjaman')
|
||||
->where('tagbaru', 0)
|
||||
->where('tagpalsu', 0)
|
||||
->where('sttebus', '');
|
||||
|
||||
// SAG BARU
|
||||
@@ -64,12 +71,14 @@ class OutstandingController extends Controller
|
||||
->where('sttebus', '');
|
||||
|
||||
if (!empty($endDate)) {
|
||||
$queryKes->where('t_gadai', '<=', $endDate);
|
||||
$queryLama->where('t_gadai', '<=', $endDate);
|
||||
$queryBaru->where('t_gadai', '<=', $endDate);
|
||||
$queryAll->where('t_gadai', '<=', $endDate);
|
||||
}
|
||||
|
||||
return array_merge(
|
||||
$queryKes->first()->toArray(),
|
||||
$queryLama->first()->toArray(),
|
||||
$queryBaru->first()->toArray(),
|
||||
$queryAll->first()->toArray()
|
||||
|
||||
Reference in New Issue
Block a user