This commit is contained in:
afiq
2021-02-13 15:14:48 +08:00
parent 70b7bde6c0
commit bb56ac1bbc
11 changed files with 133 additions and 130 deletions
@@ -6,7 +6,6 @@ namespace App\Http\Controllers;
//Events
use App\Events\OperasiNotice;
use App\Events\StatusLiked;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http;
@@ -135,37 +134,4 @@ class OperasiController extends Controller
return view('operasi.hargaemas',compact('cawangan_info','api_url','harga_emas'));
}
public function createhargaemas(Request $request)
{
$auth_user = Auth::user();
$api_url = config('api.url');
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
$harga_emas = Http::get(config('api.url') . '/api/harga_emas/')->json();
$kemaskini = Http::post(config('api.url') . '/api/harga_emas/create/',[
'karat' => $request->karat,
'keterangan'=> $request->keterangan,
'harga' => $request->harga,
'harga2' => $request->harga
])->json();
return redirect('/operasi/hargaemas');
}
public function updatehargaemas(Request $request)
{
$auth_user = Auth::user();
$api_url = config('api.url');
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
$harga_emas = Http::get(config('api.url') . '/api/harga_emas/')->json();
$kemaskini = Http::put(config('api.url') . '/api/harga_emas/update/',[
"recno" => $request->recno,
"harga" => $request->harga
])->json();
return redirect('/operasi/hargaemas');
}
}
+6 -2
View File
@@ -244,7 +244,9 @@ async function openuptambahdanserah(e)
input: 'text',
inputPlaceholder: 'Amaun',
confirmButtonText: 'Terima',
allowOutsideClick: false
showCancelButton:true,
cancelButtonText:'Batal',
allowOutsideClick: true
})
if (amaun) {
@@ -289,7 +291,9 @@ async function openuptambahdanserah(e)
input: 'text',
inputPlaceholder: 'Amaun',
confirmButtonText: 'Terima',
allowOutsideClick: false
showCancelButton:true,
cancelButtonText:'Batal',
allowOutsideClick: true
})
if (amaun) {
+2 -2
View File
@@ -527,7 +527,7 @@
});
$.ajax({
method:'get',
url:api_url + '/api/gadai/norujukan/'+histid,
url: api_url + '/api/gadai/norujukan/'+histid,
success:function(gadai){
rekodasal(gadai);
}
@@ -557,7 +557,7 @@
});
$.ajax({
method: 'get',
url: api + '/api/transaction/' + histid,
url: api_url + '/api/transaction/' + histid,
success: function(data){
historybayarantable(data);
}
+13 -22
View File
@@ -149,7 +149,7 @@
</div>
<div class="modal-body">
<form action="" id="maklumat_marhun" method="post">
<div class="row">
<div class="row justify-content-center">
<div class="col-md-6">
<div class="form-group row">
<input type="hidden" name="kodcaw" id="kodcaw" value="">
@@ -191,21 +191,7 @@
<div class="col-md-8"><input class="form-control" type="text" name="jumlah_nilai_marhun" id="jumlah_nilai_marhun" readonly></div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<div class="col-md-12">
<img style="width:200px" src="{{ asset('img/logo_arrahn_baru.png') }}" alt="">
</div>
</div>
<div class="row">
<div class="form-group row" style="margin-right:auto;margin-left:auto">
<button class="btn btn-primary mr-2">KAMERA</button>
<button class="btn btn-primary">MUAT NAIK</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<div class="form-group row">
<input class="btn btn-primary mr-2" type="button" name="tambah_marhun" id="tambah_marhun" value="Tambah">
@@ -368,6 +354,7 @@
total_nilai_marhun = total_nilai_marhun + Number(marhun_detail['n_marhun']);
total_berat = total_berat + Number(marhun_detail['berat']);
marhun_details = marhun_details + marhun_detail['bil'] + " " + marhun_detail['marhun'] +",";
jumlah_nilai_marhun += Number(marhun_detail['n_marhun']);
tablemarhun.row.add([
counter,
marhun_detail['recno'],
@@ -379,12 +366,12 @@
marhun_detail['harga'],
"<div class='buttonpunya text-center'><button onclick='editmarhun(this)' class='btn btn-primary'><i class='fas fa-edit'></i></button> <button onclick='deletemarhun(this)' class='btn btn-danger'><i class='fas fa-trash-alt'></i></button></div>"
]).draw();
count++;
counter = counter + 1;
});
});
$('#bilangan_marhun').val(formatter.format(counter-1));
$('#jumlah_nilai_marhun').val(formatter.format(jumlah_nilai_marhun));
if (count == 1){
$('.buttonpunya').html("<button onclick='editmarhun(this)' class='btn btn-primary'><i class='fas fa-edit'></i></button>");
}
@@ -515,6 +502,7 @@
var berat_emas = $('#berat_emas').val();
var harga = $('#harga').val();
var nilaimarhun = $('#nilai_marhun').val();
var bilangan_marhun_daftar = Number($('#bilangan_marhun').val());
var nilai_marhun = Number(nilaimarhun.replace(/[^0-9.-]+/g,""));
var nota_array = $('#nota').val();
if(nota_array != null){
@@ -554,7 +542,7 @@
event.preventDefault();
return false;
}else{
if(jumlah_marhun<10){
if(bilangan_marhun_daftar<10){
$.ajax({
method:'POST',
url: api_url + '/api/marhun/'+kodcaw,
@@ -619,6 +607,7 @@
var berat_emas = $('#berat_emas').val();
var harga = $('#harga').val();
var nilaimarhun = $('#nilai_marhun').val();
var bilangan_marhun_daftar = Number($('#bilangan_marhun').val());
var nilai_marhun = Number(nilaimarhun.replace(/[^0-9.-]+/g,""));
var nota_array = $('#nota').val();
console.log($.isNumeric(berat_emas));
@@ -655,7 +644,7 @@
event.preventDefault();
return false;
}else{
if(jumlah_marhun < 10){
if(bilangan_marhun_daftar < 10){
$.ajax({
method:'POST',
url: api_url + '/api/marhun/'+kodcaw,
@@ -711,6 +700,7 @@
function verifyGadai(func){
$("#terima_gadai").prop('disabled', true);
var kodcaw = $('#kodcaw').val();
var nokp = $('#nokp').val();
var nopelanggan = $('#nopelanggan').val();
@@ -727,6 +717,7 @@
var max_pinjaman = nilai_marhun_total * 0.80;
if(pinjaman < min_pinjaman){
$("#terima_gadai").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -736,6 +727,7 @@
return false;
}
else if(pinjaman > max_pinjaman){
$("#terima_gadai").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -745,8 +737,7 @@
return false;
}
else{
if(pinjaman > Number(pembiyaan_max_pelulus)+10){
if(pinjaman > Number(pembiyaan_max_pelulus)+10 || pinjaman >=10000){
const swalWithBootstrapButtons = Swal.mixin({
customClass: {
confirmButton: 'btn btn-success',
@@ -756,7 +747,7 @@
})
swalWithBootstrapButtons.fire({
title: 'Dapatkan Pengesahan Daripada Operasi?',
title: 'Dapatkan Pengesahan Operasi',
text: "Tetapan margin melebihi 75% untuk Operasi!",
icon: 'info',
showCancelButton: true,
+14 -6
View File
@@ -607,6 +607,7 @@
});
function verifyGadai(func){
$("#terima_gadai").prop('disabled', true);
event.preventDefault();
var kodcaw = $('#kodcaw').val();
var nokp = $('#nokp').val();
@@ -624,6 +625,7 @@
var max_pinjaman = nilai_marhun_total * 0.80;
if($.isNumeric(pinjaman) == false){
$("#terima_gadai").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -633,6 +635,7 @@
return false;
}
if(pinjaman < min_pinjaman){
$("#terima_gadai").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -641,6 +644,7 @@
event.preventDefault();
return false;
}else if(pinjaman > max_pinjaman){
$("#terima_gadai").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Amaran!',
@@ -655,6 +659,7 @@
success:function(data){
var check_komuditi = Object.keys(data).length;
if(check_komuditi == 0){
$("#terima_gadai").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Unit Komuditi Berbaki Minumum',
@@ -664,6 +669,7 @@
return false;
}else{
if(Number(data['unit_komuditi']) < pinjaman){
$("#terima_gadai").prop('disabled', false);
Swal.fire({
icon: 'error',
title: 'Baki Unit Komuditi Tidak Mencukupi',
@@ -690,11 +696,11 @@
}
swalWithBootstrapButtons.fire({
title: 'Dapatkan Pengesahan Daripada Operasi?',
title: 'Dapatkan Pengesahan Operasi',
text: errortext,
icon: 'info',
showCancelButton: true,
confirmButtonText: 'Setuju!',
confirmButtonText: 'Hantar',
cancelButtonText: 'Batal',
reverseButtons: true
}).then((result) => {
@@ -754,7 +760,7 @@
clearInterval(timerInterval);
Swal.fire({
icon: 'success',
title: 'Anda Berjaya Menerima Pengesahan'
title: 'Telah Disahkan'
}).then(function(){
$(func).attr("onSubmit","return true;");
$(func).submit();
@@ -769,6 +775,7 @@
});
}, 3000);
}else if (result.dismiss === Swal.DismissReason.cancel){
$("#terima_gadai").prop('disabled', false);
swalWithBootstrapButtons.fire(
'Batal',
'Maklumat Gadaian Tidak Berjaya Disimpan',
@@ -788,11 +795,11 @@
});
swalWithBootstrapButtons.fire({
title: 'Dapatkan Pengesahan Daripada Khazanah?',
title: 'Dapatkan Pengesahan Khazanah',
text: "Tetapan margin melebihi 70% untuk Khazanah!",
icon: 'info',
showCancelButton: true,
confirmButtonText: 'Setuju!',
confirmButtonText: 'Hantar',
cancelButtonText: 'Batal',
reverseButtons: true
}).then((result) => {
@@ -853,7 +860,7 @@
clearInterval(timerInterval);
Swal.fire({
icon: 'success',
title: 'Anda Berjaya Menerima Pengesahan'
title: 'Telah Disahkan'
}).then(function(){
$(func).attr("onSubmit","return true;");
@@ -870,6 +877,7 @@
});
}, 3000);
} else if (result.dismiss === Swal.DismissReason.cancel) {
$("#terima_gadai").prop('disabled', false);
swalWithBootstrapButtons.fire(
'Batal',
'Maklumat Gadaian Tidak Berjaya Disimpan',
+2 -2
View File
@@ -94,7 +94,7 @@
console.log(data);
Swal.fire({
icon: 'success',
title: 'Anda Berjaya Mengesahkan Pengesahan'
title: 'Pengesahan Berjaya'
}).then(function(){
location.reload();
@@ -123,7 +123,7 @@
Swal.fire({
icon: 'success',
title: 'Anda Berjaya Mengesahkan Pengesahan'
title: 'Pengesahan Berjaya'
}).then(function(){
location.reload();
});
@@ -14,19 +14,12 @@
<form id="form-pendahuluan" action="{{ route('khazanah.KemaskiniSerahan') }}" method="post">
@csrf
<div class="row">
<div class="row mb-2">
<div class="col-2">Tarikh</div>
<div class="col-3"> <input type="text" class="form-control" id="tarikh" name="tarikh" value="{{ $currdate=date('Y-m-d')}}" /></div>
<div class="col-4"></div> <div class="col-4"></div>
</div>
<br>
<div class="row">
<div class="col-3"><input type="text" class="form-control" id="tarikh" readonly name="tarikh" value="{{ $currdate=date('Y-m-d')}}" /></div>
<div class="col-2">Teller ID </div>
<div class="col-3"><input type="text" class="form-control" name="teller" value="{{ $array_reqteller['kodlaluan'] }}" readonly/></div>
<div class="col-4"></div> <div class="col-4"></div>
</div>
<br>
<input type="hidden" name="no" value="{{ $array_reqteller['no'] }}"/>
@@ -42,9 +35,9 @@
<div class="col-3"> </div>
<div class="col-2"> </div>
<div class="col-6">
<button type="button" data-toggle="modal" data-target="#marhunModal" class="btn btn-primary">Panduan Format Bundle</button>
<button type="button" data-toggle="modal" data-target="#marhunModal" class="btn btn-info">Panduan Format Bundle</button>
<input type="button" onclick="triggersubmit();" class="btn btn-primary" value="Terima"/>
<a href="{{ url('/serahan') }}" class="btn btn-primary">Batal</a>
<a href="{{ url('/serahan') }}" class="btn btn-danger">Batal</a>
</div>
</div>
<br>
@@ -61,7 +54,7 @@
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
<h4>Wang Bundle</h4>
<h4>Wang Bundle Dari Peti Besi</h4>
<table class="table table-bordered">
<tr>
<th></th>
@@ -120,7 +113,7 @@
</div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
<h4>Wang Keping</h4>
<h4>Wang Keping Dari Peti Besi</h4>
<table class="table table-bordered">
<tr>
<th></th>
@@ -14,21 +14,12 @@
<form id="form-pendahuluan" action="{{ route('khazanah.kemaskiniPendahuluan') }}" method="post">
@csrf
<div class="row">
<div class="row mb-2">
<div class="col-2">Tarikh</div>
<div class="col-3"> <input type="text" class="form-control" id="tarikh" name="tarikh" value="{{ $currdate=date('Y-m-d')}}" /></div>
<div class="col-4"></div> <div class="col-4"></div>
</div>
<br>
<div class="row">
<div class="col-3"><input type="text" class="form-control" id="tarikh" readonly name="tarikh" value="{{ $currdate=date('Y-m-d')}}" /></div>
<div class="col-2">Teller ID </div>
<div class="col-3"><input type="text" class="form-control" name="teller" value="{{ $array_reqteller['kodlaluan'] }}" readonly/></div>
<div class="col-4"></div> <div class="col-4"></div>
</div>
<br>
<input type="hidden" name="no" value="{{ $array_reqteller['no'] }}"/>
<div class="row">
@@ -43,9 +34,9 @@
<div class="col-3"> </div>
<div class="col-2"> </div>
<div class="col-6">
<button type="button" data-toggle="modal" data-target="#marhunModal" class="btn btn-primary">Panduan Format Bundle</button>
<input type="button" onclick="triggersubmit();" class="btn btn-primary" value="Terima"/>
<a href="{{ url('/pendahuluan') }}" class="btn btn-primary">Batal</a>
<button type="button" data-toggle="modal" data-target="#marhunModal" class="btn btn-info">Panduan Format Bundle</button>
<input type="button" onclick="triggersubmit();" class="btn btn-primary" value="Lulus"/>
<a href="{{ url('/pendahuluan') }}" class="btn btn-danger">Batal</a>
</div>
</div>
<br>
@@ -63,7 +54,7 @@
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
<h4>Wang Bundle</h4>
<h4>Wang Bundle Dari Peti Besi</h4>
<table class="table table-bordered">
<tr>
<th></th>
@@ -122,7 +113,7 @@
</div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
<h4>Wang Keping</h4>
<h4>Wang Keping Dari Peti Besi</h4>
<table class="table table-bordered">
<tr>
<th></th>
+6 -12
View File
@@ -8,8 +8,6 @@
<span aria-hidden="true">&times;</span>
</button>
</div>
<form id="kemaskinihargala" method="post" action="{{ route('hargaemas.update') }}">
@csrf
<div class="modal-body">
<input type="hidden" name="recno" id="recno"/>
<label>Karat</label>
@@ -23,9 +21,8 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger btn-lg" data-dismiss="modal">Batal</button>
<button type="submit" class="btn btn-success btn-lg">Terima</button>
<button type="button" class="btn btn-success btn-lg" id="terima_emas">Terima</button>
</div>
</form>
</div>
</div>
</div>
@@ -40,24 +37,21 @@
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form method="post" action="{{ route('hargaemas.create') }}">
@csrf
<div class="modal-body">
<label>Karat</label>
<input name="karat" class="form-control"/>
<input name="karat" id="karat_baru" class="form-control"/>
<label>Keterangan</label>
<input name="keterangan" class="form-control"/>
<input name="keterangan" id="keterangan_baru" class="form-control"/>
<label>Harga</label>
<input name="harga" class="form-control"/>
<input name="harga" id="harga_baru" class="form-control"/>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger btn-lg" data-dismiss="modal">Batal</button>
<button type="submit" class="btn btn-success btn-lg">Terima</button>
<button type="submit" class="btn btn-success btn-lg" id="terima_emas_baru">Terima</button>
</div>
</form>
</div>
</div>
</div>
+59 -2
View File
@@ -36,7 +36,6 @@
<td>{{ $he['tarikhupdate'] }}</td>
<td class="text-center">
<a href="#" onclick="editharga(this)" data-recno="{{ $he['recno'] }}" class="btn btn-primary"><i class="fas fa-edit"></i></a>
<a href="#" onclick="hapusharga(this)" data-recno="{{ $he['recno'] }}" class="btn btn-danger"><i class="fas fa-trash-alt"></i></a>
</td>
</tr>
@endforeach
@@ -60,8 +59,66 @@
let api_url = "{{ $api_url }}";
var tableemas = $('#table-emas').DataTable({
"scrollX": true
"scrollX": true
});
$('#terima_emas').on('click',function(){
$('#kemaskiniHargaModal').modal('hide');
var recno = $('#recno').val();
var harga = $('#harga').val();
$.ajax({
method:'put',
datatype:'json',
url: api_url + '/api/harga_emas/update',
data:{
'recno': recno,
'harga': harga
},
success:function(data){
if(data == 1){
Swal.fire(
'Berjaya!',
'Harga Emas Berjaya Dikemaskini',
'success'
).then(function(){
location.reload();
});
}
}
});
});
$('#terima_emas_baru').on('click',function(){
$('#createHargaModal').modal('hide');
var karat = $('#karat_baru').val();
var harga = $('#harga_baru').val();
var keterangan = $('#keterangan_baru').val();
$.ajax({
method:'post',
datatype:'json',
url: api_url + '/api/harga_emas/create',
data:{
'karat' : karat,
'keterangan': keterangan,
'harga' : harga,
'harga2' : harga
},
success:function(data){
console.log(data);
if(data == 1){
Swal.fire(
'Berjaya!',
'Emas Baru Berjaya Ditambah',
'success'
).then(function(){
location.reload();
});
}
}
});
});
function editharga(e)
+18 -19
View File
@@ -802,8 +802,7 @@
Swal.fire({
icon: 'success',
title: 'Berjaya!',
text: 'You clicked the button!',
footer: '<a href>Why do I have this issue?</a>'
text: 'Penebusan Berjaya',
}).then(function() {
window.open(urlroute, '_blank');
@@ -864,8 +863,8 @@
urlroute = urlroute.replace(':id', norujukan);
Swal.fire(
'Good job!',
'You clicked the button!',
'Berjaya!',
'Bayaran Ansuran Berjaya',
'success'
).then(function() {
window.open(urlroute, '_blank');
@@ -962,8 +961,8 @@
},
success:function(success_data){
Swal.fire(
'Good job!',
'You clicked the button!',
'Berjaya!',
'Bayaran Ansuran Berjaya',
'success'
).then(function() {
window.location.replace("{{ url('customer_info') }}");
@@ -1161,8 +1160,8 @@
console.log(success_data);
Swal.fire(
'Good job!',
'You clicked the button!',
'Berjaya!',
'Tebus Separuh Berjaya',
'success'
) .then(function() {
window.open(urlroute, '_blank');
@@ -1213,7 +1212,7 @@
});
swalWithBootstrapButtons.fire({
title: 'Dapatkan Pengesahan Daripada Khazanah?',
title: 'Dapatkan Pengesahan Khazanah',
text: "Tetapan margin melebihi 70% untuk Khazanah!",
icon: 'info',
showCancelButton: true,
@@ -1277,7 +1276,7 @@
clearInterval(timerInterval);
Swal.fire({
icon: 'success',
title: 'Anda Berjaya Menerima Pengesahan'
title: 'Telah Disahkan'
}).then(function(){
tambahpinjamanfunc();
@@ -1293,8 +1292,8 @@
}, 3000);
} else if (result.dismiss === Swal.DismissReason.cancel) {
swalWithBootstrapButtons.fire(
'Cancelled',
'Your imaginary file is safe :)',
'Gagal',
'Gagal mendapatkan kelulusan khazanah',
'error'
)
}
@@ -1313,7 +1312,7 @@
});
swalWithBootstrapButtons.fire({
title: 'Dapatkan Pengesahan Daripada Operasi?',
title: 'Dapatkan Pengesahan Operasi',
text: "Tetapan margin melebihi 75% untuk Operasi!",
icon: 'info',
showCancelButton: true,
@@ -1376,7 +1375,7 @@
clearInterval(timerInterval);
Swal.fire({
icon: 'success',
title: 'Anda Berjaya Menerima Pengesahan'
title: 'Telah Disahkan'
}).then(function(){
$(func).attr("onSubmit","return true;");
$(func).submit();
@@ -1392,8 +1391,8 @@
}, 3000);
}else if (result.dismiss === Swal.DismissReason.cancel){
swalWithBootstrapButtons.fire(
'Cancelled',
'Your imaginary file is safe :)',
'Gagal',
'Gagal mendapatkan kelulusan operasi',
'error'
)
}
@@ -1495,8 +1494,8 @@
urlroute = urlroute.replace(':id', norujukan);
Swal.fire(
'Good job!',
'You clicked the button!',
'Berjaya!',
'Tambah Pinjaman Berjaya!',
'success'
).then(function() {
window.open(urlroute, '_blank');
@@ -1545,7 +1544,7 @@
allowEnterKey: false,
confirmButtonText: '<i class="fa fa-thumbs-up"></i> Baik Boss!',
icon: 'success',
title: 'Maklumat anda Berjaya Direkodkan!'
title: 'Maklumat Anda Berjaya Direkodkan!'
});
console.log(data.nowakil);