fix skit2
This commit is contained in:
@@ -334,7 +334,7 @@ class GadaianController extends Controller
|
|||||||
|
|
||||||
public function resitansurans($id)
|
public function resitansurans($id)
|
||||||
{
|
{
|
||||||
|
$auth_user = Auth::user();
|
||||||
$totaltransaction = 0;
|
$totaltransaction = 0;
|
||||||
|
|
||||||
$transaction = Http::get(config('api.url') . '/api/transaction/one/'. $id)->json();
|
$transaction = Http::get(config('api.url') . '/api/transaction/one/'. $id)->json();
|
||||||
@@ -349,8 +349,14 @@ class GadaianController extends Controller
|
|||||||
// if(sizeof($customers_info) != 0)
|
// if(sizeof($customers_info) != 0)
|
||||||
// $customers_info = $customers_info[0];
|
// $customers_info = $customers_info[0];
|
||||||
|
|
||||||
|
$wakil = Http::get(config('api.url') . '/api/getwakil/' . $auth_user['cawangan'] . '/code/' . $penebusan['nowakil'])->json();
|
||||||
|
|
||||||
return view('print.resitansuran',compact('transaction','gadai','customers_info'));
|
// dd($wakil);
|
||||||
|
if(sizeof($wakil) != 0)
|
||||||
|
$wakil = $wakil[0];
|
||||||
|
|
||||||
|
|
||||||
|
return view('print.resitansuran',compact('transaction','gadai','customers_info','wakil'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function resitbelumansurans($id)
|
public function resitbelumansurans($id)
|
||||||
|
|||||||
@@ -670,7 +670,7 @@ class KhazanahController extends Controller
|
|||||||
$updatelulus = Http::put(config('api.url') . '/api/UpdateKelulusan/' . $auth_user['cawangan'] . '/' . $norujukan,[
|
$updatelulus = Http::put(config('api.url') . '/api/UpdateKelulusan/' . $auth_user['cawangan'] . '/' . $norujukan,[
|
||||||
"pengesahan" => "operasi",
|
"pengesahan" => "operasi",
|
||||||
'siri' => $request->siri,
|
'siri' => $request->siri,
|
||||||
'namaoperasi' => $request->namaoperasi
|
"namakhazanah" => $request->namakhazanah
|
||||||
])->json();
|
])->json();
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
@@ -679,7 +679,7 @@ class KhazanahController extends Controller
|
|||||||
"pengesahan" => "operasi",
|
"pengesahan" => "operasi",
|
||||||
'siri' => $request->siri,
|
'siri' => $request->siri,
|
||||||
"pembatalan" => "batal",
|
"pembatalan" => "batal",
|
||||||
'namaoperasi' => $request->namaoperasi
|
"namakhazanah" => $request->namakhazanah
|
||||||
])->json();
|
])->json();
|
||||||
|
|
||||||
event(new NotifikasiKelulusan($norujukan,"batal",$request->siri,$request->komenkelulusan,$request->teller));
|
event(new NotifikasiKelulusan($norujukan,"batal",$request->siri,$request->komenkelulusan,$request->teller));
|
||||||
|
|||||||
@@ -493,188 +493,209 @@
|
|||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method:'get',
|
method:'get',
|
||||||
url: api_url + '/api/polis/get/',
|
url: api_url + '/api/check/serah/lelong',
|
||||||
datatype:'json',
|
datatype:'json',
|
||||||
data:{
|
data:{
|
||||||
'kodcaw': "{{ $cawangan_info['kodcaw'] }}",
|
'kodcaw': "{{ $cawangan_info['kodcaw'] }}",
|
||||||
'norujukan': norujukan
|
'norujukan': norujukan
|
||||||
},
|
},
|
||||||
success:function(data){
|
success:function(data){
|
||||||
|
if(data == 0){
|
||||||
|
|
||||||
|
|
||||||
var count = Object.keys(data).length;
|
|
||||||
|
|
||||||
if(count > 0)
|
|
||||||
{
|
|
||||||
if(data[0].tebus === 0)
|
|
||||||
{
|
|
||||||
const swalWithBootstrapButtons = Swal.mixin({
|
|
||||||
customClass: {
|
|
||||||
confirmButton: 'btn btn-success',
|
|
||||||
cancelButton: 'btn btn-danger mr-1'
|
|
||||||
},
|
|
||||||
buttonsStyling: false
|
|
||||||
});
|
|
||||||
|
|
||||||
swalWithBootstrapButtons.fire({
|
|
||||||
title: 'Dapatkan Pengesahan Khazanah',
|
|
||||||
text: "Surat Akuan Gadaian Hilang!",
|
|
||||||
icon: 'info',
|
|
||||||
showCancelButton: true,
|
|
||||||
confirmButtonText: 'Hantar',
|
|
||||||
cancelButtonText: 'Batal',
|
|
||||||
reverseButtons: true
|
|
||||||
}).then((result) => {
|
|
||||||
if (result.isConfirmed) {
|
|
||||||
|
|
||||||
let komen = "Surat Akuan Gadaian Hilang|" + '-' + "|" + '-' + "|" + '-' + "| Tambah Pinjaman";
|
|
||||||
let teller = "{{ Auth::user()->name }}";
|
|
||||||
|
|
||||||
Swal.fire({
|
|
||||||
title: 'Tunggu Pengesahan Daripada Khazanah.',
|
|
||||||
icon: 'info',
|
|
||||||
width: 600,
|
|
||||||
padding: '3em',
|
|
||||||
background: '#fffff',
|
|
||||||
showCancelButton: false,
|
|
||||||
showConfirmButton: false,
|
|
||||||
allowOutsideClick: false,
|
|
||||||
allowEscapeKey: false,
|
|
||||||
allowEnterKey: false
|
|
||||||
})
|
|
||||||
let siricreated = 0;
|
|
||||||
$.ajax({
|
|
||||||
method:'post',
|
|
||||||
url: "{{ route('khazanah.createkelulusan') }}",
|
|
||||||
data: {
|
|
||||||
"_token": "{{ csrf_token() }}",
|
|
||||||
"norujukan" : norujukan,
|
|
||||||
"komen" : komen,
|
|
||||||
"jumpinjam" : '0.00',
|
|
||||||
"teller" : teller
|
|
||||||
},
|
|
||||||
success:function(data){
|
|
||||||
siricreated = data;
|
|
||||||
},
|
|
||||||
error: function(xhr, status, error) {
|
|
||||||
var err = eval("(" + xhr.responseText + ")");
|
|
||||||
alert(xhr.responseText);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var pusher = new Pusher("{{ env('PUSHER_APP_KEY') }}", {
|
|
||||||
cluster: 'ap1',
|
|
||||||
encrypted: true
|
|
||||||
});
|
|
||||||
|
|
||||||
var channel = pusher.subscribe('notice-kelulusan');
|
|
||||||
channel.bind('my-kelulusan', function(data) {
|
|
||||||
|
|
||||||
|
|
||||||
if(data.norujukan == norujukan && data.siri == siricreated && data.teller == teller)
|
|
||||||
{
|
|
||||||
if(data.kelulusan == 'lulus')
|
|
||||||
{
|
|
||||||
Swal.fire({
|
|
||||||
icon: 'success',
|
|
||||||
title: 'Telah Disahkan'
|
|
||||||
}).then(function(){
|
|
||||||
$.ajax({
|
|
||||||
method:'put',
|
|
||||||
url: api_url + '/api/polis/put/',
|
|
||||||
data: {
|
|
||||||
'kodcaw': "{{ $cawangan_info['kodcaw'] }}",
|
|
||||||
'norujukan': norujukan,
|
|
||||||
'tebus' : 1
|
|
||||||
},
|
|
||||||
success:function(data){
|
|
||||||
location.reload();
|
|
||||||
|
|
||||||
},
|
|
||||||
error: function(xhr, status, error) {
|
|
||||||
var err = eval("(" + xhr.responseText + ")");
|
|
||||||
alert(xhr.responseText);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(data.kelulusan == 'batal')
|
|
||||||
{
|
|
||||||
Swal.fire({
|
|
||||||
icon: 'warning',
|
|
||||||
title: 'Telah Dibatalkan',
|
|
||||||
text: `Komen : ${data.komen}`
|
|
||||||
}).then(function(){
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (result.dismiss === Swal.DismissReason.cancel) {
|
|
||||||
swalWithBootstrapButtons.fire(
|
|
||||||
'Gagal',
|
|
||||||
'Gagal mendapatkan kelulusan khazanah',
|
|
||||||
'error'
|
|
||||||
)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$.ajax({
|
|
||||||
method:'get',
|
|
||||||
url: api_url + '/api/check/serah/gadai',
|
|
||||||
datatype:'json',
|
|
||||||
data:{
|
|
||||||
'kodcaw': "{{ $cawangan_info['kodcaw'] }}",
|
|
||||||
'norujukan': norujukan
|
|
||||||
},
|
|
||||||
success:function(data){
|
|
||||||
if(data == 'true'){
|
|
||||||
window.location = urlpenebusan;
|
|
||||||
}else if(data == 'false'){
|
|
||||||
Swal.fire({
|
|
||||||
icon: 'error',
|
|
||||||
title: 'Amaran',
|
|
||||||
text: 'Gadaian Belum Scan Barcode'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}else{
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method:'get',
|
method:'get',
|
||||||
url: api_url + '/api/check/serah/gadai',
|
url: api_url + '/api/polis/get/',
|
||||||
datatype:'json',
|
datatype:'json',
|
||||||
data:{
|
data:{
|
||||||
'kodcaw': "{{ $cawangan_info['kodcaw'] }}",
|
'kodcaw': "{{ $cawangan_info['kodcaw'] }}",
|
||||||
'norujukan': norujukan
|
'norujukan': norujukan
|
||||||
},
|
},
|
||||||
success:function(data){
|
success:function(data){
|
||||||
if(data == 'true'){
|
|
||||||
window.location = urlpenebusan;
|
var count = Object.keys(data).length;
|
||||||
}else if(data == 'false'){
|
|
||||||
Swal.fire({
|
if(count > 0)
|
||||||
icon: 'error',
|
{
|
||||||
title: 'Amaran',
|
if(data[0].tebus === 0)
|
||||||
text: 'Gadaian Belum Scan Barcode'
|
{
|
||||||
});
|
const swalWithBootstrapButtons = Swal.mixin({
|
||||||
|
customClass: {
|
||||||
|
confirmButton: 'btn btn-success',
|
||||||
|
cancelButton: 'btn btn-danger mr-1'
|
||||||
|
},
|
||||||
|
buttonsStyling: false
|
||||||
|
});
|
||||||
|
|
||||||
|
swalWithBootstrapButtons.fire({
|
||||||
|
title: 'Dapatkan Pengesahan Khazanah',
|
||||||
|
text: "Surat Akuan Gadaian Hilang!",
|
||||||
|
icon: 'info',
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: 'Hantar',
|
||||||
|
cancelButtonText: 'Batal',
|
||||||
|
reverseButtons: true
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
|
||||||
|
let komen = "Surat Akuan Gadaian Hilang|" + '-' + "|" + '-' + "|" + '-' + "| Tambah Pinjaman";
|
||||||
|
let teller = "{{ Auth::user()->name }}";
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: 'Tunggu Pengesahan Daripada Khazanah.',
|
||||||
|
icon: 'info',
|
||||||
|
width: 600,
|
||||||
|
padding: '3em',
|
||||||
|
background: '#fffff',
|
||||||
|
showCancelButton: false,
|
||||||
|
showConfirmButton: false,
|
||||||
|
allowOutsideClick: false,
|
||||||
|
allowEscapeKey: false,
|
||||||
|
allowEnterKey: false
|
||||||
|
})
|
||||||
|
let siricreated = 0;
|
||||||
|
$.ajax({
|
||||||
|
method:'post',
|
||||||
|
url: "{{ route('khazanah.createkelulusan') }}",
|
||||||
|
data: {
|
||||||
|
"_token": "{{ csrf_token() }}",
|
||||||
|
"norujukan" : norujukan,
|
||||||
|
"komen" : komen,
|
||||||
|
"jumpinjam" : '0.00',
|
||||||
|
"teller" : teller
|
||||||
|
},
|
||||||
|
success:function(data){
|
||||||
|
siricreated = data;
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
var err = eval("(" + xhr.responseText + ")");
|
||||||
|
alert(xhr.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var pusher = new Pusher("{{ env('PUSHER_APP_KEY') }}", {
|
||||||
|
cluster: 'ap1',
|
||||||
|
encrypted: true
|
||||||
|
});
|
||||||
|
|
||||||
|
var channel = pusher.subscribe('notice-kelulusan');
|
||||||
|
channel.bind('my-kelulusan', function(data) {
|
||||||
|
|
||||||
|
|
||||||
|
if(data.norujukan == norujukan && data.siri == siricreated && data.teller == teller)
|
||||||
|
{
|
||||||
|
if(data.kelulusan == 'lulus')
|
||||||
|
{
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'success',
|
||||||
|
title: 'Telah Disahkan'
|
||||||
|
}).then(function(){
|
||||||
|
$.ajax({
|
||||||
|
method:'put',
|
||||||
|
url: api_url + '/api/polis/put/',
|
||||||
|
data: {
|
||||||
|
'kodcaw': "{{ $cawangan_info['kodcaw'] }}",
|
||||||
|
'norujukan': norujukan,
|
||||||
|
'tebus' : 1
|
||||||
|
},
|
||||||
|
success:function(data){
|
||||||
|
location.reload();
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
var err = eval("(" + xhr.responseText + ")");
|
||||||
|
alert(xhr.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(data.kelulusan == 'batal')
|
||||||
|
{
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'warning',
|
||||||
|
title: 'Telah Dibatalkan',
|
||||||
|
text: `Komen : ${data.komen}`
|
||||||
|
}).then(function(){
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (result.dismiss === Swal.DismissReason.cancel) {
|
||||||
|
swalWithBootstrapButtons.fire(
|
||||||
|
'Gagal',
|
||||||
|
'Gagal mendapatkan kelulusan khazanah',
|
||||||
|
'error'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$.ajax({
|
||||||
|
method:'get',
|
||||||
|
url: api_url + '/api/check/serah/gadai',
|
||||||
|
datatype:'json',
|
||||||
|
data:{
|
||||||
|
'kodcaw': "{{ $cawangan_info['kodcaw'] }}",
|
||||||
|
'norujukan': norujukan
|
||||||
|
},
|
||||||
|
success:function(data){
|
||||||
|
if(data == 'true'){
|
||||||
|
window.location = urlpenebusan;
|
||||||
|
}else if(data == 'false'){
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Amaran',
|
||||||
|
text: 'Gadaian Belum Scan Barcode'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
$.ajax({
|
||||||
|
method:'get',
|
||||||
|
url: api_url + '/api/check/serah/gadai',
|
||||||
|
datatype:'json',
|
||||||
|
data:{
|
||||||
|
'kodcaw': "{{ $cawangan_info['kodcaw'] }}",
|
||||||
|
'norujukan': norujukan
|
||||||
|
},
|
||||||
|
success:function(data){
|
||||||
|
if(data == 'true'){
|
||||||
|
window.location = urlpenebusan;
|
||||||
|
}else if(data == 'false'){
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Amaran',
|
||||||
|
text: 'Gadaian Belum Scan Barcode'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}else if(data == 1){
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Amaran',
|
||||||
|
text: 'Gadaian Sedang Dilelong..'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user