Merged in izzati-ujrah (pull request #7)
update khazanah controller fix conflict
This commit is contained in:
@@ -4297,4 +4297,135 @@ class KhazanahController extends Controller
|
||||
return view('print.laporan_ansuran_ujrah', compact('tebus','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'));
|
||||
}
|
||||
|
||||
public function laporanStokAuditKhas(){
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
|
||||
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
return view('khazanah.laporan.stokauditkhas',compact('cawangan_info','api_url'));
|
||||
}
|
||||
|
||||
public function cetakLaporanStokAuditKhas(Request $request){
|
||||
$api_url = config('api.url');
|
||||
$auth_user = Auth::user();
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
$daritempoh = $request->daritempoh;
|
||||
$hinggatempoh = $request->hinggatempoh;
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
$cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
|
||||
if($request->radaktif === 'aktif')
|
||||
{
|
||||
$stokaudit = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/stokauditkhas/aktif/'. $auth_user['cawangan'],['daritempoh' => $daritempoh, 'hinggatempoh' => $hinggatempoh])->json();
|
||||
return view('print.laporan_stokauditkhas', compact('stokaudit','cawangan_detail','tarikh_cetak','daritempoh','hinggatempoh','api_url','cawangan_info'));
|
||||
}
|
||||
}
|
||||
|
||||
public function cetakExportLaporanStokAuditKhas(Request $request){
|
||||
// dd($request->all());
|
||||
$api_url = config('api.url');
|
||||
$auth_user = Auth::user();
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
$daritempoh = $request->daritempoh;
|
||||
$hinggatempoh = $request->hinggatempoh;
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
$cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
|
||||
$stokaudit = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/stokauditkhas/aktif/'. $auth_user['cawangan'],['daritempoh' => $daritempoh, 'hinggatempoh' => $hinggatempoh])->json();
|
||||
|
||||
if($request->type == 'excel')
|
||||
{
|
||||
return view('excel.excel_stokauditkhas', compact('stokaudit','cawangan_detail','tarikh_cetak','daritempoh','hinggatempoh','api_url','cawangan_info'));
|
||||
}
|
||||
elseif($request->type == 'whatsapp')
|
||||
{
|
||||
|
||||
$blastwhatsapp = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/blastwasap/'.$auth_user['cawangan'],
|
||||
['daritempoh' => $daritempoh, 'hinggatempoh' => $hinggatempoh, 'namapengguna' => $auth_user['name'],])->json();
|
||||
if($blastwhatsapp == 'success'){
|
||||
return redirect()->route('laporan.stokauditkhas')
|
||||
->with('success','Blast Whatsapp Dalam Proses.');
|
||||
}
|
||||
elseif($blastwhatsapp == 'failed'){
|
||||
return redirect()->route('laporan.stokauditkhas')
|
||||
->with('failed','Blast Whatsapp Tidak Berjaya, Sila Semak Semula Rekod Blasted.');
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$stokaudit = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/stokauditkhas/aktif/'. $auth_user['cawangan'],['daritempoh' => $daritempoh, 'hinggatempoh' => $hinggatempoh])->json();
|
||||
return view('pdf.pdf_stokauditkhas', compact('stokaudit','cawangan_detail','tarikh_cetak','daritempoh','hinggatempoh','api_url','cawangan_info'));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function rekodblast(Request $request){
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
|
||||
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$rekodblast = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/rekodblast/'. $auth_user['cawangan'])->json();
|
||||
return view('khazanah.laporan.rekodblast',compact('cawangan_info','api_url','rekodblast'));
|
||||
}
|
||||
|
||||
public function rekodblastexport(Request $request){
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
|
||||
$cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
|
||||
if($request->type == 'pdf')
|
||||
{
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$rekodblast = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/rekodblast/'. $auth_user['cawangan'])->json();
|
||||
return view('pdf.pdf_rekodblast', compact('cawangan_info','api_url','rekodblast','cawangan_detail','tarikh_cetak'));
|
||||
}
|
||||
}
|
||||
|
||||
public function rekodblastsms(Request $request){
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
|
||||
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$rekodblastsms = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/rekodblastsms/'. $auth_user['cawangan'])->json();
|
||||
return view('khazanah.laporan.rekodblastsms',compact('cawangan_info','api_url','rekodblastsms'));
|
||||
}
|
||||
|
||||
public function rekodblastsmsexport(Request $request){
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
|
||||
$cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
|
||||
if($request->type == 'pdf')
|
||||
{
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$rekodblastsms = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/rekodblastsms/'. $auth_user['cawangan'])->json();
|
||||
return view('pdf.pdf_rekodblastsms', compact('cawangan_info','api_url','rekodblastsms','cawangan_detail','tarikh_cetak'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user