Merged in feature/kadar-anggota (pull request #403)

enable kadar anggota for all branches
This commit is contained in:
dev_kopkb
2026-08-30 03:55:08 +00:00
2 changed files with 204 additions and 204 deletions
+30 -32
View File
@@ -525,38 +525,36 @@ var api_url = @json($api_url ?? '');
});
// Logik amaran SweetAlert
if("{{ auth()->user()->cawangan }}" == 'X0301'){
if (search === true) {
if (blacklist_search === true) {
Swal.fire({
icon: 'warning',
title: 'Amaran!',
text: 'Pelanggan telah disenarai hitamkan dari Pembiayaan.'
});
}
else if (isAnggota && !isPelanggan) {
Swal.fire({
icon: 'info',
title: 'Anggota Belum Didaftarkan!',
text: 'Pelanggan ini adalah anggota koperasi tetapi belum berdaftar sebagai pelanggan.'
});
}
else if (isPelanggan && !isAnggota) {
Swal.fire({
icon: 'info',
title: 'Pelanggan Bukan Anggota!',
text: 'Pelanggan ini berdaftar tetapi belum menjadi anggota koperasi.'
});
}
else if (!isAnggota && !isPelanggan) {
Swal.fire({
icon: 'info',
title: 'Pelanggan Tiada Dalam Rekod!',
text: 'Sila Daftar Pelanggan.'
});
}
}
}
if (search === true) {
if (blacklist_search === true) {
Swal.fire({
icon: 'warning',
title: 'Amaran!',
text: 'Pelanggan telah disenarai hitamkan dari Pembiayaan.'
});
}
else if (isAnggota && !isPelanggan) {
Swal.fire({
icon: 'info',
title: 'Anggota Belum Didaftarkan!',
text: 'Pelanggan ini adalah anggota koperasi tetapi belum berdaftar sebagai pelanggan.'
});
}
else if (isPelanggan && !isAnggota) {
Swal.fire({
icon: 'info',
title: 'Pelanggan Bukan Anggota!',
text: 'Pelanggan ini berdaftar tetapi belum menjadi anggota koperasi.'
});
}
else if (!isAnggota && !isPelanggan) {
Swal.fire({
icon: 'info',
title: 'Pelanggan Tiada Dalam Rekod!',
text: 'Sila Daftar Pelanggan.'
});
}
}
});
+174 -172
View File
@@ -75,7 +75,8 @@
->json();
@endphp
<input type="text" class="form-control" name="outstanding_semasa"
id="outstanding_semasa" readonly value="{{ number_format($outstanding_semasa, 2) }}">
id="outstanding_semasa" readonly
value="{{ number_format($outstanding_semasa, 2) }}">
</div>
</div>
@@ -157,7 +158,7 @@
<!-- Butang Assign Sebagai Anggota -->
@if (isset($showAssignAnggotaBtn) && $showAssignAnggotaBtn && auth()->user()->cawangan == 'X0301')
@if (isset($showAssignAnggotaBtn) && $showAssignAnggotaBtn)
<div class="m-0 p-2">
<button type="button" class="btn btn-success d-flex align-items-center"
data-noic="{{ $noic }}" onclick="assignAnggota(this)">
@@ -363,31 +364,31 @@
data-toggle="tab" href="#nav-tawarruq" role="tab" aria-controls="nav-tawarruq"
aria-selected="{{ $aria_selected_SAG_baru }}">SAG Baru</a>
<a class="nav-item nav-link {{ $activate_tab_SAG_lama }}" " id="nav-xtawarruq-tab" data-toggle="tab" href="#nav-xtawarruq" role="tab" aria-controls="nav-xtawarruq" aria-selected="{{ $aria_selected_SAG_lama }}"><span id="textnavsag">SAG Lama</span></a>
</div>
</nav>
<div class="tab-content" id="navtawarruqdannottawarruq">
<div class="tab-pane fade {{ $activate_pane_SAG_baru }}" id="nav-tawarruq" role="tabpanel" aria-labelledby="nav-tawarruq-tab">
<table class="table table-striped table-hover" id="myTable">
<thead class="thead-dark">
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Tarikh Pembiayaan</th>
<th>Tarikh Matang</th>
<th>Baki Harga Jualan</th>
<th>Baki Pembiayaan</th>
<th>Margin</th>
<th>Tempoh</th>
<th>Keuntungan</th>
<th>Lelong</th>
</tr>
</thead>
</table>
</div>
<div class="tab-pane fade {{ $activate_pane_SAG_lama }}" id="nav-xtawarruq" role="tabpanel" aria-labelledby="nav-xtawarruq-tab">
<table id="xtawarruq" class="table table-striped table-hover">
<thead class="thead-dark">
{{-- <tr>
</div>
</nav>
<div class="tab-content" id="navtawarruqdannottawarruq">
<div class="tab-pane fade {{ $activate_pane_SAG_baru }}" id="nav-tawarruq" role="tabpanel" aria-labelledby="nav-tawarruq-tab">
<table class="table table-striped table-hover" id="myTable">
<thead class="thead-dark">
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Tarikh Pembiayaan</th>
<th>Tarikh Matang</th>
<th>Baki Harga Jualan</th>
<th>Baki Pembiayaan</th>
<th>Margin</th>
<th>Tempoh</th>
<th>Keuntungan</th>
<th>Lelong</th>
</tr>
</thead>
</table>
</div>
<div class="tab-pane fade {{ $activate_pane_SAG_lama }}" id="nav-xtawarruq" role="tabpanel" aria-labelledby="nav-xtawarruq-tab">
<table id="xtawarruq" class="table table-striped table-hover">
<thead class="thead-dark">
{{-- <tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Tarikh Gadai</th>
@@ -397,139 +398,139 @@
<th>Tempoh</th>
<th>Lelong</th>
</tr> --}}
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Tarikh Pembiayaan</th>
<th>Tarikh Matang</th>
<th>Baki Harga Jualan</th>
<th>Baki Pembiayaan</th>
<th>Margin</th>
<th>Tempoh</th>
<th>Keuntungan</th>
<th>Lelong</th>
</tr>
</thead>
</table>
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Tarikh Pembiayaan</th>
<th>Tarikh Matang</th>
<th>Baki Harga Jualan</th>
<th>Baki Pembiayaan</th>
<th>Margin</th>
<th>Tempoh</th>
<th>Keuntungan</th>
<th>Lelong</th>
</tr>
</thead>
</table>
</div>
</div>
{{-- Sudah Tebus --}}
<table id="dahtebusTable" class="table table-striped table-hover">
<thead class="thead-dark">
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Tarikh Penyelesaian Pembiayaan</th>
<th>Baki Pembiayaan</th>
<th>Margin</th>
<th>Tempoh</th>
</tr>
</thead>
</table>
<table id="lelongTable" class="table table-striped table-hover">
<thead class="thead-dark">
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Tarikh Lelong</th>
<th>Tarikh Tuntut</th>
<th>Pembiayaan</th>
<th>Harga Jual</th>
<th>Jum Tuntut/Bayar</th>
<th>Keuntungan</th>
<th>Caj Lelong</th>
<th>Status Tuntutan</th>
<th>Cetak</th>
</tr>
</thead>
</table>
<div class="text-center">
<button class="btn btn-primary" onclick="ubahfunc(this)" id="button-edit-gadaian">Ubah</button>
<button class="btn btn-primary" onclick="hapusfunc()">Hapus</button>
<button class="btn btn-primary" onclick="histfunc()">Rekod Pembiayaan</button>
<button class="btn btn-primary" onclick="removeansuran(this)" id="button-remove-ansuran">Hapus Ansuran</button>
</div>
</div>
{{-- Sudah Tebus --}}
<table id="dahtebusTable" class="table table-striped table-hover">
<thead class="thead-dark">
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Tarikh Penyelesaian Pembiayaan</th>
<th>Baki Pembiayaan</th>
<th>Margin</th>
<th>Tempoh</th>
</tr>
</thead>
</table>
<table id="lelongTable" class="table table-striped table-hover">
<thead class="thead-dark">
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Tarikh Lelong</th>
<th>Tarikh Tuntut</th>
<th>Pembiayaan</th>
<th>Harga Jual</th>
<th>Jum Tuntut/Bayar</th>
<th>Keuntungan</th>
<th>Caj Lelong</th>
<th>Status Tuntutan</th>
<th>Cetak</th>
</tr>
</thead>
</table>
<div class="text-center">
<button class="btn btn-primary" onclick="ubahfunc(this)" id="button-edit-gadaian">Ubah</button>
<button class="btn btn-primary" onclick="hapusfunc()">Hapus</button>
<button class="btn btn-primary" onclick="histfunc()">Rekod Pembiayaan</button>
<button class="btn btn-primary" onclick="removeansuran(this)" id="button-remove-ansuran">Hapus Ansuran</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="customer_detail" tabindex="-1" aria-labelledby="customer_detailLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="customer_detailLabel">Maklumat Pelanggan</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form id="kemaskiniform">
<div class='row form-group'>
<div class='col-md-6'>
<div class='form-group row col-md-12'>
<div class='col-md-5'>
Nama
<!-- Modal -->
<div class="modal fade" id="customer_detail" tabindex="-1" aria-labelledby="customer_detailLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="customer_detailLabel">Maklumat Pelanggan</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form id="kemaskiniform">
<div class='row form-group'>
<div class='col-md-6'>
<div class='form-group row col-md-12'>
<div class='col-md-5'>
Nama
</div>
<div class='col-md-7'>
<input type="text" readonly name='nama' id='nama' value="{{ $customer_info['nama'] }}" class='form-control'>
</div>
</div>
<div class='col-md-7'>
<input type="text" readonly name='nama' id='nama' value="{{ $customer_info['nama'] }}" class='form-control'>
<div class='form-group row col-md-12'>
<div class='col-md-5'>
No KP
</div>
<div class='col-md-7'>
<input type="text" readonly name='icno' id='icno' value="{{ $customer_info['kpbaru'] ? $customer_info['kpbaru'] : $customer_info['kplama'] }}" class='form-control'>
</div>
</div>
</div>
<div class='form-group row col-md-12'>
<div class='col-md-5'>
No KP
<div class='form-group row col-md-12'>
<div class='col-md-5'>
No Pelanggan
</div>
<div class='col-md-7'>
<input type="text" readonly name='nopelanggan' id='nopelanggan' value="{{ $customer_info['nopelanggan'] }}" class='form-control'>
</div>
</div>
<div class='col-md-7'>
<input type="text" readonly name='icno' id='icno' value="{{ $customer_info['kpbaru'] ? $customer_info['kpbaru'] : $customer_info['kplama'] }}" class='form-control'>
<div class='form-group row col-md-12'>
<div class='col-md-5'>
No Telefon 1
</div>
<div class='col-md-7'>
<input type="text" readonly name='' id='telefon' value="{{ $customer_info['telefon'] ? $customer_info['telefon'] : '' }}" class='form-control'>
<span id="errortelefon" style="color:red;"></span>
</div>
</div>
</div>
<div class='form-group row col-md-12'>
<div class='col-md-5'>
No Pelanggan
<div class='form-group row col-md-12'>
<div class='col-md-5'>
No Telefon 2
</div>
<div class='col-md-7'>
<input type="text" readonly name='telefon2' id='telefon2' value="{{ $customer_info['telefon2'] ? $customer_info['telefon2'] : '' }}" class='form-control'>
<span id="errortelefon2" style="color:red;"></span>
</div>
</div>
<div class='col-md-7'>
<input type="text" readonly name='nopelanggan' id='nopelanggan' value="{{ $customer_info['nopelanggan'] }}" class='form-control'>
</div>
</div>
<div class='form-group row col-md-12'>
<div class='col-md-5'>
No Telefon 1
</div>
<div class='col-md-7'>
<input type="text" readonly name='' id='telefon' value="{{ $customer_info['telefon'] ? $customer_info['telefon'] : '' }}" class='form-control'>
<span id="errortelefon" style="color:red;"></span>
</div>
</div>
<div class='form-group row col-md-12'>
<div class='col-md-5'>
No Telefon 2
</div>
<div class='col-md-7'>
<input type="text" readonly name='telefon2' id='telefon2' value="{{ $customer_info['telefon2'] ? $customer_info['telefon2'] : '' }}" class='form-control'>
<span id="errortelefon2" style="color:red;"></span>
</div>
</div>
<div class='form-group row col-md-12'>
<div class='col-md-5'>
Bank
</div>
<div class='col-md-7'>
@php
$bank = Http::withOptions(['verify' => config('app.api_verify')])
->get($api_url . '/api/bank')
->json();
@endphp
<select class="form-control" name="kodbank" data-placeholder="Pilih Bank" id="kodbank" disabled="true">
<option value="-" selected disabled>-</option>
@foreach ($bank as $banks)
<div class='form-group row col-md-12'>
<div class='col-md-5'>
Bank
</div>
<div class='col-md-7'>
@php
$bank = Http::withOptions(['verify' => config('app.api_verify')])
->get($api_url . '/api/bank')
->json();
@endphp
<select class="form-control" name="kodbank" data-placeholder="Pilih Bank" id="kodbank" disabled="true">
<option value="-" selected disabled>-</option>
@foreach ($bank as $banks)
<option value="{{ $banks['abbreviation'] }}"
{{ $banks['abbreviation'] == $customer_info['kodbank'] ? 'selected' : '' }}>
{{ $banks['name'] }}</option>
@@ -971,7 +972,7 @@
var channel = pusher.subscribe(
'notice-kelulusan');
channel.bind('my-kelulusan', function(
data) {
data) {
if (data.norujukan ==
@@ -995,7 +996,7 @@
},
success: function(
data
) {
) {
location
.reload();
@@ -1004,17 +1005,18 @@
xhr,
status,
error
) {
) {
var err =
eval(
"(" +
xhr
.responseText +
")"
);
);
alert
(xhr
.responseText);
.responseText
);
}
});
});
@@ -1242,7 +1244,7 @@
'RM ' + formatter.format(gadai_detail['bakipjm']),
(((Number(gadai_detail['pinjaman']) / Number(gadai_detail[
'nilaimarhun'])) * 100).toFixed(2)).toLocaleString(
"en-GB") + '%',
"en-GB") + '%',
gadai_detail['tempoh']
]).draw();
} else if (jenistebus == "lelong") {
@@ -1273,7 +1275,7 @@
'<a href="#" onclick="checktuntutbaki(this)" data-norujukan=' +
gadai_detail['norujukan'] + ' data-tarikhtuntut=' +
gadai_detail['trkhtuntut'] + '>' + gadai_detail[
'norujukan'] + '</a>',
'norujukan'] + '</a>',
gadai_detail['t_lelong'],
gadai_detail['trkhtuntut'],
'RM ' + formatter.format(gadai_detail['pinjaman']),
@@ -1290,7 +1292,7 @@
'<a href="#" onclick="checktuntutbaki(this)" data-norujukan=' +
gadai_detail['norujukan'] + ' data-tarikhtuntut=' +
gadai_detail['trkhtuntut'] + '>' + gadai_detail[
'norujukan'] + '</a>',
'norujukan'] + '</a>',
gadai_detail['t_lelong'],
gadai_detail['trkhtuntut'],
'RM ' + formatter.format(gadai_detail['pinjaman']),
@@ -2164,10 +2166,10 @@
cancelButtonText: 'Salah',
reverseButtons: true
}).then((
result) => {
result) => {
if (result
.isConfirmed
) {
) {
$.ajax({
method: 'put',
@@ -2181,11 +2183,11 @@
},
success: function(
data
) {
) {
if (data ===
1
) {
) {
Swal.fire({
icon: 'success',
title: 'Berjaya!',
@@ -2220,7 +2222,7 @@
Swal
.DismissReason
.cancel
) {
) {
PengesahanAkhirWakil
.fire(
'Batal',
@@ -2242,12 +2244,12 @@
daftarwakilfunction
(amaun,
norujukan
);
);
});
}
},
error: function(xhr, status,
error) {
error) {
var err = eval("(" + xhr
.responseText + ")");
alert(xhr.responseText);
@@ -2479,7 +2481,7 @@
success: function(data) {},
error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText +
")");
")");
alert(xhr.responseText);
}
});
@@ -2527,7 +2529,7 @@
location
.reload();
}
);
);
} else {
swalWithBootstrapButtons
.fire(
@@ -2540,7 +2542,7 @@
location
.reload();
}
);
);
}
@@ -2554,10 +2556,10 @@
xhr
.responseText +
")"
);
);
alert(xhr
.responseText
);
);
}
});
return true;
@@ -2716,10 +2718,10 @@
'Maklumat Pembiayaan telah dihapuskan.',
'success'
).then(
function() {
location
.reload();
});
function() {
location
.reload();
});
}
})
},