1"use strict";(globalThis.__LOADABLE_LOADED_CHUNKS__=globalThis.__LOADABLE_LOADED_CHUNKS__||[]).push([[5231],{30881(e,t,a){a.d(t,{A:()=>i});var l=a(84685),s=a(62023),r=(a(13404),a(3602),a(63988));const i=function(e){return(0,r.jsx)(l.t1,{"data-test-name":"CRMActivityChart",style:{display:"CRM"===e.selectedTab?"block":"none"},type:"Bar",height:"345px",width:"100%",isExportable:!1,data:e.chart_data,onChartReady:(e,t)=>(0,s.i3)(e,{isExportable:!1,data:t,cursorLineX:!1,cursorLineY:!1,isLegendCheckbox:!0,formatNumber:"#a",chartColorsAnalytics:["#EB1D6E","#05476E","#5BBDEC"],xAxes:[{cursorTooltipEnabled:!1,category:"time",title:"Time",showGrid:!1,showAxis:!0,showTitle:!0,showLabel:!0,disableGridTemplate:!0}],yAxes:[{cursorTooltipEnabled:!1,showGrid:!1,showAxis:!1,showTitle:!1,renderOutside:!0,showLabel:!0,disableGridTemplate:!0}],series:[{categoryX:"time",valueY:"NOTE",name:"Notes",tooltipText:"{name}: {valueY}",strokeWidth:0,fillPropertyOpacity:"opacity",fillColor:"#EB1D6E",stroke:"#EB1D6E",stacked:!0},{categoryX:"time",valueY:"MEETING",name:"Meetings",valueYShow:"totalPercent",tooltipText:"{name}: {valueY}",strokeWidth:0,fillPropertyOpacity:"opacity",fillColor:"#05476E",stroke:"#05476E",stacked:!0},{categoryX:"time",valueY:"CALL",name:"Calls",tooltipText:"{name}: {valueY}",strokeWidth:0,fillPropertyOpacity:"opacity",fillColor:"#5BBDEC",stroke:"#5BBDEC",stacked:!0}]})})}},78506(e,t,a){a.d(t,{A:()=>d});var l=a(84685),s=a(62023),r=a(13404),i=a(3602),n=a(98483),o=a(63988);const d=function(e){return(0,n.d4)(e=>e.identity),(0,o.jsx)(r.Ay,{"data-test-name":"InvoicesVsTargetChart",colSizes:{xs:12,sm:12,lg:6},components:{Title:(0,o.jsx)(r.Pl,{startText:"Invoices vs. Target"})},children:(0,o.jsx)(i.Col,{xs:!0,children:(0,o.jsx)(l.t1,{type:"Bar",height:e.chart_height?e.chart_height:"340px",width:"100%",isExportable:!1,data:e.chart_data,onChartReady:(t,a)=>(0,s.i3)(t,{data:a,onClickColumn:e.onClickChartColumn?e.onClickChartColumn:null,isExportable:!1,cursorLineX:!1,cursorLineY:!1,isLegendCheckbox:!0,formatNumber:"#a",chartColorsAnalytics:["#B8C4CB","#00D374","#DB0057"],toggleInvoiceLegend:!0,xAxes:[{cursorTooltipEnabled:!1,category:"month",title:"Month",showGrid:!0,showAxis:!0,showTitle:!0,showLabel:!0,disableGridTemplate:!0}],yAxes:[{min:0,cursorTooltipEnabled:!1,showLabel:!0,renderOutside:!0,showGrid:!0,showAxis:!1,showTitle:!1,disableGridTemplate:!0}],series:[{categoryX:"month",valueY:"total",name:"Previous Year",tooltipText:"[#fff font-size: 15px]{month} {year.formatNumber('####')}:\n[/][#fff font-size: 20px]{valueY}[/] [#fff]{additional}[/]",strokeWidth:0,fillPropertyOpacity:"opacity",fillColor:"#B8C4CB",stroke:"#B8C4CB"},{categoryX:"month",valueY:"total_next_year",name:"This Year",tooltipText:"[#fff font-size: 15px]{month} {next_year.formatNumber('####')}:\n[/][#fff font-size: 20px]{valueY}[/] [#fff]{additional}[/]",strokeWidth:0,fillPropertyOpacity:"opacity",fillColor:"#00D374",stroke:"#00D374"}],lineSeries:[{categoryX:"month",valueY:"target",name:"Target",tooltipText:"[#fff font-size: 15px]{categoryX} {target_year.formatNumber('####')}:\n[/][#fff font-size: 20px]{valueY}[/] [#fff]{additional}[/]",strokeWidth:3,stroke:"#DB0057",fillPropertyOpacity:"opacity"}]})})})})}},6280(e,t,a){a.r(t),a.d(t,{default:()=>Y});var l=a(41594),s=a(22224),r=a(24784),i=a(51904),n=a(84685),o=a(62023),d=a(13404),c=a(3602),p=a(98483),h=a(3902),m=a(94384),u=a(73640),_=a(30596),y=a(58199),x=a(22078),g=a(97836),C=a(62611),b=a(34586),v=a(61867),f=a(78506),T=a(15617),S=a(30881),A=a(50035),j=a(93664),w=a(64128),E=a(77962),k=a(83075),L=a(28363),R=a(63988);const P=function(e){const{data:t,barColor:a,onClickChartColumn:l}=e;return(0,R.jsx)("div",{"data-test-name":"SalesOrdersPerRepChart",style:{height:"500px",overflowY:t.length>=7?"scroll":"hidden"},children:(0,R.jsx)(n.t1,{type:"Bar",height:(0,L.xj)(t.length<=3?3:t.length+1,1,1400,20)+"px",width:"100%",isExportable:!1,data:t,onChartReady:(e,t)=>(0,o.xg)(e,{data:t,onClickColumn:l||null,valueX:"total",valueY:"rep_full_name",imgField:"img_src",imgHeight:50,imgWidth:50,barHeight:50,crnerRad1:0,crnerRad2:40,circleRadius:25,outlineCircle:!1,hideValueAxis:!0,isExportable:!1,
1cursorLineX:!1,cursorLineY:!1,formatNumber:"#,###.",chartColorsAnalytics:a,hideCategoryAxisLabel:!0,insideBarLabelText:"[bold]{rep_full_name}[/]Â Â Â ${valueX}",hideZoomOutBtn:!0,tooltipText:""})})})};var D=a(31238),I=a(18981);const O=(0,u.Mz)(_.jz,e=>e.filter(e=>e.client_name).map(e=>({value:e.client_id,label:e.client_name})));class B extends l.Component{constructor(){var e;return super(...arguments),e=this,this.state={selectedTab:"Sales",selectedPerRepTab:"SO",selectedActivityTab:"CRM",filters:{repType:{value:"client",label:"Client Rep"},repUser:{value:"",label:"All"},client:{value:"",label:"All"},clientStatus:{value:"",label:"All"},lastYear:!1},showPopup:null,reloadReport:!1,SO_BY_REP_FILTER:{value:"month",label:"Month"},CHART_BY_REP_TITLE:{current:j.yz[(new Date).getMonth()],previous:j.yz[(new Date).getMonth()-1]}},this.onClickClientSlice=e=>{if(!0===e.sliceGrouperOther)return;const{fetchPopUpData:t}=this.props,{selectedTab:a,filters:l}=this.state,s="Sales"===a?j.eo.SALES_BY_CLIENT.type.mngmnt:j.eo.MARGIN_BY_CLIENT.type.mngmnt,r="Sales"===a?j.eo.SALES_BY_CLIENT.route:j.eo.MARGIN_BY_CLIENT.route,i=j.yz[parseInt(e.month)-1],n=e.client_name+" - "+i,o=(0,x.yw)(new Date(parseInt(e.year),parseInt(e.month)-1,1)),d=(0,x.yw)(new Date(parseInt(e.year),parseInt(e.month),1)),c="Sales"===a?j.eo.SALES_BY_CLIENT.title:j.eo.MARGIN_BY_CLIENT.title;t(r,s,{client_id:e.client_id,start_stamp:o,end_stamp:d,filters:JSON.stringify(l)}),this.setState({showPopup:{type:"projects-list",title:c+n,report_type:s}})},this.onClickInvoiceTargetChartColumn=function(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{fetchPopUpData:l}=e.props,s=j.eo.INVOICES_VS_TARGET.type.mngmnt,r=j.eo.INVOICES_VS_TARGET.route,i="total_next_year"===a?t.next_year:t.year,n=t.month+" "+i,o=new Date(`${t.month} 1 ${i}`).getMonth()+1,d=(0,x.yw)(new Date(i,o,1));l(r,s,{start_stamp:(0,x.yw)(new Date(i,o-1,1)),end_stamp:d,filters:JSON.stringify(e.state.filters)}),e.setState({showPopup:{type:"projects-list",title:j.eo.INVOICES_VS_TARGET.title+n,report_type:s}})},this.onClickSalesActivityChartColumn=function(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{fetchPopUpData:l}=e.props,s=j.eo.SALES_ACTIVITY.type.mngmnt,r=j.eo.SALES_ACTIVITY.route,i=t.time,n=new Date(`${t.month} 1 ${t.year}`).getMonth()+1,o=(0,x.yw)(new Date(t.year,n,1));l(r,s,{order_type:a,start_stamp:(0,x.yw)(new Date(t.year,n-1,1)),end_stamp:o,filters:JSON.stringify(e.state.filters)}),e.setState({showPopup:{type:"projects-list",title:j.eo.SALES_ACTIVITY.title+i,report_type:s,order_type:a}})},this.onClickSalesOrdersInProductionChartColumn=function(t){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{fetchPopUpData:l}=e.props,s=j.eo.SALES_ORDERS_IN_PRODUCTION.type.mngmnt,r=j.eo.SALES_ORDERS_IN_PRODUCTION.route,i="total_next_year"===a?t.next_year:t.year,n=t.month+" "+i,o=new Date(`${t.month} 1 ${i}`).getMonth()+1,d=(0,x.yw)(new Date(i,o,1));l(r,s,{start_stamp:(0,x.yw)(new Date(i,o-1,1)),end_stamp:d,filters:JSON.stringify(e.state.filters)}),e.setState({showPopup:{type:"projects-list",title:j.eo.SALES_ORDERS_IN_PRODUCTION.title+n,report_type:s}})},this.onClickRepChartBar=e=>{const{fetchPopUpData:t}=this.props,a=j.eo.CHART_BY_REP.type.mngmnt,l=j.eo.CHART_BY_REP.route,r=(0,j.JY)(e.time_division_code),i=(0,s.startCase)((0,s.toLower)(e.order_type))+"s - "+e.rep_full_name+" - "+r.name;t(l,a,{start_stamp:r.startStamp,end_stamp:r.endStamp,rep_id:e.rep_user_id,order_type:e.order_type,filters:JSON.stringify(this.state.filters)}),this.setState({showPopup:{type:"projects-list",title:i,report_type:a}})},this}componentDidMount(){const{onLoadStatuses:e,onLoadClients:t,onLoadAnalyticsData:a,onLoadTeams:l,onLoadAccountStatuses:s}=this.props;a(),e(),t(),l(),s()}onChangeFilter(e,t){const{onChangeFilterDrop:a}=this.props;null===e&&"teamId"!==t&&(e={label:"All",value:""}),"repUser"===t&&"GROUP"!==e.value?this.setState({filters:{...this.state.filters,[t]:e,teamId:{key:"",value:""}}},()=>{a(this.state.filters)}):this.setState({filters:{...this.state.filters,[t]:e}},()=>{a(this.state.filters)})}onChangeTimeFilter(e,t){const{onChangeChartFilterMngmnt:a}=this.props,l=(0,j.JY)(e.value),s=e.value.toLowerCase(),r=j.oT[t].route;this.setState({[t]:e,filters:{...this.state.filters,soByRepTimeFilter:{so_by_rep_start_stamp:l.startStamp,so_by_rep_end_stamp:l.endStamp,so_by_rep_time_frame:s}},CHART_BY_REP_TITLE:{current:l.current_name,previous:l.previous_name}}),a(r,{filters:JSON.stringify(this.state.filters),start_stamp:l.startStamp,end_stamp:l.endStamp,time_frame:s})}renderPopup(){return this.state.showPopup?(0,R.jsxs)(c.Popup,{"data-test-name":"ManagementAnalyticsApp.renderPopup",title:this.state.showPopup.title,onClose:()=>{this.setState({showPopup:!1})},className:`popup ${this.state.showPopup.type}-analytics-popup`,children:[" ","projects-list"===this.state.showPopup.type?(0,R.jsx)(C.A,{...this.state.showPopup,onSave:()=>this.setState({showPopup:!1}),loadReportTotal:e=>this.setState({reportType:e})}):null,(0,R.jsx)("br",{})]}):null}targetPopup(){return this.state.showTargetPopup?(0,R.jsx)(c.Popup,{"data-test-name":"ManagementAnalyticsApp.targetPopup",style:{maxWidth:"850px",height:"96%",maxHeight:"none"},className:"set-target-analytics-popup",title:this.state.showTargetPopup.title,onClose:()=>{this.setState({showTargetPopup:!1})},children:(0,R.jsx)(I.U,{role:"management",filters:this.state.filters})}):null}render(){const{popups:e,filterOptions:t,invoice_data:a,sales_by_client_data:l,sales_orders_target_data:s,margin_by_client_data:p,sales_activity_data:h,sales_pipeline_data:m,shop_by_invoices_data:u,invoice_target_data:_,managemnt_data:y,sales_orders_per_rep_data:C,invoice_per_rep_data:w,identity:E,sales_orders_data:k}=this.props,{filters:L,selectedTab:I,SO_BY_REP_FILTER:O,CHART_BY_REP_TITLE:B,selectedActivityTab:Y,selectedPerRepTab:N}=this.state,F=((new Date).getFullYear(),!!(u&&u.length>25)),M={margin_by_client_data:p,sales_by_client_data:l},{hasCapabilities:G}=(0,x.el)(E),z=G("MODIFY-SALES-TARGET");let U=[{label:"Sales by Client",key:"Sales"}];U.push({label:"Margin by Client",key:"Margin"});let X=[{label:"SO in Production",key:"SO"},{label:"Invoices",key:"Invoices"}],W=[{label:"CRM Activity",key:"CRM"},{label:"Sales Activity",key:"SalesActivity"}];return(0,R.jsx)("div",{"data-test-name":"ManagementAnalyticsApp.render",children:(0,R.jsxs)(c.Theme,{children:[(0,R.jsx)(b.GlobalStyle,{}),(0,R.jsx)(r.A,{children:(0,R.jsx)("div",{className:"columns"})}),(0,R.jsx)(i.A,{className:"resku",popups:e,style:{background:"rgb(237, 242, 245)"},children:(0,R.jsxs)("div",{className:"main-content csku-styles",style:{to
1p:0,left:0,zIndex:100,width:"100%",minHeight:"100%",background:"rgb(237, 242, 245)",position:"absolute",paddingBottom:"2em",top:this.state.top_margin,marginTop:0},children:[(0,R.jsxs)(c.Row,{style:{marginTop:0,marginBottom:20},children:[(0,R.jsxs)(c.Col,{xs:!0,sm:6,padded:!0,children:[this.renderPopup(),this.targetPopup(),(0,R.jsx)(g.A,{title:"Management Analytics"})]}),(0,R.jsxs)(c.Col,{xs:!0,sm:6,padded:!0,end:1,children:[" ",z?(0,R.jsx)(c.Button,{variant:"primary",style:{marginRight:5},onClick:()=>{this.setState({showTargetPopup:{title:"Edit Targets"}})},children:"Edit Targets"}):null," ",(0,R.jsx)(D.m,{})]})]}),(0,R.jsxs)(c.Row,{style:{placeContent:"flex-start"},children:[(0,R.jsx)(c.Col,{padded:!0,xl:3,sm:6,xs:8,children:(0,R.jsx)(c.LabeledSelect,{label:"Rep Type",name:"repType",options:[{value:"CLIENT",label:"Client Rep"},{value:"ORDER",label:"Order Rep"}],value:L.repType,onChange:e=>this.onChangeFilter(e,"repType"),className:"csku-select-v3"})}),(0,R.jsx)(c.Col,{padded:!0,xl:3,sm:6,xs:8,children:(0,R.jsx)(c.LabeledSelect,{label:"Rep",name:"repUser",options:t.reps_all,value:L.repUser,onChange:e=>this.onChangeFilter(e,"repUser"),className:"csku-select-v3",isClearable:!(""===L.repUser.value)})}),(0,R.jsx)(c.Col,{padded:!0,xl:3,sm:6,xs:8,children:(0,R.jsx)(c.LabeledSelect,{label:"Client",name:"client",value:L.client,options:[{label:"All",value:""}].concat(t.clients),onChange:e=>this.onChangeFilter(e,"client"),menuShouldScrollIntoView:!1,className:"csku-select-v3",isClearable:!(""===L.client.value)})}),(0,R.jsx)(c.Col,{padded:!0,xl:3,sm:6,xs:8,children:(0,R.jsx)(c.LabeledSelect,{label:"Client Status",name:"clientStatus",value:L.clientStatus,options:t.statuses_all,onChange:e=>this.onChangeFilter(e,"clientStatus"),menuShouldScrollIntoView:!1,className:"csku-select-v3",isClearable:!(""===L.clientStatus.value)})}),"GROUP"===L.repUser.value?(0,R.jsx)(c.Col,{padded:!0,xl:3,sm:6,xs:8,children:(0,R.jsx)(c.LabeledSelect,{name:"teamId",options:t.team_options,value:L.teamId,onChange:e=>this.onChangeFilter(e,"teamId"),label:"Group",menuShouldScrollIntoView:!1,className:"csku-select-v3",isClearable:!0})}):null]}),Object.keys(y).length?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(c.Row,{style:{placeContent:"flex-start"},children:[(0,R.jsx)(v.A,{chart_data:"ORDER"!=L.repType.value&&1==E.show_sales_order_targets?s:k,onClickChartColumn:this.onClickSalesOrdersInProductionChartColumn}),(0,R.jsx)(f.A,{chart_data:"ORDER"!=L.repType.value&&1==E.show_invoice_targets?_:a,chart_height:"340px",onClickChartColumn:this.onClickInvoiceTargetChartColumn})]}),(0,R.jsx)(c.Row,{style:{placeContent:"flex-start"},children:(0,R.jsx)(d.Ay,{colSizes:{xs:12,lg:12},components:{Title:(0,R.jsx)(d.Pl,{})},children:(0,R.jsxs)(c.Col,{xs:!0,children:[(0,R.jsxs)(c.Row,{style:{justifyContent:"space-between"},children:[(0,R.jsx)(c.TabBar,{style:{marginLeft:"1rem",marginBottom:"1rem"},children:X.map((e,t)=>(0,R.jsx)(c.Tab,{size:X.length,selected:e.key===this.state.selectedPerRepTab,onClick:()=>{this.setState({selectedPerRepTab:e.key})},children:e.label}))}),(0,R.jsx)(c.Col,{padded:!0,xl:3,sm:6,xs:6,children:(0,R.jsx)(c.LabeledSelect,{name:"SO_BY_REP_FILTER",value:O,options:j.fc,onChange:e=>this.onChangeTimeFilter(e,"SO_BY_REP_FILTER"),menuShouldScrollIntoView:!1,className:"csku-select-v3"})})]}),(0,R.jsxs)(c.Row,{children:[(0,R.jsxs)(c.Col,{xl:6,sm:12,children:[(0,R.jsx)(d.Pl,{startText:B.current,style:{marginLeft:"2em"}}),(0,R.jsx)(P,{data:"SO"===N?C.current:w.current,barColor:["#A6F4FF"],onClickChartColumn:this.onClickRepChartBar})]}),(0,R.jsxs)(c.Col,{xl:6,sm:12,children:[(0,R.jsx)(d.Pl,{startText:B.previous,style:{marginLeft:"2em"}}),(0,R.jsx)(P,{data:"SO"===N?C.previous:w.previous,barColor:["#E1F7FA"],onClickChartColumn:this.onClickRepChartBar})]})]})]})})}),(0,R.jsx)(c.Row,{style:{placeContent:"flex-start"},children:(0,R.jsx)(d.Ay,{colSizes:{xs:12,lg:12},components:{Title:(0,R.jsx)(d.Pl,{})},children:(0,R.jsxs)(c.Col,{xs:!0,children:[(0,R.jsx)(c.TabBar,{style:{marginLeft:"1rem",marginBottom:"1rem"},children:U.map((e,t)=>(0,R.jsx)(c.Tab,{size:U.length,selected:e.key===this.state.selectedTab,onClick:()=>{this.setState({selectedTab:e.key})},children:e.label}))}),(0,R.jsx)(A.A,{chart_data:M,selectedTab:I,onClickClientSlice:this.onClickClientSlice})]})})}),(0,R.jsxs)(c.Row,{style:{placeContent:"flex-start",backgroundColor:"rgb(237, 242, 245)"},children:[(0,R.jsx)(d.Ay,{colSizes:{xs:12,sm:12,lg:6},components:{Title:(0,R.jsx)(d.Pl,{})},children:(0,R.jsxs)(c.Col,{xs:!0,children:[(0,R.jsx)(c.TabBar,{style:{marginLeft:"1rem",marginBottom:"1rem"},children:W.map((e,t)=>(0,R.jsx)(c.Tab,{size:W.length,selected:e.key===Y,onClick:()=>{this.setState({selectedActivityTab:e.key})},children:e.label}))}),(0,R.jsx)(S.A,{chart_data:h,selectedTab:Y}),(0,R.jsx)(T.A,{chart_data:m,onClickChartColumn:this.onClickSalesActivityChartColumn,selectedTab:Y})]})}),(0,R.jsx)(d.Ay,{colSizes:{xs:12,sm:12,lg:6},components:{Title:(0,R.jsx)(d.Pl,{startText:"Invoices by Shop"})}
1,children:(0,R.jsx)(c.Col,{xs:!0,children:(0,R.jsx)(n.t1,{type:"Bar",height:"400px",width:"100%",isExportable:!1,data:u,onChartReady:(e,t)=>(0,o.CV)(e,{data:t,isExportable:!1,cursorLineX:!1,cursorLineY:!1,formatNumber:"#a",xAxes:[{cursorTooltipEnabled:!1,category:"shop_name",showGrid:!1,showAxis:!1,showTitle:!1,showLabel:!1,disableGridTemplate:!0,maxZoomCount:25}],yAxes:[{cursorTooltipEnabled:!1,title:"Invoices in last 60 days",showGrid:!1,showAxis:!0,showTitle:!0,disableGridTemplate:!0,showLabel:!0,isScrollbarY:!0}],series:[{categoryX:"shop_name",valueY:"invoice_total",name:"Invoices",valueYShow:"totalPercent",tooltipText:"{shop_name}: {invoice_total}",strokeWidth:0,fillPropertyOpacity:"opacity",fillColor:"#02C0DA",stroke:"#02C0DA",cornerRadius:8,isScrollbarY:F,isInsideBarLabel:!0,insideBarLabelText:"{shop_name}"}]})})})})]}),(0,R.jsx)("div",{style:{display:"flex",backgroundColor:"rgb(237, 242, 245)"},children:(0,R.jsx)(T.A,{chart_data:m,onClickChartColumn:this.onClickSalesActivityChartColumn})})]}):(0,R.jsxs)(R.Fragment,{children:[" ",(0,R.jsx)(c.Loading,{}),(0,R.jsx)("p",{style:{padding:10,margin:0,textAlign:"center",color:"#00A0B6",fontSize:"1.3rem"},children:"Loading..."})]})," "]})})]})})}}const Y=(0,w.A)((0,p.Ng)((e,t)=>{const a=e.entities.management_analytics.invoice_results,l=e.entities.management_analytics.sales_target_results,s=e.entities.management_analytics.in_production_results;return{identity:e.identity,filterOptions:{reps_all:(0,h.$E)(e.dropdowns.users,"user_id",e=>e.contact_first_name+" "+e.contact_last_name,!1,[{label:"All",value:""},{label:"Group",value:"GROUP"}]),statuses_all:(0,h.$E)(e.dropdowns.account_statuses,"account_status_id","account_status_name",!1,[{label:"All",value:""},{label:"None",value:"null"}]),clients:O(e),team_options:(0,h.$E)(e.dropdowns.teams,"team_id","team_name",!1,[{label:"All",value:""}])},managemnt_data:e.entities.management_analytics,invoice_data:a,invoice_target_data:(0,j.pq)(a,l),sales_by_client_data:e.entities.management_analytics.client_sales_results,sales_orders_data:s,sales_orders_target_data:(0,j.pq)(s,l),margin_by_client_data:e.entities.management_analytics.client_margin_results,sales_activity_data:e.entities.management_analytics.sales_activity_results,sales_pipeline_data:e.entities.management_analytics.sales_pipeline_results,shop_by_invoices_data:e.entities.management_analytics.shop_by_invoices_results,sales_orders_per_rep_data:e.entities.management_analytics.sales_orders_per_rep_results,invoice_per_rep_data:e.entities.management_analytics.invoices_by_rep_results}},e=>({onLoadAccountStatuses:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"CLIENT";e((0,y.C3o)(t))},onLoadStatuses:()=>{e((0,y.MGE)({}))},onLoadClients:()=>{e((0,m.Am)({order_by:"latest_use",order_dir:"DESC"}))},onLoadTeams:()=>{e((0,y.SkB)({team_type:"GROUP"}))},onChangeFilterDrop:t=>{e((0,y.STg)(t))},onLoadAnalyticsData:()=>{e((0,y.M6r)())},fetchPopUpData:(t,a,l)=>{e((0,y.f87)(t,a,l))},onChangeChartFilterMngmnt:(t,a)=>{e((0,y.z80)(t,a))}}))(B),{status:E.Ay,notes:k.Ay})},15617(e,t,a){a.d(t,{A:()=>i});var l=a(84685),s=a(62023),r=a(63988);const i=function(e){return(0,r.jsx)(l.t1,{"data-test-name":"SalesActivityChart",style:{display:"SalesActivity"===e.selectedTab?"block":"none"},type:"Bar",height:"345px",width:"100%",isExportable:!1,data:e.chart_data,onChartReady:(t,a)=>(0,s.i3)(t,{onClickColumn:e.onClickChartColumn?e.onClickChartColumn:null,isExportable:!1,data:a,cursorLineX:!1,cursorLineY:!1,isLegendCheckbox:!0,formatNumber:"#a",chartColorsAnalytics:["#28D5EE","#00A0B6","#00788A"],xAxes:[{cursorTooltipEnabled:!1,category:"time",title:"Time",showGrid:!1,showAxis:!0,showTitle:!0,showLabel:!0,disableGridTemplate:!0}],yAxes:[{cursorTooltipEnabled:!1,showGrid:!1,showAxis:!1,showTitle:!1,disableGridTemplate:!0,showLabel:!0,renderOutside:!0}],series:[{categoryX:"time",valueY:"ESTIMATE",name:"Estimates",tooltipText:"{name}: {valueY}",strokeWidth:0,fillPropertyOpacity:"opacity",fillColor:"#28D5EE",stroke:"#28D5EE",stacked:!0},{categoryX:"time",valueY:"PRESENTATION",name:"Presentations",valueYShow:"totalPercent",tooltipText:"{name}: {valueY}",strokeWidth:0,fillPropertyOpacity:"opacity",fillColor:"#00A0B6",stroke:"#00A0B6",stacked:!0},{categoryX:"time",valueY:"OPPORTUNITY",name:"Opportunities",tooltipText:"{name}: {valueY}",strokeWidth:0,fillPropertyOpacity:"opacity",fillColor:"#00788A",stroke:"#00788A",stacked:!0}]})})}},50035(e,t,a){a.d(t,{A:()=>n});var l=a(84685),s=a(62023),r=a(3602),i=a(63988);const n=function(e){const{sales_by_client_data:t,margin_by_client_data:a}=e.chart_data,{selectedTab:n,onClickClientSlice:o}=e;return(0,i.jsxs)(r.Row,{"data-test-name":"SalesAndMarginByClient",id:"Client",children:[(0,i.jsx)(r.Col,{xl:6,sm:12,children:(0,i.jsx)(l.t1,{id:"sales_this_month_chart",type:"pie",height:"340px",width:"100%",isExportable:!1,data:"Sales"===n?t.this_month_data.length>0?t.this_month_data:[{total:0,client_name:"No client yet"}]:a.this_month_margin.length>0?a.this_month_margin:[{total:0,client_name:"No client yet"}],onChartReady:(e,t)=>(0,s.z8)(e,{onClickSlice:o,data:t,formatNumber:"#,###.",tooltipText:"{category}: ${value}",isExportable:!1,value:"total",category:"client_name",radius:"65",labelText:"[font-size:16px]This Month[/]\n[bold]${values.value.sum}[/]"})})}),(0,i.jsx)(r.Col,{xl:6,sm:12,children:(0,i.jsx)(l.t1,{id:"sales_last_month_chart",type:"pie",height:"340px",width:"100%",isExportable:!1,data:"Sales"===n?t.last_month_data.length>0?t.last_month_data:[{total:0,client_name:"No client yet"}]:a.last_month_margin.length>0?a.last_month_margin:[{total:0,client_name:"No client yet"}],onChartReady:(e,t)=>(0,s.z8)(e,{data:t,formatNumber:"#,###.",tooltipText:"{category}: ${value}",onClickSlice:o,isExportable:!1,value:"total",category:"client_name",radius:"65",labelText:"[font-size:16px]Last Month[/]\n[bold]${values.value.sum}[/]"})})})]})}},61867(e,t,a){a.d(t,{A:()=>
1o});var l=a(84685),s=a(62023),r=a(13404),i=a(3602),n=(a(98483),a(63988));const o=function(e){return(0,n.jsx)(r.Ay,{"data-test-name":"SalesOrdersInProductionChart",colSizes:{xs:12,sm:12,lg:6},components:{Title:(0,n.jsx)(r.Pl,{startText:"Sales Orders in Production"})},children:(0,n.jsx)(i.Col,{xs:!0,children:(0,n.jsx)(l.t1,{type:"Bar",height:"340px",width:"100%",isExportable:!1,data:e.chart_data,onChartReady:(t,a)=>(0,s.i3)(t,{data:a,onClickColumn:e.onClickChartColumn?e.onClickChartColumn:null,isExportable:!1,cursorLineX:!1,cursorLineY:!1,isLegendCheckbox:!0,formatNumber:"#a",chartColorsAnalytics:["#B8C4CB","#FFD302","#DB0057"],toggleSalesLegend:!0,xAxes:[{cursorTooltipEnabled:!1,category:"month",title:"Month",showGrid:!1,showAxis:!0,showTitle:!0,showLabel:!0,cellStartLocation:.1,cellEndLocation:.7,disableGridTemplate:!0}],yAxes:[{min:0,cursorTooltipEnabled:!1,showGrid:!1,showAxis:!1,showTitle:!1,renderOutside:!0,showLabel:!0,disableGridTemplate:!0}],series:[{categoryX:"month",valueY:"total",name:"Previous Year",tooltipText:"[#fff font-size: 15px]{month} {year.formatNumber('####')}:\n[/][#fff font-size: 20px]{valueY}[/] [#fff]{additional}[/]",strokeWidth:0,fillPropertyOpacity:"opacity",fillColor:"#B8C4CB",stroke:"#B8C4CB"},{categoryX:"month",valueY:"total_next_year",name:"This Year",tooltipText:"[#fff font-size: 15px]{month} {next_year.formatNumber('####')}:\n[/][#fff font-size: 20px]{valueY}[/] [#fff]{additional}[/]",strokeWidth:0,fillPropertyOpacity:"opacity",fillColor:"#FFD302",stroke:"#FFD302"}],lineSeries:[{categoryX:"month",valueY:"sales_orders_target",name:"Target",tooltipText:"[#fff font-size: 15px]{categoryX} {target_year.formatNumber('####')}:\n[/][#fff font-size: 20px]{valueY}[/] [#fff]{additional}[/]",strokeWidth:3,stroke:"#DB0057",fillPropertyOpacity:"opacity"}]})})})})}},18981(e,t,a){a.d(t,{U:()=>h});var l=a(3602),s=a(41594),r=a(98483),i=a(3902),n=a(58199),o=a(22078),d=a(93664),c=a(82654),p=a(63988);function h(e){const{role:t,filters:a}=e,h=(0,s.useMemo)(()=>new Date,[]),m="show_invoice_targets",u=(0,i.$E)((0,r.d4)(c.ZW),"user_id",e=>e.contact_first_name+" "+e.contact_last_name,!1),_=(0,r.d4)(e=>e.identity),y=_.user_id,x=_.tenant_id,[g,C]=(0,s.useState)("sales"===t?u.filter(e=>e.value==y)[0]:{label:"All Reps",value:""}),[b,v]=(0,s.useState)({label:h.getFullYear(),value:h.getFullYear()}),[f,T]=(0,s.useState)(1==_.show_invoice_targets),[S,A]=(0,s.useState)(1==_.show_sales_order_targets),j=(0,r.wA)(),w=(e,t)=>{const l=e.target_id,s=Math.abs(t.target.value.replaceAll(",",""));0===l?j((0,n.ms)({rep_id:g.value,target_value:s,target_type:t.target.name,month:d.yz.indexOf(e.month)+1,year:b.value})):"sales_target_value"===t.target.name?j((0,n.fy0)(e.target_id,s,null,{filters:JSON.stringify(a)})):j((0,n.fy0)(e.target_id,null,s,{filters:JSON.stringify(a)}))},E=(e,t)=>{e===m?T(!t):A(!t),j((0,n.L1I)(x,e,!t))},k=(0,r.d4)(e=>e.entities.targets_management),L=(0,r.d4)(e=>e.entities.loading_analytics_popup[d.G0]),[R,P]=(0,s.useState)([]);return(0,s.useEffect)(()=>{P(k)},[k]),(0,s.useEffect)(()=>{j((0,n.k_m)({rep_id:"sales"===t?u.filter(e=>e.value===y)[0].value:"",start_stamp:(0,o.yw)(new Date(h.getFullYear(),0,1)),end_stamp:(0,o.yw)(new Date(h.getFullYear()+1,0,1))}))},[]),(0,p.jsx)("div",{"data-test-name":"SetTargetTabledWindow",className:"set-target-div",children:(0,p.jsxs)("table",{className:"table table-striped",children:[(0,p.jsx)("thead",{}),(0,p.jsxs)("tbody",{style:{border:"none"},children:["sales"===t?null:(0,p.jsxs)("tr",{className:"disable-hover",children:[(0,p.jsx)("td",{style:{backgroundColor:"#EDF4F7",width:"28%",color:"#2A4D63"},children:"Show on dashboard"}),(0,p.jsx)("td",{colSpan:2,style:{textAlign:"center"},children:(0,p.jsx)(l.LabeledCheckbox,{labelStyle:{marginRight:0},checked:f,onChange:e=>E(m,f)})}),(0,p.jsx)("td",{colSpan:2,style:{textAlign:"center"},children:(0,p.jsx)(l.LabeledCheckbox,{checked:S,onChange:e=>E("show_sales_order_targets",S)})})]}),(0,p.jsxs)("tr",{style:{color:"#2A4D63"},className:"disable-hover",children:[(0,p.jsx)("td",{style:{backgroundColor:"#EDF4F7",width:"28%"},children:(0,p.jsx)(l.LabeledSelect,{isDisabled:"sales"===t,style:{color:"#2A4D63"},name:"rep_user",options:[{label:"All Reps",value:""}].concat(u),value:g,onChange:e=>(e=>{C(e);const t=b.value?b.value:h.getFullYear();j((0,n.k_m)({rep_id:e.value,start_stamp:(0,o.yw)(new Date(t,0,1)),end_stamp:(0,o.yw)(new Date(t+1,0,1))}))})(e)})}),(0,p.jsx)("td",{colSpan:2,style:{fontWeight:"bold",textAlign:"center"},children:"Invoices"}),(0,p.jsx)("td",{colSpan:2,style:{fontWeight:"bold",textAlign:"center"},children:"Sales Orders in Production"})]}),(0,p.jsxs)("tr",{style:{color:"#2A4D63"},className:"disable-hover",children:[(0,p.jsx)("td",{style:{backgroundColor:"#EDF4F7",width:"28%"},children:(0,p.jsx)(l.LabeledSelect,{name:"year",options:d.Wg,value:b,onChange:e=>{return v(t=e),void j((0,n.k_m)({rep_id:g.value,start_stamp:(0,o.yw)(new Date(t.value,0,1)),end_stamp:(0,o.yw)(new Date(t.value+1,0,1))}));var t}})}),(0,p.jsx)("td",{style:{textAlign:"center"},children:"Target"}),(0,p.jsxs)("td",{style:{textAlign:"center"},children:["Last Year ",(0,p.jsx)("br",{}),"(actual)"]}),(0,p.jsx)("td",{style:{textAlign:"center"},children:"Target"}),(0,p.jsxs)("td",{style:{textAlign:"center"},children:["Last Year ",(0,p.jsx)("br",{}),"(actual)"]})]}),L?d.yz.map((e,t)=>(0,p.jsxs)("tr",{style:{color:"#2A4D63"},children:[(0,p.jsx)("td",{style:{padding:"0rem 0rem 1rem 0.6rem",backgroundColor:"#EDF4F7"},children:e}),0===t?(0,p.jsxs)("td",{rowSpan:6,colSpan:4,children:[(0,p.jsx)(l.L
1oading,{}),(0,p.jsx)("p",{style:{padding:10,margin:0,textAlign:"center",color:"#00A0B6",fontSize:"1.3rem"},children:"Loading..."})]}):(0,p.jsx)(p.Fragment,{})]},t)):(0,p.jsxs)(p.Fragment,{children:[null==R?void 0:R.map((e,a)=>(0,p.jsxs)("tr",{style:{color:"#2A4D63"},children:[(0,p.jsx)("td",{style:{padding:"2px 8px",backgroundColor:"#EDF4F7"},children:e.month}),(0,p.jsx)("td",{style:{padding:"2px 8px"},children:(0,p.jsx)(l.LabeledInput,{noMargin:!0,disabled:""===g.value||"sales"===t,style:{color:""===g.value||"sales"===t?"#899CA9":"#2A4D63"},name:"sales_target_value",value:e.invoice_target,onChange:e=>{const t=e.target.value;P(e=>e.map((e,l)=>l===a?{...e,invoice_target:t}:e))},onBlur:t=>w(e,t),onFocus:e=>e.target.select()})}),(0,p.jsx)("td",{style:{padding:"0rem 1rem 0rem 0.3rem"},children:(0,p.jsx)(l.LabeledInput,{noMargin:!0,disabled:!0,readOnly:!0,value:(0,d.bZ)(e.invoice_value)})}),(0,p.jsx)("td",{style:{padding:"0rem 0rem 0rem 1rem"},children:(0,p.jsx)(l.LabeledInput,{noMargin:!0,disabled:""===g.value||"sales"===t,style:{color:""===g.value||"sales"===t?"#899CA9":"#2A4D63"},name:"in_production_target_value",value:e.sales_orders_target,onChange:e=>{const t=e.target.value;P(e=>e.map((e,l)=>l===a?{...e,sales_orders_target:t}:e))},onBlur:t=>w(e,t),onFocus:e=>e.target.select()})}),(0,p.jsx)("td",{style:{padding:"0rem 1.6rem 0rem 0.3rem"},children:(0,p.jsx)(l.LabeledInput,{noMargin:!0,disabled:!0,readOnly:!0,value:(0,d.bZ)(e.sales_orders_value)})})]})),(0,p.jsxs)("tr",{children:[(0,p.jsx)("td",{style:{padding:"0rem 0rem 0rem 8px",backgroundColor:"#EDF4F7"},children:(0,p.jsx)("b",{children:"Total"})}),(0,p.jsx)("td",{style:{padding:"4px 8px"},children:(0,p.jsx)(l.LabeledInput,{noMargin:!0,disabled:!0,name:"sales_target_total",readOnly:!0,value:(0,d.bZ)(null==R?void 0:R.reduce((e,t)=>(parseInt(t.invoice_target.replaceAll(",",""))||0)+e,0))})}),(0,p.jsx)("td",{style:{padding:"0rem 1rem 0rem 0.3rem"},children:(0,p.jsx)(l.LabeledInput,{noMargin:!0,disabled:!0,readOnly:!0,value:(0,d.bZ)(null==R?void 0:R.reduce((e,t)=>parseInt(t.invoice_value)+e,0))})}),(0,p.jsx)("td",{style:{padding:"0rem 0rem 0rem 1rem"},children:(0,p.jsx)(l.LabeledInput,{noMargin:!0,disabled:!0,readOnly:!0,name:"in_production_total",value:(0,d.bZ)(null==R?void 0:R.reduce((e,t)=>(parseInt(t.sales_orders_target.replaceAll(",",""))||0)+e,0))})}),(0,p.jsx)("td",{style:{padding:"0rem 1.6rem 0rem 0.3rem"},children:(0,p.jsx)(l.LabeledInput,{noMargin:!0,disabled:!0,readOnly:!0,value:(0,d.bZ)(null==R?void 0:R.reduce((e,t)=>parseInt(t.sales_orders_value)+e,0))})})]})]})]})]})})}}}]); 2//# sourceMappingURL=ManagementAnalyticsApp.b5b14f1a.chunk.js.map
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.