hr dan payroll
This commit is contained in:
@@ -15,12 +15,12 @@
|
||||
|
||||
<div class="col-md-2">
|
||||
<label>Dari</label>
|
||||
<input type="date" id="start_date" class="form-control">
|
||||
<input type="date" id="start_date" class="form-control" value="<?=date('Y-m-01')?>">
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label>Sampai</label>
|
||||
<input type="date" id="end_date" class="form-control">
|
||||
<input type="date" id="end_date" class="form-control" value="<?=date('Y-m-d')?>">
|
||||
</div>
|
||||
|
||||
|
||||
@@ -32,6 +32,13 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row g-2 mb-3" id="ledgerSummary">
|
||||
<div class="col-6 col-lg-3"><div class="card card-body"><small class="text-muted">Saldo Awal</small><strong data-summary="saldo_awal">0</strong></div></div>
|
||||
<div class="col-6 col-lg-3"><div class="card card-body"><small class="text-muted">Total Debit</small><strong data-summary="total_debit">0</strong></div></div>
|
||||
<div class="col-6 col-lg-3"><div class="card card-body"><small class="text-muted">Total Kredit</small><strong data-summary="total_kredit">0</strong></div></div>
|
||||
<div class="col-6 col-lg-3"><div class="card card-body"><small class="text-muted">Saldo Akhir</small><strong data-summary="saldo_akhir">0</strong></div></div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table id="tableLedger" class="table modern-table align-middle w-100">
|
||||
<thead>
|
||||
@@ -62,6 +69,7 @@ $(function(){
|
||||
opt += `<option value="${a.id}">${a.kode_akun} - ${a.nama_akun}</option>`;
|
||||
});
|
||||
$('#account_id').html(opt);
|
||||
if(res.length) loadData();
|
||||
},'json');
|
||||
|
||||
function loadData(){
|
||||
@@ -78,7 +86,7 @@ $(function(){
|
||||
|
||||
let html = '';
|
||||
|
||||
res.forEach(r=>{
|
||||
(res.data || []).forEach(r=>{
|
||||
html += `
|
||||
<tr>
|
||||
<td>${r.tanggal}</td>
|
||||
@@ -92,8 +100,13 @@ $(function(){
|
||||
});
|
||||
|
||||
$('#tableLedger tbody').html(html);
|
||||
Object.keys(res.summary || {}).forEach(function(key){
|
||||
$('[data-summary="'+key+'"]').text(Number(res.summary[key] || 0).toLocaleString('id-ID'));
|
||||
});
|
||||
|
||||
},'json');
|
||||
},'json').fail(function(xhr){
|
||||
Swal.fire('Error', xhr.responseJSON?.message || 'Data Buku Besar gagal dimuat.', 'error');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +131,7 @@ $(function(){
|
||||
+ String(now.getDate()).padStart(2, '0');
|
||||
|
||||
const account_id = $('#account_id').val();
|
||||
const start_date = $('#start_date').val() || '0000-00-00';
|
||||
const start_date = $('#start_date').val() || '1900-01-01';
|
||||
const end_date = $('#end_date').val() || today;
|
||||
|
||||
let btn = $(this);
|
||||
@@ -153,4 +166,4 @@ $(function(){
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user