fix aliran tunai separuh
This commit is contained in:
@@ -150,30 +150,27 @@ class LelongController extends Controller
|
||||
|
||||
$bakilelong = Lelong::on($cawangan['mysql'])
|
||||
->where('t_jual','<=',$request->tarikh)
|
||||
->where(function($query){
|
||||
->where(function($query) use ($tarikhbaru){
|
||||
$query->whereNull('trkhtuntut')
|
||||
->orWhere('trkhtuntut','>','2021-01-02');
|
||||
->orWhere('trkhtuntut','>',$tarikhbaru);
|
||||
})
|
||||
->where('baki','>=',0)
|
||||
->sum('baki');
|
||||
|
||||
// dd($bakilelong->toSql(), $bakilelong->getBindings());
|
||||
// dd($bakilelong);
|
||||
|
||||
$ansrugi = AnsRugi::on($cawangan['mysql'])
|
||||
->sum('bayaran');
|
||||
|
||||
$rugilelong = Lelong::on($cawangan['mysql'])
|
||||
->where('t_jual','<=',$request->tarikh)
|
||||
->where(function($query)
|
||||
->where(function($query) use ($tarikhbaru)
|
||||
{
|
||||
$query->whereNull('trkhtuntut')
|
||||
->orWhere('trkhtuntut','>','2021-01-02');
|
||||
->orWhere('trkhtuntut','>',$tarikhbaru);
|
||||
})
|
||||
->where('baki','<',0)
|
||||
->sum('baki');
|
||||
|
||||
$rugitotal=$rugilelong + $ansrugi;
|
||||
$rugitotal=$rugilelong + $ansrugi;
|
||||
|
||||
$arraylelong = ['bakilelong' => $bakilelong, 'rugilelong' => $rugitotal];
|
||||
|
||||
@@ -310,6 +307,21 @@ class LelongController extends Controller
|
||||
return response()->json($tuntutbaki,200);
|
||||
}
|
||||
|
||||
public function showTuntutBakiTeller($kodcaw,Request $request){
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$tuntutbaki = TuntutBaki::on($cawangan['mysql'])
|
||||
->where('tarikh','=', $current->toDateString())
|
||||
->where('teller','=', $request->teller)
|
||||
->get();
|
||||
|
||||
return response()->json($tuntutbaki,200);
|
||||
}
|
||||
|
||||
public function resitLelong($kodcaw,$norujukan){
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
Reference in New Issue
Block a user