diff --git a/.DS_Store b/.DS_Store
index f1757f2..6bde683 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/app/Http/Controllers/AliranTunaiController.php b/app/Http/Controllers/AliranTunaiController.php
index 15451aa..b11525c 100644
--- a/app/Http/Controllers/AliranTunaiController.php
+++ b/app/Http/Controllers/AliranTunaiController.php
@@ -446,7 +446,8 @@ class AliranTunaiController extends Controller
$gadaian = floatval($totalgadai);
if(strtoupper(Auth::user()->name) === 'LELONG'){
- $bakisemasa = $lelongan;
+ $penebusanbarcodescanned = floatval($lelongan);
+ $bakisemasa = floatval($lelongan) - floatval($totalserahan);
}else{
$bakisemasa = floatval($bakiawal) + floatval($totalpendahuluan) + floatval($penebusan) - (floatval($gadaian) + floatval($totalserahan)) - floatval($totaltuntutbaki);
}
diff --git a/app/Http/Controllers/GadaianController.php b/app/Http/Controllers/GadaianController.php
index beb0518..7feb8bb 100644
--- a/app/Http/Controllers/GadaianController.php
+++ b/app/Http/Controllers/GadaianController.php
@@ -334,7 +334,7 @@ class GadaianController extends Controller
public function resitansurans($id)
{
-
+ $auth_user = Auth::user();
$totaltransaction = 0;
$transaction = Http::get(config('api.url') . '/api/transaction/one/'. $id)->json();
@@ -349,8 +349,14 @@ class GadaianController extends Controller
// if(sizeof($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)
diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php
index 8216fa4..b1780d2 100644
--- a/app/Http/Controllers/KhazanahController.php
+++ b/app/Http/Controllers/KhazanahController.php
@@ -1224,7 +1224,6 @@ class KhazanahController extends Controller
]);
return redirect()->route('khazanah.serahan');
-
}
public function kemaskiniPendahuluan(Request $request) //Daftar Pendahuluan kepada Kaunter
@@ -1386,9 +1385,6 @@ class KhazanahController extends Controller
$amount = $request->amt;
-// if($amount>$baki_awal){
-// return redirect()->route('khazanah.serahan')->with('message', 'Jumlah yang dipinta melebihi baki dalam peti besi!.');
-// }else{
$tarikh=$request->tarikh;
$kodlaluan=$request->teller;
@@ -1500,8 +1496,6 @@ class KhazanahController extends Controller
}
- // }
-
$GetLatestBakiTunai=Http::get( config('api.url').'/api/getLatestBaki/'.$auth_user['cawangan'])->json();
$sumBaki=$GetLatestBakiTunai;
@@ -2272,6 +2266,7 @@ class KhazanahController extends Controller
public function pendahuluanserahanHQ(Request $request)
{
+
$auth_user = Auth::user();
$gldetail = Http::post(config('api.url').'/api/gldetailkaunter/'. $auth_user['cawangan'],[
diff --git a/public/.DS_Store b/public/.DS_Store
index 1b9b696..58e9ba1 100644
Binary files a/public/.DS_Store and b/public/.DS_Store differ
diff --git a/public/img/loader.gif b/public/img/loader.gif
new file mode 100644
index 0000000..c73bac1
Binary files /dev/null and b/public/img/loader.gif differ
diff --git a/resources/views/aliran_tunai/index.blade.php b/resources/views/aliran_tunai/index.blade.php
index b1eb289..1db168c 100644
--- a/resources/views/aliran_tunai/index.blade.php
+++ b/resources/views/aliran_tunai/index.blade.php
@@ -295,6 +295,15 @@
function serahankemaskini(data)
{
+ Swal.fire({
+ title: 'Memuatkan...',
+ allowEscapeKey : false,
+ allowOutsideClick: false,
+ didOpen: function () {
+ Swal.showLoading();
+ }
+ });
+
$.ajax({
type: 'get',
url: "{{ route('periksa.alirantunai') }}",
@@ -323,6 +332,15 @@
closeOnClickOutside: false
}).then(function() {
location.reload();
+
+ Swal.fire({
+ title: 'Memuatkan...',
+ allowEscapeKey : false,
+ allowOutsideClick: false,
+ didOpen: function () {
+ Swal.showLoading();
+ }
+ });
});
}else{
@@ -333,6 +351,15 @@
closeOnClickOutside: false
}).then(function() {
location.reload();
+
+ Swal.fire({
+ title: 'Memuatkan...',
+ allowEscapeKey : false,
+ allowOutsideClick: false,
+ didOpen: function () {
+ Swal.showLoading();
+ }
+ });
});
}
}
@@ -345,6 +372,15 @@
function periksaalirantunai()
{
+ Swal.fire({
+ title: 'Memuatkan...',
+ allowEscapeKey : false,
+ allowOutsideClick: false,
+ didOpen: function () {
+ Swal.showLoading();
+ }
+ });
+
$.ajax({
type: 'get',
url: "{{ route('periksa.alirantunai') }}",
@@ -357,6 +393,15 @@
text: 'Aliran tunai selari dengan sistem!'
}).then(function() {
location.reload();
+
+ Swal.fire({
+ title: 'Memuatkan...',
+ allowEscapeKey : false,
+ allowOutsideClick: false,
+ didOpen: function () {
+ Swal.showLoading();
+ }
+ });
});
}else{
@@ -371,6 +416,7 @@
"penebusan" : balasbalik['penebusan']
},
success: function(balas){
+
if(balas == 'berjaya')
{
Swal.fire({
@@ -380,6 +426,15 @@
closeOnClickOutside: false
}).then(function() {
location.reload();
+
+ Swal.fire({
+ title: 'Memuatkan...',
+ allowEscapeKey : false,
+ allowOutsideClick: false,
+ didOpen: function () {
+ Swal.showLoading();
+ }
+ });
});
}else{
@@ -390,6 +445,15 @@
closeOnClickOutside: false
}).then(function() {
location.reload();
+
+ Swal.fire({
+ title: 'Memuatkan...',
+ allowEscapeKey : false,
+ allowOutsideClick: false,
+ didOpen: function () {
+ Swal.showLoading();
+ }
+ });
});
}
diff --git a/resources/views/aliran_tunai/laporan/laporanserahan.blade.php b/resources/views/aliran_tunai/laporan/laporanserahan.blade.php
index bf4396d..1592ef3 100644
--- a/resources/views/aliran_tunai/laporan/laporanserahan.blade.php
+++ b/resources/views/aliran_tunai/laporan/laporanserahan.blade.php
@@ -520,7 +520,7 @@
CATATAN:
Serahan kepada peti besi ialah sebanyak RM
- Baki Tunai Semasa sebanyak RM
+ Baki Tunai Semasa sebanyak RM {{ number_format($totalsemua,2) }}
\ No newline at end of file
diff --git a/resources/views/customers/info.blade.php b/resources/views/customers/info.blade.php
index b150a4e..c55494e 100644
--- a/resources/views/customers/info.blade.php
+++ b/resources/views/customers/info.blade.php
@@ -454,6 +454,12 @@
});
});
+ $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
+ // here is the new selected tab id
+ var selectedTabId = e.target.id;
+
+ });
+
var tablegadai = $('#myTable').DataTable({
"scrollX": true
});
@@ -487,188 +493,209 @@
$.ajax({
method:'get',
- url: api_url + '/api/polis/get/',
+ url: api_url + '/api/check/serah/lelong',
datatype:'json',
data:{
'kodcaw': "{{ $cawangan_info['kodcaw'] }}",
'norujukan': norujukan
},
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({
method:'get',
- url: api_url + '/api/check/serah/gadai',
+ url: api_url + '/api/polis/get/',
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'
- });
+
+ 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({
+ 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..'
+ });
}
}
- });
-
-
+ });
}
@@ -801,40 +828,56 @@
text: 'Sila pilih salah satu SAG'
});
}else{
+
+ Swal.fire({
+ title: 'Memuatkan...',
+ allowEscapeKey : false,
+ allowOutsideClick: false,
+ didOpen: function () {
+ Swal.showLoading()
+ }
+ });
+
$.ajax({
method:'get',
url:'{{ route("gadai.history") }}',
data:{ "norujukan" : histid},
success:function(data)
{
- $('#historytebusModal').modal();
+
historytebustable(data);
+ $.ajax({
+ method: 'get',
+ url: api_url + '/api/transaction/' + histid,
+ success: function(data){
+ historybayarantable(data);
+
+ $.ajax({
+ method:'get',
+ url: api_url + '/api/gadai/norujukan/'+histid,
+ success:function(gadai){
+ rekodasal(gadai);
+
+ $.ajax({
+ method:'get',
+ url: api_url + '/api/ansuran/' + "{{ $cawangan_info['kodcaw'] }}" + '/' + histid,
+ success:function(ansuran){
+ rekodansuran(ansuran);
+
+ Swal.close();
+ $('#historytebusModal').modal();
+ }
+ });
+ }
+ });
+
+ }
+ });
},error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
alert(xhr.responseText);
}
});
- $.ajax({
- method: 'get',
- url: api_url + '/api/transaction/' + histid,
- success: function(data){
- historybayarantable(data);
- }
- });
- $.ajax({
- method:'get',
- url: api_url + '/api/gadai/norujukan/'+histid,
- success:function(gadai){
- rekodasal(gadai);
- }
- });
- $.ajax({
- method:'get',
- url: api_url + '/api/ansuran/' + "{{ $cawangan_info['kodcaw'] }}" + '/' + histid,
- success:function(ansuran){
- rekodansuran(ansuran);
- }
- });
}
}else if($("input[name='options']:checked").val() == 'sudah_tebus'){
let histid = $('input[name="sudahtebus"]:checked').val();
@@ -846,39 +889,53 @@
text: 'Sila pilih salah satu SAG'
});
}else{
+
+ Swal.fire({
+ title: 'Memuatkan...',
+ allowEscapeKey : false,
+ allowOutsideClick: false,
+ didOpen: function () {
+ Swal.showLoading()
+ }
+ });
+
$.ajax({
method:'get',
url:'{{ route("gadai.history") }}',
data:{ "norujukan" : histid},
success:function(data){
- $('#historytebusModal').modal();
historytebustable(data);
+
+ $.ajax({
+ method: 'get',
+ url: api_url + '/api/transaction/' + histid,
+ success: function(data){
+ historybayarantable(data);
+ }
+ });
+ $.ajax({
+ method:'get',
+ url:api_url + '/api/gadai/norujukan/'+histid,
+ success:function(gadai){
+ rekodasal(gadai);
+ }
+ });
+ $.ajax({
+ method:'get',
+ url: api_url + '/api/ansuran/' + "{{ $cawangan_info['kodcaw'] }}" + '/' + histid,
+ success:function(ansuran){
+ rekodansuran(ansuran);
+ }
+ });
+
+ $('#historytebusModal').modal();
+ Swal.close();
+
},error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
alert(xhr.responseText);
}
});
- $.ajax({
- method: 'get',
- url: api_url + '/api/transaction/' + histid,
- success: function(data){
- historybayarantable(data);
- }
- });
- $.ajax({
- method:'get',
- url:api_url + '/api/gadai/norujukan/'+histid,
- success:function(gadai){
- rekodasal(gadai);
- }
- });
- $.ajax({
- method:'get',
- url: api_url + '/api/ansuran/' + "{{ $cawangan_info['kodcaw'] }}" + '/' + histid,
- success:function(ansuran){
- rekodansuran(ansuran);
- }
- });
}
}
}
@@ -1494,14 +1551,154 @@
if($("input[name='options']:checked").val() == 'belum_tebus'){
let test1 = $('input[name="belum"]:checked').closest('tr').children('td:eq(2)').text();
let tarikhgadai2 = new Date(test1);tarikhgadai2.setHours(0, 0, 0, 0);
- if(+harini !== +tarikhgadai2){
- Swal.fire({
- icon: 'error',
- title: 'Amaran',
- text: 'Hapus Gadai Tidak Dibenarkan'
- });
- return false;
+
+ var id = $('.tab-content .active').attr('id');
+ if(id == "nav-tawarruq-tab") {
+ if(+harini !== +tarikhgadai2){
+ Swal.fire({
+ icon: 'error',
+ title: 'Amaran',
+ text: 'Hapus Gadai Tidak Dibenarkan'
+ });
+ return false;
+ }
}
+ else {
+ $.ajax({
+ method:'get',
+ url: api_url + '/api/upahlamatoday/' + kodcaw + '/' + hapusid,
+ success:function(data){
+ console.log(data);
+ if(data == 1){
+
+ const swalWithBootstrapButtons = Swal.mixin({
+ customClass: {
+ confirmButton: 'btn btn-success',
+ cancelButton: 'btn btn-danger'
+ },
+ buttonsStyling: false
+ });
+
+ swalWithBootstrapButtons.fire({
+ title: 'Dapatkan Pengesahan Khazanah',
+ text: "Hapus Upah Lama!",
+ icon: 'info',
+ showCancelButton: true,
+ confirmButtonText: 'Hantar',
+ cancelButtonText: 'Batal',
+ reverseButtons: true
+ }).then((result) => {
+ if(result.isConfirmed) {
+ 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 mohon = "Hapus Upah Lama";
+ let id = hapusid;
+
+ $.ajax({
+ method:'post',
+ url: '{{ route("teller.createkelulusan") }}',
+ data: {
+ "_token": "{{ csrf_token() }}",
+ "norujukan" : id,
+ "mohon" : mohon
+ },
+ success:function(data){
+ },error: function(xhr, status, error) {
+ var err = eval("(" + xhr.responseText + ")");
+ alert(xhr.responseText);
+ }
+ });
+
+ let teller = "{{ Auth::user()->name }}";
+
+ var pusher = new Pusher("{{ env('PUSHER_APP_KEY') }}", {
+ cluster: 'ap1',
+ encrypted: true
+ });
+
+ var channel = pusher.subscribe('notice-ubahhapus');
+ channel.bind('my-ubahhapus', function(data) {
+
+ if(data.norujukan == id && data.teller == teller)
+ {
+ if(data.kelulusan == 'lulus')
+ {
+
+ Swal.fire({
+ icon: 'success',
+ title: 'Telah Disahkan'
+ }).then(function(){
+
+ $.ajax({
+ method:'post',
+ url: api_url + '/api/removeupahlamatoday/' + kodcaw + '/' + id,
+ success:function(data){
+
+ if(data == 1)
+ {
+ swalWithBootstrapButtons.fire(
+ 'Hapus!',
+ 'Maklumat upah lama telah dihapuskan.',
+ 'success'
+ ).then(function(){
+ location.reload();
+ });
+ }else{
+ swalWithBootstrapButtons.fire(
+ 'Hapus!',
+ 'Maklumat Upah lama tidak berjaya untuk dihapuskan.',
+ 'error'
+ ).then(function(){
+ location.reload();
+ });
+ }
+
+
+ },error: function(xhr, status, error) {
+ var err = eval("(" + xhr.responseText + ")");
+ alert(xhr.responseText);
+ }
+ });
+ return true;
+ });
+ }
+ }
+ });
+ }
+ });
+
+
+ return false;
+ }
+ else{
+ Swal.fire({
+ icon: 'error',
+ title: 'Amaran',
+ text: 'Hapus Upah Tidak Dibenarkan'
+ });
+ return false;
+ }
+ },error: function(xhr, status, error) {
+ var err = eval("(" + xhr.responseText + ")");
+ alert(xhr.responseText);
+ }
+ });
+ }
+
+
+ return false;
+
}else if($("input[name='options']:checked").val() == 'sudah_tebus'){
let test = $('input[name="sudahtebus"]:checked').closest('tr').children('td:eq(2)').text();
let tarikhgadai1 = new Date(test);tarikhgadai1.setHours(0, 0, 0, 0);
diff --git a/resources/views/khazanah/alirantunai.blade.php b/resources/views/khazanah/alirantunai.blade.php
index 44da7f9..26e754b 100644
--- a/resources/views/khazanah/alirantunai.blade.php
+++ b/resources/views/khazanah/alirantunai.blade.php
@@ -272,6 +272,13 @@
+ {{--
--}}
+
@@ -300,6 +307,13 @@
+ {{--
--}}
+
@@ -333,6 +347,13 @@
+ {{--
--}}
+
@@ -517,6 +538,15 @@
+
+ {{--
--}}
+
+
@@ -546,6 +576,14 @@
+ {{--
--}}
+
+
@@ -579,6 +617,14 @@
+ {{--
--}}
+
+
diff --git a/resources/views/khazanah/dashboard.blade.php b/resources/views/khazanah/dashboard.blade.php
index 314c8bf..8394c74 100644
--- a/resources/views/khazanah/dashboard.blade.php
+++ b/resources/views/khazanah/dashboard.blade.php
@@ -171,7 +171,7 @@
RM {{ ($dashboard[0]['variasi']) ? number_format((float)$dashboard[0]['variasi'],2) : "0.00" }}
-
Variasi
+
Varian
diff --git a/resources/views/khazanah/laporan/imbangduga.blade.php b/resources/views/khazanah/laporan/imbangduga.blade.php
index e105bc6..d0d8185 100644
--- a/resources/views/khazanah/laporan/imbangduga.blade.php
+++ b/resources/views/khazanah/laporan/imbangduga.blade.php
@@ -16,30 +16,24 @@
@@ -60,6 +54,18 @@
});
+ function loadingmodal()
+ {
+ Swal.fire({
+ title: 'Memuatkan...',
+ allowEscapeKey : false,
+ allowOutsideClick: false,
+ didOpen: function () {
+ Swal.showLoading()
+ }
+ });
+ }
+
@endsection
diff --git a/resources/views/khazanah/laporan/tuntutbaki.blade.php b/resources/views/khazanah/laporan/tuntutbaki.blade.php
index 08255b7..5cd425f 100644
--- a/resources/views/khazanah/laporan/tuntutbaki.blade.php
+++ b/resources/views/khazanah/laporan/tuntutbaki.blade.php
@@ -142,7 +142,6 @@
tb['cajlelong'],
tb['jumlah']
]).draw();
-
counter = counter + 1;
$('#totalcajlelong').text(formatter.format(totalcajlelong));
$('#totaljumlah').text(formatter.format(totaljumlah));
diff --git a/resources/views/khazanah/pendahuluanserahanmain.blade.php b/resources/views/khazanah/pendahuluanserahanmain.blade.php
index 77aa83f..7995ee2 100644
--- a/resources/views/khazanah/pendahuluanserahanmain.blade.php
+++ b/resources/views/khazanah/pendahuluanserahanmain.blade.php
@@ -345,6 +345,8 @@
});
}
+ },error: function(jqXHR, textStatus, errorThrown) {
+ console.log(textStatus, errorThrown);
}
});
}
diff --git a/resources/views/lelongan/index.blade.php b/resources/views/lelongan/index.blade.php
index 1955d43..10445e8 100644
--- a/resources/views/lelongan/index.blade.php
+++ b/resources/views/lelongan/index.blade.php
@@ -253,8 +253,8 @@
}
});
- return false;
-
+ return false;
+
const swalWithBootstrapButtons = Swal.mixin({
customClass: {
confirmButton: 'btn btn-success',
@@ -331,8 +331,6 @@
cluster: 'ap1',
encrypted: true
});
-
- //let teller = "{{ Auth::user()->name }}";
var channel = pusher.subscribe('notice-ubahhapus');
channel.bind('my-ubahhapus', function(data) {
diff --git a/resources/views/modal/wakil.blade.php b/resources/views/modal/wakil.blade.php
index 229b7ae..f40b640 100644
--- a/resources/views/modal/wakil.blade.php
+++ b/resources/views/modal/wakil.blade.php
@@ -16,6 +16,7 @@
+
@@ -28,6 +29,7 @@
+
@@ -37,6 +39,7 @@
+
@@ -47,6 +50,7 @@
+
@@ -56,6 +60,7 @@
+
@@ -65,6 +70,7 @@
+
diff --git a/resources/views/penebusan/index.blade.php b/resources/views/penebusan/index.blade.php
index ee5e4a0..21a7b93 100644
--- a/resources/views/penebusan/index.blade.php
+++ b/resources/views/penebusan/index.blade.php
@@ -2428,6 +2428,17 @@
function wakilfunction(e)
{
let wakil = $('#wakiltxt').val();
+
+ if(wakil === null || wakil === '')
+ {
+ Swal.fire(
+ 'Amaran!',
+ 'Sila masukkan nilai di dalam kotak wakil!',
+ 'error'
+ )
+
+ return false;
+ }
var patternregex = /\s+|[-,\/]/g;
@@ -2449,7 +2460,7 @@
allowOutsideClick: false,
allowEscapeKey: false,
allowEnterKey: false,
- confirmButtonText: ' Daftar Dulu Boss!',
+ confirmButtonText: 'Daftar',
icon: 'info',
title: 'Maklumat anda tiada dalam senarai wakil! Tekan button okay untuk mendaftar!'
}).then(function(){
@@ -2499,90 +2510,236 @@
let nota = $('#notawakil').val();
let nokp = $('#nokpwakil').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){
+ let boolnowakil = false;let boolnama = false;let boolalamat = false;let booltelefon = false;let boolnota = false;let boolnokp = false;
- if(data == 1)
- {
- $('#WakilModal').hide();
- $('#WakilModal').modal('hide');
- nw = nowakil;
- Swal.fire({
- allowOutsideClick: false,
- allowEscapeKey: false,
- allowEnterKey: false,
- confirmButtonText: ' Baik Boss!',
- icon: 'success',
- title: 'Berjaya Mendaftar Wakil Pelanggan!'
- }).then(function(){
- $('#wakiltxt').prop( "disabled", true );
- $('#caribtn').html("Ubah");
- $('#caribtn').attr("onclick","ubahwakil(this)");
-
+ if(nowakil === null || nowakil === '')
+ {
+ $("[name='errornowakil']").show();
+ $("[name='errornowakil']").text("*No wakil tidak dijana lagi!");
+ $("[name='nowakil']").addClass('is-invalid');
- });
+ boolnowakil = true;
+ }else{
+ $("[name='errornowakil']").hide();
+ $("[name='nowakil']").removeClass('is-invalid');
+
+ boolnowakil = false;
+ }
+
+ if(nama === null || nama === '')
+ {
+ $("[name='errornamawakil']").show();
+ $("[name='errornamawakil']").text("*Isikan nama dalam kotak!");
+ $("[name='namawakil']").addClass('is-invalid');
+
+ boolnama = true;
+ }else{
+ $("[name='errornamawakil']").hide();
+ $("[name='namawakil']").removeClass('is-invalid');
+
+ boolnama = false;
+ }
+
+ if(alamat === null || alamat === '')
+ {
+ $("[name='erroralamatwakil']").show();
+ $("[name='erroralamatwakil']").text("*Isikan alamat dalam kotak!");
+ $("[name='alamatwakil']").addClass('is-invalid');
+
+ boolalamat = true;
+ }else{
+ $("[name='erroralamatwakil']").hide();
+ $("[name='alamatwakil']").removeClass('is-invalid');
+
+ boolalamat = false;
+ }
+
+ if(telefon === null || telefon === '')
+ {
+ $("[name='errornotelwakil']").show();
+ $("[name='errornotelwakil']").text("*Isikan telefon dalam kotak!");
+ $("[name='notelwakil']").addClass('is-invalid');
+
+ booltelefon = true;
+ }else{
+ $("[name='errornotelwakil']").hide();
+ $("[name='notelwakil']").removeClass('is-invalid');
+
+ booltelefon = false;
+ }
+
+ if(nota === null || nota === '')
+ {
+ $("[name='errornotawakil']").show();
+ $("[name='errornotawakil']").text("*Isikan nota dalam kotak!");
+ $("[name='notawakil']").addClass('is-invalid');
+
+ boolnota = true;
+ }else{
+ $("[name='errornotawakil']").hide();
+ $("[name='notawakil']").removeClass('is-invalid');
+
+ boolnota = false;
+ }
+
+ if(nokp === null || nokp === '')
+ {
+ $("[name='errornokpwakil']").show();
+ $("[name='errornokpwakil']").text("*Isikan nokp dalam kotak!");
+ $("[name='nokpwakil']").addClass('is-invalid');
+
+ boolnokp = true;
+ }else{
+ $("[name='errornokpwakil']").hide();
+ $("[name='nokpwakil']").removeClass('is-invalid');
+
+ boolnokp = false;
+ }
+
+
+ if(boolnowakil == false && boolnama == false && boolalamat == false && booltelefon == false && boolnota == false && boolnokp == false)
+ {
+ $.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: ' Baik Boss!',
+ icon: 'success',
+ title: 'Berjaya Mendaftar Wakil Pelanggan!'
+ }).then(function(){
+ $('#wakiltxt').prop( "disabled", true );
+ $('#caribtn').html("Ubah");
+ $('#caribtn').attr("onclick","ubahwakil(this)");
+
+
+ });
+ }
+
+ },error: function (request, status, error) {
+ console.log(request.responseText);
}
+ });
+
+ return true;
+
+ }else{
+ return false;
+ }
+
- },error: function (request, status, error) {
- console.log(request.responseText);
- }
- });
}
+ $('#WakilModal').on('hidden.bs.modal', function (e) {
+
+ $("[name='errornowakil']").hide();
+ $("[name='nowakil']").removeClass('is-invalid');
+
+ $("[name='errornamawakil']").hide();
+ $("[name='namawakil']").removeClass('is-invalid');
+
+ $("[name='erroralamatwakil']").hide();
+ $("[name='alamatwakil']").removeClass('is-invalid');
+
+ $("[name='errornotelwakil']").hide();
+ $("[name='notelwakil']").removeClass('is-invalid');
+
+ $("[name='errornotawakil']").hide();
+ $("[name='notawakil']").removeClass('is-invalid');
+
+ $("[name='errornokpwakil']").hide();
+ $("[name='nokpwakil']").removeClass('is-invalid');
+
+ $(this).find(".invalid-feedback").hide();
+
+ });
+
+
function daftarfunction(id)
{
+ let kodcaw = "{{ Auth::user()->cawangan }}";
+
$('#nokpwakil').val(id);
- $.ajax({
+ $.ajax({
method:'GET',
- url: "{{ route('wakil.caricustomer') }}",
- data:{ "icno" : id },
+ // url: "{{ route('wakil.caricustomer') }}",
+ url: api + '/api/customers/' + id,
+ // data:{ "icno" : id },
success:function(data){
- $('#WakilModal').modal();
$('#namawakil').val('');
- $('#alamatwakil').val(data['']);
- $('#notelwakil').val(data['']);
+ $('#alamatwakil').val('');
+ $('#notelwakil').val('');
- //get first wakil
- $.ajax({
- method:'GET',
- url: "{{ route('wakil.first') }}",
- success:function(getfirstwakil)
- {
- let firstwakil = parseInt(getfirstwakil);
-
- $('#nowakil').val(firstwakil+1);
- }
- });
-
- if(data != 'no-data')
+ var size = Object.keys(data).length;
+
+ if(size > 0)
{
$('#namawakil').val(data['nama']);
$('#alamatwakil').val(data['alamat1']);
$('#notelwakil').val(data['telefon']);
$('#nopelangganwakil').val(data['nopelanggan']);
}
-
+
+ //get first wakil
+ $.ajax({
+ method:'GET',
+ // url: "{{ route('wakil.first') }}",
+ url: api + '/api/firstwakil/' + kodcaw,
+ success:function(getfirstwakil)
+ {
+ let firstwakil = parseInt(getfirstwakil);
+
+ $('#nowakil').val(firstwakil+1);
+
+ Swal.close();
+ $('#WakilModal').modal();
+
+ },error: function (request, status, error) {
+ console.log(request.responseText);
+ Swal.close();
+
+ Swal.fire({
+ title: 'Punyai Ralat dalam API wakil...',
+ icon: 'error'
+ });
+
+ }
+ })
},error: function (request, status, error) {
console.log(request.responseText);
}
+ });
+ Swal.fire({
+ title: 'Memuatkan...',
+ allowEscapeKey : false,
+ allowOutsideClick: false,
+ didOpen: function () {
+ Swal.showLoading()
+ }
});
}
diff --git a/resources/views/print/laporan_imbanduga.blade.php b/resources/views/print/laporan_imbanduga.blade.php
index 8bfdfbb..1cae6a0 100644
--- a/resources/views/print/laporan_imbanduga.blade.php
+++ b/resources/views/print/laporan_imbanduga.blade.php
@@ -1,416 +1,394 @@
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
 }})
