Merge branch 'new-master' of https://gitlab.com/online-sistem1/kaunter into pipiv2
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class updateOnline extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'update:online';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Update Online for every active gadai';
|
||||
|
||||
/**
|
||||
* 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/transaction/online/update')->json();
|
||||
if($updateOnline == 'successful'){
|
||||
return 0;
|
||||
}else{
|
||||
return 'failed';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ class Kernel extends ConsoleKernel
|
||||
protected $commands = [
|
||||
Commands\resetRoleDaily::class,
|
||||
Commands\updateJbg::class,
|
||||
Commands\updateOnline::class,
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -27,6 +28,7 @@ class Kernel extends ConsoleKernel
|
||||
{
|
||||
$schedule->command('reset:dailyrole')->daily()->timezone('Asia/Kuala_Lumpur')->at('00:01');
|
||||
$schedule->command('update:jbg')->daily()->timezone('Asia/Kuala_Lumpur')->at('00:01');
|
||||
$schedule->command('update:online')->daily()->timezone('Asia/Kuala_Lumpur')->everyFifteenMinutes();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -44,12 +44,12 @@ class CustomersController extends Controller
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. Session::get('noic'))->json();
|
||||
if($customers_info){
|
||||
$customer_info = $customers_info[0];
|
||||
}else{
|
||||
$customer_info = $customers_info;
|
||||
}
|
||||
$customer_info = Http::get(config('api.url') . '/api/customers/'. Session::get('noic'))->json();
|
||||
// if($customers_info){
|
||||
// $customer_info = $customers_info[0];
|
||||
// }else{
|
||||
// $customer_info = $customers_info;
|
||||
// }
|
||||
|
||||
$bakilelong = Http::get(config('api.url') . '/api/bakilelong/cawangan/' . $auth_user['cawangan'] . '/' . Session::get('noic') . '/baki')->json();
|
||||
$rugilelong = Http::get(config('api.url') . '/api/bakilelong/cawangan/' . $auth_user['cawangan'] . '/' . Session::get('noic') . '/rugi')->json();
|
||||
@@ -68,13 +68,13 @@ class CustomersController extends Controller
|
||||
$auth_user = Auth::user();
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$bank = Http::get(config('api.url') . '/api/bank')->json();
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
|
||||
$customer_info = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
|
||||
|
||||
if($customers_info){
|
||||
$customer_info = $customers_info[0];
|
||||
}else{
|
||||
$customer_info = $customers_info;
|
||||
}
|
||||
// if($customers_info){
|
||||
// $customer_info = $customers_info[0];
|
||||
// }else{
|
||||
// $customer_info = $customers_info;
|
||||
// }
|
||||
$request->session()->forget('page_reload');
|
||||
$request->session()->forget('norujukan');
|
||||
|
||||
@@ -94,7 +94,7 @@ class CustomersController extends Controller
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $request->icno)->json();
|
||||
|
||||
if(sizeof($customers_info) > 0)
|
||||
return $customers_info[0];
|
||||
return $customers_info;
|
||||
else
|
||||
return "no-data";
|
||||
}
|
||||
@@ -242,7 +242,7 @@ class CustomersController extends Controller
|
||||
|
||||
$nokp = $request->noic_otp;
|
||||
$customer = Http::get(config('api.url'). '/api/customers/'.$nokp)->json();
|
||||
$recipient = '+6'.$customer[0]['telefon'];
|
||||
$recipient = '+6'.$customer['telefon'];
|
||||
//pembinaan token
|
||||
function token($length) {
|
||||
$characters = array(
|
||||
|
||||
@@ -33,7 +33,7 @@ class GadaianController extends Controller
|
||||
$current_day = sprintf("%02d", $current->day);
|
||||
$noic = $request->noic;
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
|
||||
$customer_info = $customers_info[0];
|
||||
$customer_info = $customers_info;
|
||||
$limit_pinjaman_semasa = 0;
|
||||
$auth_user = Auth::user();
|
||||
if($request->session()->get('page_reload') == null){
|
||||
@@ -106,7 +106,7 @@ class GadaianController extends Controller
|
||||
|
||||
$noic = $request->noic;
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $gadaiannorujukan['nokp'])->json();
|
||||
$customer_info = $customers_info[0];
|
||||
$customer_info = $customers_info;
|
||||
|
||||
$limit_pinjaman_semasa = 0;
|
||||
$auth_user = Auth::user();
|
||||
@@ -295,7 +295,7 @@ class GadaianController extends Controller
|
||||
|
||||
}
|
||||
$customer = Http::get(config('api.url') . '/api/customers/'. $gadai_detail['nokp'])->json();
|
||||
$customer_detail = $customer[0];
|
||||
$customer_detail = $customer;
|
||||
|
||||
$marhun = Http::get(config('api.url'). '/api/marhun/'. $norujukan)->json();
|
||||
$marhun_detail = $marhun[0];
|
||||
@@ -326,8 +326,8 @@ class GadaianController extends Controller
|
||||
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json();
|
||||
|
||||
if(sizeof($customers_info) != 0)
|
||||
$customers_info = $customers_info[0];
|
||||
// if(sizeof($customers_info) != 0)
|
||||
// $customers_info = $customers_info[0];
|
||||
|
||||
return view('print.resitansuran',compact('transaction','gadai','customers_info'));
|
||||
}
|
||||
@@ -346,8 +346,8 @@ class GadaianController extends Controller
|
||||
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json();
|
||||
|
||||
if(sizeof($customers_info) != 0)
|
||||
$customers_info = $customers_info[0];
|
||||
// if(sizeof($customers_info) != 0)
|
||||
// $customers_info = $customers_info[0];
|
||||
|
||||
|
||||
return view('print.resitansuran',compact('transaction','gadai','customers_info'));
|
||||
@@ -369,8 +369,8 @@ class GadaianController extends Controller
|
||||
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json();
|
||||
|
||||
if(sizeof($customers_info) != 0)
|
||||
$customers_info = $customers_info[0];
|
||||
// if(sizeof($customers_info) != 0)
|
||||
// $customers_info = $customers_info[0];
|
||||
|
||||
$penebusan = Http::get(config('api.url') . '/api/listpenebusanhistory/' . $auth_user['cawangan'],[ "norujukan" => $id])->json();
|
||||
|
||||
@@ -407,8 +407,8 @@ class GadaianController extends Controller
|
||||
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json();
|
||||
|
||||
if(sizeof($customers_info) != 0)
|
||||
$customers_info = $customers_info[0];
|
||||
// if(sizeof($customers_info) != 0)
|
||||
// $customers_info = $customers_info[0];
|
||||
|
||||
|
||||
$penebusan = Http::get(config('api.url') . '/api/listpenebusanhistory/' . $auth_user['cawangan'],[ "norujukan" => $id])->json();
|
||||
@@ -447,8 +447,8 @@ class GadaianController extends Controller
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json();
|
||||
|
||||
$transaction_keuntungan = Http::get(config('api.url'). '/api/transaksi_keuntungan_latest/'. $id)->json();
|
||||
if(sizeof($customers_info) != 0)
|
||||
$customers_info = $customers_info[0];
|
||||
// if(sizeof($customers_info) != 0)
|
||||
// $customers_info = $customers_info[0];
|
||||
|
||||
|
||||
$penebusan = Http::get(config('api.url') . '/api/listpenebusanhistory/' . $auth_user['cawangan'],[ "norujukan" => $id])->json();
|
||||
@@ -489,8 +489,8 @@ class GadaianController extends Controller
|
||||
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json();
|
||||
|
||||
if(sizeof($customers_info) != 0)
|
||||
$customers_info = $customers_info[0];
|
||||
// if(sizeof($customers_info) != 0)
|
||||
// $customers_info = $customers_info[0];
|
||||
|
||||
|
||||
$penebusan = Http::get(config('api.url') . '/api/listpenebusanhistory/' . $auth_user['cawangan'],[ "norujukan" => $id])->json();
|
||||
@@ -520,8 +520,8 @@ class GadaianController extends Controller
|
||||
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json();
|
||||
|
||||
if(sizeof($customers_info) != 0)
|
||||
$customers_info = $customers_info[0];
|
||||
// if(sizeof($customers_info) != 0)
|
||||
// $customers_info = $customers_info[0];
|
||||
|
||||
|
||||
$penebusan = Http::get(config('api.url') . '/api/listpenebusanhistory/' . $auth_user['cawangan'] ,[ "norujukan" => $id])->json();
|
||||
@@ -559,8 +559,8 @@ class GadaianController extends Controller
|
||||
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json();
|
||||
|
||||
if(sizeof($customers_info) != 0)
|
||||
$customers_info = $customers_info[0];
|
||||
// if(sizeof($customers_info) != 0)
|
||||
// $customers_info = $customers_info[0];
|
||||
|
||||
$advansur = Http::get(config('api.url') . '/api/advansur/'. $auth_user['cawangan'] . '/'. $id)->json();
|
||||
|
||||
@@ -592,8 +592,8 @@ class GadaianController extends Controller
|
||||
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json();
|
||||
|
||||
if(sizeof($customers_info) != 0)
|
||||
$customers_info = $customers_info[0];
|
||||
// if(sizeof($customers_info) != 0)
|
||||
// $customers_info = $customers_info[0];
|
||||
|
||||
|
||||
$penebusan = Http::get(config('api.url') . '/api/listpenebusanhistory/' . $auth_user['cawangan'] ,[ "norujukan" => $id])->json();
|
||||
|
||||
@@ -52,13 +52,13 @@ class KhazanahController extends Controller
|
||||
$auth_user = Auth::user();
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$bank = Http::get(config('api.url') . '/api/bank')->json();
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
|
||||
$customer_info = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
|
||||
|
||||
if($customers_info){
|
||||
$customer_info = $customers_info[0];
|
||||
}else{
|
||||
$customer_info = $customers_info;
|
||||
}
|
||||
// if($customers_info){
|
||||
// $customer_info = $customers_info[0];
|
||||
// }else{
|
||||
// $customer_info = $customers_info;
|
||||
// }
|
||||
$request->session()->forget('page_reload');
|
||||
$request->session()->forget('norujukan');
|
||||
|
||||
@@ -76,12 +76,12 @@ class KhazanahController extends Controller
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$customers_info = Http::get(config('api.url') . '/api/customers/'. Session::get('noic'))->json();
|
||||
if($customers_info){
|
||||
$customer_info = $customers_info[0];
|
||||
}else{
|
||||
$customer_info = $customers_info;
|
||||
}
|
||||
$customer_info = Http::get(config('api.url') . '/api/customers/'. Session::get('noic'))->json();
|
||||
// if($customers_info){
|
||||
// $customer_info = $customers_info[0];
|
||||
// }else{
|
||||
// $customer_info = $customers_info;
|
||||
// }
|
||||
|
||||
$bakilelong = Http::get(config('api.url') . '/api/bakilelong/cawangan/' . $auth_user['cawangan'] . '/' . Session::get('noic') . '/baki')->json();
|
||||
$rugilelong = Http::get(config('api.url') . '/api/bakilelong/cawangan/' . $auth_user['cawangan'] . '/' . Session::get('noic') . '/rugi')->json();
|
||||
|
||||
@@ -23,7 +23,7 @@ class LelongController extends Controller
|
||||
$gadaidetail = Http::get(config('api.url') . '/api/gadai/norujukan/'. $norujukan)->json();
|
||||
$noic = $gadaidetail[0][0]['nokp'];
|
||||
$customerdetail = Http::get(config('api.url') . '/api/customers/'. $noic)->json();
|
||||
$nama = $customerdetail[0]['nama'];
|
||||
$nama = $customerdetail['nama'];
|
||||
|
||||
$lelong = Http::get(config('api.url') . '/api/lelong/cawangan/'. $auth_user['cawangan'] . '/' . $norujukan)->json();
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class PenebusanController extends Controller
|
||||
$marhundetail = Http::get(config('api.url') . '/api/marhun/'. $norujukan)->json();
|
||||
|
||||
$marhun = $marhundetail[0];
|
||||
$nama = $customerdetail[0]['nama'];
|
||||
$nama = $customerdetail['nama'];
|
||||
|
||||
$gadai = $gadaidetail[0][0];
|
||||
|
||||
@@ -945,7 +945,7 @@ class PenebusanController extends Controller
|
||||
$marhundetail = Http::get(config('api.url') . '/api/marhun/'. $norujukan)->json();
|
||||
|
||||
$marhun = $marhundetail[0];
|
||||
$nama = $customerdetail[0]['nama'];
|
||||
$nama = $customerdetail['nama'];
|
||||
|
||||
$gadai = $gadaidetail[0][0];
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
<td>
|
||||
@php
|
||||
$customer_info = Http::get($api_url . '/api/customers/'. $gadaian['nokp'])->json();
|
||||
echo ($customer_info[0]['nama']);
|
||||
echo ($customer_info['nama']);
|
||||
@endphp
|
||||
</td>
|
||||
<td>{{ $gadaian['nokp'] }}</td>
|
||||
@@ -192,8 +192,8 @@
|
||||
@php
|
||||
$customer_info = Http::get($api_url . '/api/customers/'. $gadaian['nokp'])->json();
|
||||
@endphp
|
||||
<td><input type="checkbox" id="checkgadai" autocomplete="off" data-nokp="{{ $gadaian['nokp'] }}" data-nama="{{ $customer_info[0]['nama'] }}" data-norujukan="{{$gadaian['norujukan']}}" data-kodcaw="{{ $gadaian['kodcaw'] }}" data-marhun="{{$gadaian['nilaimarhun']}}"></input></td>
|
||||
<td>{{ $customer_info[0]['nama'] }}</td>
|
||||
<td><input type="checkbox" id="checkgadai" autocomplete="off" data-nokp="{{ $gadaian['nokp'] }}" data-nama="{{ $customer_info['nama'] }}" data-norujukan="{{$gadaian['norujukan']}}" data-kodcaw="{{ $gadaian['kodcaw'] }}" data-marhun="{{$gadaian['nilaimarhun']}}"></input></td>
|
||||
<td>{{ $customer_info['nama'] }}</td>
|
||||
<td>{{ $gadaian['nokp'] }}</td>
|
||||
<td>
|
||||
@php
|
||||
@@ -365,7 +365,7 @@
|
||||
count++;
|
||||
table_rekod_gadaian.row.add([
|
||||
count,
|
||||
rekodcustomer[0]['nama'],
|
||||
rekodcustomer['nama'],
|
||||
rekodgadaian['nokp'],
|
||||
rekodgadaian['norujukan'],
|
||||
rekodgadaian['pinjaman'],
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
dataType: 'json',
|
||||
success:function(datagadaiwithnokp){
|
||||
|
||||
let nama = datagadaiwithnokp[0].nama;
|
||||
let nama = datagadaiwithnokp.nama;
|
||||
|
||||
$('#namalanjut').text(nama);
|
||||
$('#nokplanjut').text(nokp);
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
tabletebus.row.add([
|
||||
counter,
|
||||
tebus['norujukan'],
|
||||
customer[0]['nama'],
|
||||
customer['nama'],
|
||||
gadai[0][0]['nokp'],
|
||||
gadai[0][0]['tempoh'],
|
||||
gadai[0][0]['bakipjm'],
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
total_berat += Number(gadai['berat']);
|
||||
tablegadai.row.add([
|
||||
counter,
|
||||
customer[0]['nama'],
|
||||
customer['nama'],
|
||||
gadai['nokp'],
|
||||
gadai['norujukan'],
|
||||
formatter.format(gadai['pinjaman']),
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
tabletebus.row.add([
|
||||
counter,
|
||||
tebus['norujukan'],
|
||||
customer[0]['nama'] + "<br>" +gadai[0][0]['nokp'],
|
||||
customer['nama'] + "<br>" +gadai[0][0]['nokp'],
|
||||
tebus['nilaimarhun'],
|
||||
tebus['pinjaman'],
|
||||
tebus['bakiupah'],
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
total_bayaran += parseFloat(tebus['bakipjm']);
|
||||
tabletebus.row.add([
|
||||
counter,
|
||||
customer[0]['nama'],
|
||||
customer['nama'],
|
||||
gadai[0][0]['nokp'],
|
||||
tebus['norujukan'],
|
||||
tebus['t_tebus'],
|
||||
|
||||
@@ -131,12 +131,12 @@ function carila()
|
||||
|
||||
$( "#form-display" ).fadeIn( "slow", function() {
|
||||
$('#form-display').show();
|
||||
$('#nama').val(customerdata[0]['nama']);
|
||||
$('#noic1').val(customerdata[0]['kpbaru']);
|
||||
$('#alamat').val(customerdata[0]['alamat1']);
|
||||
$('#notel').val(customerdata[0]['telefon']);
|
||||
$('#notel2').val(customerdata[0]['telefon2']);
|
||||
$('#poskod').val(customerdata[0]['poskod']);
|
||||
$('#nama').val(customerdata['nama']);
|
||||
$('#noic1').val(customerdata['kpbaru']);
|
||||
$('#alamat').val(customerdata['alamat1']);
|
||||
$('#notel').val(customerdata['telefon']);
|
||||
$('#notel2').val(customerdata['telefon2']);
|
||||
$('#poskod').val(customerdata['poskod']);
|
||||
|
||||
|
||||
var poskod = $('#poskod').val();
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
dataType: 'json',
|
||||
success:function(datagadaiwithnokp){
|
||||
|
||||
let nama = datagadaiwithnokp[0].nama;
|
||||
let nama = datagadaiwithnokp.nama;
|
||||
|
||||
$('#namalanjut').text(nama);
|
||||
$('#nokplanjut').text(nokp);
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
$gadai_detail = Http::get($api_url . '/api/gadai/norujukan/'. $item['norujukan'])->json();
|
||||
$customer_detail = Http::get($api_url . '/api/customers/' . $gadai_detail[0][0]['nokp'])->json();
|
||||
|
||||
echo $customer_detail[0]['nama'];
|
||||
echo $customer_detail['nama'];
|
||||
@endphp
|
||||
</td>
|
||||
<td>{{ $gadai_detail[0][0]['nokp'] }}</td>
|
||||
|
||||
@@ -243,10 +243,10 @@
|
||||
<td>
|
||||
@php
|
||||
$customer_detail = Http::get($api_url . '/api/customers/' . $item['nokp'])->json();
|
||||
echo $customer_detail[0]['nama'];
|
||||
echo $customer_detail['nama'];
|
||||
@endphp
|
||||
</td>
|
||||
<td>{{$customer_detail[0]['alamat1']}}</td>
|
||||
<td>{{$customer_detail['alamat1']}}</td>
|
||||
<td>{{ $item['nokp'] }}</td>
|
||||
<td>{{ $item['masa'] }}</td>
|
||||
<td>{{ number_format($item['berat'],2) }}</td>
|
||||
|
||||
@@ -220,7 +220,7 @@
|
||||
$gadai_detail = Http::get($api_url . '/api/gadai/norujukan/'. $item['norujukan'])->json();
|
||||
$customer_detail = Http::get($api_url . '/api/customers/' . $gadai_detail[0][0]['nokp'])->json();
|
||||
|
||||
echo $customer_detail[0]['nama'] . '<br>' . $gadai_detail[0][0]['nokp'] . '<br>' . $customer_detail[0]['alamat1'] . '<br>' . $customer_detail[0]['alamat2'];
|
||||
echo $customer_detail['nama'] . '<br>' . $gadai_detail[0][0]['nokp'] . '<br>' . $customer_detail['alamat1'] . '<br>' . $customer_detail['alamat2'];
|
||||
@endphp
|
||||
</td>
|
||||
<td>{{$item['nilaimarhun']}}</td>
|
||||
|
||||
@@ -249,7 +249,7 @@
|
||||
$gadai_detail = Http::get($api_url . '/api/gadai/norujukan/'. $item['norujukan'])->json();
|
||||
$customer_detail = Http::get($api_url . '/api/customers/' . $gadai_detail[0][0]['nokp'])->json();
|
||||
|
||||
echo $customer_detail[0]['nama'];
|
||||
echo $customer_detail['nama'];
|
||||
@endphp
|
||||
</td>
|
||||
<td>{{$gadai_detail[0][0]['nokp']}}</td>
|
||||
|
||||
Reference in New Issue
Block a user