Merged in izzati-feat-laporan-baki-lelong (pull request #310)
update query baki lelong
This commit is contained in:
@@ -126,7 +126,10 @@ public function getSummaryLaporanBakiLelongBelumTuntut(Request $request)
|
|||||||
sum(lelong.cajlelong) as sum_cajlelong,
|
sum(lelong.cajlelong) as sum_cajlelong,
|
||||||
sum(lelong.hargajual) as sum_hargajual,
|
sum(lelong.hargajual) as sum_hargajual,
|
||||||
sum(lelong.baki) as sum_baki'))
|
sum(lelong.baki) as sum_baki'))
|
||||||
->whereNull('lelong.trkhtuntut')
|
->where(function ($query) use ($request) {
|
||||||
|
$query->whereNull('lelong.trkhtuntut')
|
||||||
|
->orWhere('lelong.trkhtuntut', '>', $request->endDate); // or use a specific date: '2025-06-01'
|
||||||
|
})
|
||||||
->where('lelong.baki', '>', 0.00);
|
->where('lelong.baki', '>', 0.00);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ class LelonganService
|
|||||||
public function getCawanganReportBakiLelongBelumTuntut()
|
public function getCawanganReportBakiLelongBelumTuntut()
|
||||||
{
|
{
|
||||||
$cawangan_connection = Cawangan::where('kodcaw', $this->kod_cawangan)->first()->mysql;
|
$cawangan_connection = Cawangan::where('kodcaw', $this->kod_cawangan)->first()->mysql;
|
||||||
|
$endDate = $this->endDate;
|
||||||
$query_total_lelongan = Lelong::on($cawangan_connection)
|
$query_total_lelongan = Lelong::on($cawangan_connection)
|
||||||
->join('gadai', 'gadai.norujukan', '=', 'lelong.norujukan') // Joining gadai table
|
->join('gadai', 'gadai.norujukan', '=', 'lelong.norujukan') // Joining gadai table
|
||||||
->select(
|
->select(
|
||||||
@@ -272,7 +272,10 @@ class LelonganService
|
|||||||
'gadai.bakipjm', // Fetch pinjaman from gadai
|
'gadai.bakipjm', // Fetch pinjaman from gadai
|
||||||
'gadai.marhun' // Fetch marhun from gadai
|
'gadai.marhun' // Fetch marhun from gadai
|
||||||
)
|
)
|
||||||
->whereNull('lelong.trkhtuntut')
|
->where(function ($query) use ($endDate) {
|
||||||
|
$query->whereNull('lelong.trkhtuntut')
|
||||||
|
->orWhere('lelong.trkhtuntut', '>', $endDate); // or use a specific date: '2025-06-01'
|
||||||
|
})
|
||||||
->where('lelong.baki', '>', 0.00);
|
->where('lelong.baki', '>', 0.00);
|
||||||
|
|
||||||
$query_total_lelongan->when(!empty($this->startDate) and !empty($this->endDate), function ($q) {
|
$query_total_lelongan->when(!empty($this->startDate) and !empty($this->endDate), function ($q) {
|
||||||
|
|||||||
Reference in New Issue
Block a user