/
home
/
infinitibizsol
/
.trash
/
static.1
/
js
/
File Upload :
llllll
Current File: /home/infinitibizsol/.trash/static.1/js/71.a5ed5f86.chunk.js
"use strict";(self.webpackChunk_minimal_material_kit_react=self.webpackChunk_minimal_material_kit_react||[]).push([[71],{7071:(e,t,a)=>{a.r(t),a.d(t,{default:()=>H});var n=a(5043),r=(a(9490),a(4321),a(6240)),l=a(9252),o=a(8911),i=a(8977),s=a(5865),d=a(688),c=a(2143),u=a(8903),h=a(5869),v=(a(2500),a(579));var p=a(3338);var m=a(2110);function x(e){let{title:t,total:a,price:n,sx:r,...l}=e;const o=void 0!==a?(0,p.Rn)(a):null,i=void 0!==n?(0,p.Rn)(n):null;return(0,v.jsxs)(m.A,{sx:{py:5,boxShadow:0,textAlign:"center",...r},...l,children:[null!==i&&(0,v.jsxs)(s.A,{variant:"h3",children:["$",i]}),null!==o&&(0,v.jsx)(s.A,{variant:"h3",children:o}),(0,v.jsx)(s.A,{variant:"subtitle2",sx:{opacity:.72},children:t})]})}var y=a(8065),k=a.n(y),b=a(3216),w=a(9588),j=a(7154),g=a(9456),f=a(1525),A=a.n(f),D=a(4535),S=a(4576),C=a(8390),R=a(4908),_=a(7857),L=a(8421),T=a(9907);a(220);k().extend(A());const I=(0,D.Ay)(_.a,{shouldForwardProp:e=>"isSelected"!==e&&"isHovered"!==e})((e=>{let{theme:t,isSelected:a,isHovered:n,day:r}=e;return{borderRadius:0,...a&&{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText,"&:hover, &:focus":{backgroundColor:t.palette.primary.main}},...n&&{backgroundColor:t.palette.primary[t.palette.mode],"&:hover, &:focus":{backgroundColor:t.palette.primary[t.palette.mode]}},...0===r.day()&&{borderTopLeftRadius:"50%",borderBottomLeftRadius:"50%"},...6===r.day()&&{borderTopRightRadius:"50%",borderBottomRightRadius:"50%"}}})),W=(e,t)=>null!=t&&e.isSame(t,"week");function N(e){const{day:t,selectedDay:a,hoveredDay:n,...r}=e;return(0,v.jsx)(I,{...r,day:t,sx:{px:2.5},disableMargin:!0,selected:!1,isSelected:W(t,a),isHovered:W(t,n)})}const B=[{value:"currentweek",label:"Current week"},{value:"lastweek",label:"Last week"},{value:"last4weeks",label:"Last 4 weeks"},{value:"last12weeks",label:"Last 12 weeks"}];function H(){(0,r.A)();const[e,t]=(0,n.useState)(null),[a,p]=(0,n.useState)(null),[m,y]=(0,n.useState)({}),[k,f]=(0,n.useState)("currentweek"),A=(0,b.Zp)(),D=(0,g.wA)(),{userInfo:_}=(0,g.d4)((e=>e.auth)),[I,W]=(0,n.useState)(null),[H,O]=(0,n.useState)("Current week");return(0,n.useEffect)((()=>{(async()=>{const e=await j.A.post("".concat(w.VY,"/vehicle-run/total-sale-and-net-proceed"),{user_id:null===_||void 0===_?void 0:_.user_id,timeRange:k});var t;200===(null===e||void 0===e?void 0:e.status)&&y(null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.data)})()}),[k]),(0,n.useEffect)((()=>{if(a){const e=a.toDate(),t=(0,L.tq)(e),{day:n,week:r,year:l}=t,o=new Date(l,0,7*r),i=o.getDay();o.setDate(o.getDate()-(0===i?6:i-1));const s=new Date(o);s.setDate(s.getDate()+6);const d=o.toLocaleDateString("en-US",{month:"short",day:"numeric"}),c=s.toLocaleDateString("en-US",{month:"short",day:"numeric"});t.week&&(D((0,T.Np)({userId:null===_||void 0===_?void 0:_.user_id,weekId:null===t||void 0===t?void 0:t.week})),A("/dashboard/app/users",{state:{week:t.week,startDate:d,endDate:c}}))}}),[a,_]),(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)(l.A,{maxWidth:"xl",children:[(0,v.jsxs)(o.A,{direction:"row",alignItems:"center",justifyContent:"end",mb:5,children:[(0,v.jsx)(i.A,{color:"inherit",disableRipple:!0,onClick:e=>{W(e.currentTarget)},endIcon:(0,v.jsx)(h.A,{icon:I?"eva:chevron-up-fill":"eva:chevron-down-fill"}),children:(0,v.jsx)(s.A,{component:"span",variant:"subtitle2",sx:{borderBottom:"1px solid black"},children:H})}),(0,v.jsx)(d.A,{keepMounted:!0,anchorEl:I,open:Boolean(I),onClose:()=>{W(null)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:B.map((e=>(0,v.jsx)(c.A,{selected:"currentweek"===e.value,onClick:()=>((e,t)=>{f(e),O(t),W(null)})(e.value,e.label),sx:{typography:"body2"},children:e.label},e.value)))})]}),(0,v.jsxs)(u.Ay,{container:!0,spacing:3,children:[(0,v.jsx)(u.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,v.jsx)(x,{title:"Total Sale",price:(null===m||void 0===m?void 0:m.total_sales)||0})}),(0,v.jsx)(u.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,v.jsx)(x,{title:"Net Proceed",price:(null===m||void 0===m?void 0:m.net_proceeds)||0})}),(0,v.jsx)(u.Ay,{item:!0,xs:12,sm:6,md:4,children:(0,v.jsx)(x,{title:"Units Sold",total:(null===m||void 0===m?void 0:m.units)||0})}),(0,v.jsxs)(u.Ay,{item:!0,xs:12,md:12,lg:12,children:[(0,v.jsx)(o.A,{direction:"row",alignItems:"center",justifyContent:"space-between",mb:5,children:(0,v.jsx)(s.A,{variant:"h4",children:"Opportunity"})}),(0,v.jsx)("div",{style:{width:"100%"},children:(0,v.jsx)(C.$,{dateAdapter:S.R,style:{width:"100%"},children:(0,v.jsx)(R.x,{value:a,onChange:e=>{p(e)},localetext:{calendarWeekNumberHeaderText:"Week",calendarWeekNumberText:e=>"Week ".concat(e)},showDaysOutsideCurrentMonth:!0,displayWeekNumber:!0,slots:{day:N},slotProps:{day:t=>({selectedDay:a,hoveredDay:e})}})})})]})]})]})})}},3338:(e,t,a)=>{a.d(t,{Rn:()=>l});var n=a(9328),r=a.n(n);function l(e){return o(e||0===e?r()(e).format("0.00a"):"",".00")}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".00";return e.includes(t)?e.replace(t,""):e}}}]); //# sourceMappingURL=71.a5ed5f86.chunk.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure