Update besar apk finance
This commit is contained in:
@@ -243,7 +243,7 @@ $(document).on('input','.qty,.harga',function(){
|
||||
|
||||
let tr = $(this).closest('tr');
|
||||
let qty = parseFloat(tr.find('.qty').val()) || 0;
|
||||
let harga = parseFloat(tr.find('.harga').val()) || 0;
|
||||
let harga = window.parseMoney(tr.find('.harga').val());
|
||||
|
||||
let sub = qty * harga;
|
||||
|
||||
@@ -385,7 +385,7 @@ function hitungBayar(){
|
||||
let totalBayar = 0;
|
||||
|
||||
$('#tableBayar .debit').each(function(){
|
||||
totalBayar += parseFloat($(this).val()) || 0;
|
||||
totalBayar += window.parseMoney($(this).val());
|
||||
});
|
||||
|
||||
let invoiceTotal = parseFloat($('#invoiceTotal').text().replace(/\./g,'')) || 0;
|
||||
@@ -423,7 +423,7 @@ $('#btnProsesBayar').click(function(){
|
||||
$('#tableBayar tbody tr').each(function(){
|
||||
|
||||
let account_id = $(this).find('.account_id').val();
|
||||
let debit = parseFloat($(this).find('.debit').val()) || 0;
|
||||
let debit = window.parseMoney($(this).find('.debit').val());
|
||||
|
||||
if(account_id && debit > 0){
|
||||
detail.push({ account_id, amount: debit });
|
||||
@@ -570,6 +570,15 @@ $(document).on('click', '.btn-delete', function () {
|
||||
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
async function stage5InvoiceAction(action,id){
|
||||
if(!confirm('Lanjutkan tindakan '+action+' untuk invoice ini?')) return;
|
||||
const routes={submit:'submit_invoice',approve:'approve_invoice',post:'post_invoice'};
|
||||
const body=new URLSearchParams(); body.append('<?=$this->security->get_csrf_token_name()?>','<?=$this->security->get_csrf_hash()?>');
|
||||
const response=await fetch('<?=base_url('receivables/')?>'+routes[action]+'/'+id,{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded'},body});
|
||||
const result=await response.json(); alert(result.message); if(result.status) location.reload();
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user