ActualTime=moment;feroksoft={deSerialize:function(b){return JSON.parse('{"'+decodeURI(b.replace(/&/g,'","').replace(/=/g,'":"').replace(/\+/g," "))+'"}')},detectIE:function(){var e=window.navigator.userAgent;var c=e.indexOf("MSIE ");if(c>0){return parseInt(e.substring(c+5,e.indexOf(".",c)),10)}var b=e.indexOf("Trident/");if(b>0){var g=e.indexOf("rv:");return parseInt(e.substring(g+3,e.indexOf(".",g)),10)}var f=e.indexOf("Edge/");if(f>0){return parseInt(e.substring(f+5,e.indexOf(".",f)),10)}return false},money_round:function(c,e){var b=typeof e!="undefined"?Math.pow(10,e):100;if(c>=0){var f=Math.round(Math.abs(c+0.00009)*b)/b}else{var f=-Math.round(Math.abs(c-0.00009)*b)/b}return f},coin_round:function(b){if(typeof b=="string"){b=parseInt(b)}if(typeof b=="undefined"){b=0}return(b/100).toFixed(2)},rates_round:function(b){return parseFloat(Math.abs(b).toFixed(8))},numberToWords:function(k,h,l,f,c){function g(u,r,s){var q=[2,0,1,1,1,2,2,2,2,2];return(r==""?"":" "+r+(u[u.length-2]=="1"?s[2]:s[q[u[u.length-1]]]))}function j(r){function q(s){return s===s.toUpperCase()}function o(s){let plural_endings=["і","и"];return plural_endings.some(function(t){return s.endsWith(t)})}if(q(r)||r.endsWith("о")||r.toLowerCase()==="сомоні"||r.toLowerCase()==="седі"){return[r,["","",""]]}else{if(o(r)){return[r.slice(0,-1),["","и","ів"]]}else{if(r.endsWith("ий")){return[r.slice(0,-2),["ий","і","их"]]}else{if(r.endsWith("ь")){return[r.slice(0,-1),["ь","і","ів"]]}else{if(r.endsWith("ія")){return[r.slice(0,-1),["я","ї","й"],"f"]}else{if(r.endsWith("ке")){return[r.slice(0,-1),["ий","і","их"]]}else{if(r.endsWith("е")){return[r.slice(0,-1),["е","і","их"]]}else{if(r.endsWith("ка")){return[r.slice(0,-1),["а","і","их"],"f"]}else{if(r.endsWith("а")){return[r.slice(0,-1),["а","и",""],"f"]}else{if(r.endsWith("ня")){return[r.slice(0,-2),["ня","ні","ень"],"f"]}else{return[r,["","и","ів"]]}}}}}}}}}}}function b(o,v){var s="";var u=[["","тисяч","мільйон","мільярд","трильйон","квадрильйон","квінтильйон","секстильйон","септильйон","октильйон","нонільйон","децильйон"],["а","і",""],["","и","ів"]];if(o==""||o=="0"||o=="00"){return" нуль"}o=o.split(/(?=(?:\d{3})+$)/);if(o[0].length==1){o[0]="00"+o[0]}if(o[0].length==2){o[0]="0"+o[0]}function r(t,y){var w=[[""," один"," два"," три"," чотири"," п'ять"," шість"," сім"," вісім"," дев'ять"],[" десять"," одинадцять"," дванадцять"," тринадцять"," чотирнадцять"," п'ятнадцять"," шістнадцять"," сімнадцять"," вісімнадцять"," дев'ятнадцять"],["",""," двадцять"," тридцять"," сорок"," п'ятдесят"," шістдесят"," сімдесят"," вісімдесят"," дев'яносто"],[""," сто"," двісті"," триста"," чотириста"," п'ятсот"," шістсот"," сімсот"," вісімсот"," дев'ятсот"],[""," одна"," дві"]];return w[3][t[0]]+(t[1]==1?w[1][t[2]]:w[2][t[1]]+(y?w[4][t[2]]:w[0][t[2]]))}for(var q=(o.length-1);q>=0;q--){if(o[q]!="000"){s=(((v&&q==(o.length-1))||q==(o.length-2))&&(o[q][2]=="1"||o[q][2]=="2")?r(o[q],1):r(o[q]))+g(o[q],u[0][o.length-1-q],(q==(o.length-2)?u[1]:u[2]))+s}}return s.substring(1)}h=f.split(" ").map(j);if(f.indexOf("гривня")!=-1){l=l?l:["копій",["ка","ки","ок"],"f"]}else{l=["цент",["","и","ів"],"f"]}k=Number(k).toFixed(2).split(".");function e(o){return g(k[0],o[0],o[1])+" "}x=b(k[0],h[0][2]=="f");if(h.length>1){x+=h.reduce(function(q,o){return e(q)+e(o)})}else{x+=e(h[0])}if((k[1]!=0)||(!c)){x+=k[1];x+=g(k[1],l[0],l[1])}return x}};concosoft={qetValuesDistinct:function(b,e){var c=[];b.forEach(function(g,f){if(!c.includes(g[e])){c.push(g[e])}});return c},getByFilters:function(b,c){return b.filter(function(f){var e=true;$.each(c,function(h,g){e=e*(f[h]==g)});return e})},summ_array_values:function(b,e){var c=0;$.each(b,function(g,f){c=c+f[e]});return c}};$.sha256=function sha256(o){function K(e,b){return(e>>>b)|(e<<(32-b))}var F=Math.pow;var t=F(2,32);var h="length";var D,C;var v="";var z=[];var g=o[h]*8;var f=sha256.h=sha256.h||[];var B=sha256.k=sha256.k||[];var r=B[h];var l={};for(var q=2;r<64;q++){if(!l[q]){for(D=0;D<313;D+=q){l[D]=q}f[r]=(F(q,0.5)*t)|0;B[r++]=(F(q,1/3)*t)|0}}o+="\x80";while(o[h]%64-56){o+="\x00"}for(D=0;D>8){return}z[D>>2]|=C<<((3-D)%4)*8}z[z[h]]=((g/t)|0);z[z[h]]=(g);for(C=0;C>>3))+y[D-7]+(K(u,17)^K(u,19)^(u>>>10)))|0);var I=(K(H,2)^K(H,13)^K(H,22))+((H&f[1])^(H&f[2])^(f[1]&f[2]));f=[(J+I)|0].concat(f);f[4]=(f[4]+J)|0}for(D=0;D<8;D++){f[D]=(f[D]+c[D])|0}}for(D=0;D<8;D++){for(C=3;C+1;C--){var G=(f[D]>>(C*8))&255;v+=((G<16)?0:"")+G.toString(16)}}return v};$.round=function(b,c){return parseFloat(Math.abs(b).toFixed(c))};$.urlParam=function(b){var c=new RegExp("[?&]"+b+"=([^&#]*)").exec(window.location.href);if(c==null){return null}else{return c[1]||0}};$.date=function(f){var h=new Date(f);var b=h.getDate();var g=h.getMonth()+1;var e=h.getFullYear();if(b<10){b="0"+b}if(g<10){g="0"+g}var c=b+"/"+g+"/"+e;return c};$.isoDateToTime=function(b){if(b){var e=moment(b);var c=("0"+e.hour()).slice(-2)+":"+("0"+e.minute()).slice(-2)+":"+("0"+e.second()).slice(-2);return c}else{return b}};$.isoDateToUADate=function(b,c){c=c?c:"р.";var e=moment(b);ua_dic={0:("Jan","січня"),1:("Feb","лютого"),2:("Mar","березня"),3:("Apr","квітня"),4:("May","травня"),5:("Jun","червня"),6:("Jul","липня"),7:("Aug","серпня"),8:("Sep","вересня"),9:("Oct","жовтня"),10:("Nov","листопада"),11:("Dec","грудня")};date=e.date()+" "+ua_dic[e.month()]+" "+e.year()+c;return date};$.isoDateToUADateWithoutYear=function(b,c){c=c?c:"р.";var e=moment(b);ua_dic={0:("Jan","січня"),1:("Feb","лютого"),2:("Mar","березня"),3:("Apr","квітня"),4:("May","травня"),5:("Jun","червня"),6:("Jul","липня"),7:("Aug","серпня"),8:("Sep","вересня"),9:("Oct","жовтня"),10:("Nov","листопада"),11:("Dec","грудня")};date=e.date()+" "+ua_dic[e.month()];return date};$.isoDateToShortDate=function(b){var c=moment(b);dic={0:("Jan","01"),1:("Feb","02"),2:("Mar","03"),3:("Apr","04"),4:("May","05"),5:("Jun","06"),6:("Jul","07"),7:("Aug","08"),8:("Sep","09"),9:("Oct","10"),10:("Nov","11"),11:("Dec","12")};date=c.date()+"."+dic[c.month()]+"."+c.year();return date};$.isoDateToUSADate=function(b){var c=b;date=("0"+c.getDate()).slice(-2)+"."+("0"+(c.getMonth()+1)).slice(-2)+"."+c.getFullYear();return date};$.jsDateToWTForms=function(b){d=b;date=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();time=d.getHours()+":"+d.getMinutes()+":"+d.getSeconds();return date+" "+time};$.getMovement=function(b,e,j,g,c,h,f){var j=typeof j!=="undefined"?j:true;var g=typeof g!=="undefined"?g:"money_amount";var c=typeof c!=="undefined"?c:true;var h=typeof h!=="undefined"?h:true;var f=typeof f!=="undefined"?f:false;summ=0;$.each(e,function(l,k){cond=j?(k[g]>0):(k[g]<0);cond2=((k.storno_time==null)||(k.fiscal_storno_time==null));cond3=c?(k.currency_id==b):true;cond4=h?(k.fiscal_time!=null):(k.fiscal_time==null);cond5=f?(k.confirmation_time!=null)&&(k.confirmation_time):true;if(cond&&cond2&&cond3&&cond4&&cond5){summ+=k[g]}});return feroksoft.rates_round((j?summ:-summ),2)};$.getMovementCashier=function(f,b,h,k,j,c,e,l,g){var h=typeof h!=="undefined"?h:true;var k=typeof k!=="undefined"?k:"money_amount";var j=typeof j!=="undefined"?j:true;var c=typeof c!=="undefined"?c:true;var e=typeof e!=="undefined"?e:false;summ=0;$.each(b,function(q,o){cond=h?(o[k]>0):(o[k]<0);cond2=((o.storno_time==null)||(o.fiscal_storno_time==null));cond3=j?(o.currency_id==f):true;cond4=c?(o.fiscal_time!=null):(o.fiscal_time==null);cond5=e?(o.confirmation_time!=null)&&(o.confirmation_time):true;cond6=l==o.operator_id;cond7=o.operation_time>g;if(cond&&cond2&&cond3&&cond4&&cond5&&cond6&&cond7){summ+=o[k]}});return feroksoft.rates_round((h?summ:-summ),2)};$.toStringHex=function(b){return btoa(b.match(/\w{2}/g).map(function(c){return String.fromCharCode(parseInt(c,16))}).join(""))};$.splitList=function(f,e,c){var e=e?e:3;var c=c?c:3;var b=f.slice();var g=[];g.push(b.splice(0,c));while(b.length>0){g.push(b.splice(0,e))}return g};$.pad=function(b,c){var e=b+"";while(e.length");$.each(c.header,function(e,f){th=$("");th.addClass("centered");th.html(f.name);theader.append(th)});b.find("thead").append(theader);b.find("tbody").html("");$.each(c.data,function(f,e){tr=$("");$.each(c.header,function(g,h){td=$("");td.html(e[h.name]);td.addClass(h.classes);tr.append(td)});b.find("tbody").prepend(tr)});return true}function goHome(){window.location.href="/"}function markNormal(b){b.removeClass("alert-danger");b.on("focus",function(){});b.parent().find(".alert-danger").remove()}function markError(b,c){var c=c?c:"Помилка заповнення поля";b.addClass("alert-danger");b.on("focus",function(){markNormal(b)});if(b.parent().find(".alert-warning").length==0){b.parent().append('
'+c+"
")}else{b.parent().find(".alert-warning").html(c)}}function displayModal(b){b.modal({backdrop:true,show:true,keyboard:true})}function hideModal(b){b.modal({backdrop:true,show:false,keyboard:false})}function sortTable(h,g){var e=document.getElementById(h).getElementsByTagName("tbody").item(0);var f=e.getElementsByTagName("tr");for(var c=0;c").addClass("col-sm-9");input=$("").addClass("form-control").attr("id",e).attr("name",e).attr("placeholder","0").attr("step","0.01").attr("type","number").val(0);field.append(input);field.insertAfter(c);label=$("