<div class="d-flex justify-content-between align-items-center mb-3">
    <h5 class="mb-0"><?= lang('adv_finance.credit_notes') ?></h5>
    <?php if(auth_can('installments.create')): ?><a href="/advanced-finance/credit-notes/create" class="btn btn-primary btn-sm"><i class="fas fa-plus me-1"></i><?= lang('adv_finance.create_credit_note') ?></a><?php endif; ?>
</div>
<div class="card"><div class="card-body">
    <table id="cn-table" class="table table-striped w-100" data-url="/advanced-finance/credit-notes/datatable"
           data-columns='[{"data":"credit_note_number","title":"CN #"},{"data":"member_name","title":"Member"},{"data":"credit_date","title":"Date"},{"data":"total_amount","title":"Total"},{"data":"applied_amount","title":"Applied"},{"data":"remaining_amount","title":"Remaining"},{"data":"status_badge","title":"Status","orderable":false},{"data":"id","title":"Actions","orderable":false,"searchable":false}]'>
        <thead><tr><th>CN #</th><th>Member</th><th>Date</th><th>Total</th><th>Applied</th><th>Remaining</th><th>Status</th><th>Actions</th></tr></thead>
    </table>
</div></div>
<?php $__view->push('scripts') ?><script>document.addEventListener('DOMContentLoaded',function(){DataTableHelper.init('cn-table',{columnDefs:[{targets:-1,render:function(d){return '<a href="/advanced-finance/credit-notes/'+d+'" class="btn btn-sm btn-outline-primary"><i class="fas fa-eye"></i></a>';}}]});});</script><?php $__view->endPush() ?>