hapus ansuran extended for audit trail and box comment
This commit is contained in:
@@ -119,6 +119,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">Agama</div>
|
||||
@php
|
||||
$ugama = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/ugama')->json();
|
||||
$ugama = [];
|
||||
@endphp
|
||||
<div class="col-md-8">
|
||||
<select class="form-control" name="agama" id="agama">
|
||||
<option selected value="01">Islam</option>
|
||||
@@ -150,6 +154,10 @@
|
||||
<div class="col-md-4">Umur</div>
|
||||
<div class="col-md-8"><input class="form-control" type="text" name="age" id="age" readonly></div>
|
||||
<div class="col-md-4">Bangsa</div>
|
||||
@php
|
||||
$bangsa = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/bangsa')->json();
|
||||
$bangsa = [];
|
||||
@endphp
|
||||
<div class="col-md-8">
|
||||
<select class="form-control" name="bangsa" id="bangsa">
|
||||
<option value="M">Melayu</option>
|
||||
|
||||
@@ -2778,7 +2778,7 @@
|
||||
|
||||
|
||||
try{
|
||||
let response = await getKelulusanKhazanahOperasi('Hapus Ansuran',ansid);
|
||||
let response = await getKelulusanKhazanahOperasi('Hapus Ansuran',ansid,ansuranlatest);
|
||||
let pusherresponse = await PusherResponse(ansid,response,ansuranlatest['created_at'],ansuranlatest['id']);
|
||||
|
||||
}catch(error){
|
||||
@@ -2798,8 +2798,8 @@
|
||||
.then(response => response[0][0]);
|
||||
}
|
||||
|
||||
async function getKelulusanKhazanahOperasi(textstatus = 'none',norujukan){
|
||||
|
||||
async function getKelulusanKhazanahOperasi(textstatus = 'none',norujukan,ansuranlatest = null){
|
||||
|
||||
const swalWithBootstrapButtons = Swal.mixin({
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-success',
|
||||
@@ -2827,8 +2827,29 @@
|
||||
let marg = gadai.percentpinj;
|
||||
let status = textstatus;
|
||||
let jumpinjam = gadai.pinjaman;
|
||||
let ansuran = ansuranlatest ? ansuranlatest['bakihargajualan'] - gadai.bakihargajualan : 0;
|
||||
let teller = "{{ Auth::user()->name }}";
|
||||
|
||||
|
||||
let comment = Swal.fire({
|
||||
title: 'Sila Masukkan Komen',
|
||||
input: 'text',
|
||||
inputPlaceholder: 'Komen',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Hantar',
|
||||
cancelButtonText: 'Batal',
|
||||
inputValidator: (value) => {
|
||||
if (!value) {
|
||||
return 'Sila masukkan komen!';
|
||||
}
|
||||
}
|
||||
});
|
||||
let komen = await comment.then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
return result.value;
|
||||
}
|
||||
});
|
||||
|
||||
Swal.fire({
|
||||
title: 'Tunggu Pengesahan Daripada Khazanah-Operasi.',
|
||||
icon: 'info',
|
||||
@@ -2846,18 +2867,21 @@
|
||||
|
||||
let requestdata = {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"mohon" : "Hapus Ansuran",
|
||||
"norujukan" : norujukan,
|
||||
"komen" : '',
|
||||
"komen" : komen,
|
||||
"margin" : marg,
|
||||
"berat" : ber,
|
||||
"nilaimarhun" : nm,
|
||||
"status" : status,
|
||||
"jumpinjam" : jumpinjam,
|
||||
"teller" : teller
|
||||
"teller" : teller,
|
||||
"ansuran" : ansuran,
|
||||
"tagoperasi" : 1
|
||||
};
|
||||
|
||||
|
||||
siricreated = await fetch("{{ route('operasi.createkelulusan') }}",{
|
||||
siricreated = await fetch("{{ route('teller.createkelulusan') }}",{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
@@ -2866,8 +2890,8 @@
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(response => {return response});
|
||||
|
||||
return siricreated;
|
||||
|
||||
return siricreated;
|
||||
|
||||
}else if (result.dismiss === Swal.DismissReason.cancel){
|
||||
console.log('gagal');
|
||||
@@ -2892,12 +2916,14 @@
|
||||
encrypted: true
|
||||
});
|
||||
|
||||
|
||||
let recno = (siricreated && typeof siricreated === 'object' && 'id' in siricreated) ? siricreated['id'] : siricreated;
|
||||
let teller = "{{ Auth::user()->name }}";
|
||||
let kodcaw = "{{ Auth::user()->cawangan }}";
|
||||
var channel = pusher.subscribe('notice-kelulusan');
|
||||
channel.bind('my-kelulusan', function(data) {
|
||||
|
||||
if(data.norujukan == norujukan && data.siri == siricreated && data.teller == teller)
|
||||
console.log(data,siricreated,teller,norujukan);
|
||||
if(data.norujukan == norujukan && data.siri == recno && data.teller == teller)
|
||||
{
|
||||
if(data.kelulusan == 'lulus')
|
||||
{
|
||||
|
||||
@@ -112,11 +112,12 @@
|
||||
<th>No Rujukan</th>
|
||||
<th>Teller</th>
|
||||
<th>Status</th>
|
||||
<th>Nilai Pembiayaan (RM)</th>
|
||||
<th>Nilai Marhun (RM)</th>
|
||||
<th>Berat</th>
|
||||
<th>Margin</th>
|
||||
<th>Tindakan</th>
|
||||
<th width="10%">Nilai Pembiayaan (RM)</th>
|
||||
<th width="10%">Ansuran (RM)</th>
|
||||
<th width="10%">Nilai Marhun (RM)</th>
|
||||
<th width="10%">Berat</th>
|
||||
<th width="10%">Margin</th>
|
||||
<th width="10%">Tindakan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -133,6 +134,7 @@
|
||||
<td>{{ $k['teller'] }}</td>
|
||||
<td>{{ $k['status'] }}</td>
|
||||
<td>{{ Helper::formatNumber($k['jumpinj']) }}</td>
|
||||
<td></td>
|
||||
<td>{{ Helper::formatNumber($k['nilaimarhun']) }}</td>
|
||||
<td>{{ $k['berat'] }}</td>
|
||||
<td>{{ $k['margin'] }}</td>
|
||||
@@ -141,11 +143,12 @@
|
||||
</tr>
|
||||
@endforeach
|
||||
@foreach($kelulusanmohonid as $index=>$km)
|
||||
<tr>
|
||||
<tr data-recno="{{ $km['recno'] }}" data-tagoperasi = "{{ $km['tagoperasi'] }}">
|
||||
<td><a href="#" data-toggle="modal" data-target="#kelulusanmodal" data-norujukan="{{ $km['norujukan'] }}">{{ $km['norujukan'] }} </a></td>
|
||||
<td>{{ $km['teller'] }}</td>
|
||||
<td>{{ $km['mohon'] }}</td>
|
||||
<td>{{ Helper::formatNumber($km['pinjaman']) }}</td>
|
||||
<td>{{ Helper::formatNumber($km['ansuran']) }}</td>
|
||||
<td>{{ Helper::formatNumber($km['nilaimarhun']) }}</td>
|
||||
<td>{{ $km['berat'] }}</td>
|
||||
<td>{{ $km['margin'] }}</td>
|
||||
@@ -514,6 +517,8 @@
|
||||
let norujukan = $(e).data('norujukan');
|
||||
let teller = $(e).closest('tr').children('td:eq(1)').text();
|
||||
let namakhazanah = "{{ $auth_user = Auth::user()->name }}";
|
||||
let recno = $(e).closest('tr').data('recno');
|
||||
let tagoperasi = $(e).closest('tr').data('tagoperasi');
|
||||
|
||||
teller = String(teller);
|
||||
|
||||
@@ -524,7 +529,9 @@
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"norujukan" : norujukan,
|
||||
"khazanah" : namakhazanah,
|
||||
'teller' : teller
|
||||
'teller' : teller,
|
||||
"recno" : recno,
|
||||
"tagoperasi" : tagoperasi,
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
@@ -593,6 +600,8 @@
|
||||
let norujukan = $(e).data('norujukan');
|
||||
let namakhazanah = "{{ $auth_user = Auth::user()->name }}";
|
||||
let teller = $(e).closest('tr').children('td:eq(1)').text();
|
||||
let recno = $(e).closest('tr').data('recno');
|
||||
let tagoperasi = $(e).closest('tr').data('tagoperasi');
|
||||
|
||||
teller = String(teller);
|
||||
|
||||
@@ -605,7 +614,9 @@
|
||||
"khazanah" : namakhazanah,
|
||||
"komenubahhapus" : komenkelulusan,
|
||||
"batal" : 'batal',
|
||||
'teller' : teller
|
||||
'teller' : teller,
|
||||
"recno" : recno,
|
||||
"tagoperasi" : tagoperasi
|
||||
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="container col-12">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
@@ -113,6 +113,7 @@
|
||||
<th>Komen</th>
|
||||
<th>Status</th>
|
||||
<th>Nilai Pembiayaan</th>
|
||||
<th>Ansuran</th>
|
||||
<th>Nilai Marhun</th>
|
||||
<th>Berat</th>
|
||||
<th>Margin</th>
|
||||
@@ -128,11 +129,16 @@
|
||||
<th>{{ $k['komen'] }}</th>
|
||||
<td>{{ $k['status'] }}</td>
|
||||
<td>{{ number_format($k['pinjaman'],2) }}</td>
|
||||
@if(isset($k['ansuran']) && $k['ansuran'] != 0)
|
||||
<td>{{ number_format($k['ansuran'],2) }}</td>
|
||||
@else
|
||||
<td></td>
|
||||
@endif
|
||||
<td>{{ $k['nilaimarhun'] }}</td>
|
||||
<td>{{ $k['berat'] }}</td>
|
||||
<td>{{ $k['margin'] }}</td>
|
||||
<td><button class="btn btn-primary mr-2" onclick="updatelulus(this)" data-kodcaw="{{ $k['cawangankod'] }}" data-pelulus="{{ $k['pelulus'] }}" data-norujukan="{{ $k['norujukan'] }}" data-siri="{{ $k['siri'] }}"><i class="fas fa-thumbs-up"></i></button>
|
||||
<button class="btn btn-danger" onclick="updatebatal(this)" data-kodcaw="{{ $k['cawangankod'] }}" data-norujukan="{{ $k['norujukan'] }}" data-pelulus="{{ $k['pelulus'] }}" data-siri="{{ $k['siri'] }}" ><i class="fas fa-thumbs-down"></i></button></td>
|
||||
<td><button class="btn btn-primary mr-2" onclick="updatelulus(this)" data-taglulus="{{ isset($k['mohonid']) ? true : false }}" data-kodcaw="{{ $k['cawangankod'] }}" data-norujukan="{{ $k['norujukan'] }}" data-siri="{{ isset($k['siri']) ? $k['siri'] : $k['recno'] }}"><i class="fas fa-thumbs-up"></i></button>
|
||||
<button class="btn btn-danger" onclick="updatebatal(this)" data-taglulus="{{ isset($k['mohonid']) ? true : false }}" data-kodcaw="{{ $k['cawangankod'] }}" data-norujukan="{{ $k['norujukan'] }}" data-siri="{{ isset($k['siri']) ? $k['siri'] : $k['recno'] }}" ><i class="fas fa-thumbs-down"></i></button></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@@ -346,6 +352,7 @@
|
||||
let siri = $(e).data('siri');
|
||||
let namaoperasi = "{{ Auth::user()->name }}";
|
||||
let teller = $(e).closest('tr').children('td:eq(2)').text();
|
||||
let taglulus = $(e).data('taglulus');
|
||||
|
||||
teller = String(teller);
|
||||
|
||||
@@ -354,6 +361,7 @@
|
||||
url: "{{ route('operasi.updatekelulusan') }}",
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"taglulus" : taglulus,
|
||||
"norujukan" : norujukan,
|
||||
"kodcaw" : cawangankod,
|
||||
"komenkelulusan" : komenkelulusan,
|
||||
|
||||
Reference in New Issue
Block a user