From 6a2b78c72cf641ed91c4c346b9aab5f9314e78bb Mon Sep 17 00:00:00 2001 From: afiq Date: Mon, 15 Feb 2021 09:08:19 +0800 Subject: [PATCH] update --- app/Http/Controllers/KhazanahController.php | 5 ++ app/Http/Controllers/KomuditiController.php | 5 ++ app/Http/Controllers/LelongController.php | 5 ++ public/js/main.js | 10 ++- resources/views/customers/info.blade.php | 25 ++++---- resources/views/gadaian/edit.blade.php | 28 ++++++--- resources/views/gadaian/index.blade.php | 22 ++++--- .../views/homepage/penilai/home.blade.php | 18 ++++-- resources/views/khazanah/dashboard.blade.php | 4 +- resources/views/khazanah/gadaian.blade.php | 7 ++- resources/views/khazanah/kelulusan.blade.php | 2 +- .../views/khazanah/pendahuluanserah.blade.php | 2 +- resources/views/operasi/kelulusan.blade.php | 5 +- resources/views/penebusan/index.blade.php | 9 +-- .../views/print/laporanscanbarcode.blade.php | 24 +++---- resources/views/print/sag.blade.php | 62 +++++-------------- 16 files changed, 118 insertions(+), 115 deletions(-) diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index d3b81b3..c4f495f 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -20,6 +20,11 @@ use PDF; class KhazanahController extends Controller { + public function __construct() + { + $this->middleware('auth'); + } + public function index() { $search = false; diff --git a/app/Http/Controllers/KomuditiController.php b/app/Http/Controllers/KomuditiController.php index e4eecc4..7f52ab0 100644 --- a/app/Http/Controllers/KomuditiController.php +++ b/app/Http/Controllers/KomuditiController.php @@ -7,6 +7,11 @@ use Illuminate\Support\Facades\Auth; class KomuditiController extends Controller { + public function __construct() + { + $this->middleware('auth'); + } + public function index(){ $auth_user = Auth::user(); $api_url = config('api.url'); diff --git a/app/Http/Controllers/LelongController.php b/app/Http/Controllers/LelongController.php index 8a8dd52..0c962fb 100644 --- a/app/Http/Controllers/LelongController.php +++ b/app/Http/Controllers/LelongController.php @@ -8,6 +8,11 @@ use Illuminate\Support\Facades\Auth; class LelongController extends Controller { + public function __construct() + { + $this->middleware('auth'); + } + public function lelong(){ $api_url = config('api.url'); $auth_user = Auth::user(); diff --git a/public/js/main.js b/public/js/main.js index b632e87..7584c52 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -107,9 +107,8 @@ function totalkey(datakeyin) $('#' + idkey).val(0); Swal.fire({ icon: 'error', - title: 'Oops...', - text: 'Something went wrong!', - footer: 'Why do I have this issue?' + title: 'Amaran', + text: 'Jumlah Melebihi kadar', }); } else @@ -147,9 +146,8 @@ function kiraan(datakeyin) // $('#' + idkey).val(''); Swal.fire({ icon: 'error', - title: 'Oops...', - text: 'Something went wrong!', - footer: 'Why do I have this issue?' + title: 'Amaran', + text: 'Jumlah denominasi melebihi kadar' }); } else diff --git a/resources/views/customers/info.blade.php b/resources/views/customers/info.blade.php index 37e7e32..0415fdf 100644 --- a/resources/views/customers/info.blade.php +++ b/resources/views/customers/info.blade.php @@ -680,11 +680,11 @@ }); swalWithBootstrapButtons.fire({ - title: 'Dapatkan Pengesahan Daripada Khazanah?', - text: "Ubah Rekod Pelanggan!", + title: 'Dapatkan Pengesahan Khazanah', + text: "Ubah Maklumat Gadaian", icon: 'info', showCancelButton: true, - confirmButtonText: 'Setuju!', + confirmButtonText: 'Hantar', cancelButtonText: 'Batal', reverseButtons: true }).then((result) => { @@ -739,7 +739,7 @@ clearInterval(timerInterval); Swal.fire({ icon: 'success', - title: 'Anda Berjaya Menerima Pengesahan' + title: 'Telah Disahkan' }).then(function(){ var urlroute = '{{ route("gadaian.edit", ":id") }}'; @@ -760,8 +760,8 @@ }, 3000); }else if (result.dismiss === Swal.DismissReason.cancel){ swalWithBootstrapButtons.fire( - 'Cancelled', - 'Your imaginary file is safe :)', + 'Batal', + 'Tidak Berjaya Mendaptkan Pengesahan Khazanah', 'error' ) } @@ -825,11 +825,11 @@ }); swalWithBootstrapButtons.fire({ - title: 'Dapatkan Pengesahan Daripada Khazanah?', + title: 'Dapatkan Pengesahan Khazanah', text: "Hapus Rekod!", icon: 'info', showCancelButton: true, - confirmButtonText: 'Setuju!', + confirmButtonText: 'Hantar', cancelButtonText: 'Batal', reverseButtons: true }).then((result) => { @@ -889,7 +889,7 @@ clearInterval(timerInterval); Swal.fire({ icon: 'success', - title: 'Anda Berjaya Menerima Pengesahan' + title: 'Telah Disahkan' }).then(function(){ if($("input[name='options']:checked").val() == 'belum_tebus'){ $.ajax({ @@ -906,7 +906,7 @@ success:function(batalkomuditi){ swalWithBootstrapButtons.fire( 'Hapus!', - 'Data pelanggan telah dihapuskan.', + 'Maklumat gadaian telah dihapuskan.', 'success' ).then(function(){ location.reload(); @@ -927,7 +927,7 @@ if(data != "Bukan-Tebus"){ swalWithBootstrapButtons.fire( 'Hapus!', - 'Data pelanggan telah dihapuskan.', + 'Maklumat gadaian telah dihapuskan.', 'success' ).then(function () { location.reload(); @@ -1073,7 +1073,7 @@ Swal.fire({ icon: 'success', title: 'Berjaya', - text: 'Anda telah berjaya mengemaskini maklumat pelanggan' + text: 'Berjaya mengemaskini maklumat pelanggan' }) }, error: function (request, status, error) { @@ -1167,7 +1167,6 @@ } }, error: function(xhRequest, ErrorText, thrownError){ - // alert('Gadai Tidak Berjaya'); console.log(xhRequest); } }); diff --git a/resources/views/gadaian/edit.blade.php b/resources/views/gadaian/edit.blade.php index a39f1bc..880e002 100644 --- a/resources/views/gadaian/edit.blade.php +++ b/resources/views/gadaian/edit.blade.php @@ -746,12 +746,19 @@ buttonsStyling: false }) + if(pinjaman > Number(pembiyaan_max_pelulus)+10){ + var errortext = "Tetapan margin melebihi 75% untuk Operasi!"; + } + if(pinjaman >= 10000){ + var errortext = "Pinjaman Melebihi 10000"; + } + swalWithBootstrapButtons.fire({ title: 'Dapatkan Pengesahan Operasi', - text: "Tetapan margin melebihi 75% untuk Operasi!", + text: errortext, icon: 'info', showCancelButton: true, - confirmButtonText: 'Setuju!', + confirmButtonText: 'Hantar', cancelButtonText: 'Batal', reverseButtons: true }).then((result) => { @@ -854,7 +861,7 @@ text: "Tetapan margin melebihi 70% untuk Khazanah!", icon: 'info', showCancelButton: true, - confirmButtonText: 'Setuju!', + confirmButtonText: 'Hantar', cancelButtonText: 'Batal', reverseButtons: true }).then((result) => { @@ -944,13 +951,16 @@ event.preventDefault(); return false; } + else if(pinjaman < 10000){ + Swal.fire({ + icon: 'success', + title: 'Berjaya!', + text: 'Gadaian Berjaya Disimpan' + }); + return true; + } } - Swal.fire({ - icon: 'success', - title: 'Berjaya!', - text: 'Gadaian Berjaya Disimpan' - }); - return true; + } diff --git a/resources/views/gadaian/index.blade.php b/resources/views/gadaian/index.blade.php index dd4d48a..549414f 100644 --- a/resources/views/gadaian/index.blade.php +++ b/resources/views/gadaian/index.blade.php @@ -679,7 +679,7 @@ return false; } else{ - if(pinjaman > Number(pembiyaan_max_pelulus)+10 || pinjaman > 10000){ + if(pinjaman > Number(pembiyaan_max_pelulus)+10 || pinjaman >= 10000){ const swalWithBootstrapButtons = Swal.mixin({ customClass: { confirmButton: 'btn btn-success', @@ -691,7 +691,7 @@ if(pinjaman > Number(pembiyaan_max_pelulus)+10){ var errortext = "Tetapan margin melebihi 75% untuk Operasi!"; } - if(pinjaman > 10000){ + if(pinjaman >= 10000){ var errortext = "Pinjaman Melebihi 10000"; } @@ -888,14 +888,16 @@ event.preventDefault(); return false; } - Swal.fire({ - icon: 'success', - title: 'Berjaya!', - text: 'Gadaian Berjaya Disimpan' - }); - $(func).attr("onSubmit","return true;"); - $(func).submit(); - return true; + else if( pinjaman < 10000){ + Swal.fire({ + icon: 'success', + title: 'Berjaya!', + text: 'Gadaian Berjaya Disimpan' + }); + $(func).attr("onSubmit","return true;"); + $(func).submit(); + return true; + } } } } diff --git a/resources/views/homepage/penilai/home.blade.php b/resources/views/homepage/penilai/home.blade.php index 8552ae3..834a3be 100644 --- a/resources/views/homepage/penilai/home.blade.php +++ b/resources/views/homepage/penilai/home.blade.php @@ -242,6 +242,10 @@ minimumFractionDigits: 2 }); + $('#cetak_sag').on('click',function(){ + location.reload(); + }); + //modal $('#marhunModal').on('show.bs.modal', function(event) { var button = $(event.relatedTarget); // button yg trigger @@ -258,7 +262,7 @@ var bil_count = 0; $.each(arraymarhun,function(index,marhun){ $.each(marhun, function(index2,marhun_detail){ - bil_count++; + var marhun_name; $.ajax({ method:'GET', @@ -268,6 +272,8 @@ marhun:marhun_detail['marhun'] }, success:function(marhun_ajax){ + console.log(index2); + bil_count++; $("#tablemarhun").append("" + bil_count + "" + marhun_ajax['descpt'] +"" + marhun_detail['berat'] +"" + marhun_detail['karat'] +"RM " + marhun_detail['n_marhun'].toLocaleString(undefined,{minimumFractionDigits:2}) +""+ marhun_detail['nota'] +""); } }); @@ -288,6 +294,7 @@ $('#pinjaman_modal1').val(pinjaman); $('#belum_serah').empty(); + var bil_count = 0; $.each(arraymarhun,function(index,marhun){ $.each(marhun, function(index2,marhun_detail){ var marhun_name; @@ -299,7 +306,8 @@ marhun:marhun_detail['marhun'] }, success:function(marhun_ajax){ - $("#belum_serah").append("" + index2 + "" + marhun_ajax['descpt'] +"" + marhun_detail['berat'] +"" + marhun_detail['karat'] +"RM " + marhun_detail['n_marhun'].toLocaleString(undefined,{minimumFractionDigits:2}) +""+ marhun_detail['nota'] +""); + bil_count++; + $("#belum_serah").append("" + bil_count + "" + marhun_ajax['descpt'] +"" + marhun_detail['berat'] +"" + marhun_detail['karat'] +"RM " + marhun_detail['n_marhun'].toLocaleString(undefined,{minimumFractionDigits:2}) +""+ marhun_detail['nota'] +""); } }); }); @@ -364,11 +372,11 @@ }); swalWithBootstrapButtons.fire({ - title: 'Dapatkan Pengesahan Daripada Khazanah?', + title: 'Dapatkan Pengesahan Khazanah', text: "Cetak SAG Semula!", icon: 'info', showCancelButton: true, - confirmButtonText: 'Setuju!', + confirmButtonText: 'Hantar', cancelButtonText: 'Batal', reverseButtons: true }).then((result) => { @@ -423,7 +431,7 @@ clearInterval(timerInterval); Swal.fire({ icon: 'success', - title: 'Anda Berjaya Menerima Pengesahan' + title: 'Telah Disahkan' }).then(function(){ $("#print_submit_belum_serah").submit(); }); diff --git a/resources/views/khazanah/dashboard.blade.php b/resources/views/khazanah/dashboard.blade.php index 8f10eeb..1010337 100644 --- a/resources/views/khazanah/dashboard.blade.php +++ b/resources/views/khazanah/dashboard.blade.php @@ -60,7 +60,7 @@

RM {{ number_format($keseluruhanupahharian,2) }}

-

Upah Hari Ini

+

Keuntungan Hari Ini

@@ -105,7 +105,7 @@

RM {{ number_format($keseluruhanupahterkumpul) }}

-

Upah Terkumpul

+

Keuntungan Terkumpul

diff --git a/resources/views/khazanah/gadaian.blade.php b/resources/views/khazanah/gadaian.blade.php index 88bd206..9fda294 100644 --- a/resources/views/khazanah/gadaian.blade.php +++ b/resources/views/khazanah/gadaian.blade.php @@ -23,7 +23,7 @@ Berat Karat Nilai Marhun - Nota test + Nota @@ -201,7 +201,7 @@ var total_berat = button.data('berat'); $('#jumlah_berat').val(total_berat); - + var bil_count = 0; $('#tablemarhun').empty(); $.each(arraymarhun,function(index,marhun){ $.each(marhun, function(index,marhun_detail){ @@ -214,7 +214,8 @@ marhun:marhun_detail['marhun'] }, success:function(marhun_ajax){ - $("#tablemarhun").append("" + marhun_detail['bil'] + "" + marhun_ajax['descpt'] +"" + marhun_detail['berat'] +"" + marhun_detail['karat'] +"RM " + marhun_detail['n_marhun'].toLocaleString(undefined,{minimumFractionDigits:2}) +""+ marhun_detail['nota'] +""); + bil_count++; + $("#tablemarhun").append("" + bil_count + "" + marhun_ajax['descpt'] +"" + marhun_detail['berat'] +"" + marhun_detail['karat'] +"RM " + marhun_detail['n_marhun'].toLocaleString(undefined,{minimumFractionDigits:2}) +""+ marhun_detail['nota'] +""); } }); }); diff --git a/resources/views/khazanah/kelulusan.blade.php b/resources/views/khazanah/kelulusan.blade.php index c41063b..18e3213 100644 --- a/resources/views/khazanah/kelulusan.blade.php +++ b/resources/views/khazanah/kelulusan.blade.php @@ -37,7 +37,7 @@ {{ $k['norujukan'] }} {{ $k['komen'] }} - {{ $k['pinjaman'] }} + {{ number_format($k['pinjaman'],2) }} {{ $k['nilaimarhun'] }} {{ $k['berat'] }} {{ $k['margin'] }} diff --git a/resources/views/khazanah/pendahuluanserah.blade.php b/resources/views/khazanah/pendahuluanserah.blade.php index f5cb4c8..c95fe04 100644 --- a/resources/views/khazanah/pendahuluanserah.blade.php +++ b/resources/views/khazanah/pendahuluanserah.blade.php @@ -35,7 +35,7 @@
- + Batal
diff --git a/resources/views/operasi/kelulusan.blade.php b/resources/views/operasi/kelulusan.blade.php index e99ac08..21f32bb 100644 --- a/resources/views/operasi/kelulusan.blade.php +++ b/resources/views/operasi/kelulusan.blade.php @@ -35,12 +35,11 @@ @foreach($arraykelulusan as $index=>$k) - {{-- {{ dd($k) }} --}} {{ $k['norujukan'] }} {{ $k['cawangan'] }} {{ $k['komen'] }} - {{ $k['pinjaman'] }} + {{ number_format($k['pinjaman'],2) }} {{ $k['nilaimarhun'] }} {{ $k['berat'] }} {{ $k['margin'] }} @@ -86,7 +85,7 @@ console.log(data); Swal.fire({ icon: 'success', - title: 'Anda Berjaya Mengesahkan Pengesahan' + title: 'Pengesahan Berjaya' }).then(function(){ location.reload(); }); diff --git a/resources/views/penebusan/index.blade.php b/resources/views/penebusan/index.blade.php index 99a5280..e497919 100644 --- a/resources/views/penebusan/index.blade.php +++ b/resources/views/penebusan/index.blade.php @@ -172,7 +172,7 @@
- JUMLAH UPAH(RM) + JUMLAH KEUNTUNGAN(RM)
@@ -1182,6 +1182,7 @@ } else if($('#sltjenistebus').find(":selected").val() == 'P') { + let pinjamanbaru = $('#pinjamanbaru').val(); let jenisbayarantebus = ''; if(tarikhgadai < tarikhtawarruq) { @@ -1216,7 +1217,7 @@ text: "Tetapan margin melebihi 70% untuk Khazanah!", icon: 'info', showCancelButton: true, - confirmButtonText: 'Setuju!', + confirmButtonText: 'Hantar', cancelButtonText: 'Batal', reverseButtons: true }).then((result) => { @@ -1301,7 +1302,7 @@ event.preventDefault(); return false; - }else if(parseFloat($('#basic-addon2').text()) > 75 && parseFloat($('#basic-addon2').text()) <= 80){ + }else if((parseFloat($('#basic-addon2').text()) > 75 && parseFloat($('#basic-addon2').text()) <= 80) || pinjamanbaru >= 10000){ const swalWithBootstrapButtons = Swal.mixin({ customClass: { @@ -1316,7 +1317,7 @@ text: "Tetapan margin melebihi 75% untuk Operasi!", icon: 'info', showCancelButton: true, - confirmButtonText: 'Setuju!', + confirmButtonText: 'Hantar', cancelButtonText: 'Batal', reverseButtons: true }).then((result) => { diff --git a/resources/views/print/laporanscanbarcode.blade.php b/resources/views/print/laporanscanbarcode.blade.php index 27784e6..c9d3d97 100644 --- a/resources/views/print/laporanscanbarcode.blade.php +++ b/resources/views/print/laporanscanbarcode.blade.php @@ -198,6 +198,10 @@ Nilai Marhun Berat + @php + $jumlah_nilai_marhun = 0; + $jumlah_berat = 0; + @endphp @foreach($marhun_serah_petibesi as $item) {{$loop->iteration}} @@ -207,24 +211,20 @@ {{$item['penilai']}} {{$item['teller']}} {{$item['marhun']}} - {{$item['nilaimarhun']}} - {{$item['berat']}} + {{number_format($item['nilaimarhun'],2)}} + {{number_format($item['berat'],2)}} + @php + $jumlah_nilai_marhun += $item['nilaimarhun']; + $jumlah_berat += $item['berat']; + @endphp @endforeach JUMLAH - - @foreach($marhun_serah_petibesi as $item) - {{$item['nilaimarhun'] }} - @endforeach - - - @foreach($marhun_serah_petibesi as $item) - {{$item['berat'] }} - @endforeach - + {{ number_format($jumlah_nilai_marhun,2) }} + {{ number_format($jumlah_berat,2) }} diff --git a/resources/views/print/sag.blade.php b/resources/views/print/sag.blade.php index fa8236a..86e1f29 100644 --- a/resources/views/print/sag.blade.php +++ b/resources/views/print/sag.blade.php @@ -6,10 +6,10 @@