+
-
+
+
+
+
\ No newline at end of file
diff --git a/resources/views/print/laporan_lejer_am.blade.php b/resources/views/print/laporan_lejer_am.blade.php
index 9a3ef9b..34c6f05 100644
--- a/resources/views/print/laporan_lejer_am.blade.php
+++ b/resources/views/print/laporan_lejer_am.blade.php
@@ -313,7 +313,6 @@
-
diff --git a/resources/views/print/laporan_penebusan.blade.php b/resources/views/print/laporan_penebusan.blade.php
index 9b3f70c..c7bf612 100644
--- a/resources/views/print/laporan_penebusan.blade.php
+++ b/resources/views/print/laporan_penebusan.blade.php
@@ -203,13 +203,14 @@
J Tebus |
Nilai Marhun(RM) |
Pembiayaan(RM) |
+ {{-- Baki Pembiayaan(RM) | --}}
Upah/Keuntungan(RM) |
Bayaran(RM) |
Jumlah(RM) |
@php $counter = 1;$totalnm = 0; $totalbayaran = 0; $totalpinjaman = 0; $totalupah = 0;@endphp
@foreach($tebus as $index=>$item)
- @php $totalbayaran += ($item['jenistebus'] === 'S') ? ($item['pinjaman']+$item['bakiupah']) : $item['bakipjm']; $totalpinjaman += $item['pinjaman']; $totalupah += $item['bakiupah']; $totalnm += $item['nilaimarhun'];@endphp
+ @php $totalbayaran += ($item['jenistebus'] === 'S') ? ($item['pinjaman']+$item['bakiupah']) : $item['bakipjm']; $totalpinjaman += ($item['hargajualan'] != $item['bakihargajualan']) ? $item['gadaibakipjm'] : $item['pinjaman']; $totalupah += $item['bakiupah']; $totalnm += $item['nilaimarhun'];@endphp
@if($index > 0)
@if($item['teller'] != $tebus[$index - 1]['teller'])
@@ -240,13 +241,20 @@
|
{{ number_format($item['nilaimarhun'],2) }}
|
- {{ number_format($item['pinjaman'],2) }} |
+ @php
+
+ if($item['hargajualan'] !== $item['bakihargajualan'])
+ echo number_format($item['gadaibakipjm'],2);
+ else
+ echo number_format($item['pinjaman'],2);
+ @endphp |
+ {{-- {{ number_format($item['gadaibakipjm'],2) }} | --}}
{{ number_format($item['bakiupah'],2) }} |
{{ number_format($item['bakipjm'],2) }} |
@php if($item['jenistebus'] == 'S'){ $total=($item['pinjaman']+$item['bakiupah']);echo number_format($total,2);} else echo number_format($item['bakipjm'],2); @endphp |
@php $counter++; @endphp
- @php $totalnmteller += $item['nilaimarhun']; $totalpinjamanteller += $item['pinjaman'];$totalupahteller += $item['bakiupah'];$totalbayaranteller += $item['bakipjm']; @endphp
+ @php $totalnmteller += $item['nilaimarhun']; $totalpinjamanteller += ($item['hargajualan'] != $item['bakihargajualan']) ? $item['gadaibakipjm'] : $item['pinjaman'];$totalupahteller += $item['bakiupah'];$totalbayaranteller += $item['bakipjm']; @endphp
@php $totaljumlahteller += ($item['jenistebus'] === 'S') ? ($item['pinjaman']+$item['bakiupah']) : $item['bakipjm']; @endphp
@if($index+1 < sizeof($tebus))
@if($item['teller'] != $tebus[$index + 1]['teller'])
diff --git a/resources/views/print/laporan_ringkasanharian.blade.php b/resources/views/print/laporan_ringkasanharian.blade.php
index 01b23c6..959667b 100644
--- a/resources/views/print/laporan_ringkasanharian.blade.php
+++ b/resources/views/print/laporan_ringkasanharian.blade.php
@@ -114,7 +114,7 @@
{{ 'RM '. number_format($laporan['panjar_harian'],2) }}
2. BULANAN
{{ 'RM '. number_format($laporan['panjar_bulanan'],2) }}
- 3. TERKUMPUL
+ 3. TERKUMPUL (TAHUNAN)
{{ 'RM '. number_format($laporan['panjar_tahunan'],2) }}
diff --git a/resources/views/print/resitansuran.blade.php b/resources/views/print/resitansuran.blade.php
index 6bda936..a1d4c9e 100644
--- a/resources/views/print/resitansuran.blade.php
+++ b/resources/views/print/resitansuran.blade.php
@@ -394,11 +394,11 @@ hr.new5 {
- | Nama Wakil | : | | | | | |
+ Nama Wakil | : @php if(sizeof($wakil) != 0){ echo $wakil['nama'];} else echo ''; @endphp | | | | | |
- | No K/P Wakil | : | | | | | |
+ No K/P Wakil | : @php if(sizeof($wakil) != 0) echo $wakil['nokp']; else echo ''; @endphp | | | | | |
diff --git a/routes/web.php b/routes/web.php
index 34cb0d3..91d4a77 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -68,7 +68,7 @@ Route::get('/daftar_marhun',['as'=>'daftar_marhun','uses'=>'MarhunController@ind
Route::get('/penebusan/{norujukan}',['as'=>'penebusan','uses' => 'PenebusanController@index'])->middleware('auth','teller');
Route::get('/lelongan/{norujukan}',['as'=>'lelongan','uses' => 'LelongController@index'])->middleware('auth','teller');
Route::get('/aliran_tunai','AliranTunaiController@index')->middleware('auth','teller');
-Route::get('/aliran_tunai/laporanserahan}',['as'=>'laporan.serahanteller','uses' => 'AliranTunaiController@LaporanSerahan'])->middleware('auth','teller');
+Route::get('/aliran_tunai/laporanserahan',['as'=>'laporan.serahanteller','uses' => 'AliranTunaiController@LaporanSerahan'])->middleware('auth','teller');
Route::put('/aliran_tunai/Gadaian',['as'=>'alirantunai.gadai','uses' => 'AliranTunaiController@alirantunaiGadai'])->middleware('auth','teller');
Route::put('/aliran_tunai/Tebusan',['as'=>'alirantunai.tebus','uses' => 'AliranTunaiController@alirantunaiTebus'])->middleware('auth','teller');
Route::put('/aliran_tunai/advansur',['as'=>'alirantunai.advansur','uses' => 'AliranTunaiController@alirantunaiUpahBknTawarruq'])->middleware('auth','teller');