1 line
37 KiB
JavaScript
1 line
37 KiB
JavaScript
"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[6248],{23787:(e,s,i)=>{i.d(s,{FG:()=>A,nV:()=>x,pY:()=>j,pg:()=>h});var n=i(89379),r=i(80045),t=i(93230),a=i(2235),l=i(16491),o=i(82053),c=i(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:s,scroll:i=!1,onScroll:a,sx:l}=e,o=(0,r.A)(e,d);return(0,c.jsx)(t.A,(0,n.A)((0,n.A)({spacing:1.25,onScroll:a,sx:(0,n.A)((0,n.A)({p:1.5},i&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},o),{},{children:s}))},h=e=>{let{accent:s="#662582",header:i,footer:r,selected:t=!1,onClick:o,children:d,sx:x}=e;return(0,c.jsxs)(a.A,{elevation:0,onClick:o,sx:(0,n.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:t?s:"#e2e8f0",background:t?"".concat(s,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:s}}),(0,c.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[i,d,r]})]})},A=e=>{let{children:s,columns:i=2,sx:r}=e;return(0,c.jsx)(l.A,{sx:(0,n.A)({display:"grid",gridTemplateColumns:"repeat(".concat(i,", minmax(0, 1fr))"),gap:1,mt:1.25},r),children:s})},j=e=>{let{label:s,value:i,children:n,full:r=!1,align:t="left"}=e;return(0,c.jsxs)(l.A,{sx:{gridColumn:r?"1 / -1":"auto",minWidth:0,textAlign:t},children:[(0,c.jsx)(o.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:s}),(0,c.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==n?n:(0,c.jsx)(o.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==i&&void 0!==i?i:"\u2014"})})]})}},66248:(e,s,i)=>{i.r(s),i.d(s,{default:()=>oe});var n=i(89379),r=i(9950),t=i(46702),a=i(28429),l=i(26910),o=i(63189),c=i(19474),d=i(58833),x=i(53067),h=i(62824),A=i(52329),j=i(36256),m=i(32653),g=i(96583),p=i(28170),u=i(93230),f=i(41413),b=i(60899),v=i(25277),y=i(65429),w=i(92743),Y=i(36080),C=i(82053),S=i(29925),k=i(82223),z=i(40033),D=i(48159),M=i(84142),I=i(46639),F=i(93038),T=i(83274),H=i(25333),E=i(1320),O=i(15769),P=i(69780),W=i(9213),_=i(21671),R=i(34075),N=i(79739),U=i(25713),L=i(82917),q=i(25979),B=i(33738),$=i(74745),G=i(37476),K=i(72179),V=i(50027),X=i(52351),Z=i(4159),J=i.n(Z),Q=i(14857),ee=i(47223),se=i(23787),ie=i(46585),ne=i(94118),re=i(97973),te=i(8881),ae=i(44414),le=i(36220);J().extend(le);const oe=()=>{const[e,s]=(0,r.useState)([]),[i,Z]=(0,r.useState)(!0),le=(0,a.zy)(),[oe,ce]=(0,r.useState)(""),[de,xe]=(0,r.useState)(""),[he,Ae]=(0,r.useState)(""),[je,me]=(0,r.useState)(""),[ge,pe]=(0,r.useState)(!1),[ue,fe]=(0,r.useState)(""),[be,ve]=(0,r.useState)(""),[ye,we]=(0,r.useState)(!1),[Ye,Ce]=(0,r.useState)(""),[Se]=(0,r.useState)(""),[ke,ze]=(0,r.useState)(""),[De,Me]=(0,r.useState)(""),[Ie,Fe]=(0,r.useState)(""),[Te,He]=(0,r.useState)(""),[Ee,Oe]=(0,r.useState)([]),[Pe,We]=(0,r.useState)(""),[_e,Re]=(0,r.useState)(""),[Ne,Ue]=(0,r.useState)([]),[Le,qe]=(0,r.useState)([]),[Be,$e]=(0,r.useState)(""),[Ge,Ke]=(0,r.useState)(""),[Ve]=(0,r.useState)(""),[Xe]=(0,r.useState)(""),[Ze,Je]=(0,r.useState)(""),[Qe,es]=(0,r.useState)([]),[ss,is]=(0,r.useState)({shifts:0,assigned:0,remaining:0,shiftid:0,price:0}),[ns,rs]=(0,r.useState)(0),{state:ts}=(0,a.zy)(),[as,ls]=(0,r.useState)(""),os=(0,a.Zp)(),[cs,ds]=(0,r.useState)(["",""]),[xs,hs]=(0,r.useState)(""),[As,js]=(0,r.useState)(!1);(0,r.useEffect)((()=>{console.log("categoryarr"),console.log(e,de,Te,Ve,Xe)}),[Qe]),(0,r.useEffect)((()=>{ts&&($e(ts.orderheaderid),Ke(ts.tenantid)),console.log(ts),console.log(Date.now())}),[]),(0,r.useEffect)((()=>{ts&&($e(ts.orderheaderid),Ke(ts.tenantid)),console.log(ts),console.log(Date.now())}),[ts.orderheaderid,ts.tenantid]);const ms=(0,Q.A)(),gs=(0,ee.A)(ms.breakpoints.down("md")),ps=async()=>{Z(!0),await l.A.get("".concat("https://jupiter.nearle.app/live/api/v2","/orders/getordersbystatus?tenantid=").concat(Ge)).then((e=>{console.log(e);let s=e.data.Details.find((e=>e.orderheaderid==Be));console.log("result"),console.log(s),Oe(s.orderaddons),He(s.venuetype),We(s.remarks),hs(s.startdate),fe(s.tenantname),xe(""),ve(s.tenantaddress),me(s.eventname),Ae(J()(s.orderdate).format("MM/DD/YYYY")||""),ce(s.orderid),Ce(s.orderstatus),ze(s.taxamount),Me(s.orderamount),Fe(s.ordervalue),Re(J()(s.cancelled).format("MM/DD/YYYY")||""),Je(s.pending),Z(!1)})).catch((e=>{console.log(e),Z(!1)}))},us=async()=>{Z(!0),await l.A.get("".concat("https://jupiter.nearle.app/live/api/v2","/orders/getorderdetails?orderheaderid=").concat(Be)).then((e=>{console.log("res"),console.log(e),s(e.data.Details||[]),console.log("categoryarr"),es(e.data.Details),console.log(e.data.Details),Z(!1)})).catch((e=>{console.log(e),Z(!1)}))},fs=async e=>{Z(!0);try{await l.A.get("".concat("https://jupiter.nearle.app/live/api/v2","/orders/getassignedinfo?orderdetailid=").concat(e)).then((e=>{console.log(e),e.data.status&&Ue(e.data.Details),Z(!1)})).catch((e=>{console.log(e),Z(!1)}))}catch(s){console.log(s),Z(!1)}},bs=async e=>{let s={orderheaderid:Be,orderprocessid:e.orderprocessid,orderdetailid:e.orderdetailid,orderstatus:"pending",pending:J()().format("YYYY-MM-DD HH:mm:ss"),status:1};console.log(s),await l.A.put("".concat("https://jupiter.nearle.app/live/api/v2","/orders/updateprocessstatus"),s).then((s=>{console.log(s),"Successful"===s.data.message&&((0,te.M8)("Role unassigned successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),ss.assigned>ss.shifts&&vs(e),ps(),us(),pe(!1),Cs(),ys(),setTimeout((()=>{Cs()}),2e3))})).catch((e=>{console.log(e)}))},vs=e=>{let s;console.log(e);let i=[e.userfcmtoken],n=[{notificationid:0,notificationdate:J()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Un-Asigned",message:"".concat(e.firstname," has been Un-assigned to the order ").concat(oe),configid:2,tenantid:Ge,orderheaderid:Be,orderprocessid:e.orderprocessid,shiftid:e.shiftid,userid:e.userid,orderid:oe,success:0,orderstatus:"assigned",processing:J()().format("YYYY-MM-DD HH:mm:ss"),notifytype:2,notifyreason:"Staff Un-Assigned"}];s={Title:"Staff Un-Asigned",message:"A Staff has been Un-assigned to the order ".concat(oe),tenantid:Ge,orderheaderid:Be,orderid:oe,configid:2};let r={notifications:n,fcmmodel:{priority:"high",registration_ids:i,data:s,notification:{body:"An order has been Un-assigned ".concat(oe),title:"Legendary",sound:"ring",content_available:!0,click_action:"FLUTTER_NOTIFICATION_CLICK"}}};console.log("grpnotifyobj unassign"),console.log(r),Ys(r)};(0,r.useEffect)((()=>{console.log(Be),Be&&Ge?(ps(),us(),Cs(),console.log(le.state||"")):Z(!1),console.log(Be,Ge)}),[Be,Ge,as]);const ys=()=>{we(!1),qe([]),ds(["",""])};(0,r.useEffect)((()=>{console.log(ss)}));const ws=async e=>{let s=e.userfcmtoken,i={notificationid:0,notificationdate:J()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Asigned",message:"A Staff has been assigned to the order ".concat(oe),configid:2,tenantid:Ge,orderheaderid:Be,orderprocessid:e.orderprocessid,shiftid:e.shiftid,userid:e.userid,orderid:oe,sound:"ring",click_action:"FLUTTER_NOTIFICATION_CLICK"};console.log(i,s),await l.A.post("".concat("https://jupiter.nearle.app/live/api/v2","/utils/notification/send"),{priority:"high",registration_ids:[s],data:i,notification:{body:"A Staff has been assigned to ".concat(oe),title:"Legendary",sound:"ring",content_available:!0}},{headers:{Authorization:"Bearer ".concat("")}}).then((e=>{console.log(e),(0,te.M8)("Notification sent successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})})).catch((e=>{console.log(e)}))},Ys=async e=>{console.log(e),await l.A.post("".concat("https://jupiter.nearle.app/live/api/v2","/utils/notification/sendall"),e,{headers:{Authorization:"Bearer ".concat("")}}).then((e=>{console.log(e),e.data.status&&((0,te.M8)("Notification sent successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),ps())})).catch((e=>{console.log(e)}))},Cs=async()=>{await l.A.get("".concat("https://jupiter.nearle.app/live/api/v2","/orders/getorderstatuscount?orderheaderid=").concat(Be)).then((e=>{e.data.status?(console.log(e),ls(e.data.pendingcount),ps()):(ls(e.data.pendingcount),ps())})).catch((e=>{console.log(e)}))};function Ss(e){let{open:s,handleClose:i}=e;const[n,t]=(0,r.useState)("");return(0,ae.jsx)(g.A,{open:s,onClose:()=>i(!1),maxWidth:"xs",fullScreen:gs,PaperProps:{sx:{borderRadius:{xs:0,sm:3}}},children:(0,ae.jsx)(p.A,{sx:{mt:2,my:1},children:(0,ae.jsxs)(u.A,{alignItems:"center",spacing:3.5,children:[(0,ae.jsx)(f.A,{color:"error",sx:{width:72,height:72,fontSize:"1.75rem"},children:(0,ae.jsx)(j.A,{})}),(0,ae.jsx)(b.Ay,{children:(0,ae.jsx)(v.A,{label:oe.slice(4),variant:"combined",color:"warning",size:"small"})}),(0,ae.jsxs)(u.A,{spacing:2,children:[As&&(0,ae.jsxs)(y.A,{color:"warning",variant:"border",icon:(0,ae.jsx)(ie.A,{}),children:[(0,ae.jsx)(w.A,{children:"Order is within 24Hrs time frame. The order will be invoiced with standard pricing as agreed."}),(0,ae.jsx)(Y.A,{href:"https://thelegendarystaff.com/",target:"_blank",children:"Terms & Condition link"})]}),(0,ae.jsx)(C.A,{variant:"h4",align:"center",children:"Please type in the order number to confirm."}),(0,ae.jsx)(S.A,{type:"text",onChange:e=>{console.log(e.target.value),t(e.target.value)},error:n!==oe.slice(4),value:n})]}),(0,ae.jsxs)(u.A,{direction:"row",spacing:2,sx:{width:1},children:[(0,ae.jsx)(k.A,{fullWidth:!0,color:"error",variant:"contained",onClick:()=>{n===oe.slice(4)&&((async()=>{await l.A.put("".concat("https://jupiter.nearle.app/live/api/v2","/orders/cancel"),{orderheaderid:parseInt(Be),orderstatus:"cancelled",cancelled:J()().format("YYYY-MM-DD HH:mm:ss"),unserviceable:As?0:1}).then((e=>{console.log(e),e.data.status&&Be&&Ge&&(ps(),us())})).catch((e=>{console.log(e)}))})(),i(!0))},autoFocus:!0,children:"Yes, Cancel"}),(0,ae.jsx)(k.A,{fullWidth:!0,onClick:()=>i(!1),color:"secondary",variant:"outlined",children:"No"})]})]})})})}return(0,ae.jsxs)(ae.Fragment,{children:[i&&(0,ae.jsx)(X.A,{}),(0,ae.jsx)(Ss,{open:ge,handleClose:()=>{pe(!1)}}),(0,ae.jsxs)(g.A,{maxWidth:!1,fullWidth:!0,open:ye,onClose:ys,scroll:"paper",fullScreen:gs,PaperProps:{sx:{borderRadius:{xs:0,sm:3}}},TransitionComponent:G.s,children:[(0,ae.jsxs)(z.A,{children:[(0,ae.jsxs)(u.A,{direction:"row",justifyContent:"space-between",children:[(0,ae.jsxs)(u.A,{direction:{sm:"row",xs:"column"},spacing:2,alignItems:"center",children:[(0,ae.jsx)(C.A,{variant:"h3",children:"Assign Roles"}),(0,ae.jsx)(v.A,{label:ue,variant:"light",color:"primary"})]}),(0,ae.jsx)(v.A,{label:oe,variant:"combined",color:"warning",size:"large"})]}),(0,ae.jsxs)(b.Ay,{container:!0,sx:{p:1},spacing:2,children:[(0,ae.jsx)(b.Ay,{item:!0,sm:6,xs:12,children:(0,ae.jsx)(D.A,{value:ns,onChange:()=>rs((e=>0===e?1:0)),variant:"scrollable",scrollButtons:"auto",children:(0,ae.jsx)(M.A,{label:Se})})}),(0,ae.jsx)(b.Ay,{item:!0,sm:6,xs:12,children:(0,ae.jsxs)(u.A,{direction:"row",justifyContent:{xs:"flex-start",sm:"flex-end"},sx:{height:"100%"},spacing:2,children:[(0,ae.jsx)(v.A,{sx:{width:"130px"},label:"Required:".concat(ss.shifts),variant:"combined",color:"primary",size:"normal"}),(0,ae.jsx)(v.A,{sx:{width:"130px"},label:"Assigned: ".concat(ss.assigned),variant:"combined",color:"success",size:"normal"}),(0,ae.jsx)(v.A,{sx:{width:"130px"},label:"Remaining: ".concat(ss.remaining),variant:"combined",color:"error",size:"normal"})]})})]})]}),(0,ae.jsx)(p.A,{dividers:!0,children:0===Ne.length?(0,ae.jsx)(ae.Fragment,{children:i?(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(u.A,{alignItems:"center",children:(0,ae.jsx)(I.A,{})})}):(0,ae.jsx)(C.A,{children:"No Staffs Available"})}):gs?(0,ae.jsx)(se.nV,{children:Ne.map(((e,s)=>{const i=!!Le.find((s=>s.userid==e.userid));return(0,ae.jsxs)(se.pg,{accent:"#662582",selected:i,children:[(0,ae.jsxs)(u.A,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",spacing:1,children:[(0,ae.jsxs)(u.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,ae.jsx)(f.A,{alt:"",src:"",sx:{width:32,height:32}}),(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"subtitle2",children:e.firstname}),(0,ae.jsx)(C.A,{variant:"caption",color:"textSecondary",children:e.contactno})]})]}),e.orderdetailid!==orderdetailid?(0,ae.jsx)(F.A,{disabled:0!==e.orderdetailid,checked:i,onClick:s=>{if(console.log(ss),ss.remaining>=0){if(s.target.checked&&0!=ss.remaining){let s=Le;s.push({userid:e.userid,orderdetailid:orderdetailid,productid:productid,shiftid:ss.shiftid,userrate:ss.price,productrate:e.rolecost,firstname:e.firstname}),qe([...s]);let i=ss;i.assigned++,i.remaining=i.shifts-i.assigned,is((0,n.A)({},i))}else if(ss.assigned!=ss.shifts||0===ss.remaining&&!s.target.checked){let s=Le,i=s.findIndex((s=>s.userid===e.userid));s.splice(i,1),qe([...s]);let r=ss;r.assigned--,r.remaining=r.shifts-r.assigned,is((0,n.A)({},r))}console.log(Le)}}}):(0,ae.jsxs)(u.A,{direction:"row",alignItems:"center",children:[(0,ae.jsx)(v.A,{label:"Assigned",color:"success",size:"small",sx:{mr:1}}),(0,ae.jsx)(T.A,{title:"Unassign",children:(0,ae.jsx)(H.A,{color:"error",onClick:()=>{console.log(e),bs(e)},children:(0,ae.jsx)(ne.A,{})})}),(0,ae.jsx)(T.A,{title:"Send Notification",children:(0,ae.jsx)(H.A,{color:"info",onClick:()=>{console.log(e),ws(e)},children:(0,ae.jsx)(m.A,{})})})]})]}),(0,ae.jsxs)(se.FG,{children:[(0,ae.jsx)(se.pY,{label:"Category",children:(0,ae.jsxs)(u.A,{direction:"column",alignItems:"flex-start",spacing:.25,children:[(0,ae.jsx)(C.A,{variant:"caption",color:"textSecondary",children:e.cateoryname}),(0,ae.jsx)(v.A,{label:e.subcategoryname,color:"info",size:"small",variant:"light"})]})}),(0,ae.jsx)(se.pY,{label:"Price",value:e.rolecost}),(0,ae.jsx)(se.pY,{label:"Experience",value:"".concat(e.experience," Years")}),(0,ae.jsx)(se.pY,{label:"Level",children:(0,ae.jsx)(v.A,{label:e.levelofexperience,size:"small",color:"primary",variant:"light"})}),(0,ae.jsx)(se.pY,{label:"City",value:e.city}),e.orderid&&(0,ae.jsx)(se.pY,{label:"Order",children:(0,ae.jsx)(v.A,{label:e.orderid,color:"warning",size:"small",variant:"light"})})]})]},s)}))}):(0,ae.jsx)(E.A,{children:(0,ae.jsxs)(O.A,{children:[(0,ae.jsx)(P.A,{children:(0,ae.jsxs)(W.A,{children:[(0,ae.jsx)(_.A,{children:"#"}),(0,ae.jsx)(_.A,{children:"Staff"}),(0,ae.jsx)(_.A,{children:"Category"}),(0,ae.jsx)(_.A,{children:"Price"}),(0,ae.jsx)(_.A,{children:"Experience"}),(0,ae.jsx)(_.A,{children:"Level"}),(0,ae.jsx)(_.A,{children:"City"}),(0,ae.jsx)(_.A,{children:"Action"}),(0,ae.jsx)(_.A,{})]})}),(0,ae.jsx)(R.A,{children:Ne.map(((e,s)=>(0,ae.jsx)(r.Fragment,{children:(0,ae.jsxs)(W.A,{sx:{backgroundColor:Le.find((s=>s.userid==e.userid))?"#f5f5f5":"",":hover":{backgroundColor:Le.find((s=>s.userid==e.userid))?"#f5f5f5 !important":""}},children:[(0,ae.jsx)(_.A,{component:"th",scope:"row",padding:"none",children:s+1}),(0,ae.jsx)(_.A,{align:"left",sx:{paddingLeft:"0px !important"},children:(0,ae.jsxs)(u.A,{direction:"row",alignItems:"center",spacing:1,justifyContent:"flex-start",children:[(0,ae.jsx)(f.A,{alt:"",size:"sm",src:"",sx:{width:"25px",height:"25px"}}),(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"caption",children:e.firstname}),(0,ae.jsx)(C.A,{variant:"caption",color:"textSecondary",children:e.contactno})]})]})}),(0,ae.jsx)(_.A,{align:"left",children:(0,ae.jsxs)(u.A,{direction:"column",alignItems:"flex-start",children:[(0,ae.jsx)(C.A,{variant:"caption",color:"textSecondary",children:e.cateoryname}),(0,ae.jsx)(v.A,{label:e.subcategoryname,color:"info",size:"small",variant:"light"})]})}),(0,ae.jsx)(_.A,{children:e.rolecost}),(0,ae.jsxs)(_.A,{align:"left",children:[e.experience," Years"]}),(0,ae.jsx)(_.A,{align:"left",children:(0,ae.jsx)(v.A,{label:e.levelofexperience,size:"small",color:"primary",variant:"light"})}),(0,ae.jsx)(_.A,{align:"left",children:e.city}),(0,ae.jsx)(_.A,{align:"left",children:e.orderdetailid!==orderdetailid?(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(F.A,{disabled:0!==e.orderdetailid,checked:!!Le.find((s=>s.userid==e.userid)),onClick:s=>{if(console.log(ss),ss.remaining>=0){if(s.target.checked&&0!=ss.remaining){let s=Le;s.push({userid:e.userid,orderdetailid:orderdetailid,productid:productid,shiftid:ss.shiftid,userrate:ss.price,productrate:e.rolecost,firstname:e.firstname}),qe([...s]);let i=ss;i.assigned++,i.remaining=i.shifts-i.assigned,is((0,n.A)({},i))}else if(ss.assigned!=ss.shifts||0===ss.remaining&&!s.target.checked){let s=Le,i=s.findIndex((s=>s.userid===e.userid));s.splice(i,1),qe([...s]);let r=ss;r.assigned--,r.remaining=r.shifts-r.assigned,is((0,n.A)({},r))}console.log(Le)}}})}):(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(v.A,{label:"Assigned",color:"success",size:"small",sx:{mr:1}}),(0,ae.jsx)(T.A,{title:"Unassign",children:(0,ae.jsx)(H.A,{color:"error",onClick:()=>{console.log(e),bs(e)},children:(0,ae.jsx)(ne.A,{})})}),(0,ae.jsx)(T.A,{title:"Send Notification",children:(0,ae.jsx)(H.A,{color:"info",onClick:()=>{console.log(e),ws(e)},children:(0,ae.jsx)(m.A,{})})})]})}),(0,ae.jsx)(_.A,{children:e.orderid&&(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(v.A,{label:e.orderid,color:"warning",size:"small",variant:"light"})})})]})},s)))})]})})}),(0,ae.jsx)(N.A,{children:(0,ae.jsxs)(u.A,{sx:{mt:2,width:{xs:"100%",sm:"auto"}},direction:{xs:"column",sm:"row"},justifyContent:"flex-end",spacing:{xs:1.5,sm:5},children:[Ne.length>0&&(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsx)(k.A,{sx:{width:{xs:"100%",sm:"130px"}},variant:"contained",onClick:async()=>{let e=[],s=[];Le.map((i=>{e.push({orderprocessid:0,processdate:J()().format("YYYY-MM-DD HH:mm:ss"),tenantid:Ge,orderheaderid:Be,orderdetailid:i.orderdetailid,productid:i.productid,userid:i.userid,orderstatus:"pending",pending:"".concat(J()(Ze).format("YYYY-MM-DD")," ").concat(J()(Ze).format("HH:mm:ss")),starttime:"".concat(J()(Ve).format("YYYY-MM-DD")," ").concat(J()(Ve).format("HH:mm:ss")),endtime:"".concat(J()(Xe).format("YYYY-MM-DD")," ").concat(J()(Xe).format("HH:mm:ss")),appuserid:parseInt(localStorage.getItem("appuserid")),shiftid:i.shiftid,userrate:i.userrate,productrate:i.productrate}),Le.map((e=>{s.push({notificationid:0,notificationdate:J()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Asigned",message:"A Staff has been assigned to the order ".concat(oe),configid:2,tenantid:Ge,orderheaderid:Be,orderprocessid:0,shiftid:e.shiftid,userid:e.userid,orderid:oe,sound:"ring",click_action:"FLUTTER_NOTIFICATION_CLICK",firstname:e.firstname})}))})),console.log("arr"),console.log(e),await l.A.post("".concat("https://jupiter.nearle.app/live/api/v2","/orders/createorderprocess"),e).then((e=>{console.log(e),"Successfully created"===e.data.message&&((0,te.M8)("Roles assigned successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),we(!1),us(),Cs())})).catch((e=>{console.log(e)})),console.log(e)},children:"OK"}),(0,ae.jsx)(k.A,{sx:{width:{xs:"100%",sm:"130px"}},color:"warning",variant:"contained",onClick:()=>{qe([]);let e=ss;e.remaining=e.shifts,e.assigned=0,is(e)},children:"clear"})]}),(0,ae.jsx)(k.A,{sx:{width:{xs:"100%",sm:"130px"}},color:"error",variant:"contained",onClick:()=>{ys()},children:"Close"})]})})]}),(0,ae.jsxs)(b.Ay,{container:!0,rowSpacing:2,columnSpacing:2.75,children:[(0,ae.jsx)(U.A,{sx:{position:"sticky",top:"60px",bgcolor:ms.palette.background.default,zIndex:1,width:"100%"},children:(0,ae.jsx)(b.Ay,{item:!0,xs:12,children:(0,ae.jsxs)(u.A,{direction:{md:"row",xs:"column"},justifyContent:"space-between",alignItems:"flex-end",sx:{width:"100%",p:1},children:[(0,ae.jsxs)(u.A,{direction:"row",spacing:2,alignItems:"center",justifyContent:"flex-start",sx:{width:{xs:"100%",md:"0"}},children:[(0,ae.jsx)(H.A,{onClick:()=>history.back(),children:(0,ae.jsx)(o.A,{})}),(0,ae.jsxs)(u.A,{direction:"column",alignItems:"flex-start",children:[(0,ae.jsx)(C.A,{variant:"h3",children:"Details"}),(0,ae.jsxs)(u.A,{direction:"row",spacing:1,children:[(0,ae.jsx)(v.A,{label:""===oe?(0,ae.jsx)(L.A,{sx:{width:"80px",bgcolor:"#fff9c4"},animation:"wave"}):oe,variant:"combined",color:"warning",size:"small"}),(0,ae.jsx)(v.A,{label:""===he?(0,ae.jsx)(L.A,{sx:{width:"80px",bgcolor:"#b3e5fc"},animation:"wave"}):he,variant:"combined",color:"primary",size:"small"}),"pending"===Ye&&(0,ae.jsx)(v.A,{label:"Pending",color:"error",size:"small"}),"cancelled"===Ye&&(0,ae.jsx)(v.A,{label:"Cancelled",color:"secondary",size:"small"}),"completed"===Ye&&(0,ae.jsx)(v.A,{label:"Completed",color:"primary",size:"small"}),"processing"===Ye&&(0,ae.jsx)(v.A,{label:"Processing",color:"primary",size:"small"}),"assigned"===Ye&&(0,ae.jsx)(v.A,{label:"Assigned",color:"warning",size:"small"}),"confirmed"===Ye&&(0,ae.jsx)(v.A,{label:"Confirmed",color:"success",size:"small"}),"active"===Ye&&(0,ae.jsx)(v.A,{label:"Active",color:"info",size:"small"}),"closed"===Ye&&(0,ae.jsx)(v.A,{label:"Closed",color:"info",size:"small"}),"modified"===Ye&&(0,ae.jsx)(v.A,{label:"Modified",color:"secondary",size:"small",variant:"contained"})]})]})]}),(0,ae.jsxs)(u.A,{direction:{xs:"column",sm:"row"},spacing:2,sx:{mt:{md:0,xs:2},width:{xs:"100%",md:"auto"}},children:[("pending"===Ye||"assigned"===Ye||"confirmed"===Ye||"modified"===Ye)&&(0,ae.jsx)(T.A,{title:"Edit",children:(0,ae.jsx)(k.A,{variant:"outlined",color:"info",sx:{borderRadius:"40px",width:{xs:"100%",sm:"auto"}},startIcon:(0,ae.jsx)(t.A,{color:"info"}),onClick:e=>{e.stopPropagation(),J()(J()().format("MM-DD-YYYY")).isBefore(J()(J()(xs).format("MM-DD-YYYY")))?os("/editorder",{state:{orderheaderid:Be,tenantid:Ge}}):(0,te.M8)("Order cannot be edited.\n Order date is not valid at this time",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:4e3,style:{whiteSpace:"pre-line"}})},children:"Edit Order"})}),"cancelled"!==Ye&&""!==Ye&&"completed"!==Ye&&"closed"!==Ye&&(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(k.A,{variant:"outlined",color:"error",onClick:()=>{console.log(J()(xs).diff(J()(),"m")/60),J()(xs).diff(J()(),"m")/60>24?(js(!1),pe(!0)):(js(!0),pe(!0))},sx:{borderRadius:"40px",mt:{xs:2,sm:0},width:{xs:"100%",sm:"auto"}},startIcon:(0,ae.jsx)(K.A,{}),children:"Cancel Order"})}),"cancelled"===Ye&&(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(v.A,{label:"Order Cancelled on ".concat(_e),variant:"combined",color:"error"})})]})]})})}),(0,ae.jsx)(b.Ay,{item:!0,xs:12,sx:{mt:-2},children:(0,ae.jsx)(V.A,{content:!1,width:"100%",children:(0,ae.jsxs)(b.Ay,{container:!0,spacing:2.5,sx:{p:2.5},children:[(0,ae.jsx)(b.Ay,{item:!0,xs:12,sm:6,children:(0,ae.jsx)(V.A,{sx:{height:"100%"},children:(0,ae.jsxs)(u.A,{spacing:1,children:[(0,ae.jsx)(C.A,{variant:"h5",children:"Client"}),(0,ae.jsx)(C.A,{color:"secondary",children:""===ue?(0,ae.jsx)(L.A,{sx:{width:"40%"},animation:"wave"}):ue}),(0,ae.jsx)(q.A,{sx:{width:"100%"},children:(0,ae.jsx)(C.A,{color:"secondary",children:""===be?(0,ae.jsx)(L.A,{sx:{width:"90%"},animation:"wave"}):be})})]})})}),(0,ae.jsx)(b.Ay,{item:!0,xs:12,sm:6,children:(0,ae.jsx)(V.A,{sx:{height:"100%"},children:(0,ae.jsxs)(u.A,{spacing:1,children:[(0,ae.jsx)(C.A,{variant:"h5",children:"Event"}),(0,ae.jsx)(q.A,{sx:{width:"100%"},children:(0,ae.jsx)(C.A,{color:"secondary",children:""===je?(0,ae.jsx)(L.A,{sx:{width:"40%"},animation:"wave"}):je})})]})})}),Qe.map(((e,s)=>(0,ae.jsx)(r.Fragment,{children:(0,ae.jsx)(b.Ay,{item:!0,xs:12,children:(0,ae.jsxs)(V.A,{sx:{opacity:0==e.shiftstatus?"":"0.7"},children:[(0,ae.jsxs)(u.A,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{md:"center",xs:"flex-start"},spacing:2,sx:{p:2},children:[(0,ae.jsxs)(u.A,{direction:{xs:"column",md:"row"},spacing:2,alignItems:{md:"center",xs:"flex-start"},children:[(0,ae.jsxs)(C.A,{variant:"h5",children:["Shift ",s+1]}),(0,ae.jsxs)(C.A,{color:"secondary",children:[(0,ae.jsx)(c.A,{})," ","",e.locationaddress]}),1===e.shiftstatus&&(0,ae.jsx)(v.A,{label:"Cancelled",color:"secondary"})]}),(0,ae.jsx)(u.A,{direction:"row",spacing:1,children:e.ordercontacts.map((e=>(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(T.A,{title:e.contactname,children:(0,ae.jsx)(f.A,{sx:{bgcolor:"#2196f3",width:30,height:30},alt:"A",children:e.contactname.charAt(0).toUpperCase()})})})))})]}),gs?(0,ae.jsxs)(se.nV,{children:[0===e.orderdetails.length&&(0,ae.jsxs)(se.pg,{accent:"#662582",children:[(0,ae.jsx)(L.A,{animation:"wave"}),(0,ae.jsx)(L.A,{animation:"wave"}),(0,ae.jsx)(L.A,{animation:"wave"})]}),e.orderdetails.map(((e,n)=>(0,ae.jsxs)(se.pg,{accent:"#662582",sx:{opacity:0==e.status?"":"0.7"},children:[(0,ae.jsxs)(u.A,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",spacing:1,children:[(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsxs)(C.A,{sx:{fontSize:10,fontWeight:800,color:"#94a3b8"},children:["#",n+1]}),(0,ae.jsx)(C.A,{variant:"subtitle1",children:e.productname})]}),(0,ae.jsxs)(u.A,{direction:"row",alignItems:"center",children:[(0,ae.jsx)(T.A,{title:"Expand",children:(0,ae.jsx)(H.A,{"aria-label":"expand row",style:{color:ms.palette.primary.main},onClick:()=>{Ue([]),ds(cs[0]===s&&cs[1]===n?["",""]:[s,n]),fs(e.orderdetailid)},children:cs[0]===s&&cs[1]===n?(0,ae.jsx)(h.A,{}):(0,ae.jsx)(A.A,{})})}),"cancelled"===Ye&&(0,ae.jsx)(H.A,{sx:{minWidth:"10px !important"},disabled:!0,children:(0,ae.jsx)(d.A,{})}),1===e.status&&(0,ae.jsx)(T.A,{title:"Cancelled",children:(0,ae.jsx)(H.A,{sx:{minWidth:"10px !important"},children:(0,ae.jsx)(K.A,{color:"error"})})}),e.supplyqty>e.orderqty&&(0,ae.jsx)(T.A,{title:"Assigned count is greater than ordered count",children:(0,ae.jsx)(H.A,{color:"warning",children:(0,ae.jsx)(re.A,{})})})]})]}),(0,ae.jsxs)(se.FG,{children:[(0,ae.jsx)(se.pY,{label:"Start Date",children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.starttime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"caption",children:J()(e.starttime).format("hh:mm A")})]})}),(0,ae.jsx)(se.pY,{label:"End Date",children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.endtime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"caption",children:J()(e.endtime).format("hh:mm A")})]})}),(0,ae.jsx)(se.pY,{label:"Unpaid Break",value:e.unpaidbreak||0}),(0,ae.jsx)(se.pY,{label:"Count",children:(0,ae.jsx)(v.A,{label:e.orderqty,color:"success",variant:"light",size:"small"})}),(0,ae.jsx)(se.pY,{label:"Assigned",children:(0,ae.jsx)(v.A,{label:e.supplyqty,color:0===e.supplyqty?"error":"warning",variant:"light",size:"small"})}),(0,ae.jsx)(se.pY,{label:"Price",value:"$".concat(e.price)}),(0,ae.jsx)(se.pY,{label:"Amount",value:"$".concat(e.landingamount)})]}),(0,ae.jsxs)(B.A,{in:cs[0]===s&&cs[1]===n,timeout:"auto",unmountOnExit:!0,children:[(0,ae.jsx)($.A,{sx:{my:1.5}}),0===Ne.length?i?(0,ae.jsx)(u.A,{alignItems:"center",children:(0,ae.jsx)(I.A,{})}):(0,ae.jsx)(u.A,{sx:{p:1},children:(0,ae.jsx)(C.A,{children:"No Staffs has been Assigned"})}):(0,ae.jsx)(u.A,{spacing:1,children:Ne.map(((e,s)=>(0,ae.jsxs)(se.pg,{accent:"#0ea5e9",children:[(0,ae.jsxs)(u.A,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",children:[(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"subtitle2",children:e.staffname}),(0,ae.jsx)(b.Ay,{children:(0,ae.jsx)(v.A,{label:e.productname,color:"info",variant:"light",size:"small"})})]}),(0,ae.jsxs)(u.A,{direction:"row",children:["pending"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Pending",color:"error",size:"small"}),"cancelled"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Cancelled",color:"secondary",size:"small"}),"completed"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Completed",color:"primary",size:"small"}),"processing"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Processing",color:"primary",size:"small"}),"assigned"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Assigned",color:"warning",size:"small"}),"confirmed"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Confirmed",color:"success",size:"small"}),"active"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Active",color:"info",size:"small"}),"closed"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Closed",color:"info",size:"small"})]})]}),(0,ae.jsxs)(se.FG,{children:[(0,ae.jsx)(se.pY,{label:"Start Time",children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.Starttime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"caption",children:J()(e.Starttime).format("hh:mm A")})]})}),(0,ae.jsx)(se.pY,{label:"End Time",children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.Endtime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"caption",children:J()(e.Endtime).format("hh:mm A")})]})}),(0,ae.jsx)(se.pY,{label:"Pay Rate",value:e.rolecost}),(0,ae.jsx)(se.pY,{label:"Hours Worked",value:e.hoursworked}),(0,ae.jsx)(se.pY,{label:"Clockin",children:(0,ae.jsxs)(u.A,{spacing:.5,alignItems:"flex-start",children:[(0,ae.jsx)(v.A,{label:e.clockin?J()(e.clockin).format("MM/DD/YYYY"):"",color:"primary",variant:"light",size:"small"}),(0,ae.jsx)(v.A,{label:e.clockin?J()(e.clockin).format("hh:mm A"):"",color:"info",variant:"light",size:"small"})]})}),(0,ae.jsx)(se.pY,{label:"Clockout",children:(0,ae.jsxs)(u.A,{spacing:.5,alignItems:"flex-start",children:[(0,ae.jsx)(v.A,{label:e.clockout?J()(e.clockout).format("MM/DD/YYYY"):"",color:"primary",variant:"light",size:"small"}),(0,ae.jsx)(v.A,{label:e.clockout?J()(e.clockout).format("hh:mm A"):"",color:"info",variant:"light",size:"small"})]})})]})]},s)))})]})]},n+1)))]}):(0,ae.jsx)(E.A,{children:(0,ae.jsxs)(O.A,{children:[(0,ae.jsx)(P.A,{children:(0,ae.jsxs)(W.A,{children:[(0,ae.jsx)(_.A,{children:"#"}),(0,ae.jsx)(_.A,{children:"Role"}),(0,ae.jsx)(_.A,{children:"Start Date"}),(0,ae.jsx)(_.A,{children:"End Date"}),(0,ae.jsx)(_.A,{children:"Unpaid break"}),(0,ae.jsx)(_.A,{children:"Count"}),(0,ae.jsx)(_.A,{children:"Assigned"}),(0,ae.jsx)(_.A,{children:"Attire"}),(0,ae.jsx)(_.A,{children:"Price"}),(0,ae.jsx)(_.A,{children:"Amount"}),(0,ae.jsx)(_.A,{children:"Action"})]})}),(0,ae.jsxs)(R.A,{children:[0===e.orderdetails.length&&(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsxs)(W.A,{children:[(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsxs)(_.A,{children:[(0,ae.jsx)(L.A,{animation:"wave"}),(0,ae.jsx)(L.A,{animation:"wave"})]}),(0,ae.jsxs)(_.A,{children:[(0,ae.jsx)(L.A,{animation:"wave"}),(0,ae.jsx)(L.A,{animation:"wave"})]}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})}),(0,ae.jsx)(_.A,{children:(0,ae.jsx)(L.A,{animation:"wave"})})]})}),e.orderdetails.map(((e,n)=>(0,ae.jsxs)(ae.Fragment,{children:[(0,ae.jsxs)(W.A,{sx:{"&:last-child td, &:last-child th":{border:0},opacity:0==e.status?"":"0.7"},children:[(0,ae.jsx)(_.A,{children:n+1}),(0,ae.jsx)(_.A,{children:e.productname}),(0,ae.jsx)(_.A,{children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body1",children:J()(e.starttime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.starttime).format("hh:mm A")})]})}),(0,ae.jsxs)(_.A,{children:[" ",(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body1",children:J()(e.endtime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.endtime).format("hh:mm A")})]})]}),(0,ae.jsx)(_.A,{children:e.unpaidbreak||0}),(0,ae.jsx)(_.A,{align:"center",children:(0,ae.jsx)(v.A,{label:e.orderqty,color:"success",variant:"light",size:"small"})}),(0,ae.jsx)(_.A,{align:"center",children:(0,ae.jsx)(v.A,{label:e.supplyqty,color:0===e.supplyqty?"error":"warning",variant:"light",size:"small"})}),(0,ae.jsx)(_.A,{width:"100px"}),(0,ae.jsxs)(_.A,{children:["$",e.price]}),(0,ae.jsxs)(_.A,{children:["$",e.landingamount]}),(0,ae.jsx)(_.A,{children:(0,ae.jsxs)(u.A,{direction:"row",children:[(0,ae.jsx)(T.A,{title:"Expand",children:(0,ae.jsx)(H.A,{"aria-label":"expand row",style:{color:ms.palette.primary.main},onClick:()=>{Ue([]),ds(cs[0]===s&&cs[1]===n?["",""]:[s,n]),fs(e.orderdetailid)},children:cs[0]===s&&cs[1]===n?(0,ae.jsx)(h.A,{}):(0,ae.jsx)(A.A,{})})}),"cancelled"===Ye&&(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(H.A,{sx:{minWidth:"10px !important"},disabled:!0,children:(0,ae.jsx)(d.A,{})})}),1===e.status&&(0,ae.jsx)(T.A,{title:"Cancelled",children:(0,ae.jsx)(H.A,{sx:{minWidth:"10px !important"},children:(0,ae.jsx)(K.A,{color:"error"})})}),e.supplyqty>e.orderqty&&(0,ae.jsx)(T.A,{title:"Assigned count is greater than ordered count",children:(0,ae.jsx)(H.A,{color:"warning",children:(0,ae.jsx)(re.A,{})})})]})})]},n+1),(0,ae.jsx)(W.A,{sx:{p:2},children:(0,ae.jsx)(_.A,{style:{paddingBottom:0,paddingTop:0,paddingLeft:0,paddingRight:0},colSpan:11,sx:{width:"100%"},children:(0,ae.jsx)(B.A,{in:cs[0]===s&&cs[1]===n,timeout:"auto",unmountOnExit:!0,children:(0,ae.jsx)(V.A,{sx:{width:"100%"},children:0===Ne.length?(0,ae.jsx)(ae.Fragment,{children:i?(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(u.A,{alignItems:"center",children:(0,ae.jsx)(I.A,{})})}):(0,ae.jsx)(ae.Fragment,{children:(0,ae.jsx)(u.A,{sx:{p:1},children:(0,ae.jsx)(C.A,{children:"No Staffs has been Assigned"})})})}):(0,ae.jsx)(E.A,{children:(0,ae.jsxs)(O.A,{children:[(0,ae.jsx)(P.A,{children:(0,ae.jsxs)(W.A,{children:[(0,ae.jsx)(_.A,{children:"#"}),(0,ae.jsx)(_.A,{children:"Staff"}),(0,ae.jsx)(_.A,{children:"Start Time"}),(0,ae.jsx)(_.A,{children:"End Time"}),(0,ae.jsx)(_.A,{children:"Pay Rate"}),(0,ae.jsx)(_.A,{align:"center",children:"Clockin"}),(0,ae.jsx)(_.A,{align:"center",children:"Clockout"}),(0,ae.jsx)(_.A,{children:"Hours Worked"}),(0,ae.jsx)(_.A,{children:"Status"})]})}),(0,ae.jsx)(R.A,{children:Ne.map(((e,s)=>(0,ae.jsx)(r.Fragment,{children:(0,ae.jsxs)(W.A,{sx:{},children:[(0,ae.jsx)(_.A,{component:"th",scope:"row",padding:"none",children:s+1}),(0,ae.jsx)(_.A,{align:"left",children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"caption",children:e.staffname}),(0,ae.jsx)(b.Ay,{children:(0,ae.jsx)(v.A,{label:e.productname,color:"info",variant:"light",size:"small"})})]})}),(0,ae.jsx)(_.A,{children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.Starttime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"caption",children:J()(e.Starttime).format("hh:mm A")})]})}),(0,ae.jsx)(_.A,{children:(0,ae.jsxs)(u.A,{direction:"column",children:[(0,ae.jsx)(C.A,{variant:"body2",children:J()(e.Endtime).format("MM/DD/YYYY")}),(0,ae.jsx)(C.A,{variant:"caption",children:J()(e.Endtime).format("hh:mm A")})]})}),(0,ae.jsx)(_.A,{children:e.rolecost}),(0,ae.jsx)(_.A,{children:(0,ae.jsxs)(u.A,{spacing:.5,alignItems:"center",children:[(0,ae.jsx)(v.A,{label:e.clockin?J()(e.clockin).format("MM/DD/YYYY"):"",color:"primary",variant:"light",size:"small"}),(0,ae.jsx)(v.A,{label:e.clockin?J()(e.clockin).format("hh:mm A"):"",color:"info",variant:"light",size:"small"})]})}),(0,ae.jsx)(_.A,{children:(0,ae.jsxs)(u.A,{spacing:.5,alignItems:"center",children:[(0,ae.jsx)(v.A,{label:e.clockout?J()(e.clockout).format("MM/DD/YYYY"):"",color:"primary",variant:"light",size:"small"}),(0,ae.jsx)(v.A,{label:e.clockout?J()(e.clockout).format("hh:mm A"):"",color:"info",variant:"light",size:"small"})]})}),(0,ae.jsx)(_.A,{children:e.hoursworked}),(0,ae.jsx)(_.A,{align:"left",children:(0,ae.jsxs)(u.A,{direction:"row",children:["pending"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Pending",color:"error",size:"small"}),"cancelled"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Cancelled",color:"secondary",size:"small"}),"completed"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Completed",color:"primary",size:"small"}),"processing"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Processing",color:"primary",size:"small"}),"assigned"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Assigned",color:"warning",size:"small"}),"confirmed"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Confirmed",color:"success",size:"small"}),"active"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Active",color:"info",size:"small"}),"closed"===e.orderstatus&&(0,ae.jsx)(v.A,{label:"Closed",color:"info",size:"small"})]})})]})},s)))})]})})})})})})]})))]})]})})]})})},e.locationaddress))),(0,ae.jsx)(b.Ay,{item:!0,xs:12,children:(0,ae.jsx)($.A,{sx:{borderWidth:1}})}),(0,ae.jsx)(b.Ay,{item:!0,xs:12,sm:6,children:(0,ae.jsx)(V.A,{title:"Order Addons",sx:{height:"100%"},children:(0,ae.jsx)(b.Ay,{container:!0,spacing:2,children:(Ee||[]).map((e=>(0,ae.jsx)(r.Fragment,{children:(0,ae.jsx)(b.Ay,{item:!0,children:(0,ae.jsx)(v.A,{icon:(0,ae.jsx)(x.A,{}),variant:"outlined",color:"error",label:e.addon})})},e.addon)))})})}),(0,ae.jsx)(b.Ay,{item:!0,xs:12,sm:6,children:(0,ae.jsx)(V.A,{title:"Total",sx:{height:"100%"},children:(0,ae.jsxs)(u.A,{spacing:2,children:[(0,ae.jsxs)(u.A,{direction:"row",justifyContent:"space-between",children:[(0,ae.jsx)(C.A,{color:ms.palette.grey[500],children:"Sub Total:"}),(0,ae.jsxs)(C.A,{children:["$",""===De?(0,ae.jsx)(L.A,{sx:{width:"30px"}}):De]})]}),(0,ae.jsxs)(u.A,{direction:"row",justifyContent:"space-between",children:[(0,ae.jsx)(C.A,{color:ms.palette.grey[500],children:"Tax:"}),(0,ae.jsx)(C.A,{children:""===ke?(0,ae.jsx)(L.A,{sx:{width:"30px"}}):ke})]}),(0,ae.jsxs)(u.A,{direction:"row",justifyContent:"space-between",children:[(0,ae.jsx)(C.A,{variant:"subtitle1",children:"Grand Total:"}),(0,ae.jsx)(C.A,{variant:"subtitle1",children:""===Ie?(0,ae.jsx)(L.A,{sx:{width:"30px"}}):"$".concat(Ie)})]})]})})}),(0,ae.jsx)(b.Ay,{item:!0,xs:12,children:(0,ae.jsxs)(u.A,{direction:"column",sx:{mt:2},children:[(0,ae.jsx)(C.A,{color:"secondary",children:"Other Instructions:"}),(0,ae.jsx)(C.A,{sx:{ml:3},children:Pe})]})})]})})})]})]})}}}]); |