ok

Mini Shell

Direktori : /home2/selectio/public_html/pvmatricschool.com/admin/assets/dist/js/maps/
Upload File :
Current File : /home2/selectio/public_html/pvmatricschool.com/admin/assets/dist/js/maps/purchases.min.js.map

{"version":3,"sources":["purchases.js"],"names":["loadItems","get","total","$","empty","spoitems","JSON","parse","each","item","this","item_id","Settings","item_addition","id","product_id","row","item_cost","cost","item_qty","qty","item_code","code","item_name","name","replace","row_no","Date","getTime","newTr","tr_html","formatMoney","parseFloat","html","prependTo","grand_total","text","focus","add_order_item","store","stringify","document","ready","inputmask","placeholder","on","closest","attr","remove","hasOwnProperty","localStorage","setItem","autocomplete","source","base_url","minLength","autoFocus","delay","response","event","ui","val","length","content","bootbox","alert","lang","no_match_found","data","_trigger","select","preventDefault","bind","e","keyCode","click","confirm","r_u_sure","result","window","location","reload","new_qty","new_cost"],"mappings":"AA2FA,SAAAA,YAEAC,IAAA,cACAC,MAAA,EAEAC,EAAA,kBAAAC,QACAC,SAAAC,KAAAC,MAAAN,IAAA,aAEAE,EAAAK,KAAAH,SAAA,WAEA,IAAAI,EAAAC,KACAC,EAAA,GAAAC,SAAAC,cAAAJ,EAAAE,QAAAF,EAAAK,GACAT,SAAAM,GAAAF,EAEA,IAAAM,EAAAN,EAAAO,IAAAF,GAAAG,EAAAR,EAAAO,IAAAE,KAAAC,EAAAV,EAAAO,IAAAI,IAAAC,EAAAZ,EAAAO,IAAAM,KACAC,EAAAd,EAAAO,IAAAQ,KAAAC,QAAA,KAAA,UAAAA,QAAA,KAAA,UAEAC,GAAA,IAAAC,MAAAC,UACAC,EAAA1B,EAAA,WAAAuB,EAAA,YAAAf,EAAA,mBAAAA,EAAA,WACAmB,QAAA,4FAAAf,EAAA,kCAAAW,EAAA,KAAAH,EAAA,KAAAF,EAAA,gBACAS,SAAA,mIAAAX,EAAA,cAAAO,EAAA,gBAAAf,EAAA,kBAAAe,EAAA,mCACAI,SAAA,2IAAAb,EAAA,cAAAS,EAAA,gBAAAf,EAAA,cAAAe,EAA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T,GACAzD,EAAAO,MAAA0C,aAAA,UAEA,GAAAQ,EAAAG,QAAAD,QAAA,GAAAF,EAAAG,QAAA,GAAAjD,KACAkD,QAAAC,MAAAC,KAAAC,eAAA,WACAhE,EAAA,aAAAkC,UAEAlC,EAAAO,MAAAmD,IAAA,MAGAS,OAAA,SAAAX,EAAAC,GACAD,EAAAY,iBACA,IAAAX,EAAAnD,KAAAK,GACAwB,eAAAsB,EAAAnD,OAEAN,EAAAO,MAAAmD,IAAA,IAEAG,QAAAC,MAAAC,KAAAC,mBAKAhE,EAAA,aAAAqE,KAAA,WAAA,SAAAC,GACA,IAAAA,EAAAC,UACAD,EAAAF,iBACApE,EAAAO,MAAA0C,aAAA,aAIAjD,EAAA,aAAAkC,QACAlC,EAAA,UAAAwE,MAAA,SAAAF,GACAT,QAAAY,QAAAV,KAAAW,SAAA,SAAAC,GACAA,IACA7E,IAAA,aACA+C,OAAA,YAGA+B,OAAAC,SAAAC,cAKA9E,EAAAsC,UAAAI,GAAA,SAAA,aAAA,WACA,IAAA7B,EAAAb,EAAAO,MAAAoC,QAAA,MACAoC,EAAAlD,WAAA7B,EAAAO,MAAAmD,OACAlD,EAAAK,EAAA+B,KAAA,gBACA1C,SAAAM,GAAAK,IAAAI,IAAA8D,EACA3C,MAAA,WAAAjC,KAAAkC,UAAAnC,WACAL,cAGAG,EAAAsC,UAAAI,GAAA,SAAA,SAAA,WACA,IAAA7B,EAAAb,EAAAO,MAAAoC,QAAA,MACAqC,EAAAnD,WAAA7B,EAAAO,MAAAmD,OACAlD,EAAAK,EAAA+B,KAAA,gBACA1C,SAAAM,GAAAK,IAAAE,KAAAiE,EACA5C,MAAA,WAAAjC,KAAAkC,UAAAnC,WACAL","file":"../purchases.min.js","sourcesContent":["    $(document).ready(function() {\n        loadItems();\n        $(\"#date\").inputmask(\"yyyy-mm-dd hh:mm\", {\"placeholder\": \"yyyy-mm-dd hh:mm\"});\n\n        $(document).on('click', '.spodel', function () {\n            var row = $(this).closest('tr');\n            var item_id = row.attr('data-item-id');\n            delete spoitems[item_id];\n            row.remove();\n            if(spoitems.hasOwnProperty(item_id)) { } else {\n                localStorage.setItem('spoitems', JSON.stringify(spoitems));\n                loadItems();\n                return;\n            }\n        });\n\n        $(\"#add_item\").autocomplete({\n            source: base_url+'purchases/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                }\n                else if (ui.content.length == 1 && 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                }\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_order_item(ui.item);\n                    if (row)\n                        $(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        $('#reset').click(function (e) {\n            bootbox.confirm(lang.r_u_sure, function (result) {\n                if (result) {\n                    if (get('spoitems')) {\n                        remove('spoitems');\n                    }\n\n                    window.location.reload();\n                }\n            });\n        });\n\n        $(document).on(\"change\", '.rquantity', function () {\n            var row = $(this).closest('tr');\n            var new_qty = parseFloat($(this).val()),\n            item_id = row.attr('data-item-id');\n            spoitems[item_id].row.qty = new_qty;\n            store('spoitems', JSON.stringify(spoitems));\n            loadItems();\n        });\n\n        $(document).on(\"change\", '.rcost', function () {\n            var row = $(this).closest('tr');\n            var new_cost = parseFloat($(this).val()),\n            item_id = row.attr('data-item-id');\n            spoitems[item_id].row.cost = new_cost;\n            store('spoitems', JSON.stringify(spoitems));\n            loadItems();\n        });\n    });\n\nfunction loadItems() {\n\n    if (get('spoitems')) {\n        total = 0;\n\n        $(\"#poTable tbody\").empty();\n        spoitems = JSON.parse(get('spoitems'));\n\n        $.each(spoitems, function () {\n\n            var item = this;\n            var item_id = Settings.item_addition == 1 ? item.item_id : item.id;\n            spoitems[item_id] = item;\n\n            var product_id = item.row.id, item_cost = item.row.cost, item_qty = item.row.qty, item_code = item.row.code,\n            item_name = item.row.name.replace(/\"/g, \"&#034;\").replace(/'/g, \"&#039;\");\n\n            var row_no = (new Date).getTime();\n            var newTr = $('<tr id=\"' + row_no + '\" class=\"' + item_id + '\" data-item-id=\"' + item_id + '\"></tr>');\n            tr_html = '<td style=\"min-width:100px;\"><input name=\"product_id[]\" type=\"hidden\" class=\"rid\" value=\"' + product_id + '\"><span class=\"sname\" id=\"name_' + row_no + '\">' + item_name + ' (' + item_code + ')</span></td>';\n            tr_html += '<td style=\"padding:2px;\"><input class=\"form-control input-sm kb-pad text-center rquantity\" name=\"quantity[]\" type=\"text\" value=\"' + item_qty + '\" data-id=\"' + row_no + '\" data-item=\"' + item_id + '\" id=\"quantity_' + row_no + '\" onClick=\"this.select();\"></td>';\n            tr_html += '<td style=\"padding:2px; min-width:80px;\"><input class=\"form-control input-sm kb-pad text-center rcost\" name=\"cost[]\" type=\"text\" value=\"' + item_cost + '\" data-id=\"' + row_no + '\" data-item=\"' + item_id + '\" id=\"cost_' + row_no + '\" onClick=\"this.select();\"></td>';\n            tr_html += '<td class=\"text-right\"><span class=\"text-right ssubtotal\" id=\"subtotal_' + row_no + '\">' + formatMoney(parseFloat(item_cost) * parseFloat(item_qty)) + '</span></td>';\n            tr_html += '<td class=\"text-center\"><i class=\"fa fa-trash-o tip pointer spodel\" id=\"' + row_no + '\" title=\"Remove\"></i></td>';\n            newTr.html(tr_html);\n            newTr.prependTo(\"#poTable\");\n            total += (parseFloat(item_cost) * parseFloat(item_qty));\n\n        });\n\n        grand_total = formatMoney(total);\n        $(\"#gtotal\").text(grand_total);\n        $('#add_item').focus();\n    }\n}\n\nfunction add_order_item(item) {\n\n    var item_id = Settings.item_addition == 1 ? item.item_id : item.id;\n    if (spoitems[item_id]) {\n        spoitems[item_id].row.qty = parseFloat(spoitems[item_id].row.qty) + 1;\n    } else {\n        spoitems[item_id] = item;\n    }\n\n    store('spoitems', JSON.stringify(spoitems));\n    loadItems();\n    return true;\n}\n"]}

Zerion Mini Shell 1.0