fix conflict penebusan
This commit is contained in:
@@ -0,0 +1,563 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<!-- The Modal -->
|
||||
<div class="modal fade" id="marhunModal">
|
||||
<div class="modal-dialog modal-xl modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
|
||||
<!-- Modal Header -->
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title"></h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<h4>Marhun</h4>
|
||||
<table id="biasa" class="table table-striped table-bordered text-center" style="width:100%">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Bil</th>
|
||||
<th>Jenis Marhun</th>
|
||||
<th>Berat</th>
|
||||
<th>Karat</th>
|
||||
<th>Nilai Marhun</th>
|
||||
<th>Nota</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tablemarhun">
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row form-group">
|
||||
<div class="col-md-12 text-center">
|
||||
<form target="_blank" action="{{ route('printsag') }}" id="print_submit" method="post">
|
||||
@csrf
|
||||
<input hidden value="gadaiansemasa" name="jenisprint">
|
||||
<input type="text" hidden name="norujukan_modal" id="norujukan_modal">
|
||||
<input type="text" hidden name="pinjaman_modal" id="pinjaman_modal">
|
||||
<input type="submit" class="btn btn-primary" id="cetak_sag" value="Cetak SAG">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal footer -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="belum_serah_modal">
|
||||
<div class="modal-dialog modal-xl modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
|
||||
<!-- Modal Header -->
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title"></h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<!-- Modal body -->
|
||||
<div class="modal-body">
|
||||
<h4>Marhun</h4>
|
||||
<table id="biasa" class="table table-striped table-bordered text-center" style="width:100%">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Bil</th>
|
||||
<th>Jenis Marhun</th>
|
||||
<th>Berat</th>
|
||||
<th>Karat</th>
|
||||
<th>Nilai Marhun</th>
|
||||
<th>Nota</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="belum_serah">
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row form-group">
|
||||
<div class="col-md-12 text-center">
|
||||
<form target="_blank" action="{{ route('printsag') }}" id="print_submit_belum_serah" method="post">
|
||||
@csrf
|
||||
<input type="text" hidden name="norujukan_modal" id="norujukan_modal1">
|
||||
<input type="text" hidden name="pinjaman_modal" id="pinjaman_modal1">
|
||||
<input type="button" class="btn btn-primary" id="cetak_sag_belum_serah" value="Cetak SAG">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal footer -->
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb pb-3">
|
||||
<li class="breadcrumb-item"><a href="#">Home</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Gadaian</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<input type="hidden" name="kodcaw" id="kodcaw" value="{{$cawangan_info['kodcaw']}}">
|
||||
<div class="card-body text-center">
|
||||
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" id="gadaian-semasa-tab" data-toggle="tab" href="#gadaian-semasa" role="tab" aria-controls="gadaian-semasa" aria-selected="true"> Semasa</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="gadaian-belum-serah-tab" data-toggle="tab" href="#gadaian-belum-serah" role="tab" aria-controls="gadaian-belum-serah" aria-selected="false"> Belum Serah</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="rekod-gadaian-tab" data-toggle="tab" href="#rekod-gadaian" role="tab" aria-controls="rekod-gadaian" aria-selected="false">Rekod </a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="gadaian-semasa" role="tabpanel" aria-labelledby="gadaian-semasa-tab">
|
||||
<table class='table table-striped table-hover' id='table-gadaian-semasa'>
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Bil</th>
|
||||
<th>Nama</th>
|
||||
<th>No KP</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Pembiayaan (RM)</th>
|
||||
<th>Nilai Marhun (RM)</th>
|
||||
<th>Berat (g)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $count=1; @endphp
|
||||
@if (is_array($gadaian_semasa) || is_object($gadaian_semasa))
|
||||
@foreach($gadaian_semasa as $index=>$gadaian)
|
||||
<tr>
|
||||
<td>{{ $count }}</td>
|
||||
<td>
|
||||
@php
|
||||
$customer_info = Http::get($api_url . '/api/customers/'. $gadaian['nokp'])->json();
|
||||
echo ($customer_info[0]['nama']);
|
||||
@endphp
|
||||
</td>
|
||||
<td>{{ $gadaian['nokp'] }}</td>
|
||||
<td>
|
||||
@php
|
||||
$marhun = Http::get($api_url . '/api/marhun/' . $gadaian['norujukan'] )->json();
|
||||
@endphp
|
||||
<a href="#" data-toggle="modal" data-marhun="{{ json_encode($marhun) }}" data-pinjaman="{{$gadaian['pinjaman']}}" data-norujukan="{{$gadaian['norujukan']}}" data-hargajualan="{{$gadaian['hargajualan']}}" data-kodcaw="{{ $gadaian['kodcaw'] }}" data-target="#marhunModal"> {{$gadaian['norujukan']}}</a>
|
||||
</td>
|
||||
<td>{{ number_format($gadaian['pinjaman'],2) }}</td>
|
||||
<td>{{ number_format($gadaian['nilaimarhun'],2) }}</td>
|
||||
<td>{{ number_format($gadaian['berat'],2) }}</td>
|
||||
</tr>
|
||||
@php $count++; @endphp
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="gadaian-belum-serah" role="tabpanel" aria-labelledby="gadaian-belum-serah-tab">
|
||||
<div class="float-right mb-3">
|
||||
<button class="btn btn-primary mt-4 pull-left" onclick="checkallfunc()" disabled>Check All</button>
|
||||
<button class="btn btn-primary mt-4 pull-left" onclick="uncheckallfunc()" disabled>Uncheck All</button>
|
||||
</div>
|
||||
<table class='table table-striped table-hover' id='table-gadaian-belum-serah'>
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Bil</th>
|
||||
<th>Nama</th>
|
||||
<th>No KP</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Pembiayaan (RM)</th>
|
||||
<th>Nilai Marhun (RM)</th>
|
||||
<th>Berat (g)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $count=1; @endphp
|
||||
@if (is_array($gadaian_belumserah) || is_object($gadaian_belumserah))
|
||||
@foreach($gadaian_belumserah as $index=>$gadaian)
|
||||
<tr>
|
||||
@php
|
||||
$customer_info = Http::get($api_url . '/api/customers/'. $gadaian['nokp'])->json();
|
||||
@endphp
|
||||
<td><input type="checkbox" id="checkgadai" autocomplete="off" data-nokp="{{ $gadaian['nokp'] }}" data-nama="{{ $customer_info[0]['nama'] }}" data-norujukan="{{$gadaian['norujukan']}}" data-kodcaw="{{ $gadaian['kodcaw'] }}" data-marhun="{{$gadaian['nilaimarhun']}}"></input></td>
|
||||
<td>{{ $customer_info[0]['nama'] }}</td>
|
||||
<td>{{ $gadaian['nokp'] }}</td>
|
||||
<td>
|
||||
@php
|
||||
$marhun = Http::get($api_url . '/api/marhun/' . $gadaian['norujukan'] )->json();
|
||||
@endphp
|
||||
<a href="#" data-toggle="modal" data-marhun="{{ json_encode($marhun) }}" data-pinjaman="{{$gadaian['pinjaman']}}" data-norujukan="{{$gadaian['norujukan']}}" data-hargajualan="{{$gadaian['hargajualan']}}" data-kodcaw="{{ $gadaian['kodcaw'] }}" data-target="#belum_serah_modal"> {{$gadaian['norujukan']}}</a>
|
||||
</td>
|
||||
<td>{{ number_format($gadaian['pinjaman'],2) }}</td>
|
||||
<td>{{ number_format($gadaian['nilaimarhun'],2) }}</td>
|
||||
<td>{{ number_format($gadaian['berat'],2) }}</td>
|
||||
</tr>
|
||||
@php $count++; @endphp
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='row mt-md-3'>
|
||||
<div class='col-md-12 d-flex justify-content-end form-group'>
|
||||
Jumlah Nilai Marhun Dipilih
|
||||
<div class='col-md-3'>
|
||||
<input type="text" name="marhunpilih" id="marhunpilih" readonly class='form-control'>
|
||||
</div>
|
||||
<form action="{{ route('marhun.serah') }}" method="post">
|
||||
@csrf
|
||||
<input type="text" name="norujukanpilih" id="norujukanpilih" hidden>
|
||||
<button type="submit" id="btn-serah" class='btn btn-primary' disabled>Serah Marhun</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="rekod-gadaian" role="tabpanel" aria-labelledby="rekod-gadaian-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-2">Tarikh</div>
|
||||
<div class="col-3"><input class="form-control" autocomplete="off" type="text" placeholder="Tarikh" onchange="fetchRekodGadaian()" name="tarikh_rekod" id="tarikh_rekod"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class='table table-striped table-hover' id='table-rekod-gadaian'>
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Bil</th>
|
||||
<th>Nama</th>
|
||||
<th>No KP</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Pembiayaan (RM)</th>
|
||||
<th>Nilai Marhun (RM)</th>
|
||||
<th>Berat (g)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var api_url = "<?php echo $api_url ?>";
|
||||
|
||||
function timedRefresh(timeoutPeriod) {
|
||||
setTimeout("location.reload(true);",timeoutPeriod);
|
||||
}
|
||||
|
||||
window.onload = timedRefresh(100000);
|
||||
var table_gadaian_semasa = $('#table-gadaian-semasa').DataTable({
|
||||
"ordering": true
|
||||
});
|
||||
var table_gadaian_belum_serah = $('#table-gadaian-belum-serah').DataTable({
|
||||
"ordering": true
|
||||
});
|
||||
|
||||
var table_rekod_gadaian = $('#table-rekod-gadaian').DataTable({
|
||||
"ordering": true
|
||||
});
|
||||
|
||||
$('#tarikh_rekod').datepicker({
|
||||
format: 'dd/mm/yyyy',
|
||||
endDate: new Date()
|
||||
});
|
||||
|
||||
const formatter = new Intl.NumberFormat('en-US', {
|
||||
minimumFractionDigits: 2
|
||||
});
|
||||
|
||||
$('#cetak_sag').on('click',function(){
|
||||
location.reload();
|
||||
});
|
||||
|
||||
function checkallfunc(){
|
||||
|
||||
let totalmarhun = 0;
|
||||
$(':checkbox').each(function() {
|
||||
let marhun = Number($(this).data("marhun"));
|
||||
totalmarhun += marhun;
|
||||
this.checked = true;
|
||||
});
|
||||
$("#btn-serah").prop('disabled', false);
|
||||
$('#marhunpilih').val(formatter.format(totalmarhun.toFixed(2)));
|
||||
}
|
||||
|
||||
function uncheckallfunc(){
|
||||
let totalmarhun = 0;
|
||||
$(':checkbox').each(function() {
|
||||
let marhun = Number($(this).data("marhun"));
|
||||
totalmarhun -= marhun;
|
||||
this.checked = false;
|
||||
});
|
||||
$('#marhunpilih').val(0);
|
||||
$("#btn-serah").prop('disabled', true);
|
||||
}
|
||||
|
||||
function fetchRekodGadaian(){
|
||||
var tarikh_rekod = $('#tarikh_rekod').val();
|
||||
if(tarikh_rekod == ''){
|
||||
var current = new Date();
|
||||
var current_date = current.getDate();
|
||||
var current_month = current.getMonth()+1;
|
||||
var current_year = current.getFullYear();
|
||||
var tarikh = current_year + '-' +current_month+'-'+current_date;
|
||||
}else{
|
||||
var split_date = tarikh_rekod.split('/');
|
||||
var tarikh = split_date[2] + '-' + split_date[1] + '-' + split_date[0];
|
||||
}
|
||||
table_rekod_gadaian.clear().draw();
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: api_url + '/api/gadai/list/rekod/old',
|
||||
data:{
|
||||
'kodcaw': "{{ $cawangan_info['kodcaw'] }}",
|
||||
'tarikh': tarikh
|
||||
},
|
||||
success:function(data){
|
||||
var count = 0;
|
||||
$.each(data,function(index,rekodgadaian){
|
||||
$.ajax({
|
||||
url: api_url + '/api/customers/' + rekodgadaian['nokp'],
|
||||
method:'get',
|
||||
success:function(rekodcustomer){
|
||||
count++;
|
||||
table_rekod_gadaian.row.add([
|
||||
count,
|
||||
rekodcustomer[0]['nama'],
|
||||
rekodgadaian['nokp'],
|
||||
rekodgadaian['norujukan'],
|
||||
rekodgadaian['pinjaman'],
|
||||
rekodgadaian['nilaimarhun'],
|
||||
rekodgadaian['berat']
|
||||
]).draw();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//modal
|
||||
$('#marhunModal').on('show.bs.modal', function(event) {
|
||||
var button = $(event.relatedTarget); // button yg trigger
|
||||
var arraymarhun = button.data('marhun');
|
||||
var norujukan = button.data('norujukan');
|
||||
var kodcaw = button.data('kodcaw');
|
||||
var hargajualan = button.data('hargajualan');
|
||||
var pinjaman = button.data('pinjaman');
|
||||
// $('#pembelian_komuditi').attr('href','http://bsas-arrahn.test/pembelian/komuditi?norujukan='+norujukan);
|
||||
|
||||
$('#norujukan_modal').val(norujukan);
|
||||
$('#pinjaman_modal').val(pinjaman);
|
||||
$('#tablemarhun').empty();
|
||||
var bil_count = 0;
|
||||
$.each(arraymarhun,function(index,marhun){
|
||||
$.each(marhun, function(index2,marhun_detail){
|
||||
|
||||
var marhun_name;
|
||||
$.ajax({
|
||||
method:'GET',
|
||||
url: api_url + '/api/jemas/nama_marhun',
|
||||
dataType: 'json',
|
||||
data:{
|
||||
marhun:marhun_detail['marhun']
|
||||
},
|
||||
success:function(marhun_ajax){
|
||||
bil_count++;
|
||||
$("#tablemarhun").append("<tr><td>" + bil_count + "</td><td>" + marhun_ajax['descpt'] +"</td><td>" + marhun_detail['berat'] +"</td><td>" + marhun_detail['karat'] +"</td><td>RM " + marhun_detail['n_marhun'].toLocaleString(undefined,{minimumFractionDigits:2}) +"</td><td>"+ marhun_detail['nota'] +"</td></tr>");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('#belum_serah_modal').on('show.bs.modal', function(event) {
|
||||
var button = $(event.relatedTarget); // button yg trigger
|
||||
var arraymarhun = button.data('marhun');
|
||||
var norujukan = button.data('norujukan');
|
||||
var kodcaw = button.data('kodcaw');
|
||||
var hargajualan = button.data('hargajualan');
|
||||
var pinjaman = button.data('pinjaman');
|
||||
|
||||
$('#norujukan_modal1').val(norujukan);
|
||||
$('#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;
|
||||
$.ajax({
|
||||
method:'GET',
|
||||
url: api_url + '/api/jemas/nama_marhun',
|
||||
dataType: 'json',
|
||||
data:{
|
||||
marhun:marhun_detail['marhun']
|
||||
},
|
||||
success:function(marhun_ajax){
|
||||
bil_count++;
|
||||
$("#belum_serah").append("<tr><td>" + bil_count + "</td><td>" + marhun_ajax['descpt'] +"</td><td>" + marhun_detail['berat'] +"</td><td>" + marhun_detail['karat'] +"</td><td>RM " + marhun_detail['n_marhun'].toLocaleString(undefined,{minimumFractionDigits:2}) +"</td><td>"+ marhun_detail['nota'] +"</td></tr>");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
var total_marhun_pilih = 0;
|
||||
$(document).on('click', '#checkgadai', function(e) {
|
||||
if ($(this).is(':checked')) {
|
||||
var norujukan = $(this).data("norujukan");
|
||||
var kodcaw = $(this).data("kodcaw");
|
||||
var marhun = $(this).data("marhun");
|
||||
|
||||
total_marhun_pilih += Number(marhun);
|
||||
|
||||
$('#marhunpilih').val(formatter.format(total_marhun_pilih.toFixed(2)));
|
||||
|
||||
$("#btn-serah").prop('disabled', false);
|
||||
|
||||
var norujukanpilih = $('#norujukanpilih').val();
|
||||
|
||||
norujukanpilih += norujukan + ",";
|
||||
|
||||
$('#norujukanpilih').val(norujukanpilih);
|
||||
|
||||
}else {
|
||||
var norujukan = $(this).data("norujukan");
|
||||
var kodcaw = $(this).data("kodcaw");
|
||||
var marhun = $(this).data("marhun");
|
||||
|
||||
total_marhun_pilih -= Number(marhun);
|
||||
|
||||
$('#marhunpilih').val(total_marhun_pilih.toFixed(2));
|
||||
|
||||
var norujukanpilih = $('#norujukanpilih').val();
|
||||
|
||||
var sag;
|
||||
sag = norujukan + ",";
|
||||
|
||||
norujukanpilih = norujukanpilih.replace('ALS201203-0001,', "");
|
||||
|
||||
$('#norujukanpilih').val(norujukanpilih);
|
||||
}
|
||||
var legchecked = $('input[id^=checkgadai]:checked').length;
|
||||
if(legchecked == 0){
|
||||
$("#btn-serah").prop('disabled', true);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '#cetak_sag_belum_serah', function(e) {
|
||||
|
||||
let norujukan = $('#norujukan_modal1').val();
|
||||
let mohon = "Print SAG";
|
||||
|
||||
const swalWithBootstrapButtons = Swal.mixin({
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-success ml-1',
|
||||
cancelButton: 'btn btn-danger'
|
||||
},
|
||||
buttonsStyling: false
|
||||
});
|
||||
|
||||
swalWithBootstrapButtons.fire({
|
||||
title: 'Dapatkan Pengesahan Khazanah',
|
||||
text: "Cetak SAG Semula!",
|
||||
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: '6em',
|
||||
background: '#fffff',
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false
|
||||
})
|
||||
|
||||
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url: '{{ route("teller.createkelulusan") }}',
|
||||
data: {
|
||||
"_token" : "{{ csrf_token() }}",
|
||||
"norujukan" : norujukan,
|
||||
"mohon" : mohon
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//TIME INTERVAL
|
||||
let timerInterval;
|
||||
|
||||
timerInterval = setInterval(function(){
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: "{{ route('teller.getkelulusan') }}",
|
||||
data: {
|
||||
"norujukan" : norujukan
|
||||
},
|
||||
success:function(data){
|
||||
if(data != 0){
|
||||
clearInterval(timerInterval);
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Telah Disahkan'
|
||||
}).then(function(){
|
||||
$("#print_submit_belum_serah").submit();
|
||||
});
|
||||
}
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}, 3000);
|
||||
|
||||
|
||||
}else if (result.dismiss === Swal.DismissReason.cancel) {
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Batal',
|
||||
'Tidak Berjaya Mendapatkan Kelulusan Khazanah',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
@@ -212,6 +212,114 @@
|
||||
|
||||
}
|
||||
|
||||
function kiraanpanjar(datakeyin)
|
||||
{
|
||||
var idkey = $(datakeyin).attr('id');
|
||||
var valkey = $(datakeyin).val();
|
||||
var amount = 0;
|
||||
let amountkiraan = 0;
|
||||
|
||||
var validate = parseFloat($(datakeyin).data('amaun'));
|
||||
|
||||
$.each(arrayambilan, function( index, arr ){
|
||||
if(arr[0] == idkey)
|
||||
{
|
||||
|
||||
arrayambilan[index][1] = totalamount(idkey,valkey);
|
||||
}
|
||||
|
||||
amount += arr[1];
|
||||
});
|
||||
|
||||
if(Number(valkey) > Number(validate))
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Jumlah denominasi melebihi kadar'
|
||||
});
|
||||
$(datakeyin).val('');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$('#amaunkiraan').val(amount);
|
||||
|
||||
}
|
||||
|
||||
switch(idkey) {
|
||||
case 'bundle1':
|
||||
amountkiraan += (valkey * 100);
|
||||
$('#totalb1').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'bundle20':
|
||||
amountkiraan += (valkey * 1000);
|
||||
$('#totalb20').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'bundle5':
|
||||
amountkiraan += (valkey * 500);
|
||||
$('#totalb5').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'bundle50':
|
||||
amountkiraan += (valkey * 5000);
|
||||
$('#totalb50').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'bundle10':
|
||||
amountkiraan += (valkey * 1000);
|
||||
$('#totalb10').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'bundle100':
|
||||
amountkiraan += (valkey * 5000);
|
||||
$('#totalb100').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'sen1':
|
||||
amountkiraan += (valkey * 0.01);
|
||||
$('#totalsen1').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'sen5':
|
||||
amountkiraan += (valkey * 0.05);
|
||||
$('#totalsen5').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'sen10':
|
||||
amountkiraan += (valkey * 0.10);
|
||||
$('#totalsen10').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'sen20':
|
||||
amountkiraan += (valkey * 0.20);
|
||||
$('#totalsen20').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'sen50':
|
||||
amountkiraan += (valkey * 0.50);
|
||||
$('#totalsen50').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'ringgit1':
|
||||
amountkiraan += (valkey * 1);
|
||||
$('#totalring1').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'ringgit5':
|
||||
amountkiraan += (valkey * 5);
|
||||
$('#totalring5').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'ringgit10':
|
||||
amountkiraan += (valkey * 10);
|
||||
$('#totalring10').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'ringgit20':
|
||||
amountkiraan += (valkey * 20);
|
||||
$('#totalring20').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'ringgit50':
|
||||
amountkiraan += (valkey * 50);
|
||||
$('#totalring50').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
case 'ringgit100':
|
||||
amountkiraan += (valkey * 100);
|
||||
$('#totalring100').val(formatter.format(amountkiraan.toFixed(2)));
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function checkformpanjar(formdata)
|
||||
{
|
||||
|
||||
|
||||
@@ -2639,4 +2639,4 @@ function pembatalanbalik()
|
||||
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
@@ -570,4 +570,4 @@ hr.new5 {
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
@@ -28,12 +28,12 @@
|
||||
<br>
|
||||
|
||||
@php
|
||||
$poskod = Http::get($api_url . '/api/poskod/' . $customers[0]['poskod'])->json();
|
||||
$poskod = Http::get($api_url . '/api/poskod/' . $customers['poskod'])->json();
|
||||
$negeri = Http::get($api_url . '/api/negeri/' . $poskod['kodnegeri'])->json();
|
||||
$daerah = Http::get($api_url . '/api/daerah/' . $poskod['koddaerah'])->json();
|
||||
|
||||
@endphp
|
||||
<p style=" text-align: justify;text-justify: inter-word;line-height: 1.6;">Saya, <b>{{ $customers[0]['nama'] }}</b>, No. K/P : <b>@php $satu = substr($gadai[0][0]['nokp'],0,6); $dua = substr($gadai[0][0]['nokp'],6,2);$ketiga = substr($gadai[0][0]['nokp'],8); echo $satu . '-' . $dua . '-' . $ketiga; @endphp</b> yang beralamat di <b>{{ strtoupper($customers[0]['alamat1']) . ', ' . $customers[0]['poskod'] . ', ' . strtoupper($daerah['namadaerah']) . ', ' . strtoupper($negeri['negeri']) }}</b> dengan sesungguhnya dan sebenarnya mengaku bahawa: -</p>
|
||||
<p style=" text-align: justify;text-justify: inter-word;line-height: 1.6;">Saya, <b>{{ $customers['nama'] }}</b>, No. K/P : <b>@php $satu = substr($gadai[0][0]['nokp'],0,6); $dua = substr($gadai[0][0]['nokp'],6,2);$ketiga = substr($gadai[0][0]['nokp'],8); echo $satu . '-' . $dua . '-' . $ketiga; @endphp</b> yang beralamat di <b>{{ strtoupper($customers['alamat1']) . ', ' . $customers['poskod'] . ', ' . strtoupper($daerah['namadaerah']) . ', ' . strtoupper($negeri['negeri']) }}</b> dengan sesungguhnya dan sebenarnya mengaku bahawa: -</p>
|
||||
|
||||
<ol>
|
||||
<li style=" text-align: justify;text-justify: inter-word;line-height: 1.6;"><b>Surat Gadaian Ar-Rahn Cawangan <span>@php $namacawangan = substr($cawangan_detail['namacaw'],7); $rendoh = strtolower($namacawangan);echo ucwords($rendoh); @endphp</span></b> kepunyaan saya telah hilang dalam simpanan @php if(strtoupper($polis[0]['komen1']) == 'SIMPANAN') { echo '.'; }else{ echo 'kerana <b>' . $polis[0]['komen1'] . '</b>.'; } @endphp Saya telah sedaya upaya berusaha mencari surat tersebut tetapi gagal menemuinya. Saya juga mengaku bahawa tidak pernah menjual atau menggadai surat tersebut kepada mana-mana institusi kewangan.</li>
|
||||
@@ -77,7 +77,7 @@
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-weight: bold;">{{ $customers[0]['nama'] }}</td>
|
||||
<td style="font-weight: bold;">{{ $customers['nama'] }}</td>
|
||||
<td class="tableright">)</td>
|
||||
<td style="text-align: right;">........................................................</td>
|
||||
</tr>
|
||||
@@ -112,4 +112,4 @@
|
||||
<p style="text-align: center;margin: 0;">Pesuruhjaya Sumpah</p>
|
||||
<p style="text-align: center;margin: 0;">atau Notari Awam )</p>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user