$((function(){$("#accordion-container").dxDataGrid({dataSource:repairHistoryList,columnAutoWidth:!0,keyExpr:"id",grouping:{autoExpandAll:!0},showBorders:!0,paging:{pageSize:5},headerFilter:{visible:!0},loadPanel:{enabled:!0},columns:[{dataField:"OPENRO_DATE",dataType:"date",format:"dd/MM/yyyy",groupIndex:0},{dataField:"REQUEST_DESC"},{dataField:"JOBSNAME"},{dataField:"WORK_TYPE"},{dataField:"CVDV_NAME"},{dataField:"LINETOTAL"},{dataField:"RO_DATE",dataType:"date",format:"dd/MM/yyyy"},{dataField:"MEETCUS",dataType:"date",format:"dd/MM/yyyy"},{dataField:"CLOSERO_DATE",dataType:"date",format:"dd/MM/yyyy"},{dataField:"TRANS_DATE",dataType:"date",format:"dd/MM/yyyy"},{dataField:"MAX_CREATE_DATE",dataType:"date",format:"dd/MM/yyyy"},{dataField:"SHIPDATE",dataType:"date",format:"dd/MM/yyyy"}],summary:{recalculateWhileEditing:!0,totalItems:[{column:"plate",summaryType:"count"}],groupItems:[{column:"OPENRO_DATE",summaryType:"count",displayFormat:"{0} orders"},{column:"LINETOTAL",summaryType:"sum",displayFormat:"Total: {0}",showInGroupFooter:!0}]}})}));var loadingPage=$("#loadpanel").dxLoadPanel({shadingColor:"rgba(0,0,0,0.4)",position:{my:"center",at:"center",of:window},visible:!1,showIndicator:!0,showPane:!0,message:_globals.language.processing,shading:!0,closeOnOutsideClick:!1,onShown:function(){},onHidden:function(){}}).dxLoadPanel("instance");function onDelete(t){$id=$(t).parent().attr("data-id");var a=DevExpress.ui.dialog.custom({title:_globals.language.delete,messageHtml:"<b>"+_globals.language.deleteitem+"</b>",buttons:[{text:"OK",onClick:function(t){return{buttonText:t.component.option("text")}}},{text:_globals.language.cancel,onClick:function(t){return{buttonText:t.component.option("text")}}}]});a.show().done((function(t){if("OK"==t.buttonText){_globals.apiDeleteData($id,"visit-customers");todayVisitData=todayVisitData.filter((function(t){return t.id!==$id})),"undefined"!==typeof todayVisitDataGrid&&null!==todayVisitData&&todayVisitDataGrid.option("dataSource",todayVisitData)}}))}function onEdit(t){$id=$(t).parent().attr("data-id"),createWindow("visit-customers/update/"+$id,_globals.language.customer_info)}function createWindow(t,a){$.window({showModal:!0,modalOpacity:.5,title:a,url:t,width:window.innerWidth-200,height:window.innerHeight-200,minWidth:200,minHeight:200,maxWidth:window.innerWidth,maxHeight:window.innerHeight,bookmarkable:!1,maximizable:!1,minimizable:!1})}var popup=null,image=null;function showLageImage(t){image=$(t).attr("src"),popup?popup.option("contentTemplate",popupOptions.contentTemplate.bind(this)):popup=$("#popup").dxPopup(popupOptions).dxPopup("instance"),popup.show()}function checkImage(t){return"undefined"!==typeof t&&t.trim().length>0?t:_globals.asset("img/noimg.jpg")}popupOptions={width:"70%",height:"80%",contentTemplate:function(){return $("<div />").css({height:"100%",width:"100%"}).append($("<img>",{src:checkImage(image),width:"100%",height:"100%"}))},showTitle:!0,title:_globals.language.image,visible:!1,dragEnabled:!1,closeOnOutsideClick:!0};