ok

Mini Shell

Direktori : /home2/selectio/public_html/saew.in/admin/assets/dist/js/maps/
Upload File :
Current File : /home2/selectio/public_html/saew.in/admin/assets/dist/js/maps/pos.min.js.map

{"version":3,"sources":["pos.js"],"names":["add_invoice_item","item","count","spositems","item_id","Settings","item_addition","id","row","qty","parseFloat","store","JSON","stringify","loadItems","get","total","an","product_tax","invoice_tax","product_discount","order_discount","total_discount","$","empty","time","Date","getTime","remote_printing","ob_info","pos_customer","text","hr","val","user","username","pos_curr_time","date","dateformat","timeformat","order_data","info","bill_data","o_items","b_items","style","pos_head","site_name","prepend","lang","order","bill","parse","each","this","product_id","item_type","type","item_tax_method","tax_method","combo_items","item_qty","item_aqty","quantity","item_ds","discount","item_code","code","item_name","name","replace","net_price","real_unit_price","item_comment","comment","item_was_ordered","ordered","ds","item_discount","formatDecimal","indexOf","pds","split","isNaN","pr_tax","tax","pr_tax_val","inclusive","exclusive","row_no","newTr","tr_html","formatMoney","html","prependTo","oitb","scrollHeight","slimScroll","scrollTo","addClass","find","removeClass","comments","i","len","length","printLine","bprTr","oprTr","append","ts","order_tax","pts","g_total","grand_total","items","b_totals","rounding","round_total","roundNumber","parseInt","total_payable","total_items","totals","bill_totals","merchant_copy","display_kb","display_keyboards","focus","chr","String","fromCharCode","jQuery","browser","mobile","keyboard","autoAccept","alwaysOpen","openOn","usePreview","layout","display","bksp","accept","default","meta1","meta2","customLayout","shift","restrictInput","preventPaste","b","calTax","nav_pointer","pp","p_page","attr","pro_limit","tcp","Popup","data","createWin","then","w","close","Promise","resolve","d","assets","mywindow","window","open","document","write","setTimeout","posScreen","wh","height","total_dh","buttons_dh","items_dh","list_table_dh","outerHeight","str","size","char_per_line","res","newd","read_card","ready","on","e","preventDefault","stopPropagation","hideseek","nodata","no_match_found","n","modal","closest","item_rid","unit_price","console","log","base_url","label","row_id","backdrop","price","is_valid_discount","bootbox","alert","unexpected_value","localStorage","setItem","is_numeric","new_qty","click","protect_delete","dialog","title","enter_pin_code","closeButton","message","buttons","danger","className","callback","success","delete","md5","pin_code","remove","location","href","wrong_pin","keypress","keyCode","trigger","confirm","r_u_sure","result","please_add_product","show","print_img","element","html2canvas","scrollY","scale","canvas","img","toDataURL","post","spos_token","csrf_hash","form","serialize","printOrder","hide","printBill","apply_to","dval","focusToEnd","tval","ajax","url","dataType","cid","cat_id","category_id","products","per_page","autocomplete","source","minLength","autoFocus","delay","response","event","ui","content","_trigger","select","bind","inputmask","placeholder","no","generateCardNo","parent","children","gccode","gcname","gcvalue","gcprice","gcexpiry","file_required_fields","gc_data","Array","gcdata","hasOwnProperty","ref","type_reference_note","suspend","sid","appendTo","submit","gtotal","change","total_paying","total_paid","p_val","rounded_total","slideDown","slideUp","cn","async","balance","incorrect_gift_card","card_no","value","paying","$quick_cash","amt","contents","filter","nodeType","th","thousands_sep","$pi","join","note_count","spos_note","spos_customer","select2","hover","top","offset","menu","target","hasClass","hold_ref","status","msg","error","customer_request_failed","start","width","extend","keyaction","enter","base","$el","is","insertText","TrackData","p","SwipeParserObj","hasTrack1","CardType","ccn1","account","charAt","account_name","exp_month","exp_year","blur","removeData","clear","reload","focus_add_item","shortcut","add","propagate","add_customer","toggle_category_slider","cancel_sale","suspend_sale","print_order","print_bill","finalize_sale","today_sale","open_hold_bills","close_register","fn","v","ajaxSetup","cache","headers","cache-control"],"mappings":"AAAA,SAAAA,iBAAAC,GAIA,GAHA,GAAAC,QACAC,cAEA,MAAAF,EAAA,CAIA,IAAAG,EAAA,GAAAC,SAAAC,cAAAL,EAAAG,QAAAH,EAAAM,GASA,OARAJ,UAAAC,GACAD,UAAAC,GAAAI,IAAAC,IAAAC,WAAAP,UAAAC,GAAAI,IAAAC,KAAA,EAEAN,UAAAC,GAAAH,EAGAU,MAAA,YAAAC,KAAAC,UAAAV,YACAW,aACA,GAGA,SAAAA,YAIA,GAHA,GAAAZ,QACAC,cAEAY,IAAA,aAAA,CACAC,MAAA,EACAd,MAAA,EACAe,GAAA,EACAC,YAAA,EACAC,YAAA,EACAC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AAA,IACAA,IAAA+V,MAGAzW,EAAA0W,WAAAC,OAAA,EAAAC,SAAAC,gBAAA","file":"../pos.min.js","sourcesContent":["function add_invoice_item(item) {\n    if (count == 1) {\n        spositems = {};\n    }\n    if (item == null) {\n        return;\n    }\n\n    var item_id = Settings.item_addition == 1 ? item.item_id : item.id;\n    if (spositems[item_id]) {\n        spositems[item_id].row.qty = parseFloat(spositems[item_id].row.qty) + 1;\n    } else {\n        spositems[item_id] = item;\n    }\n\n    store('spositems', JSON.stringify(spositems));\n    loadItems();\n    return true;\n}\n\nfunction loadItems() {\n    if (count == 1) {\n        spositems = {};\n    }\n    if (get('spositems')) {\n        total = 0;\n        count = 1;\n        an = 1;\n        product_tax = 0;\n        invoice_tax = 0;\n        product_discount = 0;\n        order_discount = 0;\n        total_discount = 0;\n\n        $('#posTable tbody').empty();\n        var time = new Date().getTime() / 1000;\n        if (Settings.remote_printing != 1) {\n            var pos_customer = 'C: ' + $('#select2-spos_customer-container').text() + '\\n';\n            var hr = 'R: ' + $('#hold_ref').val() + '\\n';\n            var user = 'U: ' + username + '\\n';\n            var pos_curr_time = 'T: ' + date(Settings.dateformat + ' ' + Settings.timeformat, time) + '\\n';\n            var ob_info = pos_customer + hr + user + pos_curr_time + '\\n';\n            order_data.info = ob_info;\n            bill_data.info = ob_info;\n            var o_items = '';\n            var b_items = '';\n        } else {\n            $('#order_span').empty();\n            $('#bill_span').empty();\n            var style = '<style>.bb td, .bb th { border-bottom: 1px solid #DDD; }</style>';\n            var pos_head = '<span style=\"text-align:center;\"><h3>' + Settings.site_name + '</h3>';\n            // var pos_customer = ''; // remove this line and uncomment below to display customer\n            var pos_customer = '<h5>C: ' + $('#select2-spos_customer-container').text() + '</h5>';\n            var hr = '<h5>R: ' + $('#hold_ref').val() + '</h5>';\n            var user = '<h5>U: ' + username + '</h5>';\n            var pos_curr_time = '<h5>T: ' + date(Settings.dateformat + ' ' + Settings.timeformat, time) + '</h5>';\n            $('#order_span').prepend(style + pos_head + '<h4>' + lang.order + '</h4></span>' + pos_customer + hr + user + pos_curr_time);\n            $('#bill_span').prepend(style + pos_head + '<h4>' + lang.bill + '</h4></span>' + pos_customer + hr + user + pos_curr_time);\n            $('#order-table').empty();\n            $('#bill-table').empty();\n        }\n        spositems = JSON.parse(get('spositems'));\n\n        $.each(spositems, function() {\n            var item = this;\n            var item_id = Settings.item_addition == 1 ? item.item_id : item.id;\n            spositems[item_id] = item;\n\n            var product_id = item.row.id,\n                item_type = item.row.type,\n                item_tax_method = parseFloat(item.row.tax_method),\n                combo_items = item.combo_items,\n                item_qty = item.row.qty,\n                item_aqty = parseFloat(item.row.quantity),\n                item_type = item.row.type,\n                item_ds = item.row.discount,\n                item_code = item.row.code,\n                item_name = item.row.name.replace(/\"/g, '&#034;').replace(/'/g, '&#039;');\n            var unit_price = parseFloat(item.row.real_unit_price);\n            var net_price = unit_price;\n            var item_comment = item.row.comment;\n            var item_was_ordered = item.row.ordered ? item.row.ordered : 0;\n\n            var ds = item_ds ? item_ds : '0';\n            var item_discount = formatDecimal(ds);\n            if (ds.indexOf('%') !== -1) {\n                var pds = ds.split('%');\n                if (!isNaN(pds[0])) {\n                    item_discount = formatDecimal(parseFloat((net_price * parseFloat(pds[0])) / 100), 4);\n                }\n            }\n            product_discount += formatDecimal(item_discount * item_qty, 4);\n            net_price = formatDecimal(net_price - item_discount, 4);\n\n            var pr_tax = parseFloat(item.row.tax),\n                pr_tax_val = 0;\n            if (pr_tax !== null && pr_tax != 0) {\n                if (item_tax_method == 0) {\n                    pr_tax_val = formatDecimal((net_price * parseFloat(pr_tax)) / (100 + parseFloat(pr_tax)), 4);\n                    net_price -= pr_tax_val;\n                    tax = lang.inclusive;\n                } else {\n                    pr_tax_val = formatDecimal((net_price * parseFloat(pr_tax)) / 100, 4);\n                    tax = lang.exclusive;\n                }\n            }\n            product_tax += formatDecimal(pr_tax_val * item_qty, 4);\n\n            var row_no = new Date().getTime();\n            var newTr = $(\n                '<tr id=\"' + row_no + '\" class=\"' + item_id + '\" data-item-id=\"' + item_id + '\" data-id=\"' + item.row.id + '\"></tr>'\n            );\n            tr_html =\n                '<td><input name=\"product_id[]\" type=\"hidden\" class=\"rid\" value=\"' +\n                product_id +\n                '\"><input name=\"item_comment[]\" type=\"hidden\" class=\"ritem_comment\" value=\"' +\n                item_comment +\n                '\"><input name=\"product_code[]\" type=\"hidden\" value=\"' +\n                item.row.code +\n                '\"><input name=\"product_name[]\" type=\"hidden\" value=\"' +\n                item.row.name +\n                '\"><button type=\"button\" class=\"btn bg-purple btn-block btn-xs edit\" id=\"' +\n                row_no +\n                '\" data-item=\"' +\n                item_id +\n                '\"><span class=\"sname\" id=\"name_' +\n                row_no +\n                '\">' +\n                item_name +\n                ' (' +\n                item_code +\n                ')</span></button></td>';\n            // <input class=\"rprice\" name=\"net_price[]\" type=\"hidden\" id=\"price_' + row_no + '\" value=\"' + formatDecimal(item_price) + '\">\n            tr_html +=\n                '<td class=\"text-right\"><input class=\"realuprice\" name=\"real_unit_price[]\" type=\"hidden\" value=\"' +\n                item.row.real_unit_price +\n                '\"><input class=\"rdiscount\" name=\"product_discount[]\" type=\"hidden\" id=\"discount_' +\n                row_no +\n                '\" value=\"' +\n                ds +\n                '\"><span class=\"text-right sprice\" id=\"sprice_' +\n                row_no +\n                '\">' +\n                formatMoney(parseFloat(net_price) + parseFloat(pr_tax_val)) +\n                '</span></td>';\n            tr_html +=\n                '<td><input name=\"item_was_ordered[]\" type=\"hidden\" class=\"riwo\" value=\"' +\n                item_was_ordered +\n                '\"><input class=\"form-control input-qty kb-pad text-center rquantity\" name=\"quantity[]\" type=\"text\" value=\"' +\n                formatDecimal(item_qty) +\n                '\" data-id=\"' +\n                row_no +\n                '\" data-item=\"' +\n                item_id +\n                '\" id=\"quantity_' +\n                row_no +\n                '\" onClick=\"this.select();\"></td>';\n            tr_html +=\n                '<td class=\"text-right\"><span class=\"text-right ssubtotal\" id=\"subtotal_' +\n                row_no +\n                '\">' +\n                formatMoney((parseFloat(net_price) + parseFloat(pr_tax_val)) * parseFloat(item_qty)) +\n                '</span></td>';\n            tr_html += '<td class=\"text-center\"><i class=\"fa fa-trash-o tip pointer posdel\" id=\"' + row_no + '\" title=\"Remove\"></i></td>';\n            newTr.html(tr_html);\n            newTr.prependTo('#posTable');\n            total += formatDecimal((parseFloat(net_price) + parseFloat(pr_tax_val)) * parseFloat(item_qty), 4);\n            count += parseFloat(item_qty);\n            an++;\n            // $('#list-table-div').scrollTop(0);\n            var oitb = $('#list-table-div')[0].scrollHeight;\n            $('#list-table-div').slimScroll({ scrollTo: oitb });\n            if (item_type == 'standard' && item_qty > item_aqty) {\n                $('#' + row_no).addClass('danger');\n                $('#' + row_no)\n                    .find('.edit')\n                    .removeClass('bg-purple')\n                    .addClass('btn-warning');\n            } else if (item_type == 'combo') {\n                if (combo_items === false) {\n                    $('#' + row_no).addClass('danger');\n                } else {\n                    $.each(combo_items, function() {\n                        if (parseFloat(this.quantity) < parseFloat(this.qty) * item_qty) {\n                            $('#' + row_no).addClass('danger');\n                            $('#' + row_no)\n                                .find('.edit')\n                                .removeClass('bg-purple')\n                                .addClass('btn-warning');\n                        }\n                    });\n                }\n            }\n\n            var comments = item_comment ? item_comment.split(/\\r?\\n/g) : [];\n            if (Settings.remote_printing != 1) {\n                b_items += '#' + (an - 1) + ' ' + item_name + ' (' + item_code + ')' + '\\n';\n                for (var i = 0, len = comments.length; i < len; i++) {\n                    b_items += comments[i].length > 0 ? '   * ' + comments[i] + '\\n' : '';\n                }\n                b_items +=\n                    printLine(\n                        item_qty +\n                            ' x ' +\n                            formatMoney(parseFloat(net_price) + parseFloat(pr_tax_val)) +\n                            ': ' +\n                            formatMoney((parseFloat(net_price) + parseFloat(pr_tax_val)) * parseFloat(item_qty))\n                    ) + '\\n';\n                o_items +=\n                    printLine('#' + (an - 1) + ' ' + item_name + ' (' + item_code + '): [ ' + (item_was_ordered != 0 ? 'xxxx' : item_qty)) +\n                    ' ]\\n';\n                for (var i = 0, len = comments.length; i < len; i++) {\n                    o_items += comments[i].length > 0 ? '   * ' + comments[i] + '\\n' : '';\n                }\n                o_items += '\\n';\n            } else {\n                var bprTr =\n                    '<tr class=\"row_' +\n                    item_id +\n                    '\" data-item-id=\"' +\n                    item_id +\n                    '\"><td colspan=\"2\">#' +\n                    (an - 1) +\n                    ' ' +\n                    (item_id == 0 ? item.row.name : item_name + ' (' + item_code + ')');\n                for (var i = 0, len = comments.length; i < len; i++) {\n                    bprTr += comments[i] ? '<br> <b>*</b> <small>' + comments[i] + '</small>' : '';\n                }\n                bprTr += '</td></tr>';\n                bprTr +=\n                    '<tr class=\"bb row_' +\n                    item_id +\n                    '\" data-item-id=\"' +\n                    item_id +\n                    '\"><td>(' +\n                    item_qty +\n                    ' x ' +\n                    formatMoney(parseFloat(net_price) + parseFloat(pr_tax_val)) +\n                    ')</td><td style=\"text-align:right;\">' +\n                    formatMoney((parseFloat(net_price) + parseFloat(pr_tax_val)) * parseFloat(item_qty)) +\n                    '</td></tr>';\n                var oprTr =\n                    '<tr class=\"bb row_' +\n                    item_id +\n                    '\" data-item-id=\"' +\n                    item_id +\n                    '\"><td>#' +\n                    (an - 1) +\n                    ' ' +\n                    item_name +\n                    ' (' +\n                    item_code +\n                    ')';\n                for (var i = 0, len = comments.length; i < len; i++) {\n                    oprTr += comments[i] ? '<br> <b>*</b> <small>' + comments[i] + '</small>' : '';\n                }\n                oprTr += '</td><td>[ ' + (item_was_ordered != 0 ? 'xxxx' : item_qty) + ' ]</td></tr>';\n                $('#order-table').append(oprTr);\n                $('#bill-table').append(bprTr);\n            }\n        });\n\n        var ds = get('spos_discount') ? get('spos_discount') : $('#discount_val').val() ? $('#discount_val').val() : '0';\n        order_discount = parseFloat(ds);\n        if (ds.indexOf('%') !== -1) {\n            var pds = ds.split('%');\n            order_discount = parseFloat((total * parseFloat(pds[0])) / 100);\n        }\n\n        var ts = get('spos_tax') ? get('spos_tax') : $('#tax_val').val() ? $('#tax_val').val() : '0';\n        order_tax = parseFloat(ts);\n        if (ts.indexOf('%') !== -1) {\n            var pts = ts.split('%');\n            order_tax = ((total - order_discount) * parseFloat(pts[0])) / 100;\n        }\n\n        var g_total = total - parseFloat(order_discount) + parseFloat(order_tax);\n        grand_total = formatMoney(g_total);\n        $('#ds_con').text('(' + formatMoney(product_discount) + ') ' + formatMoney(order_discount));\n        $('#ts_con').text(formatMoney(order_tax));\n        $('#total-payable').text(grand_total);\n        $('#total').text(formatMoney(total));\n        $('#count').text(an - 1 + ' (' + formatMoney(count - 1) + ')');\n\n        if (Settings.remote_printing != 1) {\n            order_data.items = o_items;\n            bill_data.items = b_items;\n            var b_totals = '';\n            b_totals += printLine(lang.total + ': ' + formatMoney(total)) + '\\n';\n            if (order_discount > 0 || product_discount > 0) {\n                b_totals += printLine(lang.discount + ': ' + formatMoney(order_discount + product_discount)) + '\\n';\n            }\n            if (order_tax != 0) {\n                b_totals += printLine(lang.order_tax + ': ' + formatMoney(order_tax)) + '\\n';\n            }\n            b_totals += printLine(lang.grand_total + ': ' + formatMoney(g_total)) + '\\n';\n            if (Settings.rounding != 0) {\n                round_total = roundNumber(g_total, parseInt(Settings.rounding));\n                var rounding = formatDecimal(round_total - g_total, 4);\n                b_totals += printLine(lang.rounding + ': ' + formatMoney(rounding)) + '\\n';\n                b_totals += printLine(lang.total_payable + ': ' + formatMoney(round_total)) + '\\n';\n            }\n            b_totals += '\\n' + lang.total_items + ': ' + (an - 1) + ' (' + (parseFloat(count) - 1) + ')' + '\\n';\n            bill_data.totals = b_totals;\n        } else {\n            var bill_totals = '';\n            bill_totals +=\n                '<tr class=\"bb\"><td>' +\n                lang.total_items +\n                '</td><td style=\"text-align:right;\">' +\n                (an - 1) +\n                ' (' +\n                (parseFloat(count) - 1) +\n                ')</td></tr>';\n            bill_totals += '<tr class=\"bb\"><td>' + lang.total + '</td><td style=\"text-align:right;\">' + formatMoney(total) + '</td></tr>';\n            if (order_discount > 0 || product_discount > 0) {\n                bill_totals +=\n                    '<tr class=\"bb\"><td>' +\n                    lang.discount +\n                    '</td><td style=\"text-align:right;\">' +\n                    formatMoney(order_discount + product_discount) +\n                    '</td></tr>';\n            }\n            if (order_tax != 0) {\n                bill_totals +=\n                    '<tr class=\"bb\"><td>' + lang.order_tax + '</td><td style=\"text-align:right;\">' + formatMoney(order_tax) + '</td></tr>';\n            }\n            bill_totals +=\n                '<tr class=\"bb\"><td>' + lang.grand_total + '</td><td style=\"text-align:right;\">' + formatMoney(g_total) + '</td></tr>';\n            if (Settings.rounding != 0) {\n                round_total = roundNumber(g_total, parseInt(Settings.rounding));\n                var rounding = formatDecimal(round_total - g_total, 4);\n                bill_totals +=\n                    '<tr class=\"bb\"><td>' + lang.rounding + '</td><td style=\"text-align:right;\">' + formatMoney(rounding) + '</td></tr>';\n                bill_totals +=\n                    '<tr class=\"bb\"><td>' +\n                    lang.total_payable +\n                    '</td><td style=\"text-align:right;\">' +\n                    formatMoney(round_total) +\n                    '</td></tr>';\n            }\n            bill_totals += '<tr class=\"bb\"><td colspan=\"2\" style=\"text-align:center;\">' + lang.merchant_copy + '</td></tr>';\n            $('#bill-total-table').empty();\n            $('#bill-total-table').append(bill_totals);\n        }\n\n        if (Settings.display_kb == 1) {\n            display_keyboards();\n        }\n        $('#add_item').focus();\n    }\n}\n\nfunction chr(i) {\n    return String.fromCharCode(i);\n}\n\n$(document).ready(function() {\n    $(document).on('click', '.no-results, #filter-suspended-sales', function(e) {\n        e.preventDefault();\n        e.stopPropagation();\n    });\n\n    $('#susModal').on('shown.bs.modal', function(e) {\n        $('#reference_note').focus();\n    });\n\n    $('#filter-categories').hideseek({\n        nodata: lang.no_match_found,\n    });\n\n    $(document).on('click', '.suspended_sales .dropdown-menu .header', function(e) {\n        e.stopPropagation();\n    });\n\n    $('#filter-suspended-sales').hideseek({\n        nodata: lang.no_match_found,\n    });\n\n    $('#suspended_sales').on('shown.bs.dropdown', function() {\n        $('#filter-suspended-sales').focus();\n    });\n\n    $(document).on('click', '#update-note', function() {\n        var n = $('#snote').val();\n        store('spos_note', n);\n        $('#note').val(n);\n        $('#noteModal').modal('hide');\n    });\n    /* =============================\n    Edit Item Modal\n    ============================= */\n\n    $('#posTable').on('click', '.edit', function() {\n        var row = $(this).closest('tr');\n        var id = row.attr('id');\n        var item_id = row.attr('data-item-id');\n        var item_rid = row.attr('data-id');\n        var item = spositems[item_id];\n        //var unit_price = parseFloat(item.row.real_unit_price);\n        var unit_price = formatDecimal(row.find('.realuprice').val());\n        var net_price = unit_price;\n        var ds = item.row.discount ? item.row.discount : '0';\n        item_discount = formatDecimal(parseFloat(ds));\n        if (ds.indexOf('%') !== -1) {\n            var pds = ds.split('%');\n            if (!isNaN(pds[0])) {\n                item_discount = formatDecimal((net_price * parseFloat(pds[0])) / 100);\n            }\n        }\n        net_price -= item_discount;\n        var pr_tax = parseFloat(item.row.tax),\n            pr_tax_val = 0,\n            tax = '';\n        if (pr_tax !== null && pr_tax != 0) {\n            if (parseFloat(item.row.tax_method) == 0) {\n                pr_tax_val = formatDecimal((net_price * parseFloat(pr_tax)) / (100 + parseFloat(pr_tax)));\n                net_price -= pr_tax_val;\n                tax = lang.inclusive;\n            } else {\n                pr_tax_val = formatDecimal((net_price * parseFloat(pr_tax)) / 100);\n                tax = lang.exclusive;\n            }\n        }\n        console.log(item_rid, item_id, id);\n        $('#proModalLabel').html('<a href=\"' + base_url + '/products/view/' + item_rid + '\" data-toggle=\"ajax\">' + item.label + '</a>');\n        $('#net_price').text(formatMoney(net_price));\n        $('#pro_tax').text(formatMoney(pr_tax_val));\n        $('#pro_tax_method').text('(' + tax + ')');\n        $('#row_id').val(row_id);\n        $('#item_id').val(item_id);\n        $('#nPrice').val(unit_price);\n        $('#nQuantity').val(item.row.qty);\n        $('#nDiscount').val(ds);\n        $('#nComment').val(item.row.comment);\n        $('#proModal').modal({ backdrop: 'static' });\n    });\n\n    $(document).on('change', '#nPrice, #nDiscount', function() {\n        var item_id = $('#item_id').val();\n        var unit_price = parseFloat($('#nPrice').val());\n        var net_price = unit_price;\n        var item = spositems[item_id];\n        var ds = $('#nDiscount').val() ? $('#nDiscount').val() : '0';\n        item_discount = formatDecimal(parseFloat(ds));\n        if (ds.indexOf('%') !== -1) {\n            var pds = ds.split('%');\n            if (!isNaN(pds[0])) {\n                item_discount = formatDecimal((unit_price * parseFloat(pds[0])) / 100);\n            }\n        }\n        net_price -= item_discount;\n        var pr_tax = parseFloat(item.row.tax),\n            pr_tax_val = 0;\n        if (pr_tax !== null && pr_tax != 0) {\n            if (parseFloat(item.row.tax_method) == 0) {\n                pr_tax_val = formatDecimal((net_price * parseFloat(pr_tax)) / (100 + parseFloat(pr_tax)));\n                net_price -= pr_tax_val;\n                tax = lang.inclusive;\n            } else {\n                pr_tax_val = formatDecimal((net_price * parseFloat(pr_tax)) / 100);\n                tax = lang.exclusive;\n            }\n        }\n\n        $('#net_price').text(formatMoney(net_price));\n        $('#pro_tax').text(formatMoney(pr_tax_val));\n    });\n\n    /* =============================\n    Edit Item Method\n    ============================= */\n    $(document).on('click', '#editItem', function() {\n        var item_id = $('#item_id').val();\n        var price = parseFloat($('#nPrice').val());\n        if (!is_valid_discount($('#nDiscount').val())) {\n            bootbox.alert(lang.unexpected_value);\n            return false;\n        }\n        (spositems[item_id].row.qty = parseFloat($('#nQuantity').val())),\n            (spositems[item_id].row.real_unit_price = price),\n            (spositems[item_id].row.comment = $('#nComment').val()),\n            (spositems[item_id].row.discount = $('#nDiscount').val() ? $('#nDiscount').val() : '0'),\n            localStorage.setItem('spositems', JSON.stringify(spositems));\n        $('#proModal').modal('hide');\n\n        loadItems();\n        return;\n    });\n\n    /* =============================\n    Row quantity change\n    ============================= */\n    $(document).on('change', '.rquantity', function() {\n        var row = $(this).closest('tr');\n        if (!is_numeric($(this).val()) || $(this).val() == 0) {\n            loadItems();\n            bootbox.alert(lang.unexpected_value);\n            return false;\n        }\n        var new_qty = parseFloat($(this).val()),\n            item_id = row.attr('data-item-id');\n        spositems[item_id].row.qty = new_qty;\n        localStorage.setItem('spositems', JSON.stringify(spositems));\n        loadItems();\n    });\n\n    $('#reset').click(function(e) {\n        if (count <= 1) {\n            return false;\n        }\n        if (protect_delete == 1) {\n            var boxd = bootbox.dialog({\n                title: lang.enter_pin_code,\n                closeButton: true,\n                message: '<input id=\"pos_pin\" name=\"pos_pin\" type=\"password\" placeholder=\"Pin Code\" class=\"form-control kb-pad\"> ',\n                buttons: {\n                    danger: {\n                        label: lang.close,\n                        className: 'btn-default pull-left',\n                        callback: function() {},\n                    },\n                    success: {\n                        label: \"<i class='fa fa-tick'></i> \" + lang.delete,\n                        className: 'btn-warning verify_pin',\n                        callback: function() {\n                            var pos_pin = md5($('#pos_pin').val());\n                            if (pos_pin == Settings.pin_code) {\n                                if (get('spositems')) {\n                                    remove('spositems');\n                                }\n                                if (get('spos_tax')) {\n                                    remove('spos_tax');\n                                }\n                                if (get('spos_discount')) {\n                                    remove('spos_discount');\n                                }\n                                if (get('spos_customer')) {\n                                    remove('spos_customer');\n                                }\n                                window.location.href = base_url + 'pos';\n                            } else {\n                                bootbox.alert(lang.wrong_pin);\n                            }\n                        },\n                    },\n                },\n            });\n            boxd.on('shown.bs.modal', function() {\n                if (Settings.display_kb == 1) {\n                    display_keyboards();\n                }\n                $('#pos_pin')\n                    .focus()\n                    .keypress(function(e) {\n                        if (e.keyCode == 13) {\n                            e.preventDefault();\n                            $('.verify_pin').trigger('click');\n                            return false;\n                        }\n                    });\n            });\n        } else {\n            bootbox.confirm(lang.r_u_sure, function(result) {\n                if (result) {\n                    if (get('spositems')) {\n                        remove('spositems');\n                    }\n                    if (get('spos_tax')) {\n                        remove('spos_tax');\n                    }\n                    if (get('spos_discount')) {\n                        remove('spos_discount');\n                    }\n                    if (get('spos_customer')) {\n                        remove('spos_customer');\n                    }\n                    window.location.href = base_url + 'pos';\n                }\n            });\n        }\n    });\n\n    $('#print_order').click(function(e) {\n        e.preventDefault();\n        if (count <= 1) {\n            bootbox.alert(lang.please_add_product);\n        } else {\n            if (Settings.remote_printing == 0) {\n                $('#order-data').show();\n                if (Settings.print_img == 1) {\n                    $('#preo').html(\n                        '<pre style=\"background:#FFF;font-size:20px;margin:0;border:0;color:#000 !important;\">' + order_data.info + order_data.items + '</pre>'\n                    );\n                    var element = $('#order-data').get(0);\n                    html2canvas(element, {scrollY: 0, scale: 1.7}).then(function(canvas) {\n                        var img = canvas.toDataURL().split(',')[1];\n                        $.post(base_url + 'pos/receipt_img', { img: img, spos_token: csrf_hash });\n                        // return Canvas2Image.saveAsPNG(canvas);\n                    });\n                } else {\n                    var form = $('#pos-sale-form').serialize();\n                    $.post(base_url + 'pos/p/order', form);\n                }\n            } else {\n                printOrder(order_data);\n            }\n        }\n        setTimeout(function() {\n            $('#order-data').hide();\n        }, 500);\n        return false;\n    });\n\n    $('#print_bill').click(function(e) {\n        e.preventDefault();\n        if (count <= 1) {\n            bootbox.alert(lang.please_add_product);\n        } else {\n            if (Settings.remote_printing == 0) {\n                $('#bill-data').show();\n                if (Settings.print_img == 1) {\n                    $('#preb').html(\n                        '<pre style=\"background:#FFF;font-size:20px;margin:0;border:0;color:#000 !important;\">' +\n                            bill_data.info +\n                            bill_data.items +\n                            '\\n' +\n                            bill_data.totals +\n                            '</pre>'\n                    );\n                var element = $('#bill-data').get(0);\n                html2canvas(element, {scrollY: 0, scale: 1.7}).then(function(canvas) {\n                    var img = canvas.toDataURL().split(',')[1];\n                    $.post(base_url + 'pos/receipt_img', { img: img, spos_token: csrf_hash });\n                    // return Canvas2Image.saveAsPNG(canvas);\n                });\n                } else {\n                    var form = $('#pos-sale-form').serialize();\n                    $.post(base_url + 'pos/p/bill', form);\n                }\n            } else {\n                printBill(bill_data);\n            }\n        }\n        setTimeout(function() {\n            $('#bill-data').hide();\n        }, 500);\n        return false;\n    });\n\n    $('#updateDiscount').click(function() {\n        var ds = $('#get_ds').val() ? $('#get_ds').val() : '0';\n        var apply_to = $('input[name=apply_to]:checked').val();\n        if (ds.length != 0) {\n            if (apply_to == 'order') {\n                $('#discount_val').val(ds);\n                store('spos_discount', ds);\n                if (ds.indexOf('%') !== -1) {\n                    var pds = ds.split('%');\n\n                    order_discount = (total * parseFloat(pds[0])) / 100;\n                    order_tax = calTax();\n                    var g_total = total + order_tax - order_discount;\n                    grand_total = parseFloat(g_total);\n                    $('#ds_con').text('(' + formatMoney(product_discount) + ') ' + formatMoney(order_discount));\n                    $('#total-payable').text(formatMoney(grand_total));\n                } else {\n                    order_discount = ds;\n                    order_tax = calTax();\n                    var g_total = total + order_tax - parseFloat(order_discount);\n                    grand_total = parseFloat(g_total);\n                    $('#ds_con').text('(' + formatMoney(product_discount) + ') ' + formatMoney(order_discount));\n                    $('#total-payable').text(formatMoney(grand_total));\n                }\n            } else if (apply_to == 'products') {\n                var items = {};\n                spositems = JSON.parse(get('spositems'));\n                $.each(spositems, function() {\n                    this.row.discount = ds;\n                });\n                store('spositems', JSON.stringify(spositems));\n            }\n            loadItems();\n            $('#dsModal').modal('hide');\n        }\n    });\n\n    $('#add_discount').click(function() {\n        var dval = $('#discount_val').val();\n        $('#get_ds').val(dval);\n        $('#dsModal').modal({ backdrop: 'static' });\n        return false;\n    });\n    $('#dsModal').on('shown.bs.modal', function() {\n        $('#get_ds').focusToEnd();\n    });\n\n    $('#updateTax').click(function() {\n        var ts = $('#get_ts').val();\n        if (ts.length != 0) {\n            $('#tax_val').val(ts);\n            store('spos_tax', ts);\n            if (ts.indexOf('%') !== -1) {\n                var pts = ts.split('%');\n                if (!isNaN(pts[0])) {\n                    order_tax = ((total - order_discount) * parseFloat(pts[0])) / 100;\n                    var g_total = total + order_tax - order_discount;\n                    grand_total = parseFloat(g_total);\n                    $('#ts_con').text(formatMoney(order_tax));\n                    $('#total-payable').text(formatMoney(grand_total));\n                } else {\n                    $('#get_ts').val('0');\n                    $('#tax_val').val('0');\n                    var g_total = total - order_discount;\n                    grand_total = parseFloat(g_total);\n                    $('#ts_con').text('0');\n                    $('#total-payable').text(formatMoney(grand_total));\n                }\n            } else {\n                if (!isNaN(ts) && ts != 0) {\n                    order_tax = ts;\n                    var g_total = total + parseFloat(ts) - order_discount;\n                    grand_total = parseFloat(g_total);\n                    $('#ts_con').text(formatMoney(order_tax));\n                    $('#total-payable').text(formatMoney(grand_total));\n                } else {\n                    $('#get_ts').val('0');\n                    $('#tax_val').val('0');\n                    var g_total = total - order_discount;\n                    grand_total = parseFloat(g_total);\n                    $('#ts_con').text('0');\n                    $('#total-payable').text(formatMoney(grand_total));\n                }\n            }\n            $('#tsModal').modal('hide');\n        }\n    });\n\n    $('#add_tax').click(function() {\n        var tval = $('#tax_val').val();\n        $('#get_ts').val(tval);\n        $('#tsModal').modal({ backdrop: 'static' });\n        return false;\n    });\n    $('#tsModal').on('shown.bs.modal', function() {\n        $('#get_ts').focusToEnd();\n    });\n    $('#noteModal').on('shown.bs.modal', function() {\n        $('#snote').focusToEnd();\n    });\n\n    $(document).on('click', '.product', function(e) {\n        code = $(this).val();\n        $.ajax({\n            type: 'get',\n            url: base_url + 'pos/get_product/' + code,\n            dataType: 'json',\n            success: function(data) {\n                if (data !== null) {\n                    add_invoice_item(data);\n                } else {\n                    bootbox.alert(lang.no_match_found);\n                }\n            },\n        });\n    });\n\n    $(document).on('click', '.category', function() {\n        var cid = $(this).attr('id');\n        if (cat_id != cid) {\n            cat_id = cid;\n            $.ajax({\n                type: 'get',\n                url: base_url + 'pos/ajaxproducts',\n                data: { category_id: cat_id, tcp: 1 },\n                dataType: 'json',\n                success: function(data) {\n                    p_page = 'n';\n                    // $('#categories-list').addClass('control-sidebar-open');\n                    //ocat_id = cat_id;\n                    tcp = data.tcp;\n                    $('.items').html(data.products);\n                    $('.category').removeClass('active');\n                    $('#' + cat_id).addClass('active');\n                    nav_pointer();\n                },\n            });\n        }\n        return false;\n    });\n    $('#category-' + cat_id).addClass('active');\n\n    $('#next').click(function() {\n        if (p_page == 'n') {\n            p_page = 0;\n        }\n        p_page += pro_limit;\n        if (tcp >= pro_limit && p_page < tcp) {\n            $.ajax({\n                type: 'get',\n                url: base_url + 'pos/ajaxproducts',\n                data: { category_id: cat_id, per_page: p_page },\n                dataType: 'html',\n                success: function(data) {\n                    $('.items').html(data);\n                    nav_pointer();\n                },\n            });\n        } else {\n            p_page -= pro_limit;\n        }\n    });\n\n    $('#previous').click(function() {\n        if (p_page == 'n') {\n            p_page = 0;\n        }\n        if (p_page != 0) {\n            p_page -= pro_limit;\n            if (p_page == 0) {\n                p_page = 'n';\n            }\n            $.ajax({\n                type: 'get',\n                url: base_url + 'pos/ajaxproducts',\n                data: { category_id: cat_id, per_page: p_page },\n                dataType: 'html',\n                success: function(data) {\n                    $('.items').html(data);\n                    nav_pointer();\n                },\n            });\n        }\n    });\n\n    $('#add_item').autocomplete({\n        source: base_url + 'pos/suggestions',\n        minLength: 1,\n        autoFocus: false,\n        delay: 200,\n        response: function(event, ui) {\n            if ($(this).val().length >= 16 && ui.content[0].id == 0) {\n                bootbox.alert(lang.no_match_found, function() {\n                    $('#add_item').focus();\n                });\n                $(this).val('');\n            } else if (ui.content.length == 1 && ui.content[0].id != 0) {\n                ui.item = ui.content[0];\n                $(this)\n                    .data('ui-autocomplete')\n                    ._trigger('select', 'autocompleteselect', ui);\n                $(this).autocomplete('close');\n            } else if (ui.content.length == 1 && ui.content[0].id == 0) {\n                bootbox.alert(lang.no_match_found, function() {\n                    $('#add_item').focus();\n                });\n                $(this).val('');\n            }\n        },\n        select: function(event, ui) {\n            event.preventDefault();\n            if (ui.item.id !== 0) {\n                var row = add_invoice_item(ui.item);\n                if (row) $(this).val('');\n            } else {\n                bootbox.alert(lang.no_match_found);\n            }\n        },\n    });\n\n    $('#add_item').bind('keypress', function(e) {\n        if (e.keyCode == 13) {\n            e.preventDefault();\n            $(this).autocomplete('search');\n        }\n    });\n\n    $('#add_item').focus();\n    $('#gccard_no').inputmask('9999 9999 9999 9999');\n    $('#gift_card_no').inputmask('9999 9999 9999 9999');\n    $('#gcexpiry').inputmask('yyyy-mm-dd', { placeholder: 'yyyy-mm-dd' });\n    $('#genNo').click(function() {\n        var no = generateCardNo();\n        $(this)\n            .parent()\n            .parent('.input-group')\n            .children('input')\n            .val(no);\n        return false;\n    });\n\n    $(document).on('click', '#sellGiftCard', function(e) {\n        if (count == 1) {\n            spositems = {};\n        }\n        $('#gcModal').modal({ backdrop: 'static' });\n    });\n\n    $(document).on('click', '#addGiftCard', function(e) {\n        var mid = 0,\n            gccode = $('#gccard_no').val(),\n            gcname = $('#gcname').val(),\n            gcvalue = $('#gcvalue').val(),\n            gcprice = parseFloat($('#gcprice').val());\n        gcexpiry = $('#gcexpiry').val();\n        if (gccode == '' || gcvalue == '' || gcprice == '' || gcvalue == 0 || gcprice == 0) {\n            $('#gcerror').text(lang.file_required_fields);\n            $('.gcerror-con').show();\n            return false;\n        }\n        var gc_data = new Array();\n        gc_data[0] = gccode;\n        gc_data[1] = gcvalue;\n        gc_data[2] = gcexpiry;\n\n        $.ajax({\n            type: 'get',\n            url: base_url + 'gift_cards/sell_gift_card',\n            dataType: 'json',\n            data: { gcdata: gc_data },\n            success: function(data) {\n                if (data.result === 'success') {\n                    spositems[mid] = {\n                        id: mid,\n                        item_id: mid,\n                        label: gcname + ' (' + gccode + ')',\n                        row: {\n                            id: mid,\n                            code: gccode,\n                            name: gcname,\n                            quantity: 1,\n                            price: gcprice,\n                            real_unit_price: gcprice,\n                            tax: 0,\n                            qty: 1,\n                            type: 'manual',\n                            discount: '0',\n                            comment: '',\n                        },\n                    };\n                    store('spositems', JSON.stringify(spositems));\n                    loadItems();\n                    $('#gcModal').modal('hide');\n                    $('#gccard_no').val('');\n                    $('#gcvalue').val('');\n                    $('#gcprice').val('');\n                } else {\n                    $('#gcerror').text(data.message);\n                    $('.gcerror-con').show();\n                }\n            },\n        });\n    });\n\n    // $('#opModal').bind().on('click', 'a', function(){\n    //     var pg = $.url($(this).attr(\"href\")).param(\"per_page\");\n    //     $.get( base_url+'pos/ob_page&per_page='+pg, function( data ) {\n    //         $( \".html_con\" ).html( data.pd );\n    //         $( \".page_con\" ).html( data.page );\n    //     }, \"json\");\n\n    //     return false;\n    // });\n\n    var pwacc = false;\n    $(document).on('click', '.posdel', function() {\n        var row = $(this).closest('tr');\n        var item_id = row.attr('data-item-id');\n        if (protect_delete == 1) {\n            var boxd = bootbox.dialog({\n                title: lang.enter_pin_code,\n                closeButton: true,\n                message: '<input id=\"pos_pin\" name=\"pos_pin\" type=\"password\" placeholder=\"Pin Code\" class=\"form-control kb-pad\"> ',\n                buttons: {\n                    danger: {\n                        label: lang.close,\n                        className: 'btn-default pull-left',\n                        callback: function() {},\n                    },\n                    success: {\n                        label: \"<i class='fa fa-tick'></i> \" + lang.delete,\n                        className: 'btn-warning verify_pin',\n                        callback: function() {\n                            var pos_pin = md5($('#pos_pin').val());\n                            if (pos_pin == Settings.pin_code) {\n                                delete spositems[item_id];\n                                row.remove();\n                                if (spositems.hasOwnProperty(item_id)) {\n                                } else {\n                                    localStorage.setItem('spositems', JSON.stringify(spositems));\n                                    loadItems();\n                                }\n                            } else {\n                                bootbox.alert(lang.wrong_pin);\n                            }\n                        },\n                    },\n                },\n            });\n            boxd.on('shown.bs.modal', function() {\n                if (Settings.display_kb == 1) {\n                    display_keyboards();\n                }\n                $('#pos_pin')\n                    .focus()\n                    .keypress(function(e) {\n                        if (e.keyCode == 13) {\n                            e.preventDefault();\n                            $('.verify_pin').trigger('click');\n                            return false;\n                        }\n                    });\n            });\n        } else {\n            delete spositems[item_id];\n            row.remove();\n            if (spositems.hasOwnProperty(item_id)) {\n            } else {\n                localStorage.setItem('spositems', JSON.stringify(spositems));\n                loadItems();\n            }\n        }\n        return false;\n    });\n\n    $('#suspend').click(function() {\n        if (count <= 1) {\n            bootbox.alert(lang.please_add_product);\n            return false;\n        } else {\n            $('#susModal').modal({ backdrop: 'static' });\n        }\n    });\n\n    $('#suspend_sale').click(function() {\n        ref = $('#reference_note').val();\n        if (!ref || ref == '') {\n            bootbox.alert(lang.type_reference_note);\n            return false;\n        } else {\n            suspend = $('<span></span>');\n            if (sid !== 0) {\n                suspend.html(\n                    '<input type=\"hidden\" name=\"delete_id\" value=\"' +\n                        sid +\n                        '\" /><input type=\"hidden\" name=\"suspend\" value=\"yes\" /><input type=\"hidden\" name=\"suspend_note\" value=\"' +\n                        ref +\n                        '\" />'\n                );\n            } else {\n                suspend.html(\n                    '<input type=\"hidden\" name=\"suspend\" value=\"yes\" /><input type=\"hidden\" name=\"suspend_note\" value=\"' + ref + '\" />'\n                );\n            }\n            suspend.appendTo('#hidesuspend');\n            $('#pos-sale-form').submit();\n        }\n    });\n\n    $('#payment').click(function() {\n        if (count <= 1) {\n            bootbox.alert(lang.please_add_product);\n            return false;\n        } else {\n            if (sid) {\n                suspend = $('<span></span>');\n                suspend.html('<input type=\"hidden\" name=\"delete_id\" value=\"' + sid + '\" />');\n                suspend.appendTo('#hidesuspend');\n            }\n\n            gtotal = formatDecimal(total - order_discount + order_tax);\n            if (Settings.rounding != 0) {\n                round_total = roundNumber(gtotal, parseInt(Settings.rounding));\n                var rounding = formatDecimal(round_total - gtotal);\n                $('#twt').text(formatMoney(round_total) + ' (' + formatMoney(rounding) + ')');\n                $('#quick-payable').text(round_total);\n            } else {\n                $('#twt').text(formatMoney(gtotal));\n                $('#quick-payable').text(gtotal);\n            }\n            $('#item_count').text(an - 1 + ' (' + (count - 1) + ')');\n            $('#order_quantity').val(count - 1);\n            $('#order_items').val(an - 1);\n            $('#balance').text('0.00');\n            $('#payModal').modal({ backdrop: 'static' });\n        }\n    });\n    $('#payModal').on('shown.bs.modal', function(e) {\n        $('#amount')\n            .focus()\n            .val(0);\n        $('#quick-payable').click();\n    });\n    $('#payModal').on('hidden.bs.modal', function(e) {\n        $('#amount')\n            .val('')\n            .change();\n    });\n\n    $('#amount').change(function(e) {\n        var total_paying = $('.amount').val();\n        $('#total_paying').text(formatMoney(total_paying));\n        if (Settings.rounding != 0) {\n            $('#balance').text(formatMoney(total_paying - round_total));\n            $('#balance_val').val(formatDecimal(total_paying - round_total));\n            total_paid = total_paying;\n            grand_total = round_total;\n        } else {\n            $('#balance').text(formatMoney(total_paying - gtotal));\n            $('#balance_val').val(formatDecimal(total_paying - gtotal));\n            total_paid = total_paying;\n            grand_total = gtotal;\n        }\n    });\n\n    $('#add-customer').click(function() {\n        $('#customerModal').modal({ backdrop: 'static' });\n    });\n\n    $('#payModal').on('change', '#paid_by', function() {\n        $('#clear-cash-notes').click();\n        $('#amount').val(grand_total);\n        var p_val = $(this).val();\n        $('#paid_by_val').val(p_val);\n        var gtotal = formatDecimal(total - order_discount + order_tax);\n        if (Settings.rounding != 0) {\n            var rounded_total = formatDecimal(roundNumber(gtotal, parseInt(Settings.rounding)));\n        } else {\n            var rounded_total = formatDecimal(gtotal);\n        }\n        $('#rpaidby').val(p_val);\n        if (p_val == 'gift_card') {\n            $('.gc').slideDown();\n            $('.ngc').slideUp('fast');\n            setTimeout(function() {\n                $('#gift_card_no').focus();\n            }, 10);\n            $('#amount').attr('readonly', true);\n        } else {\n            $('.ngc').slideDown();\n            $('.gc').slideUp('fast');\n            $('#gc_details').html('');\n            $('#amount').attr('readonly', false);\n        }\n        if (p_val == 'cash' || p_val == 'other') {\n            $('.pcash').slideDown();\n            $('.pcheque').slideUp('fast');\n            $('.pcc').slideUp('fast');\n            setTimeout(function() {\n                $('#amount').focus();\n            }, 10);\n        } else if (p_val == 'CC' || p_val == 'stripe') {\n            $('.pcc').slideDown();\n            $('.pcheque').slideUp('fast');\n            $('.pcash').slideUp('fast');\n            $('#amount').val(rounded_total);\n            setTimeout(function() {\n                $('#swipe')\n                    .val('')\n                    .focus();\n            }, 10);\n        } else if (p_val == 'cheque') {\n            $('.pcheque').slideDown();\n            $('.pcc').slideUp('fast');\n            $('.pcash').slideUp('fast');\n            $('#amount').val(rounded_total);\n            setTimeout(function() {\n                $('#cheque_no').focus();\n            }, 10);\n        } else {\n            $('.pcheque').hide();\n            $('.pcc').hide();\n            $('.pcash').hide();\n        }\n    });\n\n    $(document).on('change', '.gift_card_no', function() {\n        var cn = $(this).val() ? $(this).val() : '';\n        if (cn != '') {\n            $.ajax({\n                type: 'get',\n                async: false,\n                url: base_url + 'pos/validate_gift_card/' + cn,\n                dataType: 'json',\n                success: function(data) {\n                    if (data === false || data.balance < 0) {\n                        $('#gift_card_no')\n                            .parent('.form-group')\n                            .addClass('has-error');\n                        bootbox.alert(lang.incorrect_gift_card);\n                    } else {\n                        $('#gc_details').html(\n                            lang.card_no +\n                                ': ' +\n                                data.card_no +\n                                '<br>' +\n                                lang.value +\n                                ': ' +\n                                data.value +\n                                ' - ' +\n                                lang.balance +\n                                ': ' +\n                                data.balance\n                        );\n                        $('#gift_card_no')\n                            .parent('.form-group')\n                            .removeClass('has-error');\n                        var paying = gtotal > data.balance ? data.balance : gtotal;\n                        $('#amount_val').val(paying);\n                        $('#amount').val(paying);\n                    }\n                },\n            });\n        }\n        return false;\n    });\n\n    $(document).on('click', '#quick-payable', function() {\n        $('#clear-cash-notes').click();\n        $(this).append('<span class=\"badge\">1</span>');\n        $('#amount').val(grand_total);\n    });\n\n    $(document).on('click', '.quick-cash', function() {\n        if ($('#quick-payable').find('span.badge').length) {\n            $('#clear-cash-notes').click();\n        }\n        var $quick_cash = $(this);\n        var amt = $quick_cash\n            .contents()\n            .filter(function() {\n                return this.nodeType == 3;\n            })\n            .text();\n        var th = Settings.thousands_sep == 0 ? '' : Settings.thousands_sep;\n        var $pi = $('#amount');\n        amt = formatDecimal(amt.split(th).join('')) * 1 + $pi.val() * 1;\n        $pi.val(formatDecimal(amt))\n            .change()\n            .focus();\n        var note_count = $quick_cash.find('span');\n        if (note_count.length == 0) {\n            $quick_cash.append('<span class=\"badge\">1</span>');\n        } else {\n            note_count.text(parseInt(note_count.text()) + 1);\n        }\n    });\n\n    $(document).on('click', '#clear-cash-notes', function() {\n        $('.quick-cash')\n            .find('.badge')\n            .remove();\n        $('#amount')\n            .val('')\n            .change()\n            .focus();\n    });\n\n    $('#payModal').on('change', '#amount, #paid_by', function(e) {\n        $('#amount_val').val($('#amount').val());\n    });\n    $('#payModal').on('blur', '#amount', function(e) {\n        $('#amount_val').val($('#amount').val());\n    });\n    $('#payModal').on('select2-close', '#paid_by', function(e) {\n        $('#paid_by_val').val($(this).val());\n    });\n    $('#payModal').on('change', '#pcc_no', function(e) {\n        $('#cc_no_val').val($(this).val());\n    });\n    $('#payModal').on('change', '#pcc_holder', function(e) {\n        $('#cc_holder_val').val($(this).val());\n    });\n    $('#payModal').on('change', '#gift_card_no', function(e) {\n        $('#paying_gift_card_no_val').val($(this).val());\n    });\n    $('#payModal').on('change', '#pcc_month', function(e) {\n        $('#cc_month_val').val($(this).val());\n    });\n    $('#payModal').on('change', '#pcc_year', function(e) {\n        $('#cc_year_val').val($(this).val());\n    });\n    $('#payModal').on('change', '#pcc_type', function(e) {\n        $('#cc_type_val').val($(this).val());\n    });\n    $('#payModal').on('change', '#pcc_cvv2', function(e) {\n        $('#cc_cvv2_val').val($(this).val());\n    });\n    $('#payModal').on('change', '#cheque_no', function(e) {\n        $('#cheque_no_val').val($(this).val());\n    });\n    $('#payModal').on('change', '#payment_note', function(e) {\n        $('#payment_note_val').val($(this).val());\n    });\n    $('#payModal').on('change', '#note', function(e) {\n        var n = $(this).val();\n        store('spos_note', n);\n        $('#spos_note').val(n);\n    });\n    if ((spos_note = get('spos_note'))) {\n        $('#note').val(spos_note);\n        $('#snote').val(spos_note);\n    }\n    $('#spos_customer').change(function(e) {\n        store('spos_customer', $(this).val());\n    });\n    if ((spos_customer = get('spos_customer'))) {\n        $('#spos_customer').select2('val', spos_customer);\n    }\n\n    $('.treeview').hover(function(e) {\n        var wh = $(document).height();\n        var top = $(this).offset().top;\n        var menu = $(this).find('.treeview-menu');\n        var menuh = menu.height() + 44;\n        if (wh - top < menuh) {\n            $(this)\n                .find('a')\n                .children('span')\n                .addClass('popup');\n            menu.addClass('popup');\n        } else {\n            $(this)\n                .find('a')\n                .children('span')\n                .removeClass('popup');\n            menu.removeClass('popup');\n        }\n    });\n\n    $('body').click(function(e) {\n        if (\n            !$(e.target).hasClass('sidebar-icon') &&\n            !$(e.target).hasClass('sb') &&\n            $('#categories-list').hasClass('control-sidebar-open')\n        ) {\n            $('#categories-list').removeClass('control-sidebar-open');\n        }\n    });\n\n    $('#submit-sale').click(function() {\n        $('#total_items').val(an - 1);\n        $('#total_quantity').val(count - 1);\n        // console.log($('#amount_val').val());\n        $('#submit').click();\n    });\n\n    var hold_ref = $('#hold_ref').val();\n    $('#hold_ref').change(function() {\n        hold_ref = $(this).val();\n        $('#reference_note').val(hold_ref);\n    });\n    $('#reference_note').change(function() {\n        hold_ref = $(this).val();\n        $('#hold_ref').val(hold_ref);\n    });\n\n    $('#suspend_sale').click(function() {\n        if ($('#reference_note').val()) {\n            $('#hold_ref').val($('#reference_note').val());\n            $('#total_items').val(an - 1);\n            $('#total_quantity').val(count - 1);\n            $('#submit').click();\n        }\n        return false;\n    });\n\n    $('#customer-form').on('submit', function(e) {\n        e.preventDefault();\n        $.ajax({\n            type: 'post',\n            url: base_url + 'customers/add',\n            data: $(this).serialize(),\n            dataType: 'json',\n            success: function(res) {\n                if (res.status == 'success') {\n                    $('#spos_customer').append(\n                        $('<option></option>')\n                            .attr('value', res.id)\n                            .text(res.val)\n                    );\n                    $('#spos_customer').select2('val', res.id);\n                    $('#customerModal').modal('hide');\n                } else {\n                    $('#c-alert').html(res.msg);\n                    $('#c-alert').show();\n                }\n            },\n            error: function() {\n                bootbox.alert(lang.customer_request_failed);\n                return false;\n            },\n        });\n        return false;\n    });\n\n    $('#customerModal').on('hidden.bs.modal', function(e) {\n        $('#c-alert').hide();\n        $('#cname').val('');\n        $('#cemail').val('');\n        $('#cphone').val('');\n        $('#cf1').val('');\n        $('#cf2').val('');\n    });\n});\n\nfunction display_keyboards() {\n    if (!jQuery.browser.mobile) {\n        $('.kb-text').keyboard({\n            autoAccept: true,\n            alwaysOpen: false,\n            openOn: 'focus',\n            usePreview: false,\n            // layout: 'qwerty',\n            layout: 'custom',\n            display: {\n                bksp: '\\u2190',\n                accept: 'return',\n                default: 'ABC',\n                meta1: '123',\n                meta2: '#+=',\n            },\n            customLayout: {\n                default: [\n                    'q w e r t y u i o p {bksp}',\n                    'a s d f g h j k l {enter}',\n                    '{s} z x c v b n m , . {s}',\n                    '{meta1} {space} {cancel} {accept}',\n                ],\n                shift: [\n                    'Q W E R T Y U I O P {bksp}',\n                    'A S D F G H J K L {enter}',\n                    '{s} Z X C V B N M / ? {s}',\n                    '{meta1} {space} {meta1} {accept}',\n                ],\n                meta1: [\n                    '1 2 3 4 5 6 7 8 9 0 {bksp}',\n                    '- / : ; ( ) \\u20ac & @ {enter}',\n                    '{meta2} . , ? ! \\' \" {meta2}',\n                    '{default} {space} {default} {accept}',\n                ],\n                meta2: [\n                    '[ ] { } # % ^ * + = {bksp}',\n                    '_ \\\\ | &lt; &gt; $ \\u00a3 \\u00a5 {enter}',\n                    '{meta1} ~ . , ? ! \\' \" {meta1}',\n                    '{default} {space} {default} {accept}',\n                ],\n            },\n        });\n\n        $('.kb-pad').keyboard({\n            restrictInput: true,\n            preventPaste: true,\n            autoAccept: true,\n            alwaysOpen: false,\n            openOn: 'click',\n            usePreview: false,\n            layout: 'costom',\n            display: {\n                b: '\\u2190:Backspace',\n            },\n            customLayout: {\n                default: ['1 2 3 {b}', '4 5 6 . {clear}', '7 8 9 0 %', '{accept} {cancel}'],\n            },\n        });\n    }\n}\n\nfunction calTax() {\n    var ts = get('spos_tax') ? get('spos_tax') : $('#tax_val').val();\n    if (ts.indexOf('%') !== -1) {\n        var pts = ts.split('%');\n        order_tax = ((total - order_discount) * parseFloat(pts[0])) / 100;\n        $('#ts_con').text(formatMoney(order_tax));\n    } else {\n        order_tax = parseFloat(ts);\n        $('#ts_con').text(formatMoney(order_tax));\n    }\n    return order_tax;\n}\n\nfunction nav_pointer() {\n    var pp = p_page == 'n' ? 0 : p_page;\n    pp == 0 ? $('#previous').attr('disabled', true) : $('#previous').attr('disabled', false);\n    pp + pro_limit > tcp ? $('#next').attr('disabled', true) : $('#next').attr('disabled', false);\n}\n\nfunction Popup(data) {\n    createWin(data).then(function(w) {\n        w.close();\n    });\n}\nfunction createWin(data) {\n    return new Promise(function(resolve) {\n        var d =\n            '<!DOCTYPE html><html><head><title>Print</title><link rel=\"stylesheet\" href=\"' +\n            assets +\n            'bootstrap/css/bootstrap.min.css\" type=\"text/css\" /></head><body>' +\n            data +\n            '<script type=\"text/javascript\">window.print();</script></body></html>';\n        var mywindow = window.open(d, 'spos_print', 'height=500,width=300');\n        mywindow.document.write(d);\n        setTimeout(function() {\n            resolve(mywindow);\n        }, 20);\n    });\n}\n\n$(document).ready(function($) {\n    window.setTimeout(function() {\n        $('.alerts').slideUp();\n    }, 15000);\n    $('.alerts').on('click', function(e) {\n        $(this).slideUp();\n    });\n    $('#list-table-div').slimScroll({ start: 'bottom' });\n    $('#category-sidebar-menu').slimScroll({ width: '100%' });\n    $('.items').slimScroll({});\n});\n\nfunction posScreen() {\n    var wh = $(window).height(),\n        total_dh = $('#totaldiv').height(),\n        buttons_dh = $('.botbuttons').height(),\n        left_top_dh = $('#lefttop').outerHeight();\n    var items_dh = wh - 120,\n        list_table_dh = wh - 185 - left_top_dh - total_dh - buttons_dh;\n    $('#right-col').height(wh - 100);\n    $('.items').height(items_dh > 400 ? items_dh : 400);\n    $('#list-table-div').height(list_table_dh);\n}\n\nfunction printLine(str) {\n    var size = parseInt(Settings.char_per_line) - 4;\n    var len = str.length;\n    var res = str.split(':');\n    var newd = res[0];\n    for (i = 1; i < size - len; i++) {\n        newd += ' ';\n    }\n    newd += res[1];\n    return newd;\n}\n\n$(window).bind('resize', posScreen);\n\nfunction read_card() {}\n\n$.extend($.keyboard.keyaction, {\n    enter: function(base) {\n        if (base.$el.is('textarea')) {\n            base.insertText('\\r\\n');\n        } else {\n            base.accept();\n        }\n    },\n});\n\n$(document).ready(function() {\n    posScreen();\n    if (Settings.display_kb == 1) {\n        display_keyboards();\n    }\n    nav_pointer();\n    loadItems();\n    read_card();\n\n    $('.swipe')\n        .keypress(function(e) {\n            var TrackData = $(this).val() ? $(this).val() : '';\n            if (TrackData != '') {\n                if (e.keyCode == 13) {\n                    e.preventDefault();\n                    var p = new SwipeParserObj(TrackData);\n\n                    if (p.hasTrack1) {\n                        var CardType = null;\n                        var ccn1 = p.account.charAt(0);\n                        if (ccn1 == 4) CardType = 'Visa';\n                        else if (ccn1 == 5) CardType = 'MasterCard';\n                        else if (ccn1 == 3) CardType = 'Amex';\n                        else if (ccn1 == 6) CardType = 'Discover';\n                        else CardType = 'Visa';\n\n                        $('#pcc_no')\n                            .val(p.account)\n                            .change();\n                        $('#pcc_holder')\n                            .val(p.account_name)\n                            .change();\n                        $('#pcc_month')\n                            .val(p.exp_month)\n                            .change();\n                        $('#pcc_year')\n                            .val(p.exp_year)\n                            .change();\n                        $('#pcc_cvv2').val('');\n                        $('#pcc_type').select2('val', CardType);\n                    } else {\n                        $('#pcc_no')\n                            .val('')\n                            .change();\n                        $('#pcc_holder')\n                            .val('')\n                            .change();\n                        $('#pcc_month')\n                            .val('')\n                            .change();\n                        $('#pcc_year')\n                            .val('')\n                            .change();\n                        $('#pcc_cvv2')\n                            .val('')\n                            .change();\n                        $('#pcc_type')\n                            .val('')\n                            .change();\n                    }\n\n                    $('#pcc_cvv2').focus();\n                }\n            }\n        })\n        .blur(function(e) {\n            $(this).val('');\n        })\n        .focus(function(e) {\n            $(this).val('');\n        });\n\n    $(document).on('blur', '#pcc_no', function() {\n        var cn = $(this).val();\n        var ccn1 = cn.charAt(0);\n        if (ccn1 == 4) CardType = 'Visa';\n        else if (ccn1 == 5) CardType = 'MasterCard';\n        else if (ccn1 == 3) CardType = 'Amex';\n        else if (ccn1 == 6) CardType = 'Discover';\n        else CardType = 'Visa';\n\n        $('#pcc_type').select2('val', CardType);\n    });\n\n    $('.modal').on('hidden.bs.modal', function() {\n        $(this).removeData('bs.modal');\n    });\n    $('#clearLS').click(function(event) {\n        bootbox.confirm(lang.r_u_sure, function(result) {\n            if (result == true) {\n                localStorage.clear();\n                location.reload();\n            }\n        });\n        return false;\n    });\n\n    if (Settings.focus_add_item != '') {\n        shortcut.add(\n            Settings.focus_add_item,\n            function() {\n                $('#add_item').focus();\n            },\n            { type: 'keydown', propagate: false, target: document }\n        );\n    }\n    if (Settings.add_customer != '') {\n        shortcut.add(\n            Settings.add_customer,\n            function() {\n                $('#add-customer').trigger('click');\n            },\n            { type: 'keydown', propagate: false, target: document }\n        );\n    }\n    if (Settings.toggle_category_slider != '') {\n        shortcut.add(\n            Settings.toggle_category_slider,\n            function() {\n                $('[data-toggle=\"control-sidebar\"]').trigger('click');\n            },\n            { type: 'keydown', propagate: false, target: document }\n        );\n    }\n    if (Settings.cancel_sale != '') {\n        shortcut.add(\n            Settings.cancel_sale,\n            function() {\n                $('#reset').click();\n            },\n            { type: 'keydown', propagate: false, target: document }\n        );\n    }\n    if (Settings.suspend_sale != '') {\n        shortcut.add(\n            Settings.suspend_sale,\n            function() {\n                $('#suspend').trigger('click');\n            },\n            { type: 'keydown', propagate: false, target: document }\n        );\n    }\n    if (Settings.print_order != '') {\n        shortcut.add(\n            Settings.print_order,\n            function() {\n                $('#print_order').click();\n            },\n            { type: 'keydown', propagate: false, target: document }\n        );\n    }\n    if (Settings.print_bill != '') {\n        shortcut.add(\n            Settings.print_bill,\n            function() {\n                $('#print_bill').click();\n            },\n            { type: 'keydown', propagate: false, target: document }\n        );\n    }\n    if (Settings.finalize_sale != '') {\n        shortcut.add(\n            Settings.finalize_sale,\n            function() {\n                $('#payment').trigger('click');\n            },\n            { type: 'keydown', propagate: false, target: document }\n        );\n    }\n    if (Settings.today_sale != '') {\n        shortcut.add(\n            Settings.today_sale,\n            function() {\n                $('#today_sale').click();\n            },\n            { type: 'keydown', propagate: false, target: document }\n        );\n    }\n    if (Settings.open_hold_bills != '') {\n        shortcut.add(\n            Settings.open_hold_bills,\n            function() {\n                $('#opened_bills').trigger('click');\n            },\n            { type: 'keydown', propagate: false, target: document }\n        );\n    }\n    if (Settings.close_register != '') {\n        shortcut.add(\n            Settings.close_register,\n            function() {\n                $('#close_register').click();\n            },\n            { type: 'keydown', propagate: false, target: document }\n        );\n    }\n});\n$.fn.focusToEnd = function() {\n    return this.each(function() {\n        var v = $(this).val();\n        $(this)\n            .focus()\n            .val('')\n            .val(v);\n    });\n};\n$.ajaxSetup({ cache: false, headers: { 'cache-control': 'no-cache' } });\n"]}

Zerion Mini Shell 1.0