<script>
jQuery('#btn_save_balance').on('click', function() {
    show_loading();
    jQuery.ajax({
        url: app_url + 'production_cash_balance/save_balance',
        type: 'POST',
        dataType: 'JSON',
        data: jQuery('#form_balance').serialize(),
        success: function(response) {
            hide_loading();
            if (response.err_code == 0) {
                bootbox.alert({
                    message: 'Saldo awal berhasil disimpan',
                    callback: function() { location.reload(); }
                });
            } else {
                bootbox.alert(response.err_message);
            }
        }
    });
});
</script>