Merge branch 'master' of https://gitlab.com/online-sistem1/api_arrahn into apiaku
This commit is contained in:
@@ -529,11 +529,17 @@ class GadaiController extends Controller
|
||||
public function barcodeScan($kodcaw,$norujukan){
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$gadai = Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update(array(
|
||||
'semakbarcode'=>'Lulus'
|
||||
));
|
||||
$dahscan = Gadai::on($cawangan['mysql'])->where([['norujukan','=',$norujukan],['semakbarcode','Lulus']])->first();
|
||||
|
||||
return response()->json($gadai,200);
|
||||
if($dahscan){
|
||||
return response()->json('scanned');
|
||||
}else{
|
||||
$gadai = Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update([
|
||||
'semakbarcode'=>'Lulus'
|
||||
]);
|
||||
|
||||
return response()->json('success');
|
||||
}
|
||||
}
|
||||
|
||||
public function checkSerahGadaian(Request $request){
|
||||
|
||||
@@ -58,7 +58,7 @@ class LaporanController extends Controller
|
||||
|
||||
|
||||
//b
|
||||
$bilangan_gadai = Gadai::on($cawangan['mysql'])->where('t_gadai','=',$request->tarikh)->count();
|
||||
$bilangan_gadai = Gadai::on($cawangan['mysql'])->where('t_gadai','=',$request->tarikh)->where('pinjaman','>',0)->count();
|
||||
$bilangan_tebus = Tebus::on($cawangan['mysql'])->where('t_tebus','=',$request->tarikh)->count();
|
||||
$bilangan_ansuran = Transaction::on('mysql7')->whereRaw('DATE(created_at) = ?',[$request->tarikh])->where([['trans_type','=','A'],['kodcaw','=',$request->kodcaw]])->count();
|
||||
$bilangan_customer_baru = Customer::on('mysql7')->where([['tarikhdaftar','=',$request->tarikh],['kodcaw',$request->kodcaw]])->count();
|
||||
@@ -256,7 +256,7 @@ class LaporanController extends Controller
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
|
||||
$laporan_terkumpul = [];
|
||||
|
||||
$gadai = Gadai::on($cawangan['mysql'])->where([['t_gadai','>=',$request->mula],['t_gadai','<=',$request->akhir]]);
|
||||
$gadai = Gadai::on($cawangan['mysql'])->where([['t_gadai','>=',$request->mula],['t_gadai','<=',$request->akhir]])->where('pinjaman','>',0);
|
||||
|
||||
$tebus = Tebus::on($cawangan['mysql'])->where([['t_tebus','>=',$request->mula],['t_tebus','<=',$request->akhir]]);
|
||||
$ansuran = Transaction::on('mysql7')->whereDate('created_at','>=',$request->mula)->whereDate('created_at','<=',$request->akhir)->where([['trans_type','=','A'],['kodcaw','=',$request->kodcaw]]);
|
||||
|
||||
@@ -249,12 +249,12 @@ class LelongController extends Controller
|
||||
}
|
||||
}else{
|
||||
$bakilelong = Lelong::on($cawangan['mysql'])
|
||||
->where('t_jual','>=',$request->mula)
|
||||
->where('t_jual','<=',$request->hingga)
|
||||
->where(function($query) use ($tarikhbaru){
|
||||
$query->whereNull('trkhtuntut')
|
||||
->orWhere('trkhtuntut','>',$tarikhbaru);
|
||||
})
|
||||
->where('trkhtuntut','>=',$request->mula)
|
||||
->where('trkhtuntut','<=',$request->hingga)
|
||||
// ->where(function($query) use ($tarikhbaru){
|
||||
// $query->whereNull('trkhtuntut')
|
||||
// ->orWhere('trkhtuntut','>',$tarikhbaru);
|
||||
// })
|
||||
->where('baki','>=',0)
|
||||
->sum('baki');
|
||||
}
|
||||
@@ -263,13 +263,13 @@ class LelongController extends Controller
|
||||
->sum('bayaran');
|
||||
|
||||
$rugilelong = Lelong::on($cawangan['mysql'])
|
||||
->where('t_jual','>=',$request->mula)
|
||||
->where('t_jual','<=',$request->hingga)
|
||||
->where(function($query) use ($tarikhbaru)
|
||||
{
|
||||
$query->whereNull('trkhtuntut')
|
||||
->orWhere('trkhtuntut','>',$tarikhbaru);
|
||||
})
|
||||
->where('trkhtuntut','>=',$request->mula)
|
||||
->where('trkhtuntut','<=',$request->hingga)
|
||||
//->where(function($query) use ($tarikhbaru)
|
||||
//{
|
||||
// $query->whereNull('t_jual')
|
||||
// ->orWhere('t_jual','>',$tarikhbaru);
|
||||
//})
|
||||
->where('baki','<',0)
|
||||
->sum('baki');
|
||||
|
||||
|
||||
@@ -195,13 +195,6 @@ class PanjarController extends Controller
|
||||
->sum('bayaran');
|
||||
|
||||
|
||||
|
||||
if($kodcaw == 'APM')
|
||||
{
|
||||
$perubatan = $perubatan - 10;
|
||||
$baikidanselenggara = $baikidanselenggara - 10;
|
||||
}
|
||||
|
||||
$arraycalculation = ['bds' => $baikidanselenggara, 'perubatan' => $perubatan, 'keraian' => $keraian];
|
||||
|
||||
return response()->json($arraycalculation);
|
||||
|
||||
@@ -580,10 +580,17 @@ class TebusController extends Controller
|
||||
|
||||
public function tagterimaupdate($kodcaw,$norujukan){
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
$dahscan = Tebus::on($cawangan['mysql'])->where([['norujukan','=',$norujukan],['tagterima',1]])->first();
|
||||
|
||||
$update_inoutmar = Tebus::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update(array(
|
||||
'tagterima' => 1
|
||||
));
|
||||
if($dahscan){
|
||||
return response()->json('scanned');
|
||||
}else{
|
||||
$update_inoutmar = Tebus::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update(array(
|
||||
'tagterima' => 1
|
||||
));
|
||||
|
||||
return response()->json('success');
|
||||
}
|
||||
}
|
||||
|
||||
public function checkSerahTebus(Request $request){
|
||||
|
||||
@@ -75,7 +75,7 @@ class TransactionOnlineController extends Controller
|
||||
|
||||
GlDetail::on($cawangan['mysql'])->create([
|
||||
'kodcaw' => $transaction['kodcaw'],
|
||||
'tarikh' => $current->toDateString(),
|
||||
'tarikh' => Carbon::parse($transaction['paid_at'])->format('Y-m-d'),
|
||||
'dtacct' => '1000/010',
|
||||
'ktacct' => '1000/020',
|
||||
'descpt' => 'SERAHAN BAYAR ONLINE - ' . $transaction['norujukan'],
|
||||
|
||||
Reference in New Issue
Block a user