hapus ansuran extended for audit trail and box comment

This commit is contained in:
Hafifie PKB
2025-06-30 13:40:53 +08:00
parent 8a3598fa24
commit 00c4b9d55e
8 changed files with 191 additions and 48 deletions
@@ -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>
+36 -10
View File
@@ -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')
{