This commit is contained in:
hafifierahman
2022-01-08 11:01:36 +08:00
23 changed files with 311 additions and 111 deletions
BIN
View File
Binary file not shown.
+48
View File
@@ -0,0 +1,48 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Http;
class initiateTunai extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'initiate:tunai';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Initiate Tunai';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$updateOnline = Http::get(config('api.url') . '/api/initiate/tunai')->json();
if($updateOnline == 'successful'){
return 0;
}else{
return 'failed';
}
}
}
BIN
View File
Binary file not shown.
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Events\Dashboard;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class KomoditiNotify implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $response;
public $cawangan;
public function __construct($response,$cawangan)
{
$this->response = $response;
$this->cawangan = $cawangan;
}
public function broadcastOn()
{
return ['komoditi-notify'];
}
public function broadcastAs()
{
return 'trigger-komoditi';
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Events\Dashboard;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class PelangganNotify implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $response;
public $cawangan;
public function __construct($response,$cawangan)
{
$this->response = $response;
$this->cawangan = $cawangan;
}
public function broadcastOn()
{
return ['pelanggan-notify'];
}
public function broadcastAs()
{
return 'trigger-pelanggan';
}
}
@@ -483,7 +483,7 @@ class AliranTunaiController extends Controller
if(strtoupper(Auth::user()->name) === 'LELONG'){
$penebusanbarcodescanned = floatval($lelongan);
$bakisemasa = floatval($bakiawal) + floatval($lelongan) - floatval($totalserahan);
$bakisemasa = floatval($bakiawal) + floatval($totalpendahuluan) + floatval($lelongan) - floatval($totalserahan);
}else{
$bakisemasa = floatval($bakiawal) + floatval($totalpendahuluan) + floatval($penebusan) - (floatval($gadaian) + floatval($totalserahan)) - floatval($totaltuntutbaki);
}
@@ -118,7 +118,7 @@ class LoginController extends Controller
return response()->json([
'success' => false,
'message' => 'Invalid Email or Password',
], 401);
], 200);
}
}
@@ -13,6 +13,7 @@ use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Auth;
use Twilio\Rest\Client;
use App\Komoditi;
use App\Events\Dashboard\PelangganNotify;
use Carbon\Carbon;
@@ -204,6 +205,7 @@ class CustomersController extends Controller
]);
Session::put('customer_info',$customer_info);
event(new PelangganNotify('lulus',$auth_user['cawangan']));
return redirect()->route('customer_info')->with( ['customer_info' => $customer_info] );
}
@@ -3388,6 +3388,42 @@ class KhazanahController extends Controller
return view('print.laporan_wakil', compact('wakil','cawangan_detail','tarikh_cetak','api_url'));
}
public function laporanSAGHilang()
{
$auth_user = Auth::user();
$api_url = config('api.url');
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
$loopalasan = Http::get(config('api.url') . '/api/lookupalasan/')->json();
return view('khazanah.laporan.saghilang', compact('cawangan_info','api_url','loopalasan'));
}
public function cetakLaporanSAGHilang(Request $request)
{
$api_url = config('api.url');
$auth_user = Auth::user();
$current = Carbon::now();
$current = new Carbon();
$tarikh_cetak = $current->toDateString();
if($request->datesaghilang == null){
$date = $current->toDateString();
}else{
$split_date = explode('-', $request->datesaghilang);
$date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
}
$polis = Http::get(config('api.url'). '/api/polis/laporan/',['kodcaw' => $auth_user['cawangan'], 'alasan' => $request->sltalasan, 'tarikh' => $date])->json();
$cawangan = Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
$cawangan_detail=$cawangan[0];
return view('print.laporan_saghilang', compact('polis','cawangan_detail','date','tarikh_cetak','api_url'));
}
@@ -7,6 +7,7 @@ namespace App\Http\Controllers;
use App\Events\OperasiNotice;
use App\Events\StatusLiked;
use App\Events\NotifikasiKelulusan;
use App\Events\Dashboard\KomoditiNotify;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
@@ -234,4 +235,10 @@ class OperasiController extends Controller
return view('operasi.rekodtelahlulus',compact('cawangan_info','api_url','arraykelulusan'));
}
public function notifyKomoditi()
{
$auth_user = Auth::user();
event(new KomoditiNotify('lulus',$auth_user['cawangan']));
}
}