aliran tunai
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Cawangan;
|
||||
use App\Tunai;
|
||||
use App\Gadai;
|
||||
use App\AddTunai;
|
||||
use App\RequestTeller;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -21,11 +22,31 @@ class TunaiController extends Controller
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$tunai=Tunai::on($cawangan['mysql'])->where([['kodcaw','=',$kodcaw],['tarikh','=',$current->toDateString()]])->get();
|
||||
return response()->json($tunai);
|
||||
$tunai=Tunai::on($cawangan['mysql'])->where([['kodcaw','=',$kodcaw],['tarikh','=',$current->toDateString()]])->orderBy('tarikh','desc')->get();
|
||||
return response()->json($tunai);
|
||||
|
||||
}
|
||||
|
||||
public function countgadaidantebus($kodcaw)
|
||||
{
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
$array_GT = [];
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$gadaicount=Gadai::on($cawangan['mysql'])->where([['sttebus','=',''],['t_gadai','=',$current->toDateString()]])->count();
|
||||
$gadaijumlah=Gadai::on($cawangan['mysql'])->where([['sttebus','=',''],['t_gadai','=',$current->toDateString()]])->sum('pinjaman');
|
||||
|
||||
$tebuscount=Gadai::on($cawangan['mysql'])->where([['sttebus','=','T'],['t_gadai','=',$current->toDateString()]])->count();
|
||||
$tebusjumlah=Gadai::on($cawangan['mysql'])->where([['sttebus','=','T'],['t_gadai','=',$current->toDateString()]])->sum('pinjaman');
|
||||
|
||||
array_push($array_GT,['gcount' => $gadaicount, 'gjumlah' => $gadaijumlah, 'tcount' => $tebuscount, 'tjumlah' => $tebusjumlah]);
|
||||
|
||||
return response()->json($array_GT);
|
||||
}
|
||||
|
||||
|
||||
public function sumBakiTunai($kodcaw)
|
||||
{
|
||||
@@ -101,7 +122,7 @@ class TunaiController extends Controller
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$tunai=Tunai::on($cawangan['mysql'])
|
||||
->where([['kodcaw','=',$kodcaw],['tarikh','<=',$current->toDateString()],['kodlaluan','=',$kodlaluan]])
|
||||
->where([['kodcaw','=',$kodcaw],['tarikh','=',$current->toDateString()],['kodlaluan','=',$kodlaluan]])
|
||||
->orderBy('tarikh','desc')
|
||||
->first();
|
||||
return response()->json($tunai);
|
||||
@@ -123,7 +144,7 @@ class TunaiController extends Controller
|
||||
|
||||
'tarikh' => $current->toDateString(),
|
||||
'kodcaw'=> $request->kodcaw,
|
||||
'kodlaluan'=>$request->KodLaluan,
|
||||
'kodlaluan'=>$request->kodlaluan,
|
||||
'tambah'=>$request->tambah,
|
||||
'kurang'=>$request->kurang,
|
||||
'nota'=>$request->nota
|
||||
@@ -144,13 +165,24 @@ class TunaiController extends Controller
|
||||
return response()->json($addtunai);
|
||||
}
|
||||
|
||||
public function getRequestTeller($kodcaw,$kodlaluan)
|
||||
public function getAddTunaibyKodlaluan($kodcaw,$kodlaluan)
|
||||
{
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
$addtunai=AddTunai::on($cawangan['mysql'])->where([['kodcaw','=',$kodcaw],['tarikh','=',$current->toDateString()],['kodlaluan','=',$kodlaluan]])->get();
|
||||
return response()->json($addtunai);
|
||||
}
|
||||
|
||||
public function getRequestTeller($kodcaw)
|
||||
{
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
$requestteller=RequestTeller::on('mysql7')->where([['kodcaw','=',$kodcaw],['kodlaluan','=',$kodlaluan],['update','=',0]])->get();
|
||||
$requestteller=RequestTeller::on('mysql7')->where([['kodcaw','=',$kodcaw],['update','=',0]])->get();
|
||||
return response()->json($requestteller);
|
||||
}
|
||||
|
||||
@@ -168,7 +200,7 @@ class TunaiController extends Controller
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
|
||||
$reqteller=RequestTeller::on('mysql7')->create([
|
||||
|
||||
'tarikh' => $current->toDateString(),
|
||||
|
||||
Reference in New Issue
Block a user