ubah wakil approved
This commit is contained in:
@@ -1264,7 +1264,9 @@ class AliranTunaiController extends Controller
|
||||
Session::put('upahsemasa', $requestupah);
|
||||
|
||||
$requestalirantunai = Http::get(config('api.url') . '/api/GetCurrentTunai/' . $auth_user['cawangan'],['kodlaluan' => Auth::user()->name])->json();
|
||||
|
||||
$masuk = $requestalirantunai['masuk'];
|
||||
$keluar = $requestalirantunai['keluar'];
|
||||
|
||||
$baki = $requestalirantunai['baki'];
|
||||
|
||||
$total = floatval($baki) + floatval($requestupah);
|
||||
|
||||
@@ -757,9 +757,92 @@
|
||||
});
|
||||
}
|
||||
|
||||
function daftarwakilfunction(nokp)
|
||||
function daftarwakil()
|
||||
{
|
||||
$('#nokp').val(nokp);
|
||||
let nopelanggan = $('#nopelangganwakil').val();
|
||||
let nowakil = $('#nowakil').val();
|
||||
let nama = $('#namawakil').val();
|
||||
let hubungan = $('#slthubungan').val();
|
||||
let alamat = $('#alamatwakil').val();
|
||||
let telefon = $('#notelwakil').val();
|
||||
let nota = $('#notawakil').val();
|
||||
let nokp = $('#nokpwakil').val();
|
||||
let norujukan = $('#norujukanwakil').val();
|
||||
|
||||
|
||||
$.ajax({
|
||||
method:'POST',
|
||||
url: "{{ route('wakil.create') }}",
|
||||
data:{
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"nopelanggan" : nopelanggan,
|
||||
"nowakil" : nowakil,
|
||||
"nama" : nama,
|
||||
"hubungan" : hubungan,
|
||||
"alamat" : alamat,
|
||||
"telefon" : telefon,
|
||||
"nota" : nota,
|
||||
"icno" : nokp
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
if(data == 1)
|
||||
{
|
||||
$('#WakilModal').hide();
|
||||
$('#WakilModal').modal('hide');
|
||||
nw = nowakil;
|
||||
Swal.fire({
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false,
|
||||
confirmButtonText: '<i class="fa fa-thumbs-up"></i> Baik Boss!',
|
||||
icon: 'success',
|
||||
title: 'Berjaya Mendaftar Wakil Pelanggan!'
|
||||
}).then(function(){
|
||||
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url: api_url + '/api/ubahwakil/' + kodcaw,
|
||||
data:{ 'nowakil' : nw,
|
||||
'norujukan' : norujukan},
|
||||
success:function(data){
|
||||
|
||||
if(data === 1)
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Berjaya!',
|
||||
text: 'Penukaran Wakil berjaya'
|
||||
}).then(async function(){
|
||||
return true;
|
||||
location.reload();
|
||||
});
|
||||
}else{
|
||||
Swal.fire({
|
||||
icon: 'info',
|
||||
title: 'Pemberitahuan!',
|
||||
text: 'Wakil telah didaftarkan dengan IC tersebut!'
|
||||
}).then(async function(){
|
||||
return true;
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
},error: function (request, status, error) {
|
||||
console.log(request.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function daftarwakilfunction(nokp,norujukan)
|
||||
{
|
||||
$('#nokpwakil').val(nokp);
|
||||
$('#norujukanwakil').val(norujukan);
|
||||
|
||||
$.ajax({
|
||||
method:'GET',
|
||||
@@ -768,9 +851,9 @@
|
||||
success:function(data){
|
||||
|
||||
$('#WakilModal').modal();
|
||||
$('#nama').val('');
|
||||
$('#alamat').val(data['']);
|
||||
$('#notel').val(data['']);
|
||||
$('#namawakil').val('');
|
||||
$('#alamatwakil').val(data['']);
|
||||
$('#notelwakil').val(data['']);
|
||||
|
||||
//get first wakil
|
||||
$.ajax({
|
||||
@@ -786,10 +869,10 @@
|
||||
|
||||
if(data != 'no-data')
|
||||
{
|
||||
$('#nama').val(data['nama']);
|
||||
$('#alamat').val(data['alamat1']);
|
||||
$('#notel').val(data['telefon']);
|
||||
$('#nopelanggan').val(data['nopelanggan']);
|
||||
$('#namawakil').val(data['nama']);
|
||||
$('#alamatwakil').val(data['alamat1']);
|
||||
$('#notelwakil').val(data['telefon']);
|
||||
$('#nopelangganwakil').val(data['nopelanggan']);
|
||||
}
|
||||
|
||||
|
||||
@@ -1021,7 +1104,7 @@
|
||||
icon: 'info',
|
||||
title: 'Maklumat anda tiada dalam senarai wakil! Tekan button Daftar untuk mendaftar!'
|
||||
}).then(function(){
|
||||
daftarwakilfunction(amaun);
|
||||
daftarwakilfunction(amaun,norujukan);
|
||||
});
|
||||
}
|
||||
},error: function(xhr, status, error) {
|
||||
|
||||
@@ -19,14 +19,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="nopelanggan"/>
|
||||
<input type="hidden" id="nopelangganwakil"/>
|
||||
<input type="hidden" id="norujukanwakil"/>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-4">
|
||||
<label>No KP</label>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<input type="text" class="form-control" id="nokp" name="nokp" readonly/>
|
||||
<input type="text" class="form-control" id="nokpwakil" name="nokpwakil" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -35,7 +36,7 @@
|
||||
<label>Nama</label>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" class="form-control" id="nama" name="nama"/>
|
||||
<input type="text" class="form-control" id="namawakil" name="namawakil"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -45,7 +46,7 @@
|
||||
<label>Alamat</label>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" class="form-control" id="alamat" name="alamat"/>
|
||||
<input type="text" class="form-control" id="alamatwakil" name="alamatwakil"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -54,7 +55,7 @@
|
||||
<label>No Tel</label>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<input type="text" class="form-control" id="notel" name="notel"/>
|
||||
<input type="text" class="form-control" id="notelwakil" name="notelwakil"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -63,7 +64,7 @@
|
||||
<label>Nota</label>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" class="form-control" name="nota" id="nota"/>
|
||||
<input type="text" class="form-control" name="notawakil" id="notawakil"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1997,14 +1997,14 @@
|
||||
|
||||
function daftarwakil()
|
||||
{
|
||||
let nopelanggan = $('#nopelanggan').val();
|
||||
let nopelanggan = $('#nopelangganwakil').val();
|
||||
let nowakil = $('#nowakil').val();
|
||||
let nama = $('#nama').val();
|
||||
let nama = $('#namawakil').val();
|
||||
let hubungan = $('#slthubungan').val();
|
||||
let alamat = $('#alamat').val();
|
||||
let telefon = $('#notel').val();
|
||||
let nota = $('#nota').val();
|
||||
let nokp = $('#nokp').val();
|
||||
let alamat = $('#alamatwakil').val();
|
||||
let telefon = $('#notelwakil').val();
|
||||
let nota = $('#notawakil').val();
|
||||
let nokp = $('#nokpwakil').val();
|
||||
|
||||
|
||||
$.ajax({
|
||||
@@ -2052,7 +2052,7 @@
|
||||
|
||||
function daftarfunction(id)
|
||||
{
|
||||
$('#nokp').val(id);
|
||||
$('#nokpwakil').val(id);
|
||||
|
||||
$.ajax({
|
||||
method:'GET',
|
||||
@@ -2061,9 +2061,9 @@
|
||||
success:function(data){
|
||||
|
||||
$('#WakilModal').modal();
|
||||
$('#nama').val('');
|
||||
$('#alamat').val(data['']);
|
||||
$('#notel').val(data['']);
|
||||
$('#namawakil').val('');
|
||||
$('#alamatwakil').val(data['']);
|
||||
$('#notelwakil').val(data['']);
|
||||
|
||||
//get first wakil
|
||||
$.ajax({
|
||||
@@ -2079,10 +2079,10 @@
|
||||
|
||||
if(data != 'no-data')
|
||||
{
|
||||
$('#nama').val(data['nama']);
|
||||
$('#alamat').val(data['alamat1']);
|
||||
$('#notel').val(data['telefon']);
|
||||
$('#nopelanggan').val(data['nopelanggan']);
|
||||
$('#namawakil').val(data['nama']);
|
||||
$('#alamatwakil').val(data['alamat1']);
|
||||
$('#notelwakil').val(data['telefon']);
|
||||
$('#nopelangganwakil').val(data['nopelanggan']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user