fix aliran tunai separuh

This commit is contained in:
hafifierahman
2021-03-24 16:18:31 +08:00
parent 0ce6f4495c
commit d86244657a
6 changed files with 137 additions and 53 deletions
+20 -8
View File
@@ -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();