diff --git a/app/Console/Commands/updateJbg.php b/app/Console/Commands/updateJbg.php
index 4225ef4..14569d3 100644
--- a/app/Console/Commands/updateJbg.php
+++ b/app/Console/Commands/updateJbg.php
@@ -12,7 +12,7 @@ class updateJbg extends Command
*
* @var string
*/
- protected $signature = 'update:jbg';
+ protected $signature = 'update:jbg {--all : all zone} {--1 : update zone 1} {--2 : update zone 2} {--3 : update zone3}';
/**
* The console command description.
@@ -38,13 +38,24 @@ class updateJbg extends Command
*/
public function handle()
{
- $updatejbg = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/updatejbgsemasa')->json();
+ if($this->option('all')){
+ $zone = 'all';
+ }else if($this->option('1')){
+ $zone = '1';
+ }else if ($this->option('2')){
+ $zone = '2';
+ }else if ($this->option('3')){
+ $zone = '3';
+ }
+ $updatejbg = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/updatejbgsemasa',[
+ 'zone' => $zone
+ ])->json();
$updatejbgLelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/updatejbglelong')->json();
$hapusGadaiNull = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/hapus/gadai/null')->json();
if($updatejbg == 'successful'){
- return 0;
+ $this->info('Success');
}else{
- return 'failed';
+ $this->info('Failed');
}
}
}
diff --git a/app/Http/Controllers/GadaianController.php b/app/Http/Controllers/GadaianController.php
index bf62b5b..400c64b 100644
--- a/app/Http/Controllers/GadaianController.php
+++ b/app/Http/Controllers/GadaianController.php
@@ -311,13 +311,20 @@ class GadaianController extends Controller
$marhun = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/marhun/'. $norujukan)->json();
$marhun_detail = $marhun[0];
+ $mutu = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/marhun/mutu/sag',[
+ 'kodcaw' => $auth_user['cawangan'],
+ 'norujukan' => $norujukan
+ ])->json();
+
+ // dd($mutu);
+
$cawangan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/detail/'. $auth_user['cawangan'])->json();
$cawangan_detail = $cawangan[0];
$pembayaran_segera = "https://spare.arrahn.com.my/pembayaransegera";
- return view('print.sag',compact('gadai_detail','customer_detail','marhun_detail','cawangan_detail','api_url','pembayaran_segera','auth_username'));
+ return view('print.sag',compact('gadai_detail','customer_detail','marhun_detail','cawangan_detail','api_url','pembayaran_segera','auth_username','mutu'));
}
public function resit($id)
diff --git a/resources/views/print/sag.blade.php b/resources/views/print/sag.blade.php
index ca5296f..4ed24f9 100644
--- a/resources/views/print/sag.blade.php
+++ b/resources/views/print/sag.blade.php
@@ -5,10 +5,10 @@