(self.webpackChunkiride=self.webpackChunkiride||[]).push([[9836],{89836:(module,__unused_webpack_exports,__webpack_require__)=>{function _wrapRegExp(){_wrapRegExp=function(e,t){return new a(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function a(e,o,i){var n=new RegExp(e,o);return t.set(n,i||t.get(e)),_setPrototypeOf(n,a.prototype)}function o(e,a){var o=t.get(a);return Object.keys(o).reduce((function(t,a){var i=o[a];if("number"==typeof i)t[a]=e[i];else{for(var n=0;void 0===e[i[n]]&&n+1]+)>/g,(function(e,t){var a=n[t];return"$"+(Array.isArray(a)?a.join("$"):a)})))}if("function"==typeof i){var r=this;return e[Symbol.replace].call(this,a,(function(){var e=arguments;return"object"!=_typeof(e[e.length-1])&&(e=[].slice.call(e)).push(o(e,r)),i.apply(this,e)}))}return e[Symbol.replace].call(this,a,i)},_wrapRegExp.apply(this,arguments)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function ownKeys(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,o)}return a}function _objectSpread(e){for(var t=1;te.length)&&(t=e.length);for(var a=0,o=new Array(t);a-1){var a=_slicedToArray(t.split("e-"),2),o=(a[0],a[1]);return parseInt(o,10)}return Math.floor(e)!==e&&e.toString().split(".")[1].length||0},round:function(e,t){t||(t=0);var a=e>=0?1:-1;return parseFloat((Math.round(e*Math.pow(10,t)+1e-4*a)/Math.pow(10,t)).toFixed(t))},getFloat:function(e,t){var a=new String(e);trim(a),a=a.replace(",",".");var o=parseFloat(a);return void 0===o||isNaN(o)?0:t?round(o,t):o},getFloat2:function(e){return round(getFloat(e),2)},openWindow:function(e,t,a,o){null==o&&(o="_blank");var i=(screen.width-t)/2,n=(screen.height-a)/2-100;window.open(e,o,"fullscreen=yes,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,status=no,location=no,directories=no,copyhistory=no,height="+a+",width="+t+",left="+i+",top="+n)},checkKey:function(e,t){var a=e.keyCode;e.which&&(a=e.which);var o=!1;a in[8,37,39,9,36,35,46]&&(o=!0);var i=String.fromCharCode(a);"."===i&&(o=!1);for(var n=!1,r=0;r3){var l=i[0];i[0]="";for(var c=3;c0&&("STR_PAD_LEFT"==o?e=r(a,i)+e:"STR_PAD_RIGHT"==o?e+=r(a,i):"STR_PAD_BOTH"==o&&(e=(e=(n=r(a,Math.ceil(i/2)))+e+n).substr(0,t))),e},footerMsg:function(e,t,a){if(1===$("#no_footermsg").val()||"bootstrap"===$("#IWEnv").val())return 0==e&&$.growl.notice({title:$("#transaction_success").val(),message:""}),1==e&&$.growl.error({duration:3e4,title:$("#transaction_error").val(),message:a}),!0;var o=$("#divMsg");return o.fadeOut(),o.html(t),o.removeClass("msgOK3").removeClass("msgERR3"),0==e&&o.addClass("msgOK3"),1==e&&o.addClass("msgERR3"),o.prop("messaggio",a),o.fadeIn(),setTimeout("$('#divMsg').fadeOut();",18e4),!0},get_ean13_checkdigit:function(e){e.length>12&&(e=e.substr(0,12)),e=parseInt(e,10),e=str_pad(e,12,"0","STR_PAD_LEFT");var t=3*(parseInt(e.substr(1,1),10)+parseInt(e.substr(3,1),10)+parseInt(e.substr(5,1),10)+parseInt(e.substr(7,1),10)+parseInt(e.substr(9,1),10)+parseInt(e.substr(11,1),10))+(parseInt(e.substr(0,1),10)+parseInt(e.substr(2,1),10)+parseInt(e.substr(4,1),10)+parseInt(e.substr(6,1),10)+parseInt(e.substr(8,1),10)+parseInt(e.substr(10,1),10));return 10*Math.ceil(t/10)-t},get_ean8_checkdigit:function(e){var t=e.toString().split("").reverse().reduce((function(e,t,a){return e+Number.parseInt(t)*((a+1)%2==0?1:3)}),0)%10;return t?10-t:0},sian_combo_swap:function(e){for(var t=0;t<$("#causalesian option").size();t++){var a="#sian_option_"+t;""!=$(a).prop("disabled")?($(a).removeAttr("disabled"),$(a).show()):($(a).prop("disabled","disabled"),$(a).hide())}},strpos:function(e,t,a){var o=(e+"").indexOf(t,a||0);return-1!==o&&o},ivaGet:function(e,t){if(null==e&&(e=0),0!=e){var a=$("#hidden_idiva"+e).attr(t);return"aliquota"!=t&&"percindetraibilita"!=t||(a=getFloat2(a)),a}},getHtmlFromAjax:function(e,t,a,o,i){var n={};"object"===_typeof(e)&&(t=e.divname,a=e.is_async,o=e.show_waiting,i=e.onSuccess,n=e.data,e=e.url),void 0===a&&(a=!0),void 0===o&&(o=!1),o&&waiting();var r=this;$.ajax({url:e+"&JSON",type:"post",async:a,dataType:"json",data:n,success:function(e){var a=e.text;$("#"+t).html(a),o&&waiting(!1),$(".ui-tooltip").hide(),r.reloadComponents("#"+t+" "),"function"==typeof i&&i(e)}})},btnLoad_onclick:function(e){var t=$("#form1");""==e||(t.method="get",t.target="_blank",t.action=e),t.submit()},btnLoad2_onclick:function(){var e=$("#form1");e.attr("action",""),e.removeAttr("target"),e.submit()},PageChange:function(e){$("#npage").val(e),btnLoad2_onclick()},deleteObject:function(e,t,a,o,i,n,r,l){IWConfirm($("#conferma_cancellazione1").val()+" (1/2)",(function(){IWConfirm2($("#conferma_cancellazione2").val()+" (2/2)",(function(){btnDel2_onclick(e,t,a,o,i,n,r,l)}))}))},btnDel2_onclick:function(e){function t(t,a,o,i,n,r,l,c){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t,a,o,i,n,r,l){void 0===a&&(a=""),void 0===o&&(o=!1),void 0===i&&(i=0),void 0===n&&(n=""),void 0===r&&(r="");var c=$("#object").val(),s=$("#tipoview").val(),u="view.php?DEL_FROM_AJAX",_="JSON=1";return _+=i>0&&n?"&iddocumento="+i+"&codicedocumento="+n+"&tipoview=view":"&id="+e+"&object="+c+"&tipoview="+s,a&&(_+="&"+a),t&&(u+="&FORZA_ELIMINAZIONE"),waiting(!0),$.ajax({url:u,data:_,type:"post",dataType:"json",success:function(t){waiting(!1);var c=t.chiedi_conferma,s=t.debug;ajaxSubmitOnSuccessFunction(t,!0,c),t.ret?(o&&!s&&(i>0?window.location.href="?codicedocumento="+n+"&tipoview=view":location.reload()),r&&reloadTable(r),$("#tr_"+e).hideRow(),"function"==typeof l&&l()):c&&IWConfirm(c,(function(){btnDel2_onclick(e,1,a,o,i,n,r,l)}))}}),!0})),btnSave_onclick:function(e,t,a,o,i){""==e&&(e=!1),""==t&&(t=!1);var n=$("button");n.prop("disabled",!0),t&&waiting2(!0,!0),"function"==typeof i&&i();var r=$("#OP_FROM_AJAX");r.val(1),$.ajax({url:"view.php",type:"post",dataType:"xml",data:$("#form1").serialize(),success:function(i){ajaxSubmitOnSuccessFunction(i),r.val("");var l=$(i).find("ret").text(),c=$(i).find("debug").text(),s=$(i).find("id").text();l?($("#id").val(s),n.fadeIn(),$("#no_beforeunload").val(1),e&&!c&&window.location.reload(),null==a||""==a||c||(window.location.href=a+s),"function"==typeof o&&o(!0,i)):"function"==typeof o&&o(!1,i),n.prop("disabled",!1),t&&waiting2(!1)},error:function(e,t,a){$("#boxDebug").html("
"+e.status+"
"+a+"
"),n.prop("disabled",!1)}})},btnPrint_onclick:function(e){var t=$("#page_print").val().split("iddocumento"),a=$("#iddocumento").val(),o=t[0]+"&iddocumento="+a;1==e&&(o+="&NON_STAMPARE_PREZZI"),window.open(o,"_blank")},btnPrint2_onclick:function(e,t,a,o,i,n,r,l,c,s){if(null==l&&(l="form1"),null==c&&(c=!1),"true"==n){""==t&&(t=0),waiting2(!0,c);var u=$("#avvisi_footer_ul0");u.hide();var _=$("#"+l);$("#tipostampa").val(e),t>0&&""!=a&&$("#iddocumento").val(t);var d="print.php?setfilename&id="+t;"false"!=r&&(d+="&EXCEL"),$.post(d,_.serialize(),(function(e){var t=$(e).find("ret").text(),a=$(e).find("outfile").text();"function"==typeof s&&s(),"true"==t?"false"==r?window.open(a,"_blank"):window.location.href=a:alert("Errore. Impossibile stampare"),u.show(),waiting2(!1)}))}else{var p="print.php?tipostampa="+e,f=i.split(",");$.each(f,(function(e){p+="&"+f[e]})),p+=""!=a?"&iddocumento="+t+"&codicedocumento="+a:"&id="+t+"&object="+o,window.open(p,"_blank")}},btnPrintMultiple:function(e,t){t&&waiting2(!0,!0),e.object="IWPrintMultiple",e.tipoview="printMultiple",$.ajax({url:"ajax.php?JSON",type:"post",dataType:"json",data:e,success:function(e){var a=e.ret,o=e.outfile;t&&waiting2(!1),a?window.open("tmp/"+o):alert($("#alert_no_stampa").val())}})},btnPrint:function(e,t,a,o){$.ajax({url:"print.php?setfilename"+(t?"&EXCEL":""),type:"post",dataType:"xml",data:e,success:function(e){if("function"!=typeof a||(a(e),o))if("true"===$(e).find("ret").text()){var i=$(e).find("outfile").text();t?window.location.href=i:window.open(i)}else alert($("#alert_no_stampa").val())}})},setNewPassword:function(e,t,a){void 0===t&&(t=!1),$.ajax({url:"ajax.php?JSON&object=IWUser&tipoview=getNewPassword&restapi="+(t?"1":"0")+"&force_length="+(a?"1":"0"),dataType:"json",success:function(t){$("#"+e).val(t.password)}})},btnNew_onclick:function(){var e=$("#codicedocumento").val(),t=$("#object").val(),a="?tipoview="+$("#tipoview").val();void 0===e?a+="&object="+t:(""!=$("#page_controls").val()&&(a="?tipoview=controls"),a+="&codicedocumento="+e),window.location=a},btnMail_onclick:function(){var e=$("#iddocumento").valFloat();IWConfirm($("#conferma_prosegui").val(),(function(){$.get("ajax.php?tipoview=inviaemaildoc&iddocumento="+e+"&codicedocumento="+$("#codicedocumento").val(),(function(e){$(e).find("ret").text()?(footerMsg(0,"Email inviata",$(e).find("msg").text()),$("#btnEmail").fadeOut()):footerMsg(1,"Errore nell'invio della email",$(e).find("msg").text())}))}))},checkAll_onclick:function(){var e,t="";$("#chk_0").is(":checked")||(t="checked");var a=$("#i_count").valFloat();0==a&&(a=1e3);for(var o=0;o5?e.substr(5)+o.substr(4):e.substr(0)+o.substr(4)]},noopLog:function(){$.get("noop-log",(function(){}))},switch_as_user:function(){var e=$("#switch_as_user");dialogShow("confirm_dialog_switch",(function(t){if(!t)return!1;var a=e.val();return waiting(),$.ajax({url:"ajax.php?JSON&object=IWUser&tipoview=switchAsUser",type:"post",data:{user:a,switch_pwd:$("#switch_password").val()},dataType:"json",success:function(e){e.ret?window.location.reload():(waiting(!1),alert("Utente inesistente!"))}}),!0}))},switch_to_azienda:function(){var e=$("#switch_to_azienda").val();waiting2(),$.ajax({url:"ajax.php?JSON&object=IWUser&tipoview=switchAzienda&codicecliente="+e,dataType:"json",success:function(e){console.log(e),e.ret?window.location="home.php?idmenu=0&__sck__=1":(waiting(!1),alert("Azienda NON TROVATA
Company NOT FOUND"))}})},eanCheckDigit:function(e){for(var t=0,a=e.length-1;a>=0;a--)t+=parseInt(e.charAt(a))*(1+a%2*2);return(10-t%10)%10},generaBarcode:function(e,t,a){__webpack_require__(55961);var o=("000000000000"+e).slice(-12);o+=eanCheckDigit(o),JsBarcode("#"+a,o,{format:"EAN13",fontSize:18,textMargin:0,height:120,width:4,flat:!0}).render(),$("#"+t).val(o)},calcolaCoordinate:function(e,t,a){var o="ajax.php?JSON&object=GoogleMapsObject&tipoview=calcolaCoordinate&indirizzo="+e;$.ajax({url:o,dataType:"json",async:!1,success:function(e){var o=e.lat,i=e.long;null===o||null===i?alert("Inserire l'indirizzo nel formato corretto"):($("#"+t).val(o),$("#"+a).val(i))}})},getHtmlDialogCisterne:function(e){var t=$("#dialog_cisterne");e.object=t.data("object"),e.tipoview="getHtmlDialogCisterne";var a="anagrafica_hidden";e.anagrafica_field&&(a=e.anagrafica_field),e.idanagrafica=$("#"+a).valFloat();var o="anagrafica3_hidden";e.committente_field&&(o=e.committente_field),e.idcommittente=$("#"+o).valFloat();var i="regdata";e.data_field&&(i=e.data_field),e.data=$("#"+i).val();var n="orario_movmagazzini";e.orario_field&&(n=e.orario_field),e.orario=$("#"+n).val(),!e.idmagazzinosorgente&&e.field_magazzino&&(e.idmagazzinosorgente=$("#"+e.field_magazzino).val());var r=e.callback;e.callback=null,getHtmlFromAjax({url:"ajax.php?1",divname:"dialog_cisterne",data:e,onSuccess:function(){"function"==typeof r&&r()}})},showDialogSelectCisterne:function(e){var t=$(".selectCisterna");t.off(),t.on("click",(function(t){e.idmagazzinosorgente=void 0;var a=$(this),o=$("#"+a.attr("id").replace("_text_","")),i=$("#dialog_cisterne"),n=o.data("dialog-iddeposito"),r=o.data("magazzino_field");n&&(e.idmagazzinosorgente=n),r&&(e.field_magazzino=r),waiting(),e.callback=function(){waiting(!1),dialogShow("dialog_cisterne",(function(){}),(function(){var e=$(".cisternaElem");e.off(),e.on("click",(function(){var e=$(this).data("index"),t=$("#dialog_cisterna_codice_"+e);a.val(t.data("descrizione_cisterna")),o.val(t.data("cisterna_id")),o.data("dialog-index",e),o.data("dialog-info",t.data()),i.data("loaded",!0),i.dialog("close"),o.change()})),$("#elenco_cisterne").DataTable().columns.adjust()}))},getHtmlDialogCisterne(e)})),e.afterLoaded&&"function"==typeof e.afterLoaded&&e.afterLoaded()},getDialogStandardCisterneFrantoio:function(e){e||(e={dialog:"dialog_cisterne",idtiposfuso:1,afterLoaded:null}),e.dialog||(e.dialog="dialog_cisterne"),showDialogSelectCisterne(e)},selectMultiItems:function(e){var t=$("#"+e.hidden_ids),a=$("#"+e.autocomplete+"_hidden"),o=t.val()?t.val().split(","):[];o.push(a.valFloat()),o=o.join(","),t.val(o.toString()),"function"==typeof e.callback&&e.callback(e)},removeIdFromMultiItems:function(e){for(var t=$("#"+e.hidden_ids),a=t.val().split(","),o=[],i=0;i"),!0)},adjustDataTables:function(){$($.fn.dataTable.tables(!0)).DataTable().columns.adjust()},deleteJqueryUpload:function deleteJqueryUpload(elem){var id=$(elem).data("id"),check=$("#myfile_del_"+id);IWConfirmTrueFalse(check.data("elimina-text"),(function(res){if(res){$("#nomefile_"+id).val(""),$("#idupload_"+id).val(0),console.log("#span_dradDropStr_"+id),$("#span_dradDropStr_"+id).html(check.data("trascina-text"));var ondeleteCallback=check.data("ondelete_callback");ondeleteCallback&&eval(ondeleteCallback)}check.is(":checked")?check.prop("checked",!1):check.prop("checked",!0)}))},reloadComponents:function reloadComponents(selector,from_datatables){selector||(selector=""),from_datatables||$(selector+".IWDataTables").each((function(){try{IWDatatable.buildDatatables(this)}catch(e){console.log("Errore caricamento Datatable: "+$(this).attr("id")),console.log(e)}})),$(selector+".iwSelect2").each((function(){IWDatatable.buildSelect2(this)}));var elements=[selector+".iw-autocomplete-input",selector+".datepicker",selector+".iw-qtip-jquery-ui",selector+".iw-minicolors",selector+".iw-dropdown-multiselect",selector+".iw-simple-xml"];elements.map((function(elem){$(elem).each((function(){eval($(this).data("iwfunction")),elem===selector+".iw-autocomplete-input"&&$(this).autocompleteOnFocusEvent()}))})),$(selector+".iw-jquery-upload").each((function(){IWDatatable.buildJqueryUploadFile(this)})),$(selector+".iw-ckeditor").each((function(){IWDatatable.buildCkEditor(this)}))},electronApi:function(e){var t=_objectSpread(_objectSpread({},{baseUrl:"https://localhost:3433",route:"/",type:"get",dataType:"json",headers:{Authorization:"Basic "+$("#electron_token").val(),"Content-Type":"application/json"},data:null,successCallback:null,errorCallback:null,show_waiting:!1,useConsoleLog:!1}),e);t.url=t.baseUrl+t.route,t.show_waiting&&waiting(!0),$.ajax(_objectSpread(_objectSpread({},t),{},{success:function(e){t.show_waiting&&waiting(!1),console.log(e),t.successCallback&&t.successCallback(e)},error:function(e){t.show_waiting&&waiting(!1);var a="";try{a=JSON.parse(e.responseText).message}catch(t){a=e.responseText}var o="Error "+e.status+"
"+a;t.useConsoleLog?console.log(o):alert(o),t.errorCallback&&t.errorCallback(o,e)}}))},avviaPesataOdeca:function(e){e.show_waiting&&waiting(!0),e.route||(e.route="readPeso"),$.ajax({url:"https://localhost:3433/"+e.route,type:"get",crossDomain:!0,dataType:"json",headers:{Authorization:"Basic "+$("#electron_token").val(),"Content-Type":"application/json"},success:function(t){if(e.show_waiting&&waiting(!1),console.log(t),t.data)try{var a=_wrapRegExp(/([A-Z])(\w)(.{7})(.{7})(.{7})(.{6})(.{6})(.{6})(.{7})/gm,{CMD:1,STATUS:2,NET:3,TARE:4,AWS:5,PCS:6,COD1:7,COD2:8,PROGR:9}).exec(t.data).groups,o=a.NET,i=a.TARE,n=Math.round(1e3*getFloat(o))/1e3,r=Math.round(1e3*getFloat(i))/1e3;e.success(n,r,t)}catch(t){"function"==typeof e.error&&e.error(t)}},error:function(t){e.show_waiting&&waiting(!1);var a="";try{a=JSON.parse(t.responseText).message}catch(e){a=t.responseText}var o="Error "+t.status+"
"+a;e.useConsoleLog?console.log(o):alert(o),"function"==typeof e.error&&e.error(o)}})},directPrint:function(e,t){var a={printer:null,pages:null,subset:null,scale:null,monochrome:!1,side:"simplex",bin:null,paperSize:"A4",printDialog:!1,copies:1},o={pdfUrl:e,options:t=_objectSpread(_objectSpread({},a),t)},i={};Object.keys(t).filter((function(e){Object.keys(a).includes(e)||(i[e]=t[e])})),electronApi(_objectSpread({route:"/printPdf",type:"post",data:JSON.stringify(o)},i))},replaceFormField:function(e,t){t||(t="form1"),"DIV"===$("#"+t).get(0).tagName&&(t+=" :input, :checkbox");var a=$("#"+t).serializeArray();return $.each(e,(function(e,t){var o=a.find((function(t){return t.name===e}));o?o.value=t:a.push({name:e,value:t})})),a},addRigheTableScroll:function(e){for(var t=e.idtable,a=e.entity,o=e.callback,i=e.field,n=e.is_autocomplete,r=[],l=0;l<$("#"+t+"_table_nrows").valFloat();l++)if($("#"+(t+"_"+i+"_"+l+(n?"_hidden":""))).valFloat()){var c=o(l);r.push(c)}$("#"+t+"_"+a+"_json").val(JSON.stringify(r)),$("#"+t+"_addRow").val(1),reloadTable(t,!1,(function(){$("#"+t+"_"+a+"_json").val(""),$("#"+t+"_addRow").val(0)}))},addRigaCultivar:function(e){addRigheTableScroll({idtable:e,entity:"cultivar",field:"idcultivar",is_autocomplete:!1,callback:function(t){return{idcultivar:$("#"+e+"_idcultivar_"+t).valFloat(),perc:$("#"+e+"_perc_"+t).valFloat()}}})},addRigheContabilizzazione:function(e){addRigheTableScroll({idtable:e,entity:"contab",field:"pdc",is_autocomplete:!0,callback:function(t){return{is_socio:$("#"+e+"_is_socio_"+t).valFloat(),idnazione:$("#"+e+"_idnazione_"+t).valFloat(),macrozona:$("#"+e+"_macrozona_"+t).valFloat(),id_deposito:$("#"+e+"_id_deposito_"+t).valFloat(),idgrupponominativi:$("#"+e+"_idgrupponominativi_"+t).valFloat(),idcanaledivendita:$("#"+e+"idcanaledivendita"+t).valFloat(),id_categoriaarticoli:$("#"+e+"_id_categoriaarticoli_"+t).valFloat(),id_pdc:$("#"+e+"_pdc_"+t+"_hidden").valFloat(),id_cdc:$("#"+e+"_cdc_"+t+"_hidden").valFloat()}}})},addRigheScadenzePagamento:function(e){addRigheTableScroll({idtable:e,entity:"modpagamento_scadenze",field:"ngiorni",callback:function(t){return{ngiorni:$("#"+e+"_ngiorni_"+t).valFloat(),add_fine_mese:$("#"+e+"_add_fine_mese_"+t).valFloat(),perc:$("#"+e+"_perc_"+t).valFloat(),importo_iva:$("#"+e+"_importo_iva_"+t).is(":checked")?1:0,tipo_pag:$("#"+e+"_tipo_pag_"+t).valFloat()}}})},openDialogCultivar:function(e){var t=$("#row_hidden_cultivar_"+e).val();t&&(t=JSON.parse(t)),getHtmlFromAjax({url:"ajax.php?1",divname:"dialog_modifica_cultivar",data:{codicedocumento:$("#codicedocumento").val(),tipoview:"openDialogCultivar",cultivar:t},onSuccess:function(){dialogShow("dialog_modifica_cultivar",(function(t){if(t){for(var a,o,i=$("#href_tablescroll_cultivar_"+e),n=[],r=[],l=0;l<$("#table_doc_cultivar_table_nrows").valFloat();l++)(a=$("#table_doc_cultivar_idcultivar_"+l).valFloat())&&(o=$("#table_doc_cultivar_perc_"+l).valFloat(),n.push({idcultivar:a,perc:o}),r.push($("#table_doc_cultivar_idcultivar_"+l+" option:selected").text()));n=n.length?JSON.stringify(n):"",$("#row_hidden_cultivar_"+e).val(n),i.html(r.length?i.data("cultivar_text")+": "+r.join(", "):i.data("insert_cultivar_text"))}}))}})},compilaCampiCultivar:function(e,t){var a=e.cultivar,o=e.cultivar_text,i=$("#href_tablescroll_cultivar_"+t);o||(o=i.data("insert_cultivar_text")),$("#row_hidden_cultivar_"+t).val(JSON.stringify(a)),i.html(o)},inlineTextFileDownload:function(e,t,a){a||(a="plain");var o=document.createElement("a"),i=new Blob([e],{type:"text/"+a}),n=URL.createObjectURL(i);o.setAttribute("href",n),o.setAttribute("download",t),o.click()}},$.fn.exists=function(){return this.length>0},$.fn.valFloat=function(){return getFloat($(this).val())},$.fn.valFloat2=function(){return getFloat2($(this).val())},$.fn.IWFooterDatatable=function(){try{this.datatable=eval("datatable_"+this.attr("id"))}catch(e){this.datatable=$("#"+this.attr("id")).DataTable()}return this.setFooterText=function(e,t,a){a||(a=0),0===a?$(this.datatable.column(t).footer()).html(e):$("tr:eq("+a+") th:eq("+t+")",this.datatable.table().footer()).html(e)},this},$.fn.toggleRow=function(){"none"==$(this).css("display")?$(this).showRow():$(this).hideRow()},$.fn.hideRow=function(){$(this).hide()},$.fn.showRow=function(){"none"==$(this).css("display")&&$(this).css("display","table-row")}}}]);