1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3452],{75067:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/branch-owner/pos-reports/orders",function(){return r(54468)}])},79976:function(e,t,r){"use strict";r.d(t,{Z:function(){return E}});var o=r(85893),n=r(1954),l=r(34386),a=r(93946),s=r(23795),i=r(86886),d=r(26447),u=r(11163),c=r(67294),h=r(82229),m=r(71964),p=r(50158),f=r(38026),v=r(97678),x=r(88767),b=r(43267),N=r(71383);let w=e=>{let{pageNo:t,searchText:r,sortValues:o,storeId:n}={...e},l={pageNo:t},a={searchText:r||"",sortValues:o||{branchName:-1},storeId:n,pageNo:t},s=(0,x.useQuery)({queryKey:["POS_ORDER_REPORT_LISTING"],queryFn:async()=>{let e=await (0,N.C4)({endPoint:b.n.posOrderReportList,body:a,params:l});return null==e?void 0:e.data},refetchOnWindowFocus:!1});return s};var g=r(41608),C=r(58496),O=r(34140);let y=e=>{let{onSearch:t,csvProps:r,hasFilters:n,placeholder:l,fileName:a}=e;return(0,o.jsx)(O.y,{onSearch:t,hasExport:!0,hasFilters:n,csvProps:r,placeholder:l,fileName:a})},S=e=>[{field:"branchName",headerName:"Branch name",minWidth:150,sortable:!0,disableColumnMenu:!0},{field:"totalNoOfOrders",headerName:"Total orders",minWidth:180,sortable:!0,disableColumnMenu:!0},{field:"totalNoOfQty",headerName:"Total quantity",minWidth:190,sortable:!0,disableColumnMenu:!0},{field:"totalOrdersAmount",headerName:"Total amount",minWidth:190,sortable:!0,disableColumnMenu:!0},{field:"View",headerName:"",minWidth:100,maxWidth:100,sortable:!1,disableColumnMenu:!0,renderCell:e}];var _=r(47986);let j=(e,t,r)=>{let o=e.reduce((e,t)=>({...e,[t.filterKey]:t.filterValue}),{}),n={apiLink:b.n.posOrderReportExport,bodyData:{searchText:r,storeId:t,...o,exportColumns:["branchName","totalNoOfOrders","totalNoOfQty","totalOrdersAmount"]}};return n},P=e=>{if(!e[0])return;let{field:t,sort:r}=e[0];return{[t]:(0,_.L9)(r)}};var T=r(19969),Z=r(83802);let E=e=>{let{listType:t,viewPath:r,placeholder:x}=e,[b,N]=(0,c.useState)(1),[O,_]=(0,c.useState)([]),[E,I]=(0,c.useState)(),R=(0,C.kK)(),k=t===g.at?"":R,[M,V]=(0,c.useState)(),{setIsMainMenuHidden:W}=(0,c.useContext)(T.p),{user:F}=(0,c.useContext)(Z.V);(0,c.useEffect)(()=>{var e,t,r;(null==F?void 0:null===(e=F.login)||void 0===e?void 0:e.role)!==g.PB&&(null==F?void 0:null===(t=F.login)||void 0===t?void 0:t.role)!==g.Vi&&(null===(r=null==localStorage?void 0:localStorage.getItem("StoreName"))||void 0===r?void 0:r.length)&&W(!0)},[]);let{data:L,isLoading:q,isFetching:A,refetch:D}=w({pageNo:b,searchText:E,storeId:k,sortValues:M}),{paginatedResults:K,lastPageNo:Q}={...null==L?void 0:L.data},X=(null==K?void 0:K.map((e,t)=>({_id:null==e?void 0:e.branchId,...e})))||[];(0,c.useEffect)(()=>{D({fetching:!0})},[E,b,M]);let B=e=>{N(1),I(e)},G=(0,c.useCallback)(()=>j(O,k,E),[O,E,R]),z=G(),H=e=>{let t=(0,u.useRouter)();return(0,o.jsx)(f.lx,{className:"d-flex justify-content-between align-items-center",children:(0,o.jsx)(l.Z,{title:"View",children:(0,o.jsx)(a.Z,{size:"small",component:s.Z,sx:{color:"text.secondary"},onClick:()=>{var r;t.push({pathname:"/stores/pos-reports/orders/view",query:{storeId:R,branchId:null==e?void 0:null===(r=e.row)||void 0===r?void 0:r.branchId}})},children:(0,o.jsx)(n.JO,{icon:"tabler:eye"})})})})};return(0,o.jsx)(h.Z,{children:(0,o.jsx)(i.ZP,{item:!0,xs:12,children:(0,o.jsxs)(f.rg,{variant:"outlined",children:[(0,o.jsx)(d.Z,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingX:5,paddingTop:5,children:(0,o.jsx)(m.G,{headerTitle:(0,v.Z)("common:orderReport")})}),(0,o.jsx)(y,{onSearch:B,csvProps:z,hasFilters:!1,placeholder:x,onFilterClear:()=>{_([])},fileName:(0,v.Z)("POSAdmin:exportFileNameReportsOrders")}),(0,o.jsx)(p.Z,{columns:S(H),rows:X,showShimmer:q,showLoader:A,autoHeight:!0,sortingMode:"server",onPaginationChange:N,currentPage:b,totalPageCount:Q,style:{},onSortModelChange:e=>{let t=P(e);V(t)}})]})})})}},54468:function(e,t,r){"use strict";r.r(t);var o=r(85893),n=r(97678),l=r(79976),a=r(41608);let s=()=>(0,o.jsx)(l.Z,{viewPath:"/branch-owner/pos-report/view",listType:a.mR,placeholder:(0,n.Z)("Search:posReportSearch")});t.default=s}},function(e){e.O(0,[4885,6826,4386,3445,5306,9080,2416,6187,2229,9774,2888,179],function(){return e(e.s=75067)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.