laporan ansuran panjaran

This commit is contained in:
MUHD HAFIFIE
2021-04-27 15:58:20 +08:00
parent 043a276d93
commit d5ce8d0df1
12 changed files with 744 additions and 159 deletions
@@ -41,23 +41,24 @@
<tr>
<th>Bil</th>
<th>No Rujukan</th>
<th>Nama</th>
<th width="30%">Nama</th>
<th>No K/P</th>
<th>JBG</th>
<th>Pembiayaan</th>
<th>Ansuran Upah</th>
<th>Nilai Marhun</th>
<th>Tempoh</th>
<th>Baki Pembiayaan</th>
<th>Bayaran</th>
<th>Keuntungan</th>
</tr>
</thead>
<tfoot class="thead-dark">
<th colspan="5">TOTAL</th>
<th id="pinjamantotal"></th>
<th id="bayarantotal"></th>
<th id="keuntungantotal"></th>
</tfoot>
</table>
</div>
</div>
<div class="row">
<div class="col-md-12 text-right">
Bilangan Surat : <span id="bilangan_surat">3</span>
Jumlah Pinjaman : <span id="jumlah_pinjaman">RM 3,000.00</span>
</div>
</div>
</div>
</div>
</div>
@@ -81,7 +82,8 @@
var today_date = current_year + '-' +current_month+'-'+current_date;
$.ajax({
method:'get',
url: api_url + '/api/ansuran/laporan/'+kodcaw+'/' + today_date,
url: api_url + '/api/ansuran/laporan/'+kodcaw,
data:{ 'tarikh' : today_date },
success: function(tebus){
tebustable(tebus);
}
@@ -94,16 +96,23 @@
var today_date = split_date[2] + '-' +split_date[1]+'-'+split_date[0];
$.ajax({
method:'get',
url: api_url + '/api/ansuran/laporan/'+kodcaw+'/' + today_date,
url: api_url + '/api/ansuran/laporan/'+kodcaw,
data:{ 'tarikh' : today_date },
success: function(tebus){
tebustable(tebus);
}
});
});
const formatter = new Intl.NumberFormat('en-US', {
minimumFractionDigits: 2
});
function tebustable(data){
var counter = 1;
var total_pinjaman = 0;
var total_bayaran = 0;
var total_keuntungan = 0;
tabletebus.clear().draw();
$.each(data,function(index,tebus){
$.ajax({
@@ -114,17 +123,22 @@
url:api_url + '/api/customers/' + gadai[0][0]['nokp'],
method:'get',
success: function(customer){
total_pinjaman += Number(gadai[0][0]['bakipjm']);
total_bayaran += Number(tebus['duit_masuk']);
total_keuntungan += Number(tebus['bayaran_keuntungan']);
tabletebus.row.add([
counter,
tebus['norujukan'],
customer[0]['nama'],
gadai[0][0]['nokp'],
tebus['jbg'],
tebus['pinjaman'],
tebus['ansuran'],
tebus['nilaimarhun'],
''
gadai[0][0]['tempoh'],
gadai[0][0]['bakipjm'],
tebus['duit_masuk'],
tebus['bayaran_keuntungan']
]).draw();
$('#pinjamantotal').text(formatter.format(total_pinjaman.toFixed(2)));
$('#bayarantotal').text(formatter.format(total_bayaran.toFixed(2)));
$('#keuntungantotal').text(formatter.format(total_keuntungan.toFixed(2)));
}
});
}