fix cron
This commit is contained in:
@@ -562,10 +562,14 @@ class LelongController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function keluarLelong(){
|
public function keluarLelong(Request $request){
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
if($request->zone == 'all'){
|
||||||
|
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||||
|
}else{
|
||||||
|
$cawangan_all = Cawangan::on('mysql7')->where('zone',$request->zone)->get();
|
||||||
|
}
|
||||||
|
|
||||||
foreach($cawangan_all as $index=>$cawangan){
|
foreach($cawangan_all as $index=>$cawangan){
|
||||||
$list_tebus_today = Tebus::on($cawangan['mysql'])->where('t_tebus',$current->toDateString())->pluck('norujukan')->toArray();
|
$list_tebus_today = Tebus::on($cawangan['mysql'])->where('t_tebus',$current->toDateString())->pluck('norujukan')->toArray();
|
||||||
@@ -611,9 +615,12 @@ class LelongController extends Controller
|
|||||||
return response()->json($lelong);
|
return response()->json($lelong);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateJBGLelong(){
|
public function updateJBGLelong(Request $request){
|
||||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
if($request->zone == 'all'){
|
||||||
$current = Carbon::now();
|
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||||
|
}else{
|
||||||
|
$cawangan_all = Cawangan::on('mysql7')->where('zone',$request->zone)->get();
|
||||||
|
}
|
||||||
|
|
||||||
foreach($cawangan_all as $index=>$cawangan){
|
foreach($cawangan_all as $index=>$cawangan){
|
||||||
$lelongList = Lelong::on($cawangan['mysql'])->where([['t_jual',null],['hargajual',0.00]])->get();
|
$lelongList = Lelong::on($cawangan['mysql'])->where([['t_jual',null],['hargajual',0.00]])->get();
|
||||||
@@ -770,8 +777,12 @@ class LelongController extends Controller
|
|||||||
return response()->json($detailslelong);
|
return response()->json($detailslelong);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function keluarLelongTawarruq(){
|
public function keluarLelongTawarruq(Request $request){
|
||||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
if($request->zone == 'all'){
|
||||||
|
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||||
|
}else{
|
||||||
|
$cawangan_all = Cawangan::on('mysql7')->where('zone',$request->zone)->get();
|
||||||
|
}
|
||||||
|
|
||||||
foreach($cawangan_all as $index=>$cawangan){
|
foreach($cawangan_all as $index=>$cawangan){
|
||||||
$list_lelong = Lelong::on($cawangan['mysql'])->where('t_jual',null)->pluck('norujukan')->toArray();
|
$list_lelong = Lelong::on($cawangan['mysql'])->where('t_jual',null)->pluck('norujukan')->toArray();
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ class TunaiController extends Controller
|
|||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
|
|
||||||
$tunai=Tunai::on($cawangan['mysql'])->where([['kodcaw','=',$kodcaw],['tarikh','=',$current->toDateString()]])->orderBy('tarikh','desc')->get();
|
$tunai=Tunai::on($cawangan['mysql'])->where([['kodcaw','=',$kodcaw],['tarikh','=',$current->toDateString()]])->orderBy('tarikh','desc')->get();
|
||||||
return response()->json($tunai);
|
return response()->json($tunai);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function countgadaidantebus($kodcaw)
|
public function countgadaidantebus($kodcaw)
|
||||||
{
|
{
|
||||||
@@ -38,10 +38,10 @@ class TunaiController extends Controller
|
|||||||
$array_GT = [];
|
$array_GT = [];
|
||||||
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
|
|
||||||
$gadaicount=Gadai::on($cawangan['mysql'])->where([['sttebus','=',''],['t_gadai','=',$current->toDateString()]])->count();
|
$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');
|
$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();
|
$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');
|
$tebusjumlah=Gadai::on($cawangan['mysql'])->where([['sttebus','=','T'],['t_gadai','=',$current->toDateString()]])->sum('pinjaman');
|
||||||
|
|
||||||
@@ -61,14 +61,14 @@ class TunaiController extends Controller
|
|||||||
$tunai=Tunai::on($cawangan['mysql'])->where('tarikh','=',$current->toDateString())->sum('baki');
|
$tunai=Tunai::on($cawangan['mysql'])->where('tarikh','=',$current->toDateString())->sum('baki');
|
||||||
|
|
||||||
return response()->json($tunai);
|
return response()->json($tunai);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function UpdateTunai($kodcaw, Request $request)
|
public function UpdateTunai($kodcaw, Request $request)
|
||||||
{
|
{
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
$updatetunai=Tunai::on($cawangan['mysql'])->where( [['tarikh','=', $current->toDateString()],['kodlaluan','=', $request->kodlaluan] ])->
|
$updatetunai=Tunai::on($cawangan['mysql'])->where( [['tarikh','=', $current->toDateString()],['kodlaluan','=', $request->kodlaluan] ])->
|
||||||
update(array(
|
update(array(
|
||||||
@@ -76,7 +76,7 @@ class TunaiController extends Controller
|
|||||||
'kurang'=>$request->kurang,
|
'kurang'=>$request->kurang,
|
||||||
'baki'=>$request->bakiakhir
|
'baki'=>$request->bakiakhir
|
||||||
));
|
));
|
||||||
|
|
||||||
return response()->json($updatetunai, 200);
|
return response()->json($updatetunai, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ class TunaiController extends Controller
|
|||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
$updatetunai = Tunai::on($cawangan['mysql'])->where( [['tarikh','=', $current->toDateString()],['kodlaluan','=', $request->kodlaluan] ])->
|
$updatetunai = Tunai::on($cawangan['mysql'])->where( [['tarikh','=', $current->toDateString()],['kodlaluan','=', $request->kodlaluan] ])->
|
||||||
update(array(
|
update(array(
|
||||||
@@ -95,11 +95,11 @@ class TunaiController extends Controller
|
|||||||
));
|
));
|
||||||
|
|
||||||
return response()->json($updatetunai, 200);
|
return response()->json($updatetunai, 200);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function DaftarTunai($kodcaw, Request $request)
|
public function DaftarTunai($kodcaw, Request $request)
|
||||||
@@ -109,11 +109,11 @@ class TunaiController extends Controller
|
|||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
$tunai=Tunai::on($cawangan['mysql'])->create([
|
$tunai=Tunai::on($cawangan['mysql'])->create([
|
||||||
|
|
||||||
'tarikh' => $current->toDateString(),
|
'tarikh' => $current->toDateString(),
|
||||||
'kodcaw'=> $request->kodcaw,
|
'kodcaw'=> $request->kodcaw,
|
||||||
'kodlaluan'=>$request->teller,
|
'kodlaluan'=>$request->teller,
|
||||||
@@ -159,7 +159,7 @@ class TunaiController extends Controller
|
|||||||
->where([['kodcaw','=',$kodcaw],['tarikh','<',$current->toDateString()],['kodlaluan','=',$request->kodlaluan]])
|
->where([['kodcaw','=',$kodcaw],['tarikh','<',$current->toDateString()],['kodlaluan','=',$request->kodlaluan]])
|
||||||
->orderBy('tarikh','desc')
|
->orderBy('tarikh','desc')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
return response()->json($tunai);
|
return response()->json($tunai);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -182,17 +182,17 @@ class TunaiController extends Controller
|
|||||||
|
|
||||||
///API FARIS
|
///API FARIS
|
||||||
|
|
||||||
|
|
||||||
public function create($kodcaw,Request $request)
|
public function create($kodcaw,Request $request)
|
||||||
{
|
{
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$addtunai=AddTunai::on($cawangan['mysql'])->create([
|
|
||||||
|
$addtunai=AddTunai::on($cawangan['mysql'])->create([
|
||||||
|
|
||||||
'tarikh' => $current->toDateString(),
|
'tarikh' => $current->toDateString(),
|
||||||
'kodcaw'=> $request->kodcaw,
|
'kodcaw'=> $request->kodcaw,
|
||||||
'kodlaluan'=>$request->kodlaluan,
|
'kodlaluan'=>$request->kodlaluan,
|
||||||
@@ -207,7 +207,7 @@ class TunaiController extends Controller
|
|||||||
|
|
||||||
public function getAddTunai($kodcaw)
|
public function getAddTunai($kodcaw)
|
||||||
{
|
{
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ class TunaiController extends Controller
|
|||||||
|
|
||||||
public function getAddTunaiDate($kodcaw,Request $request)
|
public function getAddTunaiDate($kodcaw,Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
@@ -260,26 +260,26 @@ class TunaiController extends Controller
|
|||||||
->first();
|
->first();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json($addtunai);
|
return response()->json($addtunai);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRequestTeller($kodcaw)
|
public function getRequestTeller($kodcaw)
|
||||||
{
|
{
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
$requestteller=RequestTeller::on('mysql7')->where([['kodcaw','=',$kodcaw],['update','=',0],['tarikh','=',$current->toDateString()]])->get();
|
$requestteller=RequestTeller::on('mysql7')->where([['kodcaw','=',$kodcaw],['update','=',0],['tarikh','=',$current->toDateString()]])->get();
|
||||||
return response()->json($requestteller);
|
return response()->json($requestteller);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRequestTellerLaporanSerahan($kodcaw,Request $request)
|
public function getRequestTellerLaporanSerahan($kodcaw,Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
$requestteller=RequestTeller::on('mysql7')->where([['kodcaw','=',$kodcaw],['update','=',1],['serahan','>',0],['kodlaluan','=',$request->teller],['tarikh','=',$current->toDateString()]])->get();
|
$requestteller=RequestTeller::on('mysql7')->where([['kodcaw','=',$kodcaw],['update','=',1],['serahan','>',0],['kodlaluan','=',$request->teller],['tarikh','=',$current->toDateString()]])->get();
|
||||||
|
|
||||||
return response()->json($requestteller);
|
return response()->json($requestteller);
|
||||||
@@ -287,10 +287,10 @@ class TunaiController extends Controller
|
|||||||
|
|
||||||
public function getRequestTellerLaporanSerahanBerkala($kodcaw,Request $request)
|
public function getRequestTellerLaporanSerahanBerkala($kodcaw,Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
$requestteller=RequestTeller::on('mysql7')
|
$requestteller=RequestTeller::on('mysql7')
|
||||||
->where([['kodcaw','=',$kodcaw],['update','=',1],['serahan','>',0],['kodlaluan','=',$request->teller],['tarikh','=',$current->toDateString()]])
|
->where([['kodcaw','=',$kodcaw],['update','=',1],['serahan','>',0],['kodlaluan','=',$request->teller],['tarikh','=',$current->toDateString()]])
|
||||||
->orderBy('recno','desc')
|
->orderBy('recno','desc')
|
||||||
@@ -301,10 +301,10 @@ class TunaiController extends Controller
|
|||||||
|
|
||||||
public function getRequestTellerByDate($kodcaw,Request $request)
|
public function getRequestTellerByDate($kodcaw,Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
|
|
||||||
$requestteller=RequestTeller::on('mysql7')->where([['kodcaw','=',$kodcaw],['update','=',0],['tarikh','<=',$request->hingga],['tarikh','>=',$request->mula]])->get();
|
$requestteller=RequestTeller::on('mysql7')->where([['kodcaw','=',$kodcaw],['update','=',0],['tarikh','<=',$request->hingga],['tarikh','>=',$request->mula]])->get();
|
||||||
return response()->json($requestteller);
|
return response()->json($requestteller);
|
||||||
}
|
}
|
||||||
@@ -314,7 +314,7 @@ class TunaiController extends Controller
|
|||||||
$requestteller = RequestTeller::on('mysql7')->where([['no','=',$request->no],['kodcaw','=',$kodcaw],['kodlaluan','=',$request->kodlaluan],['update','=',0]])->update(array(
|
$requestteller = RequestTeller::on('mysql7')->where([['no','=',$request->no],['kodcaw','=',$kodcaw],['kodlaluan','=',$request->kodlaluan],['update','=',0]])->update(array(
|
||||||
|
|
||||||
'update' => 1
|
'update' => 1
|
||||||
|
|
||||||
) );
|
) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,12 +322,12 @@ class TunaiController extends Controller
|
|||||||
{
|
{
|
||||||
$requestteller = RequestTeller::on('mysql7')->where([['no','=',$request->no],['kodcaw','=',$kodcaw],['kodlaluan','=',$request->kodlaluan],['update','=',0]])->update(array(
|
$requestteller = RequestTeller::on('mysql7')->where([['no','=',$request->no],['kodcaw','=',$kodcaw],['kodlaluan','=',$request->kodlaluan],['update','=',0]])->update(array(
|
||||||
'update' => 2
|
'update' => 2
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createRequestTeller($kodcaw,Request $request)
|
public function createRequestTeller($kodcaw,Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
@@ -336,8 +336,8 @@ class TunaiController extends Controller
|
|||||||
|
|
||||||
// strtotime($current->toTimeString());
|
// strtotime($current->toTimeString());
|
||||||
|
|
||||||
$reqteller=RequestTeller::on('mysql7')->create([
|
$reqteller=RequestTeller::on('mysql7')->create([
|
||||||
|
|
||||||
'tarikh' => $current->toDateString(),
|
'tarikh' => $current->toDateString(),
|
||||||
'masa' => $current->toTimeString(),
|
'masa' => $current->toTimeString(),
|
||||||
'kodcaw' => $kodcaw,
|
'kodcaw' => $kodcaw,
|
||||||
@@ -385,7 +385,7 @@ class TunaiController extends Controller
|
|||||||
->where([['kodcaw','=',$kodcaw],['tarikh','=', $getdate['tarikh']],['baki','<>',0]])
|
->where([['kodcaw','=',$kodcaw],['tarikh','=', $getdate['tarikh']],['baki','<>',0]])
|
||||||
->GroupBy('kodlaluan')
|
->GroupBy('kodlaluan')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
return response()->json($tunai);
|
return response()->json($tunai);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,16 +399,20 @@ class TunaiController extends Controller
|
|||||||
->orWhere('kodlaluan','=','LELONG')
|
->orWhere('kodlaluan','=','LELONG')
|
||||||
->distinct()
|
->distinct()
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
return response()->json($teller);
|
return response()->json($teller);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function initiateTunai(){
|
public function initiateTunai(Request $request){
|
||||||
|
|
||||||
$current = new Carbon();
|
$current = new Carbon();
|
||||||
$current = Carbon::now();
|
$current = Carbon::now();
|
||||||
|
|
||||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
if($request->zone == 'all'){
|
||||||
|
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||||
|
}else{
|
||||||
|
$cawangan_all = Cawangan::on('mysql7')->where('zone',$request->zone)->get();
|
||||||
|
}
|
||||||
|
|
||||||
foreach($cawangan_all as $index=>$cawangan){
|
foreach($cawangan_all as $index=>$cawangan){
|
||||||
$getdate = Tunai::on($cawangan['mysql'])
|
$getdate = Tunai::on($cawangan['mysql'])
|
||||||
@@ -443,21 +447,21 @@ class TunaiController extends Controller
|
|||||||
'baki'=>$tunsem['baki'],
|
'baki'=>$tunsem['baki'],
|
||||||
'tambah'=>0.00,
|
'tambah'=>0.00,
|
||||||
'kurang'=>0.00
|
'kurang'=>0.00
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Denominasi
|
//Denominasi
|
||||||
$denominasi=Denominasi::on($cawangan['mysql'])->where('tarikh','=',$current->toDateString())->limit(1)->get();
|
$denominasi=Denominasi::on($cawangan['mysql'])->where('tarikh','=',$current->toDateString())->limit(1)->get();
|
||||||
|
|
||||||
if(sizeof($denominasi) == 0)
|
if(sizeof($denominasi) == 0)
|
||||||
{
|
{
|
||||||
$deno = Denominasi::on($cawangan['mysql'])->orderby('tarikh','desc')->first();
|
$deno = Denominasi::on($cawangan['mysql'])->orderby('tarikh','desc')->first();
|
||||||
|
|
||||||
if($deno)
|
if($deno)
|
||||||
{
|
{
|
||||||
$savedeno = Denominasi::on($cawangan['mysql'])->create([
|
$savedeno = Denominasi::on($cawangan['mysql'])->create([
|
||||||
|
|
||||||
'tarikh' => $current->toDateString(),
|
'tarikh' => $current->toDateString(),
|
||||||
'bd1' => $deno['bd1'],
|
'bd1' => $deno['bd1'],
|
||||||
'b1' => $deno['b1'],
|
'b1' => $deno['b1'],
|
||||||
@@ -502,8 +506,8 @@ class TunaiController extends Controller
|
|||||||
'jumlahkeping' => $deno['jumlahkeping']
|
'jumlahkeping' => $deno['jumlahkeping']
|
||||||
]);
|
]);
|
||||||
}else{
|
}else{
|
||||||
$savedeno = Denominasi::on($cawangan['mysql'])->create([
|
$savedeno = Denominasi::on($cawangan['mysql'])->create([
|
||||||
|
|
||||||
'tarikh' => $current->toDateString(),
|
'tarikh' => $current->toDateString(),
|
||||||
'bd1' => 0,
|
'bd1' => 0,
|
||||||
'b1' => 0,
|
'b1' => 0,
|
||||||
@@ -549,20 +553,20 @@ class TunaiController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Peti Besi Cawangan
|
//Peti Besi Cawangan
|
||||||
$getVault=Vault::on($cawangan['mysql'])
|
$getVault=Vault::on($cawangan['mysql'])
|
||||||
->where('kodcaw','=',$cawangan['kodcaw'])
|
->where('kodcaw','=',$cawangan['kodcaw'])
|
||||||
->where('tarikh','=',$current->toDateString())
|
->where('tarikh','=',$current->toDateString())
|
||||||
->orderby('tarikh','desc')->limit(1)->get();
|
->orderby('tarikh','desc')->limit(1)->get();
|
||||||
|
|
||||||
if(sizeof($getVault) == 0)
|
if(sizeof($getVault) == 0)
|
||||||
{
|
{
|
||||||
$vault = Vault::on($cawangan['mysql'])->orderby('tarikh','desc')->first();
|
$vault = Vault::on($cawangan['mysql'])->orderby('tarikh','desc')->first();
|
||||||
|
|
||||||
if($vault)
|
if($vault)
|
||||||
{
|
{
|
||||||
$vaultcreate = Vault::on($cawangan['mysql'])->create([
|
$vaultcreate = Vault::on($cawangan['mysql'])->create([
|
||||||
'kodcaw'=>$cawangan['kodcaw'],
|
'kodcaw'=>$cawangan['kodcaw'],
|
||||||
'tarikh'=> $current->toDateString(),
|
'tarikh'=> $current->toDateString(),
|
||||||
'bakiawal' => $vault['bakiakhir'],
|
'bakiawal' => $vault['bakiakhir'],
|
||||||
@@ -584,10 +588,10 @@ class TunaiController extends Controller
|
|||||||
'rm50' => $vault['rm50'],
|
'rm50' => $vault['rm50'],
|
||||||
'rm100' => $vault['rm100'],
|
'rm100' => $vault['rm100'],
|
||||||
'rm1000' => $vault['rm1000'],
|
'rm1000' => $vault['rm1000'],
|
||||||
'totpanjar' => 0
|
'totpanjar' => 0
|
||||||
]);
|
]);
|
||||||
}else{
|
}else{
|
||||||
$vaultcreate = Vault::on($cawangan['mysql'])->create([
|
$vaultcreate = Vault::on($cawangan['mysql'])->create([
|
||||||
'kodcaw'=>$request->kodcaw,
|
'kodcaw'=>$request->kodcaw,
|
||||||
'tarikh'=> $current->toDateString(),
|
'tarikh'=> $current->toDateString(),
|
||||||
'bakiawal' => 0,
|
'bakiawal' => 0,
|
||||||
@@ -609,11 +613,11 @@ class TunaiController extends Controller
|
|||||||
'rm50' => 0,
|
'rm50' => 0,
|
||||||
'rm100' => 0,
|
'rm100' => 0,
|
||||||
'rm1000' => 0,
|
'rm1000' => 0,
|
||||||
'totpanjar' => 0
|
'totpanjar' => 0
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user