{"version":3,"sources":["helpers/moneyFormat.ts","components/ProgressBar/index.tsx","constants/enumTipoSistema.ts","auth/index.ts","helpers/usePersistedState.ts","constants/enderecoWebservice.ts","services/api.ts","helpers/usePersistedStateIndexedDB.ts","store/ChartDataContext.tsx","store/LayoutContext.tsx","components/SnackbarCloseButton/index.tsx","components/Header/index.tsx","components/ServiceWorkerWrapper/index.tsx","theme/index.ts","theme/shadows.ts","theme/typography.ts","components/Loading/index.tsx","assets/images/sti3-icon.png","icons/GenIcon/index.tsx","icons/index.tsx","components/Logo/index.tsx","constants/mensagensValidacoes.ts","components/FormInput/index.tsx","components/Button/ButtonLoading/index.tsx","components/Copyright/index.tsx","components/FormInputPassword/index.tsx","constants/rotas.ts","pages/Autenticacao/Login/index.tsx","pages/Autenticacao/RecuperarSenha/index.tsx","pages/Autenticacao/RedefinirSenha/index.tsx","pages/Autenticacao/ConfirmarEmail/index.tsx","components/DialogConfirm/index.tsx","components/TransitionDefault/index.tsx","components/GerenciarUsuario/ButtonMoreOption/index.tsx","components/FormInputSelect/index.tsx","components/GerenciarUsuario/FiltroUsuario/index.tsx","components/FormInputAutoComplete/index.tsx","components/GerenciarUsuario/Inserir/index.tsx","components/GerenciarUsuario/Alterar/index.tsx","components/GerenciarUsuario/index.tsx","components/TrocarLoja/ButtonExcluir/index.tsx","components/TrocarLoja/index.tsx","pages/Dashboard/Downloads/styles.ts","pages/Dashboard/Downloads/index.tsx","components/Menu/NavItem.tsx","components/Menu/index.tsx","components/HeaderCard/index.tsx","components/RadioButtonFiltros/index.tsx","components/Totalizador/index.tsx","constants/identificacaoGrafico.ts","components/GraficoSemDados/index.tsx","components/Grafico/Loja/VendaPorVendedor/v1/VendaPorVendedor.tsx","components/DatePickerRange/index.tsx","helpers/dateFormat.ts","helpers/dateMinMax.ts","helpers/extractInformationChartV2.ts","components/Grafico/Loja/VendaPorVendedor/v2/VendaPorVendedor.tsx","components/Grafico/Loja/VendaPorHora/v1/VendaPorHora.tsx","components/Grafico/Loja/VendaPorHora/v2/VendaPorHora.tsx","components/Grafico/Loja/VendaPorDiaSemana.tsx","components/LegendaGrafico/index.tsx","components/Grafico/Loja/VendaLojaPorFormaPagamento/v1/VendaLojaPorFormaPagamento.tsx","components/Grafico/Loja/VendaLojaPorFormaPagamento/v2/VendaLojaPorFormaPagamento.tsx","components/Grafico/Loja/VendaTicketMedio.tsx","components/Grafico/Loja/VendaTotalizadores/v1/VendaTotalizadores.tsx","components/Grafico/Loja/VendaTotalizadores/v2/VendaTotalizadores.tsx","pages/Dashboard/VendasPorLoja/index.tsx","components/ProgressBarVendaPorLoja/index.tsx","components/Grafico/TodasLojas/VendaPorLoja/v1/VendaPorLoja.tsx","components/Grafico/TodasLojas/VendaPorLoja/v2/VendaPorLoja.tsx","components/Grafico/TodasLojas/VendaTodasLojasPorFormaPagamento/v1/VendaTodasLojasPorFormaPagamento.tsx","components/Grafico/TodasLojas/VendaTodasLojasPorFormaPagamento/v2/VendaTodasLojasPorFormaPagamento.tsx","components/Grafico/TodasLojas/VendaPorOrigem/v1/VendaPorOrigem.tsx","components/Grafico/TodasLojas/VendaPorOrigem/v2/VendaPorOrigem.tsx","pages/Dashboard/VendasTodasLojas/index.tsx","components/Grafico/Produto/ProdutoSituacao.tsx","components/TotalizadorDividido/index.tsx","components/Grafico/Produto/ProdutoMaisVendidos/v1/ProdutoMaisVendidos.tsx","components/Grafico/Produto/ProdutoMaisVendidos/v2/ProdutoMaisVendidos.tsx","components/Grafico/Produto/ProdutoEmEstoque.tsx","components/Grafico/Produto/TotalGruposVendidos.tsx","pages/Dashboard/Produtos/index.tsx","components/Grafico/ContasAPagar/ContasAPagar.tsx","components/Grafico/ContasAPagar/ContasPagas.tsx","pages/Dashboard/ContasPagar/index.tsx","components/Grafico/ContasAReceber/ContasAReceber.tsx","components/Grafico/ContasAReceber/ContasRecebidas.tsx","pages/Dashboard/ContasReceber/index.tsx","routes.tsx","styles/global.ts","App.tsx","serviceWorkerRegistration.ts","index.tsx"],"names":["formatarDinheiro","valor","exibirPrefixo","valorFormatado","Number","toLocaleString","style","currency","replace","useStyles","makeStyles","container","height","backgroundColor","borderRadius","margin","divComplete","transition","spanNome","color","float","position","marginTop","marginLeft","spanValor","marginRight","ProgressBar","props","classes","bgcolor","completed","nome","key","useState","completedState","setCompletedState","useEffect","className","width","background","TipoSistemaEnum","ZENDAR","POWERSTOCK","STI3","properties","1","name","value","nomeExibicao","manifest","process","2","3","TOKEN","REFRESH_TOKEN","DOMINIO","LOGIN_REMEMBER","APPLICATION_NOT_UPDATED","getEnumByName","enumObj","Object","entries","filter","obj","setToken","dados","localStorage","setItem","token","refreshToken","setLoja","loja","JSON","stringify","setDominio","dominio","getDadosToken","this","getToken","JwtDecode","getItem","getDataDominio","getRefreshToken","getSecurityStamp","securitystamp","getLojas","userData","parse","lojas","sort","loja1","loja2","NomeFantasia","CidadeUf","administrador","toLowerCase","usuarioId","userId","getUserIdentityAppInsights","email","empresaId","autenticado","clearToken","removeItem","clearTokenAndRedirect","window","location","reload","getRememberLogin","loginString","usuarioBytes","CryptoJs","AES","decrypt","toString","enc","Utf8","usuario","senha","lembrarSenha","getSistema","undefined","REACT_APP_APP_SISTEMA","sistema","host","split","setRememberLogin","login","encryptUsuario","encrypt","setAplicacaoDesatualizada","desatualizada","applicationNotUpdated","getAplicacaoDesatualizada","notUpdated","count","aplicacaoDesatualizada","removeRememberLogin","usePersistedState","initialState","storageValue","state","setState","ConstanteEnderecoWebservice","AUTENTICACAO_LOGIN","AUTENTICACAO_LOGOFF","AUTENTICACAO_RECUPERAR_SENHA","AUTENTICACAO_ALTERAR_SENHA","AUTENTICACAO_REFRESH_TOKEN","AUTENTICACAO_INTEGRACAO_LOGIN","AUTENTICACAO_INTEGRACAO_LOGOFF","AUTENTICACAO_INTEGRACAO_REFRESH_TOKEN","USUARIO_LISTAR","USUARIO_EXCLUIR","USUARIO_INSERIR","USUARIO_ALTERAR","USUARIO_OBTER","USUARIO_CONFIRMAR_EMAIL","USUARIO_REENVIAR_CONFIRMACAO_EMAIL","EXPORTAR_FORMA_PAGAMENTO_LOJA","LOJA_LISTAR","LOJA_DESATIVAR","RELATORIOS_DISPONIVEIS","OBTER_RELATORIO","GRAFICO_LISTAR","refreshTokenEnderecoWebService","auth","api","axios","create","baseURL","headers","HTTP_REFERER_MULTIEMPRESA","interceptors","response","use","data","error","originalRequest","config","status","retry","sucesso","avisos","put","then","res","defaults","common","Authorization","href","err","request","configNew","openDB","indexedDB","open","onupgradeneeded","db","result","objectStoreNames","contains","createObjectStore","onsuccess","tx","transaction","objectStore","get","storedValue","oncomplete","close","ChartDataContext","createContext","LayoutProvider","children","enqueueSnackbar","useSnackbar","usePersistedStateIndexedDB","chartData","setChartData","consultarAposLogin","setConsultarAposLogin","syncData","lojaId","a","lojaIdConsulta","lojaItem","LojaId","length","primeiraLoja","params","retornoFormatado","map","Filtros","Dias","variant","item","obterVersaoGrafico","useCallback","identificacaoGrafico","versao","informacoesGraficoPorIdentificacao","identificacao","Provider","useChartData","context","useContext","Error","LayoutContext","loading","setLoading","loadingReloadGraficos","setLoadingReloadGraficos","titlePage","setTitlePage","appInsights","useMemo","ApplicationInsights","instrumentationKey","useLayout","SnackbarCloseButton","closeSnackbar","IconButton","size","onClick","fontSize","HeaderSistema","nomeSistema","valueSistema","sistemaAtual","toUpperCase","slice","charSet","content","rel","ServiceWorkerWrapper","React","showReload","setShowReload","addEventListener","reloadPage","Snackbar","message","anchorOrigin","vertical","horizontal","autoHideDuration","action","Button","theme","createMuiTheme","palette","type","default","colors","white","paper","primary","main","teal","secondary","text","shadows","typography","fontFamily","fontWeightLight","fontWeightRegular","fontWeightMedium","top","left","transform","minWidth","minHeight","zIndex","opacity","containerLoading","Loading","useTheme","radius","GenIcon","path","xmlns","xmlnsXlink","d","StrokeRounded","fill","stroke","strokeLinecap","strokeLinejoin","Stroke075Rounded","strokeWidth","ProdutosIcon","viewBox","points","x1","y1","x2","y2","PowerStockLogotipo","ZendarCompleto","VendasIcon","ContasReceberIcon","cx","cy","r","ContasPagarIcon","LojaIcon","x","y","UsuariosIcon","Logo","alignSelf","marginBottom","src","logo","alt","ConstanteMensagemValidacao","CAMPO_OBRIGATORIO","EMAIL_INVALIDO","SENHA_MINIMO_SEIS_CARACTERES","SENHA_NAO_COINCIDEM","inputLabelProps","grey","CssTextField","withStyles","root","borderColor","TextField","FormInput","setValue","rest","label","control","Input","InputLabelProps","inputProps","onBlur","e","target","trim","as","defaultValue","ButtonLoading","cor","fullWidth","heightLoader","disabled","css","Copyright","Typography","align","Link","Date","getFullYear","FormControl","FormInputPassword","messageError","autoComplete","labelWidth","required","showPassword","setShowPassword","InputLabel","OutlinedInput","endAdornment","InputAdornment","edge","FormHelperText","ConstanteRotas","LOGIN","RECUPERAR_SENHA","REDEFINIR_SENHA","VENDAS_POR_LOJA","VENDAS_TODAS_LOJAS","PRODUTOS","CONTAS_PAGAR","CONTAS_RECEBER","CONFIRMAR_EMAIL","display","flexDirection","alignItems","form","spacing","submit","dialog","blueGrey","schema","yup","shape","_","parent","isSti3","rememberLogin","Login","history","useHistory","sistemaIsZendarOrPowerstock","loginEnderecoWebService","logoffEnderecoWebService","useForm","resolver","yupResolver","defaultValues","handleSubmit","errors","register","tratarResponse","versaoAplicativoDesatualizada","navigator","serviceWorker","getRegistrations","registrations","update","push","onSubmit","dataLogin","versaoAplicativo","post","logOff","justifyContent","Container","component","maxWidth","autoFocus","Boolean","helperText","FormControlLabel","Checkbox","inputRef","defaultChecked","Grid","lg","cursor","Box","mt","RecuperarSenha","confirmarSenha","oneOf","RedefinirSenha","useLocation","query","URLSearchParams","search","decodeURIComponent","dataPut","novaSenha","ConfirmarEmail","confirmarEmail","DialogConfirm","title","contentText","handleOK","dialogOpen","setDialogOpen","Dialog","onClose","aria-labelledby","aria-describedby","DialogTitle","id","DialogContent","DialogContentText","DialogActions","Transition","forwardRef","ref","Slide","direction","createStyles","paperMenu","iconAction","handleAlterar","handleExcluir","handleResetSenha","handleReenviarEmailConfirmacao","anchorEl","setAnchorEl","usuarioLogadoId","handleCloseMenuOpcoes","aria-label","aria-controls","aria-haspopup","currentTarget","TransitionComponent","Zoom","MenuItem","emailConfirmed","option","FormInputSelect","optionsList","NativeSelect","input","description","body","formSearch","FiltroUsuario","reset","actionHandle","getValues","setOpen","quantidadeFiltros","setQuantidadeFiltros","filtroOriginal","setFiltroOriginal","handleClose","Badge","badgeContent","Tune","keepMounted","quantidadeFiltrosAtualizada","FormInputAutoComplete","options","getOptionLabel","renderOption","renderInput","noOptionsText","render","onChange","Autocomplete","limitTags","disableCloseOnSelect","multiple","appBar","flex","padding","formControl","radioButton","helpMessage","typographyHelp","icon","checkedIcon","min","InserirUsuario","handleDialogClose","setLojas","anchorElHelp","setAnchorElHelp","showLojas","setShowLojas","trigger","openHelp","lojasId","resetForm","fullScreen","AppBar","Toolbar","xs","md","event","checked","HelpOutline","Popover","transformOrigin","xl","nomeFantasia","cidade","uf","selected","AlterarUsuario","anchorElHelpEmailConfirmado","setAnchorElHelpEmailConfirmado","setAdministrador","bloquearDesmarcarAdministrador","emailConfirmado","setEmailConfirmado","openHelpEmailConfirmado","getUsuario","includes","getDados","maxHeight","paddingLeft","fab","bottom","right","GerenciarUsuario","classesItem","currentPage","scrollPosition","setScrollPosition","showAdicionar","setShowAdicionar","showAdicionarDialog","setShowAdicionarDialog","showAlterarDialog","setShowAlterarDialog","setUsuarioId","usuarios","setUsuarios","usuariosFiltrados","setUsuariosFiltrados","dialogConfirmOpen","setDialogConfirmOpen","dialogConfirmOpenAlterarSenha","setDialogConfirmOpenAlterarSenha","usuarioSelecionado","setUsuarioSelecionado","sistemaIsSti3","getUsuarios","confirmDelete","delete","confirmAlterarSenha","forEach","aviso","handleClickOpenHelp","handleClickCloseHelp","ListItem","disableGutters","button","listaFiltrada","usuarioItem","Divider","List","onScroll","scrollTop","overflow","Fragment","Chip","ErrorOutline","orange","ButtonMoreOption","in","Fab","Add","Inserir","Alterar","boxShadow","ButtonOptionsLoja","onConfirm","ria-label","anchorPosition","borderLeft","fontWeight","fontWeightBold","fade","searchIcon","pointerEvents","inputRoot","inputInput","TrocarLoja","lojaSelecionada","setLojaSelecionada","infoLoja","useRef","lojasAuth","userIsAdm","handleSalvar","lojaSelecionadaObj","sincronizacaoAtrasada","dataSincronizacao","dataSincronizacaoNormalizada","getMonth","getDate","dataAtual","current","listaLojasIdExterno","newLojas","InputBase","placeholder","filtro","filtrarLojas","dataHoraUltimaSincronizacao","lojaIdExterno","listItem","listItemAction","Downloads","relatorios","listRelatorios","setListRelatorios","obterRequestAxios","url","nomeArquivo","zip","responseType","file","tipoRelatorio","descricaoRelatorio","JSZip","nomePersonalizado","axiosList","nomeRelatorio","urlArquivo","Promise","all","generateAsync","jsFileDownload","lineHeight","relatorio","descricao","filtrarRelatorio","ListItemText","ListItemSecondaryAction","handleDownload","list","paddingTop","paddingBottom","letterSpacing","textTransform","iconSair","active","divSubmenu","whiteSpace","paddingRight","divider","SubMenu","titulo","NavItem","closeHandle","setRelatorios","isLoading","setIsLoading","maisUmaLoja","items","Icon","setCurrentPage","handleSetPage","getRelatorios","activeClassName","RouterLink","to","disablePadding","flexGrow","drawer","breakpoints","up","flexShrink","menuButton","toolbar","mixins","drawerPaper","textAlign","iconMenu","iconRefresh","cabecalhoNomeLoja","HideOnScroll","useScrollTrigger","appear","Header","mobileOpen","setMobileOpen","handleDrawerToggle","handleGet","CssBaseline","Hidden","smUp","implementation","Drawer","anchor","ModalProps","textTitulo","textSubtitulo","verticalAlign","textAtualizadoEm","gap","containerTitle","down","containerButton","HeaderCard","subtitulo","atualizadoEm","handleOrdem","exibirFiltro","appearButtonDownload","handleDownloadReport","downloadReportDisabled","isResponsiveVersion","useMediaQuery","ordem","setOrdem","ordemAplicada","setOrdemAplicada","AccessTime","RadioGroup","row","Radio","labelPlacement","toggleButtonGroup","bgNaoSelecionado","toggleButton","fontSizeSmall","RadioButtonFiltros","listItems","bgSelecionado","handle","opcaoPadrao","setOption","itemsComValor","possuiDados","filtroItem","texto","ToggleButtonGroup","exclusive","newOption","ToggleButton","rowValor","rowTitulo","Totalizador","exibirEmReais","IdentificacaoGrafico","TodasEmpresas_VendasPorLoja","TodasEmpresas_VendasPorFormaPagto","TodasEmpresas_VendasPorOrigem","Vendas_VendasPorVendedor","Vendas_VendasPorHora","Vendas_VendasPorDiaDaSemana","Vendas_VendasPorFormaPagto","Vendas_TicketMedio","Vendas_Totalizadores","Produtos_SituacaoProdutos","Produtos_ProdutosMaisVendidos","Produtos_ProdutosEmEstoque","ContasAPagar_ContasAPagar","ContasAPagar_ContasPagas","ContasAReceber_ContasAReceber","ContasAReceber_ContasRecebidas","Produtos_TotalGruposVendidos","GraficoSemDados","VendaPorVendedor","dataUltimaSincronizacao","setDataUltimaSincronizacao","radioButtonList","setRadioButtonList","progressBarList","setProgressBarList","valorTotal","setValorTotal","obterDadosGrafico","informacoesFiltro","obterDadosPorFiltro","informacao","informacaoFiltro","find","Filtro","Valor","Total","total","listPorcentagem","index","porcentagem","b","parseFloat","calcularPorcentagens","Dados","Descricao","resetGrafico","filtros","filtrosComValor","myCustomLocale","months","weekDays","short","isWeekend","weekStartingIndex","getToday","gregorainTodayObject","toNativeDate","date","year","month","day","getMonthLength","transformDigit","digit","from","digitSeparator","yearLetterSkip","isRtl","DatePickerRange","defaultDateRange","bgButtonColor","bgDateColor","labelColor","datepicker","calendar","border","divShowDate","obterDataComponenteDatePicker","padStart","modalIsOpen","setModalIsOpen","selectedDayRangeDatePicker","setSelectedDayRangeDatePicker","selectedDayRange","setSelectedDayRange","minimoMaximoDayRange","setMinimoMaximoDayRange","handleOk","dateFrom","setMonth","DateRange","shouldHighlightWeekends","locale","wrapperClassName","calendarClassName","maximumDate","minimumDate","renderFooter","dateToDayDatePicker","Intl","DateTimeFormat","minHourDate","maxHourDate","extractInformationChartV2","dtInicial","dtFinal","dataItem","Data","valTotal","listItens","Array","infoFiltro","indexDado","dado","objIndex","findIndex","itemUpdate","setDefaultDateRange","dateTo","selectedDate","VendaPorHora","infoGraficoState","setInfoGraficoState","totalVendas","setTotalVendas","listSort","hora","infoGrafico","series","chart","show","foreColor","gradient","gradientToColors","opacityFrom","opacityTo","dataLabels","enabled","curve","markers","strokeColor","xaxis","categories","labels","grid","yaxis","lines","axisBorder","formatter","parseInt","tooltip","marker","newInfoGrafico","ApexCharts","exec","atualizarGrafico","VendaPorDiaSemana","setTotal","corPrincipal","corFundo","iconCor","LegendaGrafico","VendaLojaPorFormaPagamento","legenda","setLegenda","Itens","formaPagto","toFixed","lineCap","legend","horizontalAlign","floating","useSeriesColors","itemMargin","onItemClick","toggleDataSeries","val","VendaTicketMedio","ticketMedio","setTicketMedio","ticketMedioValor","offsetX","offsetY","VendaTotalizadores","obs","InformacaoAdicional","InfoGrafico","minheight","Vendas","Card","sincronizado","spanCidade","syncProblemIcon","Tooltip","placement","VendaPorLoja","ValorTotal","Sincronizado","LojaIdExterno","VendaTodasLojasPorFormaPagamento","dataInicio","setDataInicio","dataFim","setDataFim","Uint8Array","atob","arquivo","code","charCodeAt","JSFiledownload","VendaPorOrigem","ProdutoSituacao","obterDados","TotalizadorDividido","valorEsquerdo","tituloEsquerdo","exibirEmReaisEsquerdo","valorDireito","tituloDireito","exibirEmReaisDireito","observacao","quantidade","ProdutoMaisVendidos","totalVendasAdicional","setTotalVendasAdicional","TotalAdicional","valTotalAdicional","ProdutoEmEstoque","TotalGruposVendidos","Produtos","dividerInformacaoAdicional","ContasAPagar","informacoesAdicionais","infoAdicional","filtroPadrao","informacaoAdicional","ContasPagas","ContasAReceber","ContasRecebidas","requireLogin","next","meta","trackPageView","isLoggedIn","uri","redirect","Routes","guards","exact","values","VendasPorLoja","VendasTodasLojas","ContasPagar","ContasReceber","boxSizing","html","GlobalStyles","App","ThemeProvider","preventDuplicate","dense","maxSnack","copyTitle","copyBody","copyShareButtonLabel","copyAddHomeButtonLabel","timesToShow","copyClosePrompt","permanentlyHideOnDismiss","isLocalhost","hostname","match","registerValidSW","swUrl","registration","onupdatefound","installingWorker","installing","onstatechange","controller","console","log","onUpdate","onSuccess","catch","ReactDOM","StrictMode","fallback","document","getElementById","URL","origin","fetch","contentType","indexOf","ready","unregister","checkValidServiceWorker","serviceWorkerRegistration","waiting","postMessage","evt","CustomEvent","dispatchEvent"],"mappings":"2aAAe,SAASA,EACtBC,EACAC,GAEA,IAAIC,EAAiBC,OAAOH,GAAOI,eAAe,QAAS,CACzDC,MAAO,WACPC,SAAU,QAOZ,OAJKL,IACHC,EAAiBA,EAAeK,QAAQ,SAAO,KAG1CL,ECTT,IAAMM,EAAYC,aAAW,iBAAO,CAClCC,UAAW,CACTC,OAAQ,GACRC,gBAAiB,UACjBC,aAAc,EACdC,OAAQ,qBAEVC,YAAa,CACXJ,OAAQ,OACRK,WAAY,wBAEdC,SAAU,CACRC,MAAO,OACPC,MAAO,OACPC,SAAU,WACVC,UAAW,QACXC,WAAY,QAEdC,UAAW,CACTL,MAAO,OACPC,MAAO,QACPC,SAAU,WACVC,UAAW,QACXG,YAAa,YAyBFC,EArBK,SAAC,GAAkB,IAAbC,EAAY,oBAC9BC,EAAUnB,IACRoB,EAAyCF,EAAzCE,QAASC,EAAgCH,EAAhCG,UAAWC,EAAqBJ,EAArBI,KAAM9B,EAAe0B,EAAf1B,MAAO+B,EAAQL,EAARK,IAFL,EAGQC,mBAAS,GAHjB,mBAG7BC,EAH6B,KAGbC,EAHa,KASpC,OAJAC,qBAAU,WACRD,EAAkBL,KACjB,CAACA,IAGF,sBAAKO,UAAWT,EAAQjB,UAAxB,UACE,qBACE0B,UAAWT,EAAQZ,YACnBV,MAAO,CAAEgC,MAAM,GAAD,OAAKJ,EAAL,KAAwBK,WAAYV,KAEpD,sBAAMQ,UAAWT,EAAQV,SAAzB,SAAoCa,IACpC,sBAAMM,UAAWT,EAAQJ,UAAzB,SAAqCxB,EAAiBC,GAAO,OANvB+B,I,uGCJ7BQ,EA3BS,CACtBC,OAAQ,EACRC,WAAY,EACZC,KAAM,EAENC,WAAY,CACVC,EAAG,CACDC,KAAM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66B,SAASR,KAMlBM,QAAQC,IAAI,sCAGR56B,GAAUA,EAAO86B,WACnB96B,EAAO86B,UAAUT,WAO5BU,OAAM,SAACj7B,GACN66B,QAAQ76B,MAAM,4CAA6CA,MCjGjEk7B,IAASvjB,OACP,cAAC,IAAMwjB,WAAP,UACE,cAAC,WAAD,CAAUC,SAAU,cAAC,EAAD,IAApB,SACE,cAAC9B,GAAD,QAGJ+B,SAASC,eAAe,SDiBnB,SAAkBp7B,GACvB,GAA6C,kBAAmB6Q,UAAW,CAGzE,GADkB,IAAIwqB,IAAItjC,GAAwBuD,OAAOC,SAASoF,MACpD26B,SAAWhgC,OAAOC,SAAS+/B,OAIvC,OAGFhgC,OAAO8K,iBAAiB,QAAQ,WAC9B,IAAMg0B,EAAK,UAAMriC,GAAN,sBAEPiiC,KAgEV,SAAiCI,EAAep6B,GAE9Cu7B,MAAMnB,EAAO,CACX56B,QAAS,CAAE,iBAAkB,YAE5Bc,MAAK,SAACX,GAEL,IAAM67B,EAAc77B,EAASH,QAAQoC,IAAI,gBAEnB,MAApBjC,EAASM,QACO,MAAfu7B,IAA8D,IAAvCA,EAAYC,QAAQ,cAG5C5qB,UAAUC,cAAc4qB,MAAMp7B,MAAK,SAAC+5B,GAClCA,EAAasB,aAAar7B,MAAK,WAC7BhF,OAAOC,SAASC,eAKpB2+B,GAAgBC,EAAOp6B,MAG1B+6B,OAAM,WACLJ,QAAQC,IACN,oEAvFAgB,CAAwBxB,EAAOp6B,GAI/B6Q,UAAUC,cAAc4qB,MAAMp7B,MAAK,WACjCq6B,QAAQC,IACN,+GAMJT,GAAgBC,EAAOp6B,OC1C/B67B,CAAmC,CACjChB,SAAU,SAACR,GACT,GAAIA,GAAgBA,EAAayB,QAAS,CACxCzB,EAAayB,QAAQC,YAAY,CAAE90B,KAAM,iBACzC,IAAM+0B,EAAM,IAAIC,YAAY,cAC5B3gC,OAAO4gC,cAAcF,S","file":"static/js/main.b384990c.chunk.js","sourcesContent":["export default function formatarDinheiro(\r\n valor: any,\r\n exibirPrefixo: boolean\r\n): string {\r\n let valorFormatado = Number(valor).toLocaleString('pt-BR', {\r\n style: 'currency',\r\n currency: 'BRL',\r\n });\r\n\r\n if (!exibirPrefixo) {\r\n valorFormatado = valorFormatado.replace('R$ ', ''); // O espaço gerado pelo toLocaleString é um outro caracter\r\n }\r\n\r\n return valorFormatado;\r\n}\r\n","import React, { useEffect, useState } from 'react';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n height: 30,\r\n backgroundColor: '#323B40',\r\n borderRadius: 0,\r\n margin: '0px 10px 5px 10px',\r\n },\r\n divComplete: {\r\n height: '100%',\r\n transition: 'width 1s ease-in-out',\r\n },\r\n spanNome: {\r\n color: '#fff',\r\n float: 'left',\r\n position: 'relative',\r\n marginTop: '-25px',\r\n marginLeft: '15px',\r\n },\r\n spanValor: {\r\n color: '#fff',\r\n float: 'right',\r\n position: 'relative',\r\n marginTop: '-25px',\r\n marginRight: '15px',\r\n },\r\n}));\r\n\r\nconst ProgressBar = ({ ...props }) => {\r\n const classes = useStyles();\r\n const { bgcolor, completed, nome, valor, key } = props;\r\n const [completedState, setCompletedState] = useState(0);\r\n\r\n useEffect(() => {\r\n setCompletedState(completed);\r\n }, [completed]);\r\n\r\n return (\r\n
\r\n \r\n {nome}\r\n {formatarDinheiro(valor, true)}\r\n
\r\n );\r\n};\r\n\r\nexport default ProgressBar;\r\n","export type TipoSistema = 1 | 2;\r\n\r\nexport type ListaItensSistema = {\r\n icone: string;\r\n name: string;\r\n value: number;\r\n manifest: string;\r\n nomeExibicao: string;\r\n};\r\n\r\nconst TipoSistemaEnum = {\r\n ZENDAR: 0,\r\n POWERSTOCK: 1,\r\n STI3: 2,\r\n\r\n properties: {\r\n 1: {\r\n name: 'zendar',\r\n value: 0,\r\n nomeExibicao: 'Zendar Dashboard',\r\n manifest: `${process.env.PUBLIC_URL}/manifestZendar.json`,\r\n },\r\n 2: {\r\n name: 'powerstock',\r\n value: 1,\r\n nomeExibicao: 'Powerstock Dashboard',\r\n manifest: `${process.env.PUBLIC_URL}/manifestPowerstock.json`,\r\n },\r\n 3: {\r\n name: 'sti3',\r\n value: 2,\r\n nomeExibicao: 'Sti3 Dashboard',\r\n manifest: `${process.env.PUBLIC_URL}/manifest.json`,\r\n },\r\n },\r\n};\r\n\r\nexport default TipoSistemaEnum;\r\n","import JwtDecode from 'jwt-decode';\r\nimport CryptoJs from 'crypto-js';\r\nimport { StringDecoder } from 'string_decoder';\r\n\r\nimport TipoSistemaEnum from '../constants/enumTipoSistema';\r\n\r\nexport interface PossuiPermissaoResponse {\r\n permitido: boolean;\r\n bloqueio?: 'plano' | 'permissao';\r\n}\r\n\r\nexport interface Loja {\r\n LojaId: string;\r\n NomeFantasia: string;\r\n CidadeUf: string;\r\n DataHoraUltimaSincronizacao: string;\r\n}\r\n\r\nexport interface ApplicationNotUpdated {\r\n notUpdated: boolean;\r\n count: number;\r\n}\r\n\r\ninterface GetNameEnumInterface {\r\n name: string;\r\n value: number;\r\n}\r\n\r\nconst TOKEN = 'token';\r\nconst REFRESH_TOKEN = 'refreshToken';\r\nconst LOJA = 'loja';\r\nconst DOMINIO = 'dominio';\r\nconst LOGIN_REMEMBER = 'loginRemember';\r\nconst APPLICATION_NOT_UPDATED = 'applicationNotUpdated';\r\n\r\nexport const getEnumByName = (\r\n enumObj: any,\r\n name: any\r\n): GetNameEnumInterface => {\r\n return Object.entries(enumObj.properties as GetNameEnumInterface).filter(\r\n (obj: any) => obj[1].name === name\r\n )[0][1] as GetNameEnumInterface;\r\n};\r\n\r\nexport default {\r\n setToken(dados: any) {\r\n localStorage.setItem(TOKEN, dados.token);\r\n localStorage.setItem(REFRESH_TOKEN, dados.refreshToken);\r\n },\r\n\r\n setLoja(loja: any) {\r\n localStorage.setItem(LOJA, JSON.stringify(loja));\r\n },\r\n\r\n setDominio(dominio: string) {\r\n localStorage.setItem(DOMINIO, dominio);\r\n },\r\n\r\n getDadosToken(): any {\r\n const token = this.getToken();\r\n\r\n if (token) return JwtDecode(token);\r\n\r\n return undefined;\r\n },\r\n\r\n getToken(): any {\r\n const token = localStorage.getItem(TOKEN);\r\n return token;\r\n },\r\n\r\n getDataDominio(): any {\r\n const dominio = localStorage.getItem(DOMINIO);\r\n return dominio;\r\n },\r\n\r\n getRefreshToken(): any {\r\n return localStorage.getItem(REFRESH_TOKEN);\r\n },\r\n\r\n getSecurityStamp(): string {\r\n const userData = this.getDadosToken();\r\n return userData.securitystamp;\r\n },\r\n\r\n getLojas(): Array {\r\n const userData = this.getDadosToken();\r\n\r\n if (userData) {\r\n return JSON.parse(userData.lojas).sort((loja1, loja2) => {\r\n if (loja1.NomeFantasia > loja2.NomeFantasia) return 1;\r\n if (loja1.NomeFantasia < loja2.NomeFantasia) return -1;\r\n\r\n if (loja1.CidadeUf > loja2.CidadeUf) return 1;\r\n if (loja1.CidadeUf < loja2.CidadeUf) return -1;\r\n\r\n return 1;\r\n });\r\n }\r\n\r\n return [] as Array;\r\n },\r\n\r\n administrador(): boolean {\r\n const userData = this.getDadosToken();\r\n\r\n if (userData) {\r\n return (\r\n (userData.administrador || '').toLowerCase() === 'true' ||\r\n userData.administrador === true\r\n );\r\n }\r\n\r\n return false;\r\n },\r\n\r\n usuarioId(): string {\r\n const userData = this.getDadosToken();\r\n return userData.userId;\r\n },\r\n\r\n getUserIdentityAppInsights(): string {\r\n const userData = this.getDadosToken();\r\n return `user: ${userData.email} | id: ${userData.userId} | empresaId: ${userData.empresaId}`;\r\n },\r\n\r\n empresaId(): StringDecoder {\r\n const userData = this.getDadosToken();\r\n return userData.empresaId;\r\n },\r\n\r\n autenticado(): boolean {\r\n return this.getToken() != null;\r\n },\r\n\r\n clearToken() {\r\n localStorage.removeItem(TOKEN);\r\n localStorage.removeItem(REFRESH_TOKEN);\r\n localStorage.removeItem(DOMINIO);\r\n },\r\n\r\n clearTokenAndRedirect() {\r\n this.clearToken();\r\n window.location.reload();\r\n },\r\n\r\n getRememberLogin() {\r\n const loginString = localStorage.getItem(LOGIN_REMEMBER);\r\n const key = (process.env.REACT_APP_KEY_ENCRYPT as string) || '';\r\n\r\n if (loginString) {\r\n const usuarioBytes = CryptoJs.AES.decrypt(loginString, key);\r\n\r\n return JSON.parse(usuarioBytes.toString(CryptoJs.enc.Utf8));\r\n }\r\n\r\n return {\r\n usuario: '',\r\n senha: '',\r\n dominio: '',\r\n lembrarSenha: false,\r\n };\r\n },\r\n\r\n getSistema(): any {\r\n if (\r\n process.env.NODE_ENV === 'development' ||\r\n process.env.NODE_ENV === 'test' ||\r\n process.env.REACT_APP_APP_SISTEMA !== undefined\r\n ) {\r\n return getEnumByName(TipoSistemaEnum, process.env.REACT_APP_APP_SISTEMA);\r\n }\r\n\r\n const sistema = window.location.host.split('.')[1].toLowerCase();\r\n return getEnumByName(TipoSistemaEnum, sistema);\r\n },\r\n\r\n setRememberLogin(login) {\r\n const key = (process.env.REACT_APP_KEY_ENCRYPT as string) || '';\r\n const encryptUsuario = CryptoJs.AES.encrypt(\r\n JSON.stringify(login),\r\n key\r\n ).toString();\r\n\r\n localStorage.setItem(LOGIN_REMEMBER, encryptUsuario);\r\n },\r\n\r\n setAplicacaoDesatualizada(desatualizada: boolean) {\r\n const applicationNotUpdated = this.getAplicacaoDesatualizada();\r\n\r\n if (desatualizada) {\r\n applicationNotUpdated.notUpdated = true;\r\n applicationNotUpdated.count += 1;\r\n } else {\r\n applicationNotUpdated.notUpdated = false;\r\n applicationNotUpdated.count = 0;\r\n }\r\n\r\n localStorage.setItem(\r\n APPLICATION_NOT_UPDATED,\r\n JSON.stringify(applicationNotUpdated)\r\n );\r\n },\r\n\r\n getAplicacaoDesatualizada(): ApplicationNotUpdated {\r\n const aplicacaoDesatualizada = localStorage.getItem(\r\n APPLICATION_NOT_UPDATED\r\n );\r\n\r\n if (aplicacaoDesatualizada) {\r\n const aplicacaoDesatualizadaObj = JSON.parse(\r\n aplicacaoDesatualizada\r\n ) as ApplicationNotUpdated;\r\n\r\n return aplicacaoDesatualizadaObj;\r\n }\r\n\r\n return {\r\n notUpdated: false,\r\n count: 0,\r\n };\r\n },\r\n\r\n removeRememberLogin() {\r\n localStorage.removeItem(LOGIN_REMEMBER);\r\n },\r\n};\r\n","import { useState, useEffect, Dispatch, SetStateAction } from 'react';\r\n\r\ntype Response = [T, Dispatch>];\r\n\r\nfunction usePersistedState(key: string, initialState: T): Response {\r\n const [state, setState] = useState(() => {\r\n const storageValue = localStorage.getItem(key);\r\n\r\n if (storageValue) {\r\n return JSON.parse(storageValue);\r\n }\r\n return initialState;\r\n });\r\n\r\n useEffect(() => {\r\n localStorage.setItem(key, JSON.stringify(state));\r\n }, [key, state]);\r\n\r\n return [state, setState];\r\n}\r\n\r\nexport default usePersistedState;\r\n","const ConstanteEnderecoWebservice = {\r\n AUTENTICACAO_LOGIN: 'api/autenticacao/login',\r\n AUTENTICACAO_LOGOFF: 'api/autenticacao/logoff',\r\n AUTENTICACAO_RECUPERAR_SENHA: 'api/autenticacao/recuperar-senha/',\r\n AUTENTICACAO_ALTERAR_SENHA: 'api/autenticacao/alterar-senha',\r\n AUTENTICACAO_REFRESH_TOKEN: 'api/autenticacao/refresh-token',\r\n\r\n AUTENTICACAO_INTEGRACAO_LOGIN: 'api/AutenticacaoIntegracao/login',\r\n AUTENTICACAO_INTEGRACAO_LOGOFF: 'api/AutenticacaoIntegracao/logoff',\r\n AUTENTICACAO_INTEGRACAO_REFRESH_TOKEN:\r\n 'api/AutenticacaoIntegracao/refresh-token',\r\n\r\n USUARIO_LISTAR: 'api/usuario/listar',\r\n USUARIO_EXCLUIR: 'api/usuario/excluir',\r\n USUARIO_INSERIR: 'api/usuario/inserir',\r\n USUARIO_ALTERAR: 'api/usuario/alterar',\r\n USUARIO_OBTER: 'api/usuario/obter',\r\n USUARIO_CONFIRMAR_EMAIL: 'api/usuario/confirmar-email',\r\n USUARIO_REENVIAR_CONFIRMACAO_EMAIL: 'api/usuario/enviar-email-confirmacao/',\r\n\r\n EXPORTAR_FORMA_PAGAMENTO_LOJA: 'api/grafico/exportar-formapagto-loja',\r\n\r\n LOJA_LISTAR: 'api/loja/listar',\r\n LOJA_DESATIVAR: 'api/Modulo/desativar',\r\n\r\n RELATORIOS_DISPONIVEIS: 'api/Relatorio/obter-disponiveis',\r\n OBTER_RELATORIO: 'api/Relatorio/obter-relatorio',\r\n\r\n GRAFICO_LISTAR: 'api/grafico/listar',\r\n};\r\n\r\nexport default ConstanteEnderecoWebservice;\r\n","import axios, { AxiosRequestConfig } from 'axios';\r\n// import { toast } from 'react-toastify';\r\nimport auth from 'auth';\r\nimport ConstanteEnderecoWebservice from 'constants/enderecoWebservice';\r\nimport TipoSistemaEnum from 'constants/enumTipoSistema';\r\n\r\nexport interface ResponseApi {\r\n sucesso: boolean;\r\n avisos: Array;\r\n tiposAviso: Array;\r\n erros: Array;\r\n dados: T;\r\n}\r\n\r\nconst sistemaIsZendarOrPowerstock = auth.getSistema() !== TipoSistemaEnum.STI3;\r\n\r\nconst refreshTokenEnderecoWebService = sistemaIsZendarOrPowerstock\r\n ? ConstanteEnderecoWebservice.AUTENTICACAO_INTEGRACAO_REFRESH_TOKEN\r\n : ConstanteEnderecoWebservice.AUTENTICACAO_REFRESH_TOKEN;\r\n\r\nconst api = axios.create({\r\n baseURL: process.env.REACT_APP_API_URL,\r\n headers: {\r\n 'Access-Control-Allow-Origin': '*',\r\n 'referencia-servico': '',\r\n HTTP_REFERER_MULTIEMPRESA: '',\r\n },\r\n});\r\n\r\napi.interceptors.response.use(\r\n (response) => {\r\n return response.data;\r\n },\r\n (error) => {\r\n try {\r\n const originalRequest = error.config;\r\n\r\n if (error.response?.status === 401 && !originalRequest.retry) {\r\n originalRequest.retry = true;\r\n\r\n return api\r\n .put(refreshTokenEnderecoWebService, {\r\n token: auth.getToken(),\r\n refreshToken: auth.getRefreshToken(),\r\n })\r\n .then((res) => {\r\n if (res.sucesso && res.dados) {\r\n auth.setToken(res.dados);\r\n\r\n api.defaults.headers.common.Authorization = `Bearer ${auth.getToken()}`;\r\n\r\n return api(originalRequest);\r\n }\r\n\r\n auth.clearToken();\r\n window.location.href = '/';\r\n\r\n return api(originalRequest);\r\n });\r\n }\r\n\r\n if (error.response?.status === 405 && !originalRequest.retry) {\r\n originalRequest.retry = true;\r\n\r\n return api(originalRequest);\r\n }\r\n\r\n if (!originalRequest.retry) {\r\n originalRequest.retry = true;\r\n\r\n return {\r\n data: {\r\n sucesso: false,\r\n },\r\n avisos: [\r\n 'O aplicativo está em manutenção, tente novamente mais tarde.',\r\n ],\r\n };\r\n }\r\n\r\n return null;\r\n } catch (err) {\r\n return {\r\n data: {\r\n sucesso: false,\r\n },\r\n avisos: ['Ocorreu um erro inesperado, tente novamente mais tarde.'],\r\n };\r\n }\r\n }\r\n);\r\n\r\napi.interceptors.request.use((config: AxiosRequestConfig) => {\r\n const token = auth.getToken();\r\n const dominio = auth.getDataDominio();\r\n const sistema = auth.getSistema();\r\n const configNew = config;\r\n\r\n configNew.headers['Access-Control-Allow-Origin'] = '*';\r\n configNew.headers['referencia-servico'] = 'MODULO_DASHBOARD';\r\n\r\n if (sistema) {\r\n if (\r\n process.env.REACT_APP_APP_SISTEMA !== undefined &&\r\n process.env.NODE_ENV !== 'development'\r\n ) {\r\n // Homolog\r\n configNew.headers.HTTP_REFERER_MULTIEMPRESA = `${dominio}.azurewebsites.net`;\r\n } else if (\r\n process.env.REACT_APP_APP_SISTEMA !== undefined &&\r\n process.env.NODE_ENV === 'development'\r\n ) {\r\n // Dev\r\n configNew.headers.HTTP_REFERER_MULTIEMPRESA = `${dominio}`;\r\n } else {\r\n configNew.headers.HTTP_REFERER_MULTIEMPRESA = `${dominio}.${sistema?.name}.app`;\r\n }\r\n }\r\n\r\n if (token) {\r\n configNew.headers.Authorization = `Bearer ${token}`;\r\n }\r\n\r\n return configNew;\r\n});\r\n\r\nexport default api;\r\n","import { useState, useEffect, Dispatch, SetStateAction } from 'react';\r\n\r\ntype Response = [T, Dispatch>];\r\n\r\nfunction usePersistedState(key: string, initialState: T): Response {\r\n const [state, setState] = useState(initialState);\r\n\r\n useEffect(() => {\r\n const openDB = indexedDB.open('dashboard', 1);\r\n\r\n openDB.onupgradeneeded = () => {\r\n const db = openDB.result;\r\n if (!db.objectStoreNames.contains('store')) {\r\n db.createObjectStore('store');\r\n }\r\n };\r\n\r\n openDB.onsuccess = () => {\r\n const db = openDB.result;\r\n const tx = db.transaction('store', 'readonly');\r\n const store = tx.objectStore('store');\r\n const request = store.get(key);\r\n\r\n request.onsuccess = () => {\r\n const storedValue = request.result;\r\n if (storedValue !== undefined) {\r\n setState(storedValue);\r\n }\r\n };\r\n\r\n tx.oncomplete = () => {\r\n db.close();\r\n };\r\n };\r\n }, [key]);\r\n\r\n useEffect(() => {\r\n const openDB = indexedDB.open('dashboard', 1);\r\n\r\n openDB.onsuccess = () => {\r\n const db = openDB.result;\r\n const tx = db.transaction('store', 'readwrite');\r\n const store = tx.objectStore('store');\r\n store.put(state, key);\r\n\r\n tx.oncomplete = () => {\r\n db.close();\r\n };\r\n };\r\n }, [key, state]);\r\n\r\n return [state, setState];\r\n}\r\n\r\nexport default usePersistedState;\r\n","import React, { createContext, useCallback, useContext } from 'react';\r\n\r\nimport { useSnackbar } from 'notistack';\r\n\r\nimport auth from 'auth';\r\nimport usePersistedState from 'helpers/usePersistedState';\r\nimport api, { ResponseApi } from 'services/api';\r\nimport ConstanteEnderecoWebservice from 'constants/enderecoWebservice';\r\nimport usePersistedStateIndexedDB from 'helpers/usePersistedStateIndexedDB';\r\n\r\nexport interface DadosInterface {\r\n lojaId: string;\r\n identificacao: number;\r\n dataUltimaSincronizacao: Date;\r\n dados: any;\r\n versao: number;\r\n}\r\n\r\nexport interface LojaInterface {\r\n LojaId: string;\r\n NomeFantasia: string;\r\n CidadeUf: string;\r\n DataHoraUltimaSincronizacao: string;\r\n}\r\n\r\ninterface ChartDataContextProps {\r\n chartData: Array;\r\n setChartData: React.Dispatch>;\r\n syncData: (lojaId?: string) => Promise;\r\n loja: LojaInterface;\r\n setLoja: React.Dispatch>;\r\n consultarAposLogin: boolean;\r\n setConsultarAposLogin: React.Dispatch>;\r\n obterVersaoGrafico: (identificacaGrafico: number) => number;\r\n}\r\n\r\nconst ChartDataContext = createContext(\r\n {} as ChartDataContextProps\r\n);\r\n\r\ninterface CharDataContextProviderProps {\r\n children: React.ReactNode;\r\n}\r\n\r\nexport default function LayoutProvider({\r\n children,\r\n}: CharDataContextProviderProps): JSX.Element {\r\n const { enqueueSnackbar } = useSnackbar();\r\n\r\n const [chartData, setChartData] = usePersistedStateIndexedDB<\r\n Array\r\n >('chartDataPersistedState', [{} as DadosInterface]);\r\n\r\n const [loja, setLoja] = usePersistedState(\r\n 'lojaPersistedState',\r\n {} as LojaInterface\r\n );\r\n\r\n const [consultarAposLogin, setConsultarAposLogin] = usePersistedState<\r\n boolean\r\n >('consultaAposLoginPersistedState', false);\r\n\r\n interface DadosGraficos {\r\n lojaId: string;\r\n identificacao: number;\r\n dataUltimaSincronizacao: Date;\r\n dados: any;\r\n versao: number;\r\n }\r\n\r\n const syncData = async (lojaId): Promise => {\r\n let lojaIdConsulta = lojaId;\r\n\r\n if (!lojaIdConsulta) {\r\n const lojaExistente =\r\n auth.getLojas().filter((lojaItem) => lojaItem.LojaId === loja.LojaId)\r\n .length > 0;\r\n\r\n if (lojaExistente) lojaIdConsulta = loja.LojaId;\r\n }\r\n\r\n if (!lojaIdConsulta) {\r\n const primeiraLoja = auth.getLojas()[0];\r\n lojaIdConsulta = primeiraLoja.LojaId;\r\n setLoja(primeiraLoja);\r\n }\r\n\r\n const response = await api.get>>(\r\n ConstanteEnderecoWebservice.GRAFICO_LISTAR,\r\n {\r\n params: {\r\n lojaId: lojaIdConsulta,\r\n },\r\n }\r\n );\r\n\r\n if (response?.sucesso) {\r\n const retornoFormatado = response.dados.map((obj) => ({\r\n ...obj,\r\n dados: JSON.parse(obj.dados).Filtros || JSON.parse(obj.dados).Dias,\r\n }));\r\n\r\n if (!consultarAposLogin) {\r\n setConsultarAposLogin(true);\r\n }\r\n\r\n if (retornoFormatado.length === 0) {\r\n enqueueSnackbar(\r\n 'A loja selecionada não possui informações sincronizadas.',\r\n { variant: 'warning' }\r\n );\r\n\r\n return false;\r\n }\r\n\r\n setChartData(retornoFormatado);\r\n return true;\r\n }\r\n\r\n if (response?.avisos) {\r\n response.avisos.map((item: string) =>\r\n enqueueSnackbar(item, { variant: 'warning' })\r\n );\r\n }\r\n\r\n return false;\r\n };\r\n\r\n const obterVersaoGrafico = useCallback(\r\n (identificacaoGrafico: number): number => {\r\n let versao = 1;\r\n\r\n if (chartData.length > 0) {\r\n const informacoesGraficoPorIdentificacao = chartData.filter(\r\n (item) => item.identificacao === identificacaoGrafico\r\n );\r\n\r\n if (informacoesGraficoPorIdentificacao.length > 0) {\r\n versao = informacoesGraficoPorIdentificacao[0].versao;\r\n }\r\n }\r\n\r\n return versao;\r\n },\r\n [chartData]\r\n );\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\n\r\nexport function useChartData(): ChartDataContextProps {\r\n const context = useContext(ChartDataContext);\r\n\r\n if (!context)\r\n throw new Error('useChartData must be used within a ChartDataProvider.');\r\n\r\n return context;\r\n}\r\n","import React, {\r\n createContext,\r\n useState,\r\n useContext,\r\n useEffect,\r\n useMemo,\r\n} from 'react';\r\nimport { ApplicationInsights } from '@microsoft/applicationinsights-web';\r\n\r\nexport interface DadosInterface {\r\n identificacao: number;\r\n dataUltimaSincronizacao: Date;\r\n dados: any;\r\n}\r\n\r\ninterface LayoutContextProps {\r\n loading: boolean;\r\n setLoading: (value: boolean) => void;\r\n loadingReloadGraficos: boolean;\r\n setLoadingReloadGraficos: (value: boolean) => void;\r\n titlePage: string;\r\n setTitlePage: (value: string) => void;\r\n appInsights: ApplicationInsights;\r\n}\r\n\r\nconst LayoutContext = createContext(\r\n {} as LayoutContextProps\r\n);\r\n\r\ninterface LayoutContextProviderProps {\r\n children: React.ReactNode;\r\n}\r\n\r\nexport default function LayoutProvider({\r\n children,\r\n}: LayoutContextProviderProps): JSX.Element {\r\n const [loading, setLoading] = useState(false);\r\n const [loadingReloadGraficos, setLoadingReloadGraficos] = useState(false);\r\n\r\n const [titlePage, setTitlePage] = useState('Vendas');\r\n\r\n const appInsights = useMemo(\r\n () =>\r\n new ApplicationInsights({\r\n config: {\r\n instrumentationKey: process.env.REACT_APP_APPLICATION_INSIGHTS, // '749cccae-6a15-41f0-920d-2b254674188d',\r\n },\r\n }),\r\n []\r\n );\r\n\r\n // useEffect(() => {\r\n // if (process.env.NODE_ENV === 'production') {\r\n // appInsights.loadAppInsights();\r\n // appInsights.context.application.ver = process.env.REACT_APP_VERSION\r\n // ? process.env.REACT_APP_VERSION\r\n // : '';\r\n // }\r\n // }, [appInsights]);\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\n\r\nexport function useLayout(): LayoutContextProps {\r\n const context = useContext(LayoutContext);\r\n\r\n if (!context)\r\n throw new Error('useLayout must be used within a LayoutProvider.');\r\n\r\n return context;\r\n}\r\n","import { IconButton } from '@material-ui/core';\r\nimport { Close as IconClose } from '@material-ui/icons';\r\nimport { useSnackbar } from 'notistack';\r\nimport * as React from 'react';\r\n\r\nfunction SnackbarCloseButton({ key }) {\r\n const { closeSnackbar } = useSnackbar();\r\n\r\n return (\r\n closeSnackbar(key)}>\r\n \r\n \r\n );\r\n}\r\n\r\nexport default SnackbarCloseButton;\r\n","import React from 'react';\r\nimport { Helmet, HelmetProvider } from 'react-helmet-async';\r\n\r\nimport TipoSistemaEnum from 'constants/enumTipoSistema';\r\nimport auth from 'auth';\r\n\r\nconst HeaderSistema = () => {\r\n const { name: nomeSistema, value: valueSistema } = auth.getSistema();\r\n\r\n const sistemaAtual = nomeSistema[0].toUpperCase() + nomeSistema.slice(1);\r\n\r\n let manifest = '';\r\n\r\n switch (valueSistema) {\r\n case TipoSistemaEnum.ZENDAR:\r\n manifest = TipoSistemaEnum.properties[1].manifest;\r\n break;\r\n case TipoSistemaEnum.POWERSTOCK:\r\n manifest = TipoSistemaEnum.properties[2].manifest;\r\n break;\r\n case TipoSistemaEnum.STI3:\r\n manifest = TipoSistemaEnum.properties[3].manifest;\r\n break;\r\n\r\n default:\r\n manifest = '';\r\n }\r\n return (\r\n \r\n \r\n \r\n \r\n\r\n {sistemaAtual}\r\n\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default HeaderSistema;\r\n","import React, { useEffect } from 'react';\r\nimport { Snackbar, Button } from '@material-ui/core';\r\nimport auth from 'auth';\r\n\r\nconst ServiceWorkerWrapper: React.FC = () => {\r\n const [showReload, setShowReload] = React.useState(false);\r\n\r\n useEffect(() => {\r\n window.addEventListener('pwaUpdated', () => {\r\n setShowReload(true);\r\n });\r\n }, []);\r\n\r\n const reloadPage = () => {\r\n setShowReload(false);\r\n auth.clearTokenAndRedirect();\r\n };\r\n\r\n return (\r\n \r\n Atualizar\r\n \r\n }\r\n />\r\n );\r\n};\r\n\r\nexport default ServiceWorkerWrapper;\r\n","import { createMuiTheme, colors } from '@material-ui/core';\r\nimport shadowsCustom from './shadows';\r\nimport typography from './typography';\r\n\r\nconst theme = createMuiTheme({\r\n palette: {\r\n type: 'dark',\r\n background: {\r\n default: colors.common.white,\r\n paper: colors.common.white,\r\n },\r\n primary: {\r\n main: colors.teal[400],\r\n },\r\n secondary: {\r\n main: colors.common.white,\r\n },\r\n text: {\r\n primary: colors.common.white,\r\n secondary: colors.teal[400],\r\n },\r\n },\r\n shadows: shadowsCustom as any,\r\n typography,\r\n});\r\n\r\nexport default theme;\r\n","export default [\r\n 'none',\r\n '0 0 0 1px rgba(63,63,68,0.05), 0 1px 2px 0 rgba(63,63,68,0.15)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 2px 2px -2px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 3px 4px -2px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 3px 4px -2px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 4px 6px -2px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 4px 6px -2px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 4px 8px -2px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 5px 8px -2px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 6px 12px -4px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 7px 12px -4px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 6px 16px -4px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 7px 16px -4px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 8px 18px -8px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 9px 18px -8px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 10px 20px -8px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 11px 20px -8px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 12px 22px -8px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 13px 22px -8px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 14px 24px -8px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 16px 28px -8px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 18px 30px -8px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 20px 32px -8px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 22px 34px -8px rgba(0,0,0,0.25)',\r\n '0 0 1px 0 rgba(0,0,0,0.31), 0 24px 36px -8px rgba(0,0,0,0.25)',\r\n];\r\n","export default {\r\n // h1: {\r\n // fontWeight: 500,\r\n // fontSize: 35,\r\n // letterSpacing: '-0.24px',\r\n // },\r\n // h2: {\r\n // fontWeight: 500,\r\n // fontSize: 29,\r\n // letterSpacing: '-0.24px',\r\n // },\r\n // h3: {\r\n // fontWeight: 500,\r\n // fontSize: 24,\r\n // letterSpacing: '-0.06px',\r\n // },\r\n // h4: {\r\n // fontWeight: 500,\r\n // fontSize: 20,\r\n // letterSpacing: '-0.06px',\r\n // },\r\n // h5: {\r\n // fontWeight: 500,\r\n // fontSize: 16,\r\n // letterSpacing: '-0.05px',\r\n // },\r\n // h6: {\r\n // fontWeight: 500,\r\n // fontSize: 14,\r\n // letterSpacing: '-0.05px',\r\n // },\r\n // overline: {\r\n // fontWeight: 500,\r\n // },\r\n fontFamily: `\"Nunito\", sans-serif`,\r\n fontSize: 14,\r\n fontWeightLight: 300,\r\n fontWeightRegular: 400,\r\n fontWeightMedium: 500,\r\n};\r\n","import React from 'react';\r\nimport ScaleLoader from 'react-spinners/ScaleLoader';\r\nimport { makeStyles, useTheme } from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n position: 'absolute',\r\n top: '50%',\r\n left: '50%',\r\n marginRight: '-50%',\r\n transform: 'translate(-50%, -50%)',\r\n minWidth: '100%',\r\n minHeight: '100%',\r\n backgroundColor: 'black',\r\n zIndex: 9998,\r\n opacity: '0.8',\r\n },\r\n containerLoading: {\r\n position: 'absolute',\r\n top: '50%',\r\n left: '50%',\r\n marginRight: '-50%',\r\n transform: 'translate(-50%, -50%)',\r\n zIndex: 9999,\r\n },\r\n}));\r\n\r\nconst Loading = () => {\r\n const theme = useTheme();\r\n const classes = useStyles();\r\n\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Loading;\r\n","export default __webpack_public_path__ + \"static/media/sti3-icon.4ab55239.png\";","/* eslint-disable react/require-default-props */\r\nimport React from 'react';\r\n\r\ninterface GenIconInterface extends React.SVGAttributes {\r\n path?: string;\r\n children?: React.ReactNode;\r\n size?: number | string;\r\n}\r\n\r\nconst GenIcon = ({ path, size, children, ...props }: GenIconInterface) => {\r\n return (\r\n \r\n {path && !children && }\r\n {children && !path && children}\r\n \r\n );\r\n};\r\n\r\nexport default GenIcon;\r\n","import React from 'react';\r\nimport { CSSProperties } from 'styled-components';\r\n\r\nimport GenIcon from './GenIcon';\r\n\r\ninterface IconInterface extends React.SVGAttributes {\r\n size?: number;\r\n}\r\n\r\nexport type IconType = (props: IconInterface) => JSX.Element;\r\n\r\nconst Stroke: CSSProperties = {\r\n fill: 'none',\r\n stroke: 'currentColor',\r\n};\r\n\r\nconst StrokeRounded: CSSProperties = {\r\n ...Stroke,\r\n strokeLinecap: 'round',\r\n strokeLinejoin: 'round',\r\n};\r\n\r\nconst Stroke075Rounded: CSSProperties = {\r\n ...StrokeRounded,\r\n strokeWidth: '0.75px',\r\n};\r\n\r\nexport const ProdutosIcon: IconType = ({ size, ...props }) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n);\r\n\r\nexport const PowerStockLogotipo: IconType = ({ size, color, ...props }) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n);\r\n\r\nexport const ZendarCompleto: IconType = ({ size, color, ...props }) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n);\r\n\r\nexport const VendasIcon: IconType = ({ size, ...props }) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n);\r\n\r\nexport const ContasReceberIcon: IconType = ({ size, ...props }) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n);\r\n\r\nexport const ContasPagarIcon: IconType = ({ size, ...props }) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n);\r\n\r\nexport const LojaIcon: IconType = ({ size, ...props }) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n);\r\n\r\nexport const UsuariosIcon: IconType = ({ size, ...props }) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n);\r\n\r\nexport const MenuIcon: IconType = ({ size, ...props }) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n);\r\n","import React from 'react';\r\n\r\nimport logo from 'assets/images/sti3-icon.png';\r\nimport auth from 'auth';\r\nimport TipoSistemaEnum from 'constants/enumTipoSistema';\r\n\r\nimport { ZendarCompleto, PowerStockLogotipo } from 'icons';\r\n\r\nconst Logo: React.FC = () => {\r\n const sistema = auth.getSistema() || '';\r\n\r\n switch (sistema.value) {\r\n case TipoSistemaEnum.ZENDAR:\r\n return (\r\n \r\n );\r\n\r\n case TipoSistemaEnum.POWERSTOCK:\r\n return (\r\n \r\n );\r\n\r\n default:\r\n return (\r\n \r\n );\r\n }\r\n};\r\n\r\nexport default Logo;\r\n","const ConstanteMensagemValidacao = {\r\n CAMPO_OBRIGATORIO: 'O campo é obrigatório',\r\n\r\n EMAIL_INVALIDO: 'O e-mail informado é inválido',\r\n\r\n SENHA_MINIMO_SEIS_CARACTERES: 'A senha deve possuir pelo menos 6 caracteres',\r\n\r\n SENHA_NAO_COINCIDEM: 'As senhas não coincidem',\r\n};\r\n\r\nexport default ConstanteMensagemValidacao;\r\n","import React from 'react';\r\nimport { Controller } from 'react-hook-form';\r\nimport TextField from '@material-ui/core/TextField';\r\nimport { colors, makeStyles, withStyles } from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n inputLabelProps: {\r\n color: colors.grey[400],\r\n },\r\n}));\r\n\r\nconst CssTextField = withStyles((theme) => ({\r\n root: {\r\n '& :not(.Mui-error)': {\r\n '& label.Mui-focused': {\r\n color: theme.palette.primary.main,\r\n },\r\n\r\n '&.MuiOutlinedInput-root': {\r\n '& fieldset': {\r\n borderColor: colors.grey[300],\r\n color: colors.grey[300],\r\n },\r\n '&:hover fieldset :not(.Mui-disabled)': {\r\n borderColor: theme.palette.primary.main,\r\n },\r\n '&.Mui-focused fieldset': {\r\n borderColor: theme.palette.primary.main,\r\n },\r\n '& input:disabled': {\r\n color: colors.grey[200],\r\n background: '#2e3b42',\r\n },\r\n },\r\n },\r\n '& .MuiFormLabel-root.Mui-disabled': {\r\n color: colors.grey[300],\r\n },\r\n },\r\n}))(TextField);\r\n\r\nconst FormInput = (props: any) => {\r\n const classes = useStyles();\r\n const { setValue, ...rest } = props;\r\n const { name, label, control } = props;\r\n\r\n const Input = (\r\n {\r\n if (setValue) {\r\n setValue(name, e.target.value.trim());\r\n }\r\n },\r\n }}\r\n />\r\n );\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default FormInput;\r\n","import { Button, colors, PropTypes } from '@material-ui/core';\r\nimport React from 'react';\r\nimport ScaleLoader from 'react-spinners/ScaleLoader';\r\n\r\ninterface ButtonLoadingProps {\r\n text: string;\r\n loading: boolean;\r\n cor?: string;\r\n size?: 'small' | 'medium' | 'large';\r\n onClick?: () => void;\r\n fullWidth?: boolean;\r\n variant?: 'text' | 'outlined' | 'contained';\r\n color?: PropTypes.Color;\r\n className?: string;\r\n}\r\n\r\nconst ButtonLoading = ({\r\n text,\r\n loading,\r\n cor = colors.teal[400],\r\n size = 'large',\r\n fullWidth = true,\r\n variant = 'contained',\r\n color = 'primary',\r\n className,\r\n ...rest\r\n}: ButtonLoadingProps) => {\r\n const heightLoader = size === 'large' ? '24px' : '12px';\r\n\r\n return (\r\n \r\n \r\n {!loading ? text : ''}\r\n \r\n );\r\n};\r\n\r\nexport default ButtonLoading;\r\n","import React from 'react';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport Link from '@material-ui/core/Link';\r\nimport { colors } from '@material-ui/core';\r\n\r\nconst Copyright: React.FC = () => {\r\n return (\r\n <>\r\n \r\n {'Copyright © '}\r\n \r\n STi3 Sistemas\r\n {' '}\r\n {new Date().getFullYear()}.\r\n \r\n \r\n );\r\n};\r\n\r\nexport default Copyright;\r\n","import React, { useState } from 'react';\r\nimport { Controller } from 'react-hook-form';\r\nimport {\r\n colors,\r\n FormHelperText,\r\n makeStyles,\r\n withStyles,\r\n} from '@material-ui/core';\r\nimport FormControl from '@material-ui/core/FormControl';\r\nimport InputLabel from '@material-ui/core/InputLabel';\r\nimport InputAdornment from '@material-ui/core/InputAdornment';\r\nimport OutlinedInput from '@material-ui/core/OutlinedInput';\r\nimport IconButton from '@material-ui/core/IconButton';\r\nimport Visibility from '@material-ui/icons/Visibility';\r\nimport VisibilityOff from '@material-ui/icons/VisibilityOff';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n inputLabelProps: {\r\n color: colors.grey[400],\r\n },\r\n}));\r\n\r\nconst CssTextField = withStyles((theme) => ({\r\n root: {\r\n '& :not(.Mui-error)': {\r\n '& label.Mui-focused': {\r\n color: theme.palette.primary.main,\r\n },\r\n\r\n '&.MuiOutlinedInput-root': {\r\n '& fieldset': {\r\n borderColor: colors.grey[300],\r\n color: colors.grey[300],\r\n },\r\n '&:hover fieldset :not(.Mui-disabled)': {\r\n borderColor: theme.palette.primary.main,\r\n },\r\n '&.Mui-focused fieldset': {\r\n borderColor: theme.palette.primary.main,\r\n },\r\n '& input:disabled': {\r\n color: colors.grey[200],\r\n background: '#2e3b42',\r\n },\r\n },\r\n },\r\n '& .MuiFormLabel-root.Mui-disabled': {\r\n color: colors.grey[300],\r\n },\r\n },\r\n}))(FormControl);\r\n\r\nconst FormInputPassword = (props: any) => {\r\n const classes = useStyles();\r\n\r\n const {\r\n name,\r\n label,\r\n control,\r\n error,\r\n messageError,\r\n autoComplete,\r\n labelWidth,\r\n required,\r\n } = props;\r\n const [showPassword, setShowPassword] = useState(false);\r\n\r\n const Input = (\r\n \r\n {label}\r\n \r\n setShowPassword(!showPassword)}\r\n edge=\"end\"\r\n color=\"secondary\"\r\n >\r\n {showPassword ? : }\r\n \r\n \r\n }\r\n labelWidth={labelWidth}\r\n />\r\n }\r\n name={name}\r\n control={control}\r\n />\r\n\r\n {error && {messageError}}\r\n \r\n );\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default FormInputPassword;\r\n","const ConstanteRotas = {\r\n LOGIN: '/',\r\n RECUPERAR_SENHA: '/recuperar-senha',\r\n REDEFINIR_SENHA: '/redefinir-senha',\r\n VENDAS_POR_LOJA: '/vendas-por-loja',\r\n VENDAS_TODAS_LOJAS: '/vendas-todas-lojas',\r\n PRODUTOS: '/produtos',\r\n CONTAS_PAGAR: '/contas-pagar',\r\n CONTAS_RECEBER: '/contas-receber',\r\n CONFIRMAR_EMAIL: '/confirmar-email',\r\n};\r\n\r\nexport default ConstanteRotas;\r\n\r\nexport const SubstituirParametroRota = (\r\n route: string,\r\n paramName: string,\r\n value: string\r\n) => {\r\n return route.replace(`:${paramName}`, value);\r\n};\r\n","/* eslint-disable no-restricted-syntax */\r\n/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React, { useCallback, useState } from 'react';\r\nimport { useHistory } from 'react-router-dom';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport Logo from 'components/Logo';\r\nimport {\r\n colors,\r\n Container,\r\n Box,\r\n Grid,\r\n Link,\r\n Checkbox,\r\n FormControlLabel,\r\n Typography,\r\n} from '@material-ui/core';\r\n\r\nimport * as yup from 'yup';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport ConstanteMensagemValidacao from 'constants/mensagensValidacoes';\r\nimport { useForm } from 'react-hook-form';\r\nimport FormInput from 'components/FormInput';\r\nimport ButtonLoading from 'components/Button/ButtonLoading';\r\nimport auth from 'auth';\r\nimport Copyright from 'components/Copyright';\r\nimport FormInputPassword from 'components/FormInputPassword';\r\nimport api, { ResponseApi } from 'services/api';\r\nimport ConstanteEnderecoWebservice from 'constants/enderecoWebservice';\r\nimport { useSnackbar } from 'notistack';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport ConstanteRotas from 'constants/rotas';\r\nimport TipoSistemaEnum from 'constants/enumTipoSistema';\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n paper: {\r\n marginTop: '50px',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n },\r\n form: {\r\n width: '100%',\r\n marginTop: theme.spacing(1),\r\n },\r\n submit: {\r\n margin: theme.spacing(3, 0, 2),\r\n },\r\n dialog: {\r\n background: colors.blueGrey[800],\r\n color: '#fff',\r\n },\r\n}));\r\n\r\nconst schema = yup.object().shape({\r\n email: yup.lazy((_, params) => {\r\n const { isSti3 } = params.parent;\r\n if (isSti3) {\r\n return yup\r\n .string()\r\n .required(ConstanteMensagemValidacao.CAMPO_OBRIGATORIO)\r\n .email(ConstanteMensagemValidacao.EMAIL_INVALIDO);\r\n }\r\n return yup.string();\r\n }),\r\n usuario: yup.lazy((_, params) => {\r\n const { isSti3 } = params.parent;\r\n if (!isSti3) {\r\n return yup\r\n .string()\r\n .required(ConstanteMensagemValidacao.CAMPO_OBRIGATORIO);\r\n }\r\n return yup.string();\r\n }),\r\n senha: yup.string().required(ConstanteMensagemValidacao.CAMPO_OBRIGATORIO),\r\n dominio: yup.lazy((_, params) => {\r\n const { isSti3 } = params.parent;\r\n if (!isSti3) {\r\n return yup\r\n .string()\r\n .required(ConstanteMensagemValidacao.CAMPO_OBRIGATORIO);\r\n }\r\n return yup.string();\r\n }),\r\n lembrarSenha: yup.boolean(),\r\n});\r\n\r\nconst rememberLogin = auth.getRememberLogin();\r\n\r\ninterface RetornoLogin {\r\n token: string;\r\n refreshToken: string;\r\n validadeToken: Date;\r\n validadeRefreshToken: Date;\r\n versaoAplicativoDesatualizada: boolean;\r\n}\r\n\r\nconst Login: React.FC = () => {\r\n const { enqueueSnackbar } = useSnackbar();\r\n const classes = useStyles();\r\n const history = useHistory();\r\n const [loading, setLoading] = useState(false);\r\n const { setConsultarAposLogin } = useChartData();\r\n\r\n const sistema = auth.getSistema() || '';\r\n\r\n const sistemaIsZendarOrPowerstock = sistema.value !== TipoSistemaEnum.STI3;\r\n\r\n const loginEnderecoWebService = sistemaIsZendarOrPowerstock\r\n ? ConstanteEnderecoWebservice.AUTENTICACAO_INTEGRACAO_LOGIN\r\n : ConstanteEnderecoWebservice.AUTENTICACAO_LOGIN;\r\n\r\n const logoffEnderecoWebService = sistemaIsZendarOrPowerstock\r\n ? ConstanteEnderecoWebservice.AUTENTICACAO_INTEGRACAO_LOGOFF\r\n : ConstanteEnderecoWebservice.AUTENTICACAO_LOGOFF;\r\n\r\n const { handleSubmit, errors, control, register, setValue } = useForm({\r\n resolver: yupResolver(schema),\r\n defaultValues: rememberLogin,\r\n });\r\n\r\n const tratarResponse = (response: ResponseApi, dominio) => {\r\n if (response.sucesso) {\r\n auth.setAplicacaoDesatualizada(\r\n response.dados.versaoAplicativoDesatualizada\r\n );\r\n\r\n // Forçar atualização Safari < 13.0\r\n if (auth.getAplicacaoDesatualizada().count > 1) {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.getRegistrations().then((registrations) => {\r\n for (const registration of registrations) {\r\n registration.update();\r\n }\r\n });\r\n }\r\n }\r\n\r\n setConsultarAposLogin(false);\r\n auth.setToken(response.dados);\r\n\r\n history.push(ConstanteRotas.VENDAS_TODAS_LOJAS);\r\n\r\n return;\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.map((item: string) =>\r\n enqueueSnackbar(item, { variant: 'warning' })\r\n );\r\n }\r\n\r\n setLoading(false);\r\n };\r\n\r\n const onSubmit = handleSubmit(async (data) => {\r\n setLoading(true);\r\n auth.setDominio(data?.dominio);\r\n\r\n if (data.lembrarSenha) {\r\n auth.setRememberLogin(data);\r\n } else {\r\n auth.removeRememberLogin();\r\n }\r\n\r\n const dataLogin = {\r\n ...data,\r\n dominio: `${data?.dominio}.${sistema.name}.app`,\r\n versaoAplicativo: process.env.REACT_APP_VERSION,\r\n };\r\n\r\n const response = await api.post>(\r\n loginEnderecoWebService,\r\n dataLogin\r\n );\r\n\r\n setLoading(false);\r\n\r\n if (response.sucesso) {\r\n tratarResponse(response, data?.dominio);\r\n return;\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.map((item: string) =>\r\n enqueueSnackbar(item, { variant: 'warning' })\r\n );\r\n }\r\n });\r\n\r\n const logOff = useCallback(async () => {\r\n await api.post(logoffEnderecoWebService);\r\n\r\n auth.clearToken();\r\n }, [logoffEnderecoWebService]);\r\n\r\n React.useEffect(() => {\r\n if (auth.autenticado()) {\r\n logOff();\r\n }\r\n }, [logOff]);\r\n\r\n return (\r\n \r\n \r\n
\r\n \r\n
\r\n {sistemaIsZendarOrPowerstock && (\r\n \r\n )}\r\n {sistemaIsZendarOrPowerstock ? (\r\n \r\n ) : (\r\n \r\n )}\r\n\r\n \r\n }\r\n label=\"\"\r\n style={{ color: '#fff', display: 'none' }}\r\n />\r\n \r\n\r\n \r\n }\r\n label=\"Lembrar login?\"\r\n style={{ color: '#fff' }}\r\n />\r\n \r\n \r\n \r\n history.push('/recuperar-senha')}\r\n variant=\"body2\"\r\n color=\"secondary\"\r\n style={{ cursor: 'pointer' }}\r\n >\r\n Esqueceu a senha?\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n Versão {process.env.REACT_APP_VERSION}\r\n \r\n \r\n
\r\n \r\n );\r\n};\r\n\r\nexport default Login;\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React, { useState } from 'react';\r\nimport { useHistory } from 'react-router-dom';\r\nimport Link from '@material-ui/core/Link';\r\nimport Grid from '@material-ui/core/Grid';\r\nimport Box from '@material-ui/core/Box';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport Container from '@material-ui/core/Container';\r\nimport Logo from 'components/Logo';\r\nimport * as yup from 'yup';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport ConstanteMensagemValidacao from 'constants/mensagensValidacoes';\r\nimport { useForm } from 'react-hook-form';\r\nimport FormInput from 'components/FormInput';\r\nimport ButtonLoading from 'components/Button/ButtonLoading';\r\nimport { useSnackbar } from 'notistack';\r\nimport Copyright from 'components/Copyright';\r\nimport api, { ResponseApi } from 'services/api';\r\nimport ConstanteEnderecoWebservice from 'constants/enderecoWebservice';\r\nimport ConstanteRotas from 'constants/rotas';\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n paper: {\r\n marginTop: '50px',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n },\r\n form: {\r\n width: '100%',\r\n marginTop: theme.spacing(1),\r\n },\r\n submit: {\r\n margin: theme.spacing(3, 0, 2),\r\n },\r\n typography: {\r\n marginTop: theme.spacing(1),\r\n },\r\n}));\r\n\r\nconst schema = yup.object().shape({\r\n email: yup\r\n .string()\r\n .required(ConstanteMensagemValidacao.CAMPO_OBRIGATORIO)\r\n .email(ConstanteMensagemValidacao.EMAIL_INVALIDO),\r\n});\r\n\r\nconst RecuperarSenha: React.FC = () => {\r\n const classes = useStyles();\r\n const history = useHistory();\r\n const [loading, setLoading] = useState(false);\r\n\r\n const { handleSubmit, errors, control, setValue } = useForm({\r\n resolver: yupResolver(schema),\r\n });\r\n\r\n const { enqueueSnackbar } = useSnackbar();\r\n\r\n const onSubmit = handleSubmit(async (data) => {\r\n setLoading(true);\r\n\r\n const response = await api.post>(\r\n `${ConstanteEnderecoWebservice.AUTENTICACAO_RECUPERAR_SENHA}${data.email}`\r\n );\r\n\r\n setLoading(false);\r\n\r\n if (response.sucesso) {\r\n enqueueSnackbar('E-mail para recuperação de senha enviado com sucesso.', {\r\n variant: 'success',\r\n });\r\n history.push(ConstanteRotas.LOGIN);\r\n return;\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.map((item: string) =>\r\n enqueueSnackbar(item, { variant: 'warning' })\r\n );\r\n }\r\n });\r\n\r\n return (\r\n \r\n \r\n
\r\n \r\n \r\n Esqueceu a senha?\r\n \r\n \r\n Informe o endereço de e-mail que você utilizou no cadastro para\r\n receber instruções sobre como redefinir sua senha.\r\n \r\n
\r\n \r\n\r\n \r\n \r\n \r\n history.push(ConstanteRotas.LOGIN)}\r\n variant=\"body2\"\r\n color=\"secondary\"\r\n style={{ cursor: 'pointer' }}\r\n >\r\n Lembrei a senha!\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n
\r\n \r\n );\r\n};\r\n\r\nexport default RecuperarSenha;\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React, { useState } from 'react';\r\nimport { useHistory, useLocation } from 'react-router-dom';\r\nimport Link from '@material-ui/core/Link';\r\nimport Grid from '@material-ui/core/Grid';\r\nimport Box from '@material-ui/core/Box';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport Container from '@material-ui/core/Container';\r\nimport Logo from 'components/Logo';\r\nimport * as yup from 'yup';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport ConstanteMensagemValidacao from 'constants/mensagensValidacoes';\r\nimport { useForm } from 'react-hook-form';\r\nimport ButtonLoading from 'components/Button/ButtonLoading';\r\nimport { useSnackbar } from 'notistack';\r\nimport Copyright from 'components/Copyright';\r\nimport FormInputPassword from 'components/FormInputPassword';\r\nimport ConstanteEnderecoWebservice from 'constants/enderecoWebservice';\r\nimport api, { ResponseApi } from 'services/api';\r\nimport ConstanteRotas from 'constants/rotas';\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n paper: {\r\n marginTop: '50px',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n },\r\n form: {\r\n width: '100%',\r\n marginTop: theme.spacing(1),\r\n },\r\n submit: {\r\n margin: theme.spacing(3, 0, 2),\r\n },\r\n typography: {\r\n marginTop: theme.spacing(1),\r\n },\r\n}));\r\n\r\nconst schema = yup.object().shape({\r\n senha: yup.string().required(ConstanteMensagemValidacao.CAMPO_OBRIGATORIO),\r\n confirmarSenha: yup\r\n .string()\r\n .required(ConstanteMensagemValidacao.CAMPO_OBRIGATORIO)\r\n .oneOf(\r\n [yup.ref('senha'), ''],\r\n ConstanteMensagemValidacao.SENHA_NAO_COINCIDEM\r\n ),\r\n});\r\n\r\nconst RedefinirSenha: React.FC = () => {\r\n const classes = useStyles();\r\n const history = useHistory();\r\n const [loading, setLoading] = useState(false);\r\n\r\n const location = useLocation();\r\n const query = new URLSearchParams(location.search);\r\n\r\n let nome = query.get('nome');\r\n nome = decodeURIComponent(nome as string);\r\n\r\n let email = query.get('email');\r\n email = decodeURIComponent(email as string);\r\n\r\n const { handleSubmit, errors, control } = useForm({\r\n resolver: yupResolver(schema),\r\n });\r\n\r\n const { enqueueSnackbar } = useSnackbar();\r\n\r\n const onSubmit = handleSubmit(async (data) => {\r\n setLoading(true);\r\n\r\n let token = query.get('token');\r\n\r\n token = decodeURIComponent(token as string);\r\n\r\n const dataPut = {\r\n token,\r\n email,\r\n novaSenha: data.senha,\r\n };\r\n\r\n const response = await api.put(\r\n ConstanteEnderecoWebservice.AUTENTICACAO_ALTERAR_SENHA,\r\n dataPut\r\n );\r\n\r\n setLoading(false);\r\n\r\n if (response.sucesso) {\r\n enqueueSnackbar(\r\n 'Senha redefinida com sucesso. Agora você já pode acessar o sistema com a nova senha.',\r\n {\r\n variant: 'success',\r\n }\r\n );\r\n history.push(ConstanteRotas.LOGIN);\r\n return;\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.map((item: string) =>\r\n enqueueSnackbar(item, { variant: 'warning' })\r\n );\r\n }\r\n });\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n Olá {nome}, cadastre uma nova senha!\r\n \r\n
\r\n \r\n\r\n \r\n\r\n \r\n \r\n \r\n history.push(ConstanteRotas.LOGIN)}\r\n variant=\"body2\"\r\n color=\"secondary\"\r\n style={{ cursor: 'pointer' }}\r\n >\r\n Voltar para o login!\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nexport default RedefinirSenha;\r\n","/* eslint-disable jsx-a11y/anchor-is-valid */\r\nimport React, { useCallback, useEffect, useState } from 'react';\r\nimport { useHistory, useLocation } from 'react-router-dom';\r\nimport Box from '@material-ui/core/Box';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport { makeStyles, useTheme } from '@material-ui/core/styles';\r\nimport Container from '@material-ui/core/Container';\r\nimport Logo from 'components/Logo';\r\nimport { useSnackbar } from 'notistack';\r\nimport Copyright from 'components/Copyright';\r\nimport ConstanteEnderecoWebservice from 'constants/enderecoWebservice';\r\nimport api, { ResponseApi } from 'services/api';\r\nimport ConstanteRotas from 'constants/rotas';\r\nimport ScaleLoader from 'react-spinners/ScaleLoader';\r\nimport auth from 'auth';\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n paper: {\r\n marginTop: '50px',\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n },\r\n typography: {\r\n marginTop: theme.spacing(1),\r\n marginBottom: theme.spacing(3),\r\n },\r\n}));\r\n\r\nconst ConfirmarEmail: React.FC = () => {\r\n const classes = useStyles();\r\n const theme = useTheme();\r\n\r\n const history = useHistory();\r\n const [loading, setLoading] = useState(false);\r\n\r\n const location = useLocation();\r\n\r\n const { enqueueSnackbar } = useSnackbar();\r\n\r\n const confirmarEmail = useCallback(async () => {\r\n setLoading(true);\r\n\r\n const query = new URLSearchParams(location.search);\r\n\r\n let email = query.get('email');\r\n email = decodeURIComponent(email as string);\r\n\r\n let token = query.get('token');\r\n\r\n token = decodeURIComponent(token as string);\r\n\r\n const response = await api.put>(\r\n ConstanteEnderecoWebservice.USUARIO_CONFIRMAR_EMAIL,\r\n { token, email }\r\n );\r\n\r\n setLoading(false);\r\n\r\n if (response.sucesso) {\r\n enqueueSnackbar('Seu e-email foi confirmado com sucesso.', {\r\n variant: 'success',\r\n });\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.map((item: string) =>\r\n enqueueSnackbar(item, { variant: 'warning' })\r\n );\r\n }\r\n\r\n history.push(ConstanteRotas.LOGIN);\r\n }, [enqueueSnackbar, history, location.search]);\r\n\r\n useEffect(() => {\r\n confirmarEmail();\r\n }, [confirmarEmail]);\r\n\r\n return (\r\n <>\r\n {loading && (\r\n \r\n
\r\n \r\n \r\n Estamos confirmando o seu e-mail.\r\n \r\n \r\n Aguarde...\r\n \r\n \r\n
\r\n \r\n \r\n \r\n
\r\n )}\r\n \r\n );\r\n};\r\n\r\nexport default ConfirmarEmail;\r\n","import React from 'react';\r\nimport {\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n DialogContentText,\r\n Button,\r\n} from '@material-ui/core';\r\n\r\ninterface PropsDialog {\r\n title?: string;\r\n contentText: string;\r\n handleOK: () => void;\r\n dialogOpen: boolean;\r\n setDialogOpen: React.Dispatch>;\r\n}\r\n\r\nconst DialogConfirm = ({\r\n title,\r\n contentText,\r\n handleOK,\r\n dialogOpen,\r\n setDialogOpen,\r\n}: PropsDialog) => {\r\n return (\r\n setDialogOpen(false)}\r\n aria-labelledby=\"alert-dialog-title\"\r\n aria-describedby=\"alert-dialog-description\"\r\n >\r\n {title && {title}}\r\n\r\n \r\n \r\n {contentText}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default DialogConfirm;\r\n","import React from 'react';\r\nimport { Slide } from '@material-ui/core';\r\nimport { TransitionProps } from '@material-ui/core/transitions/transition';\r\n\r\nconst Transition = React.forwardRef(function Transition(\r\n props: TransitionProps & { children?: React.ReactElement },\r\n ref: React.Ref\r\n) {\r\n return ;\r\n});\r\n\r\nexport default Transition;\r\n","import {\r\n colors,\r\n createStyles,\r\n IconButton,\r\n makeStyles,\r\n Menu,\r\n MenuItem,\r\n Theme,\r\n} from '@material-ui/core';\r\nimport React from 'react';\r\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\r\nimport EditIcon from '@material-ui/icons/Edit';\r\nimport DeleteIcon from '@material-ui/icons/Delete';\r\nimport EmailIcon from '@material-ui/icons/Email';\r\nimport LockIcon from '@material-ui/icons/Lock';\r\nimport Zoom from '@material-ui/core/Zoom';\r\nimport { UsuarioInterface } from 'components/GerenciarUsuario';\r\nimport auth from 'auth';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n paperMenu: {\r\n background: colors.grey[900],\r\n },\r\n iconAction: {\r\n marginRight: theme.spacing(1),\r\n },\r\n })\r\n);\r\n\r\ninterface ButtonMoreProps {\r\n usuario: UsuarioInterface;\r\n handleAlterar: (usuario) => void;\r\n handleExcluir: (usuario) => void;\r\n handleResetSenha: (usuario) => void;\r\n handleReenviarEmailConfirmacao: (usuario) => void;\r\n}\r\n\r\nconst ButtonLoading = ({\r\n usuario,\r\n handleAlterar,\r\n handleExcluir,\r\n handleResetSenha,\r\n handleReenviarEmailConfirmacao,\r\n}: ButtonMoreProps) => {\r\n const classes = useStyles();\r\n\r\n const [anchorEl, setAnchorEl] = React.useState(null);\r\n const usuarioLogadoId = auth.usuarioId();\r\n\r\n const handleCloseMenuOpcoes = () => {\r\n setAnchorEl(null);\r\n };\r\n\r\n return (\r\n
\r\n setAnchorEl(e.currentTarget)}\r\n >\r\n \r\n \r\n\r\n \r\n {\r\n handleAlterar(usuario.id);\r\n handleCloseMenuOpcoes();\r\n }}\r\n >\r\n \r\n Alterar\r\n \r\n {usuarioLogadoId !== usuario.id && (\r\n {\r\n handleExcluir(usuario);\r\n handleCloseMenuOpcoes();\r\n }}\r\n >\r\n \r\n Excluir\r\n \r\n )}\r\n {\r\n handleResetSenha(usuario);\r\n handleCloseMenuOpcoes();\r\n }}\r\n >\r\n \r\n Alterar senha\r\n \r\n {!usuario.emailConfirmed && (\r\n {\r\n handleReenviarEmailConfirmacao(usuario);\r\n handleCloseMenuOpcoes();\r\n }}\r\n >\r\n \r\n Reenviar confirmação de e-mail\r\n \r\n )}\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default ButtonLoading;\r\n","import React from 'react';\r\nimport { Controller } from 'react-hook-form';\r\nimport {\r\n colors,\r\n FormHelperText,\r\n makeStyles,\r\n NativeSelect,\r\n withStyles,\r\n} from '@material-ui/core';\r\nimport FormControl from '@material-ui/core/FormControl';\r\nimport InputLabel from '@material-ui/core/InputLabel';\r\nimport OutlinedInput from '@material-ui/core/OutlinedInput';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n inputLabelProps: {\r\n color: colors.grey[400],\r\n },\r\n option: {\r\n backgroundColor: `${colors.blueGrey[700]} !important`,\r\n },\r\n}));\r\n\r\nconst CssTextField = withStyles((theme) => ({\r\n root: {\r\n '& :not(.Mui-error)': {\r\n '& label.Mui-focused': {\r\n color: theme.palette.primary.main,\r\n },\r\n\r\n '&.MuiOutlinedInput-root': {\r\n '& fieldset': {\r\n borderColor: colors.grey[300],\r\n color: colors.grey[300],\r\n },\r\n '&:hover fieldset :not(.Mui-disabled)': {\r\n borderColor: theme.palette.primary.main,\r\n },\r\n '&.Mui-focused fieldset': {\r\n borderColor: theme.palette.primary.main,\r\n },\r\n '& input:disabled': {\r\n color: 'red',\r\n background: '#2e3b42',\r\n },\r\n },\r\n },\r\n '& .MuiFormLabel-root.Mui-disabled': {\r\n color: colors.grey[300],\r\n },\r\n },\r\n}))(FormControl);\r\n\r\ninterface Props {\r\n name: string;\r\n label: string;\r\n control: any;\r\n error?: any;\r\n messageError?: string;\r\n labelWidth: number;\r\n optionsList: Array | undefined;\r\n autoFocus?: boolean;\r\n}\r\n\r\ninterface PropsOptionList {\r\n value: string;\r\n description: string;\r\n}\r\n\r\nconst FormInputSelect = (props: Props) => {\r\n const classes = useStyles();\r\n\r\n const {\r\n name,\r\n label,\r\n control,\r\n error,\r\n messageError,\r\n labelWidth,\r\n optionsList,\r\n autoFocus,\r\n } = props;\r\n\r\n const Input = (\r\n \r\n {label}\r\n \r\n }\r\n >\r\n \r\n ))}\r\n \r\n }\r\n name={name}\r\n control={control}\r\n />\r\n\r\n {error && {messageError}}\r\n \r\n );\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default FormInputSelect;\r\n","import React from 'react';\r\nimport { createStyles, makeStyles } from '@material-ui/core/styles';\r\nimport Dialog from '@material-ui/core/Dialog';\r\nimport {\r\n Badge,\r\n Button,\r\n colors,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n IconButton,\r\n} from '@material-ui/core';\r\nimport { Tune } from '@material-ui/icons';\r\nimport Transition from 'components/TransitionDefault';\r\nimport FormInputSelect from 'components/FormInputSelect';\r\nimport auth from 'auth';\r\nimport FormInput from 'components/FormInput';\r\n\r\nconst useStyles = makeStyles(() =>\r\n createStyles({\r\n body: {\r\n background: colors.grey[800],\r\n height: '100%',\r\n },\r\n formSearch: {\r\n height: '100%',\r\n },\r\n dialog: {\r\n background: colors.blueGrey[800],\r\n color: '#fff',\r\n },\r\n })\r\n);\r\n\r\nconst FiltroUsuario = ({ ...props }) => {\r\n const { control, reset, actionHandle, getValues } = props;\r\n const classes = useStyles();\r\n const [open, setOpen] = React.useState(false);\r\n const [quantidadeFiltros, setQuantidadeFiltros] = React.useState(0);\r\n const [filtroOriginal, setFiltroOriginal] = React.useState(getValues());\r\n\r\n const handleClickOpen = () => {\r\n setOpen(true);\r\n setFiltroOriginal(getValues());\r\n };\r\n\r\n const handleClose = () => {\r\n setOpen(false);\r\n reset(filtroOriginal);\r\n };\r\n\r\n const handleFiltrar = () => {\r\n actionHandle();\r\n setOpen(false);\r\n\r\n const { loja, nome, email } = getValues();\r\n\r\n let quantidadeFiltrosAtualizada = 0;\r\n\r\n if (loja) quantidadeFiltrosAtualizada += 1;\r\n\r\n if (nome) quantidadeFiltrosAtualizada += 1;\r\n\r\n if (email) quantidadeFiltrosAtualizada += 1;\r\n\r\n setQuantidadeFiltros(quantidadeFiltrosAtualizada);\r\n };\r\n\r\n return (\r\n <>\r\n handleClickOpen()}\r\n color=\"secondary\"\r\n >\r\n \r\n \r\n \r\n \r\n \r\n Filtrar usuários\r\n \r\n
\r\n {\r\n return {\r\n value: loja.LojaId,\r\n description: `${loja.NomeFantasia} (${loja.CidadeUf})`,\r\n };\r\n })}\r\n />\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default FiltroUsuario;\r\n","import React from 'react';\r\nimport { Controller } from 'react-hook-form';\r\nimport Autocomplete from '@material-ui/lab/Autocomplete';\r\n\r\nconst FormInputAutoComplete = ({\r\n options,\r\n getOptionLabel,\r\n control,\r\n defaultValue,\r\n name,\r\n renderOption,\r\n renderInput,\r\n noOptionsText,\r\n}) => {\r\n return (\r\n (\r\n onChange(data)}\r\n {...props}\r\n />\r\n )}\r\n onChange={([, data]) => data}\r\n defaultValue={defaultValue}\r\n name={name}\r\n control={control}\r\n />\r\n );\r\n};\r\n\r\nexport default FormInputAutoComplete;\r\n","import React, { useCallback, useEffect, useState } from 'react';\r\nimport {\r\n createStyles,\r\n Theme,\r\n makeStyles,\r\n withStyles,\r\n} from '@material-ui/core/styles';\r\nimport Dialog from '@material-ui/core/Dialog';\r\nimport {\r\n AppBar,\r\n Button,\r\n Checkbox,\r\n colors,\r\n DialogContent,\r\n FormControlLabel,\r\n FormHelperText,\r\n Grid,\r\n IconButton,\r\n Popover,\r\n TextField,\r\n Toolbar,\r\n Typography,\r\n} from '@material-ui/core';\r\nimport { ArrowBack, HelpOutline } from '@material-ui/icons';\r\nimport Transition from 'components/TransitionDefault';\r\nimport auth from 'auth';\r\nimport FormInput from 'components/FormInput';\r\nimport { useForm } from 'react-hook-form';\r\nimport ButtonLoading from 'components/Button/ButtonLoading';\r\nimport FormInputPassword from 'components/FormInputPassword';\r\nimport api, { ResponseApi } from 'services/api';\r\nimport ConstanteEnderecoWebservice from 'constants/enderecoWebservice';\r\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\r\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\r\nimport FormInputAutoComplete from 'components/FormInputAutoComplete';\r\nimport ConstanteMensagemValidacao from 'constants/mensagensValidacoes';\r\nimport * as yup from 'yup';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport { useSnackbar } from 'notistack';\r\nimport Loading from 'components/Loading';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n appBar: {\r\n position: 'relative',\r\n background: theme.palette.primary.main,\r\n },\r\n title: {\r\n marginLeft: theme.spacing(2),\r\n flex: 1,\r\n },\r\n body: {\r\n height: '100%',\r\n '& .MuiDialogContent-root': {\r\n padding: '0px',\r\n background: colors.grey[800],\r\n },\r\n },\r\n dialog: {\r\n background: colors.blueGrey[800],\r\n color: colors.common.white,\r\n },\r\n form: {\r\n background: colors.grey[800],\r\n padding: theme.spacing(1, 2, 1, 2),\r\n height: '100%',\r\n },\r\n formControl: {\r\n marginTop: theme.spacing(2),\r\n },\r\n radioButton: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n },\r\n helpMessage: {\r\n background: colors.grey[700],\r\n },\r\n typographyHelp: {\r\n padding: theme.spacing(2),\r\n },\r\n })\r\n);\r\n\r\ninterface LojaInterface {\r\n id: string;\r\n nomeFantasia: string;\r\n cidade: string;\r\n uf: string;\r\n}\r\n\r\nconst CssTextField = withStyles((theme) => ({\r\n root: {\r\n '& :not(.Mui-error)': {\r\n '&.Mui-focused.MuiInputLabel-asterisk, &.Mui-focused.MuiInputLabel-outlined': {\r\n color: theme.palette.primary.main,\r\n },\r\n '&.MuiInputLabel-outlined': {\r\n color: colors.grey[400],\r\n '&.MuiInputLabel-asterisk': {\r\n color: colors.grey[400],\r\n },\r\n },\r\n\r\n '&.MuiOutlinedInput-root': {\r\n '& fieldset': {\r\n borderColor: colors.grey[300],\r\n color: colors.grey[300],\r\n },\r\n '&:hover fieldset :not(.Mui-disabled)': {\r\n borderColor: theme.palette.primary.main,\r\n },\r\n '&.Mui-focused fieldset': {\r\n borderColor: theme.palette.primary.main,\r\n },\r\n '& input:disabled': {\r\n color: colors.grey[200],\r\n background: '#2e3b42',\r\n },\r\n },\r\n },\r\n '& .MuiFormLabel-root.Mui-disabled': {\r\n color: colors.grey[300],\r\n },\r\n },\r\n}))(TextField);\r\n\r\nconst icon = ;\r\nconst checkedIcon = ;\r\n\r\nconst schema = yup.object().shape({\r\n nome: yup.string().required(ConstanteMensagemValidacao.CAMPO_OBRIGATORIO),\r\n email: yup\r\n .string()\r\n .required(ConstanteMensagemValidacao.CAMPO_OBRIGATORIO)\r\n .email(ConstanteMensagemValidacao.EMAIL_INVALIDO),\r\n senha: yup\r\n .string()\r\n .required(ConstanteMensagemValidacao.CAMPO_OBRIGATORIO)\r\n .min(6, ConstanteMensagemValidacao.SENHA_MINIMO_SEIS_CARACTERES),\r\n confirmarSenha: yup\r\n .string()\r\n .required(ConstanteMensagemValidacao.CAMPO_OBRIGATORIO)\r\n .oneOf(\r\n [yup.ref('senha'), ''],\r\n ConstanteMensagemValidacao.SENHA_NAO_COINCIDEM\r\n ),\r\n lojas: yup.array().min(1, ConstanteMensagemValidacao.CAMPO_OBRIGATORIO),\r\n});\r\n\r\ninterface PropsDialog {\r\n dialogOpen: boolean;\r\n setDialogOpen: React.Dispatch>;\r\n handleDialogClose: () => void;\r\n}\r\n\r\nconst InserirUsuario = ({\r\n dialogOpen,\r\n setDialogOpen,\r\n handleDialogClose,\r\n}: PropsDialog) => {\r\n const classes = useStyles();\r\n const [lojas, setLojas] = useState([] as Array);\r\n const [anchorElHelp, setAnchorElHelp] = React.useState(null);\r\n const [showLojas, setShowLojas] = React.useState(true);\r\n const { enqueueSnackbar } = useSnackbar();\r\n const [loading, setLoading] = React.useState(false);\r\n\r\n const {\r\n handleSubmit,\r\n control,\r\n setValue,\r\n register,\r\n errors,\r\n trigger,\r\n reset,\r\n } = useForm({\r\n resolver: yupResolver(schema),\r\n defaultValues: {\r\n nome: '',\r\n email: '',\r\n senha: '',\r\n confirmarSenha: '',\r\n administrador: false,\r\n lojas: [] as Array,\r\n },\r\n });\r\n\r\n const openHelp = Boolean(anchorElHelp);\r\n\r\n const handleClickOpenHelp = (event) => {\r\n setAnchorElHelp(event.currentTarget);\r\n };\r\n\r\n const handleClickCloseHelp = () => {\r\n setAnchorElHelp(null);\r\n };\r\n\r\n const handleCheckAdminsitrador = (event) => {\r\n setShowLojas(!event.target.checked);\r\n };\r\n\r\n const handleClose = () => {\r\n setDialogOpen(false);\r\n };\r\n\r\n const getLojas = useCallback(async () => {\r\n setLoading(true);\r\n const response = await api.get>>(\r\n ConstanteEnderecoWebservice.LOJA_LISTAR,\r\n {\r\n params: {\r\n empresaId: auth.empresaId(),\r\n },\r\n }\r\n );\r\n\r\n setLoading(false);\r\n if (response.sucesso) {\r\n setLojas(response.dados);\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.map((item: string) =>\r\n enqueueSnackbar(item, { variant: 'warning' })\r\n );\r\n }\r\n }, [enqueueSnackbar]);\r\n\r\n const handleVincularTodasLojas = () => {\r\n setValue('lojas', lojas);\r\n if (errors.lojas) trigger();\r\n };\r\n\r\n const onSubmit = handleSubmit(async (data) => {\r\n setLoading(true);\r\n\r\n let lojasId = [] as Array;\r\n\r\n if (lojas.length > 1) {\r\n lojasId = data.lojas ? data.lojas.map((item) => item.id) : [];\r\n } else {\r\n lojasId = lojas.map((item) => item.id);\r\n }\r\n\r\n const response = await api.post(\r\n ConstanteEnderecoWebservice.USUARIO_INSERIR,\r\n {\r\n administrador: data.administrador,\r\n nome: data.nome,\r\n email: data.email,\r\n senha: data.senha,\r\n empresaId: auth.empresaId(),\r\n lojasId,\r\n }\r\n );\r\n\r\n setLoading(false);\r\n\r\n if (response.sucesso) {\r\n enqueueSnackbar('Operação realizada com sucesso.', {\r\n variant: 'success',\r\n });\r\n\r\n handleDialogClose();\r\n setDialogOpen(false);\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.map((item: string) =>\r\n enqueueSnackbar(item, { variant: 'warning' })\r\n );\r\n }\r\n });\r\n\r\n const resetForm = useCallback(() => {\r\n reset({\r\n nome: '',\r\n email: '',\r\n senha: '',\r\n confirmarSenha: '',\r\n administrador: false,\r\n lojas: [] as Array,\r\n });\r\n\r\n setShowLojas(true);\r\n }, [reset]);\r\n\r\n useEffect(() => {\r\n if (dialogOpen) {\r\n resetForm();\r\n\r\n if (lojas.length === 0) {\r\n getLojas();\r\n }\r\n }\r\n }, [dialogOpen, getLojas, lojas, resetForm]);\r\n\r\n return (\r\n \r\n {loading && }\r\n \r\n \r\n \r\n \r\n \r\n \r\n Adicionar usuário\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n \r\n }\r\n label=\"Administrador\"\r\n />\r\n \r\n \r\n \r\n \r\n \r\n O usuário administrador é vinculado automaticamente com\r\n todas as lojas e possui acesso em todas as funcionalidades\r\n do aplicativo.\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {showLojas && lojas.length > 1 && (\r\n \r\n \r\n Vincular com todas as lojas\r\n \r\n \r\n `${option.nomeFantasia} (${option.cidade} - ${option.uf})`\r\n }\r\n renderOption={(option, { selected }) => (\r\n <>\r\n \r\n {`${option.nomeFantasia} (${option.cidade} - ${option.uf})`}\r\n \r\n )}\r\n renderInput={(params) => (\r\n \r\n )}\r\n />\r\n {Boolean(errors.lojas) && (\r\n \r\n {ConstanteMensagemValidacao.CAMPO_OBRIGATORIO}\r\n \r\n )}\r\n \r\n )}\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default InserirUsuario;\r\n","import React, { useCallback, useEffect, useState } from 'react';\r\nimport {\r\n createStyles,\r\n Theme,\r\n makeStyles,\r\n withStyles,\r\n} from '@material-ui/core/styles';\r\nimport Dialog from '@material-ui/core/Dialog';\r\nimport {\r\n AppBar,\r\n Button,\r\n Checkbox,\r\n colors,\r\n DialogContent,\r\n FormControlLabel,\r\n FormHelperText,\r\n Grid,\r\n IconButton,\r\n Popover,\r\n TextField,\r\n Toolbar,\r\n Typography,\r\n} from '@material-ui/core';\r\nimport { ArrowBack, HelpOutline } from '@material-ui/icons';\r\nimport Transition from 'components/TransitionDefault';\r\nimport auth from 'auth';\r\nimport FormInput from 'components/FormInput';\r\nimport { useForm } from 'react-hook-form';\r\nimport ButtonLoading from 'components/Button/ButtonLoading';\r\nimport api, { ResponseApi } from 'services/api';\r\nimport ConstanteEnderecoWebservice from 'constants/enderecoWebservice';\r\nimport CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';\r\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\r\nimport FormInputAutoComplete from 'components/FormInputAutoComplete';\r\nimport ConstanteMensagemValidacao from 'constants/mensagensValidacoes';\r\nimport * as yup from 'yup';\r\nimport { yupResolver } from '@hookform/resolvers/yup';\r\nimport { useSnackbar } from 'notistack';\r\nimport Loading from 'components/Loading';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n appBar: {\r\n position: 'relative',\r\n background: theme.palette.primary.main,\r\n },\r\n title: {\r\n marginLeft: theme.spacing(2),\r\n flex: 1,\r\n },\r\n body: {\r\n height: '100%',\r\n '& .MuiDialogContent-root': {\r\n padding: '0px',\r\n background: colors.grey[800],\r\n },\r\n },\r\n dialog: {\r\n background: colors.blueGrey[800],\r\n color: colors.common.white,\r\n },\r\n form: {\r\n background: colors.grey[800],\r\n padding: theme.spacing(1, 2, 1, 2),\r\n height: '100%',\r\n },\r\n formControl: {\r\n marginTop: theme.spacing(2),\r\n },\r\n radioButton: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n },\r\n helpMessage: {\r\n background: colors.grey[700],\r\n },\r\n typographyHelp: {\r\n padding: theme.spacing(2),\r\n },\r\n })\r\n);\r\n\r\ninterface LojaInterface {\r\n id: string;\r\n nomeFantasia: string;\r\n cidade: string;\r\n uf: string;\r\n}\r\n\r\ninterface UsuarioInterface {\r\n id: string;\r\n nome: string;\r\n email: string;\r\n administrador: boolean;\r\n emailConfirmed: boolean;\r\n lojas: Array;\r\n}\r\n\r\nconst CssTextField = withStyles((theme) => ({\r\n root: {\r\n '& :not(.Mui-error)': {\r\n '&.Mui-focused.MuiInputLabel-asterisk, &.Mui-focused.MuiInputLabel-outlined': {\r\n color: theme.palette.primary.main,\r\n },\r\n '&.MuiInputLabel-outlined': {\r\n color: colors.grey[400],\r\n '&.MuiInputLabel-asterisk': {\r\n color: colors.grey[400],\r\n },\r\n },\r\n\r\n '&.MuiOutlinedInput-root': {\r\n '& fieldset': {\r\n borderColor: colors.grey[300],\r\n color: colors.grey[300],\r\n },\r\n '&:hover fieldset :not(.Mui-disabled)': {\r\n borderColor: theme.palette.primary.main,\r\n },\r\n '&.Mui-focused fieldset': {\r\n borderColor: theme.palette.primary.main,\r\n },\r\n '& input:disabled': {\r\n color: colors.grey[200],\r\n background: '#2e3b42',\r\n },\r\n },\r\n },\r\n '& .MuiFormLabel-root.Mui-disabled': {\r\n color: colors.grey[300],\r\n },\r\n },\r\n}))(TextField);\r\n\r\nconst icon = ;\r\nconst checkedIcon = ;\r\n\r\nconst schema = yup.object().shape({\r\n nome: yup.string().required(ConstanteMensagemValidacao.CAMPO_OBRIGATORIO),\r\n email: yup\r\n .string()\r\n .required(ConstanteMensagemValidacao.CAMPO_OBRIGATORIO)\r\n .email(ConstanteMensagemValidacao.EMAIL_INVALIDO),\r\n lojas: yup.array().min(1, ConstanteMensagemValidacao.CAMPO_OBRIGATORIO),\r\n});\r\n\r\ninterface PropsDialog {\r\n usuarioId: string;\r\n dialogOpen: boolean;\r\n setDialogOpen: React.Dispatch>;\r\n handleDialogClose: () => void;\r\n}\r\n\r\nconst AlterarUsuario = ({\r\n usuarioId,\r\n dialogOpen,\r\n setDialogOpen,\r\n handleDialogClose,\r\n}: PropsDialog) => {\r\n const classes = useStyles();\r\n const [lojas, setLojas] = useState([] as Array);\r\n const [anchorElHelp, setAnchorElHelp] = React.useState(null);\r\n const [\r\n anchorElHelpEmailConfirmado,\r\n setAnchorElHelpEmailConfirmado,\r\n ] = React.useState(null);\r\n\r\n const [administrador, setAdministrador] = React.useState(true);\r\n const { enqueueSnackbar } = useSnackbar();\r\n const bloquearDesmarcarAdministrador = auth.usuarioId() === usuarioId;\r\n const [loading, setLoading] = React.useState(false);\r\n const [emailConfirmado, setEmailConfirmado] = React.useState(false);\r\n\r\n const {\r\n handleSubmit,\r\n control,\r\n setValue,\r\n register,\r\n errors,\r\n trigger,\r\n reset,\r\n } = useForm({\r\n resolver: yupResolver(schema),\r\n defaultValues: {\r\n nome: '',\r\n email: '',\r\n lojas: [] as Array,\r\n },\r\n });\r\n\r\n const openHelp = Boolean(anchorElHelp);\r\n const openHelpEmailConfirmado = Boolean(anchorElHelpEmailConfirmado);\r\n\r\n const handleClickOpenHelp = (event) => {\r\n setAnchorElHelp(event.currentTarget);\r\n };\r\n\r\n const handleClickCloseHelp = () => {\r\n setAnchorElHelp(null);\r\n };\r\n\r\n const handleClickOpenHelpEmailConfirmado = (event) => {\r\n setAnchorElHelpEmailConfirmado(event.currentTarget);\r\n };\r\n\r\n const handleClickCloseHelpEmailConfirmado = () => {\r\n setAnchorElHelpEmailConfirmado(null);\r\n };\r\n\r\n const handleCheckAdminsitrador = () => {\r\n setAdministrador(!administrador);\r\n };\r\n\r\n const handleClose = () => {\r\n setDialogOpen(false);\r\n };\r\n\r\n const getLojas = useCallback(async () => {\r\n setLoading(true);\r\n\r\n if (lojas.length === 0) {\r\n const response = await api.get>>(\r\n ConstanteEnderecoWebservice.LOJA_LISTAR,\r\n {\r\n params: {\r\n empresaId: auth.empresaId(),\r\n },\r\n }\r\n );\r\n\r\n if (response.sucesso) {\r\n setLojas(response.dados);\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.map((item: string) =>\r\n enqueueSnackbar(item, { variant: 'warning' })\r\n );\r\n }\r\n }\r\n }, [enqueueSnackbar, lojas.length]);\r\n\r\n const getUsuario = useCallback(async () => {\r\n if (lojas.length > 0) {\r\n const response = await api.get>(\r\n ConstanteEnderecoWebservice.USUARIO_OBTER,\r\n {\r\n params: {\r\n usuarioId,\r\n },\r\n }\r\n );\r\n\r\n if (response.sucesso) {\r\n const usuario = response.dados;\r\n\r\n reset({\r\n nome: usuario.nome,\r\n email: usuario.email,\r\n lojas: lojas.filter((loja) => usuario.lojas.includes(loja.id)),\r\n });\r\n\r\n setEmailConfirmado(usuario.emailConfirmed);\r\n setAdministrador(usuario.administrador);\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.map((item: string) =>\r\n enqueueSnackbar(item, { variant: 'warning' })\r\n );\r\n }\r\n\r\n setLoading(false);\r\n }\r\n }, [enqueueSnackbar, lojas, reset, usuarioId]);\r\n\r\n const getDados = useCallback(async () => {\r\n await getLojas();\r\n await getUsuario();\r\n }, [getLojas, getUsuario]);\r\n\r\n const handleVincularTodasLojas = () => {\r\n setValue('lojas', lojas);\r\n if (errors.lojas) trigger();\r\n };\r\n\r\n const onSubmit = handleSubmit(async (data) => {\r\n setLoading(true);\r\n\r\n let lojasId = [] as Array;\r\n\r\n if (lojas.length > 1) {\r\n lojasId = data.lojas ? data.lojas.map((item) => item.id) : [];\r\n } else {\r\n lojasId = lojas.map((item) => item.id);\r\n }\r\n\r\n const response = await api.put(\r\n ConstanteEnderecoWebservice.USUARIO_ALTERAR,\r\n {\r\n id: usuarioId,\r\n administrador,\r\n nome: data.nome,\r\n email: data.email,\r\n empresaId: auth.empresaId(),\r\n lojasId,\r\n }\r\n );\r\n\r\n setLoading(false);\r\n\r\n if (response.sucesso) {\r\n enqueueSnackbar('Operação realizada com sucesso.', {\r\n variant: 'success',\r\n });\r\n\r\n handleDialogClose();\r\n setDialogOpen(false);\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.map((item: string) =>\r\n enqueueSnackbar(item, { variant: 'warning' })\r\n );\r\n }\r\n });\r\n\r\n useEffect(() => {\r\n if (dialogOpen) {\r\n getDados();\r\n }\r\n }, [dialogOpen, getDados]);\r\n\r\n return (\r\n \r\n {loading && }\r\n \r\n \r\n \r\n \r\n \r\n \r\n Alterar usuário\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n \r\n }\r\n style={{ marginRight: '2px' }}\r\n label=\"Administrador\"\r\n />\r\n \r\n \r\n \r\n \r\n \r\n O usuário administrador é vinculado automaticamente com\r\n todas as lojas e possui acesso em todas as funcionalidades\r\n do aplicativo.\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n \r\n {emailConfirmado && (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n Não é possível alterar um e-mail já confirmado.\r\n \r\n \r\n \r\n )}\r\n
\r\n
\r\n {!administrador && lojas.length > 1 && (\r\n \r\n \r\n Vincular com todas as lojas\r\n \r\n \r\n `${option.nomeFantasia} (${option.cidade} - ${option.uf})`\r\n }\r\n renderOption={(option, { selected }) => (\r\n <>\r\n \r\n {`${option.nomeFantasia} (${option.cidade} - ${option.uf})`}\r\n \r\n )}\r\n renderInput={(params) => (\r\n \r\n )}\r\n />\r\n {Boolean(errors.lojas) && (\r\n \r\n {ConstanteMensagemValidacao.CAMPO_OBRIGATORIO}\r\n \r\n )}\r\n \r\n )}\r\n
\r\n\r\n
\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default AlterarUsuario;\r\n","import React, { useCallback, useState } from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\r\nimport {\r\n Button,\r\n Dialog,\r\n ListItem,\r\n List,\r\n Divider,\r\n AppBar,\r\n Toolbar,\r\n IconButton,\r\n Typography,\r\n Chip,\r\n colors,\r\n Fab,\r\n Popover,\r\n Zoom,\r\n} from '@material-ui/core';\r\nimport ArrowBack from '@material-ui/icons/ArrowBack';\r\nimport { Add, ErrorOutline } from '@material-ui/icons';\r\nimport { useForm } from 'react-hook-form';\r\nimport { useSnackbar } from 'notistack';\r\n\r\nimport { UsuariosIcon } from 'icons';\r\nimport ConstanteEnderecoWebservice from 'constants/enderecoWebservice';\r\nimport TipoSistemaEnum from 'constants/enumTipoSistema';\r\nimport auth from 'auth';\r\nimport api, { ResponseApi } from 'services/api';\r\n\r\nimport DialogConfirm from 'components/DialogConfirm';\r\nimport Transition from 'components/TransitionDefault';\r\nimport ButtonMoreOption from 'components/GerenciarUsuario/ButtonMoreOption';\r\nimport Loading from 'components/Loading';\r\n\r\nimport FiltroUsuario from './FiltroUsuario';\r\nimport InserirUsuario from './Inserir';\r\nimport AlterarUsuario from './Alterar';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n appBar: {\r\n position: 'relative',\r\n background: theme.palette.primary.main,\r\n },\r\n title: {\r\n marginLeft: theme.spacing(2),\r\n flex: 1,\r\n },\r\n body: {\r\n background: colors.grey[800],\r\n height: '100%',\r\n },\r\n fab: {\r\n position: 'fixed',\r\n bottom: theme.spacing(2),\r\n right: theme.spacing(2),\r\n },\r\n helpMessage: {\r\n background: colors.grey[700],\r\n },\r\n typographyHelp: {\r\n padding: theme.spacing(2),\r\n },\r\n })\r\n);\r\n\r\nexport interface UsuarioInterface {\r\n id: string;\r\n nome: string;\r\n email: string;\r\n administrador: string;\r\n emailConfirmed: boolean;\r\n lojas: Array;\r\n}\r\n\r\nconst GerenciarUsuario = ({ ...props }) => {\r\n const { classesItem, currentPage } = props;\r\n const classes = useStyles();\r\n const [loading, setLoading] = useState(false);\r\n const [open, setOpen] = useState(false);\r\n const [scrollPosition, setScrollPosition] = useState(0);\r\n const [showAdicionar, setShowAdicionar] = useState(true);\r\n const [showAdicionarDialog, setShowAdicionarDialog] = useState(false);\r\n const [showAlterarDialog, setShowAlterarDialog] = useState(false);\r\n const [usuarioId, setUsuarioId] = useState('');\r\n const [anchorElHelp, setAnchorElHelp] = useState(null);\r\n const [usuarios, setUsuarios] = useState([] as Array);\r\n const [usuariosFiltrados, setUsuariosFiltrados] = useState(\r\n [] as Array\r\n );\r\n const [dialogConfirmOpen, setDialogConfirmOpen] = useState(false);\r\n const [\r\n dialogConfirmOpenAlterarSenha,\r\n setDialogConfirmOpenAlterarSenha,\r\n ] = useState(false);\r\n const [usuarioSelecionado, setUsuarioSelecionado] = useState<\r\n UsuarioInterface\r\n >({} as UsuarioInterface);\r\n\r\n const sistema = auth.getSistema();\r\n const sistemaIsSti3 = sistema.value === TipoSistemaEnum.STI3;\r\n\r\n const { enqueueSnackbar } = useSnackbar();\r\n\r\n const { control, reset, getValues } = useForm({\r\n defaultValues: {\r\n loja: '',\r\n nome: '',\r\n email: '',\r\n },\r\n });\r\n\r\n const filtrarUsuarios = () => {\r\n const { loja, nome, email } = getValues();\r\n\r\n const listaFiltrada = usuarios.filter((usuarioItem) => {\r\n return (\r\n (nome === '' ||\r\n usuarioItem.nome.toLowerCase().includes(nome.toLowerCase())) &&\r\n (email === '' ||\r\n usuarioItem.email.toLowerCase().includes(email.toLowerCase())) &&\r\n (loja === '' ||\r\n loja === undefined ||\r\n usuarioItem.lojas.includes(loja.toLowerCase()))\r\n );\r\n });\r\n\r\n setUsuariosFiltrados(listaFiltrada);\r\n };\r\n\r\n const getUsuarios = useCallback(async () => {\r\n setLoading(true);\r\n const response = await api.get>>(\r\n ConstanteEnderecoWebservice.USUARIO_LISTAR\r\n );\r\n\r\n setLoading(false);\r\n if (response.sucesso) {\r\n setUsuarios(response.dados);\r\n setUsuariosFiltrados(response.dados);\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.map((item: string) =>\r\n enqueueSnackbar(item, { variant: 'warning' })\r\n );\r\n }\r\n }, [enqueueSnackbar]);\r\n\r\n const handleClickOpen = () => {\r\n getUsuarios();\r\n setOpen(true);\r\n };\r\n\r\n const handleClose = () => {\r\n setOpen(false);\r\n };\r\n\r\n const confirmDelete = async () => {\r\n setLoading(true);\r\n setDialogConfirmOpen(false);\r\n const response = await api.delete(\r\n ConstanteEnderecoWebservice.USUARIO_EXCLUIR,\r\n {\r\n params: {\r\n id: usuarioSelecionado.id,\r\n },\r\n }\r\n );\r\n\r\n if (response.sucesso) {\r\n getUsuarios();\r\n enqueueSnackbar('Usuário excluído com sucesso.', { variant: 'success' });\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.map((item: string) =>\r\n enqueueSnackbar(item, { variant: 'warning' })\r\n );\r\n }\r\n\r\n setLoading(false);\r\n };\r\n\r\n const confirmAlterarSenha = async () => {\r\n setLoading(true);\r\n setDialogConfirmOpenAlterarSenha(false);\r\n\r\n const response = await api.post>(\r\n `${ConstanteEnderecoWebservice.AUTENTICACAO_RECUPERAR_SENHA}${usuarioSelecionado.email}`\r\n );\r\n\r\n if (response.sucesso) {\r\n enqueueSnackbar('E-mail para alteração de senha enviado com sucesso.', {\r\n variant: 'success',\r\n });\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.map((item: string) =>\r\n enqueueSnackbar(item, { variant: 'warning' })\r\n );\r\n }\r\n\r\n setLoading(false);\r\n };\r\n\r\n const handleScroll = (scrollTop) => {\r\n setShowAdicionar(scrollTop <= scrollPosition);\r\n setScrollPosition(scrollTop);\r\n };\r\n\r\n const handleAlterar = (id) => {\r\n setUsuarioId(id);\r\n setShowAlterarDialog(true);\r\n };\r\n\r\n const handleExcluir = (usuario) => {\r\n setUsuarioSelecionado(usuario);\r\n setDialogConfirmOpen(true);\r\n };\r\n\r\n const handleResetSenha = (usuario) => {\r\n setUsuarioSelecionado(usuario);\r\n setDialogConfirmOpenAlterarSenha(true);\r\n };\r\n\r\n const handleReenviarEmailConfirmacao = async (usuario) => {\r\n setLoading(true);\r\n\r\n const response = await api.post(\r\n `${ConstanteEnderecoWebservice.USUARIO_REENVIAR_CONFIRMACAO_EMAIL}${usuario.email}`,\r\n null\r\n );\r\n\r\n if (response.sucesso) {\r\n enqueueSnackbar(\r\n `O e-mail para confirmação foi enviado com sucesso para '${usuario.email}'.`,\r\n {\r\n variant: 'success',\r\n }\r\n );\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.forEach((aviso: string) =>\r\n enqueueSnackbar(aviso, { variant: 'warning' })\r\n );\r\n }\r\n\r\n setLoading(false);\r\n };\r\n\r\n const openHelp = Boolean(anchorElHelp);\r\n\r\n const handleClickOpenHelp = (event) => {\r\n setAnchorElHelp(event.currentTarget);\r\n };\r\n\r\n const handleClickCloseHelp = () => {\r\n setAnchorElHelp(null);\r\n };\r\n\r\n return (\r\n <>\r\n {sistemaIsSti3 && (\r\n \r\n \r\n \r\n Gerenciar usuários\r\n \r\n \r\n )}\r\n \r\n {loading && }\r\n \r\n \r\n \r\n \r\n \r\n \r\n Gerenciar usuários\r\n \r\n \r\n \r\n \r\n\r\n \r\n\r\n {\r\n handleScroll(e.target.scrollTop);\r\n }}\r\n className={classes.body}\r\n style={{ overflow: 'auto' }}\r\n >\r\n {usuariosFiltrados.map((usuarioItem) => (\r\n \r\n \r\n \r\n \r\n
\r\n \r\n {usuarioItem.nome}\r\n \r\n {usuarioItem.administrador && (\r\n \r\n )}\r\n
\r\n \r\n {usuarioItem.email}{' '}\r\n {!usuarioItem.emailConfirmed && (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n Esse e-mail está pendente de confirmação. Caso não\r\n tenha recebido o e-mail, verifique a caixa de spam\r\n ou reenvie novamente.\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n \r\n
\r\n \r\n \r\n \r\n ))}\r\n \r\n \r\n {\r\n setShowAdicionarDialog(true);\r\n }}\r\n >\r\n \r\n \r\n \r\n getUsuarios()}\r\n />\r\n getUsuarios()}\r\n usuarioId={usuarioId}\r\n />\r\n \r\n\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default GerenciarUsuario;\r\n","import React from 'react';\r\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\r\nimport { colors, Menu, MenuItem } from '@material-ui/core';\r\nimport MoreVertIcon from '@material-ui/icons/MoreVert';\r\nimport DeleteIcon from '@material-ui/icons/Delete';\r\nimport IconButton from '@material-ui/core/IconButton';\r\n\r\ninterface ButtonExcluirProps {\r\n setDialogOpen(isOpen: boolean): void;\r\n onConfirm(): void;\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n paperMenu: {\r\n background: colors.grey[900],\r\n boxShadow: 'none',\r\n minWidth: '150px',\r\n },\r\n iconAction: {\r\n marginRight: theme.spacing(1),\r\n },\r\n })\r\n);\r\n\r\nfunction ButtonOptionsLoja({ onConfirm, setDialogOpen }: ButtonExcluirProps) {\r\n const classes = useStyles();\r\n const [anchorEl, setAnchorEl] = React.useState(null);\r\n\r\n return (\r\n <>\r\n setAnchorEl(e.currentTarget)}\r\n >\r\n \r\n \r\n setAnchorEl(null)}\r\n anchorPosition={{\r\n left: 0,\r\n top: 0,\r\n }}\r\n anchorEl={anchorEl}\r\n anchorOrigin={{\r\n vertical: 'top',\r\n horizontal: 'right',\r\n }}\r\n transformOrigin={{\r\n vertical: 'top',\r\n horizontal: 'right',\r\n }}\r\n >\r\n {\r\n setDialogOpen(true);\r\n setAnchorEl(null);\r\n onConfirm();\r\n }}\r\n >\r\n \r\n Remover\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nexport default ButtonOptionsLoja;\r\n","import React, { useCallback, useState, useRef } from 'react';\r\nimport {\r\n createStyles,\r\n fade,\r\n makeStyles,\r\n Theme,\r\n} from '@material-ui/core/styles';\r\nimport { Button, colors } from '@material-ui/core';\r\nimport Dialog from '@material-ui/core/Dialog';\r\nimport ListItem from '@material-ui/core/ListItem';\r\nimport List from '@material-ui/core/List';\r\nimport Divider from '@material-ui/core/Divider';\r\nimport AppBar from '@material-ui/core/AppBar';\r\nimport Toolbar from '@material-ui/core/Toolbar';\r\nimport IconButton from '@material-ui/core/IconButton';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport ArrowBack from '@material-ui/icons/ArrowBack';\r\nimport SearchIcon from '@material-ui/icons/Search';\r\nimport InputBase from '@material-ui/core/InputBase';\r\nimport { useSnackbar } from 'notistack';\r\n\r\nimport auth from 'auth';\r\nimport api, { ResponseApi } from 'services/api';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport ConstanteEnderecoWebservice from 'constants/enderecoWebservice';\r\nimport TipoSistemaEnum from 'constants/enumTipoSistema';\r\n\r\nimport { LojaIcon } from 'icons';\r\nimport DialogConfirm from 'components/DialogConfirm';\r\nimport ButtonLoading from 'components/Button/ButtonLoading';\r\nimport Transition from 'components/TransitionDefault';\r\nimport Loading from 'components/Loading';\r\n\r\nimport ButtonOptionsLoja from './ButtonExcluir';\r\n\r\ninterface LojaInterface {\r\n id: string;\r\n nomeFantasia: string;\r\n cidade: string;\r\n uf: string;\r\n dataHoraUltimaSincronizacao: string;\r\n lojaIdExterno: string;\r\n}\r\n\r\ninterface InfoLojaProps {\r\n empresaId: string;\r\n listaLojasIdExterno: string[];\r\n}\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n appBar: {\r\n position: 'relative',\r\n background: theme.palette.primary.main,\r\n },\r\n title: {\r\n marginLeft: theme.spacing(2),\r\n flex: 1,\r\n },\r\n body: {\r\n background: colors.grey[800],\r\n height: '100%',\r\n '& .Mui-selected': {\r\n background: colors.grey[700],\r\n borderLeft: `4px solid ${theme.palette.primary.main}`,\r\n },\r\n '& .Mui-selected:hover': {\r\n background: colors.grey[700],\r\n borderLeft: `4px solid ${theme.palette.primary.main}`,\r\n },\r\n '& .Mui-selected p': {\r\n marginLeft: '-4px',\r\n fontWeight: theme.typography.fontWeightBold,\r\n },\r\n },\r\n search: {\r\n position: 'relative',\r\n borderRadius: theme.shape.borderRadius,\r\n backgroundColor: fade(theme.palette.common.white, 0.15),\r\n '&:hover': {\r\n backgroundColor: fade(theme.palette.common.white, 0.25),\r\n },\r\n marginLeft: theme.spacing(1),\r\n marginRight: theme.spacing(1),\r\n marginBottom: theme.spacing(1),\r\n },\r\n searchIcon: {\r\n padding: theme.spacing(0, 2),\r\n height: '100%',\r\n position: 'absolute',\r\n pointerEvents: 'none',\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n },\r\n inputRoot: {\r\n color: 'inherit',\r\n width: '100%',\r\n },\r\n inputInput: {\r\n padding: theme.spacing(1, 1, 1, 0),\r\n paddingLeft: theme.spacing(6),\r\n },\r\n fab: {\r\n position: 'fixed',\r\n bottom: theme.spacing(2),\r\n right: theme.spacing(2),\r\n 'z-index': '999',\r\n },\r\n })\r\n);\r\n\r\nconst TrocarLoja = ({ ...props }) => {\r\n const [open, setOpen] = useState(false);\r\n const [lojaSelecionada, setLojaSelecionada] = useState('');\r\n const [lojas, setLojas] = useState([]);\r\n const { setLoja, loja, syncData } = useChartData();\r\n const [loading, setLoading] = useState(false);\r\n const [dialogOpen, setDialogOpen] = useState(false);\r\n\r\n const infoLoja = useRef(null);\r\n\r\n const classes = useStyles();\r\n const { enqueueSnackbar } = useSnackbar();\r\n\r\n const lojasAuth = auth.getLojas();\r\n const userIsAdm = auth.administrador();\r\n const sistema = auth.getSistema();\r\n const dominio = auth.getDataDominio();\r\n\r\n const { classesItem, currentPage } = props;\r\n const sistemaIsSti3 = sistema.value === TipoSistemaEnum.STI3;\r\n\r\n const getLojas = useCallback(async () => {\r\n setLoading(true);\r\n const response = await api.get>>(\r\n ConstanteEnderecoWebservice.LOJA_LISTAR,\r\n {\r\n params: {\r\n empresaId: auth.empresaId(),\r\n },\r\n }\r\n );\r\n\r\n setLoading(false);\r\n if (response.sucesso) {\r\n setLojas(response.dados);\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.forEach((aviso: string) =>\r\n enqueueSnackbar(aviso, { variant: 'warning' })\r\n );\r\n }\r\n }, [enqueueSnackbar]);\r\n\r\n const handleClose = () => {\r\n setOpen(false);\r\n };\r\n\r\n const filtrarLojas = (filtro) => {\r\n const listaFiltrada = lojas.filter((lojaItem) => {\r\n return (\r\n filtro === '' ||\r\n lojaItem.nomeFantasia.toLowerCase().includes(filtro.toLowerCase()) ||\r\n lojaItem.uf.toLowerCase().includes(filtro.toLowerCase())\r\n );\r\n });\r\n\r\n setLojas(listaFiltrada);\r\n };\r\n\r\n const handleSalvar = async () => {\r\n setLoading(true);\r\n\r\n const lojaSelecionadaObj = lojasAuth.filter((lojaItem) => {\r\n return lojaItem.LojaId === lojaSelecionada;\r\n })[0];\r\n\r\n const sincronizado = await syncData(lojaSelecionada);\r\n\r\n if (sincronizado) {\r\n setLoja(lojaSelecionadaObj);\r\n handleClose();\r\n }\r\n setLoading(false);\r\n };\r\n\r\n const handleClickOpen = () => {\r\n setLojaSelecionada(loja.LojaId);\r\n setOpen(true);\r\n getLojas();\r\n };\r\n\r\n const sincronizacaoAtrasada = (dataSincronizacao: Date) => {\r\n const dataSincronizacaoNormalizada = new Date(\r\n dataSincronizacao.getFullYear(),\r\n dataSincronizacao.getMonth(),\r\n dataSincronizacao.getDate(),\r\n 0,\r\n 0,\r\n 0\r\n );\r\n\r\n const dataAtual = new Date();\r\n\r\n const dataAtualNormalizada = new Date(\r\n dataAtual.getFullYear(),\r\n dataAtual.getMonth(),\r\n dataAtual.getDate(),\r\n 0,\r\n 0,\r\n 0\r\n );\r\n\r\n return dataSincronizacaoNormalizada < dataAtualNormalizada;\r\n };\r\n\r\n async function handleRemoveLoja() {\r\n setLoading(true);\r\n setDialogOpen(false);\r\n const { empresaId, listaLojasIdExterno } = infoLoja.current\r\n ? infoLoja?.current\r\n : ({} as InfoLojaProps);\r\n\r\n const response = await api.post>(\r\n ConstanteEnderecoWebservice.LOJA_DESATIVAR,\r\n {\r\n empresaId,\r\n listaLojasIdExterno,\r\n }\r\n );\r\n\r\n if (response.avisos) {\r\n response.avisos.forEach((aviso) => {\r\n enqueueSnackbar(aviso, { variant: 'warning' });\r\n });\r\n }\r\n\r\n if (response.sucesso && response.dados) {\r\n const newLojas = lojas.filter((item) => item.id !== empresaId);\r\n infoLoja.current = null;\r\n setLojas(newLojas);\r\n }\r\n setLoading(false);\r\n }\r\n\r\n function onConfirmExclusion(\r\n empresaId: string,\r\n listaLojasIdExterno: string[]\r\n ) {\r\n infoLoja.current = {\r\n empresaId,\r\n listaLojasIdExterno,\r\n };\r\n }\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n Trocar loja\r\n \r\n \r\n \r\n {loading && }\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n Trocar loja\r\n \r\n \r\n \r\n \r\n\r\n \r\n
\r\n
\r\n \r\n
\r\n {\r\n filtrarLojas(e.target.value);\r\n }}\r\n />\r\n
\r\n\r\n \r\n\r\n {lojas.map((lojaItem) => (\r\n \r\n setLojaSelecionada(lojaItem.id)}\r\n >\r\n \r\n
\r\n \r\n {lojaItem.nomeFantasia}\r\n \r\n \r\n {`${lojaItem.cidade} - ${lojaItem.uf}`}\r\n \r\n \r\n {/* {lojaItem.CidadeUf} */}\r\n {`Sincronizado em: ${new Date(\r\n lojaItem.dataHoraUltimaSincronizacao\r\n ).toLocaleString()}`}\r\n \r\n
\r\n {userIsAdm && sistemaIsSti3 && (\r\n
\r\n {\r\n onConfirmExclusion(lojaItem.id, [\r\n lojaItem.lojaIdExterno,\r\n ]);\r\n }}\r\n setDialogOpen={setDialogOpen}\r\n />\r\n
\r\n )}\r\n \r\n \r\n \r\n
\r\n ))}\r\n
\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default TrocarLoja;\r\n","import {\r\n makeStyles,\r\n Theme,\r\n createStyles,\r\n colors,\r\n fade,\r\n} from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n appBar: {\r\n position: 'relative',\r\n background: theme.palette.primary.main,\r\n },\r\n title: {\r\n marginLeft: theme.spacing(2),\r\n flex: 1,\r\n },\r\n body: {\r\n background: colors.grey[800],\r\n height: '100%',\r\n },\r\n search: {\r\n position: 'relative',\r\n borderRadius: theme.shape.borderRadius,\r\n backgroundColor: fade(theme.palette.common.white, 0.15),\r\n '&:hover': {\r\n backgroundColor: fade(theme.palette.common.white, 0.25),\r\n },\r\n marginLeft: theme.spacing(1),\r\n marginRight: theme.spacing(1),\r\n marginBottom: theme.spacing(1),\r\n },\r\n searchIcon: {\r\n padding: theme.spacing(0, 2),\r\n height: '100%',\r\n position: 'absolute',\r\n pointerEvents: 'none',\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n },\r\n inputRoot: {\r\n color: 'inherit',\r\n width: '100%',\r\n },\r\n inputInput: {\r\n padding: theme.spacing(1, 1, 1, 0),\r\n paddingLeft: theme.spacing(6),\r\n },\r\n fab: {\r\n position: 'fixed',\r\n bottom: theme.spacing(2),\r\n right: theme.spacing(2),\r\n },\r\n helpMessage: {\r\n background: colors.grey[700],\r\n },\r\n typographyHelp: {\r\n padding: theme.spacing(2),\r\n },\r\n listItem: {\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n width: '100%',\r\n },\r\n text: {\r\n fontSize: '18px',\r\n },\r\n listItemAction: {\r\n marginRight: theme.spacing(2),\r\n },\r\n })\r\n);\r\n\r\nexport default useStyles;\r\n","import React, { useState } from 'react';\r\nimport {\r\n Button,\r\n Dialog,\r\n ListItem,\r\n List,\r\n Divider,\r\n AppBar,\r\n Toolbar,\r\n IconButton,\r\n Typography,\r\n colors,\r\n InputBase,\r\n ListItemText,\r\n ListItemSecondaryAction,\r\n} from '@material-ui/core';\r\nimport ArrowBack from '@material-ui/icons/ArrowBack';\r\nimport { ClassNameMap, useSnackbar } from 'notistack';\r\nimport SearchIcon from '@material-ui/icons/Search';\r\nimport JSZip from 'jszip';\r\nimport jsFileDownload from 'js-file-download';\r\nimport { BsDownload } from 'react-icons/bs';\r\nimport axios from 'axios';\r\n\r\nimport ConstanteEnderecoWebservice from 'constants/enderecoWebservice';\r\nimport TipoSistemaEnum from 'constants/enumTipoSistema';\r\nimport auth from 'auth';\r\nimport api, { ResponseApi } from 'services/api';\r\n\r\nimport Transition from 'components/TransitionDefault';\r\nimport Loading from 'components/Loading';\r\n\r\nimport useStyles from './styles';\r\n\r\ntype Relatorios = {\r\n urlArquivo: string;\r\n nomeArquivo: string;\r\n};\r\n\r\ntype RelatoriosItem = {\r\n identificacao: number;\r\n descricao: string;\r\n};\r\n\r\ntype DownloadsProps = {\r\n classesItem: ClassNameMap<\r\n | 'button'\r\n | 'icon'\r\n | 'active'\r\n | 'title'\r\n | 'divider'\r\n | 'list'\r\n | 'item'\r\n | 'iconSair'\r\n | 'divSubmenu'\r\n >;\r\n currentPage: string;\r\n relatorios: RelatoriosItem[];\r\n};\r\n\r\nconst Downloads = ({\r\n classesItem,\r\n currentPage,\r\n relatorios,\r\n}: DownloadsProps) => {\r\n const classes = useStyles();\r\n const [loading, setLoading] = useState(false);\r\n const [open, setOpen] = useState(false);\r\n const [listRelatorios, setListRelatorios] = useState(relatorios);\r\n\r\n const sistema = auth.getSistema();\r\n const sistemaIsSti3 = sistema.value === TipoSistemaEnum.STI3;\r\n\r\n const { enqueueSnackbar } = useSnackbar();\r\n\r\n const handleClickOpen = () => {\r\n setOpen(true);\r\n };\r\n\r\n const obterRequestAxios = async (\r\n url: string,\r\n nomeArquivo: string,\r\n zip: any\r\n ) => {\r\n const res = await axios.get(url, {\r\n responseType: 'blob',\r\n });\r\n\r\n zip.file(`${nomeArquivo}.csv`, res.data);\r\n };\r\n\r\n async function handleDownload(tipoRelatorio, descricaoRelatorio) {\r\n setLoading(true);\r\n\r\n const zip = new JSZip();\r\n\r\n const response = await api.get>(\r\n ConstanteEnderecoWebservice.OBTER_RELATORIO,\r\n {\r\n params: {\r\n tipoRelatorio,\r\n nomePersonalizado: descricaoRelatorio,\r\n },\r\n }\r\n );\r\n if (response) {\r\n if (response.avisos) {\r\n response.avisos.forEach((avisos) => {\r\n enqueueSnackbar(avisos, { variant: 'warning' });\r\n });\r\n }\r\n\r\n if (response.dados && response.sucesso) {\r\n try {\r\n const { dados } = response;\r\n if (dados.length === 0) {\r\n enqueueSnackbar('Não há dados para download.', {\r\n variant: 'info',\r\n });\r\n setLoading(false);\r\n return;\r\n }\r\n const axiosList = [] as any[];\r\n let nomeRelatorio = '';\r\n dados.forEach(async ({ urlArquivo, nomeArquivo }) => {\r\n nomeRelatorio = nomeArquivo;\r\n axiosList.push(obterRequestAxios(urlArquivo, nomeArquivo, zip));\r\n });\r\n await Promise.all(axiosList);\r\n await zip.generateAsync({ type: 'blob' }).then((content) => {\r\n jsFileDownload(\r\n content,\r\n dados?.length > 1\r\n ? `${descricaoRelatorio}.zip`\r\n : `${nomeRelatorio}.zip`\r\n );\r\n });\r\n } catch (error) {\r\n enqueueSnackbar(\r\n 'Ocorreu um erro inesperado ao processar o download.',\r\n { variant: 'error' }\r\n );\r\n }\r\n }\r\n }\r\n\r\n setLoading(false);\r\n }\r\n\r\n const handleClose = () => {\r\n setOpen(false);\r\n };\r\n\r\n const filtrarRelatorio = (filtro) => {\r\n if (filtro === '') {\r\n setListRelatorios(relatorios);\r\n return;\r\n }\r\n const listaFiltrada = listRelatorios.filter((relatorio) => {\r\n return relatorio?.descricao\r\n ?.toLowerCase()\r\n ?.includes(filtro.toLowerCase());\r\n });\r\n\r\n setListRelatorios(listaFiltrada);\r\n };\r\n\r\n return (\r\n <>\r\n {sistemaIsSti3 && (\r\n \r\n \r\n \r\n Downloads\r\n \r\n \r\n )}\r\n \r\n {loading && }\r\n \r\n \r\n \r\n \r\n \r\n \r\n Relatórios disponíveis\r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n {\r\n filtrarRelatorio(e.target.value);\r\n }}\r\n />\r\n
\r\n\r\n {listRelatorios.map((relatorio) => (\r\n <>\r\n \r\n \r\n {relatorio.descricao}\r\n \r\n \r\n handleDownload(relatorio.identificacao, relatorio.descricao)\r\n }\r\n color=\"secondary\"\r\n classes={{\r\n root: classes.listItemAction,\r\n }}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ))}\r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nexport default Downloads;\r\n","import React, { useCallback, useEffect, useState } from 'react';\r\nimport { NavLink as RouterLink, useHistory } from 'react-router-dom';\r\nimport {\r\n Button,\r\n Divider,\r\n ListItem,\r\n makeStyles,\r\n List,\r\n Box,\r\n colors,\r\n} from '@material-ui/core';\r\nimport { useSnackbar } from 'notistack';\r\nimport ExitToAppIcon from '@material-ui/icons/ExitToApp';\r\nimport {\r\n VendasIcon,\r\n ContasPagarIcon,\r\n ContasReceberIcon,\r\n ProdutosIcon,\r\n} from 'icons';\r\n\r\nimport api, { ResponseApi } from 'services/api';\r\nimport ConstanteEnderecoWebservice from 'constants/enderecoWebservice';\r\nimport auth from 'auth';\r\nimport TipoSistemaEnum from 'constants/enumTipoSistema';\r\n\r\nimport GerenciarUsuario from 'components/GerenciarUsuario';\r\nimport ConstanteRotas from 'constants/rotas';\r\nimport TrocarLoja from 'components/TrocarLoja';\r\nimport Loading from 'components/Loading';\r\nimport Downloads from 'pages/Dashboard/Downloads';\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n list: {\r\n '& .Mui-selected': {\r\n borderLeft: `4px solid ${theme.palette.primary.main}`,\r\n },\r\n '& .Mui-selected:hover': {\r\n borderLeft: `4px solid ${theme.palette.primary.main}`,\r\n },\r\n '& .Mui-selected span': {\r\n marginLeft: '-4px',\r\n },\r\n },\r\n item: {\r\n display: 'flex',\r\n paddingTop: 0,\r\n paddingBottom: 0,\r\n },\r\n button: {\r\n color: theme.palette.text.secondary,\r\n fontWeight: theme.typography.fontWeightLight,\r\n justifyContent: 'flex-start',\r\n letterSpacing: 0,\r\n padding: '10px 8px',\r\n textTransform: 'none',\r\n width: '100%',\r\n },\r\n icon: {\r\n marginRight: theme.spacing(1),\r\n marginLeft: (props: any) =>\r\n props.administrador ? theme.spacing(3) : theme.spacing(1),\r\n color: '#fff',\r\n fontSize: '22px',\r\n },\r\n iconSair: {\r\n marginRight: theme.spacing(1),\r\n marginLeft: theme.spacing(1),\r\n color: '#fff',\r\n fontSize: '22px',\r\n },\r\n title: {\r\n marginRight: 'auto',\r\n fontSize: '16px',\r\n color: '#fff',\r\n },\r\n active: {\r\n color: theme.palette.primary.main,\r\n '& $title': {\r\n fontWeight: theme.typography.fontWeightMedium,\r\n color: theme.palette.primary.main,\r\n },\r\n '& $icon': {\r\n color: theme.palette.primary.main,\r\n },\r\n },\r\n divSubmenu: {\r\n width: '100%',\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'flex-start',\r\n\r\n '& div': {\r\n color: theme.palette.primary.main,\r\n fontSize: '16px',\r\n paddingLeft: theme.spacing(1),\r\n whiteSpace: 'nowrap',\r\n paddingRight: theme.spacing(1),\r\n },\r\n '& span': {\r\n backgroundColor: colors.blueGrey[200],\r\n height: '1px',\r\n width: '100%',\r\n },\r\n },\r\n divider: {\r\n background: colors.blueGrey[400],\r\n },\r\n}));\r\n\r\ninterface RelatoriosInterface {\r\n identificacao: number;\r\n descricao: string;\r\n}\r\n\r\nconst SubMenu = ({ className, titulo }) => {\r\n return (\r\n
\r\n
{titulo}
\r\n \r\n
\r\n );\r\n};\r\n\r\nconst NavItem = ({ closeHandle, ...rest }) => {\r\n const [relatorios, setRelatorios] = useState([]);\r\n const [isLoading, setIsLoading] = useState(false);\r\n\r\n const { enqueueSnackbar } = useSnackbar();\r\n\r\n const administrador = auth.administrador();\r\n\r\n const classes = useStyles({ administrador });\r\n const history = useHistory();\r\n const maisUmaLoja = auth.getLojas().length > 1;\r\n\r\n const items = [\r\n {\r\n href: '/vendas-por-loja',\r\n Icon: ,\r\n title: 'Vendas',\r\n key: 'vendas',\r\n },\r\n {\r\n href: '/produtos',\r\n Icon: ,\r\n title: 'Produtos',\r\n key: 'produtos',\r\n },\r\n {\r\n href: '/contas-pagar',\r\n Icon: ,\r\n title: 'Contas a Pagar',\r\n key: 'contas-pagar',\r\n },\r\n {\r\n href: '/contas-receber',\r\n Icon: ,\r\n title: 'Contas a Receber',\r\n key: 'contas-receber',\r\n },\r\n ];\r\n\r\n const [currentPage, setCurrentPage] = useState('todas-lojas');\r\n\r\n const sistema = auth.getSistema() || '';\r\n\r\n const sistemaIsZendarOrPowerstock = sistema.value !== TipoSistemaEnum.STI3;\r\n\r\n const logoffEnderecoWebService = sistemaIsZendarOrPowerstock\r\n ? ConstanteEnderecoWebservice.AUTENTICACAO_INTEGRACAO_LOGOFF\r\n : ConstanteEnderecoWebservice.AUTENTICACAO_LOGOFF;\r\n\r\n const logOff = async () => {\r\n await api.post(logoffEnderecoWebService);\r\n\r\n auth.clearToken();\r\n history.push(ConstanteRotas.LOGIN);\r\n };\r\n\r\n const handleSetPage = (key) => {\r\n closeHandle();\r\n setCurrentPage(key);\r\n };\r\n\r\n const getRelatorios = useCallback(async () => {\r\n setIsLoading(true);\r\n const response = await api.get>(\r\n ConstanteEnderecoWebservice.RELATORIOS_DISPONIVEIS\r\n );\r\n if (response) {\r\n if (response.sucesso) {\r\n setRelatorios(response.dados);\r\n }\r\n\r\n if (response.avisos) {\r\n response.avisos.forEach((avisos: string) =>\r\n enqueueSnackbar(avisos, { variant: 'warning' })\r\n );\r\n }\r\n }\r\n setIsLoading(false);\r\n }, [enqueueSnackbar]);\r\n\r\n useEffect(() => {\r\n if (!sistemaIsZendarOrPowerstock) {\r\n getRelatorios();\r\n }\r\n }, [sistemaIsZendarOrPowerstock, getRelatorios]);\r\n\r\n return (\r\n <>\r\n \r\n {isLoading && }\r\n\r\n \r\n <>\r\n \r\n \r\n handleSetPage('todas-lojas')}\r\n color=\"secondary\"\r\n >\r\n \r\n Vendas\r\n \r\n \r\n \r\n\r\n {administrador &&\r\n !sistemaIsZendarOrPowerstock &&\r\n relatorios?.length > 0 && (\r\n \r\n )}\r\n\r\n \r\n\r\n \r\n {items.map((item) => (\r\n \r\n handleSetPage(item.key)}\r\n color=\"secondary\"\r\n >\r\n {item.Icon}\r\n {item.title}\r\n \r\n \r\n ))}\r\n \r\n\r\n {((administrador && !sistemaIsZendarOrPowerstock) || maisUmaLoja) && (\r\n \r\n )}\r\n\r\n {maisUmaLoja && (\r\n \r\n )}\r\n\r\n {administrador && !sistemaIsZendarOrPowerstock && (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Sair\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default NavItem;\r\n","import React, { useCallback, useEffect } from 'react';\r\nimport AppBar from '@material-ui/core/AppBar';\r\nimport CssBaseline from '@material-ui/core/CssBaseline';\r\nimport Drawer from '@material-ui/core/Drawer';\r\nimport Hidden from '@material-ui/core/Hidden';\r\nimport IconButton from '@material-ui/core/IconButton';\r\nimport ListItem from '@material-ui/core/ListItem';\r\n\r\nimport Toolbar from '@material-ui/core/Toolbar';\r\nimport Typography from '@material-ui/core/Typography';\r\nimport { makeStyles, useTheme } from '@material-ui/core/styles';\r\nimport RefreshOutlinedIcon from '@material-ui/icons/RefreshOutlined';\r\nimport Slide from '@material-ui/core/Slide';\r\nimport useScrollTrigger from '@material-ui/core/useScrollTrigger';\r\n\r\nimport { useLayout } from 'store/LayoutContext';\r\nimport { useChartData } from 'store/ChartDataContext';\r\n\r\nimport { colors } from '@material-ui/core';\r\nimport MenuIcon from '@material-ui/icons/Menu';\r\nimport ScaleLoader from 'react-spinners/ScaleLoader';\r\nimport NavItem from './NavItem';\r\n\r\nconst drawerWidth = 240;\r\nconst useStyles = makeStyles((theme) => ({\r\n root: {\r\n display: 'flex',\r\n },\r\n drawer: {\r\n [theme.breakpoints.up('sm')]: {\r\n flexShrink: 0,\r\n },\r\n background: '#2B3238',\r\n color: '#fff',\r\n },\r\n appBar: {\r\n zIndex: theme.zIndex.drawer + 1,\r\n background: '#36464E',\r\n },\r\n menuButton: {\r\n marginRight: theme.spacing(2),\r\n },\r\n toolbar: theme.mixins.toolbar,\r\n drawerPaper: {\r\n width: drawerWidth,\r\n background: '#2D3A40',\r\n color: '#fff',\r\n },\r\n content: {\r\n flexGrow: 1,\r\n padding: theme.spacing(1),\r\n background: '#36464E',\r\n height: '100%',\r\n },\r\n\r\n title: {\r\n flexGrow: 1,\r\n textAlign: 'center',\r\n color: '#fff',\r\n },\r\n listItem: {\r\n background: colors.blueGrey[800],\r\n },\r\n iconMenu: {\r\n fontSize: '25px',\r\n },\r\n iconRefresh: {\r\n fontSize: '25px',\r\n },\r\n cabecalhoNomeLoja: {\r\n display: 'inline-grid',\r\n background: colors.blueGrey[800],\r\n },\r\n}));\r\n\r\nfunction HideOnScroll(props: any) {\r\n const { children, window } = props;\r\n const trigger = useScrollTrigger({ target: window ? window() : undefined });\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n}\r\n\r\nconst Header: React.FC = ({ children }) => {\r\n const classes = useStyles();\r\n const theme = useTheme();\r\n const [mobileOpen, setMobileOpen] = React.useState(false);\r\n const { syncData, consultarAposLogin, loja } = useChartData();\r\n const {\r\n setLoadingReloadGraficos,\r\n loadingReloadGraficos,\r\n titlePage,\r\n } = useLayout();\r\n\r\n function handleDrawerToggle() {\r\n setMobileOpen(!mobileOpen);\r\n }\r\n\r\n const handleGet = useCallback(async () => {\r\n setLoadingReloadGraficos(true);\r\n\r\n await syncData();\r\n\r\n setLoadingReloadGraficos(false);\r\n }, [setLoadingReloadGraficos, syncData]);\r\n\r\n useEffect(() => {\r\n if (!consultarAposLogin) {\r\n handleGet();\r\n }\r\n }, [consultarAposLogin, handleGet]);\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {titlePage}\r\n \r\n {loadingReloadGraficos && (\r\n \r\n )}\r\n {!loadingReloadGraficos && (\r\n handleGet()}>\r\n \r\n \r\n )}\r\n \r\n \r\n \r\n\r\n \r\n
\r\n
\r\n {children}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default Header;\r\n","import React, { useState } from 'react';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport { Tune, AccessTime } from '@material-ui/icons';\r\nimport { BsDownload } from 'react-icons/bs';\r\nimport {\r\n Typography,\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n Button,\r\n Radio,\r\n RadioGroup,\r\n FormControlLabel,\r\n IconButton,\r\n colors,\r\n} from '@material-ui/core';\r\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n container: {\r\n margin: '5px 10px 10px 10px',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n },\r\n textTitulo: {\r\n fontWeight: 'bold',\r\n marginBottom: '-5px',\r\n display: 'flex',\r\n },\r\n textSubtitulo: {\r\n fontWeight: 'bold',\r\n marginTop: '4px',\r\n // bottom: '0',\r\n marginLeft: '4px',\r\n fontSize: '12px',\r\n verticalAlign: 'baseline',\r\n },\r\n textAtualizadoEm: {\r\n fontSize: '12px',\r\n marginLeft: '5px',\r\n },\r\n icon: {\r\n fontSize: '12px',\r\n verticalAlign: '-2px',\r\n },\r\n titulo: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifyContent: 'flex-end',\r\n gap: '4px',\r\n },\r\n dataSincronizacao: {\r\n // marginTop: '-25px',\r\n },\r\n dialog: {\r\n background: colors.blueGrey[800],\r\n color: '#fff',\r\n },\r\n containerTitle: {\r\n width: '100%',\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n\r\n [theme.breakpoints.down('sm')]: {\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n },\r\n },\r\n\r\n containerButton: {\r\n [theme.breakpoints.up('md')]: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n color: '#FFFF',\r\n },\r\n [theme.breakpoints.down('sm')]: {\r\n alignSelf: 'flex-end',\r\n width: '100%',\r\n marginTop: '8px',\r\n },\r\n },\r\n}));\r\n\r\ninterface Props {\r\n titulo: string;\r\n atualizadoEm: string;\r\n handleOrdem: (ordem: string) => void;\r\n exibirFiltro: boolean;\r\n subtitulo?: string;\r\n appearButtonDownload?: boolean;\r\n handleDownloadReport?(bol: boolean): void;\r\n downloadReportDisabled?: boolean;\r\n}\r\n\r\nconst HeaderCard = (props: Props) => {\r\n const classes = useStyles();\r\n const {\r\n titulo,\r\n subtitulo,\r\n atualizadoEm,\r\n handleOrdem,\r\n exibirFiltro,\r\n appearButtonDownload,\r\n handleDownloadReport,\r\n downloadReportDisabled,\r\n } = props;\r\n\r\n const isResponsiveVersion = useMediaQuery('(max-width: 960px)');\r\n\r\n const [open, setOpen] = useState(false);\r\n\r\n const [ordem, setOrdem] = useState('desc');\r\n const [ordemAplicada, setOrdemAplicada] = useState('desc');\r\n\r\n const handleClickOpen = () => {\r\n setOpen(true);\r\n setOrdem(ordemAplicada);\r\n };\r\n\r\n const handleClose = () => {\r\n setOpen(false);\r\n };\r\n\r\n const handleOk = () => {\r\n handleClose();\r\n setOrdemAplicada(ordem);\r\n handleOrdem(ordem);\r\n };\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n
\r\n \r\n {titulo}

{subtitulo}

\r\n
\r\n
\r\n \r\n \r\n Sincronizado em {atualizadoEm}\r\n \r\n
\r\n
\r\n {appearButtonDownload && (\r\n {\r\n if (handleDownloadReport) handleDownloadReport(true);\r\n }}\r\n className={classes.containerButton}\r\n disabled={downloadReportDisabled}\r\n >\r\n \r\n \r\n csv\r\n \r\n \r\n )}\r\n
\r\n {exibirFiltro && (\r\n handleClickOpen()}\r\n color=\"secondary\"\r\n >\r\n \r\n \r\n )}\r\n \r\n \r\n Selecione a ordem\r\n \r\n \r\n \r\n }\r\n label=\"Decrescente\"\r\n labelPlacement=\"end\"\r\n onClick={() => setOrdem('desc')}\r\n />\r\n }\r\n label=\"Crescente\"\r\n labelPlacement=\"end\"\r\n onClick={() => setOrdem('asc')}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n );\r\n};\r\n\r\nexport default HeaderCard;\r\n","import React, { useState, useEffect } from 'react';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport ToggleButton from '@material-ui/lab/ToggleButton';\r\nimport ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';\r\nimport { useSnackbar } from 'notistack';\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n container: {\r\n marginBottom: '10px',\r\n marginLeft: '10px',\r\n marginRight: '10px',\r\n },\r\n toggleButtonGroup: {\r\n width: '100%',\r\n height: '30px',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n background: (props: any) => props.bgNaoSelecionado,\r\n borderRadius: '10px !important',\r\n },\r\n toggleButton: {\r\n [theme.breakpoints.down('sm')]: {\r\n fontSize: (props: any) => props.fontSizeSmall,\r\n },\r\n fontSize: (props: any) => props.fontSize,\r\n\r\n width: '100%',\r\n color: (props: any) => `${props.color} !important`,\r\n border: (props: any) => `2px solid ${props.bgNaoSelecionado} !important`,\r\n borderRadius: '10px !important',\r\n textTransform: 'none',\r\n },\r\n}));\r\n\r\nconst RadioButtonFiltros = ({\r\n listItems,\r\n bgSelecionado,\r\n bgNaoSelecionado,\r\n color = '#fff',\r\n fontSize = '13px',\r\n fontSizeSmall = '11px',\r\n handle,\r\n opcaoPadrao = -1,\r\n}) => {\r\n const { enqueueSnackbar } = useSnackbar();\r\n const [option, setOption] = useState(-1);\r\n\r\n const handleChange = (event, newOption) => {\r\n if (newOption !== null) {\r\n const itemButton = listItems.filter(\r\n (item) => item.valor === newOption\r\n )[0];\r\n\r\n if (!itemButton.possuiDados) {\r\n enqueueSnackbar('Não existem informações para serem exibidas.', {\r\n variant: 'info',\r\n });\r\n return;\r\n }\r\n setOption(newOption);\r\n handle(newOption);\r\n }\r\n };\r\n\r\n const classes = useStyles({\r\n bgNaoSelecionado,\r\n color,\r\n fontSize,\r\n fontSizeSmall,\r\n });\r\n\r\n useEffect(() => {\r\n const itemsComValor = listItems.filter((item) => item.possuiDados);\r\n\r\n if (itemsComValor.length > 0)\r\n if (opcaoPadrao !== -1) {\r\n const filtroPadrao = itemsComValor.filter(\r\n (filtroItem) => filtroItem.valor === opcaoPadrao\r\n );\r\n\r\n if (filtroPadrao[0]) {\r\n setOption(opcaoPadrao);\r\n } else {\r\n setOption(itemsComValor[itemsComValor.length - 1].valor);\r\n }\r\n } else {\r\n setOption(itemsComValor[itemsComValor.length - 1].valor);\r\n }\r\n }, [listItems, opcaoPadrao]);\r\n\r\n return (\r\n <>\r\n {listItems && listItems[0]?.texto?.length > 0 && option >= 0 ? (\r\n
\r\n \r\n {listItems.map((item) => (\r\n \r\n {item.texto}\r\n \r\n ))}\r\n \r\n
\r\n ) : (\r\n <>\r\n )}\r\n \r\n );\r\n};\r\n\r\nexport default RadioButtonFiltros;\r\n","import React from 'react';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n height: '55px',\r\n background: '#fff',\r\n marginBottom: '10px',\r\n display: 'grid',\r\n verticalAlign: 'center',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n },\r\n rowValor: {\r\n color: '#1E2326',\r\n fontWeight: 'bold',\r\n fontSize: '18px',\r\n textAlign: 'center',\r\n },\r\n rowTitulo: {\r\n color: '#1E2326',\r\n fontSize: '16px',\r\n marginTop: '-15px',\r\n textAlign: 'center',\r\n },\r\n}));\r\n\r\nconst Totalizador = ({ valor, titulo, exibirEmReais = true }) => {\r\n const classes = useStyles();\r\n\r\n return (\r\n
\r\n
\r\n {exibirEmReais && R$ }\r\n {exibirEmReais ? formatarDinheiro(valor, false) : valor}\r\n
\r\n {titulo}\r\n
\r\n );\r\n};\r\n\r\nexport default Totalizador;\r\n","const IdentificacaoGrafico = {\r\n TodasEmpresas_VendasPorLoja: 0,\r\n TodasEmpresas_VendasPorFormaPagto: 1,\r\n TodasEmpresas_VendasPorOrigem: 2,\r\n Vendas_VendasPorVendedor: 3,\r\n Vendas_VendasPorHora: 4,\r\n Vendas_VendasPorDiaDaSemana: 5,\r\n Vendas_VendasPorFormaPagto: 6,\r\n Vendas_TicketMedio: 7,\r\n Vendas_Totalizadores: 8,\r\n Produtos_SituacaoProdutos: 9,\r\n Produtos_ProdutosMaisVendidos: 10,\r\n Produtos_ProdutosEmEstoque: 11,\r\n ContasAPagar_ContasAPagar: 12,\r\n ContasAPagar_ContasPagas: 13,\r\n ContasAReceber_ContasAReceber: 14,\r\n ContasAReceber_ContasRecebidas: 15,\r\n Produtos_TotalGruposVendidos: 16,\r\n};\r\n\r\nexport default IdentificacaoGrafico;\r\n","import React from 'react';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport { Typography } from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n marginBottom: '5px',\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n padding: '30px 0 30px 0',\r\n height: '100%',\r\n },\r\n}));\r\n\r\nconst GraficoSemDados = () => {\r\n const classes = useStyles();\r\n\r\n return (\r\n
\r\n \r\n Não existem informações para serem exibidas\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default GraficoSemDados;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport ProgressBar from 'components/ProgressBar';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport Totalizador from 'components/Totalizador';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\n\r\nconst VendaPorVendedor = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [progressBarList, setProgressBarList] = useState([] as any);\r\n const [valorTotal, setValorTotal] = useState(0);\r\n\r\n const obterDadosGrafico = useCallback((dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao === IdentificacaoGrafico.Vendas_VendasPorVendedor\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n }, []);\r\n\r\n const calcularPorcentagens = (list, total) => {\r\n const listPorcentagem = list.map((obj, index) => ({\r\n ...obj,\r\n id: index,\r\n porcentagem: obj.valor === 0 ? 0 : obj.valor / (total / 100),\r\n }));\r\n\r\n setProgressBarList(\r\n listPorcentagem.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n )\r\n );\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (!informacao) {\r\n setProgressBarList(undefined);\r\n return;\r\n }\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n setValorTotal(informacaoFiltro.Total);\r\n\r\n const Itens = informacaoFiltro.Dados.map((item, index) => {\r\n return { id: index, nome: item.Descricao, valor: item.Total };\r\n });\r\n\r\n calcularPorcentagens(Itens, informacaoFiltro.Total);\r\n },\r\n [chartData, obterDadosGrafico]\r\n );\r\n\r\n const handleOrdem = (ordem: string) => {\r\n const list =\r\n ordem === 'desc'\r\n ? progressBarList.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n )\r\n : progressBarList.sort(\r\n (a, b) => parseFloat(a.porcentagem) - parseFloat(b.porcentagem)\r\n );\r\n\r\n setProgressBarList([...list]);\r\n };\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setProgressBarList([]);\r\n setValorTotal(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n\r\n const filtros = informacao.dados.map((item) => {\r\n return {\r\n texto: item.Filtro.Descricao,\r\n valor: item.Filtro.Valor,\r\n possuiDados: item.Total > 0,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n setRadioButtonList(filtros);\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(\r\n filtrosComValor[filtrosComValor.length - 1].valor\r\n );\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro, obterDadosGrafico]);\r\n\r\n return (\r\n
\r\n \r\n \r\n\r\n \r\n\r\n {progressBarList?.length === 0 && }\r\n\r\n {progressBarList &&\r\n progressBarList.map((item) => (\r\n \r\n ))}\r\n
\r\n );\r\n};\r\n\r\nexport default VendaPorVendedor;\r\n","// eslint-disable-next-line @typescript-eslint/ban-ts-comment\r\n// @ts-nocheck\r\nimport React, { useEffect, useState } from 'react';\r\nimport 'react-modern-calendar-datepicker/lib/DatePicker.css';\r\nimport { Day, DayRange, Calendar } from 'react-modern-calendar-datepicker';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport { Dialog, DialogContent, Button } from '@material-ui/core';\r\nimport { useSnackbar } from 'notistack';\r\n\r\nimport { DateRange } from '@material-ui/icons';\r\n\r\ninterface DatePickerProps {\r\n onChange?: (selectedDate: { from: Date; to: Date }) => void;\r\n bgButtonColor?: string;\r\n bgDateColor?: string;\r\n labelColor?: string;\r\n fontSize?: string;\r\n fontSizeSmall?: string;\r\n defaultDateRange: DayRange;\r\n}\r\n\r\nconst myCustomLocale = {\r\n // months list by order\r\n months: [\r\n 'Janeiro',\r\n 'Fevereiro',\r\n 'Março',\r\n 'Abril',\r\n 'Maio',\r\n 'Junho',\r\n 'Julho',\r\n 'Agosto',\r\n 'Setembro',\r\n 'Outubro',\r\n 'Novembro',\r\n 'Dezembro',\r\n ],\r\n\r\n // week days by order\r\n weekDays: [\r\n {\r\n name: 'Domingo', // used for accessibility\r\n short: 'D', // displayed at the top of days' rows\r\n isWeekend: true, // is it a formal weekend or not?\r\n },\r\n {\r\n name: 'Segunda',\r\n short: 'S',\r\n },\r\n {\r\n name: 'Terça',\r\n short: 'T',\r\n },\r\n {\r\n name: 'Quarta',\r\n short: 'Q',\r\n },\r\n {\r\n name: 'Quinta',\r\n short: 'Q',\r\n },\r\n {\r\n name: 'Sexta',\r\n short: 'S',\r\n },\r\n {\r\n name: 'Sábado',\r\n short: 'S',\r\n isWeekend: true,\r\n },\r\n ],\r\n\r\n // just play around with this number between 0 and 6\r\n weekStartingIndex: 0,\r\n\r\n // return a { year: number, month: number, day: number } object\r\n getToday(gregorainTodayObject) {\r\n return gregorainTodayObject;\r\n },\r\n\r\n // return a native JavaScript date here\r\n toNativeDate(date) {\r\n return new Date(date.year, date.month - 1, date.day);\r\n },\r\n\r\n // return a number for date's month length\r\n getMonthLength(date) {\r\n return new Date(date.year, date.month, 0).getDate();\r\n },\r\n\r\n // return a transformed digit to your locale\r\n transformDigit(digit) {\r\n return digit;\r\n },\r\n\r\n // for input range value\r\n from: 'De',\r\n to: 'Até',\r\n\r\n // used for input value when multi dates are selected\r\n digitSeparator: ',',\r\n\r\n // if your provide -2 for example, year will be 2 digited\r\n yearLetterSkip: 0,\r\n\r\n // is your language rtl or ltr?\r\n isRtl: false,\r\n};\r\n\r\nconst DatePickerRange = ({\r\n onChange,\r\n defaultDateRange,\r\n bgButtonColor = '#993A50',\r\n bgDateColor = '#993A50',\r\n labelColor = '#fff',\r\n fontSize = '13px',\r\n fontSizeSmall = '11px',\r\n}: DatePickerProps) => {\r\n const { enqueueSnackbar } = useSnackbar();\r\n\r\n const useStyles = makeStyles((theme) => ({\r\n datepicker: {\r\n width: '100%',\r\n },\r\n calendar: {\r\n zIndex: '99999999',\r\n // border: '2px solid rgba(18, 17, 19, 0.2)',\r\n },\r\n container: {\r\n marginBottom: '10px',\r\n marginLeft: '10px',\r\n marginRight: '10px',\r\n display: 'flex',\r\n background: (props: any) => props.bgDateColor,\r\n borderRadius: '10px',\r\n border: (props: any) => `2px solid ${props.bgDateColor} !important`,\r\n },\r\n divShowDate: {\r\n width: '100%',\r\n height: '26px',\r\n display: 'flex',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n background: (props: any) => props.bgDateColor,\r\n borderRadius: '10px !important',\r\n [theme.breakpoints.down('sm')]: {\r\n fontSize: (props: any) => props.fontSizeSmall,\r\n },\r\n fontSize: (props: any) => props.fontSize,\r\n },\r\n }));\r\n\r\n const classes = useStyles({\r\n bgButtonColor,\r\n bgDateColor,\r\n labelColor,\r\n fontSize,\r\n fontSizeSmall,\r\n });\r\n\r\n const obterDataComponenteDatePicker = (date: Day) => {\r\n return (\r\n date &&\r\n `${date.day.toString().padStart(2, '0')}/${date.month\r\n .toString()\r\n .padStart(2, '0')}/${date.year}`\r\n );\r\n };\r\n\r\n const [modalIsOpen, setModalIsOpen] = useState(false);\r\n\r\n const [selectedDayRangeDatePicker, setSelectedDayRangeDatePicker] = useState<\r\n DayRange\r\n >(defaultDateRange);\r\n\r\n const [selectedDayRange, setSelectedDayRange] = useState(\r\n defaultDateRange\r\n );\r\n\r\n const [minimoMaximoDayRange, setMinimoMaximoDayRange] = useState(\r\n defaultDateRange\r\n );\r\n\r\n const onChangeSelectRangeDate = (value: DayRange) => {\r\n setSelectedDayRangeDatePicker(value);\r\n };\r\n\r\n const handleOk = () => {\r\n if (selectedDayRangeDatePicker.from) {\r\n const { from } = selectedDayRangeDatePicker;\r\n const to = selectedDayRangeDatePicker.to\r\n ? selectedDayRangeDatePicker.to\r\n : selectedDayRangeDatePicker.from;\r\n\r\n setSelectedDayRange({ from, to });\r\n\r\n onChange({\r\n from: new Date(from.year, from.month - 1, from.day, 0, 0, 0, 0),\r\n to: new Date(to.year, to.month - 1, to.day, 0, 0, 0, 0),\r\n });\r\n\r\n setModalIsOpen(false);\r\n } else {\r\n enqueueSnackbar('Período informado é inválido.', {\r\n variant: 'warning',\r\n });\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n const dateFrom = new Date(\r\n defaultDateRange.from?.year,\r\n defaultDateRange.from?.month,\r\n defaultDateRange.from?.day,\r\n 0,\r\n 0,\r\n 0,\r\n 0\r\n );\r\n dateFrom.setMonth(dateFrom.getMonth() - 3);\r\n\r\n setMinimoMaximoDayRange({\r\n from: {\r\n day: dateFrom.getDate(),\r\n month: dateFrom.getMonth(),\r\n year: dateFrom.getFullYear(),\r\n },\r\n to: defaultDateRange.to,\r\n });\r\n\r\n setSelectedDayRange(defaultDateRange);\r\n }, [defaultDateRange]);\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n \r\n Período:\r\n {` ${obterDataComponenteDatePicker(selectedDayRange.from)} `}\r\n até\r\n {` ${obterDataComponenteDatePicker(selectedDayRange.to)}`}\r\n \r\n
\r\n
\r\n {\r\n setSelectedDayRangeDatePicker(selectedDayRange);\r\n setModalIsOpen(true);\r\n }}\r\n >\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n (\r\n \r\n setModalIsOpen(false)}\r\n variant=\"outlined\"\r\n >\r\n Cancelar\r\n \r\n \r\n
\r\n )}\r\n />\r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nexport default DatePickerRange;\r\n","import { Day } from 'react-modern-calendar-datepicker';\r\n\r\nexport default function dateToDayDatePicker(date: Date): Day {\r\n return {\r\n day: date.getDate(),\r\n month: date.getMonth() + 1,\r\n year: date.getFullYear(),\r\n };\r\n}\r\n\r\nexport const formatDate = new Intl.DateTimeFormat('pt-BR', {\r\n day: '2-digit',\r\n month: '2-digit',\r\n year: '2-digit',\r\n});\r\n","export function minHourDate(date: Date): Date {\r\n return new Date(\r\n date.getFullYear(),\r\n date.getMonth(),\r\n date.getDate(),\r\n 0,\r\n 0,\r\n 0,\r\n 0\r\n );\r\n}\r\n\r\nexport function maxHourDate(date: Date): Date {\r\n return new Date(\r\n date.getFullYear(),\r\n date.getMonth(),\r\n date.getDate(),\r\n 23,\r\n 59,\r\n 59\r\n );\r\n}\r\n","import { maxHourDate, minHourDate } from './dateMinMax';\r\n\r\nexport default function extractInformationChartV2(\r\n informacao: any,\r\n dtInicial: any,\r\n dtFinal: any\r\n) {\r\n const informacoesFiltro = informacao.dados.filter((item) => {\r\n const dataItem = new Date(item.Data);\r\n return (\r\n dtInicial &&\r\n dtFinal &&\r\n dataItem >= minHourDate(dtInicial) &&\r\n dataItem <= maxHourDate(dtFinal)\r\n );\r\n });\r\n\r\n let valTotal = 0;\r\n const listItens = Array();\r\n\r\n for (let index = 0; index < informacoesFiltro.length; index += 1) {\r\n const infoFiltro = informacoesFiltro[index];\r\n valTotal += infoFiltro.Total;\r\n\r\n for (\r\n let indexDado = 0;\r\n indexDado < infoFiltro.Dados.length;\r\n indexDado += 1\r\n ) {\r\n const dado = infoFiltro.Dados[indexDado];\r\n\r\n const objIndex = listItens.findIndex(\r\n (obj) => obj.nome === dado.Descricao\r\n );\r\n\r\n if (objIndex === -1) {\r\n listItens.push({\r\n id: listItens.length - 1,\r\n nome: dado.Descricao,\r\n valor: dado.Total,\r\n });\r\n } else {\r\n const itemUpdate = listItens[objIndex];\r\n\r\n listItens[objIndex] = {\r\n id: itemUpdate.id,\r\n nome: itemUpdate.nome,\r\n valor: itemUpdate.valor + dado.Total,\r\n };\r\n }\r\n }\r\n }\r\n return { valTotal, listItens };\r\n}\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport ProgressBar from 'components/ProgressBar';\r\nimport Totalizador from 'components/Totalizador';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport DatePickerRange from 'components/DatePickerRange';\r\nimport dateToDayDatePicker from 'helpers/dateFormat';\r\nimport { DayRange } from 'react-modern-calendar-datepicker';\r\nimport extractInformationChartV2 from 'helpers/extractInformationChartV2';\r\n\r\nconst VendaPorVendedor = () => {\r\n const { chartData, loja } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [progressBarList, setProgressBarList] = useState([] as any);\r\n const [valorTotal, setValorTotal] = useState(0);\r\n const [defaultDateRange, setDefaultDateRange] = useState({\r\n from: dateToDayDatePicker(new Date()),\r\n to: dateToDayDatePicker(new Date()),\r\n });\r\n\r\n const resetGrafico = () => {\r\n setProgressBarList([]);\r\n setValorTotal(0);\r\n };\r\n\r\n const obterDadosGrafico = useCallback(\r\n (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao ===\r\n IdentificacaoGrafico.Vendas_VendasPorVendedor &&\r\n item.lojaId === loja.LojaId\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n },\r\n [loja.LojaId]\r\n );\r\n\r\n const calcularPorcentagens = (list, total) => {\r\n const listPorcentagem = list.map((obj, index) => ({\r\n ...obj,\r\n id: index,\r\n porcentagem: obj.valor === 0 ? 0 : obj.valor / (total / 100),\r\n }));\r\n\r\n setProgressBarList(\r\n listPorcentagem.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n )\r\n );\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (dtInicial, dtFinal) => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (!informacao) {\r\n setProgressBarList(undefined);\r\n return;\r\n }\r\n\r\n const { valTotal, listItens } = extractInformationChartV2(\r\n informacao,\r\n dtInicial,\r\n dtFinal\r\n );\r\n\r\n setValorTotal(valTotal);\r\n calcularPorcentagens(listItens, valTotal);\r\n },\r\n [chartData, obterDadosGrafico]\r\n );\r\n\r\n const handleOrdem = (ordem: string) => {\r\n const list =\r\n ordem === 'desc'\r\n ? progressBarList.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n )\r\n : progressBarList.sort(\r\n (a, b) => parseFloat(a.porcentagem) - parseFloat(b.porcentagem)\r\n );\r\n\r\n setProgressBarList([...list]);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n const dateTo = new Date(informacao.dataUltimaSincronizacao);\r\n const dateFrom = new Date(informacao.dataUltimaSincronizacao);\r\n\r\n setDataUltimaSincronizacao(dateTo.toLocaleString());\r\n\r\n setDefaultDateRange({\r\n from: dateToDayDatePicker(dateFrom),\r\n to: dateToDayDatePicker(dateTo),\r\n });\r\n\r\n const filtros = informacao.dados.map((item) => {\r\n return {\r\n texto: item.Data,\r\n valor: item.Data,\r\n possuiDados: item.Total > 0,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(dateFrom, dateTo);\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro, obterDadosGrafico]);\r\n\r\n const dateOnChange = (selectedDate: { from: Date; to: Date }) => {\r\n obterDadosPorFiltro(selectedDate.from, selectedDate.to);\r\n };\r\n\r\n return (\r\n
\r\n \r\n\r\n \r\n\r\n \r\n\r\n {progressBarList?.length === 0 && }\r\n\r\n {progressBarList &&\r\n progressBarList.map((item) => (\r\n \r\n ))}\r\n
\r\n );\r\n};\r\n\r\nexport default VendaPorVendedor;\r\n","/* eslint-disable radix */\r\nimport React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport ApexCharts from 'apexcharts';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport Totalizador from 'components/Totalizador';\r\n\r\nconst VendaPorHora = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [infoGraficoState, setInfoGraficoState] = useState(undefined);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) => item.identificacao === IdentificacaoGrafico.Vendas_VendasPorHora\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const atualizarGrafico = (list) => {\r\n const listSort = list.sort(\r\n (a, b) => parseFloat(a.hora) - parseFloat(b.hora)\r\n );\r\n\r\n const infoGrafico = {\r\n series: [\r\n {\r\n name: 'Vendas',\r\n data: [],\r\n },\r\n ],\r\n options: {\r\n chart: {\r\n type: 'area',\r\n id: 'venda-por-hora',\r\n toolbar: {\r\n show: false,\r\n },\r\n foreColor: '#fff',\r\n },\r\n colors: ['#fff'],\r\n fill: {\r\n gradient: {\r\n gradientToColors: ['#fff'],\r\n opacityFrom: 1,\r\n opacityTo: 0.5,\r\n },\r\n },\r\n dataLabels: {\r\n enabled: false,\r\n },\r\n stroke: {\r\n curve: 'smooth',\r\n },\r\n markers: {\r\n size: 5,\r\n colors: ['#fff'],\r\n strokeColor: '#fff',\r\n strokeWidth: 3,\r\n },\r\n xaxis: {\r\n categories: listSort.map((item) => `${item.hora}h`),\r\n labels: {\r\n show: true,\r\n style: {\r\n colors: ['#fff'],\r\n },\r\n },\r\n },\r\n grid: {\r\n borderColor: '#fff',\r\n yaxis: {\r\n lines: {\r\n show: true,\r\n },\r\n },\r\n },\r\n yaxis: {\r\n axisBorder: {\r\n show: false,\r\n },\r\n min: 0,\r\n title: {\r\n style: {\r\n color: '#fff',\r\n },\r\n },\r\n labels: {\r\n show: true,\r\n style: {\r\n colors: ['#fff'],\r\n },\r\n formatter: (value) => {\r\n return `${parseInt(value)}`;\r\n },\r\n },\r\n },\r\n labels: [],\r\n tooltip: {\r\n enabled: true,\r\n theme: 'dark',\r\n marker: {\r\n show: false,\r\n },\r\n },\r\n },\r\n };\r\n\r\n const newInfoGrafico = {\r\n ...infoGrafico,\r\n series: [{ name: 'Vendas', data: listSort.map((item) => item.valor) }],\r\n };\r\n\r\n // Necessário para atualização do gráfico\r\n try {\r\n ApexCharts.exec(\r\n newInfoGrafico.options.chart.id,\r\n 'updateOptions',\r\n newInfoGrafico.options\r\n );\r\n\r\n ApexCharts.exec('reactchart-example', 'resetSeries');\r\n\r\n // eslint-disable-next-line no-empty\r\n } catch (error) {}\r\n\r\n setInfoGraficoState(newInfoGrafico);\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n setInfoGraficoState(undefined);\r\n\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n setTotalVendas(informacaoFiltro.Total);\r\n\r\n const Itens = informacaoFiltro.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n hora: parseInt(item.Descricao),\r\n valor: parseInt(item.Total),\r\n };\r\n });\r\n\r\n atualizarGrafico(Itens);\r\n },\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Filtro.Descricao,\r\n valor: item.Filtro.Valor,\r\n possuiDados: item.Total > 0,\r\n key: index,\r\n };\r\n });\r\n if (filtros) {\r\n setRadioButtonList(filtros);\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(\r\n filtrosComValor[filtrosComValor.length - 1].valor\r\n );\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro]);\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n \r\n\r\n \r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n \r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default VendaPorHora;\r\n","/* eslint-disable radix */\r\nimport React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport ApexCharts from 'apexcharts';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport Totalizador from 'components/Totalizador';\r\nimport DatePickerRange from 'components/DatePickerRange';\r\nimport dateToDayDatePicker from 'helpers/dateFormat';\r\nimport { DayRange } from 'react-modern-calendar-datepicker';\r\nimport { maxHourDate, minHourDate } from 'helpers/dateMinMax';\r\n\r\nconst VendaPorHora = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [infoGraficoState, setInfoGraficoState] = useState(undefined);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [defaultDateRange, setDefaultDateRange] = useState({\r\n from: dateToDayDatePicker(new Date()),\r\n to: dateToDayDatePicker(new Date()),\r\n });\r\n\r\n const obterDadosGrafico = useCallback((dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) => item.identificacao === IdentificacaoGrafico.Vendas_VendasPorHora\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n }, []);\r\n\r\n const atualizarGrafico = (list) => {\r\n const listSort = list.sort(\r\n (a, b) => parseFloat(a.hora) - parseFloat(b.hora)\r\n );\r\n\r\n const infoGrafico = {\r\n series: [\r\n {\r\n name: 'Vendas',\r\n data: [],\r\n },\r\n ],\r\n options: {\r\n chart: {\r\n type: 'area',\r\n id: 'venda-por-hora',\r\n toolbar: {\r\n show: false,\r\n },\r\n foreColor: '#fff',\r\n },\r\n colors: ['#fff'],\r\n fill: {\r\n gradient: {\r\n gradientToColors: ['#fff'],\r\n opacityFrom: 1,\r\n opacityTo: 0.5,\r\n },\r\n },\r\n dataLabels: {\r\n enabled: false,\r\n },\r\n stroke: {\r\n curve: 'smooth',\r\n },\r\n markers: {\r\n size: 5,\r\n colors: ['#fff'],\r\n strokeColor: '#fff',\r\n strokeWidth: 3,\r\n },\r\n xaxis: {\r\n categories: listSort.map((item) => `${item.hora}h`),\r\n labels: {\r\n show: true,\r\n style: {\r\n colors: ['#fff'],\r\n },\r\n },\r\n },\r\n grid: {\r\n borderColor: '#fff',\r\n yaxis: {\r\n lines: {\r\n show: true,\r\n },\r\n },\r\n },\r\n yaxis: {\r\n axisBorder: {\r\n show: false,\r\n },\r\n min: 0,\r\n title: {\r\n style: {\r\n color: '#fff',\r\n },\r\n },\r\n labels: {\r\n show: true,\r\n style: {\r\n colors: ['#fff'],\r\n },\r\n formatter: (value) => {\r\n return `${parseInt(value)}`;\r\n },\r\n },\r\n },\r\n labels: [],\r\n tooltip: {\r\n enabled: true,\r\n theme: 'dark',\r\n marker: {\r\n show: false,\r\n },\r\n },\r\n },\r\n };\r\n\r\n const newInfoGrafico = {\r\n ...infoGrafico,\r\n series: [{ name: 'Vendas', data: listSort.map((item) => item.valor) }],\r\n };\r\n\r\n // Necessário para atualização do gráfico\r\n try {\r\n ApexCharts.exec(\r\n newInfoGrafico.options.chart.id,\r\n 'updateOptions',\r\n newInfoGrafico.options\r\n );\r\n\r\n ApexCharts.exec('reactchart-example', 'resetSeries');\r\n\r\n // eslint-disable-next-line no-empty\r\n } catch (error) {}\r\n\r\n setInfoGraficoState(newInfoGrafico);\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (dtInicial, dtFinal) => {\r\n setInfoGraficoState(undefined);\r\n\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacoesFiltro = informacao.dados.filter((item) => {\r\n const dataItem = new Date(item.Data);\r\n return (\r\n dtInicial &&\r\n dtFinal &&\r\n dataItem >= minHourDate(dtInicial) &&\r\n dataItem <= maxHourDate(dtFinal)\r\n );\r\n });\r\n\r\n let valTotal = 0;\r\n const listItens = Array();\r\n\r\n for (let index = 0; index < informacoesFiltro.length; index += 1) {\r\n const infoFiltro = informacoesFiltro[index];\r\n valTotal += infoFiltro.Total;\r\n for (\r\n let indexDado = 0;\r\n indexDado < infoFiltro.Dados.length;\r\n indexDado += 1\r\n ) {\r\n const dado = infoFiltro.Dados[indexDado];\r\n\r\n const objIndex = listItens.findIndex(\r\n (obj) => obj.hora === parseInt(dado.Descricao)\r\n );\r\n\r\n if (objIndex === -1) {\r\n listItens.push({\r\n id: listItens.length - 1,\r\n hora: parseInt(dado.Descricao),\r\n valor: parseInt(dado.Total),\r\n });\r\n } else {\r\n const itemUpdate = listItens[objIndex];\r\n\r\n listItens[objIndex] = {\r\n id: itemUpdate.id,\r\n hora: itemUpdate.hora,\r\n valor: itemUpdate.valor + dado.Total,\r\n };\r\n }\r\n }\r\n }\r\n\r\n setTotalVendas(valTotal);\r\n atualizarGrafico(listItens);\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n const dateTo = new Date(informacao.dataUltimaSincronizacao);\r\n const dateFrom = new Date(informacao.dataUltimaSincronizacao);\r\n\r\n setDataUltimaSincronizacao(dateTo.toLocaleString());\r\n\r\n setDefaultDateRange({\r\n from: dateToDayDatePicker(dateFrom),\r\n to: dateToDayDatePicker(dateTo),\r\n });\r\n\r\n const filtros = informacao.dados.map((item) => {\r\n return {\r\n texto: item.Data,\r\n valor: item.Data,\r\n possuiDados: item.Total > 0,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(dateFrom, dateTo);\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro, obterDadosGrafico]);\r\n\r\n const dateOnChange = (selectedDate: { from: Date; to: Date }) => {\r\n obterDadosPorFiltro(selectedDate.from, selectedDate.to);\r\n };\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n\r\n \r\n\r\n \r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n \r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default VendaPorHora;\r\n","/* eslint-disable radix */\r\nimport React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport ApexCharts from 'apexcharts';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport Totalizador from 'components/Totalizador';\r\n\r\nconst VendaPorDiaSemana = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [infoGraficoState, setInfoGraficoState] = useState(undefined);\r\n const [total, setTotal] = useState(0);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao === IdentificacaoGrafico.Vendas_VendasPorDiaDaSemana\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const atualizarGrafico = (list) => {\r\n const listSort = list.sort(\r\n (a, b) => parseFloat(a.hora) - parseFloat(b.hora)\r\n );\r\n\r\n const infoGrafico = {\r\n series: [\r\n {\r\n name: 'Vendas',\r\n data: [],\r\n },\r\n ],\r\n options: {\r\n chart: {\r\n type: 'bar',\r\n id: 'venda-por-dia-semana',\r\n toolbar: {\r\n show: false,\r\n },\r\n foreColor: '#fff',\r\n },\r\n colors: ['#00F5F7'],\r\n fill: {\r\n opacity: 1,\r\n },\r\n dataLabels: {\r\n enabled: false,\r\n },\r\n xaxis: {\r\n categories: listSort.map((item) => item.descricao),\r\n labels: {\r\n show: true,\r\n style: {\r\n colors: ['#fff'],\r\n },\r\n },\r\n },\r\n grid: {\r\n borderColor: '#fff',\r\n yaxis: {\r\n lines: {\r\n show: true,\r\n },\r\n },\r\n },\r\n yaxis: {\r\n axisBorder: {\r\n show: false,\r\n },\r\n min: 0,\r\n title: {\r\n style: {\r\n color: '#fff',\r\n },\r\n },\r\n labels: {\r\n show: true,\r\n style: {\r\n colors: ['#fff'],\r\n },\r\n formatter: (value) => {\r\n return `${parseInt(value)}`;\r\n },\r\n },\r\n },\r\n labels: [],\r\n tooltip: {\r\n enabled: true,\r\n theme: 'dark',\r\n marker: {\r\n show: false,\r\n },\r\n },\r\n },\r\n };\r\n\r\n const newInfoGrafico = {\r\n ...infoGrafico,\r\n series: [{ name: 'Vendas', data: listSort.map((item) => item.valor) }],\r\n };\r\n\r\n // Necessário para atualização do gráfico\r\n try {\r\n ApexCharts.exec(\r\n newInfoGrafico.options.chart.id,\r\n 'updateOptions',\r\n newInfoGrafico.options\r\n );\r\n\r\n ApexCharts.exec('reactchart-example', 'resetSeries');\r\n\r\n // eslint-disable-next-line no-empty\r\n } catch (error) {}\r\n\r\n setInfoGraficoState(newInfoGrafico);\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n setInfoGraficoState(undefined);\r\n\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n setTotal(informacaoFiltro.Total);\r\n\r\n const Itens = informacaoFiltro.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n descricao: item.Descricao,\r\n valor: parseInt(item.Total),\r\n };\r\n });\r\n\r\n atualizarGrafico(Itens);\r\n },\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setTotal(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Filtro.Descricao,\r\n valor: item.Filtro.Valor,\r\n possuiDados: item.Total > 0,\r\n key: index,\r\n };\r\n });\r\n if (filtros) {\r\n setRadioButtonList(filtros);\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(\r\n filtrosComValor[filtrosComValor.length - 1].valor\r\n );\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro]);\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n \r\n\r\n \r\n\r\n
\r\n {total === 0 && }\r\n {total > 0 && (\r\n \r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default VendaPorDiaSemana;\r\n","import React from 'react';\r\nimport { Divider, makeStyles } from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n background: (props: any) => props.corPrincipal,\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n padding: '5px 10px 0px 10px',\r\n margin: '0px 10px 0px 10px',\r\n },\r\n divider: {\r\n margin: '0px 10px 0px 10px',\r\n background: (props: any) => props.corFundo,\r\n },\r\n porcentagem: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n height: '100%',\r\n fontWeight: 'bold',\r\n },\r\n iconCor: {\r\n height: '14px',\r\n width: '14px',\r\n background: (props: any) => props.cor,\r\n borderRadius: '2px',\r\n },\r\n descricao: {\r\n color: (props: any) => props.cor,\r\n },\r\n valor: {\r\n paddingLeft: '5px',\r\n fontSize: '12px',\r\n },\r\n}));\r\n\r\nexport interface LegendaProps {\r\n cor: string;\r\n descricao: string;\r\n valor: string;\r\n porcentagem: string;\r\n corPrincipal: string;\r\n corFundo: string;\r\n}\r\n\r\nconst LegendaGrafico = (props: LegendaProps) => {\r\n const { cor, descricao, valor, porcentagem, corPrincipal, corFundo } = props;\r\n const classes = useStyles({ cor, corPrincipal, corFundo });\r\n\r\n return (\r\n <>\r\n
\r\n \r\n
{descricao}
\r\n
\r\n
\r\n

{valor}

\r\n
\r\n
\r\n
\r\n
\r\n

{porcentagem}

\r\n
\r\n
\r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nexport default LegendaGrafico;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport ApexCharts from 'apexcharts';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport LegendaGrafico from 'components/LegendaGrafico';\r\nimport Totalizador from 'components/Totalizador';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\n\r\nconst VendaLojaPorFormaPagamento = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [infoGraficoState, setInfoGraficoState] = useState(undefined);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [legenda, setLegenda] = useState([] as Array);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao === IdentificacaoGrafico.Vendas_VendasPorFormaPagto\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const atualizarGrafico = (list, total) => {\r\n const colors = [\r\n '#008FFB',\r\n '#00E396',\r\n '#FEB019',\r\n '#FF4560',\r\n '#775DD0',\r\n '#03A9F4',\r\n '#4CAF50',\r\n '#F9CE1D',\r\n '#FF9800',\r\n '#33B2DF',\r\n '#c9509b',\r\n ];\r\n\r\n const listPorcentagem = list.map((obj, index) => ({\r\n ...obj,\r\n id: index,\r\n porcentagem: obj.valor === 0 ? 0 : obj.valor / (total / 100),\r\n }));\r\n\r\n const listSort = listPorcentagem.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n );\r\n\r\n setLegenda(\r\n listSort.map((item, index) => ({\r\n cor: colors[index <= colors.length - 1 ? index : index % colors.length],\r\n formaPagto: item.nome,\r\n valor: item.valor,\r\n porcentagem: `${item.porcentagem.toFixed(1)}%`,\r\n }))\r\n );\r\n\r\n const infoGrafico = {\r\n series: listSort.map((item) => item.porcentagem),\r\n\r\n options: {\r\n stroke: {\r\n lineCap: 'round',\r\n },\r\n chart: {\r\n id: 'vendas-por-forma-pagamento',\r\n },\r\n colors,\r\n labels: listSort.map((item) => item.nome),\r\n legend: {\r\n show: false,\r\n position: 'bottom',\r\n horizontalAlign: 'center',\r\n floating: false,\r\n labels: {\r\n colors: '#fff',\r\n useSeriesColors: false,\r\n },\r\n itemMargin: {\r\n horizontal: 10,\r\n vertical: 5,\r\n },\r\n onItemClick: {\r\n toggleDataSeries: false,\r\n },\r\n },\r\n tooltip: {\r\n enabled: true,\r\n y: {\r\n formatter: (val) => `${val.toFixed(1)}%`,\r\n },\r\n },\r\n },\r\n };\r\n\r\n const newInfoGrafico = {\r\n ...infoGrafico,\r\n series: listSort.map((item) => item.porcentagem),\r\n options: {\r\n ...infoGrafico.options,\r\n labels: listSort.map((item) => item.nome),\r\n },\r\n };\r\n\r\n // Necessário para atualização do gráfico\r\n try {\r\n ApexCharts.exec(\r\n newInfoGrafico.options.chart.id,\r\n 'updateOptions',\r\n newInfoGrafico.options\r\n );\r\n\r\n ApexCharts.exec(newInfoGrafico.options.chart.id, 'resetSeries');\r\n\r\n // eslint-disable-next-line no-empty\r\n } catch (error) {}\r\n\r\n setInfoGraficoState(newInfoGrafico);\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n setInfoGraficoState(undefined);\r\n\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n const Itens = informacaoFiltro.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n nome: item.Descricao,\r\n valor: item.Total,\r\n };\r\n });\r\n\r\n setTotalVendas(informacaoFiltro.Total);\r\n atualizarGrafico(Itens, informacaoFiltro.Total);\r\n },\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n // const informacao = obterDadosGrafico(chartData);\r\n // if (informacao) {\r\n // setDataUltimaSincronizacao(\r\n // new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n // );\r\n // const filtros = informacao.dados.map((item, index) => {\r\n // return {\r\n // texto: item.Filtro.Descricao,\r\n // valor: item.Filtro.Valor,\r\n // possuiDados: item.Total > 0,\r\n // key: index,\r\n // };\r\n // });\r\n // if (filtros) {\r\n // setRadioButtonList(filtros);\r\n // const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n // if (filtrosComValor.length > 0) {\r\n // obterDadosPorFiltro(\r\n // filtrosComValor[filtrosComValor.length - 1].valor\r\n // );\r\n // } else {\r\n // resetGrafico();\r\n // }\r\n // }\r\n // } else {\r\n // resetGrafico();\r\n // }\r\n }, [chartData, obterDadosPorFiltro]);\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n \r\n\r\n \r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n \r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default VendaLojaPorFormaPagamento;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport ApexCharts from 'apexcharts';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport LegendaGrafico from 'components/LegendaGrafico';\r\nimport Totalizador from 'components/Totalizador';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\nimport DatePickerRange from 'components/DatePickerRange';\r\nimport dateToDayDatePicker from 'helpers/dateFormat';\r\nimport { DayRange } from 'react-modern-calendar-datepicker';\r\nimport extractInformationChartV2 from 'helpers/extractInformationChartV2';\r\n\r\nconst VendaLojaPorFormaPagamento = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [infoGraficoState, setInfoGraficoState] = useState(undefined);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [legenda, setLegenda] = useState([] as Array);\r\n const [defaultDateRange, setDefaultDateRange] = useState({\r\n from: dateToDayDatePicker(new Date()),\r\n to: dateToDayDatePicker(new Date()),\r\n });\r\n\r\n const obterDadosGrafico = useCallback((dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao === IdentificacaoGrafico.Vendas_VendasPorFormaPagto\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n }, []);\r\n\r\n const atualizarGrafico = (list, total) => {\r\n const colors = [\r\n '#008FFB',\r\n '#00E396',\r\n '#FEB019',\r\n '#FF4560',\r\n '#775DD0',\r\n '#03A9F4',\r\n '#4CAF50',\r\n '#F9CE1D',\r\n '#FF9800',\r\n '#33B2DF',\r\n '#c9509b',\r\n ];\r\n\r\n const listPorcentagem = list.map((obj, index) => ({\r\n ...obj,\r\n id: index,\r\n porcentagem: obj.valor === 0 ? 0 : obj.valor / (total / 100),\r\n }));\r\n\r\n const listSort = listPorcentagem.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n );\r\n\r\n setLegenda(\r\n listSort.map((item, index) => ({\r\n cor: colors[index <= colors.length - 1 ? index : index % colors.length],\r\n formaPagto: item.nome,\r\n valor: item.valor,\r\n porcentagem: `${item.porcentagem.toFixed(1)}%`,\r\n }))\r\n );\r\n\r\n const infoGrafico = {\r\n series: listSort.map((item) => item.porcentagem),\r\n\r\n options: {\r\n stroke: {\r\n lineCap: 'round',\r\n },\r\n chart: {\r\n id: 'vendas-por-forma-pagamento',\r\n },\r\n colors,\r\n labels: listSort.map((item) => item.nome),\r\n legend: {\r\n show: false,\r\n position: 'bottom',\r\n horizontalAlign: 'center',\r\n floating: false,\r\n labels: {\r\n colors: '#fff',\r\n useSeriesColors: false,\r\n },\r\n itemMargin: {\r\n horizontal: 10,\r\n vertical: 5,\r\n },\r\n onItemClick: {\r\n toggleDataSeries: false,\r\n },\r\n },\r\n tooltip: {\r\n enabled: true,\r\n y: {\r\n formatter: (val) => `${val.toFixed(1)}%`,\r\n },\r\n },\r\n },\r\n };\r\n\r\n const newInfoGrafico = {\r\n ...infoGrafico,\r\n series: listSort.map((item) => item.porcentagem),\r\n options: {\r\n ...infoGrafico.options,\r\n labels: listSort.map((item) => item.nome),\r\n },\r\n };\r\n\r\n // Necessário para atualização do gráfico\r\n try {\r\n ApexCharts.exec(\r\n newInfoGrafico.options.chart.id,\r\n 'updateOptions',\r\n newInfoGrafico.options\r\n );\r\n\r\n ApexCharts.exec(newInfoGrafico.options.chart.id, 'resetSeries');\r\n\r\n // eslint-disable-next-line no-empty\r\n } catch (error) {}\r\n\r\n setInfoGraficoState(newInfoGrafico);\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (dtInicial, dtFinal) => {\r\n setInfoGraficoState(undefined);\r\n\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const { valTotal, listItens } = extractInformationChartV2(\r\n informacao,\r\n dtInicial,\r\n dtFinal\r\n );\r\n\r\n setTotalVendas(valTotal);\r\n atualizarGrafico(listItens, valTotal);\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n const dateTo = new Date(informacao.dataUltimaSincronizacao);\r\n const dateFrom = new Date(informacao.dataUltimaSincronizacao);\r\n\r\n setDataUltimaSincronizacao(dateTo.toLocaleString());\r\n\r\n setDefaultDateRange({\r\n from: dateToDayDatePicker(dateFrom),\r\n to: dateToDayDatePicker(dateTo),\r\n });\r\n\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Data,\r\n valor: item.Data,\r\n possuiDados: item.Total > 0,\r\n key: index,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(dateFrom, dateTo);\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro, obterDadosGrafico]);\r\n\r\n const dateOnChange = (selectedDate: { from: Date; to: Date }) => {\r\n obterDadosPorFiltro(selectedDate.from, selectedDate.to);\r\n };\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n\r\n \r\n\r\n \r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n \r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default VendaLojaPorFormaPagamento;\r\n","/* eslint-disable radix */\r\nimport React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport ApexCharts from 'apexcharts';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport Totalizador from 'components/Totalizador';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\n\r\nconst VendaTicketMedio = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [infoGraficoState, setInfoGraficoState] = useState(undefined);\r\n const [ticketMedio, setTicketMedio] = useState(0);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) => item.identificacao === IdentificacaoGrafico.Vendas_TicketMedio\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const atualizarGrafico = (list, ticketMedioValor, filtro) => {\r\n const infoGrafico = {\r\n series: [\r\n {\r\n name: 'Vendas',\r\n data: [],\r\n type: 'area',\r\n },\r\n {\r\n name: 'Ticket médio',\r\n data: [],\r\n type: 'line',\r\n },\r\n ],\r\n options: {\r\n chart: {\r\n id: 'ticket-medio',\r\n toolbar: {\r\n show: false,\r\n },\r\n foreColor: '#fff',\r\n },\r\n colors: ['#fff', '#FEB019'],\r\n fill: {\r\n type: 'solid',\r\n opacity: [0.35, 1],\r\n },\r\n dataLabels: {\r\n enabled: false,\r\n },\r\n stroke: {\r\n curve: 'smooth',\r\n },\r\n // markers: {\r\n // size: 5,\r\n // colors: ['#fff', '#FEB019'],\r\n // strokeColor: '#fff',\r\n // strokeWidth: 3,\r\n // },\r\n xaxis: {\r\n title: {\r\n text: filtro === 7 ? 'Meses' : 'Dias',\r\n offsetX: 0,\r\n offsetY: 10,\r\n style: {\r\n color: undefined,\r\n fontSize: '14px',\r\n fontWeight: 600,\r\n },\r\n },\r\n categories: list.map((item) => item.data),\r\n labels: {\r\n show: true,\r\n style: {\r\n colors: ['#fff'],\r\n },\r\n },\r\n },\r\n grid: {\r\n borderColor: '#fff',\r\n yaxis: {\r\n lines: {\r\n show: true,\r\n },\r\n },\r\n },\r\n yaxis: {\r\n axisBorder: {\r\n show: false,\r\n },\r\n min: 0,\r\n title: {\r\n style: {\r\n color: '#fff',\r\n },\r\n },\r\n labels: {\r\n show: true,\r\n style: {\r\n colors: ['#fff'],\r\n },\r\n formatter: (value) => {\r\n return `${parseInt(value)}`;\r\n },\r\n },\r\n },\r\n labels: [],\r\n tooltip: {\r\n y: {\r\n formatter(value) {\r\n return `${formatarDinheiro(value, true)}`;\r\n },\r\n },\r\n enabled: true,\r\n theme: 'dark',\r\n marker: {\r\n show: false,\r\n },\r\n },\r\n legend: {\r\n position: 'top',\r\n // horizontalAlign: 'right',\r\n // itemMargin: {\r\n // horizontal: 5,\r\n // vertical: 0\r\n // },\r\n },\r\n },\r\n };\r\n\r\n const newInfoGrafico = {\r\n ...infoGrafico,\r\n series: [\r\n { name: 'Vendas', data: list.map((item) => item.valor), type: 'area' },\r\n {\r\n name: 'Ticket médio',\r\n data: list.map(() => ticketMedioValor),\r\n type: 'line',\r\n },\r\n ],\r\n };\r\n\r\n // Necessário para atualização do gráfico\r\n try {\r\n ApexCharts.exec(\r\n newInfoGrafico.options.chart.id,\r\n 'updateOptions',\r\n newInfoGrafico.options\r\n );\r\n\r\n ApexCharts.exec('reactchart-example', 'resetSeries');\r\n\r\n // eslint-disable-next-line no-empty\r\n } catch (error) {}\r\n\r\n setInfoGraficoState(newInfoGrafico);\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n setInfoGraficoState(undefined);\r\n\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n setTicketMedio(informacaoFiltro.Total);\r\n\r\n const Itens = informacaoFiltro.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n data: item.Descricao,\r\n valor: item.Total,\r\n };\r\n });\r\n\r\n atualizarGrafico(Itens, informacaoFiltro.Total, valor);\r\n },\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setTicketMedio(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Filtro.Descricao,\r\n valor: item.Filtro.Valor,\r\n possuiDados: item.Total > 0,\r\n key: index,\r\n };\r\n });\r\n if (filtros) {\r\n setRadioButtonList(filtros);\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(\r\n filtrosComValor[filtrosComValor.length - 1].valor\r\n );\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro]);\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n \r\n\r\n \r\n\r\n
\r\n {ticketMedio === 0 && }\r\n {ticketMedio > 0 && (\r\n \r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default VendaTicketMedio;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport Totalizador from 'components/Totalizador';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\nimport { Divider, makeStyles } from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n background: '#18826B',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n padding: '5px 10px 0px 10px',\r\n margin: '0px 10px 0px 10px',\r\n },\r\n divider: {\r\n margin: '0px 10px 0px 10px',\r\n background: '#28D8B2',\r\n },\r\n porcentagem: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n height: '100%',\r\n fontWeight: 'bold',\r\n },\r\n descricao: {\r\n color: (props: any) => props.cor,\r\n },\r\n valor: {\r\n fontSize: '12px',\r\n },\r\n}));\r\n\r\nconst VendaTotalizadores = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [legenda, setLegenda] = useState([] as Array);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) => item.identificacao === IdentificacaoGrafico.Vendas_Totalizadores\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n const items = informacaoFiltro.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n descricao: item.Descricao,\r\n obs: item.InformacaoAdicional[0].Descricao,\r\n valor: item.Total,\r\n };\r\n });\r\n\r\n setTotalVendas(informacaoFiltro.Total);\r\n setLegenda(items);\r\n },\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Filtro.Descricao,\r\n valor: item.Filtro.Valor,\r\n possuiDados: item.Total > 0,\r\n key: index,\r\n };\r\n });\r\n if (filtros) {\r\n setRadioButtonList(filtros);\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(\r\n filtrosComValor[filtrosComValor.length - 1].valor\r\n );\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro]);\r\n\r\n const InfoGrafico = (props) => {\r\n const { descricao, valor, obs } = props;\r\n const classes = useStyles({ cor: 'white' });\r\n\r\n return (\r\n <>\r\n
\r\n \r\n
{descricao}
\r\n
\r\n

{obs}

\r\n
\r\n
\r\n
\r\n
\r\n

{formatarDinheiro(valor, true)}

\r\n
\r\n
\r\n \r\n \r\n \r\n );\r\n };\r\n return (\r\n <>\r\n {}}\r\n />\r\n \r\n\r\n \r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default VendaTotalizadores;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport Totalizador from 'components/Totalizador';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\nimport { Divider, makeStyles } from '@material-ui/core';\r\nimport DatePickerRange from 'components/DatePickerRange';\r\nimport dateToDayDatePicker from 'helpers/dateFormat';\r\nimport { DayRange } from 'react-modern-calendar-datepicker';\r\nimport { maxHourDate, minHourDate } from 'helpers/dateMinMax';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n background: '#18826B',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n padding: '5px 10px 0px 10px',\r\n margin: '0px 10px 0px 10px',\r\n },\r\n divider: {\r\n margin: '0px 10px 0px 10px',\r\n background: '#28D8B2',\r\n },\r\n porcentagem: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n height: '100%',\r\n fontWeight: 'bold',\r\n },\r\n descricao: {\r\n color: (props: any) => props.cor,\r\n },\r\n valor: {\r\n fontSize: '12px',\r\n },\r\n}));\r\n\r\nconst VendaTotalizadores = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [legenda, setLegenda] = useState([] as Array);\r\n const [defaultDateRange, setDefaultDateRange] = useState({\r\n from: dateToDayDatePicker(new Date()),\r\n to: dateToDayDatePicker(new Date()),\r\n });\r\n\r\n const obterDadosGrafico = useCallback((dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) => item.identificacao === IdentificacaoGrafico.Vendas_Totalizadores\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n }, []);\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (dtInicial, dtFinal) => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacoesFiltro = informacao.dados.filter((item) => {\r\n const dataItem = new Date(item.Data);\r\n return (\r\n dtInicial &&\r\n dtFinal &&\r\n dataItem >= minHourDate(dtInicial) &&\r\n dataItem <= maxHourDate(dtFinal)\r\n );\r\n });\r\n\r\n let valTotal = 0;\r\n const listItens = Array();\r\n\r\n for (let index = 0; index < informacoesFiltro.length; index += 1) {\r\n const infoFiltro = informacoesFiltro[index];\r\n valTotal += infoFiltro.Total;\r\n\r\n for (\r\n let indexDado = 0;\r\n indexDado < infoFiltro.Dados.length;\r\n indexDado += 1\r\n ) {\r\n const dado = infoFiltro.Dados[indexDado];\r\n\r\n const objIndex = listItens.findIndex(\r\n (obj) =>\r\n obj.descricao === dado.Descricao &&\r\n obj.obs === dado.InformacaoAdicional[0].Descricao\r\n );\r\n\r\n if (objIndex === -1) {\r\n listItens.push({\r\n id: listItens.length - 1,\r\n descricao: dado.Descricao,\r\n obs: dado.InformacaoAdicional[0].Descricao,\r\n valor: dado.Total,\r\n });\r\n } else {\r\n const itemUpdate = listItens[objIndex];\r\n\r\n listItens[objIndex] = {\r\n id: itemUpdate.id,\r\n descricao: dado.Descricao,\r\n obs: dado.InformacaoAdicional[0].Descricao,\r\n valor: itemUpdate.valor + dado.Total,\r\n };\r\n }\r\n }\r\n }\r\n\r\n setTotalVendas(valTotal);\r\n setLegenda(listItens);\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n const dateTo = new Date(informacao.dataUltimaSincronizacao);\r\n const dateFrom = new Date(informacao.dataUltimaSincronizacao);\r\n\r\n setDataUltimaSincronizacao(dateTo.toLocaleString());\r\n\r\n setDefaultDateRange({\r\n from: dateToDayDatePicker(dateFrom),\r\n to: dateToDayDatePicker(dateTo),\r\n });\r\n\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Data,\r\n valor: item.Total,\r\n possuiDados: item.Total > 0,\r\n key: index,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(dateFrom, dateTo);\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro, obterDadosGrafico]);\r\n\r\n const InfoGrafico = (props) => {\r\n const { descricao, valor, obs } = props;\r\n const classes = useStyles({ cor: 'white' });\r\n\r\n return (\r\n <>\r\n
\r\n \r\n
{descricao}
\r\n
\r\n

{obs}

\r\n
\r\n
\r\n
\r\n
\r\n

{formatarDinheiro(valor, true)}

\r\n
\r\n
\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n const dateOnChange = (selectedDate: { from: Date; to: Date }) => {\r\n obterDadosPorFiltro(selectedDate.from, selectedDate.to);\r\n };\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n\r\n \r\n\r\n \r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default VendaTotalizadores;\r\n","import React from 'react';\r\nimport { Card, Grid, Container } from '@material-ui/core';\r\nimport { makeStyles, Theme } from '@material-ui/core/styles';\r\nimport VendaPorVendedorV1 from 'components/Grafico/Loja/VendaPorVendedor/v1/VendaPorVendedor';\r\nimport VendaPorVendedorV2 from 'components/Grafico/Loja/VendaPorVendedor/v2/VendaPorVendedor';\r\nimport VendaPorHoraV1 from 'components/Grafico/Loja/VendaPorHora/v1/VendaPorHora';\r\nimport VendaPorHoraV2 from 'components/Grafico/Loja/VendaPorHora/v2/VendaPorHora';\r\nimport VendaPorDiaSemana from 'components/Grafico/Loja/VendaPorDiaSemana';\r\nimport VendaLojaPorFormaPagamentoV1 from 'components/Grafico/Loja/VendaLojaPorFormaPagamento/v1/VendaLojaPorFormaPagamento';\r\nimport VendaLojaPorFormaPagamentoV2 from 'components/Grafico/Loja/VendaLojaPorFormaPagamento/v2/VendaLojaPorFormaPagamento';\r\n\r\nimport VendaTicketMedio from 'components/Grafico/Loja/VendaTicketMedio';\r\nimport VendaTotalizadoresV1 from 'components/Grafico/Loja/VendaTotalizadores/v1/VendaTotalizadores';\r\nimport VendaTotalizadoresV2 from 'components/Grafico/Loja/VendaTotalizadores/v2/VendaTotalizadores';\r\n\r\nimport { useLayout } from 'store/LayoutContext';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\n\r\nconst useStyles = makeStyles((theme: Theme) => ({\r\n container: {\r\n paddingLeft: '0px',\r\n paddingRight: '0px',\r\n minWidth: '100%',\r\n minheight: '100%',\r\n },\r\n fab: {\r\n position: 'fixed',\r\n bottom: theme.spacing(2),\r\n right: theme.spacing(2),\r\n 'z-index': '999',\r\n },\r\n}));\r\n\r\nconst Vendas: React.FC = () => {\r\n const classes = useStyles();\r\n const { setTitlePage } = useLayout();\r\n const { obterVersaoGrafico } = useChartData();\r\n\r\n React.useEffect(() => {\r\n setTitlePage('Vendas');\r\n });\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n {obterVersaoGrafico(\r\n IdentificacaoGrafico.Vendas_VendasPorVendedor\r\n ) === 1 ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {obterVersaoGrafico(IdentificacaoGrafico.Vendas_VendasPorHora) ===\r\n 1 ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {obterVersaoGrafico(\r\n IdentificacaoGrafico.Vendas_VendasPorFormaPagto\r\n ) === 1 ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {obterVersaoGrafico(IdentificacaoGrafico.Vendas_Totalizadores) ===\r\n 1 ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Vendas;\r\n","import React, { useEffect, useState } from 'react';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\nimport SyncDisabledIcon from '@material-ui/icons/SyncDisabled';\r\nimport { Tooltip } from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n height: 40,\r\n backgroundColor: '#323B40',\r\n borderRadius: 0,\r\n margin: '0px 10px 5px 10px',\r\n opacity: (props: any) => (props.sincronizado ? 'unset' : '0.6'),\r\n },\r\n divComplete: {\r\n height: '100%',\r\n transition: 'width 1s ease-in-out',\r\n },\r\n spanNome: {\r\n color: '#fff',\r\n float: 'left',\r\n position: 'relative',\r\n marginTop: '-38px',\r\n marginLeft: '15px',\r\n fontWeight: 'bold',\r\n whiteSpace: 'nowrap',\r\n },\r\n spanCidade: {\r\n color: '#fff',\r\n float: 'left',\r\n position: 'relative',\r\n marginTop: '-18px',\r\n marginLeft: '15px',\r\n fontSize: '11px',\r\n whiteSpace: 'nowrap',\r\n },\r\n spanValor: {\r\n color: '#fff',\r\n float: 'right',\r\n position: 'relative',\r\n marginTop: '-30px',\r\n marginRight: '15px',\r\n },\r\n syncProblemIcon: {\r\n color: 'rgb(250, 91, 91)',\r\n float: 'right',\r\n position: 'relative',\r\n marginTop: '-32px',\r\n marginRight: '15px',\r\n cursor: 'pointer',\r\n },\r\n}));\r\n\r\nconst ProgressBar = ({ ...props }) => {\r\n const { bgcolor, completed, nome, cidade, valor, sincronizado, key } = props;\r\n const classes = useStyles({ sincronizado });\r\n const [completedState, setCompletedState] = useState(0);\r\n const [open, setOpen] = React.useState(false);\r\n\r\n const handleTooltipButton = () => {\r\n setOpen(!open);\r\n };\r\n\r\n useEffect(() => {\r\n setCompletedState(completed);\r\n }, [completed]);\r\n\r\n return (\r\n
\r\n \r\n
\r\n {nome}\r\n {cidade}\r\n
\r\n {sincronizado ? (\r\n <>\r\n \r\n {formatarDinheiro(valor, true)}\r\n \r\n \r\n ) : (\r\n \r\n Sincronização pendente\r\n \r\n }\r\n placement=\"left\"\r\n >\r\n \r\n \r\n )}\r\n
\r\n );\r\n};\r\n\r\nexport default ProgressBar;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport ProgressBar from 'components/ProgressBarVendaPorLoja';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport Totalizador from 'components/Totalizador';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\n\r\nconst VendaPorLoja = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [progressBarList, setProgressBarList] = useState([] as any);\r\n const [valorTotal, setValorTotal] = useState(0);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao === IdentificacaoGrafico.TodasEmpresas_VendasPorLoja\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const calcularPorcentagens = (list, total) => {\r\n const listPorcentagem = list.map((obj, index) => ({\r\n ...obj,\r\n id: index,\r\n porcentagem: obj.valor === 0 ? 0 : obj.valor / (total / 100),\r\n }));\r\n\r\n setProgressBarList(\r\n listPorcentagem.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n )\r\n );\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n setValorTotal(informacaoFiltro.ValorTotal);\r\n\r\n const Itens = informacaoFiltro.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n nome: item.NomeFantasia,\r\n cidade: item.CidadeUf,\r\n valor: item.Sincronizado ? item.ValorTotal : -1,\r\n sincronizado: item.Sincronizado,\r\n };\r\n });\r\n\r\n calcularPorcentagens(Itens, informacaoFiltro.ValorTotal);\r\n },\r\n [chartData]\r\n );\r\n\r\n const handleOrdem = (ordem: string) => {\r\n const list =\r\n ordem === 'desc'\r\n ? progressBarList.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n )\r\n : progressBarList.sort(\r\n (a, b) => parseFloat(a.porcentagem) - parseFloat(b.porcentagem)\r\n );\r\n\r\n setProgressBarList([...list]);\r\n };\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setProgressBarList([]);\r\n setValorTotal(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n\r\n const filtros = informacao.dados.map((item) => {\r\n return {\r\n texto: item.Filtro.Descricao,\r\n valor: item.Filtro.Valor,\r\n possuiDados: item.ValorTotal > 0,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n setRadioButtonList(filtros);\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(\r\n filtrosComValor[filtrosComValor.length - 1].valor\r\n );\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro]);\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n\r\n {progressBarList?.length === 0 && }\r\n\r\n {progressBarList &&\r\n progressBarList.map((item) => (\r\n \r\n ))}\r\n
\r\n );\r\n};\r\n\r\nexport default VendaPorLoja;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport ProgressBar from 'components/ProgressBarVendaPorLoja';\r\nimport Totalizador from 'components/Totalizador';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport DatePickerRange from 'components/DatePickerRange';\r\nimport dateToDayDatePicker from 'helpers/dateFormat';\r\nimport { DayRange } from 'react-modern-calendar-datepicker';\r\nimport { maxHourDate, minHourDate } from 'helpers/dateMinMax';\r\n\r\nconst VendaPorLoja = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [progressBarList, setProgressBarList] = useState([] as any);\r\n const [valorTotal, setValorTotal] = useState(0);\r\n const [defaultDateRange, setDefaultDateRange] = useState({\r\n from: dateToDayDatePicker(new Date()),\r\n to: dateToDayDatePicker(new Date()),\r\n });\r\n\r\n const obterDadosGrafico = useCallback((dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao === IdentificacaoGrafico.TodasEmpresas_VendasPorLoja\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n }, []);\r\n\r\n const calcularPorcentagens = (list, total) => {\r\n const listPorcentagem = list.map((obj, index) => ({\r\n ...obj,\r\n id: index,\r\n porcentagem: obj.valor === 0 ? 0 : obj.valor / (total / 100),\r\n }));\r\n\r\n setProgressBarList(\r\n listPorcentagem.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n )\r\n );\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (dtInicial, dtFinal) => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacoesFiltro = informacao.dados.filter((item) => {\r\n const dataItem = new Date(item.Data);\r\n\r\n return (\r\n dtInicial &&\r\n dtFinal &&\r\n dataItem >= minHourDate(dtInicial) &&\r\n dataItem <= maxHourDate(dtFinal)\r\n );\r\n });\r\n\r\n let valTotal = 0;\r\n const listItens = Array();\r\n\r\n for (let index = 0; index < informacoesFiltro.length; index += 1) {\r\n const infoFiltro = informacoesFiltro[index];\r\n valTotal += infoFiltro.ValorTotal;\r\n for (\r\n let indexDado = 0;\r\n indexDado < infoFiltro.Dados.length;\r\n indexDado += 1\r\n ) {\r\n const dado = infoFiltro.Dados[indexDado];\r\n\r\n const objIndex = listItens.findIndex(\r\n (obj) => obj.lojaIdExterno === dado.LojaIdExterno\r\n );\r\n\r\n if (objIndex === -1) {\r\n listItens.push({\r\n id: listItens.length - 1,\r\n nome: dado.NomeFantasia,\r\n cidade: dado.CidadeUf,\r\n valor: dado.Sincronizado ? dado.ValorTotal : -1,\r\n sincronizado: dado.Sincronizado,\r\n lojaIdExterno: dado.LojaIdExterno,\r\n });\r\n } else {\r\n const itemUpdate = listItens[objIndex];\r\n\r\n listItens[objIndex] = {\r\n id: itemUpdate.id,\r\n nome: itemUpdate.nome,\r\n cidade: itemUpdate.cidade,\r\n valor: itemUpdate.valor + dado.ValorTotal,\r\n sincronizado: itemUpdate.sincronizado,\r\n lojaIdExterno: itemUpdate.lojaIdExterno,\r\n };\r\n }\r\n }\r\n }\r\n\r\n setValorTotal(valTotal);\r\n calcularPorcentagens(listItens, valTotal);\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [chartData]\r\n );\r\n\r\n const handleOrdem = (ordem: string) => {\r\n const list =\r\n ordem === 'desc'\r\n ? progressBarList.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n )\r\n : progressBarList.sort(\r\n (a, b) => parseFloat(a.porcentagem) - parseFloat(b.porcentagem)\r\n );\r\n\r\n setProgressBarList([...list]);\r\n };\r\n\r\n const resetGrafico = () => {\r\n setProgressBarList([]);\r\n setValorTotal(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n const dateTo = new Date(informacao.dataUltimaSincronizacao);\r\n const dateFrom = new Date(informacao.dataUltimaSincronizacao);\r\n // dateFrom.setMonth(dateFrom.getMonth() - 3);\r\n\r\n setDataUltimaSincronizacao(dateTo.toLocaleString());\r\n\r\n setDefaultDateRange({\r\n from: dateToDayDatePicker(dateFrom),\r\n to: dateToDayDatePicker(dateTo),\r\n });\r\n\r\n const filtros = informacao.dados.map((item) => {\r\n return {\r\n texto: item.Data,\r\n valor: item.Data,\r\n possuiDados: item.ValorTotal > 0,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(dateFrom, dateTo);\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro, obterDadosGrafico]);\r\n\r\n const dateOnChange = (selectedDate: { from: Date; to: Date }) => {\r\n obterDadosPorFiltro(selectedDate.from, selectedDate.to);\r\n };\r\n\r\n return (\r\n
\r\n \r\n\r\n \r\n\r\n \r\n\r\n {progressBarList?.length === 0 && }\r\n\r\n {progressBarList &&\r\n progressBarList.map((item) => (\r\n \r\n ))}\r\n
\r\n );\r\n};\r\n\r\nexport default VendaPorLoja;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport ApexCharts from 'apexcharts';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport LegendaGrafico from 'components/LegendaGrafico';\r\nimport Totalizador from 'components/Totalizador';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\n\r\nconst VendaTodasLojasPorFormaPagamento = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [infoGraficoState, setInfoGraficoState] = useState(undefined);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [legenda, setLegenda] = useState([] as Array);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao ===\r\n IdentificacaoGrafico.TodasEmpresas_VendasPorFormaPagto\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const atualizarGrafico = (list, total) => {\r\n const colors = [\r\n '#008FFB',\r\n '#00E396',\r\n '#FEB019',\r\n '#FF4560',\r\n '#775DD0',\r\n '#03A9F4',\r\n '#4CAF50',\r\n '#F9CE1D',\r\n '#FF9800',\r\n '#33B2DF',\r\n '#c9509b',\r\n ];\r\n\r\n const listPorcentagem = list.map((obj, index) => ({\r\n ...obj,\r\n id: index,\r\n porcentagem: obj.valor === 0 ? 0 : obj.valor / (total / 100),\r\n }));\r\n\r\n const listSort = listPorcentagem.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n );\r\n\r\n setLegenda(\r\n listSort.map((item, index) => ({\r\n cor: colors[index <= colors.length - 1 ? index : index % colors.length],\r\n formaPagto: item.nome,\r\n valor: item.valor,\r\n porcentagem: `${item.porcentagem.toFixed(1)}%`,\r\n }))\r\n );\r\n\r\n const infoGrafico = {\r\n series: listSort.map((item) => item.porcentagem),\r\n\r\n options: {\r\n stroke: {\r\n lineCap: 'round',\r\n },\r\n chart: {\r\n id: 'vendas-por-forma-pagamento',\r\n },\r\n colors,\r\n labels: listSort.map((item) => item.nome),\r\n legend: {\r\n show: false,\r\n position: 'bottom',\r\n horizontalAlign: 'center',\r\n floating: false,\r\n labels: {\r\n colors: '#fff',\r\n useSeriesColors: false,\r\n },\r\n itemMargin: {\r\n horizontal: 10,\r\n vertical: 5,\r\n },\r\n onItemClick: {\r\n toggleDataSeries: false,\r\n },\r\n },\r\n tooltip: {\r\n enabled: true,\r\n y: {\r\n formatter: (val) => `${val.toFixed(1)}%`,\r\n },\r\n },\r\n },\r\n };\r\n\r\n const newInfoGrafico = {\r\n ...infoGrafico,\r\n series: listSort.map((item) => item.porcentagem),\r\n options: {\r\n ...infoGrafico.options,\r\n labels: listSort.map((item) => item.nome),\r\n },\r\n };\r\n\r\n // Necessário para atualização do gráfico\r\n try {\r\n ApexCharts.exec(\r\n newInfoGrafico.options.chart.id,\r\n 'updateOptions',\r\n newInfoGrafico.options\r\n );\r\n\r\n ApexCharts.exec(newInfoGrafico.options.chart.id, 'resetSeries');\r\n\r\n // eslint-disable-next-line no-empty\r\n } catch (error) {}\r\n\r\n setInfoGraficoState(newInfoGrafico);\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n setInfoGraficoState(undefined);\r\n\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n const Itens = informacaoFiltro.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n nome: item.Descricao,\r\n valor: item.ValorTotal,\r\n };\r\n });\r\n\r\n setTotalVendas(informacaoFiltro.ValorTotal);\r\n atualizarGrafico(Itens, informacaoFiltro.ValorTotal);\r\n },\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Filtro.Descricao,\r\n valor: item.Filtro.Valor,\r\n possuiDados: item.ValorTotal > 0,\r\n key: index,\r\n };\r\n });\r\n if (filtros) {\r\n setRadioButtonList(filtros);\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(\r\n filtrosComValor[filtrosComValor.length - 1].valor\r\n );\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n setRadioButtonList([{}]);\r\n setTotalVendas(0);\r\n }\r\n }, [chartData, obterDadosPorFiltro]);\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n \r\n\r\n \r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n \r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default VendaTodasLojasPorFormaPagamento;\r\n","import React, { useState, useEffect, useCallback, useRef } from 'react';\r\nimport ApexCharts from 'apexcharts';\r\nimport { useSnackbar } from 'notistack';\r\nimport JSZip from 'jszip';\r\nimport JSFiledownload from 'js-file-download';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport { DayRange } from 'react-modern-calendar-datepicker';\r\n\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport dateToDayDatePicker from 'helpers/dateFormat';\r\nimport { maxHourDate, minHourDate } from 'helpers/dateMinMax';\r\nimport api, { ResponseApi } from 'services/api';\r\nimport ConstanteEnderecoWebservice from 'constants/enderecoWebservice';\r\nimport auth from 'auth';\r\n\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport LegendaGrafico from 'components/LegendaGrafico';\r\nimport Totalizador from 'components/Totalizador';\r\nimport DatePickerRange from 'components/DatePickerRange';\r\nimport DialogConfirm from 'components/DialogConfirm';\r\nimport Loading from 'components/Loading';\r\n\r\ntype ResponseDownload = {\r\n nomeArquivo: string;\r\n arquivo: string;\r\n};\r\n\r\nconst VendaTodasLojasPorFormaPagamento = () => {\r\n const { enqueueSnackbar } = useSnackbar();\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [infoGraficoState, setInfoGraficoState] = useState(undefined);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [legenda, setLegenda] = useState([] as Array);\r\n const [defaultDateRange, setDefaultDateRange] = useState({\r\n from: dateToDayDatePicker(new Date()),\r\n to: dateToDayDatePicker(new Date()),\r\n });\r\n const [dialogOpen, setDialogOpen] = useState(false);\r\n const [loading, setLoading] = useState(false);\r\n\r\n const [dataInicio, setDataInicio] = useState(new Date());\r\n const [dataFim, setDataFim] = useState(new Date());\r\n\r\n const obterDadosGrafico = useCallback((dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao ===\r\n IdentificacaoGrafico.TodasEmpresas_VendasPorFormaPagto\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n }, []);\r\n\r\n const atualizarGrafico = (list, total) => {\r\n const colors = [\r\n '#008FFB',\r\n '#00E396',\r\n '#FEB019',\r\n '#FF4560',\r\n '#775DD0',\r\n '#03A9F4',\r\n '#4CAF50',\r\n '#F9CE1D',\r\n '#FF9800',\r\n '#33B2DF',\r\n '#c9509b',\r\n ];\r\n\r\n const listPorcentagem = list.map((obj, index) => ({\r\n ...obj,\r\n id: index,\r\n porcentagem: obj.valor === 0 ? 0 : obj.valor / (total / 100),\r\n }));\r\n\r\n const listSort = listPorcentagem.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n );\r\n\r\n setLegenda(\r\n listSort.map((item, index) => ({\r\n cor: colors[index <= colors.length - 1 ? index : index % colors.length],\r\n formaPagto: item.nome,\r\n valor: item.valor,\r\n porcentagem: `${item.porcentagem.toFixed(1)}%`,\r\n }))\r\n );\r\n\r\n const infoGrafico = {\r\n series: listSort.map((item) => item.porcentagem),\r\n\r\n options: {\r\n stroke: {\r\n lineCap: 'round',\r\n },\r\n chart: {\r\n id: 'vendas-por-forma-pagamento',\r\n },\r\n colors,\r\n labels: listSort.map((item) => item.nome),\r\n legend: {\r\n show: false,\r\n position: 'bottom',\r\n horizontalAlign: 'center',\r\n floating: false,\r\n labels: {\r\n colors: '#fff',\r\n useSeriesColors: false,\r\n },\r\n itemMargin: {\r\n horizontal: 10,\r\n vertical: 5,\r\n },\r\n onItemClick: {\r\n toggleDataSeries: false,\r\n },\r\n },\r\n tooltip: {\r\n enabled: true,\r\n y: {\r\n formatter: (val) => `${val.toFixed(1)}%`,\r\n },\r\n },\r\n },\r\n };\r\n\r\n const newInfoGrafico = {\r\n ...infoGrafico,\r\n series: listSort.map((item) => item.porcentagem),\r\n options: {\r\n ...infoGrafico.options,\r\n labels: listSort.map((item) => item.nome),\r\n },\r\n };\r\n\r\n // Necessário para atualização do gráfico\r\n try {\r\n ApexCharts.exec(\r\n newInfoGrafico.options.chart.id,\r\n 'updateOptions',\r\n newInfoGrafico.options\r\n );\r\n\r\n ApexCharts.exec(newInfoGrafico.options.chart.id, 'resetSeries');\r\n\r\n // eslint-disable-next-line no-empty\r\n } catch (error) {}\r\n\r\n setInfoGraficoState(newInfoGrafico);\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (dtInicial, dtFinal) => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacoesFiltro = informacao.dados.filter((item) => {\r\n const dataItem = new Date(item.Data);\r\n\r\n return (\r\n dtInicial &&\r\n dtFinal &&\r\n dataItem >= minHourDate(dtInicial) &&\r\n dataItem <= maxHourDate(dtFinal)\r\n );\r\n });\r\n\r\n setInfoGraficoState(undefined);\r\n\r\n let valTotal = 0;\r\n const listItens = Array();\r\n\r\n for (let index = 0; index < informacoesFiltro.length; index += 1) {\r\n const infoFiltro = informacoesFiltro[index];\r\n valTotal += infoFiltro.ValorTotal;\r\n for (\r\n let indexDado = 0;\r\n indexDado < infoFiltro.Dados.length;\r\n indexDado += 1\r\n ) {\r\n const dado = infoFiltro.Dados[indexDado];\r\n\r\n const objIndex = listItens.findIndex(\r\n (obj) => obj.nome === dado.Descricao\r\n );\r\n\r\n if (objIndex === -1) {\r\n listItens.push({\r\n id: listItens.length - 1,\r\n nome: dado.Descricao,\r\n valor: dado.ValorTotal,\r\n });\r\n } else {\r\n const itemUpdate = listItens[objIndex];\r\n\r\n listItens[objIndex] = {\r\n id: itemUpdate.id,\r\n nome: itemUpdate.nome,\r\n valor: itemUpdate.valor + dado.ValorTotal,\r\n };\r\n }\r\n }\r\n }\r\n\r\n setTotalVendas(valTotal);\r\n atualizarGrafico(listItens, valTotal);\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n const dateTo = new Date(informacao.dataUltimaSincronizacao);\r\n const dateFrom = new Date(informacao.dataUltimaSincronizacao);\r\n\r\n setDataUltimaSincronizacao(dateTo.toLocaleString());\r\n setDataInicio(dateTo);\r\n setDataFim(dateTo);\r\n\r\n setDefaultDateRange({\r\n from: dateToDayDatePicker(dateFrom),\r\n to: dateToDayDatePicker(dateTo),\r\n });\r\n\r\n const filtros = informacao.dados.map((item) => {\r\n return {\r\n texto: item.Data,\r\n valor: item.Data,\r\n possuiDados: item.ValorTotal > 0,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(dateFrom, dateTo);\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n setTotalVendas(0);\r\n }\r\n }, [chartData, obterDadosGrafico, obterDadosPorFiltro]);\r\n\r\n const dateOnChange = (selectedDate: { from: Date; to: Date }) => {\r\n obterDadosPorFiltro(selectedDate.from, selectedDate.to);\r\n setDataInicio(selectedDate.from);\r\n setDataFim(selectedDate.to);\r\n };\r\n\r\n async function handleDownloadReport() {\r\n setLoading(true);\r\n setDialogOpen(false);\r\n const zip = new JSZip();\r\n const empresaId = auth.empresaId();\r\n\r\n const response = await api.get>(\r\n ConstanteEnderecoWebservice.EXPORTAR_FORMA_PAGAMENTO_LOJA,\r\n {\r\n params: {\r\n empresaId,\r\n dataInicio,\r\n dataFim,\r\n },\r\n }\r\n );\r\n if (response.avisos) {\r\n response.avisos.forEach((avisos) => {\r\n enqueueSnackbar(avisos, { variant: 'warning' });\r\n });\r\n }\r\n if (response.dados && response.sucesso) {\r\n response.dados.forEach((item) => {\r\n zip.file(\r\n item.nomeArquivo,\r\n Uint8Array.from(atob(item.arquivo), (code) => code.charCodeAt(0))\r\n );\r\n });\r\n await zip.generateAsync({ type: 'blob' }).then((content) => {\r\n JSFiledownload(content, 'Lojas.zip');\r\n });\r\n }\r\n setLoading(false);\r\n }\r\n\r\n return (\r\n <>\r\n {loading && }\r\n {}}\r\n appearButtonDownload\r\n handleDownloadReport={setDialogOpen}\r\n downloadReportDisabled={totalVendas === 0}\r\n />\r\n\r\n \r\n\r\n \r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n \r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n \r\n );\r\n};\r\n\r\nexport default VendaTodasLojasPorFormaPagamento;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport ApexCharts from 'apexcharts';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport LegendaGrafico from 'components/LegendaGrafico';\r\nimport Totalizador from 'components/Totalizador';\r\n\r\nconst VendaPorOrigem = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [infoGraficoState, setInfoGraficoState] = useState(undefined);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [legenda, setLegenda] = useState([] as Array);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao ===\r\n IdentificacaoGrafico.TodasEmpresas_VendasPorOrigem\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const atualizarGrafico = (list, total) => {\r\n const colors = [\r\n '#00E396',\r\n '#FEB019',\r\n '#FF4560',\r\n '#008FFB',\r\n '#4CAF50',\r\n '#F9CE1D',\r\n '#03A9F4',\r\n '#FF9800',\r\n '#33B2DF',\r\n '#7D02EB',\r\n ];\r\n\r\n const listPorcentagem = list.map((obj, index) => ({\r\n ...obj,\r\n id: index,\r\n porcentagem: obj.valor === 0 ? 0 : obj.valor / (total / 100),\r\n }));\r\n\r\n const listSort = listPorcentagem.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n );\r\n\r\n setLegenda(\r\n listSort.map((item, index) => ({\r\n cor: colors[index <= colors.length - 1 ? index : index % colors.length],\r\n formaPagto: item.nome,\r\n valor: item.valor,\r\n porcentagem: `${item.porcentagem.toFixed(1)}%`,\r\n }))\r\n );\r\n\r\n const infoGrafico = {\r\n series: listSort.map((item) => item.porcentagem),\r\n\r\n options: {\r\n stroke: {\r\n lineCap: 'round',\r\n },\r\n chart: {\r\n id: 'vendas-por-origem',\r\n },\r\n colors,\r\n labels: listSort.map((item) => item.nome),\r\n legend: {\r\n show: false,\r\n position: 'bottom',\r\n horizontalAlign: 'center',\r\n floating: false,\r\n labels: {\r\n colors: '#fff',\r\n useSeriesColors: false,\r\n },\r\n itemMargin: {\r\n horizontal: 10,\r\n vertical: 5,\r\n },\r\n onItemClick: {\r\n toggleDataSeries: false,\r\n },\r\n },\r\n tooltip: {\r\n enabled: true,\r\n y: {\r\n formatter: (val) => `${val.toFixed(1)}%`,\r\n },\r\n },\r\n },\r\n };\r\n\r\n const newInfoGrafico = {\r\n ...infoGrafico,\r\n series: listSort.map((item) => item.porcentagem),\r\n options: {\r\n ...infoGrafico.options,\r\n labels: listSort.map((item) => item.nome),\r\n },\r\n };\r\n\r\n // Necessário para atualização do gráfico\r\n try {\r\n ApexCharts.exec(\r\n newInfoGrafico.options.chart.id,\r\n 'updateOptions',\r\n newInfoGrafico.options\r\n );\r\n\r\n ApexCharts.exec(newInfoGrafico.options.chart.id, 'resetSeries');\r\n\r\n // eslint-disable-next-line no-empty\r\n } catch (error) {}\r\n\r\n setInfoGraficoState(newInfoGrafico);\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n setInfoGraficoState(undefined);\r\n\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n const Itens = informacaoFiltro.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n nome: item.Descricao,\r\n valor: item.ValorTotal,\r\n };\r\n });\r\n\r\n setTotalVendas(informacaoFiltro.ValorTotal);\r\n atualizarGrafico(Itens, informacaoFiltro.ValorTotal);\r\n },\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Filtro.Descricao,\r\n valor: item.Filtro.Valor,\r\n possuiDados: item.ValorTotal > 0,\r\n key: index,\r\n };\r\n });\r\n if (filtros) {\r\n setRadioButtonList(filtros);\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(\r\n filtrosComValor[filtrosComValor.length - 1].valor\r\n );\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n setRadioButtonList([{}]);\r\n setTotalVendas(0);\r\n }\r\n }, [chartData, obterDadosPorFiltro]);\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n \r\n\r\n \r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n \r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default VendaPorOrigem;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport ApexCharts from 'apexcharts';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport LegendaGrafico from 'components/LegendaGrafico';\r\nimport Totalizador from 'components/Totalizador';\r\nimport DatePickerRange from 'components/DatePickerRange';\r\nimport dateToDayDatePicker from 'helpers/dateFormat';\r\nimport { DayRange } from 'react-modern-calendar-datepicker';\r\nimport { maxHourDate, minHourDate } from 'helpers/dateMinMax';\r\n\r\nconst VendaPorOrigem = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [infoGraficoState, setInfoGraficoState] = useState(undefined);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [legenda, setLegenda] = useState([] as Array);\r\n const [defaultDateRange, setDefaultDateRange] = useState({\r\n from: dateToDayDatePicker(new Date()),\r\n to: dateToDayDatePicker(new Date()),\r\n });\r\n\r\n const obterDadosGrafico = useCallback((dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao ===\r\n IdentificacaoGrafico.TodasEmpresas_VendasPorOrigem\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n }, []);\r\n\r\n const atualizarGrafico = (list, total) => {\r\n const colors = [\r\n '#00E396',\r\n '#FEB019',\r\n '#FF4560',\r\n '#008FFB',\r\n '#4CAF50',\r\n '#F9CE1D',\r\n '#03A9F4',\r\n '#FF9800',\r\n '#33B2DF',\r\n '#7D02EB',\r\n ];\r\n\r\n const listPorcentagem = list.map((obj, index) => ({\r\n ...obj,\r\n id: index,\r\n porcentagem: obj.valor === 0 ? 0 : obj.valor / (total / 100),\r\n }));\r\n\r\n const listSort = listPorcentagem.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n );\r\n\r\n setLegenda(\r\n listSort.map((item, index) => ({\r\n cor: colors[index <= colors.length - 1 ? index : index % colors.length],\r\n formaPagto: item.nome,\r\n valor: item.valor,\r\n porcentagem: `${item.porcentagem.toFixed(1)}%`,\r\n }))\r\n );\r\n\r\n const infoGrafico = {\r\n series: listSort.map((item) => item.porcentagem),\r\n\r\n options: {\r\n stroke: {\r\n lineCap: 'round',\r\n },\r\n chart: {\r\n id: 'vendas-por-origem',\r\n },\r\n colors,\r\n labels: listSort.map((item) => item.nome),\r\n legend: {\r\n show: false,\r\n position: 'bottom',\r\n horizontalAlign: 'center',\r\n floating: false,\r\n labels: {\r\n colors: '#fff',\r\n useSeriesColors: false,\r\n },\r\n itemMargin: {\r\n horizontal: 10,\r\n vertical: 5,\r\n },\r\n onItemClick: {\r\n toggleDataSeries: false,\r\n },\r\n },\r\n tooltip: {\r\n enabled: true,\r\n y: {\r\n formatter: (val) => `${val.toFixed(1)}%`,\r\n },\r\n },\r\n },\r\n };\r\n\r\n const newInfoGrafico = {\r\n ...infoGrafico,\r\n series: listSort.map((item) => item.porcentagem),\r\n options: {\r\n ...infoGrafico.options,\r\n labels: listSort.map((item) => item.nome),\r\n },\r\n };\r\n\r\n // Necessário para atualização do gráfico\r\n try {\r\n ApexCharts.exec(\r\n newInfoGrafico.options.chart.id,\r\n 'updateOptions',\r\n newInfoGrafico.options\r\n );\r\n\r\n ApexCharts.exec(newInfoGrafico.options.chart.id, 'resetSeries');\r\n\r\n // eslint-disable-next-line no-empty\r\n } catch (error) {}\r\n\r\n setInfoGraficoState(newInfoGrafico);\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (dtInicial, dtFinal) => {\r\n setInfoGraficoState(undefined);\r\n\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacoesFiltro = informacao.dados.filter((item) => {\r\n const dataItem = new Date(item.Data);\r\n\r\n return (\r\n dtInicial &&\r\n dtFinal &&\r\n dataItem >= minHourDate(dtInicial) &&\r\n dataItem <= maxHourDate(dtFinal)\r\n );\r\n });\r\n\r\n let valTotal = 0;\r\n const listItens = Array();\r\n\r\n for (let index = 0; index < informacoesFiltro.length; index += 1) {\r\n const infoFiltro = informacoesFiltro[index];\r\n valTotal += infoFiltro.ValorTotal;\r\n for (\r\n let indexDado = 0;\r\n indexDado < infoFiltro.Dados.length;\r\n indexDado += 1\r\n ) {\r\n const dado = infoFiltro.Dados[indexDado];\r\n\r\n const objIndex = listItens.findIndex(\r\n (obj) => obj.nome === dado.Descricao\r\n );\r\n\r\n if (objIndex === -1) {\r\n listItens.push({\r\n id: listItens.length - 1,\r\n nome: dado.Descricao,\r\n valor: dado.ValorTotal,\r\n });\r\n } else {\r\n const itemUpdate = listItens[objIndex];\r\n\r\n listItens[objIndex] = {\r\n id: itemUpdate.id,\r\n nome: itemUpdate.nome,\r\n valor: itemUpdate.valor + dado.ValorTotal,\r\n };\r\n }\r\n }\r\n }\r\n\r\n setTotalVendas(valTotal);\r\n atualizarGrafico(listItens, valTotal);\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n const dateTo = new Date(informacao.dataUltimaSincronizacao);\r\n const dateFrom = new Date(informacao.dataUltimaSincronizacao);\r\n\r\n setDataUltimaSincronizacao(dateTo.toLocaleString());\r\n\r\n setDefaultDateRange({\r\n from: dateToDayDatePicker(dateFrom),\r\n to: dateToDayDatePicker(dateTo),\r\n });\r\n\r\n const filtros = informacao.dados.map((item) => {\r\n return {\r\n texto: item.Data,\r\n valor: item.Data,\r\n possuiDados: item.ValorTotal > 0,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(dateFrom, dateTo);\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n setTotalVendas(0);\r\n }\r\n }, [chartData, obterDadosGrafico, obterDadosPorFiltro]);\r\n\r\n const dateOnChange = (selectedDate: { from: Date; to: Date }) => {\r\n obterDadosPorFiltro(selectedDate.from, selectedDate.to);\r\n };\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n\r\n \r\n\r\n \r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n \r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default VendaPorOrigem;\r\n","import React from 'react';\r\nimport { Card, Grid, Container } from '@material-ui/core';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport VendaPorLojaV1 from 'components/Grafico/TodasLojas/VendaPorLoja/v1/VendaPorLoja';\r\nimport VendaPorLojaV2 from 'components/Grafico/TodasLojas/VendaPorLoja/v2/VendaPorLoja';\r\nimport VendaTodasLojasPorFormaPagamentoV1 from 'components/Grafico/TodasLojas/VendaTodasLojasPorFormaPagamento/v1/VendaTodasLojasPorFormaPagamento';\r\nimport VendaTodasLojasPorFormaPagamentoV2 from 'components/Grafico/TodasLojas/VendaTodasLojasPorFormaPagamento/v2/VendaTodasLojasPorFormaPagamento';\r\nimport VendaPorOrigemV1 from 'components/Grafico/TodasLojas/VendaPorOrigem/v1/VendaPorOrigem';\r\nimport VendaPorOrigemV2 from 'components/Grafico/TodasLojas/VendaPorOrigem/v2/VendaPorOrigem';\r\n\r\nimport { useLayout } from 'store/LayoutContext';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n paddingLeft: '0px',\r\n paddingRight: '0px',\r\n minWidth: '100%',\r\n minheight: '100%',\r\n },\r\n}));\r\n\r\nconst Vendas: React.FC = () => {\r\n const classes = useStyles();\r\n const { setTitlePage } = useLayout();\r\n const { obterVersaoGrafico } = useChartData();\r\n\r\n React.useEffect(() => {\r\n setTitlePage('Vendas');\r\n });\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n {obterVersaoGrafico(\r\n IdentificacaoGrafico.TodasEmpresas_VendasPorLoja\r\n ) === 1 ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {obterVersaoGrafico(\r\n IdentificacaoGrafico.TodasEmpresas_VendasPorFormaPagto\r\n ) === 1 ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {obterVersaoGrafico(\r\n IdentificacaoGrafico.TodasEmpresas_VendasPorOrigem\r\n ) === 1 ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Vendas;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport ApexCharts from 'apexcharts';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport LegendaGrafico from 'components/LegendaGrafico';\r\n\r\nconst ProdutoSituacao = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [infoGraficoState, setInfoGraficoState] = useState(undefined);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [legenda, setLegenda] = useState([] as Array);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao === IdentificacaoGrafico.Produtos_SituacaoProdutos\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const atualizarGrafico = (list, total) => {\r\n const colors = [\r\n '#008FFB',\r\n '#00E396',\r\n '#FEB019',\r\n '#FF4560',\r\n '#775DD0',\r\n '#03A9F4',\r\n '#4CAF50',\r\n '#F9CE1D',\r\n '#FF9800',\r\n '#33B2DF',\r\n '#7D02EB',\r\n ];\r\n\r\n const listPorcentagem = list.map((obj, index) => ({\r\n ...obj,\r\n id: index,\r\n porcentagem: obj.valor === 0 ? 0 : obj.valor / (total / 100),\r\n }));\r\n\r\n const listSort = listPorcentagem.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n );\r\n\r\n setLegenda(\r\n listSort.map((item, index) => ({\r\n cor: colors[index <= colors.length - 1 ? index : index % colors.length],\r\n formaPagto: item.nome,\r\n valor: item.valor,\r\n porcentagem: `${item.porcentagem.toFixed(1)}%`,\r\n }))\r\n );\r\n\r\n const infoGrafico = {\r\n series: listSort.map((item) => item.porcentagem),\r\n\r\n options: {\r\n stroke: {\r\n lineCap: 'round',\r\n },\r\n chart: {\r\n id: 'situacao-produto',\r\n },\r\n colors,\r\n labels: listSort.map((item) => item.nome),\r\n legend: {\r\n show: false,\r\n position: 'bottom',\r\n horizontalAlign: 'center',\r\n floating: false,\r\n labels: {\r\n colors: '#fff',\r\n useSeriesColors: false,\r\n },\r\n itemMargin: {\r\n horizontal: 10,\r\n vertical: 5,\r\n },\r\n onItemClick: {\r\n toggleDataSeries: false,\r\n },\r\n },\r\n tooltip: {\r\n enabled: true,\r\n y: {\r\n formatter: (val) => `${val.toFixed(1)}%`,\r\n },\r\n },\r\n },\r\n };\r\n\r\n const newInfoGrafico = {\r\n ...infoGrafico,\r\n series: listSort.map((item) => item.porcentagem),\r\n options: {\r\n ...infoGrafico.options,\r\n labels: listSort.map((item) => item.nome),\r\n },\r\n };\r\n\r\n // Necessário para atualização do gráfico\r\n try {\r\n ApexCharts.exec(\r\n newInfoGrafico.options.chart.id,\r\n 'updateOptions',\r\n newInfoGrafico.options\r\n );\r\n\r\n ApexCharts.exec(newInfoGrafico.options.chart.id, 'resetSeries');\r\n\r\n // eslint-disable-next-line no-empty\r\n } catch (error) {}\r\n\r\n setInfoGraficoState(newInfoGrafico);\r\n };\r\n\r\n const obterDados = useCallback(() => {\r\n setInfoGraficoState(undefined);\r\n const informacao = obterDadosGrafico(chartData).dados[0];\r\n\r\n const Itens = informacao.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n nome: item.Descricao,\r\n valor: item.Total,\r\n };\r\n });\r\n\r\n setTotalVendas(informacao.Total);\r\n atualizarGrafico(Itens, informacao.Total);\r\n }, [chartData]);\r\n\r\n const resetGrafico = () => {\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n\r\n obterDados();\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDados]);\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n \r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default ProdutoSituacao;\r\n","import React from 'react';\r\nimport { makeStyles } from '@material-ui/core/styles';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n height: '55px',\r\n background: '#fff',\r\n marginBottom: '10px',\r\n display: 'grid',\r\n justifyContent: 'center',\r\n alignItems: 'center',\r\n width: '49.80%',\r\n },\r\n rowValor: {\r\n color: '#1E2326',\r\n fontWeight: 'bold',\r\n fontSize: '18px',\r\n textAlign: 'center',\r\n },\r\n rowTitulo: {\r\n color: '#1E2326',\r\n fontSize: '16px',\r\n marginTop: '-15px',\r\n textAlign: 'center',\r\n },\r\n}));\r\n\r\nconst TotalizadorDividido = ({\r\n valorEsquerdo,\r\n tituloEsquerdo,\r\n exibirEmReaisEsquerdo = true,\r\n valorDireito,\r\n tituloDireito,\r\n exibirEmReaisDireito = true,\r\n}) => {\r\n const classes = useStyles();\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n
\r\n {exibirEmReaisEsquerdo && (\r\n R$ \r\n )}\r\n \r\n {exibirEmReaisEsquerdo\r\n ? formatarDinheiro(valorEsquerdo, false)\r\n : valorEsquerdo}\r\n \r\n
\r\n {tituloEsquerdo}\r\n
\r\n
\r\n
\r\n {exibirEmReaisDireito && (\r\n R$ \r\n )}\r\n \r\n {exibirEmReaisDireito\r\n ? formatarDinheiro(valorDireito, false)\r\n : valorDireito}\r\n \r\n
\r\n {tituloDireito}\r\n
\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default TotalizadorDividido;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport TotalizadorDividido from 'components/TotalizadorDividido';\r\nimport Totalizador from 'components/Totalizador';\r\n\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\nimport { Divider, makeStyles, Typography } from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n background: '#993A50',\r\n padding: '5px 10px 0px 10px',\r\n margin: '0px 10px 0px 10px',\r\n },\r\n observacao: {\r\n padding: '0px 10px 5px 10px',\r\n fontSize: '12px',\r\n },\r\n divider: {\r\n margin: '0px 10px 0px 10px',\r\n background: '#FE6383',\r\n },\r\n porcentagem: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n height: '100%',\r\n fontWeight: 'bold',\r\n },\r\n descricao: {\r\n color: (props: any) => props.cor,\r\n fontSize: '14px',\r\n paddingBottom: '5px 0 5px 0',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n fontWeight: 'bold',\r\n },\r\n obs: {\r\n color: (props: any) => props.cor,\r\n fontSize: '12px',\r\n paddingBottom: '5px 0 5px 0',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n },\r\n quantidade: {\r\n fontSize: '12px',\r\n marginBottom: '5px',\r\n minWidth: '80px',\r\n textAlign: 'right',\r\n fontWeight: 'bold',\r\n },\r\n valorTotal: {\r\n fontSize: '12px',\r\n marginBottom: '5px',\r\n minWidth: '80px',\r\n textAlign: 'right',\r\n },\r\n}));\r\n\r\nconst ProdutoMaisVendidos = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [totalVendasAdicional, setTotalVendasAdicional] = useState(0);\r\n\r\n const [legenda, setLegenda] = useState([] as Array);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao ===\r\n IdentificacaoGrafico.Produtos_ProdutosMaisVendidos\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n const items = informacaoFiltro.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n descricao: item.Descricao,\r\n obs: item.InformacaoAdicional[0].Descricao,\r\n valorTotal: item.InformacaoAdicional[0].Total,\r\n quantidade: item.Total,\r\n };\r\n });\r\n\r\n setTotalVendas(informacaoFiltro.Total);\r\n setTotalVendasAdicional(informacaoFiltro.TotalAdicional);\r\n\r\n setLegenda(items);\r\n },\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Filtro.Descricao,\r\n valor: item.Filtro.Valor,\r\n possuiDados: item.Total > 0,\r\n key: index,\r\n };\r\n });\r\n if (filtros) {\r\n setRadioButtonList(filtros);\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(\r\n filtrosComValor[filtrosComValor.length - 1].valor\r\n );\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro]);\r\n\r\n const classes = useStyles({ cor: 'white' });\r\n\r\n const InfoGrafico = (props) => {\r\n const { descricao, obs, valorTotal, quantidade } = props;\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n
{descricao}
\r\n
\r\n

{quantidade}

\r\n
\r\n
\r\n \r\n
{obs}
\r\n
\r\n {formatarDinheiro(valorTotal, true)}\r\n
\r\n
\r\n \r\n \r\n \r\n );\r\n };\r\n return (\r\n <>\r\n {}}\r\n />\r\n \r\n {\r\n // TODO Rever regra após atualização dos clientes\r\n totalVendasAdicional ? (\r\n <>\r\n \r\n \r\n Top 50 produtos mais vendidos.\r\n \r\n \r\n ) : (\r\n <>\r\n \r\n \r\n Top 50 produtos mais vendidos.\r\n \r\n \r\n )\r\n }\r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default ProdutoMaisVendidos;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport TotalizadorDividido from 'components/TotalizadorDividido';\r\nimport Totalizador from 'components/Totalizador';\r\nimport DatePickerRange from 'components/DatePickerRange';\r\nimport dateToDayDatePicker from 'helpers/dateFormat';\r\nimport { DayRange } from 'react-modern-calendar-datepicker';\r\n\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\nimport { Divider, makeStyles, Typography } from '@material-ui/core';\r\nimport { maxHourDate, minHourDate } from 'helpers/dateMinMax';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n background: '#993A50',\r\n padding: '5px 10px 0px 10px',\r\n margin: '0px 10px 0px 10px',\r\n },\r\n observacao: {\r\n padding: '0px 10px 5px 10px',\r\n fontSize: '12px',\r\n },\r\n divider: {\r\n margin: '0px 10px 0px 10px',\r\n background: '#FE6383',\r\n },\r\n porcentagem: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n height: '100%',\r\n fontWeight: 'bold',\r\n },\r\n descricao: {\r\n color: (props: any) => props.cor,\r\n fontSize: '14px',\r\n paddingBottom: '5px 0 5px 0',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n fontWeight: 'bold',\r\n },\r\n obs: {\r\n color: (props: any) => props.cor,\r\n fontSize: '12px',\r\n paddingBottom: '5px 0 5px 0',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n },\r\n quantidade: {\r\n fontSize: '12px',\r\n marginBottom: '5px',\r\n minWidth: '80px',\r\n textAlign: 'right',\r\n fontWeight: 'bold',\r\n },\r\n valorTotal: {\r\n fontSize: '12px',\r\n marginBottom: '5px',\r\n minWidth: '80px',\r\n textAlign: 'right',\r\n },\r\n}));\r\n\r\nconst ProdutoMaisVendidos = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [totalVendasAdicional, setTotalVendasAdicional] = useState(0);\r\n const [defaultDateRange, setDefaultDateRange] = useState({\r\n from: dateToDayDatePicker(new Date()),\r\n to: dateToDayDatePicker(new Date()),\r\n });\r\n\r\n const [legenda, setLegenda] = useState([] as Array);\r\n\r\n const obterDadosGrafico = useCallback((dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao ===\r\n IdentificacaoGrafico.Produtos_ProdutosMaisVendidos\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n }, []);\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (dtInicial, dtFinal) => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacoesFiltro = informacao.dados.filter((item) => {\r\n const dataItem = new Date(item.Data);\r\n return (\r\n dtInicial &&\r\n dtFinal &&\r\n dataItem >= minHourDate(dtInicial) &&\r\n dataItem <= maxHourDate(dtFinal)\r\n );\r\n });\r\n\r\n let valTotal = 0;\r\n let valTotalAdicional = 0;\r\n\r\n let listItens = Array();\r\n\r\n for (let index = 0; index < informacoesFiltro.length; index += 1) {\r\n const infoFiltro = informacoesFiltro[index];\r\n valTotal += infoFiltro.Total;\r\n valTotalAdicional += infoFiltro.TotalAdicional;\r\n\r\n for (\r\n let indexDado = 0;\r\n indexDado < infoFiltro.Dados.length;\r\n indexDado += 1\r\n ) {\r\n const dado = infoFiltro.Dados[indexDado];\r\n\r\n const objIndex = listItens.findIndex(\r\n (obj) =>\r\n obj.descricao === dado.Descricao &&\r\n obj.obs === dado.InformacaoAdicional[0].Descricao\r\n );\r\n\r\n if (objIndex === -1) {\r\n listItens.push({\r\n id: listItens.length - 1,\r\n descricao: dado.Descricao,\r\n obs: dado.InformacaoAdicional[0].Descricao,\r\n valorTotal: dado.InformacaoAdicional[0].Total,\r\n quantidade: dado.Total,\r\n });\r\n } else {\r\n const itemUpdate = listItens[objIndex];\r\n\r\n listItens[objIndex] = {\r\n id: itemUpdate.id,\r\n descricao: dado.Descricao,\r\n obs: dado.InformacaoAdicional[0].Descricao,\r\n valorTotal:\r\n itemUpdate.valorTotal + dado.InformacaoAdicional[0].Total,\r\n quantidade: itemUpdate.quantidade + dado.Total,\r\n };\r\n }\r\n }\r\n }\r\n\r\n setTotalVendas(valTotal);\r\n setTotalVendasAdicional(valTotalAdicional);\r\n\r\n listItens = listItens.sort(\r\n (a, b) => parseFloat(b.quantidade) - parseFloat(a.quantidade)\r\n );\r\n\r\n listItens = listItens.slice(\r\n 0,\r\n listItens.length > 50 ? 50 : listItens.length\r\n );\r\n\r\n setLegenda(listItens);\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n const dateTo = new Date(informacao.dataUltimaSincronizacao);\r\n const dateFrom = new Date(informacao.dataUltimaSincronizacao);\r\n\r\n setDataUltimaSincronizacao(dateTo.toLocaleString());\r\n\r\n setDefaultDateRange({\r\n from: dateToDayDatePicker(dateFrom),\r\n to: dateToDayDatePicker(dateTo),\r\n });\r\n\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Data,\r\n valor: item.Total,\r\n possuiDados: item.Total > 0,\r\n key: index,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(dateFrom, dateTo);\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro, obterDadosGrafico]);\r\n\r\n const classes = useStyles({ cor: 'white' });\r\n\r\n const dateOnChange = (selectedDate: { from: Date; to: Date }) => {\r\n obterDadosPorFiltro(selectedDate.from, selectedDate.to);\r\n };\r\n\r\n const InfoGrafico = (props) => {\r\n const { descricao, obs, valorTotal, quantidade } = props;\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n
{descricao}
\r\n
\r\n

{quantidade}

\r\n
\r\n
\r\n \r\n
{obs}
\r\n
\r\n {formatarDinheiro(valorTotal, true)}\r\n
\r\n
\r\n \r\n \r\n \r\n );\r\n };\r\n return (\r\n <>\r\n {}}\r\n />\r\n\r\n \r\n\r\n {\r\n // TODO Rever regra após atualização dos clientes\r\n totalVendasAdicional ? (\r\n <>\r\n \r\n \r\n Top 50 produtos mais vendidos.\r\n \r\n \r\n ) : (\r\n <>\r\n \r\n \r\n Top 50 produtos mais vendidos.\r\n \r\n \r\n )\r\n }\r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n {legenda.map((item) => (\r\n 0\r\n ? item.quantidade.toFixed(2)\r\n : item.quantidade\r\n }\r\n />\r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default ProdutoMaisVendidos;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport Totalizador from 'components/Totalizador';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\nimport { Divider, makeStyles } from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n background: '#0B597D',\r\n padding: '5px 10px 0px 10px',\r\n margin: '0px 10px 0px 10px',\r\n },\r\n divider: {\r\n margin: '0px 10px 0px 10px',\r\n background: '#0B99C1',\r\n },\r\n porcentagem: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n height: '100%',\r\n fontWeight: 'bold',\r\n },\r\n descricao: {\r\n color: (props: any) => props.cor,\r\n fontSize: '14px',\r\n paddingBottom: '5px 0 5px 0',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n fontWeight: 'bold',\r\n },\r\n obs: {\r\n color: (props: any) => props.cor,\r\n fontSize: '12px',\r\n paddingBottom: '5px 0 5px 0',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n },\r\n valorTotal: {\r\n fontSize: '12px',\r\n marginBottom: '5px',\r\n minWidth: '80px',\r\n textAlign: 'right',\r\n fontWeight: 'bold',\r\n },\r\n quantidade: {\r\n fontSize: '12px',\r\n marginBottom: '5px',\r\n minWidth: '80px',\r\n textAlign: 'right',\r\n },\r\n}));\r\n\r\nconst ProdutoEmEstoque = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [legenda, setLegenda] = useState([] as Array);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao === IdentificacaoGrafico.Produtos_ProdutosEmEstoque\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n const items = informacaoFiltro.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n descricao: item.Descricao,\r\n obs: item.InformacaoAdicional.Descricao,\r\n quantidade: item.InformacaoAdicional[0].Total,\r\n valorTotal: item.Total,\r\n };\r\n });\r\n\r\n setTotalVendas(informacaoFiltro.Total);\r\n setLegenda(items);\r\n },\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Filtro.Descricao,\r\n valor: item.Filtro.Valor,\r\n possuiDados: item.Dados.length > 0,\r\n key: index,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n setRadioButtonList(filtros);\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(\r\n filtrosComValor[filtrosComValor.length - 1].valor\r\n );\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro]);\r\n\r\n const InfoGrafico = (props) => {\r\n const { descricao, valorTotal, quantidade } = props;\r\n const classes = useStyles({ cor: 'white' });\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n
{descricao}
\r\n
\r\n

{formatarDinheiro(valorTotal, true)}

\r\n
\r\n
\r\n \r\n
\r\n
{quantidade}
\r\n
\r\n
\r\n \r\n \r\n );\r\n };\r\n return (\r\n <>\r\n {}}\r\n />\r\n \r\n\r\n \r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas && (\r\n
\r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default ProdutoEmEstoque;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport TotalizadorDividido from 'components/TotalizadorDividido';\r\nimport Totalizador from 'components/Totalizador';\r\nimport DatePickerRange from 'components/DatePickerRange';\r\nimport dateToDayDatePicker from 'helpers/dateFormat';\r\nimport { DayRange } from 'react-modern-calendar-datepicker';\r\n\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\nimport { Divider, makeStyles } from '@material-ui/core';\r\nimport { maxHourDate, minHourDate } from 'helpers/dateMinMax';\r\nimport auth from 'auth';\r\nimport TipoSistemaEnum from 'constants/enumTipoSistema';\r\n\r\nconst sistema = auth.getSistema() || '';\r\n\r\nconst sistemaIsZendarOrPowerstock = sistema.value !== TipoSistemaEnum.STI3;\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n background: '#4B3D7B',\r\n padding: '5px 10px 0px 10px',\r\n margin: '0px 10px 0px 10px',\r\n },\r\n observacao: {\r\n padding: '0px 10px 5px 10px',\r\n fontSize: '12px',\r\n },\r\n divider: {\r\n margin: '0px 10px 0px 10px',\r\n background: '#7C66C8',\r\n },\r\n porcentagem: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n height: '100%',\r\n fontWeight: 'bold',\r\n },\r\n descricao: {\r\n color: (props: any) => props.cor,\r\n fontSize: '14px',\r\n paddingBottom: '5px 0 5px 0',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n fontWeight: 'bold',\r\n },\r\n obs: {\r\n color: (props: any) => props.cor,\r\n fontSize: '12px',\r\n paddingBottom: '5px 0 5px 0',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n },\r\n quantidade: {\r\n fontSize: '12px',\r\n marginBottom: '5px',\r\n minWidth: '80px',\r\n textAlign: 'right',\r\n fontWeight: 'normal',\r\n },\r\n valorTotal: {\r\n fontSize: '12px',\r\n marginBottom: '5px',\r\n minWidth: '80px',\r\n textAlign: 'right',\r\n },\r\n}));\r\n\r\nconst TotalGruposVendidos = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [totalVendasAdicional, setTotalVendasAdicional] = useState(0);\r\n const [defaultDateRange, setDefaultDateRange] = useState({\r\n from: dateToDayDatePicker(new Date()),\r\n to: dateToDayDatePicker(new Date()),\r\n });\r\n\r\n const [legenda, setLegenda] = useState([] as Array);\r\n\r\n const obterDadosGrafico = useCallback((dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao === IdentificacaoGrafico.Produtos_TotalGruposVendidos\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n }, []);\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (dtInicial, dtFinal) => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacoesFiltro = informacao.dados.filter((item) => {\r\n const dataItem = new Date(item.Data);\r\n return (\r\n dtInicial &&\r\n dtFinal &&\r\n dataItem >= minHourDate(dtInicial) &&\r\n dataItem <= maxHourDate(dtFinal)\r\n );\r\n });\r\n\r\n let valTotal = 0;\r\n let valTotalAdicional = 0;\r\n\r\n let listItens = Array();\r\n\r\n for (let index = 0; index < informacoesFiltro.length; index += 1) {\r\n const infoFiltro = informacoesFiltro[index];\r\n valTotal += infoFiltro.Total;\r\n valTotalAdicional += infoFiltro.TotalAdicional;\r\n\r\n for (\r\n let indexDado = 0;\r\n indexDado < infoFiltro.Dados.length;\r\n indexDado += 1\r\n ) {\r\n const dado = infoFiltro.Dados[indexDado];\r\n\r\n const objIndex = listItens.findIndex(\r\n (obj) =>\r\n obj.descricao === dado.Descricao &&\r\n obj.obs === dado.InformacaoAdicional[0].Descricao\r\n );\r\n\r\n if (objIndex === -1) {\r\n listItens.push({\r\n id: listItens.length - 1,\r\n descricao: dado.Descricao,\r\n obs: dado.InformacaoAdicional[0].Descricao,\r\n valorTotal: dado.Total,\r\n quantidade: dado.InformacaoAdicional[0].Total,\r\n });\r\n } else {\r\n const itemUpdate = listItens[objIndex];\r\n\r\n listItens[objIndex] = {\r\n id: itemUpdate.id,\r\n descricao: dado.Descricao,\r\n obs: dado.InformacaoAdicional[0].Descricao,\r\n valorTotal: itemUpdate.valorTotal + dado.Total,\r\n quantidade:\r\n itemUpdate.quantidade + dado.InformacaoAdicional[0].Total,\r\n };\r\n }\r\n }\r\n }\r\n\r\n setTotalVendas(valTotal);\r\n setTotalVendasAdicional(valTotalAdicional);\r\n\r\n listItens = listItens.sort(\r\n (a, b) => parseFloat(b.quantidade) - parseFloat(a.quantidade)\r\n );\r\n\r\n setLegenda(listItens);\r\n },\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n const dateTo = new Date(informacao.dataUltimaSincronizacao);\r\n const dateFrom = new Date(informacao.dataUltimaSincronizacao);\r\n\r\n setDataUltimaSincronizacao(dateTo.toLocaleString());\r\n\r\n setDefaultDateRange({\r\n from: dateToDayDatePicker(dateFrom),\r\n to: dateToDayDatePicker(dateTo),\r\n });\r\n\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Data,\r\n valor: item.Total,\r\n possuiDados: item.Total > 0,\r\n key: index,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(dateFrom, dateTo);\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro, obterDadosGrafico]);\r\n\r\n const classes = useStyles({ cor: 'white' });\r\n\r\n const dateOnChange = (selectedDate: { from: Date; to: Date }) => {\r\n obterDadosPorFiltro(selectedDate.from, selectedDate.to);\r\n };\r\n\r\n const InfoGrafico = (props) => {\r\n const { descricao, obs, valorTotal, quantidade } = props;\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n
{descricao}
\r\n {!sistemaIsZendarOrPowerstock && (\r\n
\r\n {formatarDinheiro(valorTotal, true)}\r\n
\r\n )}\r\n {sistemaIsZendarOrPowerstock && (\r\n
{valorTotal}
\r\n )}\r\n
\r\n \r\n
{obs}
\r\n {!sistemaIsZendarOrPowerstock && (\r\n
\r\n

{quantidade}

\r\n
\r\n )}\r\n {sistemaIsZendarOrPowerstock && (\r\n
\r\n

{formatarDinheiro(quantidade, true)}

\r\n
\r\n )}\r\n
\r\n \r\n \r\n \r\n );\r\n };\r\n return (\r\n <>\r\n {}}\r\n />\r\n\r\n \r\n\r\n {\r\n // TODO Rever regra após atualização dos clientes\r\n totalVendasAdicional ? (\r\n <>\r\n \r\n \r\n ) : (\r\n \r\n )\r\n }\r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n {legenda.map((item) => (\r\n 0\r\n ? item.quantidade.toFixed(2)\r\n : item.quantidade\r\n }\r\n />\r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default TotalGruposVendidos;\r\n","import React from 'react';\r\nimport { Card, Grid, Container } from '@material-ui/core';\r\nimport { makeStyles, Theme } from '@material-ui/core/styles';\r\nimport ProdutoSituacao from 'components/Grafico/Produto/ProdutoSituacao';\r\nimport ProdutoMaisVendidosV1 from 'components/Grafico/Produto/ProdutoMaisVendidos/v1/ProdutoMaisVendidos';\r\nimport ProdutoMaisVendidosV2 from 'components/Grafico/Produto/ProdutoMaisVendidos/v2/ProdutoMaisVendidos';\r\nimport ProdutoEmEstoque from 'components/Grafico/Produto/ProdutoEmEstoque';\r\n\r\nimport { useLayout } from 'store/LayoutContext';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport TotalGruposVendidos from 'components/Grafico/Produto/TotalGruposVendidos';\r\nimport auth from 'auth';\r\nimport TipoSistemaEnum from 'constants/enumTipoSistema';\r\n\r\nconst useStyles = makeStyles((theme: Theme) => ({\r\n container: {\r\n paddingLeft: '0px',\r\n paddingRight: '0px',\r\n minWidth: '100%',\r\n minheight: '100%',\r\n },\r\n fab: {\r\n position: 'fixed',\r\n bottom: theme.spacing(2),\r\n right: theme.spacing(2),\r\n 'z-index': '999',\r\n },\r\n}));\r\n\r\nconst Produtos: React.FC = () => {\r\n const classes = useStyles();\r\n const { setTitlePage } = useLayout();\r\n const { obterVersaoGrafico } = useChartData();\r\n\r\n const sistema = auth.getSistema() || '';\r\n const sistemaIsZendarOrPowerstock = sistema.value !== TipoSistemaEnum.STI3;\r\n\r\n React.useEffect(() => {\r\n setTitlePage('Produtos');\r\n });\r\n\r\n return (\r\n <>\r\n \r\n \r\n {!sistemaIsZendarOrPowerstock && (\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n \r\n {obterVersaoGrafico(\r\n IdentificacaoGrafico.Produtos_ProdutosMaisVendidos\r\n ) === 1 ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {obterVersaoGrafico(\r\n IdentificacaoGrafico.Produtos_TotalGruposVendidos\r\n ) === 2 ? (\r\n \r\n ) : (\r\n <>\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Produtos;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport Totalizador from 'components/Totalizador';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\nimport { Divider, makeStyles } from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n background: '#993A50',\r\n padding: '5px 10px 0px 10px',\r\n margin: '0px 10px 0px 10px',\r\n },\r\n divider: {\r\n margin: '0px 10px 0px 10px',\r\n background: '#FE6383',\r\n },\r\n dividerInformacaoAdicional: {\r\n background: '#b8495f',\r\n marginBottom: '6px',\r\n },\r\n descricao: {\r\n color: (props: any) => props.cor,\r\n fontSize: '14px',\r\n paddingBottom: '5px 0 5px 0',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n fontWeight: 'bold',\r\n },\r\n data: {\r\n color: (props: any) => props.cor,\r\n fontSize: '12px',\r\n paddingBottom: '5px 0 5px 0',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n },\r\n valorTotal: {\r\n fontSize: '14px',\r\n marginBottom: '5px',\r\n minWidth: '80px',\r\n textAlign: 'right',\r\n fontWeight: 'bold',\r\n },\r\n total: {\r\n fontSize: '12px',\r\n marginBottom: '5px',\r\n minWidth: '80px',\r\n textAlign: 'right',\r\n },\r\n}));\r\n\r\nconst ContasAPagar = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [legenda, setLegenda] = useState([] as Array);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao === IdentificacaoGrafico.ContasAPagar_ContasAPagar\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n const items = informacaoFiltro.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n descricao: item.Descricao,\r\n informacoesAdicionais: item.InformacaoAdicional.map(\r\n (infoAdicional) => ({\r\n data: infoAdicional.Descricao,\r\n total: infoAdicional.Total,\r\n })\r\n ),\r\n valorTotal: item.Total,\r\n };\r\n });\r\n\r\n setTotalVendas(informacaoFiltro.Total);\r\n setLegenda(items);\r\n },\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Filtro.Descricao,\r\n valor: item.Filtro.Valor,\r\n possuiDados: item.Total > 0,\r\n key: index,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n setRadioButtonList(filtros);\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n const filtroPadrao = filtrosComValor.filter(\r\n (filtroItem) => filtroItem.valor === 4\r\n );\r\n\r\n if (filtroPadrao[0]) {\r\n obterDadosPorFiltro(filtroPadrao[0].valor);\r\n } else {\r\n obterDadosPorFiltro(\r\n filtrosComValor[filtrosComValor.length - 1].valor\r\n );\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro]);\r\n\r\n const InfoGrafico = (props) => {\r\n const { descricao, valorTotal, informacoesAdicionais } = props;\r\n const classes = useStyles({ cor: 'white' });\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n
{descricao}
\r\n
\r\n

{formatarDinheiro(valorTotal, true)}

\r\n
\r\n
\r\n {informacoesAdicionais.map((informacaoAdicional) => (\r\n <>\r\n \r\n
{informacaoAdicional.data}
\r\n
\r\n {formatarDinheiro(informacaoAdicional.total, true)}\r\n
\r\n
\r\n \r\n \r\n ))}\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n\r\n \r\n\r\n \r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default ContasAPagar;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport ApexCharts from 'apexcharts';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport LegendaGrafico from 'components/LegendaGrafico';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\n\r\nconst ContasPagas = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [infoGraficoState, setInfoGraficoState] = useState(undefined);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [legenda, setLegenda] = useState([] as Array);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao === IdentificacaoGrafico.ContasAPagar_ContasPagas\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const atualizarGrafico = (list, total) => {\r\n const colors = [\r\n '#008FFB',\r\n '#00E396',\r\n '#FEB019',\r\n '#FF4560',\r\n '#775DD0',\r\n '#03A9F4',\r\n '#4CAF50',\r\n '#F9CE1D',\r\n '#FF9800',\r\n '#33B2DF',\r\n '#7D02EB',\r\n ];\r\n\r\n const listPorcentagem = list.map((obj, index) => ({\r\n ...obj,\r\n id: index,\r\n porcentagem: obj.valor === 0 ? 0 : obj.valor / (total / 100),\r\n }));\r\n\r\n const listSort = listPorcentagem.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n );\r\n\r\n setLegenda(\r\n listSort.map((item, index) => ({\r\n cor: colors[index <= colors.length - 1 ? index : index % colors.length],\r\n formaPagto: item.nome,\r\n valor: item.valor,\r\n porcentagem: `${item.porcentagem.toFixed(1)}%`,\r\n }))\r\n );\r\n\r\n const infoGrafico = {\r\n series: listSort.map((item) => item.porcentagem),\r\n\r\n options: {\r\n stroke: {\r\n lineCap: 'round',\r\n },\r\n chart: {\r\n id: 'contas-pagas',\r\n },\r\n colors,\r\n labels: listSort.map((item) => item.nome),\r\n legend: {\r\n show: false,\r\n position: 'bottom',\r\n horizontalAlign: 'center',\r\n floating: false,\r\n labels: {\r\n colors: '#fff',\r\n useSeriesColors: false,\r\n },\r\n itemMargin: {\r\n horizontal: 10,\r\n vertical: 5,\r\n },\r\n onItemClick: {\r\n toggleDataSeries: false,\r\n },\r\n },\r\n tooltip: {\r\n enabled: true,\r\n y: {\r\n formatter: (val) => `${val.toFixed(1)}%`,\r\n },\r\n },\r\n },\r\n };\r\n\r\n const newInfoGrafico = {\r\n ...infoGrafico,\r\n series: listSort.map((item) => item.porcentagem),\r\n options: {\r\n ...infoGrafico.options,\r\n labels: listSort.map((item) => item.nome),\r\n },\r\n };\r\n\r\n // Necessário para atualização do gráfico\r\n try {\r\n ApexCharts.exec(\r\n newInfoGrafico.options.chart.id,\r\n 'updateOptions',\r\n newInfoGrafico.options\r\n );\r\n\r\n ApexCharts.exec(newInfoGrafico.options.chart.id, 'resetSeries');\r\n\r\n // eslint-disable-next-line no-empty\r\n } catch (error) {}\r\n\r\n setInfoGraficoState(newInfoGrafico);\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n setInfoGraficoState(undefined);\r\n\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n const Itens = informacaoFiltro.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n nome: item.Descricao,\r\n valor: item.Total,\r\n };\r\n });\r\n\r\n setTotalVendas(informacaoFiltro.Total);\r\n atualizarGrafico(Itens, informacaoFiltro.Total);\r\n },\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Filtro.Descricao,\r\n valor: item.Filtro.Valor,\r\n possuiDados: item.Total > 0,\r\n key: index,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n setRadioButtonList(filtros);\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(\r\n filtrosComValor[filtrosComValor.length - 1].valor\r\n );\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro]);\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n \r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n \r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default ContasPagas;\r\n","import React from 'react';\r\nimport { Card, Grid, Container } from '@material-ui/core';\r\nimport { makeStyles, Theme } from '@material-ui/core/styles';\r\nimport ContasPagar from 'components/Grafico/ContasAPagar/ContasAPagar';\r\nimport ContasPagas from 'components/Grafico/ContasAPagar/ContasPagas';\r\n\r\nimport { useLayout } from 'store/LayoutContext';\r\n\r\nconst useStyles = makeStyles((theme: Theme) => ({\r\n container: {\r\n paddingLeft: '0px',\r\n paddingRight: '0px',\r\n minWidth: '100%',\r\n minheight: '100%',\r\n },\r\n fab: {\r\n position: 'fixed',\r\n bottom: theme.spacing(2),\r\n right: theme.spacing(2),\r\n 'z-index': '999',\r\n },\r\n}));\r\n\r\nconst ContasAPagar: React.FC = () => {\r\n const classes = useStyles();\r\n const { setTitlePage } = useLayout();\r\n\r\n React.useEffect(() => {\r\n setTitlePage('Contas a Pagar');\r\n });\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default ContasAPagar;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport Totalizador from 'components/Totalizador';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\nimport { Divider, makeStyles } from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles(() => ({\r\n container: {\r\n background: '#993d3a',\r\n padding: '5px 10px 0px 10px',\r\n margin: '0px 10px 0px 10px',\r\n },\r\n divider: {\r\n margin: '0px 10px 0px 10px',\r\n background: '#fe6863',\r\n },\r\n dividerInformacaoAdicional: {\r\n background: '#b8495f',\r\n marginBottom: '6px',\r\n },\r\n descricao: {\r\n color: (props: any) => props.cor,\r\n fontSize: '14px',\r\n paddingBottom: '5px 0 5px 0',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n fontWeight: 'bold',\r\n },\r\n data: {\r\n color: (props: any) => props.cor,\r\n fontSize: '12px',\r\n paddingBottom: '5px 0 5px 0',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n },\r\n valorTotal: {\r\n fontSize: '14px',\r\n marginBottom: '5px',\r\n minWidth: '80px',\r\n textAlign: 'right',\r\n fontWeight: 'bold',\r\n },\r\n total: {\r\n fontSize: '12px',\r\n marginBottom: '5px',\r\n minWidth: '80px',\r\n textAlign: 'right',\r\n },\r\n}));\r\n\r\nconst ContasAReceber = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [legenda, setLegenda] = useState([] as Array);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao ===\r\n IdentificacaoGrafico.ContasAReceber_ContasAReceber\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n const items = informacaoFiltro.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n descricao: item.Descricao,\r\n informacoesAdicionais: item.InformacaoAdicional.map(\r\n (infoAdicional) => ({\r\n data: infoAdicional.Descricao,\r\n total: infoAdicional.Total,\r\n })\r\n ),\r\n valorTotal: item.Total,\r\n };\r\n });\r\n\r\n setTotalVendas(informacaoFiltro.Total);\r\n setLegenda(items);\r\n },\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Filtro.Descricao,\r\n valor: item.Filtro.Valor,\r\n possuiDados: item.Total > 0,\r\n key: index,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n setRadioButtonList(filtros);\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n const filtroPadrao = filtrosComValor.filter(\r\n (filtroItem) => filtroItem.valor === 4\r\n );\r\n\r\n if (filtroPadrao[0]) {\r\n obterDadosPorFiltro(filtroPadrao[0].valor);\r\n } else {\r\n obterDadosPorFiltro(\r\n filtrosComValor[filtrosComValor.length - 1].valor\r\n );\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro]);\r\n\r\n const InfoGrafico = (props) => {\r\n const { descricao, valorTotal, informacoesAdicionais } = props;\r\n const classes = useStyles({ cor: 'white' });\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n
{descricao}
\r\n
\r\n

{formatarDinheiro(valorTotal, true)}

\r\n
\r\n
\r\n {informacoesAdicionais.map((informacaoAdicional) => (\r\n <>\r\n \r\n
{informacaoAdicional.data}
\r\n
\r\n {formatarDinheiro(informacaoAdicional.total, true)}\r\n
\r\n
\r\n \r\n \r\n ))}\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n \r\n\r\n \r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default ContasAReceber;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport HeaderCard from 'components/HeaderCard';\r\nimport RadioButtonFiltros from 'components/RadioButtonFiltros';\r\nimport { useChartData } from 'store/ChartDataContext';\r\nimport IdentificacaoGrafico from 'constants/identificacaoGrafico';\r\nimport ReactApexChart from 'react-apexcharts';\r\nimport ApexCharts from 'apexcharts';\r\nimport GraficoSemDados from 'components/GraficoSemDados';\r\nimport LegendaGrafico from 'components/LegendaGrafico';\r\nimport formatarDinheiro from 'helpers/moneyFormat';\r\n\r\nconst ContasRecebidas = () => {\r\n const { chartData } = useChartData();\r\n const [dataUltimaSincronizacao, setDataUltimaSincronizacao] = useState('');\r\n const [radioButtonList, setRadioButtonList] = useState([{}] as any);\r\n const [infoGraficoState, setInfoGraficoState] = useState(undefined);\r\n const [totalVendas, setTotalVendas] = useState(0);\r\n const [legenda, setLegenda] = useState([] as Array);\r\n\r\n const obterDadosGrafico = (dados) => {\r\n const informacoesFiltro = dados.filter(\r\n (item) =>\r\n item.identificacao ===\r\n IdentificacaoGrafico.ContasAReceber_ContasRecebidas\r\n );\r\n\r\n if (informacoesFiltro.length > 0) {\r\n return {\r\n ...informacoesFiltro[0],\r\n };\r\n }\r\n\r\n return null;\r\n };\r\n\r\n const atualizarGrafico = (list, total) => {\r\n const colors = [\r\n '#008FFB',\r\n '#00E396',\r\n '#FEB019',\r\n '#FF4560',\r\n '#775DD0',\r\n '#03A9F4',\r\n '#4CAF50',\r\n '#F9CE1D',\r\n '#FF9800',\r\n '#33B2DF',\r\n '#7D02EB',\r\n ];\r\n\r\n const listPorcentagem = list.map((obj, index) => ({\r\n ...obj,\r\n id: index,\r\n porcentagem: obj.valor === 0 ? 0 : obj.valor / (total / 100),\r\n }));\r\n\r\n const listSort = listPorcentagem.sort(\r\n (a, b) => parseFloat(b.porcentagem) - parseFloat(a.porcentagem)\r\n );\r\n\r\n setLegenda(\r\n listSort.map((item, index) => ({\r\n cor: colors[index <= colors.length - 1 ? index : index % colors.length],\r\n formaPagto: item.nome,\r\n valor: item.valor,\r\n porcentagem: `${item.porcentagem.toFixed(1)}%`,\r\n }))\r\n );\r\n\r\n const infoGrafico = {\r\n series: listSort.map((item) => item.porcentagem),\r\n\r\n options: {\r\n stroke: {\r\n lineCap: 'round',\r\n },\r\n chart: {\r\n id: 'contas-recebidas',\r\n },\r\n colors,\r\n labels: listSort.map((item) => item.nome),\r\n legend: {\r\n show: false,\r\n position: 'bottom',\r\n horizontalAlign: 'center',\r\n floating: false,\r\n labels: {\r\n colors: '#fff',\r\n useSeriesColors: false,\r\n },\r\n itemMargin: {\r\n horizontal: 10,\r\n vertical: 5,\r\n },\r\n onItemClick: {\r\n toggleDataSeries: false,\r\n },\r\n },\r\n tooltip: {\r\n enabled: true,\r\n y: {\r\n formatter: (val) => `${val.toFixed(1)}%`,\r\n },\r\n },\r\n },\r\n };\r\n\r\n const newInfoGrafico = {\r\n ...infoGrafico,\r\n series: listSort.map((item) => item.porcentagem),\r\n options: {\r\n ...infoGrafico.options,\r\n labels: listSort.map((item) => item.nome),\r\n },\r\n };\r\n\r\n // Necessário para atualização do gráfico\r\n try {\r\n ApexCharts.exec(\r\n newInfoGrafico.options.chart.id,\r\n 'updateOptions',\r\n newInfoGrafico.options\r\n );\r\n\r\n ApexCharts.exec(newInfoGrafico.options.chart.id, 'resetSeries');\r\n\r\n // eslint-disable-next-line no-empty\r\n } catch (error) {}\r\n\r\n setInfoGraficoState(newInfoGrafico);\r\n };\r\n\r\n const obterDadosPorFiltro = useCallback(\r\n (valor) => {\r\n setInfoGraficoState(undefined);\r\n\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n const informacaoFiltro = informacao.dados.find(\r\n (item) => item.Filtro.Valor === valor\r\n );\r\n\r\n const Itens = informacaoFiltro.Dados.map((item, index) => {\r\n return {\r\n id: index,\r\n nome: item.Descricao,\r\n valor: item.Total,\r\n };\r\n });\r\n\r\n setTotalVendas(informacaoFiltro.Total);\r\n atualizarGrafico(Itens, informacaoFiltro.Total);\r\n },\r\n [chartData]\r\n );\r\n\r\n const resetGrafico = () => {\r\n setRadioButtonList([{}]);\r\n setTotalVendas(0);\r\n };\r\n\r\n useEffect(() => {\r\n const informacao = obterDadosGrafico(chartData);\r\n\r\n if (informacao) {\r\n setDataUltimaSincronizacao(\r\n new Date(informacao.dataUltimaSincronizacao).toLocaleString()\r\n );\r\n\r\n const filtros = informacao.dados.map((item, index) => {\r\n return {\r\n texto: item.Filtro.Descricao,\r\n valor: item.Filtro.Valor,\r\n possuiDados: item.Total > 0,\r\n key: index,\r\n };\r\n });\r\n\r\n if (filtros) {\r\n setRadioButtonList(filtros);\r\n const filtrosComValor = filtros.filter((filtro) => filtro.possuiDados);\r\n if (filtrosComValor.length > 0) {\r\n obterDadosPorFiltro(\r\n filtrosComValor[filtrosComValor.length - 1].valor\r\n );\r\n } else {\r\n resetGrafico();\r\n }\r\n }\r\n } else {\r\n resetGrafico();\r\n }\r\n }, [chartData, obterDadosPorFiltro]);\r\n\r\n return (\r\n <>\r\n {}}\r\n />\r\n {totalVendas > 0 && (\r\n \r\n )}\r\n\r\n
\r\n {totalVendas === 0 && }\r\n {totalVendas > 0 && (\r\n
\r\n \r\n {legenda.map((item) => (\r\n \r\n ))}\r\n
\r\n )}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default ContasRecebidas;\r\n","import React from 'react';\r\nimport { Card, Grid, Container } from '@material-ui/core';\r\nimport { makeStyles, Theme } from '@material-ui/core/styles';\r\nimport ContasReceber from 'components/Grafico/ContasAReceber/ContasAReceber';\r\nimport ContasRecebidas from 'components/Grafico/ContasAReceber/ContasRecebidas';\r\n\r\nimport { useLayout } from 'store/LayoutContext';\r\n\r\nconst useStyles = makeStyles((theme: Theme) => ({\r\n container: {\r\n paddingLeft: '0px',\r\n paddingRight: '0px',\r\n minWidth: '100%',\r\n minheight: '100%',\r\n },\r\n fab: {\r\n position: 'fixed',\r\n bottom: theme.spacing(2),\r\n right: theme.spacing(2),\r\n 'z-index': '999',\r\n },\r\n}));\r\n\r\nconst ContasAPagar: React.FC = () => {\r\n const classes = useStyles();\r\n const { setTitlePage } = useLayout();\r\n\r\n React.useEffect(() => {\r\n setTitlePage('Contas a Receber');\r\n });\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default ContasAPagar;\r\n","import React, { useEffect } from 'react';\r\nimport { BrowserRouter, Route, Switch } from 'react-router-dom';\r\nimport {\r\n GuardProvider,\r\n GuardedRoute as Guard,\r\n GuardFunction,\r\n} from 'react-router-guards';\r\nimport Loading from 'components/Loading';\r\nimport { useLayout } from 'store/LayoutContext';\r\n\r\nimport Login from 'pages/Autenticacao/Login';\r\nimport RecuperarSenha from 'pages/Autenticacao/RecuperarSenha';\r\nimport RedefinirSenha from 'pages/Autenticacao/RedefinirSenha';\r\nimport ConfirmarEmail from 'pages/Autenticacao/ConfirmarEmail';\r\n\r\nimport Menu from 'components/Menu';\r\nimport VendasPorLoja from 'pages/Dashboard/VendasPorLoja';\r\nimport VendasTodasLojas from 'pages/Dashboard/VendasTodasLojas';\r\nimport Produtos from 'pages/Dashboard/Produtos';\r\nimport ContasPagar from 'pages/Dashboard/ContasPagar';\r\nimport ContasReceber from 'pages/Dashboard/ContasReceber';\r\n\r\nimport {\r\n GuardFunctionRouteProps,\r\n GuardToRoute,\r\n Next,\r\n} from 'react-router-guards/dist/types';\r\nimport auth from 'auth';\r\nimport ConstanteRotas from 'constants/rotas';\r\n\r\nconst requireLogin: GuardFunction = (\r\n to: GuardToRoute,\r\n from: GuardFunctionRouteProps | null,\r\n next: Next\r\n) => {\r\n if (process.env.NODE_ENV === 'production' && to.meta.appInsights) {\r\n to.meta.appInsights.trackPageView({\r\n isLoggedIn: auth.autenticado(),\r\n name: auth.autenticado()\r\n ? auth.getUserIdentityAppInsights()\r\n : 'Não autenticado',\r\n uri: to.location,\r\n });\r\n }\r\n\r\n if (to.meta.auth) {\r\n if (auth.autenticado()) {\r\n next();\r\n }\r\n next.redirect('/');\r\n return;\r\n }\r\n\r\n next();\r\n};\r\n\r\nconst Routes: React.FC = () => {\r\n const { loading, appInsights } = useLayout();\r\n\r\n return (\r\n \r\n {loading && }\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Routes;\r\n","import { colors, createStyles, makeStyles } from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles(() =>\r\n createStyles({\r\n '@global': {\r\n '*': {\r\n boxSizing: 'border-box',\r\n margin: 0,\r\n padding: 0,\r\n },\r\n html: {\r\n '-webkit-font-smoothing': 'antialiased',\r\n '-moz-osx-font-smoothing': 'grayscale',\r\n },\r\n body: {\r\n backgroundColor: '#36464E',\r\n height: '100%',\r\n width: '100%',\r\n },\r\n '#root': {\r\n height: '100%',\r\n width: '100%',\r\n },\r\n '.MuiDialog-paper': {\r\n background: colors.blueGrey[900],\r\n color: colors.common.white,\r\n margin: 0,\r\n },\r\n '.MuiAutocomplete-listbox': {\r\n backgroundColor: colors.grey[700],\r\n },\r\n '.MuiAutocomplete-option': {\r\n backgroundColor: colors.grey[700],\r\n },\r\n '.MuiAutocomplete-option[aria-selected=\"true\"]': {\r\n backgroundColor: colors.grey[700],\r\n },\r\n '.MuiAutocomplete-option[data-focus=\"true\"]': {\r\n backgroundColor: colors.grey[600],\r\n },\r\n '.MuiAutocomplete-option:active': {\r\n backgroundColor: colors.grey[600],\r\n },\r\n '.MuiAutocomplete-noOptions': {\r\n backgroundColor: colors.grey[700],\r\n color: colors.common.white,\r\n padding: '14px 16px',\r\n },\r\n '.MuiAutocomplete-paper': {\r\n backgroundColor: colors.grey[700],\r\n },\r\n '.DatePicker': {\r\n zIndex: 'unset!important',\r\n },\r\n '.DatePicker__calendarContainer': {\r\n zIndex: '10!important',\r\n },\r\n '.MuiCard-root': {\r\n overflow: 'unset',\r\n },\r\n },\r\n })\r\n);\r\n\r\nconst GlobalStyles = () => {\r\n useStyles();\r\n\r\n return null;\r\n};\r\n\r\nexport default GlobalStyles;\r\n","import React from 'react';\r\nimport PWAPrompt from 'react-ios-pwa-prompt';\r\nimport { ThemeProvider } from '@material-ui/core';\r\nimport CssBaseline from '@material-ui/core/CssBaseline';\r\nimport { SnackbarProvider } from 'notistack';\r\n\r\nimport ChartDataContext from 'store/ChartDataContext';\r\nimport LayoutContext from 'store/LayoutContext';\r\n\r\nimport SnackbarCloseButton from 'components/SnackbarCloseButton';\r\nimport HeaderSistema from 'components/Header';\r\nimport ServiceWorkerWrapper from 'components/ServiceWorkerWrapper';\r\n\r\nimport theme from './theme';\r\nimport Routes from './routes';\r\nimport GlobalStyles from './styles/global';\r\n\r\nexport default function App() {\r\n return (\r\n \r\n \r\n \r\n\r\n \r\n }\r\n >\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","/* eslint-disable no-param-reassign */\r\n/* eslint-disable @typescript-eslint/no-use-before-define */\r\n// This optional code is used to register a service worker.\r\n// register() is not called by default.\r\n\r\n// This lets the app load faster on subsequent visits in production, and gives\r\n// it offline capabilities. However, it also means that developers (and users)\r\n// will only see deployed updates on subsequent visits to a page, after all the\r\n// existing tabs open on the page have been closed, since previously cached\r\n// resources are updated in the background.\r\n\r\n// To learn more about the benefits of this model and instructions on how to\r\n// opt-in, read https://cra.link/PWA\r\n\r\nconst isLocalhost = Boolean(\r\n window.location.hostname === 'localhost' ||\r\n // [::1] is the IPv6 localhost address.\r\n window.location.hostname === '[::1]' ||\r\n // 127.0.0.0/8 are considered localhost for IPv4.\r\n window.location.hostname.match(\r\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\r\n )\r\n);\r\n\r\ntype Config = {\r\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\r\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\r\n};\r\n\r\nexport function register(config?: Config) {\r\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\r\n // The URL constructor is available in all browsers that support SW.\r\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\r\n if (publicUrl.origin !== window.location.origin) {\r\n // Our service worker won't work if PUBLIC_URL is on a different origin\r\n // from what our page is served on. This might happen if a CDN is used to\r\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\r\n return;\r\n }\r\n\r\n window.addEventListener('load', () => {\r\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\r\n\r\n if (isLocalhost) {\r\n // This is running on localhost. Let's check if a service worker still exists or not.\r\n checkValidServiceWorker(swUrl, config);\r\n\r\n // Add some additional logging to localhost, pointing developers to the\r\n // service worker/PWA documentation.\r\n navigator.serviceWorker.ready.then(() => {\r\n console.log(\r\n 'This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://cra.link/PWA'\r\n );\r\n });\r\n } else {\r\n // Is not localhost. Just register service worker\r\n registerValidSW(swUrl, config);\r\n }\r\n });\r\n }\r\n}\r\n\r\nfunction registerValidSW(swUrl: string, config?: Config) {\r\n navigator.serviceWorker\r\n .register(swUrl)\r\n .then((registration) => {\r\n registration.onupdatefound = () => {\r\n const installingWorker = registration.installing;\r\n if (installingWorker == null) {\r\n return;\r\n }\r\n installingWorker.onstatechange = () => {\r\n if (installingWorker.state === 'installed') {\r\n if (navigator.serviceWorker.controller) {\r\n // At this point, the updated precached content has been fetched,\r\n // but the previous service worker will still serve the older\r\n // content until all client tabs are closed.\r\n console.log(\r\n 'New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://cra.link/PWA.'\r\n );\r\n\r\n // Execute callback\r\n if (config && config.onUpdate) {\r\n config.onUpdate(registration);\r\n }\r\n } else {\r\n // At this point, everything has been precached.\r\n // It's the perfect time to display a\r\n // \"Content is cached for offline use.\" message.\r\n console.log('Content is cached for offline use.');\r\n\r\n // Execute callback\r\n if (config && config.onSuccess) {\r\n config.onSuccess(registration);\r\n }\r\n }\r\n }\r\n };\r\n };\r\n })\r\n .catch((error) => {\r\n console.error('Error during service worker registration:', error);\r\n });\r\n}\r\n\r\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\r\n // Check if the service worker can be found. If it can't reload the page.\r\n fetch(swUrl, {\r\n headers: { 'Service-Worker': 'script' },\r\n })\r\n .then((response) => {\r\n // Ensure service worker exists, and that we really are getting a JS file.\r\n const contentType = response.headers.get('content-type');\r\n if (\r\n response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)\r\n ) {\r\n // No service worker found. Probably a different app. Reload the page.\r\n navigator.serviceWorker.ready.then((registration) => {\r\n registration.unregister().then(() => {\r\n window.location.reload();\r\n });\r\n });\r\n } else {\r\n // Service worker found. Proceed as normal.\r\n registerValidSW(swUrl, config);\r\n }\r\n })\r\n .catch(() => {\r\n console.log(\r\n 'No internet connection found. App is running in offline mode.'\r\n );\r\n });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator.serviceWorker.ready\r\n .then((registration) => {\r\n registration.unregister();\r\n })\r\n .catch((error) => {\r\n console.error(error.message);\r\n });\r\n }\r\n}\r\n","import React, { Suspense } from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport Loading from 'components/ProgressBar';\r\nimport App from './App';\r\nimport * as serviceWorkerRegistration from './serviceWorkerRegistration';\r\n\r\nReactDOM.render(\r\n \r\n }>\r\n \r\n \r\n ,\r\n document.getElementById('root')\r\n);\r\n\r\nserviceWorkerRegistration.register({\r\n onUpdate: (registration) => {\r\n if (registration && registration.waiting) {\r\n registration.waiting.postMessage({ type: 'SKIP_WAITING' });\r\n const evt = new CustomEvent('pwaUpdated');\r\n window.dispatchEvent(evt);\r\n }\r\n },\r\n});\r\n// reportWebVitals();\r\n"],"sourceRoot":""}