ok

Mini Shell

Direktori : /home2/selectio/www/mm-tailor-billing/themes/default/assets/dist/js/maps/
Upload File :
Current File : /home2/selectio/www/mm-tailor-billing/themes/default/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","ds","item_discount","formatDecimal","indexOf","pds","split","isNaN","pr_tax","tax","pr_tax_val","inclusiveTax","inclusive","exlusiveTax","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","print","show","createWin","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","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","close","className","callback","success","delete","md5","pin_code","remove","location","href","wrong_pin","keypress","keyCode","trigger","confirm","r_u_sure","result","please_add_product","print_img","element","html2canvas","scrollY","scale","then","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","console","log","target","which","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","hasClass","quantityFormat","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,UAAA,IAEA,MAAAF,EAAA,CAIA,IAAAG,EAAA,GAAAC,SAAAC,cAAAL,EAAAG,QAAAH,EAAAM,GASA,OARAJ,UAAAC,GACAD,UAAAC,GAAAI,IAAAC,IAAAC,WAAAP,UAAAC,GAAAI,IAAAC,KAAAC,WAAAT,EAAAO,IAAAC,KAAA,GAEAN,UAAAC,GAAAH,EAGAU,MAAA,YAAAC,KAAAC,UAAAV,YACAW,aACA,GAGA,SAAAA,YAIA,GAHA,GAAAZ,QACAC,UAAA,IAEAY,IAAA,aA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AGA,IAAAtK,SAAAuX,YACAR,SAAAC,IACAhX,SAAAuX,WACA,WACArW,EAAA,eAAA+L,SAEA,CAAA7J,KAAA,UAAA6T,WAAA,EAAAhE,OAAA3I,WAGA,IAAAtK,SAAAwX,eACAT,SAAAC,IACAhX,SAAAwX,cACA,WACAtW,EAAA,YAAAqN,QAAA,UAEA,CAAAnL,KAAA,UAAA6T,WAAA,EAAAhE,OAAA3I,WAGA,IAAAtK,SAAAyX,YACAV,SAAAC,IACAhX,SAAAyX,WACA,WACAvW,EAAA,eAAA+L,SAEA,CAAA7J,KAAA,UAAA6T,WAAA,EAAAhE,OAAA3I,WAGA,IAAAtK,SAAA0X,iBACAX,SAAAC,IACAhX,SAAA0X,gBACA,WACAxW,EAAA,iBAAAqN,QAAA,UAEA,CAAAnL,KAAA,UAAA6T,WAAA,EAAAhE,OAAA3I,WAGA,IAAAtK,SAAA2X,gBACAZ,SAAAC,IACAhX,SAAA2X,eACA,WACAzW,EAAA,mBAAA+L,SAEA,CAAA7J,KAAA,UAAA6T,WAAA,EAAAhE,OAAA3I,aAIApJ,EAAA0W,GAAA7H,WAAA,WACA,OAAA9M,KAAAD,KAAA,WACA,IAAA6U,EAAA3W,EAAA+B,MAAArB,MACAV,EAAA+B,MAAA0E,QAAA/F,IAAA,IAAAA,IAAAiW,MAGA3W,EAAA4W,UAAA,CAAAC,OAAA,EAAAC,QAAA,CAAAC,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) + parseFloat(item.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      var item_was_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 = inclusiveTax(net_price, pr_tax);\n          net_price -= pr_tax_val;\n          tax = lang.inclusive;\n        } else {\n          pr_tax_val = exlusiveTax(net_price, pr_tax);\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 = $('<tr id=\"' + row_no + '\" class=\"' + item_id + '\" data-item-id=\"' + item_id + '\" data-id=\"' + item.row.id + '\"></tr>');\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(\n            '#' + (an - 1) + ' ' + item_name + ' (' + item_code + '): [ ' + (item_was_ordered != 0 ? 'xxxx' : parseFloat(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\" style=\"border-bottom:0!important;\">#' +\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_' + item_id + '\" data-item-id=\"' + item_id + '\"><td>#' + (an - 1) + ' ' + item_name + ' (' + item_code + ')';\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' : parseFloat(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 += '<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 += '<tr class=\"bb\"><td>' + lang.rounding + '</td><td style=\"text-align:right;\">' + formatMoney(rounding) + '</td></tr>';\n        bill_totals += '<tr><td>' + lang.total_payable + '</td><td style=\"text-align:right;\">' + formatMoney(round_total) + '</td></tr>';\n      }\n      bill_totals += '<tr><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\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:18px;margin:0;border:0;color:#000 !important;\">' +\n              order_data.info +\n              order_data.items +\n              '</pre>'\n          );\n          var element = $('#order-data').get(0);\n          html2canvas(element, { scrollY: 0, scale: 1.3 }).then(function (canvas) {\n            var img = canvas.toDataURL().split(',')[1];\n            $.post(base_url + 'pos/receipt_img', {\n              img: img,\n              spos_token: csrf_hash,\n            });\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:18px;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.3 }).then(function (canvas) {\n            var img = canvas.toDataURL().split(',')[1];\n            $.post(base_url + 'pos/receipt_img', {\n              img: img,\n              spos_token: csrf_hash,\n            });\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    order_tax = 0;\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] && 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] && ui.content[0].id != 0) {\n        ui.item = ui.content[0];\n        $(this).data('ui-autocomplete')._trigger('select', 'autocompleteselect', ui);\n        $(this).autocomplete('close');\n      } else if (ui.content.length == 1 && ui.content[0] && 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).parent().parent('.input-group').children('input').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('<input type=\"hidden\" name=\"suspend\" value=\"yes\" /><input type=\"hidden\" name=\"suspend_note\" value=\"' + ref + '\" />');\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').focus().val(0);\n    $('#quick-payable').click();\n  });\n  $('#payModal').on('hidden.bs.modal', function (e) {\n    $('#amount').val('').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('keypress', function (e) {\n    console.log(e.target.type);\n    if (e.which == 13 && e.target.type != 'textarea') {\n      $('#submit-sale').focus();\n      setTimeout(function () {\n        $('#submit-sale').click();\n      }, 250);\n    }\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').val('').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').parent('.form-group').addClass('has-error');\n            bootbox.alert(lang.incorrect_gift_card);\n          } else {\n            $('#gc_details').html(\n              lang.card_no + ': ' + data.card_no + '<br>' + lang.value + ': ' + data.value + ' - ' + lang.balance + ': ' + data.balance\n            );\n            $('#gift_card_no').parent('.form-group').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)).change().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').find('.badge').remove();\n    $('#amount').val('').change().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).find('a').children('span').addClass('popup');\n      menu.addClass('popup');\n    } else {\n      $(this).find('a').children('span').removeClass('popup');\n      menu.removeClass('popup');\n    }\n  });\n\n  $('body').click(function (e) {\n    if (!$(e.target).hasClass('sidebar-icon') && !$(e.target).hasClass('sb') && $('#categories-list').hasClass('control-sidebar-open')) {\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(quantityFormat(count - 1));\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(quantityFormat(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($('<option></option>').attr('value', res.id).text(res.val));\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: ['Q W E R T Y U I O P {bksp}', 'A S D F G H J K L {enter}', '{s} Z X C V B N M / ? {s}', '{meta1} {space} {meta1} {accept}'],\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\n$(document).ready(function () {\n  $(document).on('click', '#print-modal-close', function (e) {\n    $('#printModal').hide();\n  });\n});\nfunction Popup(data, type) {\n  $('#print-title').text(lang.print + ' ' + lang[type]);\n  $('#print-body').html(data);\n  $('#printModal').show();\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').val(p.account).change();\n            $('#pcc_holder').val(p.account_name).change();\n            $('#pcc_month').val(p.exp_month).change();\n            $('#pcc_year').val(p.exp_year).change();\n            $('#pcc_cvv2').val('');\n            $('#pcc_type').select2('val', CardType);\n          } else {\n            $('#pcc_no').val('').change();\n            $('#pcc_holder').val('').change();\n            $('#pcc_month').val('').change();\n            $('#pcc_year').val('').change();\n            $('#pcc_cvv2').val('').change();\n            $('#pcc_type').val('').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).focus().val('').val(v);\n  });\n};\n$.ajaxSetup({ cache: false, headers: { 'cache-control': 'no-cache' } });\n"]}

Zerion Mini Shell 1.0