{"version":3,"sources":["redux/actions/AuthActions.ts","redux/reducers/AppReducer.ts","api/documents.ts","redux/actions/DocumentsActions.ts","api/auth.ts","redux/reducers/NotificationsReducer.ts","components/core/translate/Translate.tsx","redux/reducers/EimzoReducer.ts","redux/actions/AdminActions.ts","components/form/BankAutoComplete.tsx","hooks/redux.ts","data/marks.ts","layouts/dashboard/DashboardStyles.js","api/eimzo.ts","redux/actions/EimzoActions.ts","components/Scrollbar.js","components/form/RegionAutoComplete.tsx","components/form/DistrictAutoComplete.tsx","utils/requests.ts","redux/reducers/GoodsReducer.ts","redux/actions/ProfileActions.ts","utils/formatNumber.js","models/profile.ts","hooks/useProfile.ts","api/requests.ts","utils/utils.js","hooks/useToggle.ts","utils/formatTime.js","layouts/dashboard/skeletons/NavbarSkeleton.tsx","layouts/dashboard/skeletons/SidebarSkeleton.tsx","layouts/dashboard/index.js","layouts/LogoOnlyLayout.js","components/Page.js","components/_dashboard/app/AppBannedDocs.js","components/_dashboard/app/AppRejectedDocs.js","components/NewsModal.tsx","data/news.ts","redux/actions/NewsActions.ts","components/_dashboard/app/AppNewsUpdate.js","components/_dashboard/app/AppSignedDocs.js","components/_dashboard/app/AppWaitingDocs.js","pages/DashboardApp.js","hooks/useCopy.ts","redux/reducers/GroupActionsReducer.ts","components/core/tables/DetailPanel.tsx","components/_dashboard/user/UserListToolbar.js","components/core/tables/CustomPaginationTop.jsx","components/core/tables/CustomPaginationBottom.jsx","components/core/documentsFilter/DocumentsFilter.tsx","components/core/getDocumentFromRouming/GetDocumentFromRouming.tsx","static/xlsx/factura/sample.xlsx","static/xlsx/factura/template.xlsx","components/core/tables/DocumentsPreviewTable.tsx","hooks/use-open-file.ts","components/core/tables/RowMoreDocuments.tsx","components/core/tables/RenderMarksList.tsx","components/core/openFile/OpenFile.tsx","components/core/linearLoader/LinearLoader.tsx","components/core/loader/MainLoader.tsx","components/ProfileSelect.tsx","pages/MobileAuth.tsx","pages/Settings.tsx","components/core/skeletons/DocumentEditSkeleton.tsx","components/core/skeletons/ReferencesSkeleton.tsx","components/core/skeletons/ContactsSkeleton.tsx","components/core/skeletons/MxiksSkeleton.tsx","components/core/skeletons/LoginSkeleton.tsx","components/core/skeletons/RegisterSkeleton.tsx","pages/miniapp/MiniApp.js","api/editProfile.ts","components/profileRequisites/BankAccount.tsx","components/profileRequisites/ProdDeliver.tsx","pages/Admin.tsx","routes.js","theme/shape.js","theme/lightPalette.js","theme/darkPaletter.js","theme/typography.js","theme/overrides/index.js","theme/overrides/Card.js","theme/overrides/Lists.js","theme/overrides/Paper.js","theme/overrides/Input.js","theme/overrides/Button.js","theme/overrides/Tooltip.js","theme/overrides/Backdrop.js","theme/overrides/Typography.js","theme/overrides/IconButton.js","theme/overrides/Autocomplete.js","theme/overrides/Checkbox.js","theme/shadows.js","theme/index.js","theme/globalStyles.js","components/core/alert/Alert.tsx","hooks/useApp.ts","App.js","version.js","serviceWorker.js","reportWebVitals.js","redux/reducers/DocumentsReducer.ts","redux/reducers/ProfileReducer.ts","redux/reducers/RootReducer.ts","utils/i18n.ts","index.js","redux/actions/GoodsActions.ts","redux/reducers/AuthReducer.ts","data/lists.ts","redux/actions/AdminBanksActions.ts","components/form/ControlledTextField.tsx","redux/reducers/FilterReducer.ts","api/profile.ts"],"names":["getAuthId","async","serialNumber","length","parseInt","toString","res","api","status","data","authId","e","getProfileStatus","tin","fetchProfileType","format","Date","now","window","localStorage","setItem","JSON","stringify","dispatch","AuthSlice","actions","setAccountStatus","entityToken","type","console","log","userSignUp","payload","appSlice","toggleSystemLoading","response","toggleSystemAlert","show","message","user","entities","userLogin","token","refreshToken","updateProfileToken","saveLoginPass","createSlice","name","initialState","showSidebar","systemLoading","systemLoadingMsg","scaled","darkTheme","systemAlert","autoHide","reducers","toggleDarkTheme","state","action","toggleSideBar","hasOwnProperty","toggleInputsScale","getDocuments","params","axios","get","getDocCounts","getPrintDocument","id","getDownloadDocument","uploadFileXLSX","file","post","getDocument","saveDocument","editDocument","deleteDocument","signDocument","showSnackbar","arguments","undefined","pkcs7","headers","readDocument","waybillLocalMethods","method","url","trim","getDocumentFromRouming","rejectDocument","getSignCheck","getSignedFile","side","getWaybillLocalSign","deleteFromBin","refreshAllDocs","cookie","refreshDocument","SERVER_ERROR","fetchDocuments","createAsyncThunk","thunkAPI","rejectWithValue","fetchGetDocumentFromRouming","error","fetchDocCounts","fetchDocument","fetchSaveDocument","uploadXlsx","fetchAllDocuments","fetchEraseDocument","fetchEditDocument","fetchSignDocument","fetchReadDocument","fetchWaybillLocalMethods","fetchDeleteDocument","refetchAllDocs","fetchRejectDocument","fetchSignedFile","fetchWaybillLocalSign","fetchRefreshDocument","userPwdLogin","notificationsApi","createApi","reducerPath","baseQuery","fetchBaseQuery","baseUrl","process","prepareHeaders","_ref","_authReducer$profile$","getState","authReducer","profile","at","set","endpoints","builder","getReceivedDocs","query","useGetReceivedDocsQuery","Translate","tk","rest","t","useTranslation","_jsx","Typography","children","eimzoSlice","certificates","serialNumbers","setCertificates","setSerialNumbers","extraReducers","adminApi","getAllBanks","args","filter","page","limit","fields","modifyBanks","mutation","body","getMeasures","modifyMeasures","getEntities","modifyEntities","getUsers","modifyUsers","getPackages","modifyPackages","getBillings","modifyBillings","getItems","modifyItems","getGroups","modifyGroups","useGetAllBanksQuery","useGetBillingsQuery","useGetEntitiesQuery","useGetGroupsQuery","useGetItemsQuery","useGetMeasuresQuery","useGetPackagesQuery","useGetUsersQuery","useModifyBanksMutation","useModifyBillingsMutation","useModifyEntitiesMutation","useModifyGroupsMutation","useModifyItemsMutation","useModifyMeasuresMutation","useModifyPackagesMutation","useModifyUsersMutation","BankAutoComplete","_profile$accounts","control","controlProfile","setValue","setValueProfile","index","self","disabled","label","fieldPath","useProfileGetter","useGetProfile","useGetBanksQuery","banks","accounts","bank","_profile$accounts2","bankId","some","acc","Controller","render","_ref2","field","value","ref","Autocomplete","options","find","onChange","getOptionLabel","option","nameRU","returnOptionLabel","renderInput","TextField","inputRef","size","sx","mt","whiteSpace","overflow","React","memo","useAppDispatch","useDispatch","useAppSelector","useSelector","MARK_TYPES","PACKAGE_TYPES","RootStyle","styled","display","minHeight","MainStyle","theme","flexGrow","paddingTop","paddingBottom","spacing","breakpoints","up","paddingLeft","paddingRight","RootStyleNavbar","AppBar","open","isVisible","boxShadow","backgroundColor","palette","background","header","width","transform","transition","ToolbarStyle","Toolbar","_ref3","padding","justifyContent","alignItems","borderBottom","divider","flexBasis","maxWidth","AccountStatus","color","border","marginLeft","borderRadius","textOverflow","fontSize","lineHeight","FinanceCard","Card","_ref4","minWidth","paper","shape","margin","height","textAlign","position","FinanceTitle","_ref5","typography","pxToRem","text","secondary","fontWeight","fontWeightMedium","down","FinanceStatus","_ref6","debt","fontWeightBold","main","success","_ref7","FinanceIcon","marginRight","FinanceResultsBox","MenuIconContainer","Box","_ref8","top","right","getTimeStamp","getJoinSign","API_KEYS","errImzo","loadKeys","_serialNumbers","_certificates","EIMZOClient","listAllUserKeys","o","i","itemId","v","push","obj","items","firstId","r","installApiKeys","Promise","resolve","reject","CAPIWS","apikey","event","setTimeout","getInitialState","buildSuccess","reason","handleError","errMsg","loadKey","keyObject","cert","_cert$obj","keyId","indexOf","signData","callFunction","plugin","Buffer","from","pkcs7_64","then","pkcs7tst","catch","_currentProfile$user","_currentProfile$user$","eimzoReducer","allProfiles","toUpperCase","newKeyId","signedData","setNewKeyId","appendSign","documentData","getAttachedInfo","pkcs7Doc2","joinedDocuments","json","pkcs7Info","parsedDocument","documentBase64","parse","SimpleBarStyle","SimpleBarReact","maxHeight","alpha","grey","opacity","zIndex","Scrollbar","other","test","navigator","userAgent","overflowX","timeout","clickOnTrack","RegionAutoComplete","postfix","useGetRegionsQuery","waybillLocalData","useGetWaybillLocalRegionsQuery","regions","i18n","selector","regionName","returnValue","Array","isArray","region","regionId","language","nameRu","nameUzCyrl","DistrictAutoComplete","suffix","regionid","allDistricts","useGetDistrictsQuery","districts","useGetWaybillLocalDistrictsQuery","skip","list","district","districtCode","districtId","districtIdSelector","handleDistrictChange","buildPayloadPagination","pagination","search","sortBy","sortDesc","itemsPerPage","sorting","descending","sort","order","io","group","number","branch","dateMin","dateMax","goodsSlice","listOfMxikCodes","listOfAllMeasures","addMxik","mxik","existing","mxikCode","clearMxik","fetchMxikList","pending","fulfilled","rejected","fetchAllMeasures","fetchProfile","_","getProfile","shortName","fetchRentContracts","to","getRentContracts","fetchProfileByTin","getProfileByTin","fetchCurrentTurnOver","year","getCurrentTurnOver","date","newDate","fShortDashedDate","Error","getProfileType","fetchWareHouses","getWarehouses","fetchBankAccounts","getProfileBankAccounts","fetchProfileRights","getProfileRights","fetchMoneyLeft","getMoneyLeft","getStatus","checkPremiumAccount","useGetMoneyLeftQuery","useGetStatusQuery","useCheckPremiumAccountQuery","fCurrencySpace","numeral","Number","isInteger","replace","fNumber","fShortenNumber","fFloat","fixedVal","isNaN","toFixed","tokenExpiration","isItd","vat","vatRegCode","oked","email","mobile","phone","account","director","directorPinfl","accountant","telegramId","address","itemReleased","personalNum","branches","budget","isBudget","vatStatus","active","code","isSafe","suspended","vatPayer","isFizAuthToYurProfile","isAuthWithPassword","itemReleaseds","TIME_TO_CHECK_FOR_TOKEN_REFRESH","useProfileSetter","localProfile","navigate","useNavigate","logout","filterSlice","resetFilter","profileLogout","profileExit","useCallback","deleteAllCookies","key","removeItem","sessionStorage","clear","clearAccountStatus","location","reload","setProfileHook","noTokenUpdate","profileCopy","Object","assign","getTime","setProfile","profilesStore","profileObj","useGetAllProfiles","getCheckNonConfirmatoryCompany","getCheckProduct","day","dd","getDate","mm","getMonth","yyyy","getFullYear","String","getWithoutVatCompany","buyerTin","commitentTin","getLgotasForTurnOverCompany","getListOfAllMeasures","getListOfMxiks","getListOfMxiksByTin","getMxikByTin","searchParam","searchForMxik","searchForMxikByCode","codes","searchOtherIncomeMxik","getLotInfo","lotId","getLotType","signRequest","loginecp","verifyCode","mobileVerification","getProviders","setProviders","getInvestmentObject","getVehicles","getInvestmentListById","sellerTin","objectId","getInvestmentListByAccount","getContractById","getProductOriginByTin","getCheckMxikWithoutVat","getCheckMxikZeroVat","catchErrorMessage","errorData","errorText","searchRailwayDocId","getMarks","inputProps","props","InputProps","readOnly","fullWidth","getContractEntityFields","isOwner","role","basis","jobtitle","checkErrorsBase","errorMessage","errorTranslations","returnObjects","startKey","explanation","entries","checkRoumingErrorsBase","roumingErrorTranslations","startsWith","checkFormFacturaErrorsBase","keys","toLowerCase","split","rowNumber","processedKeys","map","arrayMatch","match","current","checkTTHErrorsBase","checkFormWaybillLocalErrorsBase","selectAllText","target","select","cookies","document","eqPos","substr","copyObject","isValidTinPinfl","tinPinfl","includes","resolveParam","toLowerCaseKeys","reduce","useToggle","initialValue","setState","useState","on","off","toggle","prev","fDate","locale","ru","fShortDate","fShortDatePerDay","parsedDate","isToday","isThisYear","fDateTime","custom","NavbarSkeleton","appReducer","_jsxs","Stack","direction","xs","sm","Skeleton","animation","variant","Drawer","shouldForwardProp","prop","flexShrink","boxSizing","CustomScrollbar","CustomList","List","SidebarSkeleton","useTheme","px","DashboardNavbar","lazy","DashboardSidebar","DashboardLayout","setOpen","Suspense","fallback","isOpenSidebar","onCloseSidebar","Outlet","LogoOnlyLayout","useEffect","_Fragment","Page","forwardRef","title","Helmet","propTypes","PropTypes","node","isRequired","string","flexDirection","darker","lighter","IconWrapperStyle","marginBottom","dark","backgroundImage","AppBannedDocs","count","Icon","icon","banned","warning","AppRejectedDocs","formatNewsText","NewsModal","handleClose","files","descriptionElementRef","useRef","descriptionElement","focus","Dialog","onClose","closeAfterTransition","BackdropComponent","Backdrop","BackdropProps","Button","onClick","backdropFilter","DialogContent","pb","component","alt","src","mb","DialogContentText","tabIndex","dangerouslySetInnerHTML","__html","newsApi","getNews","useGetNewsQuery","placeholderAnimation","hidden","scale","visible","duration","NewsItem","news","newsClick","short_text","Paper","elevation","p","cursor","objectFit","motion","div","initial","animate","variants","textDecoration","AppNewsUpdate","_fetchedNews$messages2","modalContent","setModalContent","visibleNewsCount","setVisibleNewsCount","fetchedNews","isFetching","isSuccess","handleNewsClick","_fetchedNews$messages","lastShowedNewsId","getItem","messages","latestNewsWithImage","newsItem","latestNewsWithImageId","messageid","latestNewsDate","twoDaysAgo","CardHeader","style","onMouseOver","currentTarget","onMouseOut","TelegramIcon","handleTelegramLinkClick","Divider","Grid","container","flexWrap","slice","item","md","endIcon","arrowIosForwardFill","handleLoadMore","prevCount","Math","min","primary","AppSignedDocs","rightTopArrow","info","AppWaitingDocs","clockFilled","DashboardApp","signed","sended","documentsReducer","docCounts","in","drafts","outSended","out","Container","y","ease","Link","AppWeeklySales","delay","AppNewUsers","AppItemOrders","AppBugReports","useCopy","copyToClipboard","clipboard","writeText","err","textarea","createElement","appendChild","execCommand","removeChild","groupActionsSlice","processingRow","processingRowsError","processingRowsSuccess","processingRowsErrorDialog","setProcessingRow","setProcessingRowsError","setProcessingRowsSuccess","setProcessingRowsErrorDialog","clearProcessingRow","clearProcessingRowsErrorDialog","clearAllProcessedRows","statusColors","received","deleted","earsed","DetailPanel","_targetTins$","_targetTins$2","_targetTins$3","_targetTins$4","_targetTins$5","_targetTins$6","_targetTins$7","row","useParams","_id","stateId","updatedAt","contractNumber","contractDate","roumingId","docNumber","docDate","subType","ownerTin","targetTins","ownerName","extension","notes","original","statusColor","targetTinsLength","tinOrPinfl","partnerName","tinOrPinflLabel","contragent","responsiblePersonPINFL","responsiblePersonName","contractText","gap","noWrap","singlesidedtype","Tooltip","arrow","disableInteractive","placement","setupTinFilter","setupDocTypeFilter","docType","setupNumberDocumentFilter","numberDocument","setupNumberFilter","totalDocSum","totalSum","totalVatSum","UserListToolbar","docsLength","numSelected","setShowSignMessage","showSignButton","documentType","deleteDocuments","erase","refreshDocuments","refreshReceived","onClearSelection","disabledState","isSmallScreen","useMediaQuery","LoadingButton","loading","loadingPosition","refresh","mr","trash2Fill","signIcon","borderColor","CustomPaginationTop","totalDocs","rowsPerPage","handleChangePage","handleChangeRowsPerPage","pageTitle","pageTitleIcon","totalPages","ceil","verticalAlign","Select","MenuItem","Pagination","handlePageChange","siblingCount","boundaryCount","selected","CustomPaginationBottom","pr","DocumentsFilter","filterReducer","isFilterActive","setIsFilterActive","docCategory","setDocCategory","anchorEl","setAnchorEl","setContractDate","minDate","setMinDate","maxDate","setMaxDate","setTin","num","setNum","contractNum","setContractNum","filterPopover","Boolean","dropFilter","ml","Badge","invisible","badgeContent","anchorOrigin","vertical","horizontal","textTransform","icons","stopPropagation","content","left","Popover","FormControl","InputLabel","labelId","listOfFilterDocuments","doc","ListSubheader","LocalizationProvider","dateAdapter","AdapterDayjs","adapterLocale","uz","DatePicker","views","newValue","inputFormat","mask","startIcon","setupFilter","filterObject","setFilter","GetDocumentFromRouming","anchor","tinRef","fileInputRef","useId","mode","setMode","successfulUploads","setSuccessfulUploads","setLoading","progress","setProgress","timer","clearTimeout","_tinRef$current","_inputRef$current","_tinRef$current2","errors","msg","accept","_event$target$files","reader","FileReader","onload","_e$target","result","decoder","TextDecoder","encodedText","Uint8Array","char","charCodeAt","rows","decode","processedCount","_columns$","_columns$2","columns","readAsBinaryString","ReactDOM","createPortal","Fade","Alert","severity","bottom","Slide","bgcolor","round","LinearProgress","descendingComparator","a","b","orderBy","Transition","titleIconsList","imported","exported","preliminary","draft","waybillLocalActions","DocumentsPreviewTable","confirm","useConfirm","successfullSignedRef","signButton","eraseButton","setPage","showSignMessage","setOrder","setOrderBy","setRowsPerPage","opened","freeze","successfullSigned","setSuccessfullSigned","dialogContentRef","docs","tableLoading","groupActionsReducer","setSelected","rowSelection","setRowSelection","openSampleDialog","setOpenSampleDialog","processingRowsErrorDialogOpen","setProcessingRowsErrorDialogOpen","translateTableHead","newPage","filteredUsers","array","comparator","stabilizedThis","el","_user","applySortFilter","getComparator","docId","foundDoc","respStatus","_respStatus$data$erro","newDocument","sellerVatRegStatus","sellertin","seller","vatregstatus","buyertin","buyerVatRegStatus","buyer","_res","_res2","_res2$data$errors","refreshReceivedDoc","description","cancellationText","confirmationText","_res$data$errors","eraseDocuments","_res$data$errors2","useMemo","buildSearch","srch","refetchDocs","redirectToClickedDocument","signRes","hasOwn","agent","passport","dateofissue","issuedby","newDoc","_doc$data","_doc$data$seller","_doc$data2","_doc$data2$buyer","taxgap","_newDoc$data","_newDoc$data$seller","_newDoc$data$seller2","_newDoc$data$buyer","realizationpurpose","category","sign","_signRes","signType","signature","_signRes2","_doc","_doc$data3","_doc$data3$consignee","consignee","tinorpinfl","WaybillLocalId","WaybillLocalSignType","ResponsiblePersonPinfl","ConsignorTinOrPinfl","_res3","docStatus","_doc2","_doc2$data","_doc2$data$consignee","_res4","_res4$data$errors","createBasedDoc","identificator","based","navParams","corrected","additional","listOfDocumentCategories","_newDoc","accessorKey","enableColumnActions","enableColumnOrdering","enableSorting","enableColumnFilter","minSize","maxSize","muiTableHeadCellProps","align","Cell","_row$original","_row$original$extensi","IconButton","handleClickOpen","redirectToEditDocument","renewDocument","hasmarking","PriorityHighIcon","enableClickToCopy","totalDocSumText","enableResizing","sortDescFirst","redirectToDocumentPage","sectionDocumentType","toLocaleUpperCase","setMaxHeight","updateTableHeight","innerHeight","addEventListener","removeEventListener","showProgressBars","setShowProgressBars","TransitionComponent","keepMounted","DialogTitle","DialogActions","finally","href","sampleXlsx","download","m","templateXlsx","fileBase64","readAsDataURL","onerror","fileToBase64","base64","upload","textWrap","rel","_dialogContentRef$cur","innerText","MaterialReactTable","enableExpanding","density","columnOrder","desc","muiTableBodyCellProps","displayColumnDefOptions","enableHiding","muiTopToolbarProps","tableContainer","muiTableHeadRowProps","muiTableBodyRowProps","tableBody","pointerEvents","muiTableContainerProps","muiBottomToolbarProps","borderTop","muiTablePaperProps","enableColumnResizing","enableRowActions","renderRowActions","rowId","handleClickOpenProcessingRowsErrorDialog","CircularProgress","enableColumnFilters","enableGlobalFilter","enablePagination","enableRowSelection","getRowId","onRowSelectionChange","positionToolbarAlertBanner","renderTopToolbarCustomActions","AddIcon","RefreshIcon","renderBottomToolbarCustomActions","showLessIcon","showMoreIcon","layoutMode","renderDetailPanel","muiTableDetailPanelProps","tableBodyDetail","localization","expand","expandAll","collapse","collapseAll","toggleFullScreen","toggleDensity","showHideColumns","hideAll","resetOrder","showAll","toggleSelectRow","toggleSelectAll","noRecordsToDisplay","waybillLocalUnwantedKeys","RowMoreDocuments","modal","contractClients","setContractClients","moreDocCateg","documents","idPopover","checkContract","_res$data$clients","clients","redirectToNewDoc","targetTin","client","add","Menu","handlePoperClose","RenderMarksList","_doc$data2$productlis","_doc$data2$productlis2","tableHeads","splitMarks","_item$marks","_item$marks$kiz","_item$marks2","_item$marks2$nomupak","_item$marks3","_item$marks3$identtra","marks","consumer","transport","kiz","nomupak","identtransupak","downloadMarksAsExcel","_doc$data$productlist","_doc$data$productlist2","marksData","productlist","products","forEach","mark","packageType","_MARK_TYPES$find","productData","product_name","product_type","_item$marks4","producttype","package_type","mark_code","ws","XLSX","json_to_sheet","skipHeader","wb","book_new","book_append_sheet","Table","TableHead","TableRow","cell","TableCell","TableBody","_MARK_TYPES$find2","markType","Chip","OpenFile","_doc$data$consignor","_doc$data2$consignee","_doc$data3$responsibl","_doc$data4","useLocation","isUniversal","lastScrollY","setLastScrollY","topValue","setTopValue","link","setLink","setDoc","marksModal","isSidebarShown","isWaybillLocalType","isConsignor","consignor","isConsignee","isRespPerson","responsibleperson","pinfl","handleCloseMarks","createBased","eraseItem","deleteItem","rejectItem","_doc$data2$responsibl","Notes","note","nameData","pkcs","isResponsiblePerson","_pkcs","k","WaybillLocal","waybilllocaltypename","singlesidedtypename","SellerTin","FacturaId","facturaid","BuyerTin","EmpowermentId","empowermentid","CarrierTin","WaybillIds","waybillids","ActId","actid","OwnerTin","ContractId","contractid","VerificationActId","verificationactid","Type","Id","useOpenFile","comment","rejectModal","noCommentError","fetchPrintDocument","res2","all","goBack","REACT_APP_DEVELOPMENT_URL","refreshDraft","fetchSignLetter","customBtnLabel","neg","pos","copyProduct","enqueueSnackbar","handleScroll","currentScrollY","scrollY","ButtonGroup","_doc$data$buyer","print","printDoc","downloadElement","click","pdfDoc","handleOpenMarks","barCode","update","edit","copy","multiline","handleDocumentReject","autoFocus","trashCan","eraseBtn","backIcon","className","srcDoc","LinearLoader","LoadingComponent","StyledCustomButton","ProfileSelect","currentProfileTin","filteredEntities","entity","marginTop","_parsedProfile$tin","profileRes","fetch","Authorization","parsedProfile","entityName","owner","removeFizInnProfiles","selectEntity","default","MobileAuth","handleSubmit","useForm","mobProfile","setMobProfile","login","password","showPassword","handleChange","saveLoginPassword","autoComplete","onSubmit","OutlinedInput","htmlFor","endAdornment","InputAdornment","handleClickShowPassword","onMouseDown","preventDefault","visibilityoff","visibility","TABLE_ICONS","icon1","send","icon2","cancel","icon3","icon4","Settings","_profile$branches","_profile$branches2","_profile$branches2$fi","_profile$user","_rights$taxpayers","rights","profileReducer","editableUser","setEditableUser","editableUserFio","setEditableUserFio","rightsList","setRightsList","shouldRenderMobileAuth","saving","fio","fizTin","roles","brunchNum","req","setProfileRights","_res$data","fetchSignRequest","Success","hash","Hash","fetchLoginEcp","startIndex","substring","res3","searchByTin","setBranch","handleRight","rightNum","checkedRight","providersData","setProvidersData","setupProviders","enabled","fetchProviders","maxLength","isDeleted","branchNum","branchName","Checkbox","checked","pl","rowSpan","borderStyle","borderWidth","colSpan","taxpayers","_rights$taxpayers$fin","foundUserRights","taxPayer","editTableRow","barnch","deleteTableRow","deleteRow","checkmark","systemName","providerName","edocsTin","edocs","providerTin","providerTins","provider","ClientTin","ProviderTins","setEdocs","DocumentEditSkeleton","gridTemplateColumns","ReferencesSkeleton","my","ContactsSkeleton","MxiksSkeleton","LoginSkeleton","RegisterSkeleton","MiniApp","setUser","setMessages","messageText","setMessageText","chatId","setChatId","setError","showError","setShowError","chatBoxRef","socketRef","isChatClosed","setIsChatClosed","isOperator","setIsOperator","BASE_URL","startParam","URLSearchParams","tgScript","head","socketScript","checkTelegram","_window$Telegram2","_window$Telegram2$Web","_window$Telegram2$Web2","Telegram","WebApp","initDataUnsafe","path","chat_id","telegram_id","scrollToBottom","admin_id","chat_history","emit","first_name","username","_socketRef$current","disconnect","sendMessage","messageData","sender_id","message_text","timestamp","toISOString","sendToSocket","_chatBoxRef$current","scrollTo","scrollHeight","behavior","closeError","_window$Telegram","close","renderMessage","toLocaleTimeString","hour","minute","placeholder","onKeyPress","shiftKey","xmlns","viewBox","fill","d","endChat","_window$Telegram3","saveProfileData","resData","BankAccaunt","append","remove","useFieldArray","pt","ControlledTextField","ProdDeliver","prepend","defaultIndex","setDefaultIndex","Pinfl","movedItem","makeDefault","Admin","_profile$vatRegCode","_profile$oked","accountStatus","notification","methods","defaultValues","watch","reset","formState","refreshProfile","verifyMobile","prompt","userData","updateProfileData","filteredData","FormProvider","nameUz","rules","required","validate","_field$value","fieldState","InputMask","maskChar","_fieldState$error","helperText","startAdornment","cleanedValue","_field$value2","onlyNumbers","_fieldState$error2","referrerPolicy","DocumentEdit","Contacts","Mxiks","AdminItems","References","Login","Register","Router","isAuthenticated","isFizHasOldInn","useRoutes","element","Navigate","borderRadiusSm","borderRadiusMd","createGradient","color1","color2","GREY","PRIMARY","light","contrastText","INFO","SUCCESS","WARNING","ERROR","GRADIENTS","lightPalette","common","black","white","gradients","chart","violet","blue","green","yellow","red","neutral","social","hover","disabledBackground","hoverOpacity","disabledOpacity","darkPalette","responsiveFontSizes","lg","fontFamily","fontWeightRegular","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","overline","letterSpacing","button","ComponentsOverrides","merge","MuiCard","styleOverrides","root","customShadows","z4","MuiCardHeader","defaultProps","titleTypographyProps","subheaderTypographyProps","MuiCardContent","MuiListItemIcon","MuiListItemAvatar","MuiListItemText","Lists","MuiPaper","MuiInputBase","input","MuiInput","underline","borderBottomColor","MuiFilledInput","MuiOutlinedInput","Input","MuiButton","sizeLarge","containedInherit","z8","containedPrimary","containedSecondary","outlinedInherit","textInherit","MuiTooltip","tooltip","varLow","varHigh","MuiBackdrop","MuiTypography","paragraph","gutterBottom","MuiIconButton","MuiAutocomplete","z20","MuiCheckbox","MuiSvgIcon","LIGHT_MODE","transparent","z1","z12","z16","z24","createCustomShadow","shadows","transparent1","transparent2","transparent3","createShadow","ThemeConfig","themeOptions","createTheme","components","componentsOverride","StyledEngineProvider","injectFirst","ThemeProvider","CssBaseline","GlobalStyles","GlobalThemeStyles","styles","html","WebkitOverflowScrolling","MozAppearance","WebkitAppearance","WebkitBoxShadow","WebkitTextFillColor","caretColor","img","WebkitFilter","AlertBoxWrapper","AlertBox","timerRef","countdown","setCountdown","hideAlert","counter","interval","setInterval","clearInterval","borderLeft","AlertTitle","useApp","closeSnackbar","useSnackbar","localToken","localTokenExpiration","defaults","isTokenExpired","configureAxiosMiddleware","handleToken","getProfileStat","_localProfile$tin","checkEdocsProvider","allowClose","providers","providersRes","createSnackbarContent","wordWrap","interceptors","use","_error$response","_error$response$data","_error$response$data$","_error$response2","filteredErrorMessage","errorRespons","_errorRespons$data","_errorRespons$data$er","config","checkedValue","param","join","errorMessageFn","autoHideDuration","_error$response3","_error$response3$data","_error$response3$data2","_error$response4","_error$response4$data","_error$response4$data2","_error$response5","_error$response5$data","_error$response5$data2","_error$response6","_error$response7","_error$response8","dataErrorsMsg","statusText","App","ok","versionMatch","clearData","themeLightValue","i18nextLngValue","c","toUTCString","cacheNames","caches","cacheName","delete","handleCustomHotKey","querySelector","isLocalhost","hostname","registerValidSW","swUrl","serviceWorker","register","registration","onupdatefound","installingWorker","installing","onstatechange","controller","onUpdate","onSuccess","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","documentsSlice","hasNextPage","hasPrevPage","nextPage","current_page","pagingCounter","prevPage","sened","commonDocCounts","profileSlice","warehouses","bankAccounts","persistConfig","storage","version","blacklist","listsApi","mxiksApi","rootReducer","combineReducers","goodsReducer","notificationsReducer","reducer","persistedReducer","persistReducer","store","configureStore","devTools","middleware","getDefaultMiddleware","serializableCheck","concat","persistor","persistStore","resources","translation","initReactI18next","LanguageDetector","HttpApi","init","supportedLngs","fallbackLng","debug","interpolation","escapeValue","require","notistackRef","createRef","onClickDismiss","baseURL","Provider","PersistGate","HelmetProvider","BrowserRouter","ConfirmProvider","SnackbarProvider","maxSnack","getElementById","URL","origin","contentType","ready","unregister","checkValidServiceWorker","allData","searchNonConfirmatoryCompany","fetchMxikByCode","railwayDocId","getSavedMxiksForCount","TasnifName","getSavedMxiks","mutateMxik","reqUrl","getGoodsWithPriveleges","TasnifCode","LgotaName","getZeroVatRateServices","getCompaniesWithPriveleges","Tin","getZeroVatRateCompanies","getNoOffsetGoods","SearchText","getCompensationServices","getNonConformityGoodsCompanies","useGetCompaniesWithPrivelegesQuery","useGetCompensationServicesQuery","useGetGoodsWithPrivelegesQuery","useGetNoOffsetGoodsQuery","useGetZeroVatRateCompaniesQuery","useGetZeroVatRateServicesQuery","useGetNonConformityGoodsCompaniesQuery","useGetSavedMxiksQuery","useMutateMxikMutation","useGetSavedMxiksForCountQuery","filteredProfiles","listOfDocumentDirections","listOfFacturaTypes","listOfContractTypes","listOfProductOrigins","getBanks","getDistricts","getRegions","getStations","getCountries","getWaybillLocalRegions","getWaybillLocalDistricts","getMahallas","soato","useGetCountriesQuery","useGetStationsQuery","useGetMahallasQuery","ObjectByString","s","n","formatOnBlur","formatOnChange","useFormContext","formatValue","val","str","onBlur","InputLabelProps","shrink","filterState","filters","profileTin","setFilterProfile","resetAllFilters","getProfileByPinfl","getProfileTypeCommitent"],"mappings":"wGACA,4RAMO,MAAMA,EAAYC,UACxB,IACKC,EAAaC,OAAS,IACzBD,EAAeE,SAASF,GAAcG,SAAS,KAEhD,IAAIC,QAAYC,IAAIP,UAAUE,GAC9B,GAAmB,MAAfI,EAAIE,OACP,OAAOF,EAAIG,KAAKC,MAElB,CAAE,MAAOC,GAAI,GAGDC,EAAoBC,GAAgBZ,UAChD,IACC,MAAMK,QAAYQ,YAAiBD,EAAKE,YAAO,IAAIC,KAAKA,KAAKC,OAAQ,eACrEC,OAAOC,aAAaC,QAAQ,gBAAiBC,KAAKC,UAAa,O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AQnnC,MAAK3W,IAC7B,MAAfA,EAAIE,SACP2B,GAAW,EACZ,IAEMA,CAAQ,C","file":"static/js/main.65fadf9c.chunk.js","sourcesContent":["import { RootDispatch } from '../reducers/RootReducer'\r\nimport api, { IUserLogin } from '../../api/auth'\r\nimport { format } from 'date-fns'\r\nimport { AuthSlice } from '../reducers/AuthReducer'\r\nimport { appSlice } from '../reducers/AppReducer'\r\nimport { fetchProfileType } from './ProfileActions'\r\n\r\nexport const getAuthId = async (serialNumber: string) => {\r\n\ttry {\r\n\t\tif (serialNumber.length > 8) {\r\n\t\t\tserialNumber = parseInt(serialNumber).toString(16)\r\n\t\t}\r\n\t\tlet res = await api.getAuthId(serialNumber)\r\n\t\tif (res.status === 200) {\r\n\t\t\treturn res.data.authId\r\n\t\t}\r\n\t} catch (e) {}\r\n}\r\n\r\nexport const getProfileStatus = (tin: string) => async (dispatch: RootDispatch) => {\r\n\ttry {\r\n\t\tconst res = await fetchProfileType(tin, format(new Date(Date.now()), 'yyyy-MM-dd'))\r\n\t\twindow.localStorage.setItem('accountStatus', JSON.stringify(res?.data))\r\n\t\tres?.status === 200 && dispatch(AuthSlice.actions.setAccountStatus(res?.data))\r\n\t} catch (e) {}\r\n}\r\n\r\nexport const entityToken = async (tin: string, type: string) => {\r\n\ttry {\r\n\t\treturn await api.entityToken(tin, type)\r\n\t} catch (e) {\r\n\t\tconsole.log(e)\r\n\t}\r\n}\r\n\r\nexport const userSignUp = (payload: any) => async (dispatch: RootDispatch) => {\r\n\ttry {\r\n\t\tdispatch(appSlice.actions.toggleSystemLoading(true))\r\n\t\tconst response = await api.userSignUp(payload)\r\n\t\tdispatch(appSlice.actions.toggleSystemLoading(false))\r\n\t\tif (response.status === 200) {\r\n\t\t\tdispatch(\r\n\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\tshow: true,\r\n\t\t\t\t\tmessage: 'Успешно авторизовано'\r\n\t\t\t\t})\r\n\t\t\t)\r\n\t\t\treturn response.data.user.entities\r\n\t\t} else {\r\n\t\t\treturn null\r\n\t\t}\r\n\t} catch {\r\n\t} finally {\r\n\t\tdispatch(appSlice.actions.toggleSystemLoading(false))\r\n\t}\r\n}\r\n\r\nexport const userLogin = (payload: IUserLogin) => async () => {\r\n\ttry {\r\n\t\tconst response = await api.userLogin(payload)\r\n\t\tif (response.status === 200) {\r\n\t\t\treturn {\r\n\t\t\t\tentities: response.data.user.entities,\r\n\t\t\t\ttoken: response.data.token,\r\n\t\t\t\tuser: response.data.user\r\n\t\t\t}\r\n\t\t}\r\n\t} catch (e) {}\r\n}\r\n\r\nexport const refreshToken = async (updateProfileToken: (token: string) => void) => {\r\n\ttry {\r\n\t\tconst response = await api.refreshToken()\r\n\r\n\t\tif (response.status === 200) {\r\n\t\t\tupdateProfileToken(response.data.token)\r\n\t\t}\r\n\t} catch (e) {\r\n\t\tconsole.log(e)\r\n\t}\r\n}\r\n\r\nexport const saveLoginPass = async (payload: any) => {\r\n\ttry {\r\n\t\treturn await api.saveLoginPass(payload)\r\n\t} catch (e) {}\r\n}\r\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit'\r\n\r\nexport type SystemAlert = {\r\n\tmessage: string\r\n\ttype: 'error' | 'success' | 'info' | 'warning'\r\n\tshow: boolean\r\n\tautoHide?: boolean\r\n}\r\n\r\ninterface AppState {\r\n\tshowSidebar: boolean\r\n\tsystemAlert: SystemAlert\r\n\tsystemLoading: boolean\r\n\tscaled: boolean\r\n\tdarkTheme: boolean\r\n\tsystemLoadingMsg: string\r\n}\r\n\r\nconst initialState: AppState = {\r\n\tshowSidebar: true,\r\n\tsystemLoading: false,\r\n\tsystemLoadingMsg: '',\r\n\tscaled: false,\r\n\tdarkTheme: false,\r\n\tsystemAlert: {\r\n\t\tshow: false,\r\n\t\tmessage: '',\r\n\t\ttype: 'info',\r\n\t\tautoHide: true\r\n\t}\r\n}\r\n\r\nexport const appSlice = createSlice({\r\n\tname: 'app',\r\n\tinitialState,\r\n\treducers: {\r\n\t\ttoggleDarkTheme(state, action: PayloadAction) {\r\n\t\t\tstate.darkTheme = action.payload\r\n\t\t},\r\n\t\ttoggleSideBar(state, action: PayloadAction) {\r\n\t\t\tstate.showSidebar = action.payload\r\n\t\t},\r\n\t\ttoggleSystemAlert(state, action: PayloadAction) {\r\n\t\t\tif (action.payload.hasOwnProperty('autoHide')) {\r\n\t\t\t\tstate.systemAlert = action.payload\r\n\t\t\t} else {\r\n\t\t\t\taction.payload.autoHide = true\r\n\t\t\t\tstate.systemAlert = action.payload\r\n\t\t\t}\r\n\t\t},\r\n\t\ttoggleSystemLoading(state, action) {\r\n\t\t\tif (typeof action.payload === 'boolean') {\r\n\t\t\t\tstate.systemLoading = action.payload\r\n\t\t\t\tstate.systemLoadingMsg = ''\r\n\t\t\t} else {\r\n\t\t\t\tstate.systemLoading = action.payload.state\r\n\t\t\t\tstate.systemLoadingMsg = action.payload.message\r\n\t\t\t}\r\n\t\t},\r\n\t\ttoggleInputsScale(state, action: PayloadAction) {\r\n\t\t\tstate.scaled = action.payload\r\n\t\t}\r\n\t}\r\n})\r\n\r\nexport default appSlice.reducer\r\n","import axios from 'axios'\r\n\r\nexport default {\r\n\tasync getDocuments(params: any) {\r\n\t\treturn await axios.get(`/documents`, {\r\n\t\t\tparams\r\n\t\t})\r\n\t},\r\n\tasync getDocCounts(type: string) {\r\n\t\treturn await axios.get(`/documents/${type}/get/stats`)\r\n\t},\r\n\tasync getPrintDocument(type: string, id: string) {\r\n\t\treturn await axios.get(`/documents/${type}/${id}/html`)\r\n\t},\r\n\tasync getDownloadDocument(type: string, id: string) {\r\n\t\treturn await axios.get(`/documents/${type}/${id}/true/file`)\r\n\t},\r\n\tasync uploadFileXLSX(file: any) {\r\n\t\treturn await axios.post(`/documents/factura/upload/xlsx`, file)\r\n\t},\r\n\tasync getDocument(type: string, id: string) {\r\n\t\treturn await axios.get(`/documents/${type}/${id}`)\r\n\t},\r\n\tasync saveDocument(type: string, payload: any) {\r\n\t\treturn await axios.post(`/documents/${type}/`, payload)\r\n\t},\r\n\tasync editDocument(type: string, id: string, payload: any) {\r\n\t\treturn await axios.post(`/documents/${type}/${id}/edit`, payload)\r\n\t},\r\n\tasync deleteDocument(type: string, id: string, payload: any) {\r\n\t\treturn await axios.post(`/documents/${type}/${id}/delete`, payload)\r\n\t},\r\n\tasync signDocument(type: string, id: string, payload: any, showSnackbar = true) {\r\n\t\treturn await axios.post(\r\n\t\t\t`/documents/${type}/${id}/sign`,\r\n\t\t\t{\r\n\t\t\t\tpkcs7: payload\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\theaders: { showSnackbar: showSnackbar.toString() }\r\n\t\t\t}\r\n\t\t)\r\n\t},\r\n\tasync readDocument(type: string, id: string, showSnackbar = true) {\r\n\t\treturn await axios.post(`/documents/${type}/${id}/read`, {\r\n\t\t\theaders: { showSnackbar: showSnackbar.toString() }\r\n\t\t})\r\n\t},\r\n\tasync waybillLocalMethods(id: string, payload: any, method: string) {\r\n\t\tlet url = `/documents/waybillLocal/${id}/sign`\r\n\t\tif (!!method.trim()) {\r\n\t\t\turl += `/${method}`\r\n\t\t}\r\n\t\treturn await axios.post(url, { pkcs7: payload })\r\n\t},\r\n\tasync getDocumentFromRouming(tin: string, id: string) {\r\n\t\treturn await axios.get(`/documents/factura/${tin}/${id}/refreshdoc`)\r\n\t},\r\n\tasync rejectDocument(type: string, id: string, payload: any) {\r\n\t\treturn await axios.post(`/documents/${type}/${id}/reject`, payload)\r\n\t},\r\n\tasync getSignCheck(id: string) {\r\n\t\treturn axios.get(`/documents/factura/${id}/buyer/signedfile`)\r\n\t},\r\n\tasync getSignedFile(type: string, id: string, side: string) {\r\n\t\treturn await axios.get(`/documents/${type}/${id}/${side}/signedfile`)\r\n\t},\r\n\tasync getWaybillLocalSign(id: string, side: string, state: number) {\r\n\t\treturn await axios.get(`/documents/waybillLocal/${id}/${side}/signedfile/${state}`)\r\n\t},\r\n\tasync deleteFromBin(type: string, id: string) {\r\n\t\treturn await axios.post(`/documents/${type}/${id}/erase`)\r\n\t},\r\n\tasync refreshAllDocs(data: string) {\r\n\t\tconst params = `FacturaSessionId=${data}`\r\n\t\treturn await axios.post('/documents/all/docs/refreshNew', {\r\n\t\t\tcookie: params\r\n\t\t})\r\n\t},\r\n\tasync refreshDocument(type: string, id: string, showSnackbar = true) {\r\n\t\treturn await axios.get(`/documents/${type}/${id}/refresh`, {\r\n\t\t\theaders: { showSnackbar: showSnackbar.toString() }\r\n\t\t})\r\n\t}\r\n}\r\n","import { createAsyncThunk } from '@reduxjs/toolkit'\r\nimport api from '../../api/documents'\r\n\r\nconst SERVER_ERROR = 'Ошибка на стороне сервера'\r\n\r\nexport const fetchDocuments = createAsyncThunk('documents/fetchAll', async (payload: any, thunkAPI) => {\r\n\ttry {\r\n\t\tconst res = await api.getDocuments(payload)\r\n\t\tif (res.status !== 200) return\r\n\t\treturn res.data\r\n\t} catch (e) {\r\n\t\treturn thunkAPI.rejectWithValue(SERVER_ERROR)\r\n\t}\r\n})\r\n\r\nexport const getPrintDocument = async (type: string, id: string) => {\r\n\ttry {\r\n\t\tconst res = await api.getPrintDocument(type, id)\r\n\t\treturn res.data\r\n\t} catch (e) {\r\n\t\tconsole.log(e)\r\n\t}\r\n}\r\n\r\nexport const fetchGetDocumentFromRouming = async (tin: string, id: string) => {\r\n\ttry {\r\n\t\treturn await api.getDocumentFromRouming(tin, id)\r\n\t} catch (error) {\r\n\t\tconsole.error(error)\r\n\t}\r\n}\r\n\r\nexport const getDownloadDocument = async (type: string, id: string) => {\r\n\ttry {\r\n\t\tconst res = await api.getDownloadDocument(type, id)\r\n\t\treturn res.data\r\n\t} catch (e) {\r\n\t\tconsole.log(e)\r\n\t}\r\n}\r\n\r\nexport const fetchDocCounts = createAsyncThunk('documents/fetchDocCounts', async (type: string, thunkAPI) => {\r\n\ttry {\r\n\t\tconst res = await api.getDocCounts(type)\r\n\t\tif (res.status !== 200) return\r\n\t\treturn res.data\r\n\t} catch (e) {\r\n\t\treturn thunkAPI.rejectWithValue(SERVER_ERROR)\r\n\t}\r\n})\r\n\r\nexport const fetchDocument = async (type: string, id: string) => {\r\n\ttry {\r\n\t\tconst res = await api.getDocument(type, id)\r\n\t\treturn res.data\r\n\t} catch (e) {\r\n\t\tconsole.log(e)\r\n\t}\r\n}\r\n\r\nexport const fetchSaveDocument = async (type: string, payload: any) => {\r\n\ttry {\r\n\t\treturn await api.saveDocument(type, payload)\r\n\t} catch (e) {}\r\n}\r\n\r\nexport const uploadXlsx = async (payload: any) => {\r\n\ttry {\r\n\t\treturn await api.uploadFileXLSX(payload)\r\n\t} catch (e) {}\r\n}\r\n\r\nexport const fetchAllDocuments = async (payload: any) => {\r\n\ttry {\r\n\t\tconst res = await api.getDocuments(payload)\r\n\t\tif (res.status !== 200) return\r\n\t\treturn res\r\n\t} catch (e) {}\r\n}\r\n\r\nexport const fetchEraseDocument = async (type: string, id: string) => {\r\n\ttry {\r\n\t\treturn await api.deleteFromBin(type, id)\r\n\t} catch (e) {}\r\n}\r\n\r\nexport const fetchEditDocument = async (type: string, id: string, payload: any) => {\r\n\ttry {\r\n\t\treturn await api.editDocument(type, id, payload)\r\n\t} catch (e) {}\r\n}\r\n\r\nexport const fetchSignDocument = async (type: string, id: string, payload: any, showSnackbar = true) => {\r\n\ttry {\r\n\t\treturn await api.signDocument(type, id, payload, showSnackbar)\r\n\t} catch (e) {}\r\n}\r\nexport const fetchReadDocument = async (type: string, id: string, showSnackbar = true) => {\r\n\ttry {\r\n\t\treturn await api.readDocument(type, id, showSnackbar)\r\n\t} catch (e) {}\r\n}\r\nexport const fetchWaybillLocalMethods = async (id: string, payload: any, method: string) => {\r\n\ttry {\r\n\t\treturn await api.waybillLocalMethods(id, payload, method)\r\n\t} catch (e) {}\r\n}\r\n\r\nexport const fetchDeleteDocument = async (type: string, id: string, pkcs7?: string) => {\r\n\ttry {\r\n\t\tconst payload = { pkcs7: pkcs7 ? pkcs7 : '' }\r\n\t\treturn await api.deleteDocument(type, id, payload)\r\n\t} catch (e) {\r\n\t\tconsole.log(e)\r\n\t}\r\n}\r\n\r\nexport const refetchAllDocs = async (cookie: string) => {\r\n\ttry {\r\n\t\treturn await api.refreshAllDocs(cookie)\r\n\t} catch (e) {\r\n\t\tconsole.log(e)\r\n\t}\r\n}\r\n\r\nexport const fetchSignCheck = async (id: string) => {\r\n\ttry {\r\n\t\treturn await api.getSignCheck(id)\r\n\t} catch (e) {\r\n\t\tconsole.log(e)\r\n\t}\r\n}\r\n\r\nexport const fetchRejectDocument = async (type: string, id: string, data: any) => {\r\n\ttry {\r\n\t\tconst payload = { pkcs7: data }\r\n\t\treturn await api.rejectDocument(type, id, payload)\r\n\t} catch (e) {\r\n\t\tconsole.log(e)\r\n\t}\r\n}\r\n\r\nexport const fetchSignedFile = async (type: string, id: string, side: string) => {\r\n\ttry {\r\n\t\tconst res = await api.getSignedFile(type, id, side)\r\n\t\treturn res.data\r\n\t} catch (e) {\r\n\t\tconsole.log(e)\r\n\t}\r\n}\r\n\r\nexport const fetchWaybillLocalSign = async (id: string, side: string, state: number) => {\r\n\ttry {\r\n\t\tconst res = await api.getWaybillLocalSign(id, side, state)\r\n\t\treturn res.data\r\n\t} catch (e) {\r\n\t\tconsole.log(e)\r\n\t}\r\n}\r\n\r\nexport const fetchRefreshDocument = async (type: string, id: string, showSnackbar = true) => {\r\n\ttry {\r\n\t\treturn await api.refreshDocument(type, id, showSnackbar)\r\n\t} catch (e) {\r\n\t\tconsole.log(e)\r\n\t}\r\n}\r\n","import axios from 'axios'\r\n\r\nexport interface IUserLogin {\r\n serialNumber: string,\r\n pkcs7: string\r\n}\r\n\r\nexport interface IUserPwdLogin {\r\n login: string\r\n password: string\r\n}\r\n\r\nexport default {\r\n async userLogin(payload: IUserLogin) {\r\n return await axios.post('/login', payload)\r\n },\r\n async userPwdLogin(payload: IUserPwdLogin) {\r\n return await axios.post('/loginpassword', payload)\r\n },\r\n async saveLoginPass(payload: any) {\r\n return await axios.post('/saveloginpass', payload)\r\n },\r\n async refreshToken() {\r\n return await axios.get<{token: string}>('/token')\r\n },\r\n async entityToken(tin: string, type: string) {\r\n return await axios.get(`/token/${tin}/${type}`)\r\n },\r\n async getAuthId(serialNumber: string) {\r\n return await axios.get(`/authId/${serialNumber}`)\r\n },\r\n async userSignUp(payload: any) {\r\n return await axios.post(`/register`, payload)\r\n }\r\n}\r\n","import { createSlice } from '@reduxjs/toolkit'\r\nimport { appSlice } from './AppReducer'\r\nimport { createApi, fetchBaseQuery } from '@reduxjs/toolkit/dist/query/react'\r\nimport { RootReducer } from './RootReducer'\r\nimport { IBaseDoc } from '../../models'\r\n\r\nconst initialState = {\r\n\r\n}\r\n\r\nexport const notificationsSlice = createSlice({\r\n\tname: 'notifications',\r\n\tinitialState,\r\n\treducers: {}\r\n})\r\n\r\nexport const notificationsApi = createApi({\r\n\treducerPath: 'notificationsApi',\r\n\tbaseQuery: fetchBaseQuery({\r\n\t\tbaseUrl: process.env.REACT_APP_DEVELOPMENT_URL,\r\n\t\tprepareHeaders: (headers, { getState }) => {\r\n\t\t\tconst token = (getState() as RootReducer).authReducer.profile.at(-1)?.token || \"\"\r\n\t\t\theaders.set('Authorization', `Bearer ${token}`)\r\n\t\t\treturn headers\r\n\t\t}\r\n\t}),\r\n\tendpoints: (builder) => ({\r\n\t\tgetReceivedDocs: builder.query<{docs: IBaseDoc[]}, null>({\r\n\t\t\tquery: () => '/documents?sort=createdAt&order=-1&page=1&limit=100&io=in&status=received&type=all',\r\n\t\t}),\r\n\t})\r\n})\r\n\r\nexport const { useGetReceivedDocsQuery } = notificationsApi\r\n\r\nexport default appSlice.reducer\r\n","import { Typography, TypographyTypeMap } from '@mui/material'\r\nimport { ElementType, FC } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\n\r\ninterface ITranslate {\r\n\ttk: string\r\n\tvariant?: TypographyTypeMap['props']['variant']\r\n\tcomponent?: ElementType\r\n}\r\n\r\nexport const Translate: FC = ({ tk, ...rest }) => {\r\n\tconst { t } = useTranslation()\r\n\r\n\treturn {t(tk)}\r\n}\r\n","import { createSlice } from '@reduxjs/toolkit'\r\n\r\ninterface IEimzo {\r\n\tcertificates: []\r\n\tserialNumbers: []\r\n}\r\n\r\nconst initialState: IEimzo = {\r\n\tcertificates: [],\r\n\tserialNumbers: []\r\n}\r\n\r\nexport const eimzoSlice = createSlice({\r\n\tname: 'eimzo',\r\n\tinitialState,\r\n\treducers: {\r\n\t\tsetCertificates(state, action) {\r\n\t\t\tstate.certificates = action.payload\r\n\t\t},\r\n\t\tsetSerialNumbers(state, action) {\r\n\t\t\tstate.serialNumbers = action.payload\r\n\t\t}\r\n\t},\r\n\textraReducers: {}\r\n})\r\n\r\nexport default eimzoSlice.reducer\r\n","import { createApi, fetchBaseQuery } from \"@reduxjs/toolkit/dist/query/react\";\r\nimport { RootReducer } from \"../reducers/RootReducer\";\r\n\r\ninterface IAdminQuery {\r\n filter: string;\r\n page: number;\r\n limit: number;\r\n}\r\n\r\ntype IAdminMutation = {\r\n id?: string;\r\n method: \"POST\" | \"PATCH\" | \"DELETE\";\r\n body?: any;\r\n};\r\n\r\nexport const adminApi = createApi({\r\n reducerPath: \"adminApi\",\r\n baseQuery: fetchBaseQuery({\r\n baseUrl: process.env.REACT_APP_DEVELOPMENT_URL,\r\n prepareHeaders: (headers, {getState}) => {\r\n const token = (getState() as RootReducer).authReducer.profile.at(-1)?.token || \"\"\r\n headers.set(\"Authorization\", `Bearer ${token}`);\r\n return headers;\r\n },\r\n }),\r\n endpoints: (builder) => ({\r\n getAllBanks: builder.query({\r\n query: (args) => {\r\n const { filter, page, limit } = args;\r\n return {\r\n url: `/banks`,\r\n params: { filter, page, limit, fields: \"bankId,nameUZ,nameRU\" },\r\n };\r\n },\r\n }),\r\n modifyBanks: builder.mutation({\r\n query: (args) => {\r\n const { id, method, body } = args;\r\n return {\r\n url: !!id ? `/banks/${id}` : `/banks/`,\r\n method,\r\n body,\r\n };\r\n },\r\n }),\r\n getMeasures: builder.query({\r\n query: (args) => {\r\n const { filter, page, limit } = args;\r\n return {\r\n url: `/measures`,\r\n params: { filter, page, limit, fields: \"measureId,nameUZ,nameRU\" },\r\n };\r\n },\r\n }),\r\n modifyMeasures: builder.mutation({\r\n query: (args) => {\r\n const { id, method, body } = args;\r\n return {\r\n url: !!id ? `/measures/${id}` : `/measures/`,\r\n method,\r\n body,\r\n };\r\n },\r\n }),\r\n getEntities: builder.query({\r\n query: (args) => {\r\n const { filter, page, limit } = args;\r\n return {\r\n url: `/entities`,\r\n params: { filter, page, limit, fields: \"name,tin\" },\r\n };\r\n },\r\n }),\r\n modifyEntities: builder.mutation({\r\n query: (args) => {\r\n const { id, method, body } = args;\r\n return {\r\n url: !!id ? `/entities/${id}` : `/entities/`,\r\n method,\r\n body,\r\n };\r\n },\r\n }),\r\n getUsers: builder.query({\r\n query: (args) => {\r\n const { filter, page, limit } = args;\r\n return {\r\n url: `/users`,\r\n params: { filter, page, limit, fields: \"name,email,role,tin,uid,mobile\" },\r\n };\r\n },\r\n }),\r\n modifyUsers: builder.mutation({\r\n query: (args) => {\r\n const { id, method, body } = args;\r\n return {\r\n url: !!id ? `/users/${id}` : `/users/`,\r\n method,\r\n body,\r\n };\r\n },\r\n }),\r\n getPackages: builder.query({\r\n query: (args) => {\r\n const { filter, page, limit } = args;\r\n return {\r\n url: `/packages`,\r\n params: { filter, page, limit, fields: \"code,name,tin\" },\r\n };\r\n },\r\n }),\r\n modifyPackages: builder.mutation({\r\n query: (args) => {\r\n const { id, method, body } = args;\r\n return {\r\n url: !!id ? `/packages/${id}` : `/packages/`,\r\n method,\r\n body,\r\n };\r\n },\r\n }),\r\n getBillings: builder.query({\r\n query: (args) => {\r\n const { filter, page, limit } = args;\r\n return {\r\n url: `/billings`,\r\n params: { filter, page, limit, fields: \"tin,month,year\" },\r\n };\r\n },\r\n }),\r\n modifyBillings: builder.mutation({\r\n query: (args) => {\r\n const { id, method, body } = args;\r\n return {\r\n url: !!id ? `/billings/${id}` : `/billings/`,\r\n method,\r\n body,\r\n };\r\n },\r\n }),\r\n getItems: builder.query({\r\n query: (args) => {\r\n const { filter, page, limit } = args;\r\n return {\r\n url: `/items`,\r\n params: { filter, page, limit, fields: \"code,name\" },\r\n };\r\n },\r\n }),\r\n modifyItems: builder.mutation({\r\n query: (args) => {\r\n const { id, method, body } = args;\r\n return {\r\n url: !!id ? `/items/${id}` : `/items/`,\r\n method,\r\n body,\r\n };\r\n },\r\n }),\r\n getGroups: builder.query({\r\n query: (args) => {\r\n const { filter, page, limit } = args;\r\n return {\r\n url: `/groups`,\r\n params: { filter, page, limit, fields: \"groupId,nameUZ,nameRU\" },\r\n };\r\n },\r\n }),\r\n modifyGroups: builder.mutation({\r\n query: (args) => {\r\n const { id, method, body } = args;\r\n return {\r\n url: !!id ? `/groups/${id}` : `/groups/`,\r\n method,\r\n body,\r\n };\r\n },\r\n }),\r\n }),\r\n});\r\n\r\nexport const {\r\n useGetAllBanksQuery,\r\n useGetBillingsQuery,\r\n useGetEntitiesQuery,\r\n useGetGroupsQuery,\r\n useGetItemsQuery,\r\n useGetMeasuresQuery,\r\n useGetPackagesQuery,\r\n useGetUsersQuery,\r\n useModifyBanksMutation,\r\n useModifyBillingsMutation,\r\n useModifyEntitiesMutation,\r\n useModifyGroupsMutation,\r\n useModifyItemsMutation,\r\n useModifyMeasuresMutation,\r\n useModifyPackagesMutation,\r\n useModifyUsersMutation\r\n} = adminApi;\r\n","import React from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useProfileGetter } from '../../hooks/useProfile'\r\nimport { Control, Controller, UseFormSetValue } from 'react-hook-form'\r\nimport { IBanks, useGetBanksQuery } from '../../redux/actions/AdminBanksActions'\r\nimport { Autocomplete, TextField } from '@mui/material'\r\nimport { IDocsType } from '../../models'\r\nimport { IProfile } from '../../models/profile'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\ntype IBankAutoComplete = {\r\n\tcontrol: Control\r\n\tcontrolProfile?: Control\r\n\tindex?:\r\n\t\t| 'seller'\r\n\t\t| 'buyer'\r\n\t\t| 'generalcontractor'\r\n\t\t| 'customer'\r\n\t\t| `clients.1`\r\n\t\t| 'clients.2'\r\n\t\t| 'clients.0'\r\n\t\t| 'owner'\r\n\t\t| 'payment'\r\n\tsetValue: UseFormSetValue\r\n\tsetValueProfile?: UseFormSetValue\r\n\tself?: boolean\r\n\tdisabled?: boolean\r\n\tlabel?: boolean\r\n\tfieldPath?: string | null\r\n}\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst BankAutoComplete = ({\r\n\tcontrol,\r\n\tcontrolProfile,\r\n\tsetValue,\r\n\tsetValueProfile,\r\n\tindex = 'seller',\r\n\tself = false,\r\n\tdisabled = false,\r\n\tlabel = true,\r\n\tfieldPath = null\r\n}: IBankAutoComplete) => {\r\n\tconst profile = useProfileGetter.useGetProfile()\r\n\tconst { data } = useGetBanksQuery('')\r\n\tlet banks = data || []\r\n\r\n\tif (!self && index === 'seller' && !!profile.accounts?.length) {\r\n\t\tbanks = banks.filter(\r\n\t\t\tbank => profile.bankId === bank.bankId || profile.accounts?.some(acc => acc.bankId === bank.bankId)\r\n\t\t)\r\n\t}\r\n\r\n\tconst { t } = useTranslation()\r\n\r\n\tconst handleBankChange = (bank: IBanks | null) => {\r\n\t\tif (bank) {\r\n\t\t\tfieldPath\r\n\t\t\t\t? //@ts-ignore\r\n\t\t\t\t setValueProfile(`${fieldPath}.bankId`, bank.bankId)\r\n\t\t\t\t: self\r\n\t\t\t\t? setValue('bankId', bank.bankId)\r\n\t\t\t\t: setValue(`${index}.bankid`, bank.bankId)\r\n\t\t} else {\r\n\t\t\tif (self && fieldPath === null) {\r\n\t\t\t\tsetValue('bankId', '')\r\n\t\t\t} else {\r\n\t\t\t\tsetValue(`${index}.bankid`, '')\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tconst returnOptionLabel = (option: IBanks | null) => {\r\n\t\treturn option ? `${option.bankId} - ${option.nameRU}` : ''\r\n\t}\r\n\r\n\treturn (\r\n\t\t}\r\n\t\t\trender={({ field: { value, ref } }) => (\r\n\t\t\t\t bank.bankId === value) || null}\r\n\t\t\t\t\tonChange={(e, data) => handleBankChange(data)}\r\n\t\t\t\t\tgetOptionLabel={option => returnOptionLabel(option)}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\trenderInput={params => (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nexport default React.memo(BankAutoComplete)\r\n","import {TypedUseSelectorHook, useDispatch, useSelector} from \"react-redux\";\r\nimport {RootDispatch, RootReducer} from \"../redux/reducers/RootReducer\";\r\n\r\nexport const useAppDispatch = () => useDispatch()\r\nexport const useAppSelector: TypedUseSelectorHook = useSelector\r\n","export const MARK_TYPES = [\r\n\t{\r\n\t\tvalue: 1,\r\n\t\tname: 'cigarets'\r\n\t},\r\n\t{\r\n\t\tvalue: 2,\r\n\t\tname: 'alchoholProducts'\r\n\t},\r\n\t{\r\n\t\tvalue: 3,\r\n\t\tname: 'beerAndBeerProducts'\r\n\t},\r\n\t{\r\n\t\tvalue: 4,\r\n\t\tname: 'medicines'\r\n\t},\r\n\t{\r\n\t\tvalue: 5,\r\n\t\tname: 'waterAndSoda'\r\n\t},\r\n\t{\r\n\t\tvalue: 6,\r\n\t\tname: 'appliances'\r\n\t}\r\n]\r\n\r\nexport const PACKAGE_TYPES = [\r\n\t{\r\n\t\tvalue: 'kiz',\r\n\t\tname: 'consumer'\r\n\t},\r\n\t{\r\n\t\tvalue: 'nomupak',\r\n\t\tname: 'group'\r\n\t},\r\n\t{\r\n\t\tvalue: 'identtransupak',\r\n\t\tname: 'transport'\r\n\t}\r\n]","import { styled } from '@mui/material/styles'\r\nimport { AppBar, Toolbar, Card, Typography, Box } from '@mui/material'\r\n\r\nconst APPBAR_MOBILE = 10\r\nconst APPBAR_DESKTOP = 70\r\n\r\nexport const RootStyle = styled('div')({\r\n\tdisplay: 'flex',\r\n\tminHeight: '100%',\r\n\toverflow: 'hidden'\r\n})\r\n\r\nexport const MainStyle = styled('div')(({ theme }) => ({\r\n\tflexGrow: 1,\r\n\toverflow: 'auto',\r\n\tminHeight: '100%',\r\n\tpaddingTop: APPBAR_MOBILE,\r\n\tpaddingBottom: theme.spacing(2),\r\n\t[theme.breakpoints.up('lg')]: {\r\n\t\tpaddingTop: APPBAR_DESKTOP,\r\n\t\tpaddingLeft: theme.spacing(2),\r\n\t\tpaddingRight: theme.spacing(2)\r\n\t}\r\n}))\r\n\r\nexport const RootStyleNavbar = styled(AppBar)(({ theme, open, isVisible }) => ({\r\n\tboxShadow: 'none',\r\n\tbackgroundColor: theme.palette.background.header,\r\n\twidth: open ? `calc(100% - 280px)` : `calc(100% - 55px)`,\r\n\ttransform: isVisible ? 'translateY(0)' : 'translateY(-100%)',\r\n\ttransition: 'transform 0.4s'\r\n}))\r\n\r\nexport const ToolbarStyle = styled(Toolbar)(({ theme }) => ({\r\n\t[theme.breakpoints.up('lg')]: {\r\n\t\tpadding: theme.spacing(0, 4)\r\n\t},\r\n\tdisplay: 'flex',\r\n\tjustifyContent: 'space-between',\r\n\talignItems: 'center',\r\n\tborderBottom: `1px solid ${theme.palette.divider}`,\r\n\tminHeight: '52px !important',\r\n\t'> *': {\r\n\t\tflexGrow: 1,\r\n\t\tflexBasis: '0',\r\n\t\tmaxWidth: '33.33%'\r\n\t}\r\n}))\r\n\r\nexport const AccountStatus = styled('h6')({\r\n\twidth: 'max-content',\r\n\tmaxWidth: '100px',\r\n\tcolor: 'gray',\r\n\tborder: '1px solid gray',\r\n\tpadding: '1px',\r\n\tpaddingLeft: '3px',\r\n\tmarginLeft: '5px',\r\n\tborderRadius: 5,\r\n\twhiteSpace: 'nowrap',\r\n\toverflow: 'hidden',\r\n\ttextOverflow: 'ellipsis',\r\n\tfontSize: '0.5rem',\r\n\tlineHeight: '1.5',\r\n\tdisplay: 'block'\r\n})\r\n\r\nexport const FinanceCard = styled(Card)(({ theme }) => ({\r\n\tminWidth: '120px',\r\n\twidth: 'max-content',\r\n\tmaxWidth: '200px',\r\n\tbackgroundColor: theme.palette.background.paper,\r\n\tborder: `1px solid ${theme.palette.divider}`,\r\n\tboxShadow: '0px 4px 8px rgba(0, 0, 0, 0.1)',\r\n\tborderRadius: theme.shape.borderRadius,\r\n\tpadding: theme.spacing(0.5),\r\n\tmargin: theme.spacing(0.5),\r\n\theight: 42,\r\n\tdisplay: 'flex',\r\n\tjustifyContent: 'center',\r\n\talignItems: 'center',\r\n\ttextAlign: 'center',\r\n\tposition: 'relative',\r\n\ttransition: 'transform 0.2s',\r\n\t'&:hover': {\r\n\t\ttransform: 'scale(1.05)'\r\n\t}\r\n}))\r\n\r\nexport const FinanceTitle = styled(Typography)(({ theme }) => ({\r\n\tfontSize: theme.typography.pxToRem(12),\r\n\tcolor: theme.palette.text.secondary,\r\n\tfontWeight: theme.typography.fontWeightMedium,\r\n\tdisplay: 'flex',\r\n\talignItems: 'center',\r\n\ttextAlign: 'center',\r\n\twhiteSpace: 'nowrap',\r\n\toverflow: 'hidden',\r\n\ttextOverflow: 'ellipsis',\r\n\t[theme.breakpoints.down('sm')]: {\r\n\t\tfontSize: theme.typography.pxToRem(8),\r\n\t\twhiteSpace: 'normal'\r\n\t}\r\n}))\r\n\r\nexport const FinanceAmount = styled(Typography)(({ theme, debt }) => ({\r\n\tfontSize: theme.typography.pxToRem(12),\r\n\tfontWeight: theme.typography.fontWeightBold,\r\n\tcolor: debt ? theme.palette.error.main : theme.palette.success.main,\r\n\twhiteSpace: 'nowrap'\r\n}))\r\n\r\nexport const FinanceStatus = styled(Typography)(({ theme }) => ({\r\n\tfontSize: theme.typography.pxToRem(12),\r\n\tfontWeight: theme.typography.fontWeightMedium,\r\n\ttextAlign: 'center',\r\n\twhiteSpace: 'nowrap',\r\n\toverflow: 'hidden',\r\n\ttextOverflow: 'ellipsis',\r\n\t'@media (max-width: 600px)': {\r\n\t\tfontSize: '12px'\r\n\t}\r\n}))\r\n\r\nexport const FinanceIcon = styled('div')({\r\n\talignItems: 'center',\r\n\tjustifyContent: 'center',\r\n\twidth: 20,\r\n\theight: 20,\r\n\tbackgroundColor: 'rgba(0, 0, 0, 0.05)',\r\n\tborderRadius: '50%',\r\n\tmarginRight: '3px'\r\n})\r\n\r\nexport const FinanceResultsBox = styled('div')({\r\n\tdisplay: 'flex',\r\n\talignItems: 'center',\r\n\tjustifyContent: 'center',\r\n\twidth: '100%',\r\n\tposition: 'relative',\r\n\tpaddingRight: '10px'\r\n})\r\n\r\nexport const MenuIconContainer = styled(Box)(({ theme }) => ({\r\n\tdisplay: 'none',\r\n\t[theme.breakpoints.down('lg')]: {\r\n\t\tdisplay: 'flex'\r\n\t},\r\n\tposition: 'fixed',\r\n\ttop: 16,\r\n\tright: 16,\r\n\tbackgroundColor: 'rgba(0, 0, 0, 0.7)',\r\n\tborderRadius: '50%',\r\n\tpadding: '8px',\r\n\tboxShadow: '0px 2px 5px rgba(0, 0, 0, 0.3)'\r\n}))\r\n","import axios from 'axios'\r\n\r\nexport default {\r\n\tasync getTimeStamp(payload: any) {\r\n\t\treturn axios.post('/dsvs/gettimestamp', payload)\r\n\t},\r\n\r\n\tasync getJoinSign(payload: any) {\r\n\t\treturn axios.post('/dsvs/joinpkcs7', payload)\r\n\t}\r\n}\r\n","import { eimzoSlice } from '../reducers/EimzoReducer'\r\nimport { RootDispatch, RootReducer } from '../reducers/RootReducer'\r\nimport { buildSuccess, handleError } from '../../utils/utils'\r\nimport api from '../../api/eimzo'\r\nimport { appSlice } from '../reducers/AppReducer'\r\nimport { AuthSlice } from '../reducers/AuthReducer'\r\n\r\ndeclare const window: any\r\n\r\nconst API_KEYS = [\r\n\t'localhost',\r\n\t'96D0C1491615C82B9A54D9989779DF825B690748224C2B04F500F370D51827CE2644D8D4A82C18184D73AB8530BB8ED537269603F61DB0D03D2104ABF789970B',\r\n\t'127.0.0.1',\r\n\t'A7BCFA5D490B351BE0754130DF03A068F855DB4333D43921125B9CF2670EF6A40370C646B90401955E1F7BC9CDBF59CE0B2C5467D820BE189C845D0B79CFC96F',\r\n\t'null',\r\n\t'E0A205EC4E7B78BBB56AFF83A733A1BB9FD39D562E67978CC5E7D73B0951DB1954595A20672A63332535E13CC6EC1E1FC8857BB09E0855D7E76E411B6FA16E9D',\r\n\t'edocs.uz',\r\n\t'B7E61CAE12DF2D46D62F306942C0DAFA916A4DED50704879912C4BFAD65700DF7AB35684FC663254DF9BC57A5DD5B3E567CBFDCF9B0873718CA0A95738981DC3',\r\n\t'doc.edocs.uz',\r\n\t'E56908ED539E290CB3BC103700B589FBF3B7788C1E4BA2CBFF00E6A3F6BCBF2B6ECE0DA4123D0860B9FDBCBA3563B5408E2D807BF483820EC9D282499D8F8081'\r\n]\r\n\r\nconst errImzo = 'EIMZO_FATAL_ERROR'\r\n\r\nexport const loadKeys = () => async (dispatch: RootDispatch) => {\r\n\ttry {\r\n\t\tconst _serialNumbers: any = []\r\n\t\tconst _certificates: any = []\r\n\r\n\t\tawait window.EIMZOClient.listAllUserKeys(\r\n\t\t\tfunction (o: any, i: any) {\r\n\t\t\t\tconst itemId = 'itm-' + o.serialNumber + '-' + i\r\n\t\t\t\treturn itemId\r\n\t\t\t},\r\n\t\t\tfunction (itemId: any, v: any) {\r\n\t\t\t\t_serialNumbers.push({ obj: v, value: v.serialNumber })\r\n\t\t\t\t_certificates.push(v)\r\n\t\t\t},\r\n\t\t\tfunction (items: any, firstId: any) {\r\n\t\t\t\tdispatch(eimzoSlice.actions.setSerialNumbers(_serialNumbers))\r\n\t\t\t\tdispatch(eimzoSlice.actions.setCertificates(_certificates))\r\n\t\t\t},\r\n\t\t\tfunction (e: any, r: any) {\r\n\t\t\t\tif (r) {\r\n\t\t\t\t\tconsole.log('r', r)\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconsole.log('e', e)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t)\r\n\t} catch (e) {}\r\n}\r\n\r\nexport function installApiKeys() {\r\n\treturn async (dispatch: RootDispatch) => {\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\twindow.CAPIWS.apikey(\r\n\t\t\t\tAPI_KEYS,\r\n\t\t\t\t(event: any, data: any) => {\r\n\t\t\t\t\tif (data.success) {\r\n\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\t\t\tshow: true,\r\n\t\t\t\t\t\t\t\tmessage: 'Модуль E-Imzo успешно подключен!',\r\n\t\t\t\t\t\t\t\tautoHide: false\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\t\t\t...appSlice.getInitialState().systemAlert,\r\n\t\t\t\t\t\t\t\t\tshow: false\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t}, 3000)\r\n\r\n\t\t\t\t\t\tbuildSuccess(resolve, true)\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.log('error', data.reason)\r\n\t\t\t\t\t\thandleError({ response: false, errMsg: data.reason }, dispatch, reject)\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\t(e: any) => {\r\n\t\t\t\t\tconsole.log('error', e)\r\n\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\ttype: 'warning',\r\n\t\t\t\t\t\t\tshow: true,\r\n\t\t\t\t\t\t\tmessage: 'Запустите модуль E-Imzo для корректной работы сайта',\r\n\t\t\t\t\t\t\tautoHide: false\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t)\r\n\t\t})\r\n\t}\r\n}\r\n\r\nexport function loadKey(serialNumber: string, certificates: any) {\r\n\treturn async (dispatch: RootDispatch) => {\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tconst { obj: keyObject } = certificates.find((cert: any) => cert?.obj?.serialNumber == serialNumber)\r\n\t\t\tif (!keyObject || keyObject.type !== 'pfx') {\r\n\t\t\t\thandleError({ response: false, errMsg: 'WRONG_TYPE_KEY' }, dispatch, reject)\r\n\t\t\t} else {\r\n\t\t\t\twindow.EIMZOClient.loadKey(\r\n\t\t\t\t\tkeyObject,\r\n\t\t\t\t\t// eslint-disable-next-line\r\n\t\t\t\t\tfunction (keyId: string) {\r\n\t\t\t\t\t\tbuildSuccess(resolve, keyId)\r\n\t\t\t\t\t},\r\n\t\t\t\t\t// eslint-disable-next-line\r\n\t\t\t\t\tfunction (e: any, r: any) {\r\n\t\t\t\t\t\tlet reason = ''\r\n\t\t\t\t\t\tif (r) {\r\n\t\t\t\t\t\t\tif (r.indexOf('BadPaddingException') !== -1) {\r\n\t\t\t\t\t\t\t\treason = 'WRONG_PASSWORD'\r\n\t\t\t\t\t\t\t} else if (r.indexOf('Ввод пароля отменен') !== -1) {\r\n\t\t\t\t\t\t\t\treason = 'PASSWORD_ENTRY_CANCELED'\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tconsole.log('error', r)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tconsole.log('error', e)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\t\ttype: 'warning',\r\n\t\t\t\t\t\t\t\tshow: true,\r\n\t\t\t\t\t\t\t\tmessage: 'Запустите модуль E-Imzo для корректной работы сайта'\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t}\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n}\r\n\r\nconst CAPIWS = window.CAPIWS\r\n\r\nexport function signData(payload: string, keyId: string) {\r\n\treturn async (dispatch: RootDispatch, getState: () => RootReducer) => {\r\n\t\ttry {\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\t// @ts-ignore\r\n\t\t\t\tCAPIWS.callFunction(\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tplugin: 'pkcs7',\r\n\t\t\t\t\t\tname: 'create_pkcs7',\r\n\t\t\t\t\t\targuments: [Buffer.from(payload).toString('base64'), keyId, 'no']\r\n\t\t\t\t\t},\r\n\t\t\t\t\tasync (event: any, data: any) => {\r\n\t\t\t\t\t\tif (data.success) {\r\n\t\t\t\t\t\t\tapi\r\n\t\t\t\t\t\t\t\t.getTimeStamp({ pkcs7_64: data.pkcs7_64 })\r\n\t\t\t\t\t\t\t\t.then(response => {\r\n\t\t\t\t\t\t\t\t\tif (response.status === 200) {\r\n\t\t\t\t\t\t\t\t\t\tif (response.data.success) {\r\n\t\t\t\t\t\t\t\t\t\t\tconst pkcs7tst = response.data.pkcs7_64\r\n\t\t\t\t\t\t\t\t\t\t\tbuildSuccess(resolve, pkcs7tst)\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\tconsole.log('error', response.data.reason)\r\n\t\t\t\t\t\t\t\t\t\t\thandleError({ response: false, errMsg: response.data.reason }, dispatch, reject)\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t.catch(error => {\r\n\t\t\t\t\t\t\t\t\thandleError(error, dispatch, reject)\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (data.reason == 'Ключ по идентификатору не найден') {\r\n\t\t\t\t\t\t\t\tconst serialNumbers = getState().eimzoReducer.serialNumbers\r\n\t\t\t\t\t\t\t\tconst allProfiles = getState().authReducer.profile\r\n\r\n\t\t\t\t\t\t\t\tconst currentProfile = allProfiles[allProfiles.length - 1]\r\n\t\t\t\t\t\t\t\tconst serialNumber = currentProfile.user?.serialNumber?.toUpperCase()\r\n\r\n\t\t\t\t\t\t\t\tif (serialNumber) {\r\n\t\t\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\t\t\tconst newKeyId = await dispatch(loadKey(serialNumber, serialNumbers))\r\n\t\t\t\t\t\t\t\t\t\tconst signedData = await dispatch(signData(payload, newKeyId))\r\n\r\n\t\t\t\t\t\t\t\t\t\tresolve(signedData)\r\n\t\t\t\t\t\t\t\t\t\tdispatch(AuthSlice.actions.setNewKeyId({ keyId, newKeyId }))\r\n\t\t\t\t\t\t\t\t\t} catch (error) {\r\n\t\t\t\t\t\t\t\t\t\tconsole.error('Ошибка при загрузке ключа:', error)\r\n\t\t\t\t\t\t\t\t\t\treject(error)\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else if (data.reason.indexOf('BadPaddingException') !== -1) {\r\n\t\t\t\t\t\t\t\tdata.reason = 'WRONG_PASSWORD'\r\n\t\t\t\t\t\t\t\thandleError({ response: false, errMsg: data.reason }, dispatch, reject)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\t(e: any) => {\r\n\t\t\t\t\t\tconsole.log('error', e)\r\n\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\t\ttype: 'warning',\r\n\t\t\t\t\t\t\t\tshow: true,\r\n\t\t\t\t\t\t\t\tmessage: 'Запустите модуль E-Imzo для подписания документа'\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t}\r\n\t\t\t\t)\r\n\t\t\t})\r\n\t\t} catch (e) {\r\n\t\t\tconsole.log(e)\r\n\t\t} finally {\r\n\t\t\tdispatch(appSlice.actions.toggleSystemLoading(false))\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport function appendSign(payload: any, keyId: any) {\r\n\treturn async (dispatch: RootDispatch) => {\r\n\t\ttry {\r\n\t\t\tdispatch(appSlice.actions.toggleSystemLoading(true))\r\n\r\n\t\t\tconst documentData = (await dispatch(getAttachedInfo(payload, false))) as string\r\n\t\t\tconst pkcs7Doc2 = await dispatch(signData(documentData, keyId))\r\n\t\t\tconst joinedDocuments = `${payload}|${pkcs7Doc2}`\r\n\r\n\t\t\tconst response = await api.getJoinSign({ pkcs7_64: joinedDocuments })\r\n\t\t\tif (response.status === 200) {\r\n\t\t\t\tconst { success, pkcs7_64, reason } = response.data\r\n\t\t\t\tif (success) {\r\n\t\t\t\t\treturn pkcs7_64\r\n\t\t\t\t} else {\r\n\t\t\t\t\thandleError({ response: false, errMsg: reason }, dispatch)\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\thandleError({ response: false, errMsg: response.data.reason }, dispatch)\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tdispatch(appSlice.actions.toggleSystemLoading(false))\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport function getAttachedInfo(payload: any, json: boolean) {\r\n\treturn async (dispatch: RootDispatch) => {\r\n\t\ttry {\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\tCAPIWS.callFunction(\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tplugin: 'pkcs7',\r\n\t\t\t\t\t\tname: 'get_pkcs7_attached_info',\r\n\t\t\t\t\t\targuments: [payload, '']\r\n\t\t\t\t\t},\r\n\t\t\t\t\t(event: any, data: any) => {\r\n\t\t\t\t\t\tif (!data || !data.pkcs7Info) {\r\n\t\t\t\t\t\t\treject('Ошибка получения данных')\r\n\t\t\t\t\t\t\treturn\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tconst parsedDocument = Buffer.from(data.pkcs7Info.documentBase64, 'base64').toString('utf-8')\r\n\t\t\t\t\t\tresolve(json ? JSON.parse(parsedDocument) : parsedDocument)\r\n\t\t\t\t\t},\r\n\t\t\t\t\t(e: any) => {\r\n\t\t\t\t\t\tconsole.error('Ошибка вызова CAPIWS:', e)\r\n\t\t\t\t\t\thandleError({ response: false, errMsg: errImzo }, dispatch, reject)\r\n\t\t\t\t\t}\r\n\t\t\t\t)\r\n\t\t\t})\r\n\t\t} catch (e) {\r\n\t\t\tconsole.error(e)\r\n\t\t} finally {\r\n\t\t\tdispatch(appSlice.actions.toggleSystemLoading(false))\r\n\t\t}\r\n\t}\r\n}\r\n","import PropTypes from 'prop-types';\r\nimport SimpleBarReact from 'simplebar-react';\r\n// material\r\nimport { alpha, styled } from '@mui/material/styles';\r\nimport { Box } from '@mui/material';\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst RootStyle = styled('div')({\r\n flexGrow: 1,\r\n height: '100%',\r\n overflow: 'hidden'\r\n});\r\n\r\nconst SimpleBarStyle = styled(SimpleBarReact)(({ theme }) => ({\r\n maxHeight: '100%',\r\n '& .simplebar-scrollbar': {\r\n '&:before': {\r\n backgroundColor: alpha(theme.palette.grey[600], 0.48)\r\n },\r\n '&.simplebar-visible:before': {\r\n opacity: 1\r\n }\r\n },\r\n '& .simplebar-track.simplebar-vertical': {\r\n width: 10\r\n },\r\n '& .simplebar-track.simplebar-horizontal .simplebar-scrollbar': {\r\n height: 6\r\n },\r\n '& .simplebar-mask': {\r\n zIndex: 'inherit'\r\n }\r\n}));\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nScrollbar.propTypes = {\r\n children: PropTypes.node.isRequired,\r\n sx: PropTypes.object\r\n};\r\n\r\nexport default function Scrollbar({ children, sx, ...other }) {\r\n const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\r\n navigator.userAgent\r\n );\r\n\r\n if (isMobile) {\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n \r\n {children}\r\n \r\n \r\n );\r\n}\r\n","import { Autocomplete, TextField } from '@mui/material'\r\nimport React from 'react'\r\nimport { Control, Controller, FieldPath, UseFormSetValue } from 'react-hook-form'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { IDocsType } from '../../models'\r\nimport { IRegions, useGetRegionsQuery, useGetWaybillLocalRegionsQuery } from '../../redux/actions/AdminBanksActions'\r\n\r\ntype IRegionAutoComplete = {\r\n\tcontrol: Control\r\n\tsetValue: UseFormSetValue\r\n\tname?: FieldPath\r\n\tpostfix?: 'regionname'\r\n\tindex?: 'seller' | 'buyer'\r\n\tself?: boolean\r\n\tdisabled?: boolean\r\n\tlabel?: boolean\r\n}\r\n\r\nconst RegionAutoComplete = ({\r\n\tcontrol,\r\n\tsetValue,\r\n\tindex = 'seller',\r\n\tname,\r\n\tpostfix,\r\n\tself = false,\r\n\tdisabled = false,\r\n\tlabel = true\r\n}: IRegionAutoComplete) => {\r\n\tconst { data } = useGetRegionsQuery('')\r\n\tconst { data: waybillLocalData } = useGetWaybillLocalRegionsQuery('')\r\n\tconst regions = postfix ? waybillLocalData : data\r\n\tconst { t, i18n } = useTranslation()\r\n\tconst selector = `${name || index}.regionid` as keyof IDocsType\r\n\tconst regionName = postfix ? `${name}.regionname` : ('' as keyof IDocsType)\r\n\r\n\tconst handleRegionChange = (region: IRegions | null) => {\r\n\t\tif (region) {\r\n\t\t\tself ? setValue('regionId', region.regionId) : setValue(selector, region.regionId as never)\r\n\t\t\tif (postfix && regionName) {\r\n\t\t\t\t//@ts-ignore\r\n\t\t\t\tsetValue(regionName, i18n.language === 'ru' ? region.nameRu : region.nameUzCyrl)\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tself ? setValue('regionId', '') : setValue(selector, '' as never)\r\n\t\t\tif (postfix && regionName) {\r\n\t\t\t\t//@ts-ignore\r\n\t\t\t\tsetValue(regionName, '')\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tconst returnOptionLabel = (option: IRegions | null) => {\r\n\t\t//@ts-ignore\r\n\t\treturn option ? `${option.regionId} - ${postfix ? option.nameRu : option.nameRU}` : ''\r\n\t}\r\n\r\n\tconst returnValue = (value: string | null) => {\r\n\t\treturn Array.isArray(regions) ? regions.find(region => `${region.regionId}` === `${value}`) : null\r\n\t}\r\n\r\n\treturn (\r\n\t\t (\r\n\t\t\t\t handleRegionChange(data)}\r\n\t\t\t\t\tgetOptionLabel={option => returnOptionLabel(option)}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\trenderInput={params => (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nexport default React.memo(RegionAutoComplete)\r\n","import { Autocomplete, TextField } from '@mui/material'\r\nimport React from 'react'\r\nimport { Control, Controller, FieldPath, UseFormSetValue } from 'react-hook-form'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { IDocsType } from '../../models'\r\nimport {\r\n\tIDistrict,\r\n\tuseGetDistrictsQuery,\r\n\tuseGetWaybillLocalDistrictsQuery\r\n} from '../../redux/actions/AdminBanksActions'\r\n\r\ntype IDistrictAutoComplete = {\r\n\tcontrol: Control\r\n\tsetValue: UseFormSetValue\r\n\tname?: FieldPath\r\n\tindex?: 'seller' | 'buyer'\r\n\tself?: boolean\r\n\tsuffix?: 'districtid' | 'districtcode'\r\n\tregionid?: string\r\n\tdisabled?: boolean\r\n\tlabel?: boolean\r\n}\r\n\r\nconst DistrictAutoComplete = ({\r\n\tcontrol,\r\n\tsetValue,\r\n\tname,\r\n\tindex = 'seller',\r\n\tsuffix,\r\n\tself = false,\r\n\tregionid,\r\n\tdisabled = false,\r\n\tlabel = true\r\n}: IDistrictAutoComplete) => {\r\n\tconst { data: allDistricts } = useGetDistrictsQuery('')\r\n\tconst { data: districts } = useGetWaybillLocalDistrictsQuery(regionid as string, { skip: !regionid })\r\n\tconst selector = `${name || index}.${suffix || 'districtid'}` as keyof IDocsType\r\n\r\n\tconst list = districts || allDistricts\r\n\r\n\tconst { t, i18n } = useTranslation()\r\n\r\n\tconst handleDistrictChange = (district: IDistrict | null) => {\r\n\t\tif (district) {\r\n\t\t\tif (self) {\r\n\t\t\t\tsetValue('districtId', district.districtId)\r\n\t\t\t} else {\r\n\t\t\t\t//@ts-ignore\r\n\t\t\t\t// prettier-ignore\r\n\t\t\t\tsuffix === 'districtcode' && setValue(`${name}.districtname`, i18n.language === 'ru' ? district.nameRu : district.nameUzCyrl)\r\n\t\t\t\tconst districtIdSelector = suffix === 'districtcode' ? district.districtCode : district.districtId\r\n\t\t\t\tsetValue(selector, districtIdSelector as never)\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (self) {\r\n\t\t\t\tsetValue('districtId', '')\r\n\t\t\t} else {\r\n\t\t\t\tsetValue(selector, '' as never)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tconst returnOptionLabel = (option: IDistrict | null) => {\r\n\t\tlet label = ''\r\n\t\tif (!regionid) {\r\n\t\t\tlabel = `${suffix === 'districtcode' ? option?.districtCode : option?.districtId} - ${option?.nameRU}`\r\n\t\t} else {\r\n\t\t\t//@ts-ignore\r\n\t\t\tlabel = `${suffix === 'districtcode' ? option?.districtCode : option?.districtId} - ${option?.nameRu}`\r\n\t\t}\r\n\t\treturn label\r\n\t}\r\n\r\n\tconst returnValue = (value: string) => {\r\n\t\tif (Array.isArray(list)) {\r\n\t\t\treturn (\r\n\t\t\t\tlist.find(\r\n\t\t\t\t\tdistrict => `${suffix === 'districtcode' ? district.districtCode : district.districtId}` === `${value}`\r\n\t\t\t\t) || null\r\n\t\t\t)\r\n\t\t}\r\n\t\treturn null\r\n\t}\r\n\r\n\treturn (\r\n\t\t (\r\n\t\t\t\t handleDistrictChange(data)}\r\n\t\t\t\t\tgetOptionLabel={option => returnOptionLabel(option)}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\trenderInput={params => (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nexport default React.memo(DistrictAutoComplete)\r\n","interface ISearch {\r\n io: string\r\n status: string\r\n type: string\r\n group: string | undefined | null\r\n tin: string\r\n number: number | string\r\n branch: string\r\n dateMin: string | undefined | null\r\n dateMax: string | undefined | null\r\n query: string | undefined | null\r\n fields: string | undefined | null\r\n}\r\n\r\nexport const buildPayloadPagination = (pagination: any, search: ISearch) => {\r\n const {sortBy, sortDesc, page, itemsPerPage} = pagination\r\n // Gets order\r\n const sorting = sortBy?.length ? sortBy[0] : ''\r\n const descending = sortDesc?.length && sortDesc[0] ? -1 : 1\r\n\r\n let query: any = {}\r\n\r\n // If search and fields are defined\r\n if (search) {\r\n query = {\r\n sort: sorting,\r\n order: descending,\r\n page,\r\n limit: itemsPerPage,\r\n filter: search.query,\r\n fields: search.fields\r\n }\r\n } else {\r\n // Pagination with no filters\r\n query = {\r\n sort: sorting,\r\n order: descending,\r\n page,\r\n limit: itemsPerPage\r\n }\r\n }\r\n if (search.io) query.io = search.io\r\n if (search.status) query.status = search.status\r\n if (search.type) query.type = search.type\r\n if (search.group) query.group = search.group\r\n if (search.tin) query.tin = search.tin\r\n if (search.number) query.number = search.number\r\n if (search.branch) query.branch = search.branch\r\n if (search.dateMin) query.dateMin = search.dateMin\r\n if (search.dateMax) query.dateMax = search.dateMax\r\n return query\r\n}\r\n","import { createSlice } from '@reduxjs/toolkit'\r\nimport { fetchAllMeasures, fetchMxikList } from '../actions/GoodsActions'\r\n\r\ninterface IMxikUnit {\r\n\tid: number\r\n\tname: string\r\n\tnameRu: string\r\n\tnameUz: string\r\n\tnameEng: string | null\r\n\tnameLatin: string\r\n\tunit: string\r\n\tcommonUnitsId: number\r\n\tdifference: string\r\n\tdescription: string\r\n}\r\n\r\nexport interface IMxikPackageName {\r\n\tcode: number\r\n\tmxikCode: string\r\n\tnameUz: string\r\n\tpackageType: string\r\n\tnameRu: string\r\n\tnameLat: string\r\n\tname?: string\r\n}\r\n\r\nexport interface IMeasure {\r\n\tmeasureId: string\r\n\tnameRU: string\r\n\tnameUZ: string\r\n}\r\n\r\nexport interface IOtherIcomeMxik {\r\n\tcode: string\r\n\tname: string\r\n}\r\n\r\nexport interface IMxikProduct {\r\n\tpkey: string\r\n\ttin: string\r\n\tmxikCode: string\r\n\tgroupName: string\r\n\tclassName: string\r\n\tpositionName: string\r\n\tsubPositionName: string\r\n\tbrandName: string | null\r\n\tattributeName: string | null\r\n\tinternationalCode: string | null\r\n\tunitCode: number\r\n\tunitName: string\r\n\tunitValue: string\r\n\tcommonUnitCode: number\r\n\tcommonUnitName: string\r\n\tunits: IMxikUnit[]\r\n\tpackageNames: IMxikPackageName[]\r\n\tusePackage: string\r\n\tmxikFullName: string\r\n}\r\n\r\ninterface IGoodsInitialState {\r\n\tlistOfMxikCodes: IMxikProduct[]\r\n\tlistOfAllMeasures: IMeasure[]\r\n}\r\n\r\nconst initialState: IGoodsInitialState = {\r\n\tlistOfMxikCodes: [],\r\n\tlistOfAllMeasures: []\r\n}\r\n\r\nexport const goodsSlice = createSlice({\r\n\tname: 'goods',\r\n\tinitialState,\r\n\treducers: {\r\n\t\taddMxik(state, action) {\r\n\t\t\tif (Array.isArray(action.payload)) {\r\n\t\t\t\tstate.listOfMxikCodes = [\r\n\t\t\t\t\t...state.listOfMxikCodes,\r\n\t\t\t\t\t...action.payload.filter(mxik => !state.listOfMxikCodes.some(existing => existing.mxikCode === mxik.mxikCode))\r\n\t\t\t\t]\r\n\t\t\t} else {\r\n\t\t\t\tif (!state.listOfMxikCodes.some(existing => existing.mxikCode === action.payload.mxikCode)) {\r\n\t\t\t\t\tstate.listOfMxikCodes = [...state.listOfMxikCodes, action.payload]\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tclearMxik(state) {\r\n\t\t\tstate.listOfMxikCodes = []\r\n\t\t}\r\n\t},\r\n\textraReducers: {\r\n\t\t[fetchMxikList.pending.type]: (state, action) => {\r\n\t\t\tconsole.log('waiting for mxiks list')\r\n\t\t},\r\n\t\t[fetchMxikList.fulfilled.type]: (state, action) => {\r\n\t\t\tstate.listOfMxikCodes = Array.isArray(action.payload) ? action.payload : []\r\n\t\t},\r\n\t\t[fetchMxikList.rejected.type]: (state, action) => {\r\n\t\t\tconsole.log('rejection for mxiks list')\r\n\t\t},\r\n\t\t[fetchAllMeasures.fulfilled.type]: (state, action) => {\r\n\t\t\tstate.listOfAllMeasures = action.payload\r\n\t\t}\r\n\t}\r\n})\r\n\r\nexport default goodsSlice.reducer\r\n","import { createAsyncThunk } from '@reduxjs/toolkit'\r\nimport { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\r\nimport api from '../../api/profile'\r\nimport { fShortDashedDate } from '../../utils/formatTime'\r\nimport { RootReducer } from '../reducers/RootReducer'\r\n\r\nconst SERVER_ERROR = 'Ошибка на стороне сервера'\r\n\r\nexport const fetchProfile = createAsyncThunk('profile/fetchProfile', async (_, thunkAPI) => {\r\n\ttry {\r\n\t\tconst res = await api.getProfile()\r\n\t\tres.data.name = res.data.shortName\r\n\t\treturn res.data\r\n\t} catch (e) {\r\n\t\treturn thunkAPI.rejectWithValue(SERVER_ERROR)\r\n\t}\r\n})\r\n\r\nexport const fetchRentContracts = async (from: string, to: string) => {\r\n\ttry {\r\n\t\treturn await api.getRentContracts(from, to)\r\n\t} catch (error) {\r\n\t\tconsole.error(error)\r\n\t}\r\n}\r\n\r\nexport const fetchProfileByTin = async (tin: string) => {\r\n\ttry {\r\n\t\tconst res = await api.getProfileByTin(tin)\r\n\t\tres.data.name = res.data.shortName\r\n\t\treturn res.data || {}\r\n\t} catch (e) {}\r\n}\r\n\r\nexport const fetchCurrentTurnOver = async (tin: string, year: string) => {\r\n\ttry {\r\n\t\treturn await api.getCurrentTurnOver(tin, year)\r\n\t} catch (error) {\r\n\t\tconsole.error(error)\r\n\t}\r\n}\r\n\r\nexport const fetchProfileByPinfl = async (pinfl: string) => {\r\n\ttry {\r\n\t\tconst res = await api.getProfileByPinfl(pinfl)\r\n\t\tres.data.name = res.data.shortName\r\n\t\treturn res.data || {}\r\n\t} catch (e) {}\r\n}\r\n\r\nexport const fetchProfileType = async (tin: string, date: string) => {\r\n\ttry {\r\n\t\tlet newDate = date || fShortDashedDate(Date.now())\r\n\t\tif (!tin) {\r\n\t\t\tthrow new Error('Profile tin not provided')\r\n\t\t}\r\n\t\treturn await api.getProfileType(tin, newDate)\r\n\t} catch (e) {\r\n\t\tconsole.error(e)\r\n\t}\r\n}\r\n\r\nexport const fetchWareHouses = createAsyncThunk('profile/fetchWareHouses', async (tin: string, thunkAPI) => {\r\n\ttry {\r\n\t\tconst res = await api.getWarehouses(tin)\r\n\t\treturn res.status === 200 ? res.data : []\r\n\t} catch (e) {\r\n\t\treturn thunkAPI.rejectWithValue(SERVER_ERROR)\r\n\t}\r\n})\r\n\r\nexport const fetchBankAccounts = createAsyncThunk('profile/fetchBankAccounts', async (tin: string, thunkAPI) => {\r\n\ttry {\r\n\t\tconst res = await api.getProfileBankAccounts(tin)\r\n\t\treturn res.status === 200 ? res.data : []\r\n\t} catch (error) {\r\n\t\treturn thunkAPI.rejectWithValue(SERVER_ERROR)\r\n\t}\r\n})\r\n\r\nexport const fetchProfileRights = createAsyncThunk('profile/fetchProfileRights', async (_, thunkAPI) => {\r\n\ttry {\r\n\t\tconst res = await api.getProfileRights()\r\n\t\treturn res.data\r\n\t} catch (e) {\r\n\t\treturn thunkAPI.rejectWithValue(SERVER_ERROR)\r\n\t}\r\n})\r\n\r\nexport const fetchMoneyLeft = createApi({\r\n\treducerPath: 'fetchMoneyLeft',\r\n\tbaseQuery: fetchBaseQuery({\r\n\t\tbaseUrl: process.env.REACT_APP_DEVELOPMENT_URL,\r\n\t\tprepareHeaders: (headers, { getState }) => {\r\n\t\t\tconst token = (getState() as RootReducer).authReducer.profile.at(-1)?.token || ''\r\n\t\t\theaders.set('Authorization', `Bearer ${token}`)\r\n\t\t\treturn headers\r\n\t\t}\r\n\t}),\r\n\tendpoints: builder => ({\r\n\t\tgetMoneyLeft: builder.query({\r\n\t\t\tquery: () => `/billings/balance/info`\r\n\t\t}),\r\n\t\tgetStatus: builder.query({\r\n\t\t\tquery: () => `/billings/blockuser/info`\r\n\t\t}),\r\n\t\tcheckPremiumAccount: builder.query({\r\n\t\t\tquery: () => `/premiumAccounts/check`\r\n\t\t})\r\n\t})\r\n})\r\n\r\nexport const { useGetMoneyLeftQuery, useGetStatusQuery, useCheckPremiumAccountQuery } = fetchMoneyLeft\r\n","import { replace } from 'lodash'\r\nimport numeral from 'numeral'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nexport function fCurrency(number) {\r\n\treturn numeral(number).format(Number.isInteger(number) ? '0,0' : '0,0.00')\r\n}\r\n\r\nexport function fCurrencySpace(number) {\r\n\t// Форматируем число с помощью 'numeral'\r\n\tconst formattedNumber = numeral(number).format(Number.isInteger(number) ? '0,0' : '0,0.00')\r\n\r\n\t// Заменяем запятые на пробелы\r\n\treturn formattedNumber.replace(/,/g, ' ')\r\n}\r\n\r\nexport function fPercent(number) {\r\n\treturn numeral(number / 100).format('0.0%')\r\n}\r\n\r\nexport function fNumber(number) {\r\n\treturn numeral(number).format()\r\n}\r\n\r\nexport function fShortenNumber(number) {\r\n\treturn replace(numeral(number).format('0.00a'), '.00', '')\r\n}\r\n\r\nexport function fData(number) {\r\n\treturn numeral(number).format('0.0 b')\r\n}\r\n\r\nexport function fFloat(number, fixedVal) {\r\n\tif (!Number.isNaN(number)) {\r\n\t\treturn number == '0' ? 0 : Number(number).toFixed(fixedVal)\r\n\t} else {\r\n\t\treturn number\r\n\t}\r\n}\r\n","export interface UserEntities {\r\n\tname: string\r\n\ttin: string\r\n\ttype: string\r\n}\r\n\r\nexport interface ItemReleaseds {\r\n\tfio: string\r\n\tpinfl: string\r\n}\r\n\r\nexport interface Accounts {\r\n\taccount: string\r\n\tbankId: string\r\n}\r\n\r\nexport interface IUserInfo {\r\n\t_id: string\r\n\tentities: UserEntities[]\r\n\tentityName: string\r\n\tname: string\r\n\trole: string\r\n\tserialNumber: string\r\n\ttin: string\r\n\ttype: string\r\n\tverification: string\r\n\tverified: boolean\r\n\tpersonalNum?: string\r\n}\r\n\r\nexport interface IProfile {\r\n\ttoken: string | null\r\n\ttokenExpiration: string | null\r\n\tkeyId?: string | null\r\n\ttin: string\r\n\tisItd: boolean\r\n\tname: string\r\n\tentityName?: string\r\n\tvat: boolean\r\n\tvatRegCode: string\r\n\toked: string\r\n\temail: string\r\n\tmobile: string\r\n\tphone: string\r\n\tregionId: string\r\n\tdistrictId: string\r\n\tbankId: string\r\n\taccount: string\r\n\tdirector: string\r\n\tdirectorPinfl: number\r\n\tfiztin?: string\r\n\taccountant: string\r\n\ttelegramId: string\r\n\taddress: string\r\n\titemReleased: string\r\n\tshortName: string\r\n\tpersonalNum: string\r\n\tbranches: any[]\r\n\tbudget: {\r\n\t\taccount: null | string\r\n\t\tisBudget: number\r\n\t\ttin: null | string\r\n\t}\r\n\tvatStatus: {\r\n\t\tactive: boolean\r\n\t\tcode: number | null\r\n\t\tisSafe: boolean\r\n\t\tsuspended: boolean\r\n\t\tvatPayer: boolean\r\n\t}\r\n\tisFizAuthToYurProfile?: boolean\r\n\tisAuthWithPassword?: boolean\r\n\tuser: IUserInfo | null\r\n\titemReleaseds: ItemReleaseds[] | null\r\n\taccounts: Accounts[] | null\r\n}\r\n\r\nexport const profile: IProfile = {\r\n\ttoken: null,\r\n\ttokenExpiration: null,\r\n\ttin: '',\r\n\tisItd: false,\r\n\tname: '',\r\n\tvat: false,\r\n\tvatRegCode: '',\r\n\toked: '',\r\n\temail: '',\r\n\tmobile: '',\r\n\tphone: '',\r\n\tregionId: '',\r\n\tdistrictId: '',\r\n\tbankId: '',\r\n\taccount: '',\r\n\tdirector: '',\r\n\tdirectorPinfl: 0,\r\n\taccountant: '',\r\n\ttelegramId: '',\r\n\taddress: '',\r\n\titemReleased: '',\r\n\tshortName: '',\r\n\tpersonalNum: '',\r\n\tbranches: [],\r\n\tbudget: {\r\n\t\taccount: null,\r\n\t\tisBudget: 0,\r\n\t\ttin: null\r\n\t},\r\n\tvatStatus: {\r\n\t\tactive: false,\r\n\t\tcode: null,\r\n\t\tisSafe: false,\r\n\t\tsuspended: false,\r\n\t\tvatPayer: false\r\n\t},\r\n\tisFizAuthToYurProfile: false,\r\n\tisAuthWithPassword: false,\r\n\tuser: null,\r\n\titemReleaseds: null,\r\n\taccounts: null\r\n}\r\n","import { useCallback } from 'react'\r\nimport { useNavigate } from 'react-router-dom'\r\nimport { useTranslation } from 'react-i18next'\r\n// redux\r\nimport { IProfile, profile } from '../models/profile'\r\nimport { useAppDispatch, useAppSelector } from './redux'\r\nimport { AuthSlice } from '../redux/reducers/AuthReducer'\r\nimport { filterSlice } from '../redux/reducers/FilterReducer'\r\nimport { appSlice } from '../redux/reducers/AppReducer'\r\n// utils\r\nimport { deleteAllCookies } from '../utils/utils'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst TIME_TO_CHECK_FOR_TOKEN_REFRESH = 24 * 60 * 60 * 1000\r\n\r\nexport function useProfileSetter() {\r\n\tconst dispatch = useAppDispatch()\r\n\tconst localProfile = useProfileGetter.useGetProfile()\r\n\tconst navigate = useNavigate()\r\n\tconst { t } = useTranslation()\r\n\r\n\tconst setProfileHook = (profile: IProfile, noTokenUpdate?: boolean) => {\r\n\t\tconst profileCopy = Object.assign({}, profile)\r\n\r\n\t\tconst tokenExpiration = JSON.stringify(new Date().getTime() + TIME_TO_CHECK_FOR_TOKEN_REFRESH)\r\n\t\tprofileCopy.tokenExpiration = noTokenUpdate ? profileCopy.tokenExpiration : tokenExpiration\r\n\r\n\t\tdispatch(AuthSlice.actions.setProfile({ profile: profileCopy }))\r\n\t}\r\n\r\n\tconst updateProfileToken = (token: string, profile?: IProfile) => {\r\n\t\tif (!localProfile) return\r\n\r\n\t\tconst tokenExpiration = JSON.stringify(new Date().getTime() + TIME_TO_CHECK_FOR_TOKEN_REFRESH)\r\n\r\n\t\tdispatch(AuthSlice.actions.setProfile({ profile: { ...localProfile, ...profile, token, tokenExpiration } }))\r\n\t}\r\n\r\n\tconst logout = (profile?: IProfile) => {\r\n\t\tif (!localProfile) return\r\n\r\n\t\tdispatch(filterSlice.actions.resetFilter())\r\n\t\tdispatch(AuthSlice.actions.profileLogout(profile || localProfile))\r\n\t}\r\n\r\n\tconst profileExit = useCallback(() => {\r\n\t\tlogout()\r\n\t\tdispatch(filterSlice.actions.resetFilter())\r\n\t\tdeleteAllCookies()\r\n\t\tfor (let key in window.localStorage) {\r\n\t\t\tif (key !== 'themeLight') {\r\n\t\t\t\twindow.localStorage.removeItem(key)\r\n\t\t\t}\r\n\t\t}\r\n\t\twindow.sessionStorage.clear()\r\n\t\tdispatch(\r\n\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\ttype: 'info',\r\n\t\t\t\tmessage: t('alertTitles.signOut'),\r\n\t\t\t\tshow: true\r\n\t\t\t})\r\n\t\t)\r\n\t\tdispatch(AuthSlice.actions.clearAccountStatus())\r\n\t\tnavigate('/login')\r\n\t\twindow.location.reload()\r\n\t}, [])\r\n\r\n\treturn {\r\n\t\tsetProfileHook,\r\n\t\tupdateProfileToken,\r\n\t\tlogout,\r\n\t\tprofileExit\r\n\t}\r\n}\r\n\r\nexport const useProfileGetter = {\r\n\tuseGetProfile: (): IProfile => {\r\n\t\tconst profilesStore = useAppSelector(state => state.authReducer.profile)\r\n\t\tlet profileObj\r\n\t\tif (Array.isArray(profilesStore)) {\r\n\t\t\tprofileObj = profilesStore.at(-1) || profile\r\n\t\t} else {\r\n\t\t\tprofileObj = profile\r\n\t\t}\r\n\t\treturn profileObj\r\n\t},\r\n\tuseGetAllProfiles: (): IProfile[] => {\r\n\t\treturn useAppSelector(state => state.authReducer.profile)\r\n\t}\r\n}\r\n","import axios from 'axios'\r\n\r\ninterface IWithoutVatCompany {\r\n\ttin?: string\r\n\tbuyerTin?: string\r\n\tcommitentTin?: string\r\n\tdate: string\r\n}\r\n\r\nexport interface ILgotaItem {\r\n\tlgotaId: string\r\n\tlgotaName: string\r\n\tbuyerTins?: string[]\r\n\tturnOver?: boolean\r\n}\r\n\r\ninterface LgotaEntityResponse {\r\n\t[key: string]: {\r\n\t\tsellerWithoutVat: ILgotaItem[]\r\n\t\tsellerZeroVat: ILgotaItem[]\r\n\t\tbuyerWithoutVat: ILgotaItem[]\r\n\t\tbuyerZeroVat: ILgotaItem[]\r\n\t\tsellerLgotas?: ILgotaItem[]\r\n\t\tbuyerLgotas?: ILgotaItem[]\r\n\t}\r\n}\r\n\r\ninterface LgotaTurnOverEntityResponse {\r\n\t[key: string]: ILgotaItem[]\r\n}\r\n\r\ninterface LgotaMxikResponse {\r\n\t[key: string]: {\r\n\t\tcompensationWork: boolean\r\n\t\tnotIncludedProduct: boolean\r\n\t\twithoutVat: ILgotaItem[]\r\n\t\tzeroVat: ILgotaItem[]\r\n\t}\r\n}\r\n\r\nexport default {\r\n\tasync getCheckNonConfirmatoryCompany(tin: string) {\r\n\t\treturn await axios.get(`/goods/utils/non-conformity-goods-companies?page=1&size=1&SearchText=${tin}`)\r\n\t},\r\n\tasync getCheckProduct(mxikCode: string, date: any) {\r\n\t\tdate = date ? date : Date.now()\r\n\t\tlet day = new Date(date)\r\n\t\tlet dd = day.getDate()\r\n\t\tlet mm = day.getMonth() + 1 //January is 0!\r\n\t\tlet yyyy = day.getFullYear()\r\n\r\n\t\t//@ts-ignore\r\n\t\tmm = String(mm).length === 1 ? `0${mm}` : mm\r\n\r\n\t\treturn await axios.post(`/goods/lgota/check-product?date=${yyyy}-${mm}-${dd}`, [mxikCode])\r\n\t},\r\n\tasync getWithoutVatCompany({ tin, buyerTin, commitentTin, date }: IWithoutVatCompany) {\r\n\t\treturn await axios.post(`/goods/lgota/check-company?date=${date}`, [\r\n\t\t\t`${tin || ''}`,\r\n\t\t\t`${buyerTin || ''}`,\r\n\t\t\t`${commitentTin || ''}`\r\n\t\t])\r\n\t},\r\n\tasync getLgotasForTurnOverCompany(tin: string, date: any) {\r\n\t\tdate = date ? date : Date.now()\r\n\t\tlet day = new Date(date)\r\n\t\tlet dd = day.getDate()\r\n\t\tlet mm = day.getMonth() + 1 //January is 0!\r\n\t\tlet yyyy = day.getFullYear()\r\n\r\n\t\t//@ts-ignore\r\n\t\tmm = String(mm).length === 1 ? `0${mm}` : mm\r\n\t\tconst response = await axios.post(\r\n\t\t\t`/goods/lgota/check-turnover-tax/?lang=ru&date=${yyyy}-${mm}-${dd}`,\r\n\t\t\t[tin]\r\n\t\t)\r\n\t\treturn response\r\n\t},\r\n\tasync getListOfAllMeasures() {\r\n\t\treturn await axios.get(`/measures/all`)\r\n\t},\r\n\tasync getListOfMxiks({ size = 1000, page = 0 }) {\r\n\t\treturn await axios.get(`/goods/product/list?size=${size}&page=${page}`)\r\n\t},\r\n\tasync getListOfMxiksByTin(tin: string) {\r\n\t\treturn await axios.get(`/goods/product/listbytin/${tin}/?size=1000`)\r\n\t},\r\n\tasync getMxikByTin(tin: string, code: string) {\r\n\t\tconst isAllNumerical = !!Number(code)\r\n\t\tconst searchParam = `?${isAllNumerical ? 'mxik' : 'stext'}=${code}`\r\n\t\treturn await axios.get(`/goods/product/listbytin/${tin}/${searchParam}`)\r\n\t},\r\n\tasync searchForMxik(data: string) {\r\n\t\treturn await axios.get(`/goods/mxik/search/?stext=${data}`)\r\n\t},\r\n\tasync searchForMxikByCode(codes: any) {\r\n\t\treturn await axios.post(`/goods/mxik/check/codes`, { codes })\r\n\t},\r\n\tasync searchOtherIncomeMxik(codes: any) {\r\n\t\treturn await axios.post(`/goods/mxik/list/package`, { codes })\r\n\t},\r\n\tasync getLotInfo(buyerTin: string, lotId: string) {\r\n\t\treturn await axios.get(`/documents/exchange/lotinfo/${buyerTin}/${lotId}`)\r\n\t},\r\n\tasync getLotType(buyerTin: string, lotId: string) {\r\n\t\treturn await axios.get(`/documents/exchange/lottype/${buyerTin}/${lotId}`)\r\n\t},\r\n\tasync signRequest() {\r\n\t\treturn await axios.post('/rouming/signrequest', 'q=1')\r\n\t},\r\n\tasync loginecp(pkcs7: string) {\r\n\t\treturn await axios.post('/rouming/loginecp', { pkcs7 })\r\n\t},\r\n\tasync verifyCode(code: any) {\r\n\t\treturn await axios.post('/profile/verifymobile', {\r\n\t\t\tmobileVerification: code\r\n\t\t})\r\n\t},\r\n\tasync getProviders() {\r\n\t\treturn await axios.get(`/profile/provider`)\r\n\t},\r\n\tasync setProviders(payload: any) {\r\n\t\treturn await axios.post(`/profile/provider`, payload)\r\n\t},\r\n\tasync getInvestmentObject(buyerTin: string) {\r\n\t\treturn await axios.get(`/documents/investmentobject/buyer/${buyerTin}`)\r\n\t},\r\n\tasync getVehicles(tin: string) {\r\n\t\treturn await axios.get(`/utils/waybills-v2/catalogs/transport?tinOrPinfl=${tin}`)\r\n\t},\r\n\tasync getInvestmentListById(sellerTin: string, buyerTin: string, objectId: string) {\r\n\t\treturn await axios.get(`/documents/investmentobject/list/${sellerTin}/${buyerTin}/?objectId=${objectId}`)\r\n\t},\r\n\tasync getInvestmentListByAccount(sellerTin: string, buyerTin: string, account: string) {\r\n\t\treturn await axios.get(`/documents/investmentobject/list/${sellerTin}/${buyerTin}/?buyerAccount=${account}`)\r\n\t},\r\n\tasync getContractById(id: string) {\r\n\t\treturn await axios.get(`/rouming/econtract/contract/getbyid/?lang=ru&id=${id}`)\r\n\t},\r\n\tasync getProductOriginByTin(tin: string) {\r\n\t\treturn await axios.get(`/profile/productoriginbytin/${tin}`)\r\n\t},\r\n\tasync getCheckMxikWithoutVat(code: string) {\r\n\t\treturn await axios.get(`/goods/lgota/without-vat-products/?page=0&size=10&TasnifCode=${code}`)\r\n\t},\r\n\tasync getCheckMxikZeroVat(code: string) {\r\n\t\treturn await axios.get(`/goods/lgota/zero-vat-products/?page=0&size=10&TasnifCode=${code}`)\r\n\t},\r\n\tasync catchErrorMessage(errorData: any, showSnackbar = false) {\r\n\t\tconst errorText = `${errorData}`\r\n\t\tawait axios.post(\r\n\t\t\t'/profile/errorSave',\r\n\t\t\t{\r\n\t\t\t\terror: errorText\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\theaders: { showSnackbar: showSnackbar.toString() }\r\n\t\t\t}\r\n\t\t)\r\n\t},\r\n\tasync searchRailwayDocId(data: string) {\r\n\t\treturn await axios.get(`/utils/waybills-v2/templates/integrations/railway-doc?railwayDocId=${data}`)\r\n\t},\r\n\tasync getMarks(payload: any) {\r\n\t\treturn await axios.post(`/goods/utils/checkmarkingcodes`, payload)\r\n\t}\r\n}\r\n","import { appSlice } from '../redux/reducers/AppReducer'\r\nimport { isPast } from 'date-fns'\r\nimport { refreshToken } from '../redux/actions/AuthActions'\r\n\r\nexport const inputProps = (\r\n\tlabel,\r\n\tsize,\r\n\ttype,\r\n\treadOnly = false,\r\n\tmt = 0,\r\n\twidth,\r\n\tfullWidth = false,\r\n\tvalue = undefined\r\n) => {\r\n\tconst props = {\r\n\t\tlabel: label,\r\n\t\tsize: size,\r\n\t\ttype: type,\r\n\t\tInputProps: { readOnly: readOnly },\r\n\t\tsx: { mt: mt, width: width },\r\n\t\tfullWidth: fullWidth\r\n\t}\r\n\r\n\tif (value) {\r\n\t\tprops.value = value\r\n\t}\r\n\r\n\treturn props\r\n}\r\n\r\nexport const getContractEntityFields = (obj, isOwner) => {\r\n\treturn {\r\n\t\trole: obj.role || (isOwner ? 'Поставщик' : 'Покупатель'),\r\n\t\tbasis: obj.basis || 'Устава',\r\n\t\tjobtitle: obj.jobtitle || 'Директор'\r\n\t}\r\n}\r\n\r\nexport const checkErrorsBase = (errorMessage, t) => {\r\n\tconst errorTranslations = t('errors', { returnObjects: true })\r\n\tfor (const [startKey, explanation] of Object.entries(errorTranslations)) {\r\n\t\tif (errorMessage === startKey) {\r\n\t\t\treturn explanation\r\n\t\t}\r\n\t}\r\n\r\n\treturn null\r\n}\r\n\r\nexport const checkRoumingErrorsBase = (errorMessage, t) => {\r\n\tconst roumingErrorTranslations = t('roumingErrorStartWith', { returnObjects: true })\r\n\tfor (const [startKey, explanation] of Object.entries(roumingErrorTranslations)) {\r\n\t\tif (errorMessage === startKey || errorMessage?.startsWith(startKey)) {\r\n\t\t\treturn `Ошибка в РОУМИНГЕ: ${errorMessage}\\nПояснение: ${explanation}`\r\n\t\t}\r\n\t}\r\n\r\n\treturn null\r\n}\r\n\r\nexport const checkFormFacturaErrorsBase = (errorMessage, t) => {\r\n\tconst errorTranslations = t('formFacturaErrors', { returnObjects: true })\r\n\tconst keys = errorMessage.toLowerCase().split('.')\r\n\r\n\tlet rowNumber = null\r\n\tconst processedKeys = keys.map(key => {\r\n\t\tconst arrayMatch = key.match(/(.+)\\[(\\d+)]/)\r\n\t\tif (arrayMatch) {\r\n\t\t\trowNumber = parseInt(arrayMatch[2], 10) + 1\r\n\t\t\treturn arrayMatch[1]\r\n\t\t}\r\n\t\treturn key\r\n\t})\r\n\r\n\tlet current = errorTranslations\r\n\tfor (const key of processedKeys) {\r\n\t\tif (current && current[key] !== undefined) {\r\n\t\t\tcurrent = current[key]\r\n\t\t} else {\r\n\t\t\treturn null\r\n\t\t}\r\n\t}\r\n\r\n\treturn rowNumber !== null ? `Строка-${rowNumber} товара: ${current}` : current\r\n}\r\n\r\nexport const checkTTHErrorsBase = (errorMessage, t) => {\r\n\tconst errorTranslations = t('TTH_Errors', { returnObjects: true })\r\n\r\n\tfor (const [startKey, explanation] of Object.entries(errorTranslations)) {\r\n\t\tconst sanitizedErrorMessage = errorMessage.replace(/[:\\s]/g, '_').trim()\r\n\t\tconst sanitizedStartKey = startKey.replace(/[:\\s]/g, '_').trim()\r\n\r\n\t\tif (sanitizedErrorMessage === sanitizedStartKey) {\r\n\t\t\treturn explanation\r\n\t\t}\r\n\t}\r\n\r\n\treturn null\r\n}\r\n\r\nexport const checkFormWaybillLocalErrorsBase = (errorMessage, t) => {\r\n\tconst errorTranslations = t('formTTH_Errors', { returnObjects: true })\r\n\tconst keys = errorMessage.toLowerCase().split('.')\r\n\r\n\tlet rowNumber = null\r\n\tconst processedKeys = keys.map(key => {\r\n\t\tconst arrayMatch = key.match(/(.+)\\[(\\d+)]/)\r\n\t\tif (arrayMatch) {\r\n\t\t\trowNumber = parseInt(arrayMatch[2], 10) + 1\r\n\t\t\treturn arrayMatch[1]\r\n\t\t}\r\n\t\treturn key\r\n\t})\r\n\r\n\tlet current = errorTranslations\r\n\tfor (const key of processedKeys) {\r\n\t\tif (current && current[key] !== undefined) {\r\n\t\t\tcurrent = current[key]\r\n\t\t} else {\r\n\t\t\treturn null\r\n\t\t}\r\n\t}\r\n\r\n\treturn rowNumber !== null ? `Строка-${rowNumber} товара: ${current}` : current\r\n}\r\n\r\nexport const selectAllText = event => event.target.select()\r\n\r\nexport const deleteAllCookies = () => {\r\n\tconst cookies = document.cookie.split(';')\r\n\r\n\tfor (let i = 0; i < cookies.length; i++) {\r\n\t\tconst cookie = cookies[i]\r\n\t\tconst eqPos = cookie.indexOf('=')\r\n\t\tconst name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie\r\n\t\tdocument.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:00 GMT'\r\n\t}\r\n}\r\n\r\nexport const searchArr = (arr, val, field) => {\r\n\tfor (let i = 0; i < arr.length; i++) {\r\n\t\tif (arr[i][field] === val) {\r\n\t\t\treturn arr[i]\r\n\t\t}\r\n\t}\r\n\treturn null\r\n}\r\n\r\nexport const copyObject = data => {\r\n\treturn JSON.parse(JSON.stringify(data))\r\n}\r\n\r\nexport const isValidTinPinfl = tinPinfl => {\r\n\treturn [9, 14].includes(tinPinfl?.length)\r\n}\r\n\r\nexport const checkIfTokenNeedsRefresh = (updateProfileToken, token, tokenExpiration) => {\r\n\tif (![token, tokenExpiration].every(Boolean)) return\r\n\tif (isPast(new Date(JSON.parse(tokenExpiration)))) {\r\n\t\trefreshToken(updateProfileToken)\r\n\t}\r\n}\r\n\r\nexport const buildSuccess = (resolve, resolveParam) => {\r\n\tresolve(resolveParam)\r\n}\r\n\r\nexport const handleError = (error, dispatch, reject) => {\r\n\tif (error.response && error.response.status === 401) {\r\n\t\t// store.dispatch('userLogout')\r\n\t\tdispatch(\r\n\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\ttype: 'error',\r\n\t\t\t\tshow: true,\r\n\t\t\t\tmessage: 'status === 401, Заново пройдите авторизацию'\r\n\t\t\t})\r\n\t\t)\r\n\t} else {\r\n\t\tlet errorMessage =\r\n\t\t\terror.errMsg === 'WRONG_PASSWORD' ? 'Неправильно введен пароль. Заново пройдите авторизацию.' : error.errMsg\r\n\t\tdispatch(\r\n\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\ttype: 'error',\r\n\t\t\t\tshow: true,\r\n\t\t\t\tmessage: errorMessage\r\n\t\t\t})\r\n\t\t)\r\n\t}\r\n\treject(error)\r\n}\r\n\r\nexport const isMainProduction = () => {\r\n\treturn window.location.hostname === 'doc.edocs.uz'\r\n}\r\n\r\nexport const toLowerCaseKeys = obj => {\r\n\tif (obj === null || typeof obj !== 'object') {\r\n\t\treturn obj // Если это не объект или null, возвращаем как есть\r\n\t}\r\n\r\n\tif (Array.isArray(obj)) {\r\n\t\treturn obj.map(toLowerCaseKeys) // Рекурсивно обрабатываем массивы\r\n\t}\r\n\r\n\treturn Object.keys(obj).reduce((acc, key) => {\r\n\t\tconst newKey = key.toLowerCase() // Преобразуем ключ в строчные буквы\r\n\t\tacc[newKey] = toLowerCaseKeys(obj[key]) // Рекурсивно обрабатываем значение\r\n\t\treturn acc\r\n\t}, {})\r\n}\r\n","import { useCallback, useState } from \"react\";\r\n\r\nconst useToggle = (initialValue: boolean) => {\r\n const [state, setState] = useState(initialValue);\r\n\r\n const on = useCallback(() => setState(true), [])\r\n const off = useCallback(() => setState(false), [])\r\n const toggle = useCallback(() => setState((prev) => !prev), [])\r\n\r\n return { state, on, off, toggle };\r\n};\r\n\r\nexport default useToggle","import { format, formatDistanceToNow, isToday, isThisYear } from 'date-fns'\r\nimport { ru } from 'date-fns/locale'\r\n// ----------------------------------------------------------------------\r\n\r\nexport function fDate(date) {\r\n\treturn format(new Date(date), 'dd LLLL yyyy', { locale: ru })\r\n}\r\n\r\nexport function fShortDate(date) {\r\n\treturn format(new Date(date), 'dd.MM.yyyy')\r\n}\r\n\r\nexport function fShortDashedDate(date) {\r\n\tif (date) {\r\n\t\tif (JSON.stringify(date) !== 'null') {\r\n\t\t\treturn format(new Date(date), 'yyyy-MM-dd')\r\n\t\t}\r\n\t} else {\r\n\t\treturn date\r\n\t}\r\n}\r\n\r\nexport function fShortDatePerDay(date) {\r\n\tconst parsedDate = new Date(date)\r\n\r\n\tif (isToday(parsedDate)) {\r\n\t\treturn format(parsedDate, 'HH:mm')\r\n\t}\r\n\r\n\tif (isThisYear(parsedDate)) {\r\n\t\treturn format(parsedDate, 'dd MMM', { locale: ru })\r\n\t}\r\n\r\n\treturn format(parsedDate, 'dd.MM.yyyy')\r\n}\r\n\r\nexport function fShortDottedDate(date) {\r\n\treturn format(new Date(date), 'yyyy.MM.dd')\r\n}\r\n\r\nexport function fDateTime(date) {\r\n\treturn format(new Date(date), 'HH:mm, dd-MM-yyyy', { locale: ru })\r\n}\r\n\r\nexport function fDateTimeSuffix(date) {\r\n\treturn format(new Date(date), 'dd/MM/yyyy hh:mm p')\r\n}\r\n\r\nexport function fToNow(date) {\r\n\treturn formatDistanceToNow(new Date(date), {\r\n\t\taddSuffix: true\r\n\t})\r\n}\r\n","import React, { memo } from 'react'\r\nimport { styled } from '@mui/material/styles'\r\nimport { AppBar, Box, IconButton, Skeleton, Stack, Toolbar, Typography } from '@mui/material'\r\nimport { useAppSelector } from '../../../hooks/redux'\r\nimport { Icon } from '@iconify/react'\r\nimport scale from '@iconify/icons-carbon/scale'\r\nimport ThemeToggler from '../ThemeToggler'\r\nimport LanguagePopover from '../LanguagePopover'\r\nimport AccountPopover from '../AccountPopover'\r\n\r\n// @ts-ignore\r\nconst RootStyle = styled(AppBar)(({ theme, open }) => ({\r\n\t//@ts-ignore\r\n\tbackgroundColor: theme.palette.background.custom,\r\n\twidth: `calc(100vw - ${open ? '280px' : theme.spacing(7)})`,\r\n\theight: 51\r\n}))\r\n\r\nconst ToolbarStyle = styled(Toolbar)(({ theme }) => ({\r\n\tminHeight: 51,\r\n\t[theme.breakpoints.up('lg')]: {\r\n\t\tminHeight: 51,\r\n\t\tpadding: theme.spacing(0, 5)\r\n\t}\r\n}))\r\n\r\nconst NavbarSkeleton = () => {\r\n\tconst open = useAppSelector(state => state.appReducer.showSidebar)\r\n\r\n\treturn (\r\n\t\t// @ts-ignore\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default memo(NavbarSkeleton)\r\n","import { memo } from 'react'\r\nimport { useAppSelector } from '../../../hooks/redux'\r\nimport { styled, useTheme } from '@mui/material/styles'\r\nimport Scrollbar from '../../../components/Scrollbar'\r\nimport { Drawer, List, Skeleton, Stack } from '@mui/material'\r\n\r\n//@ts-ignore\r\nconst RootStyle = styled(Drawer, {\r\n\tshouldForwardProp: prop => prop !== 'open'\r\n})(({ theme, open }) => ({\r\n\twidth: open ? 280 : theme.spacing(7),\r\n\tflexShrink: 0,\r\n\twhiteSpace: 'nowrap',\r\n\tboxSizing: 'border-box'\r\n}))\r\n\r\nconst CustomScrollbar = styled(Scrollbar)(({ theme }) => ({\r\n\t//@ts-ignore\r\n\tbackground: theme.palette.background.custom\r\n}))\r\nconst CustomList = styled(List)(({ theme }) => ({\r\n\t//@ts-ignore\r\n\tbackground: theme.palette.background.custom\r\n}))\r\n\r\nconst SidebarSkeleton = () => {\r\n\tconst open = useAppSelector(state => state.appReducer.showSidebar)\r\n\tconst theme = useTheme()\r\n\r\n\treturn (\r\n\t\t//@ts-ignore\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{Array.from({ length: 11 }).map((i, index) => (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t))}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default memo(SidebarSkeleton)\r\n","import React, { useState, lazy } from 'react'\r\nimport { Outlet } from 'react-router-dom'\r\n// material\r\nimport NavbarSkeleton from './skeletons/NavbarSkeleton'\r\nimport SidebarSkeleton from './skeletons/SidebarSkeleton'\r\nimport { RootStyle, MainStyle } from './DashboardStyles'\r\n// components\r\nconst DashboardNavbar = lazy(() => import('./DashboardNavbar'))\r\nconst DashboardSidebar = lazy(() => import('./DashboardSidebar'))\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst DashboardLayout = () => {\r\n\tconst [open, setOpen] = useState(false)\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t}>\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t}>\r\n\t\t\t\t setOpen(false)} />\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default React.memo(DashboardLayout)\r\n","import { Outlet } from \"react-router-dom\";\r\n// material\r\nimport { styled } from \"@mui/material/styles\";\r\n// components\r\nimport { useEffect } from \"react\";\r\nimport { installApiKeys } from \"../redux/actions/EimzoActions\";\r\nimport { useAppDispatch } from \"../hooks/redux\";\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nexport default function LogoOnlyLayout() {\r\n const dispatch = useAppDispatch()\r\n useEffect(() => {\r\n dispatch(installApiKeys())\r\n }, []);\r\n\r\n return (\r\n <>\r\n \r\n \r\n );\r\n}\r\n","import PropTypes from 'prop-types';\r\nimport { Helmet } from 'react-helmet-async';\r\nimport { forwardRef } from 'react';\r\n// material\r\nimport { Box } from '@mui/material';\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst Page = forwardRef(({ children, title = '', ...other }, ref) => (\r\n \r\n \r\n {title}\r\n \r\n {children}\r\n \r\n));\r\n\r\nPage.propTypes = {\r\n children: PropTypes.node.isRequired,\r\n title: PropTypes.string\r\n};\r\n\r\nexport default Page;\r\n","import { Icon } from '@iconify/react'\r\nimport banned from '@iconify/icons-carbon/document-export'\r\n// material\r\nimport { alpha, styled } from '@mui/material/styles'\r\nimport { Card, Typography } from '@mui/material'\r\n// utils\r\nimport { fShortenNumber } from '../../../utils/formatNumber'\r\nimport { useTranslation } from 'react-i18next'\r\nimport React from 'react'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst RootStyle = styled(Card)(({ theme }) => ({\r\n\tdisplay: 'flex',\r\n\tflexDirection: 'column',\r\n\tjustifyContent: 'center',\r\n\talignItems: 'center',\r\n\tboxShadow: 'none',\r\n\ttextAlign: 'center',\r\n\tpadding: theme.spacing(5, 0),\r\n\tcolor: theme.palette.error.darker,\r\n\tbackgroundColor: theme.palette.error.lighter,\r\n\t[theme.breakpoints.down('sm')]: {\r\n\t\tpadding: theme.spacing(2, 0),\r\n\t\tfontSize: '0.875rem',\r\n\t\theight: '152px'\r\n\t}\r\n}))\r\n\r\nconst IconWrapperStyle = styled('div')(({ theme }) => ({\r\n\tmargin: 'auto',\r\n\tdisplay: 'flex',\r\n\tborderRadius: '50%',\r\n\talignItems: 'center',\r\n\twidth: theme.spacing(8),\r\n\theight: theme.spacing(8),\r\n\tjustifyContent: 'center',\r\n\tmarginBottom: theme.spacing(3),\r\n\tcolor: theme.palette.error.dark,\r\n\tbackgroundImage: `linear-gradient(135deg, ${alpha(theme.palette.error.dark, 0)} 0%, ${alpha(\r\n\t\ttheme.palette.error.dark,\r\n\t\t0.24\r\n\t)} 100%)`,\r\n\t[theme.breakpoints.down('sm')]: {\r\n\t\twidth: theme.spacing(6),\r\n\t\theight: theme.spacing(2)\r\n\t}\r\n}))\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst AppBannedDocs = ({ count }) => {\r\n\tconst { t } = useTranslation()\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t{fShortenNumber(count)}\r\n\t\t\t\r\n\t\t\t\t{t('DOC_STATUS.waiting_partner')}\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default React.memo(AppBannedDocs)\r\n","import { Icon } from '@iconify/react'\r\nimport rejected from '@iconify/icons-carbon/rule-draft'\r\n// material\r\nimport { alpha, styled } from '@mui/material/styles'\r\nimport { Card, Typography } from '@mui/material'\r\n// utils\r\nimport { fShortenNumber } from '../../../utils/formatNumber'\r\nimport React from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst RootStyle = styled(Card)(({ theme }) => ({\r\n\tdisplay: 'flex',\r\n\tflexDirection: 'column',\r\n\tjustifyContent: 'center',\r\n\talignItems: 'center',\r\n\tboxShadow: 'none',\r\n\ttextAlign: 'center',\r\n\tpadding: theme.spacing(5, 0),\r\n\tcolor: theme.palette.warning.darker,\r\n\tbackgroundColor: theme.palette.warning.lighter,\r\n\t[theme.breakpoints.down('sm')]: {\r\n\t\tpadding: theme.spacing(2, 0),\r\n\t\tfontSize: '0.875rem',\r\n\t\theight: '152px'\r\n\t}\r\n}))\r\n\r\nconst IconWrapperStyle = styled('div')(({ theme }) => ({\r\n\tmargin: 'auto',\r\n\tdisplay: 'flex',\r\n\tborderRadius: '50%',\r\n\talignItems: 'center',\r\n\twidth: theme.spacing(8),\r\n\theight: theme.spacing(8),\r\n\tjustifyContent: 'center',\r\n\tmarginBottom: theme.spacing(3),\r\n\tcolor: theme.palette.warning.dark,\r\n\tbackgroundImage: `linear-gradient(135deg, ${alpha(theme.palette.warning.dark, 0)} 0%, ${alpha(\r\n\t\ttheme.palette.warning.dark,\r\n\t\t0.24\r\n\t)} 100%)`,\r\n\t[theme.breakpoints.down('sm')]: {\r\n\t\twidth: theme.spacing(6),\r\n\t\theight: theme.spacing(2)\r\n\t}\r\n}))\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst AppRejectedDocs = ({ count }) => {\r\n\tconst { t } = useTranslation()\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t{fShortenNumber(count)}\r\n\t\t\t\r\n\t\t\t\t{t('DOC_STATUS.waiting_send')}\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default React.memo(AppRejectedDocs)\r\n","import { memo, useEffect, useRef } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { Backdrop, Dialog, DialogContent, DialogContentText, Box, Button } from '@mui/material'\r\nimport { INews } from '../redux/actions/NewsActions'\r\n\r\nconst formatNewsText = (text: string) => {\r\n\treturn text\r\n\t\t.replace(/<[^>]*>(?)/g, '')\r\n\t\t.replace(/(https?:\\/\\/[^\\s]+)/g, '$1')\r\n}\r\n\r\ninterface INewsModal extends Partial {\r\n\topen: boolean\r\n\thandleClose: () => void\r\n}\r\n\r\nconst NewsModal = (props: INewsModal) => {\r\n\tconst { t } = useTranslation()\r\n\tconst { open, handleClose, text, files } = props\r\n\tconst descriptionElementRef = useRef(null)\r\n\r\n\tuseEffect(() => {\r\n\t\tif (open) {\r\n\t\t\tconst { current: descriptionElement } = descriptionElementRef\r\n\t\t\tif (descriptionElement !== null) {\r\n\t\t\t\tdescriptionElement.focus()\r\n\t\t\t}\r\n\t\t}\r\n\t}, [open])\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{t('common.close')}\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t{!!files?.length && (\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default memo(NewsModal)","export const NEWS = [\r\n\t{\r\n\t\ttitle: 'Внимание! Изменения при формировании ЭСФ.',\r\n\t\tdescription:\r\n\t\t\t'С 01.06.2023 года в системе электронных ЭСФ произошли изменения со стороны ГНК. Теперь необходимо указывать \"Цель реализации\" и \"Категория поставщика\" данной электронной счёт-фактуры. Все изменения на сервисе уже учтены, в конфигурации 1С: FIDES изменения в скором времени будут учтены с выходом нового обновления',\r\n\t\tpostedAt: Date.now()\r\n\t},\r\n\t{\r\n\t\ttitle: 'Внимание пользователям!',\r\n\t\tdescription: `Мы сердечно благодарим, что вы продолжаете пользоваться сервисом E-Docs. Наша команда сталкивается с бесконечными трудностями в поддержке сервиса в рабочем состоянии. Мы стараемся оказать помощь и поддержку каждому пользователю. На протяжении 3 лет наша команда работала не покладая рук для того, чтобы сервис оставался доступным в режиме 24/7. Мы сделали много улучшений, много новшеств, включая и те, которые нескончаемым потоком льются от оператора-роуминга. Мы стараемся, чтобы по праву назваться Первой линией поддержки пользователей. Мы не смогли бы сделать сервис лучше без вашего участия, без вашей поддержки, без вашего терпения. Спасибо, что вы с нами. \r\n\r\n Чтобы и в дальнейшем поддерживать сервис в актуальном и стабильном состоянии мы вынуждены увеличить стоимость отправки документы через наш сервис. Надеемся на ваше понимание. Мы всевозможными силами пытались предотвратить это, однако стоимость содержания сервиса за время работы возросла почти в два раза. \r\n В связи с этим с 01.12.2022 года мы изменяем тарифы.\r\n \r\n Тариф «FREE» - по-прежнему бесплатный для всех новых пользователей в течении первых 30 дней использования.\r\n Тариф «Подписчик ИТС» - 270 сум за один отправленный документ.\r\n Тариф «Базовый» - 300 сум за один отправленный документ.\r\n \r\n Также в доступе становиться приобретение пакетов на отправку документов (от 3000 документов), по сниженной цене, 250 сум за отправленный документ.`,\r\n\t\tpostedAt: Date.now()\r\n\t},\r\n\t{\r\n\t\ttitle: 'Новый сайт!',\r\n\t\tdescription:\r\n\t\t\t'Свершилось! Вы этого так долго ждали. Система электронного документооборота E-DOCS в новом интерфейсе! Для комфортной работы с системой предлагаем ознакомиться с видео инструкциями, которые доступны в нашем телеграм канале.',\r\n\t\tpostedAt: Date.now()\r\n\t}\r\n]\r\n","import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/dist/query/react'\r\n\r\nexport interface INews {\r\n\tdate: string\r\n\tfiles: string[]\r\n\tlink: string\r\n\tmessageid: number\r\n\ttext: string\r\n\tshort_text: string\r\n}\r\n\r\nexport const newsApi = createApi({\r\n\treducerPath: 'newsApi',\r\n\tbaseQuery: fetchBaseQuery({\r\n\t\tbaseUrl: 'https://news.tildacdn.com/feed/telegrambot-1177297055-84bdf649432592bce/20/0/200'\r\n\t}),\r\n\tendpoints: builder => ({\r\n\t\tgetNews: builder.query({\r\n\t\t\tquery: () => ''\r\n\t\t})\r\n\t})\r\n})\r\n\r\nexport const { useGetNewsQuery } = newsApi\r\n","import React, { useEffect } from 'react'\r\nimport PropTypes from 'prop-types'\r\nimport { Icon } from '@iconify/react'\r\nimport { motion } from 'framer-motion'\r\nimport arrowIosForwardFill from '@iconify/icons-eva/arrow-ios-forward-fill'\r\n// material\r\nimport { Box, Card, Button, Divider, Typography, CardHeader, Paper, Grid } from '@mui/material'\r\n//\r\nimport { useCallback, useState } from 'react'\r\nimport NewsModal from '../../NewsModal'\r\nimport { fDate } from '../../../utils/formatTime'\r\nimport useToggle from '../../../hooks/useToggle'\r\nimport { NEWS } from '../../../data/news'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useGetNewsQuery } from '../../../redux/actions/NewsActions'\r\nimport TelegramIcon from '@mui/icons-material/Telegram'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nNewsItem.propTypes = {\r\n\tnews: PropTypes.object.isRequired\r\n}\r\n\r\nconst placeholderAnimation = {\r\n\thidden: { opacity: 0, scale: 0.8 },\r\n\tvisible: { opacity: 1, scale: 1, transition: { duration: 0.5 } }\r\n}\r\n\r\nconst formatNewsText = text => {\r\n\treturn text\r\n\t\t.replace(/<[^>]*>(?)/g, '')\r\n\t\t.replace(/(https?:\\/\\/[^\\s]+)/g, '$1')\r\n}\r\n\r\nfunction NewsItem({ news, newsClick }) {\r\n\tconst { short_text, files, date } = news\r\n\r\n\treturn (\r\n\t\t newsClick(news)}\r\n\t\t\tsx={{\r\n\t\t\t\tp: 2,\r\n\t\t\t\tdisplay: 'flex',\r\n\t\t\t\tflexDirection: 'column',\r\n\t\t\t\tcursor: 'pointer',\r\n\t\t\t\twidth: '100%',\r\n\t\t\t\theight: '100%',\r\n\t\t\t\tbackgroundColor: 'background.paper',\r\n\t\t\t\t'&:hover': { backgroundColor: 'action.hover' },\r\n\t\t\t\tborderRadius: 2\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t{files.length > 0 ? (\r\n\t\t\t\t\r\n\t\t\t) : (\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tНовости сервиса\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{fDate(new Date(date))}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nNewsItem.propTypes = {\r\n\tnews: PropTypes.object.isRequired\r\n}\r\n\r\nexport default function AppNewsUpdate() {\r\n\tconst open = useToggle(false)\r\n\tconst { t } = useTranslation()\r\n\tconst [modalContent, setModalContent] = useState(null)\r\n\tconst [visibleNewsCount, setVisibleNewsCount] = useState(4)\r\n\r\n\tconst { data: fetchedNews, isFetching, isSuccess } = useGetNewsQuery('')\r\n\r\n\tconst handleNewsClick = useCallback(news => {\r\n\t\tsetModalContent(news)\r\n\t\topen.on()\r\n\t}, [])\r\n\r\n\tconst handleTelegramLinkClick = () => {\r\n\t\twindow.open('https://t.me/edocs_info', '_blank') // Переход на указанную ссылку\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tconst lastShowedNewsId = Number(localStorage.getItem('lastShowedNewsId'))\r\n\r\n\t\tif (isSuccess && fetchedNews?.messages?.length > 0) {\r\n\t\t\tconst latestNewsWithImage = fetchedNews.messages.find(newsItem => newsItem.files.length > 0)\r\n\t\t\tconst latestNewsWithImageId = latestNewsWithImage.messageid\r\n\r\n\t\t\tconst latestNewsDate = new Date(Date.parse(latestNewsWithImage.date))\r\n\t\t\tconst twoDaysAgo = new Date(Date.now() - 2 * 864e5)\r\n\r\n\t\t\tif (lastShowedNewsId !== latestNewsWithImageId && latestNewsDate > twoDaysAgo) {\r\n\t\t\t\tsetModalContent(latestNewsWithImage)\r\n\t\t\t\topen.on()\r\n\t\t\t\tlocalStorage.setItem('lastShowedNewsId', latestNewsWithImageId)\r\n\t\t\t}\r\n\t\t}\r\n\t}, [isSuccess, fetchedNews])\r\n\r\n\tconst handleLoadMore = () => {\r\n\t\tsetVisibleNewsCount(prevCount => Math.min(prevCount + 4, fetchedNews.messages.length))\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\t\t (e.currentTarget.style.textDecoration = 'underline')}\r\n\t\t\t\t\t\t\tonMouseOut={e => (e.currentTarget.style.textDecoration = 'none')}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{t('NEWS')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tonClick={handleTelegramLinkClick}\r\n\t\t\t\tstyle={{\r\n\t\t\t\t\tcursor: 'pointer',\r\n\t\t\t\t\tdisplay: 'inline-block',\r\n\t\t\t\t\tpaddingBottom: '24px'\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\r\n\t\t\t\r\n\r\n\t\t\t open.off()} />\r\n\r\n\t\t\t\r\n\t\t\t\t{isSuccess && !isFetching && fetchedNews?.messages\r\n\t\t\t\t\t? fetchedNews.messages\r\n\t\t\t\t\t\t\t//.filter(newsItem => newsItem.files && newsItem.files.length > 0)\r\n\t\t\t\t\t\t\t.slice(0, visibleNewsCount)\r\n\t\t\t\t\t\t\t.map(newsItem => (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t))\r\n\t\t\t\t\t: null}\r\n\t\t\t\r\n\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t= fetchedNews?.messages?.length}\r\n\t\t\t\t\tendIcon={}\r\n\t\t\t\t\tonClick={handleLoadMore}\r\n\t\t\t\t>\r\n\t\t\t\t\t{t('common.more')}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n","import { Icon } from '@iconify/react'\r\nimport rightTopArrow from '@iconify/icons-carbon/document-signed'\r\n// material\r\nimport { alpha, styled } from '@mui/material/styles'\r\nimport { Card, Typography } from '@mui/material'\r\n// utils\r\nimport { fShortenNumber } from '../../../utils/formatNumber'\r\nimport { useTranslation } from 'react-i18next'\r\nimport React from 'react'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst RootStyle = styled(Card)(({ theme }) => ({\r\n\tdisplay: 'flex',\r\n\tflexDirection: 'column',\r\n\tjustifyContent: 'center',\r\n\talignItems: 'center',\r\n\tboxShadow: 'none',\r\n\ttextAlign: 'center',\r\n\tpadding: theme.spacing(5, 0),\r\n\tcolor: theme.palette.primary.darker,\r\n\tbackgroundColor: theme.palette.primary.lighter,\r\n\t[theme.breakpoints.down('sm')]: {\r\n\t\tpadding: theme.spacing(2, 0),\r\n\t\tfontSize: '0.875rem',\r\n\t\theight: '152px'\r\n\t}\r\n}))\r\n\r\nconst IconWrapperStyle = styled('div')(({ theme }) => ({\r\n\tmargin: 'auto',\r\n\tdisplay: 'flex',\r\n\tborderRadius: '50%',\r\n\talignItems: 'center',\r\n\twidth: theme.spacing(8),\r\n\theight: theme.spacing(8),\r\n\tjustifyContent: 'center',\r\n\tmarginBottom: theme.spacing(3),\r\n\tcolor: theme.palette.primary.dark,\r\n\tbackgroundImage: `linear-gradient(135deg, ${alpha(theme.palette.primary.dark, 0)} 0%, ${alpha(\r\n\t\ttheme.palette.primary.dark,\r\n\t\t0.24\r\n\t)} 100%)`,\r\n\t[theme.breakpoints.down('sm')]: {\r\n\t\twidth: theme.spacing(6),\r\n\t\theight: theme.spacing(2)\r\n\t}\r\n}))\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst AppSignedDocs = ({ count }) => {\r\n\tconst { t } = useTranslation()\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t{fShortenNumber(count)}\r\n\t\t\t\r\n\t\t\t\t{t('DOC_STATUS.signed')}\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default React.memo(AppSignedDocs)\r\n","import { Icon } from '@iconify/react'\r\nimport clockFilled from '@iconify/icons-carbon/time'\r\n// material\r\nimport { alpha, styled } from '@mui/material/styles'\r\nimport { Card, Typography } from '@mui/material'\r\n// utils\r\nimport { fShortenNumber } from '../../../utils/formatNumber'\r\nimport { useTranslation } from 'react-i18next'\r\nimport React from 'react'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst RootStyle = styled(Card)(({ theme }) => ({\r\n\tdisplay: 'flex',\r\n\tflexDirection: 'column',\r\n\tjustifyContent: 'center',\r\n\talignItems: 'center',\r\n\tboxShadow: 'none',\r\n\ttextAlign: 'center',\r\n\tpadding: theme.spacing(5, 0),\r\n\tcolor: theme.palette.info.darker,\r\n\tbackgroundColor: theme.palette.info.lighter,\r\n\t[theme.breakpoints.down('sm')]: {\r\n\t\tpadding: theme.spacing(2, 0),\r\n\t\tfontSize: '0.875rem',\r\n\t\theight: '152px'\r\n\t}\r\n}))\r\n\r\nconst IconWrapperStyle = styled('div')(({ theme }) => ({\r\n\tmargin: 'auto',\r\n\tdisplay: 'flex',\r\n\tborderRadius: '50%',\r\n\talignItems: 'center',\r\n\twidth: theme.spacing(8),\r\n\theight: theme.spacing(8),\r\n\tjustifyContent: 'center',\r\n\tmarginBottom: theme.spacing(3),\r\n\tcolor: theme.palette.info.dark,\r\n\tbackgroundImage: `linear-gradient(135deg, ${alpha(theme.palette.info.dark, 0)} 0%, ${alpha(\r\n\t\ttheme.palette.info.dark,\r\n\t\t0.24\r\n\t)} 100%)`,\r\n\t[theme.breakpoints.down('sm')]: {\r\n\t\twidth: theme.spacing(6),\r\n\t\theight: theme.spacing(2)\r\n\t}\r\n}))\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst AppWaitingDocs = ({ count }) => {\r\n\tconst { t } = useTranslation()\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t{fShortenNumber(count)}\r\n\t\t\t\r\n\t\t\t\t{t('DOC_STATUS.waiting_you')}\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default React.memo(AppWaitingDocs)\r\n","import { Grid, Container } from '@mui/material'\r\nimport Page from '../components/Page'\r\nimport { useAppSelector } from '../hooks/redux'\r\nimport { Link } from 'react-router-dom'\r\nimport { motion } from 'framer-motion'\r\nimport { AppNewUsers, AppBugReports, AppItemOrders, AppNewsUpdate, AppWeeklySales } from '../components/_dashboard/app'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst DashboardApp = () => {\r\n\tconst { signed, sended } = useAppSelector(state => state.documentsReducer.docCounts.in)\r\n\tconst { drafts, sended: outSended } = useAppSelector(state => state.documentsReducer.docCounts.out)\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default DashboardApp\r\n","import { appSlice } from '../redux/reducers/AppReducer'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useAppDispatch } from './redux'\r\n\r\nexport function useCopy() {\r\n\tconst { t } = useTranslation()\r\n\tconst dispatch = useAppDispatch()\r\n\r\n\tconst copyToClipboard = (text: string) => {\r\n\t\tif (navigator.clipboard && navigator.clipboard.writeText) {\r\n\t\t\t// Используем Clipboard API\r\n\t\t\tnavigator.clipboard\r\n\t\t\t\t.writeText(text)\r\n\t\t\t\t.then(() => {\r\n\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\t\tshow: true,\r\n\t\t\t\t\t\t\tmessage: t('alertTitles.clipboard') + ': ' + text\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t)\r\n\t\t\t\t})\r\n\t\t\t\t.catch(err => {\r\n\t\t\t\t\tconsole.error('Ошибка при копировании через Clipboard API: ', err)\r\n\t\t\t\t})\r\n\t\t} else {\r\n\t\t\t// Резервный вариант через textarea\r\n\t\t\tconst textarea = document.createElement('textarea')\r\n\t\t\ttextarea.value = text\r\n\t\t\tdocument.body.appendChild(textarea)\r\n\t\t\ttextarea.select()\r\n\t\t\ttry {\r\n\t\t\t\tdocument.execCommand('copy')\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\tshow: true,\r\n\t\t\t\t\t\tmessage: t('alertTitles.clipboard') + ': ' + text\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t} catch (err) {\r\n\t\t\t\tconsole.error('Ошибка при копировании через execCommand: ', err)\r\n\t\t\t}\r\n\t\t\tdocument.body.removeChild(textarea)\r\n\t\t}\r\n\t}\r\n\r\n\treturn { copyToClipboard }\r\n}\r\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit'\r\n\r\ninterface DocumentState {\r\n\tprocessingRow: string\r\n\tprocessingRowsError: Record\r\n\tprocessingRowsSuccess: Record\r\n\tprocessingRowsErrorDialog: any\r\n}\r\n\r\nconst initialState: DocumentState = {\r\n\tprocessingRow: '',\r\n\tprocessingRowsError: {},\r\n\tprocessingRowsSuccess: {},\r\n\tprocessingRowsErrorDialog: {}\r\n}\r\n\r\nexport const groupActionsSlice = createSlice({\r\n\tname: 'documents',\r\n\tinitialState,\r\n\treducers: {\r\n\t\tsetProcessingRow: (state, action: PayloadAction) => {\r\n\t\t\tstate.processingRow = action.payload\r\n\t\t},\r\n\t\tsetProcessingRowsError: (state, action: PayloadAction>) => {\r\n\t\t\tstate.processingRowsError = { ...state.processingRowsError, ...action.payload }\r\n\t\t},\r\n\t\tsetProcessingRowsSuccess: (state, action: PayloadAction>) => {\r\n\t\t\tstate.processingRowsSuccess = { ...state.processingRowsSuccess, ...action.payload }\r\n\t\t},\r\n\t\tsetProcessingRowsErrorDialog: (state, action: PayloadAction) => {\r\n\t\t\tstate.processingRowsErrorDialog = action.payload\r\n\t\t},\r\n\t\tclearProcessingRow: state => {\r\n\t\t\tstate.processingRow = ''\r\n\t\t},\r\n\t\tclearProcessingRowsErrorDialog: state => {\r\n\t\t\tstate.processingRowsErrorDialog = {}\r\n\t\t},\r\n\t\tclearAllProcessedRows: state => {\r\n\t\t\tstate.processingRow = ''\r\n\t\t\tstate.processingRowsSuccess = {}\r\n\t\t\tstate.processingRowsError = {}\r\n\t\t}\r\n\t}\r\n})\r\n\r\nexport default groupActionsSlice.reducer\r\n","import React from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { Box, Button, Typography } from '@mui/material'\r\nimport { useAppDispatch } from '../../../hooks/redux'\r\nimport { useTheme } from '@mui/material/styles'\r\nimport Tooltip from '@mui/material/Tooltip'\r\nimport { Icon } from '@iconify/react'\r\nimport { fDateTime, fShortDate } from '../../../utils/formatTime'\r\nimport { filterSlice } from '../../../redux/reducers/FilterReducer'\r\nimport { appSlice } from '../../../redux/reducers/AppReducer'\r\nimport { useParams } from 'react-router-dom'\r\nimport { fCurrencySpace } from '../../../utils/formatNumber'\r\n\r\nexport const statusColors: any = {\r\n\t'1': 'grey', // Сохранён\r\n\t'7': 'blue', // Ожидает подписи получателя\r\n\t'9': 'red', // Отказано доверенным лицом\r\n\t'10': 'blue', // Ожидает подписи получателя\r\n\t'15': 'blue', // Ожидает подписи получателя\r\n\t'17': 'grey', // Отменён\r\n\t'20': 'red', // Отклонён со стороны получателя\r\n\t'30': 'green', // Подписан\r\n\t'40': 'red', // Аннулирован\r\n\t'110': 'blue', // Ожидает подписи (отв лицо)\r\n\t'120': 'gray', // Отменено\r\n\t'130': 'red', // Отказано (отв.лицом)\r\n\t'140': 'orange', // Принято (отв.лицом)\r\n\t'150': 'red', // Груз возвращен (отв.лицом)\r\n\t'160': 'blue', // Доставлено получателю\r\n\t'170': 'red', // Отказано (грузополучателем)\r\n\t'180': 'green', // Подтверждено (грузополучателем)\r\n\t'190': 'orange', // Груз возвращен (отв.лицом)\r\n\t'200': 'green', // Возвращено\r\n\t'998': 'grey', // Недействительный\r\n\t'999': 'red', // Аннулировано (НК)\r\n\tsigned: 'green', // Подписан\r\n\tsended: 'blue', // Ожидает подписи получателя\r\n\treceived: 'blue', // Ожидают вашей подписи\"\r\n\trejected: 'red', // Отклонен\r\n\tdrafts: 'grey', // Сохранён\r\n\tdeleted: 'grey', // Отменён\r\n\tearsed: 'grey' // Удалён (Корзина)\r\n}\r\n\r\nconst DetailPanel: React.FC<{ row: any }> = ({ row }) => {\r\n\tconst { io } = useParams()\r\n\tconst { t } = useTranslation()\r\n\tconst theme = useTheme()\r\n\tconst dispatch = useAppDispatch()\r\n\tconst {\r\n\t\t_id,\r\n\t\tstatus,\r\n\t\tstateId,\r\n\t\tupdatedAt,\r\n\t\tcontractNumber,\r\n\t\tcontractDate,\r\n\t\troumingId,\r\n\t\tdocNumber,\r\n\t\tdocDate,\r\n\t\ttype,\r\n\t\tsubType,\r\n\t\townerTin,\r\n\t\ttargetTins,\r\n\t\townerName,\r\n\t\textension,\r\n\t\tnotes\r\n\t} = row.original\r\n\r\n\tconst statusColor = statusColors[stateId || status] || 'grey'\r\n\tconst targetTinsLength = targetTins.length\r\n\tconst tinOrPinfl =\r\n\t\tio === 'out'\r\n\t\t\t? !!targetTinsLength && type === 'waybillLocal'\r\n\t\t\t\t? targetTins[targetTinsLength - 1].tin\r\n\t\t\t\t: targetTins[0]?.tin\r\n\t\t\t: ownerTin\r\n\tconst partnerName =\r\n\t\tio === 'out'\r\n\t\t\t? targetTinsLength && type === 'waybillLocal'\r\n\t\t\t\t? targetTins[targetTinsLength - 1].name\r\n\t\t\t\t: targetTins[0]?.name\r\n\t\t\t: ownerName\r\n\tconst tinOrPinflLabel = tinOrPinfl?.length === 9 ? t('TIN') : t('PINFL')\r\n\tconst contragent =\r\n\t\ttype === 'waybillLocal'\r\n\t\t\t? io === 'out'\r\n\t\t\t\t? `1) ${t('TTHFORM.consignee')}: `\r\n\t\t\t\t: `1) ${t('TTHFORM.consignor')}: `\r\n\t\t\t: '1) Контрагент:'\r\n\tconst responsiblePersonPINFL = targetTins[0]?.tin.length > 9 ? targetTins[0]?.tin : ''\r\n\tconst responsiblePersonName = targetTins[0]?.tin.length > 9 ? targetTins[0]?.name : ''\r\n\r\n\tconst contractText = contractNumber\r\n\t\t? `№ ${contractNumber} ${t('shortDate.from')} ${fShortDate(contractDate)} ${t('shortDate.year')}`\r\n\t\t: '--'\r\n\r\n\tconst setupDocTypeFilter = (docType: string) => {\r\n\t\tdispatch(filterSlice.actions.setupDocTypeFilter(docType))\r\n\t\tdispatch(\r\n\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\ttype: 'info',\r\n\t\t\t\tmessage: t('alertTitles.filterAct'),\r\n\t\t\t\tshow: true\r\n\t\t\t})\r\n\t\t)\r\n\t}\r\n\r\n\tconst setupNumberDocumentFilter = (numberDocument: string) => {\r\n\t\tdispatch(filterSlice.actions.setupNumberFilter(numberDocument))\r\n\t\tdispatch(\r\n\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\ttype: 'info',\r\n\t\t\t\tmessage: t('alertTitles.filterAct'),\r\n\t\t\t\tshow: true\r\n\t\t\t})\r\n\t\t)\r\n\t}\r\n\r\n\tconst setupTinFilter = (tin: string) => {\r\n\t\tdispatch(filterSlice.actions.setupTinFilter(tin))\r\n\t\tdispatch(\r\n\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\ttype: 'info',\r\n\t\t\t\tmessage: t('alertTitles.filterAct'),\r\n\t\t\t\tshow: true\r\n\t\t\t})\r\n\t\t)\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{t('detailPanel.detailedData')}\r\n\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{contragent}\r\n\t\t\t\t\r\n\r\n\t\t\t\t{type === 'factura' && extension?.singlesidedtype ? (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{t('SINGLE_SIDED')}:\r\n\t\t\t\t\t\t{' '}\r\n\t\t\t\t\t\t{t(`SINGLE_SIDED_STATUS.${extension.singlesidedtype}`) || t('DOC_STATUS.statusUndefined')}\r\n\t\t\t\t\t\r\n\t\t\t\t) : targetTins?.length ? (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{tinOrPinflLabel} {tinOrPinfl}\r\n\t\t\t\t\t\t{', '}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{partnerName}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t) : (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{t('SINGLE_SIDED')}\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t{tinOrPinfl && (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t setupTinFilter(tinOrPinfl)}\r\n\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\tpadding: 0.05,\r\n\t\t\t\t\t\t\t\tminWidth: 'auto',\r\n\t\t\t\t\t\t\t\tmargin: 0,\r\n\t\t\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\t\t\tjustifyContent: 'center',\r\n\t\t\t\t\t\t\t\talignItems: 'center'\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t\r\n\r\n\t\t\t{type === 'waybillLocal' && (\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t1.1) {t('TTHFORM.responsiblePerson')}:\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t{targetTins[0]?.tin.length > 9 ? (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{t('PINFL')} {responsiblePersonPINFL}\r\n\t\t\t\t\t\t\t{', '}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{responsiblePersonName}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\tt('detailPanel.responsiblePersonInDocument')\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\t\t\t)}\r\n\r\n\t\t\t\r\n\t\t\t\t2) {t('detailPanel.documentType')}:\r\n\t\t\t\t\r\n\t\t\t\t\t{t(`DOCUMENT_CATEGORIES.${type}`)}\r\n\t\t\t\t\t{type === 'universal' ? `(${subType})` : ''}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t setupDocTypeFilter(type)}\r\n\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\tpadding: 0.05,\r\n\t\t\t\t\t\t\tminWidth: 'auto',\r\n\t\t\t\t\t\t\tmargin: 0,\r\n\t\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\t\tjustifyContent: 'center',\r\n\t\t\t\t\t\t\talignItems: 'center'\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t3) {t('detailPanel.documentNumber')}:\r\n\t\t\t\t\r\n\t\t\t\t\t№{' '}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{docNumber}\r\n\t\t\t\t\t{' '}\r\n\t\t\t\t\t{t('shortDate.from')} {fShortDate(docDate)}\r\n\t\t\t\t\t{t('shortDate.year')}\r\n\t\t\t\t\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t setupNumberDocumentFilter(docNumber)}\r\n\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\tpadding: 0.05,\r\n\t\t\t\t\t\t\tminWidth: 'auto',\r\n\t\t\t\t\t\t\tmargin: 0,\r\n\t\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\t\tjustifyContent: 'center',\r\n\t\t\t\t\t\t\talignItems: 'center'\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t4) {t('documentItem.CONTRACT')}:\r\n\t\t\t\t{contractText}\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t5) {t('detailPanel.totalWidthVat')}:\r\n\t\t\t\t{fCurrencySpace(row.original.totalDocSum)}\r\n\t\t\t\t\r\n\t\t\t\t\t({t('detailPanel.price')}: {fCurrencySpace(row.original.totalSum)}, {t('VAT')}:{' '}\r\n\t\t\t\t\t{fCurrencySpace(row.original.totalVatSum)})\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t6) {t('detailPanel.updatedAt')}:\r\n\t\t\t\t\r\n\t\t\t\t\t{fDateTime(updatedAt)}\r\n\t\t\t\t\t{t('shortDate.year')}\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t7) {t('detailPanel.status')} - {stateId ? stateId : `${t(`DOC_STATUS.${status}`)}`}:\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t{stateId ? `${t(`DOC_STATUS.${stateId}`)}` : ''}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t8) {t('detailPanel.notes')}:\r\n\t\t\t\t{notes}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{notes ? 9 : 8}) {t('detailPanel._id')}\r\n\t\t\t\t\r\n\t\t\t\t{_id}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{notes ? 10 : 9}) {t('detailPanel.roumingId')}\r\n\t\t\t\t\r\n\t\t\t\t{roumingId}\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default React.memo(DetailPanel)\r\n","import React from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport PropTypes from 'prop-types'\r\n// redux\r\n// hooks\r\nimport { useProfileGetter } from '../../../hooks/useProfile'\r\n// material\r\nimport { Box, Typography, useMediaQuery } from '@mui/material'\r\nimport LoadingButton from '@mui/lab/LoadingButton'\r\nimport { useTheme } from '@mui/material/styles'\r\n// icons\r\nimport { Icon } from '@iconify/react'\r\nimport trash2Fill from '@iconify/icons-eva/trash-2-fill'\r\nimport signIcon from '@iconify/icons-eva/file-text-outline'\r\nimport refresh from '@iconify/icons-eva/refresh-fill'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nUserListToolbar.propTypes = {\r\n\tdocsLength: PropTypes.number,\r\n\tnumSelected: PropTypes.number,\r\n\tsetShowSignMessage: PropTypes.any,\r\n\tshowSignButton: PropTypes.bool,\r\n\tdocumentType: PropTypes.string,\r\n\tdeleteDocuments: PropTypes.any,\r\n\terase: PropTypes.any,\r\n\trefreshDocuments: PropTypes.any,\r\n\trefreshReceived: PropTypes.any,\r\n\tonClearSelection: PropTypes.any,\r\n\tdisabledState: PropTypes.bool\r\n}\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nexport default function UserListToolbar({\r\n\tdocsLength,\r\n\tnumSelected,\r\n\tsetShowSignMessage,\r\n\tshowSignButton,\r\n\tdocumentType,\r\n\tdeleteDocuments,\r\n\terase,\r\n\trefreshDocuments,\r\n\trefreshReceived,\r\n\tonClearSelection,\r\n\tdisabledState\r\n}) {\r\n\tconst { t } = useTranslation()\r\n\tconst theme = useTheme()\r\n\tconst isSmallScreen = useMediaQuery(theme.breakpoints.down('lg'))\r\n\tconst profile = useProfileGetter.useGetProfile()\r\n\tconst isAuthWithPassword = !!profile.isAuthWithPassword\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{t('common.selected')} {numSelected}\r\n\t\t\t\t\t{t('common.selectedFrom')}\r\n\t\t\t\t\t{docsLength}\r\n\t\t\t\t\t{t('common.selectedFromDoc')}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{t('common.clear')}\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t{documentType === 'received' && (\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\t\tsx={{ mr: 2, height: '100%' }}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{isSmallScreen ? null : t('common.refresh')}\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t\t{documentType === 'drafts' && (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\t\t\tsx={{ mr: 2, height: '100%' }}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{isSmallScreen ? null : t('common.refresh')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\t\t\tsx={{ mr: 2, height: '100%' }}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{isSmallScreen ? null : t('common.delete')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t\t{showSignButton && !isAuthWithPassword && (\r\n\t\t\t\t\t setShowSignMessage(true)}\r\n\t\t\t\t\t\tloading={disabledState}\r\n\t\t\t\t\t\tloadingPosition='end'\r\n\t\t\t\t\t\tendIcon={}\r\n\t\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\tmr: 2,\r\n\t\t\t\t\t\t\theight: '100%',\r\n\t\t\t\t\t\t\ttransition: 'all 0.3s ease',\r\n\t\t\t\t\t\t\t'&:hover': {\r\n\t\t\t\t\t\t\t\tborderColor: 'green',\r\n\t\t\t\t\t\t\t\tboxShadow: '0 0 10px rgba(0, 255, 0, 0.5)'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{isSmallScreen ? null : t('common.sign')}\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t\t{documentType === 'deleted' && !isAuthWithPassword && (\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\t\tsx={{ mr: 2, height: '100%' }}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{isSmallScreen ? null : t('common.delete_forever')}\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n","import React from 'react'\r\nimport { Box, Pagination, MenuItem, Select, Typography } from '@mui/material'\r\nimport { useTheme } from '@mui/material/styles'\r\n\r\nconst CustomPaginationTop = ({\r\n\ttotalDocs,\r\n\trowsPerPage,\r\n\tpage,\r\n\thandleChangePage,\r\n\thandleChangeRowsPerPage,\r\n\tpageTitle,\r\n\tpageTitleIcon\r\n}) => {\r\n\tconst theme = useTheme()\r\n\tconst totalPages = Math.ceil(totalDocs / rowsPerPage)\r\n\r\n\tconst handlePageChange = (event, value) => {\r\n\t\thandleChangePage(event, value - 1)\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t{pageTitle}\r\n\t\t\t\t\r\n\t\t\t\t\t{pageTitleIcon}\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{[10, 20, 30, rowsPerPage > 30 ? rowsPerPage : 50].map(option => (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{option}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default CustomPaginationTop\r\n","import { Box, Pagination, MenuItem, Select, Typography } from '@mui/material'\r\nimport { useTheme } from '@mui/material/styles'\r\nimport { useTranslation } from 'react-i18next'\r\n\r\nconst CustomPaginationBottom = ({ totalDocs, rowsPerPage, page, handleChangePage, handleChangeRowsPerPage }) => {\r\n\tconst { t } = useTranslation()\r\n\tconst theme = useTheme()\r\n\tconst totalPages = Math.ceil(totalDocs / rowsPerPage)\r\n\r\n\tconst handlePageChange = (event, value) => {\r\n\t\thandleChangePage(event, value - 1)\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{t('ROWS_PER_PAGE')}:\r\n\t\t\t\t\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t{[10, 20, 30, rowsPerPage > 30 ? rowsPerPage : 50].map(option => (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{option}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t))}\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default CustomPaginationBottom\r\n","import React, { useCallback, useEffect, useState } from 'react'\r\nimport { listOfFilterDocuments } from '../../../data/lists'\r\nimport { useTranslation } from 'react-i18next'\r\nimport {\r\n\tBox,\r\n\tButton,\r\n\tPopover,\r\n\tFormControl,\r\n\tInputLabel,\r\n\tSelect,\r\n\tMenuItem,\r\n\tSelectChangeEvent,\r\n\tStack,\r\n\tTextField,\r\n\tTypography,\r\n\tBadge,\r\n\tListSubheader,\r\n\tuseMediaQuery\r\n} from '@mui/material'\r\nimport { useAppDispatch, useAppSelector } from '../../../hooks/redux'\r\nimport { filterSlice, IFilter } from '../../../redux/reducers/FilterReducer'\r\nimport { fShortDashedDate } from '../../../utils/formatTime'\r\nimport { appSlice } from '../../../redux/reducers/AppReducer'\r\nimport { fetchDocCounts } from '../../../redux/actions/DocumentsActions'\r\nimport { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'\r\nimport { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'\r\nimport { DatePicker } from '@mui/x-date-pickers/DatePicker'\r\nimport { Icon } from '@iconify/react'\r\nimport ru from 'dayjs/locale/ru'\r\nimport uz from 'dayjs/locale/uz'\r\nimport i18n from 'i18next'\r\nimport { useTheme } from '@mui/material/styles'\r\n\r\nconst DocumentsFilter: React.FC = () => {\r\n\tconst { t } = useTranslation()\r\n\tconst theme = useTheme()\r\n\tconst dispatch = useAppDispatch()\r\n\tconst { filter } = useAppSelector(state => state.filterReducer)\r\n\tconst scaled = useAppSelector(state => state.appReducer.scaled)\r\n\tconst [isFilterActive, setIsFilterActive] = useState(false)\r\n\tconst [docCategory, setDocCategory] = useState(filter.docType)\r\n\tconst [anchorEl, setAnchorEl] = useState(null)\r\n\tconst [contractDate, setContractDate] = useState(filter.contractDate)\r\n\r\n\tconst [minDate, setMinDate] = useState(null)\r\n\tconst [maxDate, setMaxDate] = useState(null)\r\n\r\n\tconst [tin, setTin] = useState(filter.tin)\r\n\tconst [num, setNum] = useState(filter.number)\r\n\tconst [contractNum, setContractNum] = useState(filter.contractNumber)\r\n\tconst isSmallScreen = useMediaQuery(theme.breakpoints.down('lg'))\r\n\r\n\tuseEffect(() => {\r\n\t\tsetDocCategory(filter.docType)\r\n\t\tsetTin(filter.tin)\r\n\t\tsetNum(filter.number)\r\n\t\tsetMinDate(filter.minDate ? new Date(filter.minDate) : null)\r\n\t\tsetMaxDate(filter.maxDate ? new Date(filter.maxDate) : null)\r\n\t\tsetContractDate(filter.contractDate ? new Date(filter.contractDate) : null)\r\n\t\tsetContractNum(filter.contractNumber)\r\n\r\n\t\tif (\r\n\t\t\tfilter.docType !== 'all' ||\r\n\t\t\t!!filter.tin ||\r\n\t\t\t!!filter.number ||\r\n\t\t\tfilter.minDate ||\r\n\t\t\tfilter.maxDate ||\r\n\t\t\tfilter.contractDate ||\r\n\t\t\tfilter.contractNumber\r\n\t\t) {\r\n\t\t\tsetIsFilterActive(true)\r\n\t\t} else {\r\n\t\t\tsetIsFilterActive(false)\r\n\t\t}\r\n\t}, [filter])\r\n\r\n\tconst handleClick = (event: React.MouseEvent) => {\r\n\t\tsetAnchorEl(event.currentTarget)\r\n\t}\r\n\tconst handleClose = () => {\r\n\t\tsetAnchorEl(null)\r\n\t}\r\n\r\n\tconst size = useCallback(() => {\r\n\t\treturn scaled ? 'medium' : 'small'\r\n\t}, [scaled])\r\n\r\n\tconst handleDocCategoryChange = (event: SelectChangeEvent) => {\r\n\t\tsetDocCategory(event.target.value)\r\n\t}\r\n\r\n\tconst handleContractDateChange = (newValue: Date | null) => {\r\n\t\tsetContractDate(newValue)\r\n\t}\r\n\r\n\tconst handleMinDateChange = (newValue: Date | null) => {\r\n\t\tsetMinDate(newValue)\r\n\t}\r\n\r\n\tconst handleMaxDateChange = (newValue: Date | null) => {\r\n\t\tsetMaxDate(newValue)\r\n\t}\r\n\r\n\tconst filterPopover = Boolean(anchorEl)\r\n\tconst id = filterPopover ? 'filter-popover' : undefined\r\n\r\n\tconst setupFilter = () => {\r\n\t\tconst filterObject: IFilter = {\r\n\t\t\tdocType: docCategory,\r\n\t\t\ttin,\r\n\t\t\tnumber: num,\r\n\t\t\tminDate: minDate ? fShortDashedDate(minDate) : null,\r\n\t\t\tmaxDate: maxDate ? fShortDashedDate(maxDate) : null,\r\n\t\t\tcontractDate: contractDate ? fShortDashedDate(contractDate) : null,\r\n\t\t\tcontractNumber: contractNum\r\n\t\t}\r\n\t\tdispatch(filterSlice.actions.setFilter(filterObject))\r\n\t\tdispatch(\r\n\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\ttype: 'info',\r\n\t\t\t\tmessage: t('alertTitles.filterAct'),\r\n\t\t\t\tshow: true\r\n\t\t\t})\r\n\t\t)\r\n\t\tdispatch(fetchDocCounts(docCategory))\r\n\t\tsetIsFilterActive(true)\r\n\t\thandleClose()\r\n\t}\r\n\r\n\tconst dropFilter = async () => {\r\n\t\tdispatch(filterSlice.actions.resetFilter())\r\n\t\tdispatch(\r\n\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\ttype: 'warning',\r\n\t\t\t\tmessage: t('alertTitles.filterClear'),\r\n\t\t\t\tshow: true\r\n\t\t\t})\r\n\t\t)\r\n\t\tsetDocCategory('all')\r\n\t\tsetTin('')\r\n\t\tsetNum('')\r\n\t\tsetMaxDate(null)\r\n\t\tsetMinDate(null)\r\n\t\tsetContractNum('')\r\n\t\tsetContractDate(null)\r\n\t\tsetIsFilterActive(false)\r\n\t\tawait dispatch(fetchDocCounts('all'))\r\n\t\thandleClose()\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{isSmallScreen ? null : t('common.filter')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t{isFilterActive ? (\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcolor='error'\r\n\t\t\t\t\t\t\tonClick={event => {\r\n\t\t\t\t\t\t\t\tevent.stopPropagation()\r\n\t\t\t\t\t\t\t\tdropFilter()\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\tpadding: 1,\r\n\t\t\t\t\t\t\t\tlineHeight: 0,\r\n\t\t\t\t\t\t\t\theight: '100%',\r\n\t\t\t\t\t\t\t\ttextTransform: 'none',\r\n\t\t\t\t\t\t\t\tposition: 'relative',\r\n\t\t\t\t\t\t\t\t'&::before': {\r\n\t\t\t\t\t\t\t\t\tcontent: '\"\"',\r\n\t\t\t\t\t\t\t\t\tposition: 'absolute',\r\n\t\t\t\t\t\t\t\t\tleft: 0,\r\n\t\t\t\t\t\t\t\t\ttop: '25%',\r\n\t\t\t\t\t\t\t\t\theight: '50%',\r\n\t\t\t\t\t\t\t\t\twidth: '1px',\r\n\t\t\t\t\t\t\t\t\tbackgroundColor: 'currentColor'\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{isSmallScreen ? null : t('common.clear')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t''\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t{t('common.filterBy')}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{t('DOCS_TABLE.DOCUMENT_TYPE')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{listOfFilterDocuments\r\n\t\t\t\t\t\t\t\t\t.filter(doc => doc.name === 'all')\r\n\t\t\t\t\t\t\t\t\t.map(item => (\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{t(`DOCUMENT_CATEGORIES.${item.name}`)}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{'Глобальные документы'}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{listOfFilterDocuments.map(doc => {\r\n\t\t\t\t\t\t\t\t\tif (!['all', 'universal', 'invoice', 'actGoodsAcceptance'].includes(doc.name)) {\r\n\t\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t{t(`DOCUMENT_CATEGORIES.${doc.name}`)}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{'Локальные документы'}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{listOfFilterDocuments.map(doc => {\r\n\t\t\t\t\t\t\t\t\tif (['universal', 'invoice', 'actGoodsAcceptance'].includes(doc.name)) {\r\n\t\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t{t(`DOCUMENT_CATEGORIES.${doc.name}`)}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t setTin(event.target.value)} size={size()} />\r\n\t\t\t\t\t\t setNum(event.target.value)}\r\n\t\t\t\t\t\t\tsize={size()}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcolor='error'\r\n\t\t\t\t\t\t\tonClick={dropFilter}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{t('common.clear')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tonClick={setupFilter}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{t('common.apply')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default React.memo(DocumentsFilter)\r\n","import ReactDOM from 'react-dom'\r\nimport {\r\n\tBox,\r\n\tButton,\r\n\tPopover,\r\n\tStack,\r\n\tTextField,\r\n\tTypography,\r\n\tAlert,\r\n\tLinearProgress,\r\n\tSlide,\r\n\tFade,\r\n\tuseMediaQuery\r\n} from '@mui/material'\r\nimport useToggle from '../../../hooks/useToggle'\r\nimport React, { useEffect, useRef, useState } from 'react'\r\nimport useId from '@mui/utils/useId'\r\nimport { Icon } from '@iconify/react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useAppDispatch } from '../../../hooks/redux'\r\nimport { appSlice } from '../../../redux/reducers/AppReducer'\r\nimport { fetchGetDocumentFromRouming } from '../../../redux/actions/DocumentsActions'\r\nimport { useTheme } from '@mui/material/styles'\r\n\r\nconst GetDocumentFromRouming = () => {\r\n\tconst open = useToggle(false)\r\n\tconst anchor = useRef(null)\r\n\tconst inputRef = useRef(null)\r\n\tconst tinRef = useRef(null)\r\n\tconst fileInputRef = useRef(null)\r\n\tconst id = useId()\r\n\tconst { t } = useTranslation()\r\n\tconst theme = useTheme()\r\n\tconst dispatch = useAppDispatch()\r\n\tconst isSmallScreen = useMediaQuery(theme.breakpoints.down('lg'))\r\n\r\n\t// Стейт для выбора режима\r\n\tconst [mode, setMode] = useState('id')\r\n\r\n\t// Стейт для хранения количества успешно загруженных документов\r\n\tconst [successfulUploads, setSuccessfulUploads] = useState(null)\r\n\r\n\t// Стейт для отслеживания состояния загрузки\r\n\tconst [loading, setLoading] = useState(false)\r\n\r\n\t// Стейт для отслеживания прогресса загрузки\r\n\tconst [progress, setProgress] = useState(0)\r\n\r\n\t// Функция для загрузки документа по ID\r\n\tconst getDocument = async () => {\r\n\t\tif (!tinRef.current?.value.trim()) return\r\n\t\tif (!inputRef.current?.value.trim()) {\r\n\t\t\tdispatch(appSlice.actions.toggleSystemAlert({ message: t('GET_DOCUMENT_ID_EMPTY'), type: 'warning', show: true }))\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\tsetLoading(true) // Запускаем процесс загрузки\r\n\t\tconst res = await fetchGetDocumentFromRouming(tinRef.current?.value, inputRef.current.value)\r\n\t\tif (res?.status === 200) {\r\n\t\t\tdispatch(appSlice.actions.toggleSystemAlert({ message: t('GET_DOCUMENT_SUCCESS'), type: 'success', show: true }))\r\n\t\t\topen.off()\r\n\t\t\tsetSuccessfulUploads(1) // Один документ обновлен\r\n\t\t} else {\r\n\t\t\tdispatch(appSlice.actions.toggleSystemAlert({ message: t(res?.data.errors.msg), type: 'error', show: true }))\r\n\t\t}\r\n\t\tsetLoading(false) // Завершаем процесс загрузки\r\n\t}\r\n\r\n\t// Функция для обработки загруженного файла CSV\r\n\tconst handleFileUpload = (event: React.ChangeEvent) => {\r\n\t\tconst file = event.target.files?.[0]\r\n\t\tif (file) {\r\n\t\t\tconst reader = new FileReader()\r\n\t\t\treader.onload = async e => {\r\n\t\t\t\tconst text = e.target?.result\r\n\t\t\t\tif (typeof text === 'string') {\r\n\t\t\t\t\t// Конвертация данных\r\n\t\t\t\t\tconst decoder = new TextDecoder('windows-1251')\r\n\t\t\t\t\tconst encodedText = new Uint8Array(text.split('').map(char => char.charCodeAt(0)))\r\n\t\t\t\t\tconst decodedText = decoder.decode(encodedText)\r\n\r\n\t\t\t\t\t// Парсинг CSV\r\n\t\t\t\t\tconst rows = decodedText.split('\\n')\r\n\t\t\t\t\tlet processedCount = 0 // Количество успешно загруженных документов\r\n\r\n\t\t\t\t\tsetLoading(true) // Запускаем процесс загрузки\r\n\t\t\t\t\tfor (let index = 1; index < rows.length; index++) {\r\n\t\t\t\t\t\tconst row = rows[index]\r\n\t\t\t\t\t\tif (!row.trim()) continue // Пропустить пустые строки\r\n\t\t\t\t\t\tconst columns = row.split(';')\r\n\t\t\t\t\t\tconst id = columns[1]?.trim()\r\n\t\t\t\t\t\tconst tin = columns[6]?.trim()\r\n\t\t\t\t\t\tif (id && tin) {\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tconst res = await fetchGetDocumentFromRouming(tin, id)\r\n\r\n\t\t\t\t\t\t\t\tif (res?.status === 200) {\r\n\t\t\t\t\t\t\t\t\tprocessedCount++ // Увеличиваем счетчик успешных запросов\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} catch (error) {\r\n\t\t\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\t\t\t\tmessage: t('GET_DOCUMENT_REQUEST_FAILED'),\r\n\t\t\t\t\t\t\t\t\t\ttype: 'error',\r\n\t\t\t\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tsetProgress(((index + 1) / rows.length) * 100) // Обновляем прогресс\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsetLoading(false) // Завершаем процесс загрузки\r\n\t\t\t\t\tsetSuccessfulUploads(processedCount) // Устанавливаем количество загруженных документов\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treader.readAsBinaryString(file)\r\n\t\t}\r\n\t}\r\n\tuseEffect(() => {\r\n\t\tif (successfulUploads !== null) {\r\n\t\t\tconst timer = setTimeout(() => {\r\n\t\t\t\tsetSuccessfulUploads(null) // Скрыть уведомление\r\n\t\t\t}, 30000) // 30 секунд\r\n\r\n\t\t\treturn () => clearTimeout(timer) // Очистка таймера при размонтировании\r\n\t\t}\r\n\t}, [successfulUploads])\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t open.on()}\r\n\t\t\t\tvariant='outlined'\r\n\t\t\t\tsize='large'\r\n\t\t\t\t// color='warning'\r\n\t\t\t\taria-describedby={id}\r\n\t\t\t\tendIcon={}\r\n\t\t\t\tsx={{\r\n\t\t\t\t\tpaddingLeft: isSmallScreen ? 0 : 1,\r\n\t\t\t\t\tpaddingRight: 1,\r\n\t\t\t\t\tlineHeight: 1,\r\n\t\t\t\t\theight: '100%',\r\n\t\t\t\t\ttextTransform: 'none',\r\n\t\t\t\t\tcolor: theme.palette.grey[600],\r\n\t\t\t\t\t// @ts-ignore\r\n\t\t\t\t\tborderColor: theme.palette.background.icons\r\n\t\t\t\t}}\r\n\t\t\t>\r\n\t\t\t\t{isSmallScreen ? null : t('GET_DOCUMENT')}\r\n\t\t\t\r\n\t\t\t open.off()}\r\n\t\t\t\tanchorEl={anchor.current}\r\n\t\t\t\tanchorOrigin={{\r\n\t\t\t\t\tvertical: 'top',\r\n\t\t\t\t\thorizontal: 'left'\r\n\t\t\t\t}}\r\n\t\t\t>\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t{/* выбор режима */}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{t('CHOOSE_MODE')}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t{/* Если выбран режим загрузки по ID */}\r\n\t\t\t\t\t{mode === 'id' && (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t{/* Если выбран режим загрузки файла*/}\r\n\t\t\t\t\t{mode === 'file' && (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t{/* Уведомление о количестве успешно загруженных документов */}\r\n\t\t\t{ReactDOM.createPortal(\r\n\t\t\t\t\r\n\t\t\t\t\t setSuccessfulUploads(null)}\r\n\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\tposition: 'fixed',\r\n\t\t\t\t\t\t\tbottom: 16,\r\n\t\t\t\t\t\t\tright: 16,\r\n\t\t\t\t\t\t\tboxShadow: '0px 4px 12px rgba(0, 0, 0, 0.4)',\r\n\t\t\t\t\t\t\tfontSize: '1.1rem',\r\n\t\t\t\t\t\t\tpadding: '20px',\r\n\t\t\t\t\t\t\twidth: '350px',\r\n\t\t\t\t\t\t\tborderRadius: '10px',\r\n\t\t\t\t\t\t\tbackgroundColor: 'rgba(255, 255, 255, 0.8)',\r\n\t\t\t\t\t\t\tcolor: '#333',\r\n\t\t\t\t\t\t\tborder: '1px solid rgba(0, 0, 0, 0.2)',\r\n\t\t\t\t\t\t\tzIndex: 20000\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{t('DOCUMENT_COUNT', { count: successfulUploads ?? 0 })}\r\n\t\t\t\t\t\r\n\t\t\t\t,\r\n\t\t\t\tdocument.body\r\n\t\t\t)}\r\n\r\n\t\t\t{/* Уведомление о процессе загрузки */}\r\n\t\t\t{ReactDOM.createPortal(\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{t('LOADING_PROCESS')} {Math.round(progress)}%\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t,\r\n\t\t\t\tdocument.body\r\n\t\t\t)}\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default GetDocumentFromRouming\r\n","export default __webpack_public_path__ + \"static/media/sample.68e72f99.xlsx\";","export default __webpack_public_path__ + \"static/media/template.654c0bd9.xlsx\";","import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\r\nimport './index.scss'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { filter } from 'lodash'\r\n// hooks\r\nimport { useAppDispatch, useAppSelector } from '../../../hooks/redux'\r\nimport { useProfileGetter } from '../../../hooks/useProfile'\r\nimport { useCopy } from '../../../hooks/useCopy'\r\nimport useToggle from '../../../hooks/useToggle'\r\n// redux\r\nimport { appSlice } from '../../../redux/reducers/AppReducer'\r\nimport { appendSign, signData } from '../../../redux/actions/EimzoActions'\r\nimport { fetchProfileType } from '../../../redux/actions/ProfileActions'\r\nimport { uploadXlsx } from '../../../redux/actions/DocumentsActions'\r\nimport { groupActionsSlice } from '../../../redux/reducers/GroupActionsReducer'\r\nimport {\r\n\tfetchDeleteDocument,\r\n\tfetchDocCounts,\r\n\tfetchDocument,\r\n\tfetchDocuments,\r\n\tfetchEraseDocument,\r\n\tfetchSignDocument,\r\n\tfetchSignedFile,\r\n\tfetchRefreshDocument,\r\n\tfetchEditDocument,\r\n\tfetchWaybillLocalSign,\r\n\tfetchWaybillLocalMethods\r\n} from '../../../redux/actions/DocumentsActions'\r\n// material\r\nimport { useTheme } from '@mui/material/styles'\r\nimport { useConfirm } from 'material-ui-confirm'\r\nimport { TransitionProps } from '@mui/material/transitions'\r\nimport { MaterialReactTable, MRT_Row, type MRT_RowSelectionState } from 'material-react-table'\r\nimport {\r\n\tAlert,\r\n\tBox,\r\n\tButton,\r\n\tDialog,\r\n\tDialogActions,\r\n\tDialogContent,\r\n\tDialogContentText,\r\n\tDialogTitle,\r\n\tIconButton,\r\n\tSlide,\r\n\tTooltip,\r\n\tBadge,\r\n\tTypography,\r\n\tuseMediaQuery,\r\n\tCircularProgress\r\n} from '@mui/material'\r\n// components\r\nimport DetailPanel from './DetailPanel'\r\nimport { UserListToolbar } from '../../_dashboard/user'\r\nimport { useNavigate, useParams } from 'react-router-dom'\r\nimport { listOfDocumentCategories } from '../../../data/lists'\r\nimport { statusColors } from './DetailPanel'\r\nimport CustomPaginationTop from './CustomPaginationTop'\r\nimport CustomPaginationBottom from './CustomPaginationBottom'\r\nimport DocumentsFilter from '../documentsFilter/DocumentsFilter'\r\nimport GetDocumentFromRouming from '../getDocumentFromRouming/GetDocumentFromRouming'\r\n// utils\r\nimport i18n from 'i18next'\r\nimport { format } from 'date-fns'\r\nimport { fCurrencySpace } from '../../../utils/formatNumber'\r\nimport { buildPayloadPagination } from '../../../utils/requests'\r\nimport { fShortDate, fShortDatePerDay } from '../../../utils/formatTime'\r\n// icons\r\nimport { Icon, IconifyIcon } from '@iconify/react'\r\nimport upload from '@iconify/icons-carbon/upload'\r\nimport download from '@iconify/icons-carbon/download'\r\nimport showMoreIcon from '@iconify/icons-ant-design/caret-down-filled'\r\nimport showLessIcon from '@iconify/icons-ant-design/caret-up-filled'\r\nimport rejected from '@iconify/icons-carbon/document-subtract'\r\nimport signed from '@iconify/icons-carbon/document-signed'\r\nimport RefreshIcon from '@mui/icons-material/Refresh'\r\nimport AddIcon from '@mui/icons-material/Add'\r\nimport PriorityHighIcon from '@mui/icons-material/PriorityHigh'\r\nimport imported from '@iconify/icons-carbon/document-import'\r\nimport exported from '@iconify/icons-carbon/document-export'\r\nimport preliminary from '@iconify/icons-carbon/document-preliminary'\r\nimport draft from '@iconify/icons-carbon/document-unknown'\r\n// @ts-ignore\r\nimport sampleXlsx from '../../../static/xlsx/factura/sample.xlsx'\r\n// @ts-ignore\r\nimport templateXlsx from '../../../static/xlsx/factura/template.xlsx'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nfunction descendingComparator(a: any, b: any, orderBy: any) {\r\n\tif (b[orderBy] < a[orderBy]) {\r\n\t\treturn -1\r\n\t}\r\n\tif (b[orderBy] > a[orderBy]) {\r\n\t\treturn 1\r\n\t}\r\n\treturn 0\r\n}\r\n\r\nfunction getComparator(order: any, orderBy: any) {\r\n\treturn order === 'desc'\r\n\t\t? (a: any, b: any) => descendingComparator(a, b, orderBy)\r\n\t\t: (a: any, b: any) => -descendingComparator(a, b, orderBy)\r\n}\r\n\r\nfunction applySortFilter(array: any, comparator: any, query: any) {\r\n\tif (!Array.isArray(array)) return\r\n\tconst stabilizedThis = array.map((el: any, index: any) => [el, index])\r\n\tstabilizedThis.sort((a: any, b: any) => {\r\n\t\tconst order = comparator(a[0], b[0])\r\n\t\tif (order !== 0) return order\r\n\t\treturn a[1] - b[1]\r\n\t})\r\n\tif (query) {\r\n\t\treturn filter(array, _user => _user.name.toLowerCase().indexOf(query.toLowerCase()) !== -1)\r\n\t}\r\n\treturn stabilizedThis.map((el: any) => el[0])\r\n}\r\n\r\nconst Transition = React.forwardRef(function Transition(\r\n\tprops: TransitionProps & {\r\n\t\tchildren: React.ReactElement\r\n\t},\r\n\tref: React.Ref\r\n) {\r\n\treturn \r\n})\r\n\r\nconst getIcon = (name: IconifyIcon) => \r\n\r\ninterface IIConsList {\r\n\t[index: string]: IconifyIcon\r\n}\r\n\r\nconst titleIconsList: IIConsList = {\r\n\treceived: imported,\r\n\trejected: rejected,\r\n\tsigned: signed,\r\n\tsended: exported,\r\n\tdeleted: preliminary,\r\n\tdrafts: draft\r\n}\r\n\r\nconst waybillLocalActions: Record = {\r\n\t110: 'accept',\r\n\t140: 'give',\r\n\t160: 'accept',\r\n\t150: 'return',\r\n\t190: 'return'\r\n}\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst DocumentsPreviewTable: React.FC = () => {\r\n\tconst { type, io, status } = useParams()\r\n\tconst { t } = useTranslation()\r\n\tconst theme = useTheme()\r\n\tconst disabled = useToggle(false)\r\n\tconst dispatch = useAppDispatch()\r\n\tconst navigate = useNavigate()\r\n\tconst confirm = useConfirm()\r\n\tconst successfullSignedRef = useRef()\r\n\r\n\tconst signButton = useToggle(false)\r\n\tconst eraseButton = useToggle(false)\r\n\tconst [page, setPage] = useState(0)\r\n\tconst [showSignMessage, setShowSignMessage] = useState(false)\r\n\tconst [order, setOrder] = useState('asc')\r\n\tconst [orderBy, setOrderBy] = useState('name')\r\n\tconst [rowsPerPage, setRowsPerPage] = useState(20)\r\n\tconst [open, setOpen] = useState({\r\n\t\topened: false,\r\n\t\tid: '',\r\n\t\ttype: ''\r\n\t})\r\n\tconst freeze = useToggle(false)\r\n\tconst [successfullSigned, setSuccessfullSigned] = useState(0)\r\n\tconst dialogContentRef = useRef(null)\r\n\r\n\tconst { docs, totalDocs, tableLoading } = useAppSelector(state => state.documentsReducer)\r\n\tconst { filter: filterReducer } = useAppSelector(state => state.filterReducer)\r\n\tconst profile = useProfileGetter.useGetProfile()\r\n\tconst { token } = profile || { token: null }\r\n\tconst keyId = profile?.keyId || ''\r\n\r\n\tconst { processingRow, processingRowsError, processingRowsSuccess, processingRowsErrorDialog } = useAppSelector(\r\n\t\tstate => state.groupActionsReducer\r\n\t)\r\n\tconst { copyToClipboard } = useCopy()\r\n\tconst [selected, setSelected] = useState([])\r\n\tconst [rowSelection, setRowSelection] = useState({})\r\n\tconst [openSampleDialog, setOpenSampleDialog] = useState(false)\r\n\tconst [processingRowsErrorDialogOpen, setProcessingRowsErrorDialogOpen] = useState(false)\r\n\r\n\tuseEffect(() => {\r\n\t\tsetSelected(Object.keys(rowSelection))\r\n\t}, [rowSelection])\r\n\r\n\tconst translateTableHead = (name: string) => {\r\n\t\treturn t('DOCS_TABLE_HEADERS.' + name)\r\n\t}\r\n\r\n\tconst handleClickOpen = (id: string, type: string) => {\r\n\t\tsetOpen({ opened: true, id: id, type: type })\r\n\t}\r\n\r\n\tconst handleClose = () => {\r\n\t\tif (showSignMessage) {\r\n\t\t\tsetShowSignMessage(false)\r\n\t\t} else {\r\n\t\t\tsetOpen({ opened: false, id: '', type: '' })\r\n\t\t}\r\n\t}\r\n\r\n\tconst handleChangePage = (event: React.MouseEvent | null, newPage: number) => {\r\n\t\tsetPage(newPage)\r\n\t}\r\n\r\n\tconst handleChangeRowsPerPage = (event: React.ChangeEvent) => {\r\n\t\tsetRowsPerPage(parseInt(event.target.value, 10))\r\n\t\tconst rows = parseInt(event.target.value).toString()\r\n\t\tlocalStorage.setItem('rowsPerPage', rows)\r\n\t\tsetPage(0)\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tconst rows = JSON.parse(localStorage.getItem('rowsPerPage') || '{}')\r\n\t\tif (rows > 1) {\r\n\t\t\tsetRowsPerPage(rows)\r\n\t\t}\r\n\t}, [])\r\n\r\n\tconst filteredUsers = applySortFilter(docs, getComparator(order, orderBy), '')\r\n\r\n\tconst redirectToEditDocument = (document: any, corrected?: boolean) => {\r\n\t\tconst props = { state: { corrected } }\r\n\t\tnavigate(`/edit/${document.type}/${document._id}`, { state: props })\r\n\t}\r\n\r\n\tconst refreshDocuments = async () => {\r\n\t\tif (!selected.length) return\r\n\t\tfor await (let docId of selected) {\r\n\t\t\tdispatch(groupActionsSlice.actions.setProcessingRow(docId))\r\n\t\t\tconst foundDoc = filteredUsers?.find((doc: any) => doc._id === docId)\r\n\t\t\tconst respStatus = await refreshDocument(foundDoc)\r\n\r\n\t\t\tif (respStatus.status === 200 || foundDoc._id === respStatus) {\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tgroupActionsSlice.actions.setProcessingRowsSuccess({\r\n\t\t\t\t\t\t[foundDoc._id]: 'refresh'\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t} else {\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tgroupActionsSlice.actions.setProcessingRowsError({\r\n\t\t\t\t\t\t[foundDoc._id]: respStatus?.data.errors?.msg || 'Unknown error'\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t}\r\n\t\tsetSelected([])\r\n\t\tsetRowSelection({})\r\n\t\tdispatch(groupActionsSlice.actions.clearProcessingRow())\r\n\t}\r\n\r\n\tconst refreshDocument = async (item: any) => {\r\n\t\tlet respStatus = null\r\n\t\ttry {\r\n\t\t\tdisabled.on()\r\n\t\t\tconst doc = await fetchDocument(item.type, item._id)\r\n\t\t\trespStatus = doc?._id\r\n\r\n\t\t\tif (doc.type === 'factura' && doc.status === 'drafts') {\r\n\t\t\t\tlet newDocument = JSON.parse(JSON.stringify(doc))\r\n\t\t\t\tlet sellerVatRegStatus = await fetchProfileType(doc.data.sellertin, format(new Date(Date.now()), 'yyyy-MM-dd'))\r\n\t\t\t\tnewDocument.data.seller.vatregstatus = sellerVatRegStatus?.data.data.code\r\n\t\t\t\tif (doc.data.buyertin) {\r\n\t\t\t\t\tlet buyerVatRegStatus = await fetchProfileType(doc.data.buyertin, format(new Date(Date.now()), 'yyyy-MM-dd'))\r\n\t\t\t\t\tnewDocument.data.buyer.vatregstatus = buyerVatRegStatus?.data.data.code\r\n\t\t\t\t}\r\n\t\t\t\trespStatus = await fetchEditDocument(newDocument.type, newDocument._id, newDocument.data)\r\n\t\t\t}\r\n\t\t\tdisabled.off()\r\n\t\t} catch (e) {\r\n\t\t\tconsole.log(e)\r\n\t\t}\r\n\t\treturn respStatus\r\n\t}\r\n\r\n\tconst refreshReceived = async () => {\r\n\t\tif (!selected.length) return\r\n\t\tconst refreshReceivedDoc = async () => {\r\n\t\t\ttry {\r\n\t\t\t\tfor await (let docId of selected) {\r\n\t\t\t\t\tdispatch(groupActionsSlice.actions.setProcessingRow(docId))\r\n\t\t\t\t\tlet res = null\r\n\t\t\t\t\tconst foundDoc = filteredUsers?.find((item: any) => item._id === docId)\r\n\t\t\t\t\tif (!['universal', 'actGoodsAcceptance', 'invoice'].includes(foundDoc.type)) {\r\n\t\t\t\t\t\tres = await fetchRefreshDocument(foundDoc.type, foundDoc._id, false)\r\n\r\n\t\t\t\t\t\tif (res?.status === 200) {\r\n\t\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\t\tgroupActionsSlice.actions.setProcessingRowsSuccess({\r\n\t\t\t\t\t\t\t\t\t[foundDoc._id]: 'refresh'\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\t\tgroupActionsSlice.actions.setProcessingRowsError({\r\n\t\t\t\t\t\t\t\t\t[foundDoc._id]: res?.data.errors?.msg || 'Unknown error'\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\tgroupActionsSlice.actions.setProcessingRowsSuccess({\r\n\t\t\t\t\t\t\t\t[foundDoc._id]: 'refreshNoNeed'\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (e) {\r\n\t\t\t\tconsole.log(e)\r\n\t\t\t}\r\n\t\t}\r\n\t\tdisabled.on()\r\n\t\tawait refreshReceivedDoc()\r\n\t\tsetSelected([])\r\n\t\tsetRowSelection({})\r\n\t\tdispatch(groupActionsSlice.actions.clearProcessingRow())\r\n\t\tdisabled.off()\r\n\t}\r\n\r\n\tconst deleteDocuments = async () => {\r\n\t\tawait confirm({\r\n\t\t\ttitle: `${t('alertTitles.warning')} !`,\r\n\t\t\tdescription: `${t('DOCUMENT_DELETE_BODY')}`,\r\n\t\t\tcancellationText: t('NO'),\r\n\t\t\tconfirmationText: t('YES')\r\n\t\t})\r\n\t\t\t.then(async () => {\r\n\t\t\t\tdisabled.on()\r\n\t\t\t\tfor await (let docId of selected) {\r\n\t\t\t\t\tdispatch(groupActionsSlice.actions.setProcessingRow(docId))\r\n\t\t\t\t\tconst foundDoc = filteredUsers?.find((item: any) => item._id === docId)\r\n\t\t\t\t\tconst res = await fetchDeleteDocument(foundDoc.type, foundDoc._id)\r\n\r\n\t\t\t\t\tif (res?.status === 200) {\r\n\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\tgroupActionsSlice.actions.setProcessingRowsSuccess({\r\n\t\t\t\t\t\t\t\t[foundDoc._id]: 'delete'\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\tgroupActionsSlice.actions.setProcessingRowsError({\r\n\t\t\t\t\t\t\t\t[foundDoc._id]: res?.data.errors?.msg || 'Unknown error'\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tsetSelected([])\r\n\t\t\t\tsetRowSelection({})\r\n\t\t\t\tdisabled.off()\r\n\t\t\t})\r\n\t\t\t.catch()\r\n\t}\r\n\r\n\tconst eraseDocuments = async () => {\r\n\t\tawait confirm({\r\n\t\t\ttitle: `${t('alertTitles.warning')} !`,\r\n\t\t\tdescription: `${t('DELETE_SELECTED')} ${selected.length}`,\r\n\t\t\tcancellationText: t('NO'),\r\n\t\t\tconfirmationText: t('YES')\r\n\t\t})\r\n\t\t\t.then(async () => {\r\n\t\t\t\tdisabled.on()\r\n\t\t\t\tfor await (let docId of selected) {\r\n\t\t\t\t\tdispatch(groupActionsSlice.actions.setProcessingRow(docId))\r\n\t\t\t\t\tconst foundDoc = filteredUsers?.find((item: any) => item._id === docId)\r\n\t\t\t\t\tconst res = await fetchEraseDocument(foundDoc.type, foundDoc._id)\r\n\r\n\t\t\t\t\tif (res?.status === 200) {\r\n\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\tgroupActionsSlice.actions.setProcessingRowsSuccess({\r\n\t\t\t\t\t\t\t\t[foundDoc._id]: 'erase'\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\tgroupActionsSlice.actions.setProcessingRowsError({\r\n\t\t\t\t\t\t\t\t[foundDoc._id]: res?.data.errors?.msg || 'Unknown error'\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tsetSelected([])\r\n\t\t\t\tsetRowSelection({})\r\n\t\t\t\tdisabled.off()\r\n\t\t\t\tdispatch(fetchDocCounts(filterReducer.docType !== 'all' ? filterReducer.docType : 'all'))\r\n\t\t\t})\r\n\t\t\t.catch()\r\n\t}\r\n\r\n\tconst deleteDocument = async (type: string, id: string) => {\r\n\t\ttry {\r\n\t\t\tconst res = await fetchDeleteDocument(type, id)\r\n\t\t\tif (res!.status === 200) {\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\tshow: true,\r\n\t\t\t\t\t\tmessage: t('alertTitles.docDeleted')\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\tconsole.log(e)\r\n\t\t} finally {\r\n\t\t\trefetchDocs()\r\n\t\t\tsetOpen({ opened: false, id: '', type: '' })\r\n\t\t}\r\n\t}\r\n\r\n\tconst options = useMemo(\r\n\t\t() => ({\r\n\t\t\tsortBy: ['createdAt'],\r\n\t\t\tsortDesc: [true],\r\n\t\t\titemsPerPage: rowsPerPage,\r\n\t\t\tpage: page + 1\r\n\t\t}),\r\n\t\t[page, rowsPerPage]\r\n\t)\r\n\r\n\tconst buildSearch = useCallback(() => {\r\n\t\tconst srch: any = {\r\n\t\t\ttype: filterReducer.docType !== 'all' ? filterReducer.docType : type,\r\n\t\t\tio: io,\r\n\t\t\tstatus: status\r\n\t\t}\r\n\r\n\t\tsrch.branch = ''\r\n\t\tif (filterReducer.tin) srch.tin = filterReducer.tin\r\n\t\tif (filterReducer.number) srch.number = filterReducer.number\r\n\t\tif (filterReducer.minDate) srch.dateMin = filterReducer.minDate\r\n\t\tif (filterReducer.maxDate) srch.dateMax = filterReducer.maxDate\r\n\r\n\t\treturn srch\r\n\t}, [{ ...filterReducer }, type, status, io])\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!token) return\r\n\t\tsetSelected([])\r\n\t\tsetRowSelection({})\r\n\t\tsetPage(0)\r\n\t\tif (status === 'deleted') {\r\n\t\t\teraseButton.on()\r\n\t\t} else {\r\n\t\t\teraseButton.off()\r\n\t\t}\r\n\t\t// @ts-ignore\r\n\t\tif (['received', 'drafts'].includes(status)) {\r\n\t\t\tsignButton.on()\r\n\t\t} else {\r\n\t\t\tsignButton.off()\r\n\t\t}\r\n\t}, [type, status, io, filterReducer])\r\n\r\n\tconst refetchDocs = () => {\r\n\t\tif (!token) return\r\n\t\tdispatch(fetchDocuments(buildPayloadPagination(options, buildSearch())))\r\n\t\tdispatch(fetchDocCounts(filterReducer.docType))\r\n\t\tdispatch(groupActionsSlice.actions.clearAllProcessedRows())\r\n\t}\r\n\r\n\tconst showMore = () => {\r\n\t\tsetRowsPerPage(rowsPerPage * 2)\r\n\t\trefetchDocs()\r\n\t}\r\n\r\n\tconst showLess = () => {\r\n\t\tsetRowsPerPage(10)\r\n\t\trefetchDocs()\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tsetSelected([])\r\n\t\tsetRowSelection({})\r\n\t\tdispatch(groupActionsSlice.actions.clearAllProcessedRows())\r\n\t}, [page, rowsPerPage, filterReducer])\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!token) return\r\n\t\trefetchDocs()\r\n\t}, [type, io, status, page, rowsPerPage, filterReducer, token])\r\n\r\n\tconst redirectToClickedDocument = (type: string, id: string) => {\r\n\t\tnavigate(`/open-file/${type}/${id}`, {\r\n\t\t\tstate: { type, status, io }\r\n\t\t})\r\n\t}\r\n\r\n\tconst signDocuments = async () => {\r\n\t\tif (!selected) return\r\n\t\tdisabled.on()\r\n\t\thandleClose()\r\n\t\tfreeze.on()\r\n\r\n\t\tfor await (let docId of selected) {\r\n\t\t\tdispatch(groupActionsSlice.actions.setProcessingRow(docId))\r\n\t\t\t// @ts-ignore\r\n\t\t\tconst foundDoc = filteredUsers.find(doc => doc._id === docId)\r\n\t\t\tconst result = await signDocument(foundDoc, selected.indexOf(docId)).finally(() => {\r\n\t\t\t\tif (selected.length === selected.indexOf(docId) + 1) {\r\n\t\t\t\t\tsetSelected([])\r\n\t\t\t\t\tsetRowSelection({})\r\n\t\t\t\t}\r\n\t\t\t})\r\n\r\n\t\t\tif (result) {\r\n\t\t\t\tif (result.success) {\r\n\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\tgroupActionsSlice.actions.setProcessingRowsSuccess({\r\n\t\t\t\t\t\t\t[docId]: 'sign'\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t)\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\tgroupActionsSlice.actions.setProcessingRowsError({\r\n\t\t\t\t\t\t\t[docId]: result.message || 'Unknown error'\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tdispatch(groupActionsSlice.actions.clearProcessingRow())\r\n\t\tdisabled.off()\r\n\t}\r\n\r\n\tconst signDocument = async (item: any, index: number) => {\r\n\t\tlet signRes = null\r\n\r\n\t\tif (item?.data && !Object.hasOwn(item.data, 'signed') && Object.hasOwn(item.data, 'facturaid') && io === 'in') {\r\n\t\t\tsignRes = await fetchSignedFile(\r\n\t\t\t\titem.type,\r\n\t\t\t\titem._id as string,\r\n\t\t\t\titem.data.buyertin === profile?.tin ? 'buyer' : 'agent'\r\n\t\t\t)\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tlet doc = await fetchDocument(item.type, item._id)\r\n\t\t\tlet pkcs7: any = ''\r\n\t\t\tif (io === 'out' && doc.status === 'drafts' && doc.type === 'empowerment') {\r\n\t\t\t\tif (\r\n\t\t\t\t\tdoc.data.agent.jobtitle != null ||\r\n\t\t\t\t\tdoc.data.agent.passport.dateofissue != null ||\r\n\t\t\t\t\tdoc.data.agent.passport.issuedby != null ||\r\n\t\t\t\t\tdoc.data.agent.passport.number != null\r\n\t\t\t\t) {\r\n\t\t\t\t\tlet newDoc = JSON.parse(JSON.stringify(doc))\r\n\t\t\t\t\tnewDoc.data.agent.jobtitle = null\r\n\t\t\t\t\tnewDoc.data.agent.passport.dateofissue = null\r\n\t\t\t\t\tnewDoc.data.agent.passport.issuedby = null\r\n\t\t\t\t\tnewDoc.data.agent.passport.number = null\r\n\t\t\t\t\tawait fetchEditDocument(newDoc.type, newDoc._id, newDoc.data)\r\n\t\t\t\t\tdoc = await fetchDocument(newDoc.type, newDoc._id)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (io === 'out' && doc.status === 'drafts' && doc.type === 'factura') {\r\n\t\t\t\tif (\r\n\t\t\t\t\tdoc.data.hasOwnProperty('realizationpurpose') ||\r\n\t\t\t\t\tdoc.data.seller.hasOwnProperty('category') ||\r\n\t\t\t\t\tdoc.data?.seller?.taxgap !== null ||\r\n\t\t\t\t\tdoc.data?.buyer?.taxgap !== null\r\n\t\t\t\t) {\r\n\t\t\t\t\tlet newDoc = JSON.parse(JSON.stringify(doc))\r\n\t\t\t\t\tdelete newDoc.data?.realizationpurpose\r\n\t\t\t\t\tdelete newDoc.data.seller?.category\r\n\t\t\t\t\tdelete newDoc.data.seller?.taxgap\r\n\t\t\t\t\tdelete newDoc.data.buyer?.taxgap\r\n\t\t\t\t\tawait fetchEditDocument(newDoc.type, newDoc._id, newDoc.data)\r\n\t\t\t\t\tdoc = await fetchDocument(newDoc.type, newDoc._id)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (io === 'out' && doc.status === 'drafts') {\r\n\t\t\t\t// @ts-ignore\r\n\t\t\t\tpkcs7 = await dispatch(signData(JSON.stringify(doc.data), keyId))\r\n\t\t\t} else if (io === 'in' && doc.status === 'sended' && doc.type === 'empowerment') {\r\n\t\t\t\tlet agent = doc.targetTins.find((obj: any) => obj.side === 'agent')\r\n\t\t\t\tlet sign = await fetchSignedFile('empowerment', doc._id, profile?.personalNum == agent.tin ? 'agent' : 'seller')\r\n\t\t\t\tif (!sign) return { success: false, message: 'Подпись не найден' }\r\n\t\t\t\tpkcs7 = await dispatch(appendSign(sign.sign, keyId))\r\n\t\t\t} else if (io === 'in' && doc.status === 'sended' && doc.type === 'contract') {\r\n\t\t\t\tlet client = doc.targetTins.find((obj: any) => obj.side === 'client' && obj.tin === profile?.tin)\r\n\t\t\t\tif (!client) return { success: false, message: 'Клиент не найден' }\r\n\t\t\t\tlet sign = await fetchSignedFile('contract', doc._id, 'client')\r\n\t\t\t\tif (!sign) return { success: false, message: 'Подпись не найден' }\r\n\t\t\t\t//@ts-ignore\r\n\t\t\t\tpkcs7 = await dispatch(appendSign(sign.sign, keyId))\r\n\t\t\t} else if (\r\n\t\t\t\tio === 'in' &&\r\n\t\t\t\tdoc.status === 'sended' &&\r\n\t\t\t\tdoc.type !== 'waybillLocal' &&\r\n\t\t\t\t['actWorkPerformed', 'actVerification', 'actGoodsAcceptance', 'universal', 'invoice'].includes(doc.type)\r\n\t\t\t) {\r\n\t\t\t\tlet signType = ''\r\n\r\n\t\t\t\tif (doc.type === 'actWorkPerformed' || doc.type === 'invoice') {\r\n\t\t\t\t\tsignType = 'buyer'\r\n\t\t\t\t} else if (doc.type === 'actVerification') {\r\n\t\t\t\t\tsignType = 'partner'\r\n\t\t\t\t} else if (doc.type === 'actGoodsAcceptance' || doc.type === 'universal') {\r\n\t\t\t\t\tsignType = 'client'\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!signRes) {\r\n\t\t\t\t\tsignRes = await fetchSignedFile(\r\n\t\t\t\t\t\tdoc.type as string,\r\n\t\t\t\t\t\tdoc._id as string,\r\n\t\t\t\t\t\tsignType !== 'buyer' ? (signType !== 'partner' ? 'client' : 'partner') : 'buyer'\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst signature = !!signRes?.sign ? signRes.sign : doc.sign\r\n\r\n\t\t\t\t//@ts-ignore\r\n\t\t\t\tpkcs7 = await dispatch(appendSign(signature, keyId))\r\n\t\t\t} else if (io === 'in' && doc.status === 'sended' && doc.type === 'factura') {\r\n\t\t\t\tif (!signRes) {\r\n\t\t\t\t\tsignRes = await fetchSignedFile(\r\n\t\t\t\t\t\tdoc.type as string,\r\n\t\t\t\t\t\tdoc._id as string,\r\n\t\t\t\t\t\tdoc.data.buyertin === profile?.tin ? 'buyer' : 'agent'\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t\tconst signature = !!signRes?.sign ? signRes.sign : doc.sign\r\n\t\t\t\t//@ts-ignore\r\n\t\t\t\tpkcs7 = await dispatch(appendSign(signature, keyId))\r\n\t\t\t} else if (io === 'in' && doc.status === 'sended' && doc.type === 'waybillLocal') {\r\n\t\t\t\tif (doc.stateId === 110) {\r\n\t\t\t\t\tconst sign = await fetchWaybillLocalSign(doc._id, 'responsibleperson', 1)\r\n\t\t\t\t\tif (!sign?.sign) return\r\n\t\t\t\t\tpkcs7 = await dispatch(appendSign(sign.sign, keyId))\r\n\t\t\t\t} else if (doc?.data?.consignee?.tinorpinfl === profile?.tin && doc.stateId === 140) {\r\n\t\t\t\t\tconst sign = await fetchWaybillLocalSign(doc._id, 'consignee', 1)\r\n\t\t\t\t\tif (!sign?.sign) return\r\n\t\t\t\t\tpkcs7 = await dispatch(appendSign(sign.sign, keyId))\r\n\t\t\t\t} else if (doc.stateId === 140) {\r\n\t\t\t\t\tconst data = {\r\n\t\t\t\t\t\tWaybillLocalId: doc.roumingId,\r\n\t\t\t\t\t\tWaybillLocalSignType: 'ResponsiblePersonGiven',\r\n\t\t\t\t\t\tResponsiblePersonPinfl: profile?.tin\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpkcs7 = await dispatch(signData(JSON.stringify(data), keyId))\r\n\t\t\t\t} else if (doc.stateId === 160) {\r\n\t\t\t\t\tconst sign = await fetchWaybillLocalSign(doc._id, 'consignee', 1)\r\n\t\t\t\t\tif (!sign?.sign) return\r\n\t\t\t\t\tpkcs7 = await dispatch(appendSign(sign.sign, keyId))\r\n\t\t\t\t} else if (doc.stateId === 150) {\r\n\t\t\t\t\tconst data = {\r\n\t\t\t\t\t\tWaybillLocalSignType: 'ConsignorReturnAccepted',\r\n\t\t\t\t\t\tWaybillLocalId: doc.roumingId,\r\n\t\t\t\t\t\tConsignorTinOrPinfl: profile?.tin\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpkcs7 = await dispatch(signData(JSON.stringify(data), keyId))\r\n\t\t\t\t} else if (doc.stateId === 190) {\r\n\t\t\t\t\tconst data = {\r\n\t\t\t\t\t\tWaybillLocalSignType: 'ConsignorReturnAccepted',\r\n\t\t\t\t\t\tWaybillLocalId: doc.roumingId,\r\n\t\t\t\t\t\tConsignorTinOrPinfl: profile?.tin\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpkcs7 = await dispatch(signData(JSON.stringify(data), keyId))\r\n\t\t\t\t}\r\n\t\t\t} else if (\r\n\t\t\t\t['out', 'in'].includes(io as string) &&\r\n\t\t\t\tdoc.type === 'waybillLocal' &&\r\n\t\t\t\t[150, 190].includes(doc.stateId)\r\n\t\t\t) {\r\n\t\t\t\tconst data = {\r\n\t\t\t\t\tWaybillLocalSignType: 'ConsignorReturnAccepted',\r\n\t\t\t\t\tWaybillLocalId: doc.roumingId,\r\n\t\t\t\t\tConsignorTinOrPinfl: profile?.tin\r\n\t\t\t\t}\r\n\t\t\t\tpkcs7 = await dispatch(signData(JSON.stringify(data), keyId))\r\n\t\t\t}\r\n\r\n\t\t\tif (pkcs7) {\r\n\t\t\t\tlet res = null\r\n\t\t\t\tif (doc.type === 'waybillLocal') {\r\n\t\t\t\t\tconst docStatus = doc.stateId as number\r\n\t\t\t\t\tif (docStatus === 1) {\r\n\t\t\t\t\t\tres = await fetchSignDocument(doc.type, doc._id, pkcs7, false)\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tres = await fetchWaybillLocalMethods(\r\n\t\t\t\t\t\t\tdoc._id,\r\n\t\t\t\t\t\t\tpkcs7,\r\n\t\t\t\t\t\t\tdoc?.data?.consignee?.tinorpinfl === profile?.tin ? 'accept' : waybillLocalActions[docStatus]\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tres = await fetchSignDocument(doc.type, doc._id, pkcs7, false)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (res?.status === 200) {\r\n\t\t\t\t\tsetSuccessfullSigned(successfullSigned + 1)\r\n\t\t\t\t\treturn { success: true, message: 'Документ успешно подписан' }\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn { success: false, message: res?.data.errors?.msg }\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\treturn { success: false, message: 'Подпись не создан по непредвиденной причине' }\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\t//@ts-ignore\r\n\t\t\treturn { success: false, message: e.errMsg }\r\n\t\t}\r\n\t}\r\n\r\n\tconst renewDocument = async (type: string, id: string) => {\r\n\t\ttry {\r\n\t\t\tdispatch(appSlice.actions.toggleSystemLoading(true))\r\n\t\t\tconst res = await fetchRefreshDocument(type, id)\r\n\t\t\tdispatch(appSlice.actions.toggleSystemLoading(false))\r\n\t\t\tif (res?.status === 200) {\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\tmessage: t('alertTitles.docUpdate'),\r\n\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\tconsole.log(e)\r\n\t\t}\r\n\t}\r\n\r\n\tconst createBasedDoc = (newDoc: string | undefined, identificator: string, based: string, id: number) => {\r\n\t\tconst navParams = {\r\n\t\t\tstate: {\r\n\t\t\t\tid: identificator,\r\n\t\t\t\tbased: based,\r\n\t\t\t\tnewDoc: '',\r\n\t\t\t\tcorrected: false,\r\n\t\t\t\tadditional: false\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (newDoc === 'copy') {\r\n\t\t\tnewDoc = based\r\n\t\t\tconst foundDoc = listOfDocumentCategories.find(item => item.name.toLowerCase() === based?.toLowerCase())\r\n\t\t\tnavParams.state.newDoc = foundDoc?.name || ''\r\n\t\t\tif (based === 'factura') {\r\n\t\t\t\tif (id === 4) {\r\n\t\t\t\t\tnavParams.state.corrected = true\r\n\t\t\t\t} else if (id === 5) {\r\n\t\t\t\t\tnavParams.state.additional = true\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconst foundDoc = listOfDocumentCategories.find(item => item.name.toLowerCase() === newDoc?.toLowerCase())\r\n\t\t\tnavParams.state.newDoc = foundDoc?.name || ''\r\n\t\t}\r\n\t\tnavigate(`/document/${newDoc}`, { state: navParams })\r\n\t}\r\n\r\n\tconst fileToBase64 = (file: any) => {\r\n\t\treturn new Promise((resolve, reject) => {\r\n\t\t\tconst reader = new FileReader()\r\n\t\t\treader.readAsDataURL(file)\r\n\t\t\treader.onload = () => resolve(reader.result)\r\n\t\t\treader.onerror = error => reject(error)\r\n\t\t})\r\n\t}\r\n\r\n\tconst uploadFile = async (e: any) => {\r\n\t\tconst file = e.target.files[0]\r\n\t\tconst fileBase64: any = await fileToBase64(file).catch(e => e)\r\n\t\tif (fileBase64 instanceof Error) {\r\n\t\t\tconsole.log('Error: ', fileBase64.message)\r\n\t\t\treturn\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tdispatch(appSlice.actions.toggleSystemLoading(true))\r\n\t\t\tconst res = await uploadXlsx({\r\n\t\t\t\tbase64: fileBase64.replace(/.*base64,/, '')\r\n\t\t\t})\r\n\t\t\tif (res?.status === 200) {\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\tshow: true,\r\n\t\t\t\t\t\tmessage: t('alertTitles.successUploadXlsx')\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t} else {\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\ttype: 'error',\r\n\t\t\t\t\t\tshow: true,\r\n\t\t\t\t\t\tmessage: t('alertTitles.errorUploadXlsx')\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tconsole.log(error)\r\n\t\t\tconsole.log(fileBase64)\r\n\t\t} finally {\r\n\t\t\tdispatch(appSlice.actions.toggleSystemLoading(false))\r\n\t\t\trefetchDocs()\r\n\t\t\te.target.value = ''\r\n\t\t}\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!!successfullSigned) {\r\n\t\t\tclearTimeout(successfullSignedRef.current)\r\n\t\t\tsuccessfullSignedRef.current = setTimeout(() => setSuccessfullSigned(0), 5000)\r\n\t\t}\r\n\t\treturn () => {\r\n\t\t\tclearTimeout(successfullSignedRef.current)\r\n\t\t}\r\n\t}, [successfullSigned])\r\n\r\n\tinterface DocumentRow {\r\n\t\t_id: string\r\n\t\ttype: string\r\n\t\tdocNumber: string\r\n\t\tdocDate: string\r\n\t\tcontractDate: string\r\n\t\tcontractNumber: string\r\n\t\townerName: string\r\n\t\townerTin: string\r\n\t\ttotalSum: number\r\n\t\ttotalVatSum: number\r\n\t\ttotalDocSum: number\r\n\t\tupdatedAt: string\r\n\t\tnotes: string\r\n\t\tstateId: number\r\n\t\tstatus: string\r\n\t\troumingId: string\r\n\t\ttargetTins: {\r\n\t\t\tname: string\r\n\t\t\ttin: string\r\n\t\t}[]\r\n\t\tsubType: string\r\n\t\textension: any\r\n\t}\r\n\r\n\tconst columns = useMemo(\r\n\t\t() => [\r\n\t\t\t{\r\n\t\t\t\taccessorKey: 'actions',\r\n\t\t\t\theader: translateTableHead('DOCUMENT_ACTIONS'),\r\n\t\t\t\tenableColumnActions: false,\r\n\t\t\t\tenableColumnOrdering: false,\r\n\t\t\t\tenableSorting: false,\r\n\t\t\t\tenableColumnFilter: false,\r\n\t\t\t\tminSize: 50,\r\n\t\t\t\tmaxSize: 140,\r\n\t\t\t\tmuiTableHeadCellProps: {\r\n\t\t\t\t\talign: 'center' as const\r\n\t\t\t\t},\r\n\t\t\t\tCell: ({ row }: { row: MRT_Row }) => {\r\n\t\t\t\t\tconst { type, _id, status } = row.original\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t redirectToClickedDocument(type, _id)}\r\n\t\t\t\t\t\t\t\t\tsx={{ p: '5px', color: 'background.icons' }}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{io === 'out' && status === 'drafts' && (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleClickOpen(_id, type)} sx={{ p: '5px', color: 'background.icons' }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\tcreateBasedDoc(type, _id, type, 9)\r\n\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\tsx={{ p: '5px', color: 'background.icons' }}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t redirectToEditDocument(row.original)}\r\n\t\t\t\t\t\t\t\t\t\t\tsx={{ p: '5px', color: 'background.icons' }}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t{io === 'out' && status === 'rejected' && (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\tcreateBasedDoc(type, _id, type, 9)\r\n\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\tsx={{ p: '5px', color: 'background.icons' }}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t{io === 'out' &&\r\n\t\t\t\t\t\t\t\tstatus === 'sended' &&\r\n\t\t\t\t\t\t\t\t!['universal', 'actGoodsAcceptance', 'invoice'].includes(type) && (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\trenewDocument(type, _id)\r\n\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\tsx={{ p: '5px', color: 'background.icons' }}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t{io === 'out' && ['signed', 'sended'].includes(`${status}`) && (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\tcreateBasedDoc(type, _id, type, 9)\r\n\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\t\t\t\t\tp: '5px',\r\n\t\t\t\t\t\t\t\t\t\t\t\tcolor: 'background.icons'\r\n\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t{io === 'out' && status === 'deleted' && (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\tcreateBasedDoc(type, _id, type, 9)\r\n\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\tsx={{ p: '5px', color: 'background.icons' }}\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t{row.original?.extension?.hasmarking === true && type === 'factura' && (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\taccessorKey: 'docDate',\r\n\t\t\t\theader: translateTableHead('DOCUMENT') + ' / ' + t('DOCS_TABLE_HEADERS.CONTR_AGENT'),\r\n\t\t\t\tenableColumnActions: false,\r\n\t\t\t\tsize: 440,\r\n\t\t\t\tmuiTableHeadCellProps: {\r\n\t\t\t\t\talign: 'center' as const\r\n\t\t\t\t},\r\n\t\t\t\tCell: ({ row }: { row: MRT_Row }) => {\r\n\t\t\t\t\tconst {\r\n\t\t\t\t\t\ttype,\r\n\t\t\t\t\t\textension,\r\n\t\t\t\t\t\tdocNumber,\r\n\t\t\t\t\t\tdocDate,\r\n\t\t\t\t\t\townerName,\r\n\t\t\t\t\t\townerTin,\r\n\t\t\t\t\t\ttargetTins,\r\n\t\t\t\t\t\tsubType,\r\n\t\t\t\t\t\tstateId,\r\n\t\t\t\t\t\tstatus,\r\n\t\t\t\t\t\tnotes\r\n\t\t\t\t\t} = row.original\r\n\t\t\t\t\tconst targetTinsLength = targetTins.length\r\n\t\t\t\t\tconst tinOrPinfl =\r\n\t\t\t\t\t\tio === 'out'\r\n\t\t\t\t\t\t\t? !!targetTinsLength && type === 'waybillLocal'\r\n\t\t\t\t\t\t\t\t? targetTins[targetTinsLength - 1].tin\r\n\t\t\t\t\t\t\t\t: targetTins[0]?.tin\r\n\t\t\t\t\t\t\t: ownerTin\r\n\t\t\t\t\tconst partnerName =\r\n\t\t\t\t\t\tio === 'out'\r\n\t\t\t\t\t\t\t? targetTinsLength && type === 'waybillLocal'\r\n\t\t\t\t\t\t\t\t? targetTins[targetTinsLength - 1].name\r\n\t\t\t\t\t\t\t\t: targetTins[0]?.name\r\n\t\t\t\t\t\t\t: ownerName\r\n\t\t\t\t\tconst tinOrPinflLabel = tinOrPinfl?.length === 9 ? t('TIN') : t('PINFL')\r\n\t\t\t\t\tconst contragent =\r\n\t\t\t\t\t\ttype === 'waybillLocal'\r\n\t\t\t\t\t\t\t? io === 'out'\r\n\t\t\t\t\t\t\t\t? `${t('common.cargoReceiver')}: `\r\n\t\t\t\t\t\t\t\t: `${t('common.shipper')}: `\r\n\t\t\t\t\t\t\t: ''\r\n\t\t\t\t\tconst responsiblePersonPINFL =\r\n\t\t\t\t\t\ttargetTins[0]?.tin.length > 9 ? targetTins[0]?.tin : t('detailPanel.responsiblePersonInDocument')\r\n\t\t\t\t\tconst responsiblePersonName = targetTins[0]?.tin.length > 9 ? targetTins[0]?.name : ''\r\n\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{type !== 'universal' ? t('documentItem.' + type.toUpperCase()) : subType} № {docNumber}{' '}\r\n\t\t\t\t\t\t\t\t{t('shortDate.from')} {fShortDate(docDate)}\r\n\t\t\t\t\t\t\t\t{t('shortDate.year')}\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{stateId ? `${t(`DOC_STATUS.${stateId}`)}` : `${t(`DOC_STATUS.${status}`)}`}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t{status === 'rejected' && (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{t('detailPanel.notes')} {notes ? notes : `${t(`detailPanel.notesInDoc`)}`}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\t{type === 'factura' && extension?.singlesidedtype ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{t('SINGLE_SIDED')}:\r\n\t\t\t\t\t\t\t\t\t{' '}\r\n\t\t\t\t\t\t\t\t\t{t(`SINGLE_SIDED_STATUS.${extension.singlesidedtype}`) || t('DOC_STATUS.statusUndefined')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : targetTins?.length ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{contragent}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{tinOrPinflLabel}{' '}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t copyToClipboard(tinOrPinfl)} style={{ cursor: 'pointer' }}>\r\n\t\t\t\t\t\t\t\t\t\t\t{tinOrPinfl}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{', '}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{partnerName}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{t('SINGLE_SIDED')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\t{type === 'waybillLocal' && (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{t('TTHFORM.responsiblePersonForDeliver')}\r\n\t\t\t\t\t\t\t\t\t\t{': '}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{targetTins[0]?.tin.length > 9 ? (\r\n\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t{`${t('PINFL')} `}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t copyToClipboard(responsiblePersonPINFL)} style={{ cursor: 'pointer' }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{responsiblePersonPINFL}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{', '}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t{responsiblePersonName}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\tt('detailPanel.responsiblePersonInDocument')\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\taccessorKey: 'contractDate',\r\n\t\t\t\theader: translateTableHead('CONTRACT'),\r\n\t\t\t\tenableClickToCopy: false,\r\n\t\t\t\tenableColumnActions: false,\r\n\t\t\t\tsize: 180,\r\n\t\t\t\tmuiTableHeadCellProps: {\r\n\t\t\t\t\talign: 'center' as const\r\n\t\t\t\t},\r\n\t\t\t\tCell: ({ row }: { row: MRT_Row }) => {\r\n\t\t\t\t\tconst contractText = row.original.contractNumber\r\n\t\t\t\t\t\t? `№ ${row.original.contractNumber} ${t('shortDate.from')} ${fShortDate(row.original.contractDate)} ${t(\r\n\t\t\t\t\t\t\t\t'shortDate.year'\r\n\t\t\t\t\t\t )}`\r\n\t\t\t\t\t\t: '--'\r\n\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t copyToClipboard(contractText)}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t№ {row.original.contractNumber}{' '}\r\n\t\t\t\t\t\t\t\t{row.original.contractDate !== null && (\r\n\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t{t('shortDate.from')} {fShortDate(row.original.contractDate)} {t('shortDate.year')}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\taccessorKey: 'totalDocSum',\r\n\t\t\t\theader: translateTableHead('SUM'),\r\n\t\t\t\tenableClickToCopy: false,\r\n\t\t\t\tenableColumnActions: false,\r\n\t\t\t\tsize: 220,\r\n\t\t\t\tmuiTableHeadCellProps: {\r\n\t\t\t\t\talign: 'center' as const\r\n\t\t\t\t},\r\n\t\t\t\tCell: ({ row }: { row: MRT_Row }) => {\r\n\t\t\t\t\tconst totalDocSumText = `Сумма: ${fCurrencySpace(row.original.totalSum)}\\n${t('VAT')}: ${fCurrencySpace(\r\n\t\t\t\t\t\trow.original.totalVatSum\r\n\t\t\t\t\t)}\\n${t('TTHFORM.total')}: ${fCurrencySpace(row.original.totalDocSum)}`\r\n\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t copyToClipboard(totalDocSumText)}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tСумма: {fCurrencySpace(row.original.totalSum)}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('VAT')}: {fCurrencySpace(row.original.totalVatSum)}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('TTHFORM.totalWidthVat')}: {fCurrencySpace(row.original.totalDocSum)}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\taccessorKey: 'updatedAt',\r\n\t\t\t\theader: translateTableHead('DOC_UPDATED_AT'),\r\n\t\t\t\tenableColumnActions: false,\r\n\t\t\t\tenableColumnOrdering: false,\r\n\t\t\t\tenableResizing: false,\r\n\t\t\t\tenableSorting: true,\r\n\t\t\t\tsortDescFirst: true,\r\n\t\t\t\tsize: 100,\r\n\t\t\t\tmuiTableHeadCellProps: {\r\n\t\t\t\t\talign: 'center' as const,\r\n\t\t\t\t\tcolor: 'text.disabled'\r\n\t\t\t\t},\r\n\t\t\t\tCell: ({ row }: { row: MRT_Row }) => (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{fShortDatePerDay(row.original.updatedAt)}\r\n\t\t\t\t\t\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t],\r\n\t\t[io, status, i18n.language]\r\n\t)\r\n\r\n\tconst redirectToDocumentPage = () => {\r\n\t\tnavigate(`/document/factura`)\r\n\t}\r\n\tconst pageTitle = useMemo(() => {\r\n\t\tconst sectionDocumentType = status?.toLocaleUpperCase()\r\n\t\treturn ` ${t(`DOCUMENT_TYPES.` + t(`${sectionDocumentType}`))} `\r\n\t}, [status])\r\n\tconst pageTitleIcon = useMemo(() => {\r\n\t\tif (!status) return\r\n\t\tlet documentTypeIcon = titleIconsList[status]\r\n\t\treturn getIcon(documentTypeIcon)\r\n\t}, [status])\r\n\r\n\t//высота таблицы по экрану, каждого индивидуального пользователя\r\n\tconst [maxHeight, setMaxHeight] = useState('100vh')\r\n\tuseEffect(() => {\r\n\t\tconst updateTableHeight = () => {\r\n\t\t\tsetMaxHeight(`${window.innerHeight - 208}px`)\r\n\t\t}\r\n\t\twindow.addEventListener('resize', updateTableHeight)\r\n\t\tupdateTableHeight()\r\n\t\treturn () => {\r\n\t\t\twindow.removeEventListener('resize', updateTableHeight)\r\n\t\t}\r\n\t}, [])\r\n\r\n\tconst isSmallScreen = useMediaQuery(theme.breakpoints.down('lg'))\r\n\r\n\t//высота таблицы\r\n\tconst [showProgressBars, setShowProgressBars] = useState(false)\r\n\tuseEffect(() => {\r\n\t\tif (tableLoading) {\r\n\t\t\tsetShowProgressBars(true)\r\n\t\t} else {\r\n\t\t\tconst timer = setTimeout(() => {\r\n\t\t\t\tsetShowProgressBars(false)\r\n\t\t\t}, 200)\r\n\r\n\t\t\treturn () => clearTimeout(timer)\r\n\t\t}\r\n\t}, [tableLoading])\r\n\r\n\t//функция для открытия диалогового окна ошибки при групповом подписании\r\n\tconst handleClickOpenProcessingRowsErrorDialog = (row: any) => {\r\n\t\tsetProcessingRowsErrorDialogOpen(true)\r\n\t\tdispatch(groupActionsSlice.actions.setProcessingRowsErrorDialog(row))\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{!!successfullSigned && (\r\n\t\t\t\t\r\n\t\t\t\t\t{t('alertTitles.docsSigned')} {successfullSigned}\r\n\t\t\t\t\r\n\t\t\t)}\r\n\t\t\t{(open || showSignMessage) && (\r\n\t\t\t\t\r\n\t\t\t\t\t{t('alertTitles.warning')}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{showSignMessage ? t('DOCUMENT_SIGN_BODY') : t('DOCUMENT_DELETE_BODY')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{showSignMessage ? (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t)}\r\n\r\n\t\t\t{openSampleDialog && (\r\n\t\t\t\t setOpenSampleDialog(false)}>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t   {t('common.xlsxExample')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t   {t('common.xlsxSample')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t setOpenSampleDialog(false)}\r\n\t\t\t\t\t\t\tcolor='primary'\r\n\t\t\t\t\t\t\tsx={{ backgroundColor: theme.palette.background.paper }}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{t('common.close')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t)}\r\n\r\n\t\t\t{processingRowsErrorDialogOpen && (\r\n\t\t\t\t setProcessingRowsErrorDialogOpen(false)}>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{t('alertTitles.error')}: {processingRowsError[processingRowsErrorDialog._id]}\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('groupActions.explanation')}{' '}\r\n\t\t\t\t\t\t\t\t{(() => {\r\n\t\t\t\t\t\t\t\t\tconst errorMessage = processingRowsError[processingRowsErrorDialog._id]\r\n\r\n\t\t\t\t\t\t\t\t\tconst errorTranslations = t('errors', { returnObjects: true })\r\n\t\t\t\t\t\t\t\t\tfor (const [startKey, explanation] of Object.entries(errorTranslations)) {\r\n\t\t\t\t\t\t\t\t\t\tif (errorMessage === startKey) {\r\n\t\t\t\t\t\t\t\t\t\t\treturn explanation\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tconst roumingErrorTranslations = t('roumingErrorStartWith', { returnObjects: true })\r\n\t\t\t\t\t\t\t\t\tfor (const [startKey, explanation] of Object.entries(roumingErrorTranslations)) {\r\n\t\t\t\t\t\t\t\t\t\tif (errorMessage?.startsWith(startKey)) {\r\n\t\t\t\t\t\t\t\t\t\t\treturn explanation\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t{'Если указанный выше текст ошибки не помог решить проблему, '}\r\n\t\t\t\t\t\t\t\t\t\t\t{'пожалуйста, скопируйте его по нажатии кнопки и отправьте в техническую поддержку '}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\thttps://t.me/edocs_uz\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t})()}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('detailPanel._id')} {processingRowsErrorDialog._id}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('detailPanel.roumingId')} {processingRowsErrorDialog.roumingId}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('detailPanel.status')} -{' '}\r\n\t\t\t\t\t\t\t\t{processingRowsErrorDialog.stateId ? processingRowsErrorDialog.stateId : `${t(`DOC_STATUS.${status}`)}`}\r\n\t\t\t\t\t\t\t\t: {processingRowsErrorDialog.stateId ? `${t(`DOC_STATUS.${processingRowsErrorDialog.stateId}`)}` : ''}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t copyToClipboard(dialogContentRef.current?.innerText || '')}\r\n\t\t\t\t\t\t\tcolor='secondary'\r\n\t\t\t\t\t\t\tsx={{ backgroundColor: theme.palette.background.paper }}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{t('common.clickToCopyError')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t setProcessingRowsErrorDialogOpen(false)}\r\n\t\t\t\t\t\t\tcolor='primary'\r\n\t\t\t\t\t\t\tsx={{ backgroundColor: theme.palette.background.paper }}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{t('common.close')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t)}\r\n\r\n\t\t\t ({\r\n\t\t\t\t\tsx: {\r\n\t\t\t\t\t\t// @ts-ignore\r\n\t\t\t\t\t\tbackgroundColor: theme.palette.background.tableBody,\r\n\t\t\t\t\t\t//делаю прозрачным те строки которые успешно обновлены/удалён или подписаны\r\n\t\t\t\t\t\tpointerEvents:\r\n\t\t\t\t\t\t\tprocessingRowsSuccess[row.original._id] === 'sign' ||\r\n\t\t\t\t\t\t\tprocessingRowsSuccess[row.original._id] === 'erase' ||\r\n\t\t\t\t\t\t\tprocessingRowsSuccess[row.original._id] === 'delete'\r\n\t\t\t\t\t\t\t\t? 'none'\r\n\t\t\t\t\t\t\t\t: 'auto',\r\n\t\t\t\t\t\topacity:\r\n\t\t\t\t\t\t\tprocessingRowsSuccess[row.original._id] === 'sign' ||\r\n\t\t\t\t\t\t\tprocessingRowsSuccess[row.original._id] === 'erase' ||\r\n\t\t\t\t\t\t\tprocessingRowsSuccess[row.original._id] === 'delete'\r\n\t\t\t\t\t\t\t\t? 0.4\r\n\t\t\t\t\t\t\t\t: 1\r\n\t\t\t\t\t}\r\n\t\t\t\t})}\r\n\t\t\t\tmuiTableContainerProps={{\r\n\t\t\t\t\tsx: {\r\n\t\t\t\t\t\tmaxHeight: maxHeight,\r\n\t\t\t\t\t\t// @ts-ignore\r\n\t\t\t\t\t\tbackgroundColor: theme.palette.background.tableBody\r\n\t\t\t\t\t}\r\n\t\t\t\t}}\r\n\t\t\t\t// Нижняя часть таблицы\r\n\t\t\t\tmuiBottomToolbarProps={{\r\n\t\t\t\t\tsx: {\r\n\t\t\t\t\t\t// @ts-ignore\r\n\t\t\t\t\t\tbackgroundColor: theme.palette.background.tableContainer,\r\n\t\t\t\t\t\tborderTop: `1px solid ${theme.palette.divider}`\r\n\t\t\t\t\t}\r\n\t\t\t\t}}\r\n\t\t\t\t// Устанавливаем радиус бордера для всего блока таблицы\r\n\t\t\t\tmuiTablePaperProps={{\r\n\t\t\t\t\tsx: {\r\n\t\t\t\t\t\tborderRadius: '12px',\r\n\t\t\t\t\t\toverflow: 'hidden'\r\n\t\t\t\t\t}\r\n\t\t\t\t}}\r\n\t\t\t\tenableColumnResizing\r\n\t\t\t\tenableColumnOrdering\r\n\t\t\t\t// enableColumnActions={false}\r\n\t\t\t\tenableRowActions\r\n\t\t\t\trenderRowActions={({ row }) => {\r\n\t\t\t\t\tconst rowId = row.original._id\r\n\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t{processingRowsError[rowId] ? (\r\n\t\t\t\t\t\t\t\t handleClickOpenProcessingRowsErrorDialog(row.original)}\r\n\t\t\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\t\t\tfontSize: '12px',\r\n\t\t\t\t\t\t\t\t\t\ttextWrap: 'wrap',\r\n\t\t\t\t\t\t\t\t\t\tcolor: 'error.main',\r\n\t\t\t\t\t\t\t\t\t\tcursor: 'pointer'\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t{t('alertTitles.error')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : processingRowsSuccess[rowId] ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{processingRowsSuccess[row.original._id] === 'erase' ||\r\n\t\t\t\t\t\t\t\t\tprocessingRowsSuccess[row.original._id] === 'delete'\r\n\t\t\t\t\t\t\t\t\t\t? t('groupActions.deleted')\r\n\t\t\t\t\t\t\t\t\t\t: processingRowsSuccess[row.original._id] === 'sign'\r\n\t\t\t\t\t\t\t\t\t\t? t('groupActions.signed')\r\n\t\t\t\t\t\t\t\t\t\t: processingRowsSuccess[row.original._id] === 'refreshNoNeed'\r\n\t\t\t\t\t\t\t\t\t\t? t('groupActions.refreshNoNeed')\r\n\t\t\t\t\t\t\t\t\t\t: t('groupActions.refreshed')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : processingRow === rowId ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : rowSelection[rowId] && processingRow !== rowId ? (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{processingRow ? t('groupActions.inLine') : t('groupActions.checked')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t}}\r\n\t\t\t\tenableColumnFilters={false}\r\n\t\t\t\tenableGlobalFilter={false}\r\n\t\t\t\t// enableSorting={false}\r\n\t\t\t\tenablePagination={false}\r\n\t\t\t\tenableRowSelection={row =>\r\n\t\t\t\t\t(!processingRowsSuccess[row.original._id] && !processingRowsError[row.original._id]) ||\r\n\t\t\t\t\tprocessingRowsSuccess[row.original._id] === 'refresh' ||\r\n\t\t\t\t\tprocessingRowsSuccess[row.original._id] === 'refreshNoNeed'\r\n\t\t\t\t\t\t? !(row.original.type === 'letter' && io === 'in') // Отключаем чекбокс для 'letter'\r\n\t\t\t\t\t\t: false\r\n\t\t\t\t}\r\n\t\t\t\tgetRowId={row => row._id}\r\n\t\t\t\tonRowSelectionChange={setRowSelection}\r\n\t\t\t\tpositionToolbarAlertBanner='none'\r\n\t\t\t\tstate={{ rowSelection, showProgressBars }}\r\n\t\t\t\trenderTopToolbarCustomActions={() => {\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t{!selected.length && (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\t\t\t\tpaddingLeft: isSmallScreen ? 0 : 1,\r\n\t\t\t\t\t\t\t\t\t\t\tpaddingRight: 1,\r\n\t\t\t\t\t\t\t\t\t\t\tlineHeight: 1,\r\n\t\t\t\t\t\t\t\t\t\t\theight: '100%',\r\n\t\t\t\t\t\t\t\t\t\t\ttextTransform: 'none',\r\n\t\t\t\t\t\t\t\t\t\t\tcolor: theme.palette.grey[600],\r\n\t\t\t\t\t\t\t\t\t\t\t// @ts-ignore\r\n\t\t\t\t\t\t\t\t\t\t\tborderColor: theme.palette.background.icons\r\n\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t{isSmallScreen ? null : t('common.createDoc')}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\t{selected.length > 0 && (\r\n\t\t\t\t\t\t\t\t setRowSelection({})}\r\n\t\t\t\t\t\t\t\t\tdisabledState={disabled.state}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t refetchDocs()}>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t}}\r\n\t\t\t\trenderBottomToolbarCustomActions={() => {\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t setOpenSampleDialog(true)}\r\n\t\t\t\t\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\t\t\t\t\tsize='medium'\r\n\t\t\t\t\t\t\t\t\tendIcon={}\r\n\t\t\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\t\t\tpaddingLeft: 1.5,\r\n\t\t\t\t\t\t\t\t\t\tpaddingRight: 2,\r\n\t\t\t\t\t\t\t\t\t\tlineHeight: 1,\r\n\t\t\t\t\t\t\t\t\t\theight: '100%',\r\n\t\t\t\t\t\t\t\t\t\ttextTransform: 'none',\r\n\t\t\t\t\t\t\t\t\t\tcolor: theme.palette.grey[600],\r\n\t\t\t\t\t\t\t\t\t\tborderColor: theme.palette.grey[600]\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t{t('DownloadSample')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{rowsPerPage > 10 && (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t showLess()} sx={{ color: 'background.icons' }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t{!(docs?.length < rowsPerPage) && (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t showMore()} sx={{ color: 'background.icons' }}>\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t}}\r\n\t\t\t\tlayoutMode='grid'\r\n\t\t\t\trenderDetailPanel={({ row }) => }\r\n\t\t\t\tmuiTableDetailPanelProps={{\r\n\t\t\t\t\tsx: {\r\n\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\tjustifyContent: 'center',\r\n\t\t\t\t\t\talignItems: 'center',\r\n\t\t\t\t\t\twidth: '100%',\r\n\t\t\t\t\t\tborderBottom: `1px solid ${theme.palette.divider}`,\r\n\t\t\t\t\t\t// @ts-ignore\r\n\t\t\t\t\t\tbackgroundColor: theme.palette.background.tableBodyDetail\r\n\t\t\t\t\t}\r\n\t\t\t\t}}\r\n\t\t\t\tlocalization={{\r\n\t\t\t\t\texpand: t('common.expandDetailPanel'),\r\n\t\t\t\t\texpandAll: t('common.expandAllDetailPanels'),\r\n\t\t\t\t\tcollapse: t('common.collapsDetailPanel'),\r\n\t\t\t\t\tcollapseAll: t('common.collapsAllDetailPanels'),\r\n\t\t\t\t\ttoggleFullScreen: t('common.toggleFullScreen'),\r\n\t\t\t\t\ttoggleDensity: t('common.toggleDensity'),\r\n\t\t\t\t\tshowHideColumns: t('common.showHideColumns'),\r\n\t\t\t\t\thideAll: t('common.hideAll'),\r\n\t\t\t\t\tresetOrder: t('common.resetOrder'),\r\n\t\t\t\t\tshowAll: t('common.showAll'),\r\n\t\t\t\t\ttoggleSelectRow: t('common.toggleSelectRow'),\r\n\t\t\t\t\ttoggleSelectAll: t('common.toggleSelectAll'),\r\n\t\t\t\t\tselect: t('common.select'),\r\n\t\t\t\t\tnoRecordsToDisplay: t('common.noRecordsToDisplay'),\r\n\t\t\t\t\tactions: 'Статус'\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default React.memo(DocumentsPreviewTable)\r\n","import { useConfirm } from 'material-ui-confirm'\r\nimport { useCallback } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useNavigate } from 'react-router-dom'\r\nimport { listOfDocumentCategories } from '../data/lists'\r\nimport {\r\n\tfetchDeleteDocument,\r\n\tfetchDocCounts,\r\n\tfetchDocument,\r\n\tfetchEraseDocument,\r\n\tfetchRefreshDocument,\r\n\tfetchRejectDocument,\r\n\tfetchSignedFile,\r\n\tfetchWaybillLocalMethods,\r\n\tfetchWaybillLocalSign\r\n} from '../redux/actions/DocumentsActions'\r\nimport { getAttachedInfo, signData } from '../redux/actions/EimzoActions'\r\nimport { appSlice } from '../redux/reducers/AppReducer'\r\nimport { useAppDispatch, useAppSelector } from './redux'\r\nimport useToggle from './useToggle'\r\nimport { useProfileGetter } from './useProfile'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\ninterface ICreateBased {\r\n\tnewDoc: string | undefined\r\n\tidentificator: string\r\n\tbased: string\r\n\tid: number\r\n}\r\n\r\ninterface IHookProps {\r\n\ttype: string\r\n\tid: string\r\n\tio: string\r\n\tstatus: string\r\n}\r\n\r\nconst waybillLocalActions: Record = {\r\n\t110: 'reject',\r\n\t140: 'till-return',\r\n\t160: 'reject'\r\n}\r\n\r\nconst waybillLocalUnwantedKeys = [\r\n\t'deliverytypename',\r\n\t'transporttypename',\r\n\t'currentstateid',\r\n\t'currentstatename',\r\n\t'states',\r\n\t'createdat',\r\n\t'updatedat',\r\n\t'singlesidedtype'\r\n]\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nexport function useOpenFile({ type, id, io, status }: IHookProps) {\r\n\tconst navigate = useNavigate()\r\n\tconst { t } = useTranslation()\r\n\tconst confirm = useConfirm()\r\n\tconst dispatch = useAppDispatch()\r\n\tconst filterReducer = useAppSelector(state => state.filterReducer.filter)\r\n\tconst profile = useProfileGetter.useGetProfile()\r\n\tconst disabled = useToggle(false)\r\n\tconst keyId = profile?.keyId || ''\r\n\r\n\tconst editDocument = useCallback(() => {\r\n\t\tnavigate(`/edit/${type}/${id}`, { state: { corrected: false } })\r\n\t}, [])\r\n\r\n\tconst rejectItem = useCallback(async (note: string) => {\r\n\t\ttry {\r\n\t\t\tdisabled.on()\r\n\t\t\tlet signedData: any = {\r\n\t\t\t\tNotes: note\r\n\t\t\t}\r\n\t\t\tconst doc = await fetchDocument(type!, id!)\r\n\r\n\t\t\tlet side = type === 'actVerification' ? 'partner' : doc?.data?.buyertin === profile.tin ? 'buyer' : 'agent'\r\n\t\t\tif (type === 'universal' || type === 'actGoodsAcceptance') {\r\n\t\t\t\tside = 'client'\r\n\t\t\t}\r\n\t\t\tlet nameData = 'Data'\r\n\t\t\tif (type === 'factura') {\r\n\t\t\t\tnameData = 'Factura'\r\n\t\t\t} else if (type == 'empowerment') {\r\n\t\t\t\tnameData = 'Empowerment'\r\n\t\t\t\tside = doc.data.buyertin === profile.tin ? 'buyer' : doc.data.sellertin === profile.tin ? 'seller' : 'agent'\r\n\t\t\t} else if (type == 'waybill') {\r\n\t\t\t\tnameData = 'Waybill'\r\n\t\t\t} else if (type == 'actGoodsAcceptance') {\r\n\t\t\t\tnameData = 'Data'\r\n\t\t\t} else if (type == 'actWorkPerformed') {\r\n\t\t\t\tnameData = 'Act'\r\n\t\t\t} else if (type == 'contract') {\r\n\t\t\t\tnameData = 'Contract'\r\n\t\t\t\tside = 'client'\r\n\t\t\t} else if (type == 'actVerification') {\r\n\t\t\t\tnameData = 'VerificationAct'\r\n\t\t\t} else if (type == 'waybillLocal') {\r\n\t\t\t\tnameData = 'WaybillLocal'\r\n\t\t\t}\r\n\t\t\tsignedData[nameData] = doc.data\r\n\r\n\t\t\tlet pkcs = { sign: '', success: false }\r\n\t\t\tconst isResponsiblePerson = doc.data?.responsibleperson?.pinfl === profile.tin || false\r\n\t\t\tconst isConsignee = doc?.data?.consignee?.tinorpinfl === profile.tin || false\r\n\r\n\t\t\tif (doc.type === 'waybillLocal') {\r\n\t\t\t\tif (doc.stateId === 110) {\r\n\t\t\t\t\tpkcs.success = true\r\n\t\t\t\t} else if (doc.stateId === 140 && isConsignee) {\r\n\t\t\t\t\tpkcs.success = true\r\n\t\t\t\t} else if (doc.stateId === 140 && isResponsiblePerson) {\r\n\t\t\t\t\tconst data = {\r\n\t\t\t\t\t\tWaybillLocalSignType: 'ResponsiblePersonTillReturned',\r\n\t\t\t\t\t\tWaybillLocalId: doc.roumingId,\r\n\t\t\t\t\t\tResponsiblePersonPinfl: profile.tin,\r\n\t\t\t\t\t\tNotes: note\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpkcs.sign = await dispatch(signData(JSON.stringify(data), keyId))\r\n\t\t\t\t\tpkcs.success = true\r\n\t\t\t\t} else if (doc.stateId === 160 && !isResponsiblePerson) {\r\n\t\t\t\t\tpkcs = await fetchWaybillLocalSign(doc._id, 'consignee', 6)\r\n\t\t\t\t} else if (isResponsiblePerson && [160, 170].includes(doc.stateId)) {\r\n\t\t\t\t\tconst data = {\r\n\t\t\t\t\t\tWaybillLocalSignType: 'ResponsiblePersonReturned',\r\n\t\t\t\t\t\tWaybillLocalId: doc.roumingId,\r\n\t\t\t\t\t\tResponsiblePersonPinfl: profile.tin,\r\n\t\t\t\t\t\tNotes: note\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpkcs.sign = await dispatch(signData(JSON.stringify(data), keyId))\r\n\t\t\t\t\tpkcs.success = true\r\n\t\t\t\t} else if (doc.stateId === 150) {\r\n\t\t\t\t\tconst data = {\r\n\t\t\t\t\t\tWaybillLocalId: doc.roumingId,\r\n\t\t\t\t\t\tWaybillLocalSignType: 'ConsignorReturnAccepted',\r\n\t\t\t\t\t\tConsignorTinOrPinfl: profile.tin\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpkcs.sign = await dispatch(signData(JSON.stringify(data), keyId))\r\n\t\t\t\t\tpkcs.success = true\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tpkcs = await fetchSignedFile(type, id as string, side)\r\n\t\t\t}\r\n\r\n\t\t\tif (!pkcs.success) {\r\n\t\t\t\tthrow new Error('no sign on document')\r\n\t\t\t}\r\n\r\n\t\t\t//тут pkcs7 формируется\r\n\t\t\tlet pkcs7 = null\r\n\r\n\t\t\tif (doc.type === 'waybillLocal' && isResponsiblePerson && [160, 170].includes(doc.stateId)) {\r\n\t\t\t\tpkcs7 = pkcs.sign\r\n\t\t\t} else {\r\n\t\t\t\tif (doc.type === 'waybillLocal') {\r\n\t\t\t\t\twaybillLocalUnwantedKeys.map(k => {\r\n\t\t\t\t\t\tdelete signedData.WaybillLocal[k]\r\n\t\t\t\t\t})\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (signedData.WaybillLocal.waybilllocaltypename) {\r\n\t\t\t\t\t\t\tdelete signedData.WaybillLocal.waybilllocaltypename\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (signedData.WaybillLocal.singlesidedtype) {\r\n\t\t\t\t\t\t\tdelete signedData.WaybillLocal.singlesidedtype\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (signedData.WaybillLocal.singlesidedtypename) {\r\n\t\t\t\t\t\t\tdelete signedData.WaybillLocal.singlesidedtypename\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpkcs7 = await dispatch(signData(JSON.stringify(signedData), keyId))\r\n\t\t\t\t}\r\n\t\t\t\tif (doc.stateId === 150) {\r\n\t\t\t\t\tpkcs7 = pkcs.sign\r\n\t\t\t\t} else if (!isResponsiblePerson && doc.stateId !== 140) {\r\n\t\t\t\t\tpkcs7 = await dispatch(signData(JSON.stringify(signedData), keyId))\r\n\t\t\t\t} else if (isResponsiblePerson && doc.stateId === 140) {\r\n\t\t\t\t\tpkcs7 = pkcs.sign\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (doc.type !== 'waybillLocal') {\r\n\t\t\t\t\tsignedData[nameData] = await dispatch(getAttachedInfo(pkcs?.sign, true))\r\n\t\t\t\t\tpkcs7 = await dispatch(signData(JSON.stringify(signedData), keyId))\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//тут происходит сам процесс подписания\r\n\t\t\tif (!!pkcs7) {\r\n\t\t\t\tlet res = null\r\n\t\t\t\tif (doc.type === 'waybillLocal' && isResponsiblePerson && [160, 170].includes(doc.stateId)) {\r\n\t\t\t\t\tres = await fetchWaybillLocalMethods(doc._id, pkcs7, 'return')\r\n\t\t\t\t} else if (doc.type === 'waybillLocal' && doc.stateId === 150) {\r\n\t\t\t\t\tres = await fetchWaybillLocalMethods(doc._id, pkcs7, 'return')\r\n\t\t\t\t} else if (doc.type === 'waybillLocal' && doc.stateId === 140 && isResponsiblePerson) {\r\n\t\t\t\t\tres = await fetchWaybillLocalMethods(doc._id, pkcs7, waybillLocalActions[doc.stateId])\r\n\t\t\t\t} else {\r\n\t\t\t\t\tres = await fetchRejectDocument(type, id, pkcs7)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tawait dispatch(fetchDocCounts('all'))\r\n\t\t\t\tawait fetchRefreshDocument(type, id)\r\n\t\t\t\tif (res?.status === 200) {\r\n\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\t\tmessage: t('alertTitles.docRejected'),\r\n\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t)\r\n\t\t\t\t\tnavigate(-1)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tconsole.log('Ошибка при загрузке данных:', error)\r\n\t\t} finally {\r\n\t\t\tdisabled.off()\r\n\t\t}\r\n\t}, [])\r\n\r\n\tconst deleteItem = useCallback(async () => {\r\n\t\tawait confirm({\r\n\t\t\ttitle: `${t('alertTitles.warning')} !`,\r\n\t\t\tdescription: `${t('DELETE_SELECTED')} 1`,\r\n\t\t\tcancellationText: t('NO'),\r\n\t\t\tconfirmationText: t('YES')\r\n\t\t})\r\n\t\t\t.then(async () => {\r\n\t\t\t\tdisabled.on()\r\n\t\t\t\t// await fetchEraseDocument(type!, id!)\r\n\t\t\t\tconst doc = await fetchDocument(type!, id!)\r\n\t\t\t\tlet pkcs7 = ''\r\n\t\t\t\tif (io === 'out' && status === 'sended') {\r\n\t\t\t\t\tlet data: any = {}\r\n\t\t\t\t\tif (type === 'factura') {\r\n\t\t\t\t\t\tdata.SellerTin = profile.tin\r\n\t\t\t\t\t\tdata.FacturaId = doc.data.facturaid\r\n\t\t\t\t\t} else if (type === 'empowerment') {\r\n\t\t\t\t\t\tdata.BuyerTin = profile.tin\r\n\t\t\t\t\t\tdata.EmpowermentId = doc.data.empowermentid\r\n\t\t\t\t\t} else if (type === 'waybill') {\r\n\t\t\t\t\t\tdata.CarrierTin = profile.tin\r\n\t\t\t\t\t\tdata.WaybillIds = doc.data.waybillids\r\n\t\t\t\t\t} else if (type === 'actWorkPerformed') {\r\n\t\t\t\t\t\tdata.SellerTin = profile.tin\r\n\t\t\t\t\t\tdata.ActId = doc.data.actid\r\n\t\t\t\t\t} else if (type === 'contract') {\r\n\t\t\t\t\t\tdata.OwnerTin = profile.tin\r\n\t\t\t\t\t\tdata.ContractId = doc.data.contractid\r\n\t\t\t\t\t} else if (type === 'actVerification') {\r\n\t\t\t\t\t\tdata.OwnerTin = profile.tin\r\n\t\t\t\t\t\tdata.VerificationActId = doc.data.verificationactid\r\n\t\t\t\t\t} else if (type == 'actGoodsAcceptance') {\r\n\t\t\t\t\t\tdata.CarrierTin = profile.tin\r\n\t\t\t\t\t\tdata.ActId = doc.data.actid\r\n\t\t\t\t\t} else if (type === 'waybillLocal') {\r\n\t\t\t\t\t\tconst doc = await fetchDocument(type!, id!)\r\n\t\t\t\t\t\tdata = {\r\n\t\t\t\t\t\t\tWaybillLocalSignType: 'ConsignorCanceled',\r\n\t\t\t\t\t\t\tWaybillLocalId: doc?.roumingId || '',\r\n\t\t\t\t\t\t\tConsignorTinOrPinfl: profile.tin\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdata.OwnerTin = profile.tin\r\n\t\t\t\t\t\tdata.Type = type\r\n\t\t\t\t\t\tdata.Id = id\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpkcs7 = (await dispatch(signData(JSON.stringify(data), keyId))) as string\r\n\t\t\t\t}\r\n\t\t\t\tconst res = await fetchDeleteDocument(type, id, pkcs7)\r\n\t\t\t\tdispatch(fetchDocCounts(filterReducer.docType !== 'all' ? filterReducer.docType : 'all'))\r\n\t\t\t\tif (res?.status === 200) {\r\n\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\t\tmessage: t('alertTitles.docDeleted'),\r\n\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t\tnavigate(-1)\r\n\t\t\t})\r\n\t\t\t.catch()\r\n\t\t\t.finally(() => disabled.off())\r\n\t}, [])\r\n\r\n\tconst eraseItem = useCallback(async () => {\r\n\t\tif (!type || !id) return\r\n\t\tawait confirm({\r\n\t\t\ttitle: `${t('alertTitles.warning')} !`,\r\n\t\t\tdescription: `${t('DELETE_SELECTED')} 1`,\r\n\t\t\tcancellationText: t('NO'),\r\n\t\t\tconfirmationText: t('YES')\r\n\t\t})\r\n\t\t\t.then(async () => {\r\n\t\t\t\tdisabled.on()\r\n\t\t\t\tawait fetchEraseDocument(type, id)\r\n\t\t\t\tdispatch(fetchDocCounts(filterReducer.docType !== 'all' ? filterReducer.docType : 'all'))\r\n\t\t\t\tnavigate(-1)\r\n\t\t\t})\r\n\t\t\t.catch()\r\n\t\t\t.finally(() => disabled.off())\r\n\t}, [])\r\n\r\n\tconst createBased = useCallback((props: ICreateBased) => {\r\n\t\tlet { newDoc, id, identificator, based } = props\r\n\t\tconst navParams = {\r\n\t\t\tstate: {\r\n\t\t\t\tid: identificator,\r\n\t\t\t\tbased: based,\r\n\t\t\t\tnewDoc: '',\r\n\t\t\t\tcorrected: false,\r\n\t\t\t\tadditional: false\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (newDoc === 'copy') {\r\n\t\t\tnewDoc = based\r\n\t\t\tconst foundDoc = listOfDocumentCategories.find(item => item.name.toLowerCase() === based?.toLowerCase())\r\n\t\t\tnavParams.state.newDoc = foundDoc?.name || ''\r\n\t\t\tif (based === 'factura') {\r\n\t\t\t\tif (id === 4) {\r\n\t\t\t\t\tnavParams.state.corrected = true\r\n\t\t\t\t} else if (id === 5) {\r\n\t\t\t\t\tnavParams.state.additional = true\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconst foundDoc = listOfDocumentCategories.find(item => item.name.toLowerCase() === newDoc?.toLowerCase())\r\n\t\t\tnavParams.state.newDoc = foundDoc?.name || ''\r\n\t\t}\r\n\t\tnavigate(`/document/${newDoc}`, { state: navParams })\r\n\t}, [])\r\n\r\n\treturn {\r\n\t\tcreateBased,\r\n\t\teraseItem,\r\n\t\tdeleteItem,\r\n\t\trejectItem,\r\n\t\teditDocument,\r\n\t\tdisabled\r\n\t}\r\n}\r\n","import React, { useMemo, useState } from 'react'\r\nimport {\r\n\tMenu,\r\n\tCard,\r\n\tMenuItem,\r\n\tBox,\r\n\tDialog,\r\n\tDialogContentText,\r\n\tDialogActions,\r\n\tButton,\r\n\tStack,\r\n\tDialogTitle,\r\n\tTypography\r\n} from '@mui/material'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { Icon } from '@iconify/react'\r\nimport { useNavigate } from 'react-router-dom'\r\nimport { listOfDocumentCategories } from '../../../data/lists'\r\nimport useToggle from '../../../hooks/useToggle'\r\nimport { Translate } from '../translate/Translate'\r\nimport { fetchDocument } from '../../../redux/actions/DocumentsActions'\r\nimport { IContractEntity } from '../../../models'\r\nimport add from '@iconify/icons-carbon/document-add'\r\n\r\nconst RowMoreDocuments = ({\r\n\tidentificator,\r\n\ttype,\r\n\tstatus,\r\n\tstateId,\r\n\tio\r\n}: {\r\n\tidentificator: string\r\n\ttype: string\r\n\tstatus: string\r\n\tstateId: number\r\n\tio?: string\r\n}) => {\r\n\tconst modal = useToggle(false)\r\n\tconst [contractClients, setContractClients] = useState([])\r\n\r\n\tconst moreDocCateg = useMemo(() => {\r\n\t\tlet documents = []\r\n\t\tif (type === 'factura') {\r\n\t\t\tdocuments.push(\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 1,\r\n\t\t\t\t\tlabel: 'CREATE_ON_BASE.actWorkPerformed',\r\n\t\t\t\t\tnewDoc: 'actWorkPerformed'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 2,\r\n\t\t\t\t\tlabel: 'CREATE_ON_BASE.actGoodsAcceptance',\r\n\t\t\t\t\tnewDoc: 'actGoodsAcceptance'\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tid: 3,\r\n\t\t\t\t\tlabel: 'CREATE_ON_BASE.waybillLocal',\r\n\t\t\t\t\tnewDoc: 'waybillLocal'\r\n\t\t\t\t}\r\n\t\t\t)\r\n\r\n\t\t\tif (status === 'signed') {\r\n\t\t\t\tdocuments.push(\r\n\t\t\t\t\t{ id: 4, label: 'CREATE_ON_BASE.facturaCorrected', newDoc: 'copy' },\r\n\t\t\t\t\t{ id: 5, label: 'CREATE_ON_BASE.facturaAdditional', newDoc: 'copy' }\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t} else if (type === 'waybillLocal' && stateId === 180) {\r\n\t\t\tdocuments.push({ id: 7, label: 'CREATE_ON_BASE.waybillLocalCorrected', newDoc: 'copy' })\r\n\t\t} else if (type === 'waybillLocal' && [160, 180].includes(stateId)) {\r\n\t\t\tdocuments.push({ id: 8, label: 'CREATE_ON_BASE.waybillLocalAdditional', newDoc: 'copy' })\r\n\t\t} else if (type === 'contract') {\r\n\t\t\tif (io === 'in') {\r\n\t\t\t\tdocuments.push({ id: 10, label: 'CREATE_ON_BASE.empowerment', newDoc: 'empowerment' })\r\n\t\t\t} else {\r\n\t\t\t\tdocuments.push({ id: 9, label: 'CREATE_ON_BASE.factura', newDoc: 'factura' })\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (['waybillLocal', 'actWorkPerformed', 'actGoodsAcceptance', 'empowerment'].includes(type)) {\r\n\t\t\tdocuments.push({\r\n\t\t\t\tid: 6,\r\n\t\t\t\tlabel: 'CREATE_ON_BASE.factura',\r\n\t\t\t\tnewDoc: 'factura'\r\n\t\t\t})\r\n\t\t}\r\n\r\n\t\treturn documents\r\n\t}, [status, type, stateId])\r\n\r\n\tconst { t } = useTranslation()\r\n\tconst navigate = useNavigate()\r\n\r\n\tconst [anchorEl, setAnchorEl] = useState(null)\r\n\r\n\tconst handlePoperClick = (event: React.MouseEvent) => {\r\n\t\tif (moreDocCateg.length === 1) {\r\n\t\t\tcreateBasedDoc(moreDocCateg[0].newDoc, identificator, type, moreDocCateg[0].id, stateId)\r\n\t\t} else {\r\n\t\t\tsetAnchorEl(event.currentTarget)\r\n\t\t}\r\n\t}\r\n\r\n\tconst handlePoperClose = () => {\r\n\t\tsetAnchorEl(null)\r\n\t}\r\n\r\n\tconst filterPopover = Boolean(anchorEl)\r\n\tconst idPopover = filterPopover ? 'more-popover' : undefined\r\n\r\n\tconst createBasedDoc = (\r\n\t\tnewDoc: string | undefined,\r\n\t\tidentificator: string,\r\n\t\tbased: string,\r\n\t\tid: number,\r\n\t\tstateId: number\r\n\t) => {\r\n\t\tconst navParams = {\r\n\t\t\tstate: {\r\n\t\t\t\tid: identificator,\r\n\t\t\t\tbased: based,\r\n\t\t\t\tnewDoc: '',\r\n\t\t\t\tcorrected: false,\r\n\t\t\t\tadditional: false,\r\n\t\t\t\tstateId\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (newDoc === 'copy') {\r\n\t\t\tnewDoc = based\r\n\t\t\tconst foundDoc = listOfDocumentCategories.find(item => item.name.toLowerCase() === based?.toLowerCase())\r\n\t\t\tnavParams.state.newDoc = foundDoc?.name || ''\r\n\t\t\tif (based === 'factura') {\r\n\t\t\t\tif (id === 4) {\r\n\t\t\t\t\tnavParams.state.corrected = true\r\n\t\t\t\t} else if (id === 5) {\r\n\t\t\t\t\tnavParams.state.additional = true\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (based === 'waybillLocal') {\r\n\t\t\t\tif (id === 7) {\r\n\t\t\t\t\tnavParams.state.corrected = true\r\n\t\t\t\t} else if (id === 8) {\r\n\t\t\t\t\tnavParams.state.additional = true\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconst foundDoc = listOfDocumentCategories.find(item => item.name.toLowerCase() === newDoc?.toLowerCase())\r\n\t\t\tnavParams.state.newDoc = foundDoc?.name || ''\r\n\t\t}\r\n\t\tif (based === 'contract') {\r\n\t\t\tcheckContract()\r\n\t\t} else {\r\n\t\t\tnavigate(`/document/${newDoc}`, { state: navParams })\r\n\t\t}\r\n\t}\r\n\r\n\tconst checkContract = async () => {\r\n\t\tconst res = await fetchDocument(type, identificator)\r\n\t\tif (!res.data) return\r\n\r\n\t\tif (res.data.clients?.length > 1) {\r\n\t\t\tmodal.on()\r\n\t\t\tsetContractClients(res.data.clients)\r\n\t\t} else {\r\n\t\t\tredirectToNewDoc(res.data.clients[0].tin)\r\n\t\t}\r\n\t}\r\n\r\n\tconst redirectToNewDoc = (tin: string) => {\r\n\t\tconst navParams = {\r\n\t\t\tstate: {\r\n\t\t\t\tid: identificator,\r\n\t\t\t\tbased: type,\r\n\t\t\t\tnewDoc: '',\r\n\t\t\t\tcorrected: false,\r\n\t\t\t\tadditional: false,\r\n\t\t\t\ttargetTin: tin,\r\n\t\t\t\tstateId\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst newDoc = io === 'in' ? 'empowerment' : 'factura'\r\n\r\n\t\tconst foundDoc = listOfDocumentCategories.find(item => item.name.toLowerCase() === newDoc?.toLowerCase())\r\n\t\tnavParams.state.newDoc = foundDoc?.name || ''\r\n\r\n\t\tnavigate(`/document/${newDoc}`, { state: navParams })\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t modal.off()}>\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{contractClients.length\r\n\t\t\t\t\t\t\t? contractClients.map(client => (\r\n\t\t\t\t\t\t\t\t\t redirectToNewDoc(client.tin)}\r\n\t\t\t\t\t\t\t\t\t\tkey={client.tin}\r\n\t\t\t\t\t\t\t\t\t\tsx={{ p: 1, mt: 1, borderRadius: 1, border: '1px solid #888', cursor: 'pointer' }}\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t   {client.tin}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t   {client.name}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t ))\r\n\t\t\t\t\t\t\t: null}\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{moreDocCateg.map(item => (\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\tcreateBasedDoc(item!.newDoc, identificator, type, item.id, stateId)\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{t(item.label)}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t))}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default RowMoreDocuments\r\n","import React, { memo, useMemo } from 'react'\r\nimport { Box, Typography, Table, TableHead, TableRow, TableCell, TableBody, Chip, Button } from '@mui/material'\r\n\r\nimport { MARK_TYPES } from '../../../data/marks'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useCopy } from '../../../hooks/useCopy'\r\nimport * as XLSX from 'xlsx'\r\n\r\ninterface MarksData {\r\n\tproduct_name: string;\r\n\tproduct_type: string;\r\n\tpackage_type: string;\r\n\tmark_code: string;\r\n}\r\n\r\nconst RenderMarksList = memo(({ doc }: { doc: any }) => {\r\n\tconst { t } = useTranslation()\r\n\tconst { copyToClipboard } = useCopy()\r\n\r\n\tconst tableHeads = useMemo(\r\n\t\t() => [\r\n\t\t\t{ id: 1, name: '№' },\r\n\t\t\t{ id: 2, name: t('open_file_table_heads.product_name') },\r\n\t\t\t{ id: 3, name: t('open_file_table_heads.product_type') },\r\n\t\t\t{ id: 4, name: t('open_file_table_heads.package_type') }\r\n\t\t],\r\n\t\t[]\r\n\t)\r\n\r\n\tconst splitMarks = (item: any) => {\r\n\t\tlet marks = { consumer: [], group: [], transport: [] }\r\n\r\n\t\tif (item?.marks?.kiz?.length) {\r\n\t\t\tmarks.consumer = item.marks.kiz\r\n\t\t}\r\n\t\tif (item?.marks?.nomupak?.length) {\r\n\t\t\tmarks.group = item.marks.nomupak\r\n\t\t}\r\n\t\tif (item?.marks?.identtransupak?.length) {\r\n\t\t\tmarks.transport = item.marks.identtransupak\r\n\t\t}\r\n\t\treturn marks\r\n\t}\r\n\r\n\tconst downloadMarksAsExcel = () => {\r\n\t\tconst marksData: MarksData[] = []\r\n\t\tdoc?.data?.productlist?.products?.forEach((item: any) => {\r\n\t\t\tconst marks = splitMarks(item)\r\n\t\r\n\t\t\tconst allMarks = [\r\n\t\t\t\t...marks.consumer.map((mark) => ({ mark, packageType: 'consumer' })),\r\n\t\t\t\t...marks.group.map((mark) => ({ mark, packageType: 'group' })),\r\n\t\t\t\t...marks.transport.map((mark) => ({ mark, packageType: 'transport' }))\r\n\t\t\t]\r\n\t\t\t\r\n\t\t\tallMarks.forEach(({ mark, packageType }, index) => {\r\n\t\t\t\tconst productData = {\r\n\t\t\t\t\tproduct_name: index === 0 ? item.name : '',\r\n\t\t\t\t\tproduct_type: index === 0 ? t(\r\n\t\t\t\t\t\t`MARKS.${\r\n\t\t\t\t\t\t\tMARK_TYPES.find(mark => mark.value === item.marks?.producttype)?.name || 'not_selected'\r\n\t\t\t\t\t\t}`) : '',\r\n\t\t\t\t\tpackage_type: t(`PACKAGES.${packageType || 'not_selected'}`),\r\n\t\t\t\t\tmark_code: mark\r\n\t\t\t\t}\r\n\t\t\t\tmarksData.push(productData)\r\n\t\t\t})\r\n\t\t})\r\n\r\n\r\n\t\tconst ws = XLSX.utils.json_to_sheet(marksData, {\r\n\t\t\theader: [],\r\n\t\t\tskipHeader: true\r\n\t\t})\r\n\r\n const wb = XLSX.utils.book_new()\r\n XLSX.utils.book_append_sheet(wb, ws, 'Marks')\r\n\r\n XLSX.writeFile(wb, 'коды маркировки.xlsx')\r\n}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{tableHeads.map(cell => (\r\n\t\t\t\t\t\t\t{cell.name}\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{doc?.data?.productlist?.products?.map((item: any, index: number) => (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{index + 1}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{item.name}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{t(\r\n\t\t\t\t\t\t\t\t\t\t`MARKS.${\r\n\t\t\t\t\t\t\t\t\t\t\tMARK_TYPES.find(mark => mark.value === (item && item.marks ? item.marks.producttype : null))\r\n\t\t\t\t\t\t\t\t\t\t\t\t?.name || 'not_selected'\r\n\t\t\t\t\t\t\t\t\t\t}`\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{Object.entries(splitMarks(item)).map(([markType, marks]) =>\r\n\t\t\t\t\t\t\t\t\tmarks.length ? (\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{t(`PACKAGES.${markType || 'not_selected'}`)}:\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t{marks.map((mark: string) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t copyToClipboard(mark)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolor='info'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsize='small'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t) : null\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t))}\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t\r\n\t)\r\n})\r\n\r\nexport default RenderMarksList\r\n","import React, { useEffect, useRef, useState, useMemo } from 'react'\r\nimport { useLocation, useNavigate, useParams } from 'react-router-dom'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { format } from 'date-fns'\r\nimport './index.scss'\r\n//redux\r\nimport { appSlice } from '../../../redux/reducers/AppReducer'\r\nimport { appendSign, signData } from '../../../redux/actions/EimzoActions'\r\nimport { fetchProfileType } from '../../../redux/actions/ProfileActions'\r\nimport {\r\n\tgetDownloadDocument,\r\n\tgetPrintDocument,\r\n\tfetchDocument,\r\n\tfetchSignedFile,\r\n\tfetchSignDocument,\r\n\tfetchRefreshDocument,\r\n\tfetchEditDocument,\r\n\tfetchWaybillLocalSign,\r\n\tfetchWaybillLocalMethods,\r\n\tfetchReadDocument\r\n} from '../../../redux/actions/DocumentsActions'\r\n//hooks and utils\r\nimport useToggle from '../../../hooks/useToggle'\r\nimport { useAppDispatch, useAppSelector } from '../../../hooks/redux'\r\nimport { useProfileGetter } from '../../../hooks/useProfile'\r\nimport { useOpenFile } from '../../../hooks/use-open-file'\r\n//material\r\nimport {\r\n\tBox,\r\n\tButton,\r\n\tButtonGroup,\r\n\tCard,\r\n\tStack,\r\n\tTextField,\r\n\tTypography,\r\n\tDialog,\r\n\tDialogActions,\r\n\tDialogContent,\r\n\tDialogTitle\r\n} from '@mui/material'\r\nimport LoadingButton from '@mui/lab/LoadingButton'\r\n// icons\r\nimport { Icon } from '@iconify/react'\r\nimport backIcon from '@iconify/icons-carbon/arrow-left'\r\nimport update from '@iconify/icons-carbon/update-now'\r\nimport sign from '@iconify/icons-carbon/document-tasks'\r\nimport reject from '@iconify/icons-carbon/document-subtract'\r\nimport pdfDoc from '@iconify/icons-carbon/generate-pdf'\r\nimport print from '@iconify/icons-carbon/printer'\r\nimport edit from '@iconify/icons-carbon/edit'\r\nimport eraseBtn from '@iconify/icons-carbon/column-delete'\r\nimport trashCan from '@iconify/icons-carbon/trash-can'\r\nimport copy from '@iconify/icons-carbon/copy-file'\r\nimport barCode from '@iconify/icons-carbon/barcode'\r\n//components\r\nimport RowMoreDocuments from '../tables/RowMoreDocuments'\r\nimport RenderMarksList from '../tables/RenderMarksList'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\ninterface IStateProps {\r\n\ttype: string\r\n\tio: string\r\n\tstatus: string\r\n\t_id: string\r\n}\r\n\r\nconst waybillLocalActions: Record = {\r\n\t110: 'accept',\r\n\t140: 'give',\r\n\t160: 'accept',\r\n\t150: 'return',\r\n\t190: 'return'\r\n}\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst OpenFile = () => {\r\n\tconst { type, id } = useParams()\r\n\tconst { t } = useTranslation()\r\n\tconst dispatch = useAppDispatch()\r\n\tconst navigate = useNavigate()\r\n\tconst location = useLocation().state as IStateProps\r\n\tconst isUniversal = location.type === 'universal'\r\n\r\n\tconst [lastScrollY, setLastScrollY] = useState(0)\r\n\tconst [topValue, setTopValue] = useState('52px')\r\n\r\n\tconst [link, setLink] = useState('')\r\n\tconst [doc, setDoc] = useState({})\r\n\tconst ref = useRef(null)\r\n\r\n\tconst profile = useProfileGetter.useGetProfile()\r\n\tconst isAuthWithPassword = !!profile.isAuthWithPassword\r\n\tconst keyId = profile?.keyId || ''\r\n\r\n\tconst marksModal = useToggle(false)\r\n\tconst isSidebarShown = useAppSelector(state => state.appReducer.showSidebar)\r\n\r\n\tconst isWaybillLocalType = type === 'waybillLocal'\r\n\tconst isConsignor = doc?.data?.consignor?.tinorpinfl === profile.tin\r\n\tconst isConsignee = doc?.data?.consignee?.tinorpinfl === profile.tin\r\n\tconst isRespPerson = doc?.data?.responsibleperson?.pinfl === profile.tin\r\n\r\n\tconst handleOpenMarks = () => marksModal.on()\r\n\tconst handleCloseMarks = () => marksModal.off()\r\n\r\n\tconst { createBased, eraseItem, deleteItem, rejectItem, editDocument, disabled } = useOpenFile({\r\n\t\ttype: location.type,\r\n\t\tid: id as string,\r\n\t\tio: location.io,\r\n\t\tstatus: location.status\r\n\t})\r\n\r\n\tconst createBasedDoc = (newDoc: string | undefined, identificator: string, based: string, id: number) => {\r\n\t\tcreateBased({ newDoc, id, identificator, based })\r\n\t}\r\n\r\n\tconst comment = useRef(null)\r\n\tconst rejectModal = useToggle(false)\r\n\tconst noCommentError = useToggle(false)\r\n\r\n\tconst handleDocumentReject = () => {\r\n\t\tif (!comment.current) return\r\n\r\n\t\tif (comment.current.value.trim()) {\r\n\t\t\trejectItem(comment.current.value.trim())\r\n\t\t\trejectModal.off()\r\n\t\t\tnoCommentError.off()\r\n\t\t} else {\r\n\t\t\tnoCommentError.on()\r\n\t\t}\r\n\t}\r\n\r\n\tconst fetchPrintDocument = async () => {\r\n\t\tif (!type && !id) return\r\n\r\n\t\tconst [res, res2] = await Promise.all([\r\n\t\t\t//@ts-ignore\r\n\t\t\tgetPrintDocument(type, id),\r\n\t\t\t//@ts-ignore\r\n\t\t\tfetchDocument(type, id)\r\n\t\t])\r\n\t\tif (!!res2._id) {\r\n\t\t\tsetDoc(res2)\r\n\t\t}\r\n\t\tsetLink(res)\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tfetchPrintDocument()\r\n\t}, [])\r\n\r\n\tconst goBack = () => {\r\n\t\tnavigate(-1)\r\n\t}\r\n\r\n\tconst { REACT_APP_DEVELOPMENT_URL } = process.env\r\n\tconst printDoc = () => {\r\n\t\twindow.open(`${REACT_APP_DEVELOPMENT_URL}/documents/${type}/${id}/file/file`)\r\n\t}\r\n\r\n\tconst printProtocol = async () => {\r\n\t\twindow.open(`${REACT_APP_DEVELOPMENT_URL}/documents/${type}/${id}/false/file`)\r\n\t}\r\n\r\n\tconst downloadPdf = async () => {\r\n\t\tconst res = await getDownloadDocument(type!, id!)\r\n\t\tconst downloadElement = document.createElement('a')\r\n\t\tdownloadElement.href = 'data:application/pdf;base64,' + res.base64\r\n\t\tdownloadElement.download = `${type}-${id}`\r\n\t\tdownloadElement.click()\r\n\t}\r\n\r\n\tconst renewDocument = async (type: string, id: string) => {\r\n\t\tif (type === 'actGoodsAcceptance' || type === 'universal' || type === 'invoice') {\r\n\t\t\treturn\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tdisabled.on()\r\n\t\t\tconst res = await fetchRefreshDocument(type, id, false)\r\n\t\t\tif (res?.status === 200) {\r\n\t\t\t\tfetchPrintDocument()\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\tmessage: t('alertTitles.docUpdate'),\r\n\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t} else if (location.type === 'factura' && location.status === 'drafts') {\r\n\t\t\t\trefreshDraft(type, id)\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\tconsole.log(e)\r\n\t\t} finally {\r\n\t\t\tdisabled.off()\r\n\t\t}\r\n\t}\r\n\r\n\tconst signDocument = async () => {\r\n\t\tlet signRes = null\r\n\t\tif (\r\n\t\t\tdoc?.data &&\r\n\t\t\t!Object.hasOwn(doc.data, 'signed') &&\r\n\t\t\tObject.hasOwn(doc.data, 'facturaid') &&\r\n\t\t\tlocation.io === 'in'\r\n\t\t) {\r\n\t\t\tsignRes = await fetchSignedFile(\r\n\t\t\t\tlocation.type,\r\n\t\t\t\tid as string,\r\n\t\t\t\tdoc.data.buyertin === profile?.tin ? 'buyer' : 'agent'\r\n\t\t\t)\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tdisabled.on()\r\n\t\t\tlet doc = await fetchDocument(type!, id!)\r\n\t\t\tlet pkcs7: any = ''\r\n\t\t\tif (location.io === 'out' && doc.status === 'drafts' && doc.type === 'empowerment') {\r\n\t\t\t\tif (\r\n\t\t\t\t\tdoc.data.agent.jobtitle != null ||\r\n\t\t\t\t\tdoc.data.agent.passport.dateofissue != null ||\r\n\t\t\t\t\tdoc.data.agent.passport.issuedby != null ||\r\n\t\t\t\t\tdoc.data.agent.passport.number != null\r\n\t\t\t\t) {\r\n\t\t\t\t\tlet newDoc = JSON.parse(JSON.stringify(doc))\r\n\t\t\t\t\tnewDoc.data.agent.jobtitle = null\r\n\t\t\t\t\tnewDoc.data.agent.passport.dateofissue = null\r\n\t\t\t\t\tnewDoc.data.agent.passport.issuedby = null\r\n\t\t\t\t\tnewDoc.data.agent.passport.number = null\r\n\t\t\t\t\tawait fetchEditDocument(newDoc.type, newDoc._id, newDoc.data)\r\n\t\t\t\t\tdoc = await fetchDocument(newDoc.type, newDoc._id)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (location.io === 'out' && doc.status === 'drafts' && doc.type === 'factura') {\r\n\t\t\t\tif (\r\n\t\t\t\t\tdoc.data.hasOwnProperty('realizationpurpose') ||\r\n\t\t\t\t\tdoc.data.seller.hasOwnProperty('category') ||\r\n\t\t\t\t\tdoc.data.seller?.taxgap !== null ||\r\n\t\t\t\t\tdoc.data.buyer?.taxgap !== null\r\n\t\t\t\t) {\r\n\t\t\t\t\tlet newDoc = JSON.parse(JSON.stringify(doc))\r\n\t\t\t\t\tdelete newDoc.data?.realizationpurpose\r\n\t\t\t\t\tdelete newDoc.data.seller?.category\r\n\t\t\t\t\tdelete newDoc.data.seller?.taxgap\r\n\t\t\t\t\tdelete newDoc.data.buyer?.taxgap\r\n\t\t\t\t\tawait fetchEditDocument(newDoc.type, newDoc._id, newDoc.data)\r\n\t\t\t\t\tdoc = await fetchDocument(newDoc.type, newDoc._id)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (location.io === 'out' && doc.status === 'drafts') {\r\n\t\t\t\t// @ts-ignore\r\n\t\t\t\tpkcs7 = await dispatch(signData(JSON.stringify(doc.data), keyId))\r\n\t\t\t} else if (location.io === 'in' && doc.status === 'sended' && doc.type === 'empowerment') {\r\n\t\t\t\tlet agent = doc.targetTins.find((obj: any) => obj.side === 'agent')\r\n\t\t\t\tlet sign = await fetchSignedFile('empowerment', doc._id, profile?.personalNum == agent.tin ? 'agent' : 'seller')\r\n\t\t\t\tif (!sign) return\r\n\t\t\t\tpkcs7 = await dispatch(appendSign(sign.sign, keyId))\r\n\t\t\t} else if (location.io === 'in' && doc.status === 'sended' && doc.type === 'contract') {\r\n\t\t\t\tlet client = doc.targetTins.find((obj: any) => obj.side === 'client' && obj.tin === profile?.tin)\r\n\t\t\t\tif (!client) return\r\n\t\t\t\tlet sign = await fetchSignedFile('contract', doc._id, 'client')\r\n\t\t\t\tif (!sign) return\r\n\t\t\t\t//@ts-ignore\r\n\t\t\t\tpkcs7 = await dispatch(appendSign(sign.sign, keyId))\r\n\t\t\t} else if (\r\n\t\t\t\tlocation.io === 'in' &&\r\n\t\t\t\tdoc.status === 'sended' &&\r\n\t\t\t\tdoc.type !== 'waybillLocal' &&\r\n\t\t\t\t['actWorkPerformed', 'actVerification', 'actGoodsAcceptance', 'universal', 'invoice'].includes(doc.type)\r\n\t\t\t) {\r\n\t\t\t\tlet signType = ''\r\n\r\n\t\t\t\tif (doc.type === 'actWorkPerformed' || doc.type === 'invoice') {\r\n\t\t\t\t\tsignType = 'buyer'\r\n\t\t\t\t} else if (doc.type === 'actVerification') {\r\n\t\t\t\t\tsignType = 'partner'\r\n\t\t\t\t} else if (doc.type === 'actGoodsAcceptance' || doc.type === 'universal') {\r\n\t\t\t\t\tsignType = 'client'\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!signRes) {\r\n\t\t\t\t\tsignRes = await fetchSignedFile(\r\n\t\t\t\t\t\tlocation.type,\r\n\t\t\t\t\t\tid as string,\r\n\t\t\t\t\t\tsignType !== 'buyer' ? (signType !== 'partner' ? 'client' : 'partner') : 'buyer'\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t\tconst signature = !!signRes?.sign ? signRes.sign : doc.sign\r\n\t\t\t\t//@ts-ignore\r\n\t\t\t\tpkcs7 = await dispatch(appendSign(signature, keyId))\r\n\t\t\t} else if (location.io === 'in' && doc.status === 'sended' && doc.type === 'factura') {\r\n\t\t\t\tif (!signRes) {\r\n\t\t\t\t\tsignRes = await fetchSignedFile(\r\n\t\t\t\t\t\tlocation.type,\r\n\t\t\t\t\t\tid as string,\r\n\t\t\t\t\t\tdoc.data.buyertin === profile?.tin ? 'buyer' : 'agent'\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t\tconst signature = !!signRes?.sign ? signRes.sign : doc.sign\r\n\t\t\t\t//@ts-ignore\r\n\t\t\t\tpkcs7 = await dispatch(appendSign(signature, keyId))\r\n\t\t\t} else if (location.io === 'in' && doc.status === 'sended' && doc.type === 'waybillLocal') {\r\n\t\t\t\tif (doc.stateId === 110) {\r\n\t\t\t\t\tconst sign = await fetchWaybillLocalSign(doc._id, 'responsibleperson', 1)\r\n\t\t\t\t\tif (!sign?.sign) return\r\n\t\t\t\t\tpkcs7 = await dispatch(appendSign(sign.sign, keyId))\r\n\t\t\t\t} else if (isConsignee && doc.stateId === 140) {\r\n\t\t\t\t\tconst sign = await fetchWaybillLocalSign(doc._id, 'consignee', 1)\r\n\t\t\t\t\tif (!sign?.sign) return\r\n\t\t\t\t\tpkcs7 = await dispatch(appendSign(sign.sign, keyId))\r\n\t\t\t\t} else if (doc.stateId === 140) {\r\n\t\t\t\t\tconst data = {\r\n\t\t\t\t\t\tWaybillLocalId: doc.roumingId,\r\n\t\t\t\t\t\tWaybillLocalSignType: 'ResponsiblePersonGiven',\r\n\t\t\t\t\t\tResponsiblePersonPinfl: profile.tin\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpkcs7 = await dispatch(signData(JSON.stringify(data), keyId))\r\n\t\t\t\t} else if (doc.stateId === 160) {\r\n\t\t\t\t\tconst sign = await fetchWaybillLocalSign(doc._id, 'consignee', 1)\r\n\t\t\t\t\tif (!sign?.sign) return\r\n\t\t\t\t\tpkcs7 = await dispatch(appendSign(sign.sign, keyId))\r\n\t\t\t\t} else if (doc.stateId === 150) {\r\n\t\t\t\t\tconst data = {\r\n\t\t\t\t\t\tWaybillLocalSignType: 'ConsignorReturnAccepted',\r\n\t\t\t\t\t\tWaybillLocalId: doc.roumingId,\r\n\t\t\t\t\t\tConsignorTinOrPinfl: profile.tin\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpkcs7 = await dispatch(signData(JSON.stringify(data), keyId))\r\n\t\t\t\t} else if (doc.stateId === 190) {\r\n\t\t\t\t\tconst data = {\r\n\t\t\t\t\t\tWaybillLocalSignType: 'ConsignorReturnAccepted',\r\n\t\t\t\t\t\tWaybillLocalId: doc.roumingId,\r\n\t\t\t\t\t\tConsignorTinOrPinfl: profile.tin\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpkcs7 = await dispatch(signData(JSON.stringify(data), keyId))\r\n\t\t\t\t}\r\n\t\t\t} else if (\r\n\t\t\t\t['out', 'in'].includes(location.io) &&\r\n\t\t\t\tdoc.type === 'waybillLocal' &&\r\n\t\t\t\t[150, 190].includes(doc.stateId)\r\n\t\t\t) {\r\n\t\t\t\tconst data = {\r\n\t\t\t\t\tWaybillLocalSignType: 'ConsignorReturnAccepted',\r\n\t\t\t\t\tWaybillLocalId: doc.roumingId,\r\n\t\t\t\t\tConsignorTinOrPinfl: profile.tin\r\n\t\t\t\t}\r\n\t\t\t\tpkcs7 = await dispatch(signData(JSON.stringify(data), keyId))\r\n\t\t\t}\r\n\t\t\tif (pkcs7) {\r\n\t\t\t\tlet res = null\r\n\t\t\t\tif (doc.type === 'waybillLocal') {\r\n\t\t\t\t\tconst docStatus = doc.stateId as number\r\n\t\t\t\t\tif (docStatus === 1) {\r\n\t\t\t\t\t\tres = await fetchSignDocument(doc.type, doc._id, pkcs7)\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tres = await fetchWaybillLocalMethods(\r\n\t\t\t\t\t\t\tdoc._id,\r\n\t\t\t\t\t\t\tpkcs7,\r\n\t\t\t\t\t\t\tisConsignee ? 'accept' : waybillLocalActions[docStatus]\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tres = await fetchSignDocument(doc.type, doc._id, pkcs7)\r\n\t\t\t\t}\r\n\t\t\t\tif (res?.status === 200) {\r\n\t\t\t\t\tawait renewDocument(location.type, id!)\r\n\t\t\t\t\tif (doc.type !== 'empowerment') {\r\n\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\t\t\tmessage: t('alertTitles.docSigned'),\r\n\t\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgoBack()\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\tconsole.log(e)\r\n\t\t} finally {\r\n\t\t\tdisabled.off()\r\n\t\t}\r\n\t}\r\n\r\n\tconst fetchSignLetter = async () => {\r\n\t\ttry {\r\n\t\t\tdisabled.on()\r\n\t\t\tlet res = await fetchReadDocument(type!, id!)\r\n\r\n\t\t\tif (res?.status === 200) {\r\n\t\t\t\tawait renewDocument(type!, id!)\r\n\t\t\t\tif (doc.type !== 'empowerment') {\r\n\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\t\tmessage: t('alertTitles.docSigned'),\r\n\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\tconsole.log('Ошибка при подписании письма:', e)\r\n\t\t} finally {\r\n\t\t\tdisabled.off()\r\n\t\t}\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tif (\r\n\t\t\tlocation.status === 'received' &&\r\n\t\t\tlocation.io === 'in' &&\r\n\t\t\tdoc.type === 'letter' &&\r\n\t\t\tdoc.status === 'sended' &&\r\n\t\t\tdoc.stateId === 15\r\n\t\t) {\r\n\t\t\tfetchSignLetter()\r\n\t\t}\r\n\t}, [doc])\r\n\r\n\tconst customBtnLabel = useMemo(() => {\r\n\t\tlet neg = 'common.decline'\r\n\t\tlet pos = 'common.sign'\r\n\r\n\t\tif (isWaybillLocalType) {\r\n\t\t\tneg = 'TTHFORM.reject.'\r\n\t\t\tpos = 'TTHFORM.accept.'\r\n\r\n\t\t\tif (isConsignor && [150, 170, 190].includes(doc.stateId)) {\r\n\t\t\t\tpos += 'returnConfirm'\r\n\t\t\t} else if (isRespPerson && [110].includes(doc.stateId)) {\r\n\t\t\t\tneg += 'reject'\r\n\t\t\t\tpos += 'deliver'\r\n\t\t\t} else if (isRespPerson && [140, 160, 170].includes(doc.stateId)) {\r\n\t\t\t\tneg += 'return'\r\n\t\t\t\tpos += 'delivered'\r\n\t\t\t} else if (isConsignee && [110, 140].includes(doc.stateId)) {\r\n\t\t\t\tneg += 'rejectWithoutRespPerson'\r\n\t\t\t\tpos += 'signWithoutRespPerson'\r\n\t\t\t} else if (isConsignee && [160].includes(doc.stateId)) {\r\n\t\t\t\tneg += 'reject'\r\n\t\t\t\tpos += 'sign'\r\n\t\t\t} else {\r\n\t\t\t\tneg += 'delete'\r\n\t\t\t\tpos = 'common.sign'\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn { pos: t(pos), neg: t(neg) }\r\n\t}, [isWaybillLocalType, doc, isRespPerson, isConsignor, isConsignee])\r\n\r\n\tconst refreshDraft = async (type: string, id: string) => {\r\n\t\ttry {\r\n\t\t\tdispatch(appSlice.actions.toggleSystemLoading(true))\r\n\t\t\tconst doc = await fetchDocument(type, id)\r\n\t\t\tif (doc.type === 'factura' && doc.status === 'drafts') {\r\n\t\t\t\tlet newDocument = JSON.parse(JSON.stringify(doc))\r\n\t\t\t\tnewDocument.data.productlist.products.map((data: any) => {\r\n\t\t\t\t\tlet copyProduct = data\r\n\t\t\t\t\tdata = {}\r\n\t\t\t\t\tdata = copyProduct\r\n\t\t\t\t})\r\n\t\t\t\tlet sellerVatRegStatus = await fetchProfileType(doc.data.sellertin, format(new Date(Date.now()), 'yyyy-MM-dd'))\r\n\t\t\t\tnewDocument.data.seller.vatregstatus = sellerVatRegStatus?.data.data.code\r\n\t\t\t\tif (doc.data.buyertin) {\r\n\t\t\t\t\tlet buyerVatRegStatus = await fetchProfileType(doc.data.buyertin, format(new Date(Date.now()), 'yyyy-MM-dd'))\r\n\t\t\t\t\tnewDocument.data.buyer.vatregstatus = buyerVatRegStatus?.data.data.code\r\n\t\t\t\t}\r\n\t\t\t\tconst res = await fetchEditDocument(newDocument.type, newDocument._id, newDocument.data)\r\n\t\t\t\tdispatch(appSlice.actions.toggleSystemLoading(false))\r\n\t\t\t\tif (res?.status === 200) {\r\n\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\t\tmessage: t('alertTitles.docUpdate'),\r\n\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\tconsole.log(e)\r\n\t\t\t// @ts-ignore\r\n\t\t\tenqueueSnackbar(e.errMsg, { variant: 'error' })\r\n\t\t} finally {\r\n\t\t\tdispatch(appSlice.actions.toggleSystemLoading(false))\r\n\t\t}\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tconst handleScroll = () => {\r\n\t\t\tconst currentScrollY = window.scrollY\r\n\t\t\tif (currentScrollY > lastScrollY && currentScrollY > 70) {\r\n\t\t\t\tsetTopValue('0px')\r\n\t\t\t} else if (currentScrollY <= 70) {\r\n\t\t\t\tsetTopValue('52px')\r\n\t\t\t}\r\n\t\t\tsetLastScrollY(currentScrollY)\r\n\t\t}\r\n\t\twindow.addEventListener('scroll', handleScroll)\r\n\t\treturn () => {\r\n\t\t\twindow.removeEventListener('scroll', handleScroll)\r\n\t\t}\r\n\t}, [lastScrollY])\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{/*Зеленые кнопки*/}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{/*Подпись документа*/}\r\n\t\t\t\t\t\t{((isWaybillLocalType &&\r\n\t\t\t\t\t\t\t((isConsignor && [1, 150, 190].includes(doc.stateId)) ||\r\n\t\t\t\t\t\t\t\t(isRespPerson && [110, 140].includes(doc.stateId)) ||\r\n\t\t\t\t\t\t\t\t(isConsignee && [110, 140, 160].includes(doc.stateId)))) ||\r\n\t\t\t\t\t\t\t(['drafts', 'received'].includes(location.status) && !isWaybillLocalType)) &&\r\n\t\t\t\t\t\t\t!isAuthWithPassword &&\r\n\t\t\t\t\t\t\t!(doc.type === 'letter' && location.status === 'received') && (\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\t\t\t\t\tsx={{\r\n\t\t\t\t\t\t\t\t\t\ttransition: 'all 0.3s ease',\r\n\t\t\t\t\t\t\t\t\t\t'&:hover': {\r\n\t\t\t\t\t\t\t\t\t\t\tborderColor: 'green',\r\n\t\t\t\t\t\t\t\t\t\t\tboxShadow: '0 0 10px rgba(0, 255, 0, 0.5)'\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t {customBtnLabel.pos}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t{/*Желтые кнопки*/}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{/*Печать документ*/}\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t{/*pdf документа*/}\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t{/*Маркировка кода*/}\r\n\t\t\t\t\t\t{location.type === 'factura' && doc.data?.hasmarking === true && (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t{/*Синие кнопки*/}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{/*Обновить документ*/}\r\n\t\t\t\t\t\t{!['universal', 'actGoodsAcceptance', 'invoice'].includes(location.type) &&\r\n\t\t\t\t\t\t\t['sended', 'signed', 'received', 'rejected', 'drafts'].includes(location.status) && (\r\n\t\t\t\t\t\t\t\t renewDocument(location.type, id!)}\r\n\t\t\t\t\t\t\t\t\tloading={disabled.state}\r\n\t\t\t\t\t\t\t\t\tloadingPosition='start'\r\n\t\t\t\t\t\t\t\t\tstartIcon={}\r\n\t\t\t\t\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t{t('common.refresh')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t{/*Редактировать документ*/}\r\n\t\t\t\t\t\t{location.status === 'drafts' && (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t{/*Копировать документ*/}\r\n\t\t\t\t\t\t{(['drafts', 'deleted'].includes(location.status) ||\r\n\t\t\t\t\t\t\t(location.io === 'out' && ['sended', 'signed', 'rejected'].includes(location.status))) && (\r\n\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\tcreateBasedDoc(location.type, id!, location.type, 9)\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t {t('common.copy')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t{/*Создать на основании документ*/}\r\n\t\t\t\t\t\t{location.io === 'out' &&\r\n\t\t\t\t\t\t\t['signed', 'sended'].includes(location.status) &&\r\n\t\t\t\t\t\t\t!['universal', 'empowerment', 'buildingFactura', 'invoice', 'actVerification'].includes(`${type}`) && (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t{location.io === 'in' &&\r\n\t\t\t\t\t\t\tlocation.status === 'signed' &&\r\n\t\t\t\t\t\t\t['empowerment', 'contract'].includes(`${type}`) && (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t{location.io === 'in' && location.status === 'received' && type === 'contract' && (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t{/*Красные кнопки*/}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{/*Отказ документа*/}\r\n\t\t\t\t\t\t{((isWaybillLocalType &&\r\n\t\t\t\t\t\t\t((isRespPerson && [110, 140, 160, 170].includes(doc.stateId)) ||\r\n\t\t\t\t\t\t\t\t(isConsignee && [110, 140, 160].includes(doc.stateId)))) ||\r\n\t\t\t\t\t\t\t(location.io === 'in' && location.status === 'received' && !isWaybillLocalType)) &&\r\n\t\t\t\t\t\t\t!isAuthWithPassword &&\r\n\t\t\t\t\t\t\t!(doc.type === 'letter' && location.status === 'received') && (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t rejectModal.on()}\r\n\t\t\t\t\t\t\t\t\t\tloading={disabled.state}\r\n\t\t\t\t\t\t\t\t\t\tloadingPosition='start'\r\n\t\t\t\t\t\t\t\t\t\tstartIcon={}\r\n\t\t\t\t\t\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t {customBtnLabel.neg}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t rejectModal.off()}\r\n\t\t\t\t\t\t\t\t\t\taria-labelledby='alert-dialog-title'\r\n\t\t\t\t\t\t\t\t\t\taria-describedby='alert-dialog-description'\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t{t('alertTitles.warning')}!\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{t('DOCUMENT_REJECT_BODY')}?\r\n\t\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t{noCommentError.state ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{t('common.reqField')}!\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t{/*Удаление документа*/}\r\n\t\t\t\t\t\t{location.io === 'out' &&\r\n\t\t\t\t\t\t\t(['drafts'].includes(location.status) ||\r\n\t\t\t\t\t\t\t\t(['sended'].includes(location.status) && !isAuthWithPassword)) && (\r\n\t\t\t\t\t\t\t\t deleteItem()}\r\n\t\t\t\t\t\t\t\t\tloading={disabled.state}\r\n\t\t\t\t\t\t\t\t\tloadingPosition='start'\r\n\t\t\t\t\t\t\t\t\tstartIcon={}\r\n\t\t\t\t\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t {t('common.delete')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t{/*Удаление документ навсегда*/}\r\n\t\t\t\t\t\t{location.status === 'deleted' && !isAuthWithPassword && (\r\n\t\t\t\t\t\t\t eraseItem()}\r\n\t\t\t\t\t\t\t\tloading={disabled.state}\r\n\t\t\t\t\t\t\t\tloadingPosition='start'\r\n\t\t\t\t\t\t\t\tstartIcon={}\r\n\t\t\t\t\t\t\t\tvariant='outlined'\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t {t('common.delete_forever')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t{/*Назад*/}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t{!!link ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{/* @ts-ignore */}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{t('LOADING_DOCUMENT')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t)}\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default React.memo(OpenFile)\r\n","import React from 'react'\r\nimport { Box, LinearProgress, Stack, Typography } from '@mui/material'\r\n\r\ninterface LinearLoaderProps {\r\n\tsystemLoadingMsg?: string\r\n}\r\n\r\nconst LinearLoader: React.FC = ({ systemLoadingMsg }) => {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{systemLoadingMsg} Пожалуйста, подождите...\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default React.memo(LinearLoader)\r\n","import React from 'react'\r\nimport LinearLoader from '../linearLoader/LinearLoader'\r\n\r\nconst LoadingComponent: React.FC = () => {\r\n\treturn \r\n}\r\n\r\nexport default React.memo(LoadingComponent)\r\n","import React, { useEffect } from 'react'\r\nimport { useLocation, useNavigate } from 'react-router-dom'\r\nimport { useTranslation } from 'react-i18next'\r\n// hooks\r\nimport { useAppDispatch, useAppSelector } from '../hooks/redux'\r\nimport { useProfileSetter } from '../hooks/useProfile'\r\n// redux\r\nimport { entityToken } from '../redux/actions/AuthActions'\r\nimport { appSlice } from '../redux/reducers/AppReducer'\r\n// components\r\nimport LoadingComponent from './core/loader/MainLoader'\r\n// material\r\nimport { AuthSlice } from '../redux/reducers/AuthReducer'\r\nimport { styled, useTheme } from '@mui/material/styles'\r\nimport { Box, Button, Stack, Typography } from '@mui/material'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\ninterface IEntityObj {\r\n\tname: string\r\n\ttin: string\r\n\ttype: string\r\n}\r\n\r\ninterface IStateProps {\r\n\tentities: IEntityObj[]\r\n}\r\n\r\nconst StyledCustomButton = styled(Button)(({ theme }) => ({\r\n\tcolor: theme.palette.text.primary,\r\n\t'&:hover': {\r\n\t\tcolor: theme.palette.primary.dark\r\n\t}\r\n}))\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst ProfileSelect: React.FC = () => {\r\n\tconst { entities = [] } = (useLocation().state as IStateProps) || {}\r\n\tconst dispatch = useAppDispatch()\r\n\tconst navigate = useNavigate()\r\n\tconst theme = useTheme()\r\n\tconst { updateProfileToken } = useProfileSetter()\r\n\tconst currentProfileTin = useAppSelector(state => state.filterReducer.currentProfileTin)\r\n\r\n\tconst { t } = useTranslation()\r\n\r\n\tconst filteredEntities = entities.filter(\r\n\t\tentity => !(entity.tin.length === 9 && ['4', '5', '6'].includes(entity.tin[0]))\r\n\t)\r\n\r\n\tconst selectEntity = async (item: IEntityObj) => {\r\n\t\tif (currentProfileTin === item.tin) {\r\n\t\t\tnavigate('/dashboard/app')\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\tdispatch(appSlice.actions.toggleSystemLoading(true))\r\n\t\tconst response = await entityToken(item.tin, item.type)\r\n\r\n\t\tconst profileRes = await fetch(`${process.env.REACT_APP_DEVELOPMENT_URL}/profile`, {\r\n\t\t\theaders: {\r\n\t\t\t\tAuthorization: `Bearer ${response?.data.token}`\r\n\t\t\t}\r\n\t\t})\r\n\t\tconst parsedProfile = await profileRes.json()\r\n\t\tparsedProfile.tin = parsedProfile.tin?.length ? parsedProfile.tin : parsedProfile.personalNum\r\n\t\tconst profileCopy = Object.assign({}, parsedProfile)\r\n\r\n\t\tif (response?.status === 200) {\r\n\t\t\tprofileCopy.tin = item.tin\r\n\t\t\tprofileCopy.entityName = response.data.user.entityName\r\n\t\t\tprofileCopy.user = response.data.user\r\n\t\t\tif (response.data.owner == false) {\r\n\t\t\t\tprofileCopy.isFizAuthToYurProfile = true\r\n\t\t\t}\r\n\t\t\tprofileCopy.isAuthWithPassword = false\r\n\r\n\t\t\tupdateProfileToken(response.data.token, profileCopy)\r\n\r\n\t\t\tdispatch(\r\n\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\tshow: true,\r\n\t\t\t\t\tmessage: 'Добро пожаловать'\r\n\t\t\t\t})\r\n\t\t\t)\r\n\r\n\t\t\tnavigate('/dashboard/app')\r\n\t\t}\r\n\r\n\t\tdispatch(AuthSlice.actions.removeFizInnProfiles())\r\n\t\tdispatch(appSlice.actions.toggleSystemLoading(false))\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tif (filteredEntities.length === 1) {\r\n\t\t\tnavigate('/dashboard/app')\r\n\t\t}\r\n\t}, [filteredEntities])\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{filteredEntities?.map((item, index) => (\r\n\t\t\t\t selectEntity(item)}\r\n\t\t\t\t\tsx={{\r\n\t\t\t\t\t\tborder: `3px solid`,\r\n\t\t\t\t\t\tbackgroundColor: theme.palette.background.default,\r\n\t\t\t\t\t\tmt: 1,\r\n\t\t\t\t\t\twidth: 400,\r\n\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\tjustifyContent: 'flex-start',\r\n\t\t\t\t\t\tp: 2\r\n\t\t\t\t\t}}\r\n\t\t\t\t>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{item.name}\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{item.tin.length === 9 ? t('TIN') : t('PINFL')}: \r\n\t\t\t\t\t\t\t{item.tin}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tРоль: \r\n\t\t\t\t\t\t\t{t(item.type)}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t))}\r\n\r\n\t\t\t{entities?.length < 1 && }\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default React.memo(ProfileSelect)\r\n","import React from 'react'\r\nimport { Card, Box, IconButton, Button, Typography, FormControl, InputLabel } from '@mui/material'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useForm } from 'react-hook-form'\r\nimport { useAppDispatch } from '../hooks/redux'\r\nimport { saveLoginPass } from '../redux/actions/AuthActions'\r\nimport InputAdornment from '@mui/material/InputAdornment'\r\nimport OutlinedInput from '@mui/material/OutlinedInput'\r\nimport { appSlice } from '../redux/reducers/AppReducer'\r\n//icons\r\nimport { Icon } from '@iconify/react'\r\n// import appStore from '@iconify/icons-ant-design/apple-filled'\r\n// import playStore from '@iconify/icons-ant-design/google-circle-filled'\r\nimport visibility from '@iconify/icons-ant-design/eye-twotone'\r\nimport visibilityoff from '@iconify/icons-ant-design/eye-invisible-twotone'\r\n\r\ninterface IMobProfile {\r\n\tlogin: string\r\n\tpassword: string\r\n\tshowPassword: boolean\r\n}\r\n\r\nconst MobileAuth = () => {\r\n\tconst { t } = useTranslation()\r\n\tconst dispatch = useAppDispatch()\r\n\r\n\tconst { handleSubmit } = useForm()\r\n\r\n\tconst [mobProfile, setMobProfile] = React.useState({\r\n\t\tlogin: '',\r\n\t\tpassword: '',\r\n\t\tshowPassword: false\r\n\t})\r\n\r\n\tconst handleChange = (prop: keyof IMobProfile) => (event: React.ChangeEvent) => {\r\n\t\tsetMobProfile({ ...mobProfile, [prop]: event.target.value })\r\n\t}\r\n\r\n\tconst handleClickShowPassword = () => {\r\n\t\tsetMobProfile({\r\n\t\t\t...mobProfile,\r\n\t\t\tshowPassword: !mobProfile.showPassword\r\n\t\t})\r\n\t}\r\n\tconst handleMouseDownPassword = (event: React.MouseEvent) => {\r\n\t\tevent.preventDefault()\r\n\t}\r\n\r\n\tconst saveLoginPassword = async () => {\r\n\t\ttry {\r\n\t\t\tlet res = await saveLoginPass({\r\n\t\t\t\tlogin: mobProfile.login,\r\n\t\t\t\tpassword: mobProfile.password\r\n\t\t\t})\r\n\t\t\tif (res?.status === 200) {\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\tmessage: t('alertTitles.loginPassSaved'),\r\n\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t} else if (res?.status === 422) {\r\n\t\t\t\tif (mobProfile.login.length <= 6 || mobProfile.password.length <= 6) {\r\n\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\tmessage: t('alertTitles.loginPassLength'),\r\n\t\t\t\t\t\t\ttype: 'error',\r\n\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t)\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\tmessage: t('alertTitles.loginPassNotSaved'),\r\n\t\t\t\t\t\t\ttype: 'error',\r\n\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\t// console.log(e)\r\n\t\t}\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{/**/}\r\n\t\t\t{/*\t{t('SETT.mobApp')}*/}\r\n\t\t\t{/**/}\r\n\t\t\t{/**/}\r\n\t\t\t{/*\t*/}\r\n\t\t\t{/*\t\t*/}\r\n\t\t\t{/*\t\t*/}\r\n\t\t\t{/*\t\t\tGET IT ON

App Store

*/}\r\n\t\t\t{/*\t\t
*/}\r\n\t\t\t{/*\t*/}\r\n\t\t\t{/*\t*/}\r\n\t\t\t{/*\t\t*/}\r\n\t\t\t{/*\t\t*/}\r\n\t\t\t{/*\t\t\tGET IT ON

Google Play

*/}\r\n\t\t\t{/*\t\t
*/}\r\n\t\t\t{/*\t*/}\r\n\t\t\t{/*
*/}\r\n\r\n\t\t\t{t('SETT.forAuth')}\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{t('input.login')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{t('input.pass')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t{mobProfile.showPassword ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tlabel={t('input.pass')}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t)\r\n}\r\n\r\nexport default React.memo(MobileAuth)\r\n","import React, { useCallback, useEffect, useState } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport { useNavigate } from 'react-router-dom'\r\n// redux\r\nimport { IBranch } from '../redux/reducers/ProfileReducer'\r\nimport { appSlice } from '../redux/reducers/AppReducer'\r\nimport { signData } from '../redux/actions/EimzoActions'\r\nimport { refetchAllDocs } from '../redux/actions/DocumentsActions'\r\nimport { fetchLoginEcp, fetchSignRequest } from '../redux/actions/GoodsActions'\r\nimport { fetchProfileByTin, fetchProfileRights } from '../redux/actions/ProfileActions'\r\n// hooks\r\nimport useToggle from '../hooks/useToggle'\r\nimport { useAppDispatch, useAppSelector } from '../hooks/redux'\r\nimport { useProfileGetter } from '../hooks/useProfile'\r\n// material\r\nimport { useTheme } from '@mui/material/styles'\r\nimport { useConfirm } from 'material-ui-confirm'\r\nimport Select, { SelectChangeEvent } from '@mui/material/Select'\r\nimport {\r\n\tCard,\r\n\tBox,\r\n\tCheckbox,\r\n\tStack,\r\n\tTable,\r\n\tIconButton,\r\n\tTableBody,\r\n\tTableCell,\r\n\tTableHead,\r\n\tTextField,\r\n\tTableRow,\r\n\tTypography,\r\n\tButton,\r\n\tDialog,\r\n\tMenuItem,\r\n\tFormControl,\r\n\tInputLabel,\r\n\tDialogActions\r\n} from '@mui/material'\r\n// api and components\r\nimport api from '../api/requests'\r\nimport MobileAuth from './MobileAuth'\r\nimport { setProfileRights } from '../api/profile'\r\n//icons\r\nimport { Icon } from '@iconify/react'\r\nimport edit from '@iconify/icons-carbon/edit'\r\nimport checkmark from '@iconify/icons-eva/checkmark-fill'\r\nimport send from '@iconify/icons-carbon/send-alt'\r\nimport cancel from '@iconify/icons-carbon/rule-cancelled'\r\nimport accept from '@iconify/icons-carbon/document-tasks'\r\nimport reject from '@iconify/icons-carbon/document-subtract'\r\nimport deleteRow from '@iconify/icons-carbon/row-delete'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst TABLE_ICONS = [\r\n\t{\r\n\t\ticon1: send,\r\n\t\ticon2: cancel,\r\n\t\ticon3: accept,\r\n\t\ticon4: reject\r\n\t},\r\n\t{\r\n\t\ticon1: send,\r\n\t\ticon2: cancel,\r\n\t\ticon3: accept,\r\n\t\ticon4: reject\r\n\t},\r\n\t{\r\n\t\ticon1: send,\r\n\t\ticon2: cancel,\r\n\t\ticon3: accept,\r\n\t\ticon4: reject\r\n\t},\r\n\t{\r\n\t\ticon1: send,\r\n\t\ticon2: cancel,\r\n\t\ticon3: accept,\r\n\t\ticon4: reject\r\n\t},\r\n\t{\r\n\t\ticon1: send,\r\n\t\ticon2: cancel,\r\n\t\ticon3: accept,\r\n\t\ticon4: reject\r\n\t},\r\n\t{\r\n\t\ticon1: send,\r\n\t\ticon2: cancel,\r\n\t\ticon3: accept,\r\n\t\ticon4: reject\r\n\t},\r\n\t{\r\n\t\ticon1: send,\r\n\t\ticon2: cancel,\r\n\t\ticon3: accept,\r\n\t\ticon4: reject\r\n\t},\r\n\t{\r\n\t\ticon1: send,\r\n\t\ticon2: cancel,\r\n\t\ticon3: accept,\r\n\t\ticon4: reject\r\n\t}\r\n]\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst Settings = () => {\r\n\tconst { t } = useTranslation()\r\n\tconst theme = useTheme()\r\n\tconst dispatch = useAppDispatch()\r\n\tconst navigate = useNavigate()\r\n\tconst confirm = useConfirm()\r\n\r\n\tconst profile = useProfileGetter.useGetProfile()\r\n\tconst rights = useAppSelector(state => state.profileReducer.rights)\r\n\tconst keyId = profile?.keyId || ''\r\n\r\n\tconst modal = useToggle(false)\r\n\tconst [editableUser, setEditableUser] = useState('')\r\n\tconst [editableUserFio, setEditableUserFio] = useState('')\r\n\tconst [rightsList, setRightsList] = useState([])\r\n\r\n\tconst shouldRenderMobileAuth = !!profile.isAuthWithPassword || !!profile.isFizAuthToYurProfile\r\n\r\n\tuseEffect(() => {\r\n\t\t!Boolean(rights.tin) && dispatch(fetchProfileRights())\r\n\t\tdispatch(fetchProfileRights())\r\n\t}, [])\r\n\r\n\tconst onSubmit = async (data: any) => {\r\n\t\tconst tin = profile.tin\r\n\t\tconst req = {\r\n\t\t\tfio: editableUserFio,\r\n\t\t\tfizTin: editableUser,\r\n\t\t\troles: rightsList,\r\n\t\t\ttin: tin,\r\n\t\t\tbrunchNum: branch\r\n\t\t}\r\n\t\tsaving(req)\r\n\t}\r\n\r\n\tconst saving = async (data: any) => {\r\n\t\ttry {\r\n\t\t\tdispatch(appSlice.actions.toggleSystemLoading(true))\r\n\t\t\tlet pkcs7: string | unknown = ''\r\n\t\t\tpkcs7 = await dispatch(signData(JSON.stringify(data), keyId))\r\n\t\t\tif (pkcs7) {\r\n\t\t\t\tconst req = await setProfileRights({ sign: pkcs7 })\r\n\t\t\t\tdispatch(fetchProfileRights())\r\n\t\t\t\tmodal.off()\r\n\t\t\t\tif (req === true) {\r\n\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\t\tmessage: t('alertTitles.rightsSuccess'),\r\n\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t)\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\ttype: 'error',\r\n\t\t\t\t\t\t\tmessage: t('alertTitles.rightsError'),\r\n\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (e) {\r\n\t\t\tconsole.log(e)\r\n\t\t} finally {\r\n\t\t\tsetEditableUserFio('')\r\n\t\t\tsetRightsList([])\r\n\t\t\tdispatch(appSlice.actions.toggleSystemLoading(false))\r\n\t\t}\r\n\t}\r\n\r\n\tconst editTableRow = (tin: string) => {\r\n\t\tconst foundUserRights = rights.taxpayers.find(taxPayer => taxPayer.tin === tin)?.roles || []\r\n\t\tsetEditableUser(tin)\r\n\t\tsetRightsList(foundUserRights)\r\n\t\tmodal.on()\r\n\t}\r\n\r\n\tconst deleteTableRow = (index: any) => {\r\n\t\tconst user = rights.taxpayers[index]\r\n\t\tconst tin = profile.tin\r\n\t\tconst data: object = {\r\n\t\t\tbarnch: undefined,\r\n\t\t\troles: [],\r\n\t\t\tfizTin: user.tin,\r\n\t\t\ttin: tin\r\n\t\t}\r\n\t\tsaving(data)\r\n\t}\r\n\r\n\tconst handleClose = () => {\r\n\t\tmodal.off()\r\n\t\tsetEditableUser('')\r\n\t\tsetRightsList([])\r\n\t}\r\n\r\n\t// refresh doc data from rouming\r\n\tconst refreshAllDocs = useCallback(async () => {\r\n\t\tawait confirm({\r\n\t\t\ttitle: `${t('alertTitles.warning')} !`,\r\n\t\t\tdescription: `${t('DO_YOU_REALLY_WANT_TO_REFRESH_ALL_DOCS')}`,\r\n\t\t\tcancellationText: t('NO'),\r\n\t\t\tconfirmationText: t('YES')\r\n\t\t})\r\n\t\t\t.then(async () => {\r\n\t\t\t\tconst res = await fetchSignRequest()\r\n\t\t\t\tif (res?.data?.Success) {\r\n\t\t\t\t\tconst hash = res.data.Hash\r\n\t\t\t\t\tconst pkcs7 = await dispatch(signData(hash, keyId))\r\n\t\t\t\t\tconst res2 = await fetchLoginEcp(pkcs7 as unknown as string)\r\n\t\t\t\t\tif (res2?.data.Success === false) return\r\n\t\t\t\t\tconst cookies = res2?.data.cookie\r\n\t\t\t\t\tlet startIndex = cookies.indexOf('=') + 1\r\n\t\t\t\t\tconst cookie = cookies.substring(startIndex)\r\n\t\t\t\t\tconst res3 = await refetchAllDocs(cookie)\r\n\t\t\t\t\tif (res3?.data.success) {\r\n\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\t\tmessage: t('alertTitles.successRefresh'),\r\n\t\t\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\tnavigate(`/dashboard/app`)\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\t\tmessage: t('alertTitles.errorRefresh'),\r\n\t\t\t\t\t\t\t\ttype: 'error',\r\n\t\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t\tnavigate(`/dashboard/app`)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch()\r\n\t}, [keyId])\r\n\r\n\tconst handlePinfl = async (event: React.ChangeEvent) => {\r\n\t\tsetEditableUser(event.target.value)\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tconst searchByTin = async () => {\r\n\t\t\tconst res = await fetchProfileByTin(editableUser)\r\n\t\t\tsetEditableUserFio(res.name)\r\n\t\t}\r\n\t\tif (editableUser.length === 14 || editableUser.length === 9) {\r\n\t\t\tsearchByTin()\r\n\t\t} else {\r\n\t\t\tsetEditableUser('')\r\n\t\t}\r\n\t}, [editableUser])\r\n\r\n\tconst [branch, setBranch] = useState('')\r\n\tconst handleBranch = (e: SelectChangeEvent) => {\r\n\t\tsetBranch(e.target.value as string)\r\n\t}\r\n\r\n\tconst handleRight = (rightNum: number) => {\r\n\t\tconst checkedRight = rightsList.includes(rightNum)\r\n\t\tcheckedRight ? setRightsList(rightsList.filter(r => r !== rightNum)) : setRightsList(prev => [...prev, rightNum])\r\n\t}\r\n\r\n\tconst [providersData, setProvidersData] = useState([])\r\n\r\n\tuseEffect(() => {\r\n\t\tconst fetchProviders = async () => {\r\n\t\t\tconst res = await api.getProviders()\r\n\t\t\tlet setupProviders = res?.data.filter((item: any) => item.enabled)\r\n\t\t\tsetProvidersData(setupProviders)\r\n\t\t}\r\n\t\tfetchProviders()\r\n\t}, [profile])\r\n\r\n\tconst setEdocs = async () => {\r\n\t\ttry {\r\n\t\t\tconst edocsTin = '300711863'\r\n\t\t\tconst edocs = providersData.find((el: any) => el.providerTin === edocsTin)\r\n\t\t\tif (edocs && edocs.enabled) {\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\tmessage: t('alertTitles.edocsAlreadyInstalled'),\r\n\t\t\t\t\t\ttype: 'warning',\r\n\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\tconst providerTins = providersData\r\n\t\t\t\t.filter((provider: any) => provider.enabled)\r\n\t\t\t\t.map((provider: any) => provider.providerTin)\r\n\t\t\tproviderTins.push(edocsTin)\r\n\t\t\tconst pkcs7 = await dispatch(\r\n\t\t\t\tsignData(\r\n\t\t\t\t\tJSON.stringify({\r\n\t\t\t\t\t\tClientTin: profile.tin,\r\n\t\t\t\t\t\tProviderTins: providerTins\r\n\t\t\t\t\t}),\r\n\t\t\t\t\tkeyId\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t\tconst res = await api.setProviders({ sign: pkcs7 })\r\n\t\t\tawait api.getProviders()\r\n\t\t\tif (res?.data.success) {\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\tmessage: t('alertTitles.edocsInstalled'),\r\n\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t\tnavigate(`/dashboard/app`)\r\n\t\t\t} else {\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\tmessage: t('alertTitles.edocsInstallError'),\r\n\t\t\t\t\t\ttype: 'error',\r\n\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t\tnavigate(`/dashboard/app`)\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tconsole.log('setEdocs error', error)\r\n\t\t}\r\n\t}\r\n\r\n\tconst displayProviders = () => {\r\n\t\treturn providersData.map((data: any) => (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{`${data?.systemName} (${data?.providerName})`}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t))\r\n\t}\r\n\r\n\treturn (\r\n\t\t
\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{!!profile?.branches?.filter((branch: IBranch) => branch.isDeleted !== 1).length && (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{t('input.branch')}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{t('EDO')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCS_PLURAL.factura')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(11)} checked={rightsList.includes(11)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(12)} checked={rightsList.includes(12)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCS_PLURAL.empowerment')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(21)} checked={rightsList.includes(21)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(22)} checked={rightsList.includes(22)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCS_PLURAL.waybill')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(31)} checked={rightsList.includes(31)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(32)} checked={rightsList.includes(32)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCS_PLURAL.acts')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(41)} checked={rightsList.includes(41)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(42)} checked={rightsList.includes(42)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCS_PLURAL.contracts')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(51)} checked={rightsList.includes(51)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(52)} checked={rightsList.includes(52)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCS_PLURAL.actVerification')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(61)} checked={rightsList.includes(61)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(62)} checked={rightsList.includes(62)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCUMENT_CATEGORIES.buildingFactura')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(71)} checked={rightsList.includes(71)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(72)} checked={rightsList.includes(72)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCS_PLURAL.calcTable')}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(81)} checked={rightsList.includes(81)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t handleRight(82)} checked={rightsList.includes(82)} />\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\r\n\t\t\t{profile.isFizAuthToYurProfile && (\r\n\t\t\t\t\r\n\t\t\t\t\t{t('AUTH.isFizAuthToYurFirst')}\r\n\t\t\t\t\t{profile.user?.name}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t{t('AUTH.isFizAuthToYurSecond')}\r\n\t\t\t\t\t{profile.shortName || profile.name} ({t('TIN')}:{profile.tin}){t('AUTH.isFizAuthToYurLast')}\r\n\t\t\t\t\t{t('AUTH.isFizAuthToYurReadOnly')}\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t\t{profile.isAuthWithPassword && (\r\n\t\t\t\t\r\n\t\t\t\t\t{t('AUTH.isAuthWithPasswordFirst')}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{profile.shortName || profile.name} ({t('TIN')}:{profile.tin})\r\n\t\t\t\t\t\r\n\t\t\t\t\t{t('AUTH.isAuthWithPasswordSecond')}\r\n\t\t\t\t\t{t('AUTH.isAuthWithPasswordReadOnly')}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t{t('AUTH.isAuthWithPasswordLast')}\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t\t\r\n\t\t\t\t{t('ASSIGN_RIGHTS')}\r\n\t\t\t\r\n\t\t\t{/* Rights table start */}\r\n\t\t\t\r\n\t\t\t\t{/* */}\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{t('factura_table_heads.actions')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('PINFL_OF_FIZ')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('factura_table_heads.branch')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCUMENT_CATEGORIES.factura')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCUMENT_CATEGORIES.empowerment')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCUMENT_CATEGORIES.waybill')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCUMENT_CATEGORIES.act')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCUMENT_CATEGORIES.contract')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCUMENT_CATEGORIES.actVerification')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCUMENT_CATEGORIES.buildingFactura')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('DOCUMENT_CATEGORIES.calcTable')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{TABLE_ICONS.map((item, index) => (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{rights.taxpayers?.map((right, index) => (\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t editTableRow(right.tin)}\r\n\t\t\t\t\t\t\t\t\t\t\tsize='small'\r\n\t\t\t\t\t\t\t\t\t\t\tdisabled={profile.isFizAuthToYurProfile || profile.isAuthWithPassword}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t deleteTableRow(index)}\r\n\t\t\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t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\r\n\t\t\t\t{/* End of rights table */}\r\n\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t   -   {t('common.send')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t   -   {t('common.cancel')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t   -   {t('common.accept2')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t   -   {t('common.decline2')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t modal.on()}\r\n\t\t\t\t\t\t\tdisabled={profile.isFizAuthToYurProfile || profile.isAuthWithPassword}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{t('ikpu.ADD_BUTTON')}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t
\r\n\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{t('SETT.refreshDocData')}\r\n\t\t\t\t\r\n\t\t\t\t{t('SETT.refreshText')}\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\r\n\t\t\t{!shouldRenderMobileAuth && }\r\n\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{t('SETT.installedEDO')}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{displayProviders()}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t
\r\n\t)\r\n}\r\n\r\nexport default React.memo(Settings)\r\n","import { memo } from 'react'\r\nimport { Box, Card, Skeleton } from '@mui/material'\r\n\r\nconst DocumentEditSkeleton = () => {\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default memo(DocumentEditSkeleton)\r\n","import { memo } from 'react'\r\nimport { Card, Skeleton, Stack } from '@mui/material'\r\n\r\nconst ReferencesSkeleton = () => {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t\r\n\t\t\t\t{Array.from({ length: 8 }).map((i, index) => (\r\n\t\t\t\t\t\r\n\t\t\t\t))}\r\n\t\t\t\r\n\t\t
\r\n\t)\r\n}\r\n\r\nexport default memo(ReferencesSkeleton)\r\n","import { memo } from 'react'\r\nimport { Box, Card, Skeleton } from '@mui/material'\r\n\r\nconst ContactsSkeleton = () => {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t{Array.from({ length: 10 }).map((i, index) => (\r\n\t\t\t\t\t\r\n\t\t\t\t))}\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default memo(ContactsSkeleton)\r\n","import { memo } from 'react'\r\nimport { Box, Card, Skeleton } from '@mui/material'\r\n\r\nconst MxiksSkeleton = () => {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{Array.from({ length: 8 }).map((i, index) => (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t))}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default memo(MxiksSkeleton)\r\n","import { memo } from 'react'\r\nimport { Box, Skeleton } from '@mui/material'\r\n\r\nconst LoginSkeleton = () => {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default memo(LoginSkeleton)\r\n","import { memo } from 'react'\r\nimport { Box, Skeleton } from '@mui/material'\r\n\r\nconst RegisterSkeleton = () => {\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default memo(RegisterSkeleton)\r\n","import React, { useEffect, useState, useRef } from 'react';\r\nimport './MiniAppStyle.css';\r\n\r\nexport default function MiniApp() {\r\n const [user, setUser] = useState(null);\r\n const [messages, setMessages] = useState([]);\r\n const [messageText, setMessageText] = useState('');\r\n const [chatId, setChatId] = useState(null);\r\n const [error, setError] = useState(null);\r\n const [showError, setShowError] = useState(false);\r\n const chatBoxRef = useRef(null);\r\n const socketRef = useRef(null);\r\n const [isChatClosed, setIsChatClosed] = useState(false);\r\n const [isOperator, setIsOperator] = useState(false);\r\n\r\n\tconst BASE_URL = 'https://api.edocs.uz/botapi';\r\n\r\n useEffect(() => {\r\n const urlParams = new URLSearchParams(window.location.search);\r\n const startParam = urlParams.get('startapp');\r\n\r\n if (startParam && startParam.startsWith('join_chat_')) {\r\n setIsOperator(true); // Если подключился к чату через ссылку, он оператор\r\n }\r\n }, []);\r\n\r\n const closeError = () => {\r\n setShowError(false);\r\n setTimeout(() => {\r\n setError(null);\r\n if (window.Telegram?.WebApp) {\r\n window.Telegram.WebApp.close();\r\n }\r\n }, 500);\r\n };\r\n\r\n useEffect(() => {\r\n if (error) {\r\n setTimeout(() => setShowError(true), 100);\r\n }\r\n }, [error]);\r\n\r\n // Проверка Telegram WebApp\r\n useEffect(() => {\r\n const tgScript = document.createElement('script');\r\n tgScript.src = 'https://telegram.org/js/telegram-web-app.js';\r\n document.head.appendChild(tgScript);\r\n\r\n const socketScript = document.createElement('script');\r\n socketScript.src = 'https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.7.2/socket.io.js';\r\n document.head.appendChild(socketScript);\r\n\r\n const checkTelegram = () => {\r\n if (window.Telegram?.WebApp?.initDataUnsafe?.user) {\r\n setUser(window.Telegram.WebApp.initDataUnsafe.user);\r\n } else {\r\n setError('⚠️ Доступ возможен только через приложение Telegram ⚠️');\r\n }\r\n };\r\n\r\n setTimeout(checkTelegram, 500);\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (!user || isChatClosed) return;\r\n\r\n try {\r\n socketRef.current = window.io('https://api.edocs.uz', {\r\n path: '/botapi/socket.io/',\r\n query: chatId ? { chat_id: chatId } : { telegram_id: user.id },\r\n });\r\n } catch (e) {\r\n setError('⚠️ Ошибка подключения к серверу ⚠️');\r\n return;\r\n }\r\n\r\n socketRef.current.on('chat_history', (messages) => {\r\n setMessages(messages);\r\n scrollToBottom();\r\n });\r\n\r\n socketRef.current.on('message', (msg) => {\r\n setMessages((prev) => [...prev, msg]);\r\n scrollToBottom();\r\n });\r\n\r\n const urlParams = new URLSearchParams(window.location.search);\r\n const startParam = urlParams.get('startapp');\r\n\r\n if (startParam && startParam.startsWith('join_chat_')) {\r\n const chatId = startParam.replace('join_chat_', '');\r\n setChatId(chatId);\r\n\r\n\t\t\tfetch(`${BASE_URL}/connect_admin`, {\r\n\t\t\t\tmethod: 'POST',\r\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\r\n\t\t\t\tbody: JSON.stringify({\r\n\t\t\t\t\tchat_id: chatId,\r\n\t\t\t\t\tadmin_id: user.id,\r\n\t\t\t\t}),\r\n\t\t\t})\r\n .then((res) => res.json())\r\n .then((data) => {\r\n if (data.error) {\r\n setError(`⚠️ ${data.error}`);\r\n } else {\r\n setChatId(chatId);\r\n setMessages(data.chat_history || []);\r\n if (chatId) {\r\n socketRef.current.emit('connect_chat', { chat_id: chatId });\r\n }\r\n }\r\n })\r\n .catch(() => setError('⚠️ Ошибка загрузки данных. Попробуйте позже ⚠️'));\r\n } else {\r\n fetch(`${BASE_URL}/user_data`, {\r\n\t\t\t\tmethod: 'POST',\r\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\r\n\t\t\t\tbody: JSON.stringify({\r\n\t\t\t\t\ttelegramId: user.id,\r\n\t\t\t\t\tfirst_name: user.first_name,\r\n\t\t\t\t\tusername: user.username || null,\r\n\t\t\t\t}),\r\n\t\t\t})\r\n .then((res) => res.json())\r\n .then((data) => {\r\n if (data.chat_id) {\r\n setChatId(data.chat_id);\r\n setMessages(data.messages);\r\n socketRef.current.emit('connect_chat', { chat_id: data.chat_id });\r\n }\r\n })\r\n .catch(() => setError('⚠️ Ошибка загрузки данных. Попробуйте позже ⚠️'));\r\n }\r\n\r\n return () => {\r\n socketRef.current?.disconnect();\r\n };\r\n }, [user, chatId, isChatClosed]);\r\n\r\n const endChat = () => {\r\n if (!chatId || !user) return;\r\n\r\n fetch(`${BASE_URL}/disconnect_admin`, {\r\n\t\t\tmethod: 'POST',\r\n\t\t\theaders: { 'Content-Type': 'application/json' },\r\n\t\t\tbody: JSON.stringify({\r\n\t\t\t\tchat_id: chatId,\r\n\t\t\t\tadmin_id: user.id,\r\n\t\t\t}),\r\n\t\t})\r\n .then((res) => res.json())\r\n .then((data) => {\r\n if (data.status === 'ok') {\r\n setIsChatClosed(true);\r\n setChatId(null);\r\n setMessages([]);\r\n setTimeout(() => {\r\n if (window.Telegram?.WebApp) {\r\n window.Telegram.WebApp.close();\r\n }\r\n }, 500);\r\n } else {\r\n setError(`⚠️ ${data.error}`);\r\n }\r\n })\r\n .catch(() => setError('⚠️ Ошибка завершения чата. Попробуйте позже ⚠️'));\r\n };\r\n\r\n const sendMessage = () => {\r\n if (!messageText.trim()) return;\r\n const messageData = {\r\n chat_id: chatId,\r\n sender_id: user.id,\r\n message_text: messageText.trim(),\r\n timestamp: new Date().toISOString(),\r\n };\r\n\r\n sendToSocket(messageData);\r\n setMessageText('');\r\n };\r\n\r\n const sendToSocket = (messageData) => {\r\n if (socketRef.current) {\r\n socketRef.current.emit('message', messageData);\r\n } else {\r\n setError('⚠️ Ошибка: соединение с сервером отсутствует! ⚠️');\r\n }\r\n };\r\n\r\n const scrollToBottom = () => {\r\n setTimeout(() => {\r\n chatBoxRef.current?.scrollTo({ top: chatBoxRef.current.scrollHeight, behavior: 'smooth' });\r\n }, 100);\r\n };\r\n\r\n const renderMessage = (msg, index) => {\r\n\t\tconst isSystemMessage = msg.sender_id === 'system';\r\n\t\r\n\t\tif (isSystemMessage) {\r\n\t\t\treturn (\r\n\t\t\t\t
\r\n\t\t\t\t\t{msg.message_text}\r\n\t\t\t\t
\r\n\t\t\t);\r\n\t\t}\r\n\t\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t\t\t{msg.message_text &&
{msg.message_text}
}\r\n\t\t\t\t\r\n\t\t\t\t\t{new Date(msg.timestamp).toLocaleTimeString('ru-RU', { hour: '2-digit', minute: '2-digit' })}\r\n\t\t\t\t\r\n\t\t\t
\r\n\t\t);\r\n\t};\r\n\r\n\treturn (\r\n <>\r\n {error && (\r\n
\r\n {error}\r\n \r\n
\r\n )}\r\n\r\n {!error && user && (\r\n
\r\n
\r\n Онлайн-чат\r\n
\r\n
\r\n {messages.map(renderMessage)}\r\n
\r\n
\r\n setMessageText(e.target.value)}\r\n placeholder=\"Введите сообщение...\"\r\n\t\t\t\t\t\t\trows=\"10\"\r\n onKeyPress={(e) => e.key === 'Enter' && !e.shiftKey && (e.preventDefault(), sendMessage())}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n
\r\n {chatId && isOperator && (\r\n \r\n )}\r\n
\r\n )}\r\n \r\n );\r\n}","import { IProfile } from '../models/profile'\r\nimport axios from 'axios'\r\n\r\nexport const updateProfileData = async () => {\r\n\tlet userData: any\r\n\tawait axios.get(`/profile`).then(res => {\r\n\t\tuserData = res\r\n\t})\r\n\treturn userData\r\n}\r\n\r\nexport const saveProfileData = async (data: IProfile) => {\r\n\tlet resData: any\r\n\tawait axios.post(`/profile`, data).then(res => {\r\n\t\tresData = res\r\n\t})\r\n\treturn resData\r\n}\r\n\r\n","import React, { FC } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\n// hooks\r\nimport { Control, Controller, UseFormWatch, UseFormSetValue, useFieldArray } from 'react-hook-form'\r\n// material\r\nimport { Button, IconButton, Grid, Typography } from '@mui/material'\r\n// models\r\nimport { IProfile } from '../../models/profile'\r\n// components\r\nimport ControlledTextField from '../../components/form/ControlledTextField'\r\n// icons\r\nimport { Icon } from '@iconify/react'\r\nimport BankAutoComplete from '../form/BankAutoComplete'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\ninterface ProdDeliverProps {\r\n\twatch: UseFormWatch\r\n\tcontrol: Control\r\n\tsetValue: UseFormSetValue\r\n\tsize: 'small' | 'medium' | undefined\r\n}\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nexport const BankAccaunt: FC = ({ control, setValue, size }) => {\r\n\tconst { t } = useTranslation()\r\n\r\n\tconst { fields, append, remove } = useFieldArray({\r\n\t\tcontrol,\r\n\t\tname: 'accounts'\r\n\t})\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{t('input.additional')}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{t('input.bank')} / {t('input.account')}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t{fields.map((field, index) => (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t (\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t remove(index)}>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t))}\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n","import React, { FC, useState } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\n// hooks\r\nimport { useAppDispatch } from '../../hooks/redux'\r\nimport { Control, Controller, UseFormSetValue, useFieldArray } from 'react-hook-form'\r\n// redux\r\nimport { appSlice } from '../../redux/reducers/AppReducer'\r\nimport { fetchProfileByTin } from '../../redux/actions/ProfileActions'\r\n// material\r\nimport { Button, IconButton, Grid, Typography, TextField, Tooltip } from '@mui/material'\r\n// models\r\nimport { IProfile } from '../../models/profile'\r\n// components\r\nimport ControlledTextField from '../../components/form/ControlledTextField'\r\n// icons\r\nimport { Icon } from '@iconify/react'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\ninterface ProdDeliverProps {\r\n\tcontrol: Control\r\n\tsetValue: UseFormSetValue\r\n\tsize: 'small' | 'medium' | undefined\r\n}\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nexport const ProdDeliver: FC = ({ control, setValue, size }) => {\r\n\tconst { t } = useTranslation()\r\n\tconst dispatch = useAppDispatch()\r\n\r\n\tconst { fields, append, remove, prepend } = useFieldArray({\r\n\t\tcontrol,\r\n\t\tname: 'itemReleaseds'\r\n\t})\r\n\r\n\t// Отслеживаем, какой индекс сейчас дефолтный\r\n\tconst [defaultIndex, setDefaultIndex] = useState(0)\r\n\r\n\t// Функция для перемещения выбранного элемента в конец\r\n\tconst makeDefault = (index: number) => {\r\n\t\tif (index === 0) return\r\n\r\n\t\tconst movedItem = fields[index]\r\n\t\tremove(index)\r\n\t\tprepend(movedItem)\r\n\t\tsetDefaultIndex(0)\r\n\t}\r\n\r\n\t// Функция для получения данных профиля\r\n\tconst fetchProfile = async (Pinfl: string, index: number) => {\r\n\t\tif (![14].includes(Pinfl?.length)) {\r\n\t\t\tdispatch(\r\n\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\ttype: 'warning',\r\n\t\t\t\t\tshow: true,\r\n\t\t\t\t\tautoHide: false,\r\n\t\t\t\t\tmessage: `${t('alertTitles.fillInPartnerTin')} ${Pinfl?.length} ${t('alertTitles.fillInPINFLAfter')}`\r\n\t\t\t\t})\r\n\t\t\t)\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\tconst res = await fetchProfileByTin(Pinfl)\r\n\r\n\t\tif (res?.tin || res?.personalNum) {\r\n\t\t\tsetValue(`itemReleaseds.${index}.fio`, res.name)\r\n\r\n\t\t\tdispatch(\r\n\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\tshow: true,\r\n\t\t\t\t\tmessage: t('alertTitles.success')\r\n\t\t\t\t})\r\n\t\t\t)\r\n\t\t} else {\r\n\t\t\tdispatch(\r\n\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\ttype: 'warning',\r\n\t\t\t\t\tshow: true,\r\n\t\t\t\t\tautoHide: false,\r\n\t\t\t\t\tmessage: t('alertTitles.partnerNotFound')\r\n\t\t\t\t})\r\n\t\t\t)\r\n\t\t}\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t{t('input.prodDeliver')}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t{fields.map((field, index) => (\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t (\r\n\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\tconst value = e.target.value\r\n\t\t\t\t\t\t\t\t\t\t\tfield.onChange(value)\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif (value.length === 14) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tfetchProfile(value, index)\r\n\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\tsetValue(`itemReleaseds.${index}.fio`, '')\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t remove(index)}>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t makeDefault(index)}>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t))}\r\n\t\t\t\r\n\t\t\r\n\t)\r\n}\r\n","import React, { useEffect, useMemo } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\nimport i18n from 'i18next'\r\n// hooks\r\nimport InputMask from 'react-input-mask'\r\nimport { useAppSelector, useAppDispatch } from '../hooks/redux'\r\nimport { Controller, useForm, FormProvider } from 'react-hook-form'\r\n// redux\r\nimport { appSlice } from '../redux/reducers/AppReducer'\r\nimport { useProfileGetter } from '../hooks/useProfile'\r\nimport { AuthSlice } from '../redux/reducers/AuthReducer'\r\n// material\r\nimport { useTheme } from '@mui/material/styles'\r\nimport { Box, Card, Grid, Typography, Button, InputAdornment, IconButton, TextField } from '@mui/material'\r\n// api and models\r\nimport api from '../api/requests'\r\nimport { IProfile } from '../models/profile'\r\nimport { saveProfileData, updateProfileData } from '../api/editProfile'\r\n// components\r\nimport BankAutoComplete from '../components/form/BankAutoComplete'\r\nimport RegionAutoComplete from '../components/form/RegionAutoComplete'\r\nimport ControlledTextField from '../components/form/ControlledTextField'\r\nimport { BankAccaunt } from '../components/profileRequisites/BankAccount'\r\nimport { ProdDeliver } from '../components/profileRequisites/ProdDeliver'\r\nimport DistrictAutoComplete from '../components/form/DistrictAutoComplete'\r\n// icons and styles\r\nimport { Icon, IconifyIcon } from '@iconify/react'\r\nimport link from '@iconify/icons-carbon/link'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst getIcon = (name: IconifyIcon) => \r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst Admin: React.FC = () => {\r\n\tconst { t } = useTranslation()\r\n\tconst theme = useTheme()\r\n\tconst dispatch = useAppDispatch()\r\n\tconst scaled = useAppSelector(state => state.appReducer.scaled)\r\n\tconst accountStatus = useAppSelector(state => state.authReducer.accountStatus.data)\r\n\tconst profile = useProfileGetter.useGetProfile()\r\n\r\n\tconst notification = (type: 'success' | 'error' | 'info' | 'warning', message: string) => {\r\n\t\tdispatch(\r\n\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\ttype: type,\r\n\t\t\t\tmessage: message,\r\n\t\t\t\tshow: true\r\n\t\t\t})\r\n\t\t)\r\n\t}\r\n\r\n\tconst methods = useForm({\r\n\t\tdefaultValues: JSON.parse(JSON.stringify(profile))\r\n\t})\r\n\r\n\tconst {\r\n\t\twatch,\r\n\t\tcontrol,\r\n\t\tsetValue,\r\n\t\treset,\r\n\t\thandleSubmit,\r\n\t\tformState: { errors }\r\n\t} = methods\r\n\r\n\tconst size = useMemo(() => {\r\n\t\treturn scaled ? 'medium' : 'small'\r\n\t}, [scaled])\r\n\r\n\tuseEffect(() => {\r\n\t\treset(profile)\r\n\t}, [profile])\r\n\r\n\tuseEffect(() => {\r\n\t\trefreshProfile()\r\n\t}, [])\r\n\r\n\t// save profile data\r\n\tconst saveProfile = async (data: IProfile) => {\r\n\t\ttry {\r\n\t\t\tsaveProfileData(data as IProfile).then(res => {\r\n\t\t\t\tif (res.status === 200) {\r\n\t\t\t\t\tif (data.mobile !== profile.mobile) {\r\n\t\t\t\t\t\tverifyMobile(data)\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tnotification('success', t('alertTitles.profileSaved'))\r\n\t\t\t\t\t\tdispatch(AuthSlice.actions.setProfile({ profile: { ...profile, ...data } }))\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tnotification('error', t('alertTitles.profileNotSaved'))\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t} catch (e) {\r\n\t\t\tconsole.log(e)\r\n\t\t}\r\n\t}\r\n\r\n\t// mobile verification by code\r\n\tconst verifyMobile = async (data: IProfile) => {\r\n\t\tconst code = prompt(`${t('alertTitles.mobileVerif')}: ${data.mobile.replace('+', '')}`)\r\n\t\tif (!!code) {\r\n\t\t\tconst answer = await api.verifyCode(code)\r\n\t\t\tif (answer.status === 200) {\r\n\t\t\t\tnotification('success', t('alertTitles.profileSaved'))\r\n\t\t\t\t// dispatch(AuthSlice.actions.setProfile(data))\r\n\t\t\t} else {\r\n\t\t\t\tnotification('error', t('alertTitles.wrongCode'))\r\n\t\t\t\tsaveProfileData(profile as IProfile)\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tnotification('error', t('alertTitles.noCodeVerif'))\r\n\t\t\tsaveProfileData(profile as IProfile)\r\n\t\t}\r\n\t}\r\n\r\n\t// refresh profile data\r\n\tconst refreshProfile = () => {\r\n\t\tupdateProfileData().then(res => {\r\n\t\t\tconst data: IProfile = res.data\r\n\t\t\tconst { tin, accounts, ...filteredData } = data\r\n\t\t\tif (res.status === 200) {\r\n\t\t\t\tnotification('success', t('alertTitles.profileUpdate'))\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tAuthSlice.actions.setProfile({\r\n\t\t\t\t\t\tprofile: { ...profile, ...filteredData }\r\n\t\t\t\t\t})\r\n\t\t\t\t)\r\n\t\t\t} else {\r\n\t\t\t\tnotification('error', t('alertTitles.errorRefresh'))\r\n\t\t\t}\r\n\t\t})\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{profile.isFizAuthToYurProfile && (\r\n\t\t\t\t\r\n\t\t\t\t\t{t('AUTH.isFizAuthToYurFirst')}\r\n\t\t\t\t\t{profile.user?.name}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t{t('AUTH.isFizAuthToYurSecond')}\r\n\t\t\t\t\t{profile.shortName || profile.name} ({t('TIN')}:{profile.tin}){t('AUTH.isFizAuthToYurLast')}\r\n\t\t\t\t\t{t('AUTH.isFizAuthToYurReadOnly')}\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\t\t\t{profile.isAuthWithPassword && (\r\n\t\t\t\t\r\n\t\t\t\t\t{t('AUTH.isAuthWithPasswordFirst')}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t{profile.shortName || profile.name} ({t('TIN')}:{profile.tin})\r\n\t\t\t\t\t\r\n\t\t\t\t\t{t('AUTH.isAuthWithPasswordSecond')}\r\n\t\t\t\t\t{t('AUTH.isAuthWithPasswordReadOnly')}\r\n\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t\t{t('AUTH.isAuthWithPasswordLast')}\r\n\t\t\t\t
\r\n\t\t\t)}\r\n\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{t('admin.details')}\r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{/* ИНН/ПИНФЛ */}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{t('admin.tin_pinfl')}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t{/* НДС */}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{t('PAYERVATSTAT')}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r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r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{t('input.address')}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t{/* Директор */}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{t('input.director')}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t{/* Главный бухгалтер */}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{t('input.accountant')}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t{/* Рабочая почта */}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{t('admin.email')}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t{/* Мобильный номер */}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{t('input.mobile')}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst cleanedValue = value.replace(/\\D/g, '').replace(/^998/, '') // Убираем все нецифровые символы\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (cleanedValue.length !== 9) return t('letterForm.invalidPhone') // Проверка, что номер заполнен полностью\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn true\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t\trender={({ field, fieldState }) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t field.onChange(`998${e.target.value.replace(/\\D/g, '')}`)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{inputProps => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(+998 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t{/* Рабочий номер */}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{t('input.work')}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!value) return true // Если поле пустое, ошибку не показываем\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst cleanedValue = value.replace(/\\D/g, '').replace(/^998/, '') // Убираем все нецифровые символы\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!cleanedValue) return true // Если поле пустое и без 998, ошибку не показываем\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (cleanedValue.length !== 9) return t('letterForm.invalidPhone') // Проверка, что номер заполнен полностью\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn true\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t\trender={({ field, fieldState }) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst onlyNumbers = e.target.value.replace(/\\D/g, '') // Убираем всё, кроме цифр\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfield.onChange(onlyNumbers ? `998${onlyNumbers}` : '') // Если поле пустое, сохраняем ''\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{inputProps => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(+998 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t{/* Телеграм */}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{t('input.tgId')}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{getIcon(link)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t{/* Основной Банк и счёт */}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t{t('input.main')}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t{t('input.bank')} / {t('input.account')}\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t{/* Дополнительные Банк и счёт */}\r\n\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t{/* Товар выдает */}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t{t('common.save')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\r\n\t)\r\n}\r\n\r\nexport default React.memo(Admin)\r\n","import React from 'react'\r\nimport { Navigate, useRoutes } from 'react-router-dom'\r\nimport DashboardLayout from './layouts/dashboard'\r\nimport LogoOnlyLayout from './layouts/LogoOnlyLayout'\r\nimport DashboardApp from './pages/DashboardApp'\r\nimport DocumentsPreviewTable from './components/core/tables/DocumentsPreviewTable'\r\nimport OpenFile from './components/core/openFile/OpenFile'\r\nimport ProfileSelect from './components/ProfileSelect'\r\nimport Settings from './pages/Settings'\r\nimport DocumentEditSkeleton from './components/core/skeletons/DocumentEditSkeleton'\r\nimport ReferencesSkeleton from './components/core/skeletons/ReferencesSkeleton'\r\nimport ContactsSkeleton from './components/core/skeletons/ContactsSkeleton'\r\nimport MxiksSkeleton from './components/core/skeletons/MxiksSkeleton'\r\nimport LoginSkeleton from './components/core/skeletons/LoginSkeleton'\r\nimport RegisterSkeleton from './components/core/skeletons/RegisterSkeleton'\r\nimport MiniApp from './pages/miniapp/MiniApp'\r\nimport Admin from './pages/Admin.tsx'\r\n\r\nconst DocumentEdit = React.lazy(() => import('./components/DocumentEdit'))\r\nconst Contacts = React.lazy(() => import('./pages/Contacts'))\r\nconst Mxiks = React.lazy(() => import('./pages/Mxiks'))\r\nconst AdminItems = React.lazy(() => import('./pages/AdminItems'))\r\nconst References = React.lazy(() => import('./pages/References'))\r\n// const Admin = React.lazy(() => import('./pages/Admin'))\r\nconst Login = React.lazy(() => import('./pages/Login'))\r\nconst Register = React.lazy(() => import('./pages/Register'))\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nexport default function Router({ token, tin }) {\r\n\tconst isAuthenticated = !!token\r\n\tconst isFizHasOldInn = tin.length === 9 && ['4', '5', '6'].includes(tin[0])\r\n\r\n\treturn useRoutes([\r\n\t\t{\r\n\t\t\tpath: '/',\r\n\t\t\telement: isAuthenticated ? : ,\r\n\t\t\tchildren: [\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: 'dashboard',\r\n\t\t\t\t\tchildren: [\r\n\t\t\t\t\t\t{ element: },\r\n\t\t\t\t\t\t{ path: 'app', element: },\r\n\t\t\t\t\t\t{ path: 'profile-select', element: }\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: 'admin',\r\n\t\t\t\t\telement: ,\r\n\t\t\t\t\tchildren: [{ path: ':type', element: }]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: 'profile',\r\n\t\t\t\t\telement: \r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: 'settings',\r\n\t\t\t\t\telement: \r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: 'contacts',\r\n\t\t\t\t\telement: (\r\n\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: 'mxiks',\r\n\t\t\t\t\telement: (\r\n\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: 'catalogue/:type',\r\n\t\t\t\t\telement: (\r\n\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: 'list/:type/:io/:status',\r\n\t\t\t\t\telement: \r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: 'document/:type',\r\n\t\t\t\t\telement: (\r\n\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: 'edit/:type/:id',\r\n\t\t\t\t\telement: (\r\n\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: 'copy/:type/:id',\r\n\t\t\t\t\telement: (\r\n\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: 'open-file/:type/:id',\r\n\t\t\t\t\telement: \r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: '',\r\n\t\t\t\t\telement: \r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tpath: 'add-account',\r\n\t\t\telement: ,\r\n\t\t\tchildren: [\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: '',\r\n\t\t\t\t\telement: (\r\n\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tpath: 'login',\r\n\t\t\telement: isAuthenticated ? (\r\n\t\t\t\tisFizHasOldInn ? (\r\n\t\t\t\t\t\r\n\t\t\t\t) : (\r\n\t\t\t\t\t\r\n\t\t\t\t)\r\n\t\t\t) : (\r\n\t\t\t\t\r\n\t\t\t),\r\n\t\t\tchildren: [\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: '',\r\n\t\t\t\t\telement: (\r\n\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tpath: 'register',\r\n\t\t\telement: isAuthenticated ? : ,\r\n\t\t\tchildren: [\r\n\t\t\t\t{\r\n\t\t\t\t\tpath: '',\r\n\t\t\t\t\telement: (\r\n\t\t\t\t\t\t}>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\tpath: 'miniapp',\r\n\t\t\telement: \r\n\t\t}\r\n\t])\r\n}\r\n","// ----------------------------------------------------------------------\r\n\r\nconst shape = {\r\n borderRadius: 8,\r\n borderRadiusSm: 12,\r\n borderRadiusMd: 16\r\n};\r\n\r\nexport default shape;\r\n","import { alpha } from '@mui/material/styles'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nfunction createGradient(color1, color2) {\r\n\treturn `linear-gradient(to bottom, ${color1}, ${color2})`\r\n}\r\n\r\n// SETUP COLORS\r\nconst GREY = {\r\n\t0: '#FFFFFF',\r\n\t100: '#F9FAFB',\r\n\t200: '#F4F6F8',\r\n\t300: '#DFE3E8',\r\n\t400: '#C4CDD5',\r\n\t500: '#919EAB',\r\n\t600: '#637381',\r\n\t700: '#454F5B',\r\n\t800: '#212B36',\r\n\t900: '#161C24',\r\n\t500_8: alpha('#919EAB', 0.08),\r\n\t500_12: alpha('#919EAB', 0.12),\r\n\t500_16: alpha('#919EAB', 0.16),\r\n\t500_24: alpha('#919EAB', 0.24),\r\n\t500_32: alpha('#919EAB', 0.32),\r\n\t500_48: alpha('#919EAB', 0.48),\r\n\t500_56: alpha('#919EAB', 0.56),\r\n\t500_80: alpha('#919EAB', 0.8)\r\n}\r\n\r\nconst PRIMARY = {\r\n\tlighter: '#ffefcc',\r\n\tlight: '#ffcf66',\r\n\tmain: '#ffaf00',\r\n\tdark: '#996900',\r\n\tdarker: '#332300',\r\n\tcontrastText: '#fff'\r\n}\r\nconst SECONDARY = {\r\n\tlighter: '#D6E4FF',\r\n\tlight: '#84A9FF',\r\n\tmain: '#3366FF',\r\n\tdark: '#1939B7',\r\n\tdarker: '#091A7A',\r\n\tcontrastText: '#fff'\r\n}\r\nconst INFO = {\r\n\tlighter: '#D0F2FF',\r\n\tlight: '#74CAFF',\r\n\tmain: '#1890FF',\r\n\tdark: '#0C53B7',\r\n\tdarker: '#04297A',\r\n\tcontrastText: '#fff'\r\n}\r\nconst SUCCESS = {\r\n\tlighter: '#E9FCD4',\r\n\tlight: '#AAF27F',\r\n\tmain: '#54D62C',\r\n\tdark: '#229A16',\r\n\tdarker: '#08660D',\r\n\tcontrastText: GREY[800]\r\n}\r\nconst WARNING = {\r\n\tlighter: '#FFF7CD',\r\n\tlight: '#FFE16A',\r\n\tmain: '#e28743',\r\n\tdark: '#B78103',\r\n\tdarker: '#7A4F01',\r\n\tcontrastText: GREY[800]\r\n}\r\nconst ERROR = {\r\n\tlighter: '#FFE7D9',\r\n\tlight: '#FFA48D',\r\n\tmain: '#FF4842',\r\n\tdark: '#B72136',\r\n\tdarker: '#7A0C2E',\r\n\tcontrastText: '#fff'\r\n}\r\n\r\nconst GRADIENTS = {\r\n\tprimary: createGradient(PRIMARY.light, PRIMARY.main),\r\n\tinfo: createGradient(INFO.light, INFO.main),\r\n\tsuccess: createGradient(SUCCESS.light, SUCCESS.main),\r\n\twarning: createGradient(WARNING.light, WARNING.main),\r\n\terror: createGradient(ERROR.light, ERROR.main)\r\n}\r\n\r\nconst CHART_COLORS = {\r\n\tviolet: ['#826AF9', '#9E86FF', '#D0AEFF', '#F7D2FF'],\r\n\tblue: ['#2D99FF', '#83CFFF', '#A5F3FF', '#CCFAFF'],\r\n\tgreen: ['#2CD9C5', '#60F1C8', '#A4F7CC', '#C0F2DC'],\r\n\tyellow: ['#FFE700', '#FFEF5A', '#FFF7AE', '#FFF3D6'],\r\n\tred: ['#FF6C40', '#FF8F6D', '#FFBD98', '#FFF2D4']\r\n}\r\n\r\nconst lightPalette = {\r\n\tcommon: { black: '#000', white: '#fff' },\r\n\tprimary: { ...PRIMARY },\r\n\tsecondary: { ...SECONDARY },\r\n\tinfo: { ...INFO },\r\n\tsuccess: { ...SUCCESS },\r\n\twarning: { ...WARNING },\r\n\terror: { ...ERROR },\r\n\tgrey: GREY,\r\n\tgradients: GRADIENTS,\r\n\tchart: CHART_COLORS,\r\n\tdivider: GREY[500_24],\r\n\ttext: { primary: GREY[800], secondary: GREY[600], disabled: GREY[500] },\r\n\tbackground: {\r\n\t\tpaper: '#ffffff',\r\n\t\tdefault: '#F4F5F7',\r\n\t\tneutral: GREY[200],\r\n\t\t// custom: '#F4F5F7',\r\n\t\tcustom: '#e7e7e7',\r\n\t\tactive: '#ffffff',\r\n\t\ticons: '#000',\r\n\t\tsocial: '#000',\r\n\t\ttext: '#000',\r\n\t\t// header: '#F4F5F7',\r\n\t\theader: '#e7e7e7',\r\n\t\ttableContainer: '#e7e7e7',\r\n\t\ttableBody: '#ffffff',\r\n\t\ttableBodyDetail: '#e8eefe'\r\n\t},\r\n\taction: {\r\n\t\tactive: GREY[600],\r\n\t\thover: GREY[500_8],\r\n\t\tselected: GREY[500_16],\r\n\t\tdisabled: GREY[500_80],\r\n\t\tdisabledBackground: GREY[500_24],\r\n\t\tfocus: GREY[500_24],\r\n\t\thoverOpacity: 0.08,\r\n\t\tdisabledOpacity: 0.48\r\n\t}\r\n}\r\n\r\nexport default lightPalette\r\n","import { alpha } from '@mui/material/styles'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nfunction createGradient(color1, color2) {\r\n\treturn `linear-gradient(to bottom, ${color1}, ${color2})`\r\n}\r\n\r\n// SETUP COLORS\r\nconst GREY = {\r\n\t0: '#FFFFFF',\r\n\t100: '#F9FAFB',\r\n\t200: '#F4F6F8',\r\n\t300: '#DFE3E8',\r\n\t400: '#C4CDD5',\r\n\t500: '#919EAB',\r\n\t600: '#637381',\r\n\t700: '#454F5B',\r\n\t800: '#212B36',\r\n\t900: '#161C24',\r\n\t500_8: alpha('#919EAB', 0.08),\r\n\t500_12: alpha('#919EAB', 0.12),\r\n\t500_16: alpha('#919EAB', 0.16),\r\n\t500_24: alpha('#919EAB', 0.24),\r\n\t500_32: alpha('#919EAB', 0.32),\r\n\t500_48: alpha('#919EAB', 0.48),\r\n\t500_56: alpha('#919EAB', 0.56),\r\n\t500_80: alpha('#919EAB', 0.8)\r\n}\r\n\r\nconst PRIMARY = {\r\n\tlighter: '#ffefcc',\r\n\tlight: '#ffcf66',\r\n\tmain: '#ffaf00',\r\n\tdark: '#996900',\r\n\tdarker: '#332300',\r\n\tcontrastText: '#fff'\r\n}\r\nconst SECONDARY = {\r\n\tlighter: '#D6E4FF',\r\n\tlight: '#84A9FF',\r\n\tmain: '#3366FF',\r\n\tdark: '#1939B7',\r\n\tdarker: '#091A7A',\r\n\tcontrastText: '#fff'\r\n}\r\nconst INFO = {\r\n\tlighter: '#80dcff',\r\n\tlight: '#74CAFF',\r\n\tmain: '#1890FF',\r\n\tdark: '#0C53B7',\r\n\tdarker: '#04297A',\r\n\tcontrastText: '#fff'\r\n}\r\nconst SUCCESS = {\r\n\tlighter: '#acf060',\r\n\tlight: '#AAF27F',\r\n\tmain: '#54D62C',\r\n\tdark: '#229A16',\r\n\tdarker: '#08660D',\r\n\tcontrastText: GREY[800]\r\n}\r\nconst WARNING = {\r\n\tlighter: '#ffeb85',\r\n\tlight: '#FFE16A',\r\n\tmain: '#FFC107',\r\n\tdark: '#B78103',\r\n\tdarker: '#7A4F01',\r\n\tcontrastText: GREY[800]\r\n}\r\nconst ERROR = {\r\n\tlighter: '#ffad7d',\r\n\tlight: '#FFA48D',\r\n\tmain: '#FF4842',\r\n\tdark: '#B72136',\r\n\tdarker: '#7A0C2E',\r\n\tcontrastText: '#fff'\r\n}\r\n\r\nconst GRADIENTS = {\r\n\tprimary: createGradient(PRIMARY.light, PRIMARY.main),\r\n\tinfo: createGradient(INFO.light, INFO.main),\r\n\tsuccess: createGradient(SUCCESS.light, SUCCESS.main),\r\n\twarning: createGradient(WARNING.light, WARNING.main),\r\n\terror: createGradient(ERROR.light, ERROR.main)\r\n}\r\n\r\nconst CHART_COLORS = {\r\n\tviolet: ['#826AF9', '#9E86FF', '#D0AEFF', '#F7D2FF'],\r\n\tblue: ['#2D99FF', '#83CFFF', '#A5F3FF', '#CCFAFF'],\r\n\tgreen: ['#2CD9C5', '#60F1C8', '#A4F7CC', '#C0F2DC'],\r\n\tyellow: ['#FFE700', '#FFEF5A', '#FFF7AE', '#FFF3D6'],\r\n\tred: ['#FF6C40', '#FF8F6D', '#FFBD98', '#FFF2D4']\r\n}\r\n\r\nconst darkPalette = {\r\n\tcommon: { black: '#000', white: '#fff' },\r\n\tprimary: { ...PRIMARY },\r\n\tsecondary: { ...SECONDARY },\r\n\tinfo: { ...INFO },\r\n\tsuccess: { ...SUCCESS },\r\n\twarning: { ...WARNING },\r\n\terror: { ...ERROR },\r\n\tgrey: GREY,\r\n\tgradients: GRADIENTS,\r\n\tchart: CHART_COLORS,\r\n\tdivider: GREY[500_24],\r\n\ttext: { primary: GREY[100], secondary: GREY[400], disabled: GREY[500] },\r\n\tbackground: {\r\n\t\t// default: '#161c24',\r\n\t\t// default: '#25374a',\r\n\t\tdefault: '#2E3440',\r\n\t\tpaper: '#1C1F26',\r\n\t\tneutral: GREY[200],\r\n\t\t// custom: '#161c2485',\r\n\t\tcustom: '#1C1F26',\r\n\t\tactive: '#A8B3A8',\r\n\t\ticons: '#FFC107',\r\n\t\tsocial: '#e28743',\r\n\t\ttext: '#fff',\r\n\t\t// header: '#182029',\r\n\t\theader: '#1C1F26',\r\n\t\ttableContainer: '#1C1F26',\r\n\t\t// tableBody: '#222c38',\r\n\t\ttableBody: '#1C1F26',\r\n\t\ttableBodyDetail: '#131c2f'\r\n\t},\r\n\taction: {\r\n\t\tactive: GREY[600],\r\n\t\thover: GREY[500_8],\r\n\t\tselected: GREY[500_16],\r\n\t\tdisabled: GREY[500_80],\r\n\t\tdisabledBackground: GREY[500_24],\r\n\t\tfocus: GREY[500_24],\r\n\t\thoverOpacity: 0.08,\r\n\t\tdisabledOpacity: 0.48\r\n\t}\r\n}\r\n\r\nexport default darkPalette\r\n","// ----------------------------------------------------------------------\r\n\r\nfunction pxToRem(value) {\r\n return `${value / 16}rem`;\r\n}\r\n\r\nfunction responsiveFontSizes({ sm, md, lg }) {\r\n return {\r\n '@media (min-width:600px)': {\r\n fontSize: pxToRem(sm)\r\n },\r\n '@media (min-width:900px)': {\r\n fontSize: pxToRem(md)\r\n },\r\n '@media (min-width:1200px)': {\r\n fontSize: pxToRem(lg)\r\n }\r\n };\r\n}\r\n\r\nconst FONT_PRIMARY = 'Public Sans, sans-serif';\r\n\r\nconst typography = {\r\n fontFamily: FONT_PRIMARY,\r\n fontWeightRegular: 400,\r\n fontWeightMedium: 600,\r\n fontWeightBold: 700,\r\n h1: {\r\n fontWeight: 700,\r\n lineHeight: 80 / 64,\r\n fontSize: pxToRem(40),\r\n ...responsiveFontSizes({ sm: 52, md: 58, lg: 64 })\r\n },\r\n h2: {\r\n fontWeight: 700,\r\n lineHeight: 64 / 48,\r\n fontSize: pxToRem(32),\r\n ...responsiveFontSizes({ sm: 40, md: 44, lg: 48 })\r\n },\r\n h3: {\r\n fontWeight: 700,\r\n lineHeight: 1.5,\r\n fontSize: pxToRem(24),\r\n ...responsiveFontSizes({ sm: 26, md: 30, lg: 32 })\r\n },\r\n h4: {\r\n fontWeight: 700,\r\n lineHeight: 1.5,\r\n fontSize: pxToRem(20),\r\n ...responsiveFontSizes({ sm: 20, md: 24, lg: 24 })\r\n },\r\n h5: {\r\n fontWeight: 700,\r\n lineHeight: 1.5,\r\n fontSize: pxToRem(18),\r\n ...responsiveFontSizes({ sm: 19, md: 20, lg: 20 })\r\n },\r\n h6: {\r\n fontWeight: 700,\r\n lineHeight: 28 / 18,\r\n fontSize: pxToRem(17),\r\n ...responsiveFontSizes({ sm: 18, md: 18, lg: 18 })\r\n },\r\n subtitle1: {\r\n fontWeight: 600,\r\n lineHeight: 1.5,\r\n fontSize: pxToRem(16)\r\n },\r\n subtitle2: {\r\n fontWeight: 600,\r\n lineHeight: 22 / 14,\r\n fontSize: pxToRem(14)\r\n },\r\n body1: {\r\n lineHeight: 1.5,\r\n fontSize: pxToRem(16)\r\n },\r\n body2: {\r\n lineHeight: 22 / 14,\r\n fontSize: pxToRem(14)\r\n },\r\n caption: {\r\n lineHeight: 1.5,\r\n fontSize: pxToRem(12)\r\n },\r\n overline: {\r\n fontWeight: 700,\r\n lineHeight: 1.5,\r\n fontSize: pxToRem(12),\r\n letterSpacing: 1.1,\r\n textTransform: 'uppercase'\r\n },\r\n button: {\r\n fontWeight: 700,\r\n lineHeight: 24 / 14,\r\n fontSize: pxToRem(14),\r\n textTransform: 'capitalize'\r\n }\r\n};\r\n\r\nexport default typography;\r\n","import { merge } from 'lodash';\r\nimport Card from './Card';\r\nimport Lists from './Lists';\r\nimport Paper from './Paper';\r\nimport Input from './Input';\r\nimport Button from './Button';\r\nimport Tooltip from './Tooltip';\r\nimport Backdrop from './Backdrop';\r\nimport Typography from './Typography';\r\nimport IconButton from './IconButton';\r\nimport Autocomplete from './Autocomplete';\r\nimport Checkbox from './Checkbox';\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nexport default function ComponentsOverrides(theme) {\r\n return merge(\r\n Card(theme),\r\n Lists(theme),\r\n Paper(theme),\r\n Input(theme),\r\n Button(theme),\r\n Tooltip(theme),\r\n Backdrop(theme),\r\n Typography(theme),\r\n IconButton(theme),\r\n Autocomplete(theme),\r\n Checkbox(theme)\r\n );\r\n}\r\n","// ----------------------------------------------------------------------\r\n\r\nexport default function Card(theme) {\r\n return {\r\n MuiCard: {\r\n styleOverrides: {\r\n root: {\r\n boxShadow: theme.customShadows.z4,\r\n borderRadius: theme.shape.borderRadiusMd,\r\n position: 'relative',\r\n zIndex: 0 // Fix Safari overflow: hidden with border radius\r\n }\r\n }\r\n },\r\n MuiCardHeader: {\r\n defaultProps: {\r\n titleTypographyProps: { variant: 'h6' },\r\n subheaderTypographyProps: { variant: 'body2' }\r\n },\r\n styleOverrides: {\r\n root: {\r\n padding: theme.spacing(3, 3, 0)\r\n }\r\n }\r\n },\r\n MuiCardContent: {\r\n styleOverrides: {\r\n root: {\r\n padding: theme.spacing(3)\r\n }\r\n }\r\n }\r\n };\r\n}\r\n","// ----------------------------------------------------------------------\r\n\r\nexport default function Lists(theme) {\r\n return {\r\n MuiListItemIcon: {\r\n styleOverrides: {\r\n root: {\r\n color: 'inherit',\r\n minWidth: 'auto',\r\n marginRight: theme.spacing(2)\r\n }\r\n }\r\n },\r\n MuiListItemAvatar: {\r\n styleOverrides: {\r\n root: {\r\n minWidth: 'auto',\r\n marginRight: theme.spacing(2)\r\n }\r\n }\r\n },\r\n MuiListItemText: {\r\n styleOverrides: {\r\n root: {\r\n marginTop: 0,\r\n marginBottom: 0\r\n },\r\n multiline: {\r\n marginTop: 0,\r\n marginBottom: 0\r\n }\r\n }\r\n }\r\n };\r\n}\r\n","// ----------------------------------------------------------------------\r\n\r\nexport default function Paper() {\r\n return {\r\n MuiPaper: {\r\n defaultProps: {\r\n elevation: 0\r\n },\r\n\r\n styleOverrides: {\r\n root: {\r\n backgroundImage: 'none'\r\n }\r\n }\r\n }\r\n };\r\n}\r\n","// ----------------------------------------------------------------------\r\n\r\nexport default function Input(theme) {\r\n return {\r\n MuiInputBase: {\r\n styleOverrides: {\r\n root: {\r\n '&.Mui-disabled': {\r\n '& svg': { color: theme.palette.text.disabled }\r\n }\r\n },\r\n input: {\r\n '&::placeholder': {\r\n opacity: 1,\r\n color: theme.palette.text.disabled\r\n }\r\n }\r\n }\r\n },\r\n MuiInput: {\r\n styleOverrides: {\r\n underline: {\r\n '&:before': {\r\n borderBottomColor: theme.palette.grey[500_56]\r\n }\r\n }\r\n }\r\n },\r\n MuiFilledInput: {\r\n styleOverrides: {\r\n root: {\r\n backgroundColor: theme.palette.grey[500_12],\r\n '&:hover': {\r\n backgroundColor: theme.palette.grey[500_16]\r\n },\r\n '&.Mui-focused': {\r\n backgroundColor: theme.palette.action.focus\r\n },\r\n '&.Mui-disabled': {\r\n backgroundColor: theme.palette.action.disabledBackground\r\n }\r\n },\r\n underline: {\r\n '&:before': {\r\n borderBottomColor: theme.palette.grey[500_56]\r\n }\r\n }\r\n }\r\n },\r\n MuiOutlinedInput: {\r\n styleOverrides: {\r\n root: {\r\n '& .MuiOutlinedInput-notchedOutline': {\r\n borderColor: theme.palette.grey[500_32]\r\n },\r\n '&.Mui-disabled': {\r\n '& .MuiOutlinedInput-notchedOutline': {\r\n borderColor: theme.palette.action.disabledBackground\r\n }\r\n }\r\n }\r\n }\r\n }\r\n };\r\n}\r\n","// ----------------------------------------------------------------------\r\n\r\nexport default function Button(theme) {\r\n return {\r\n MuiButton: {\r\n styleOverrides: {\r\n root: {\r\n '&:hover': {\r\n boxShadow: 'none'\r\n }\r\n },\r\n sizeLarge: {\r\n height: 48\r\n },\r\n containedInherit: {\r\n color: theme.palette.grey[800],\r\n boxShadow: theme.customShadows.z8,\r\n '&:hover': {\r\n backgroundColor: theme.palette.grey[400]\r\n }\r\n },\r\n containedPrimary: {\r\n boxShadow: theme.customShadows.primary\r\n },\r\n containedSecondary: {\r\n boxShadow: theme.customShadows.secondary\r\n },\r\n outlinedInherit: {\r\n border: `1px solid ${theme.palette.grey[500_32]}`,\r\n '&:hover': {\r\n backgroundColor: theme.palette.action.hover\r\n }\r\n },\r\n textInherit: {\r\n '&:hover': {\r\n backgroundColor: theme.palette.action.hover\r\n }\r\n }\r\n }\r\n }\r\n };\r\n}\r\n","// ----------------------------------------------------------------------\r\n\r\nexport default function Tooltip(theme) {\r\n return {\r\n MuiTooltip: {\r\n styleOverrides: {\r\n tooltip: {\r\n backgroundColor: theme.palette.grey[800]\r\n },\r\n arrow: {\r\n color: theme.palette.grey[800]\r\n }\r\n }\r\n }\r\n };\r\n}\r\n","import { alpha } from '@mui/material/styles';\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nexport default function Backdrop(theme) {\r\n const varLow = alpha(theme.palette.grey[900], 0.48);\r\n const varHigh = alpha(theme.palette.grey[900], 1);\r\n\r\n return {\r\n MuiBackdrop: {\r\n styleOverrides: {\r\n root: {\r\n background: [\r\n `rgb(22,28,36)`,\r\n `-moz-linear-gradient(75deg, ${varLow} 0%, ${varHigh} 100%)`,\r\n `-webkit-linear-gradient(75deg, ${varLow} 0%, ${varHigh} 100%)`,\r\n `linear-gradient(75deg, ${varLow} 0%, ${varHigh} 100%)`\r\n ],\r\n '&.MuiBackdrop-invisible': {\r\n background: 'transparent'\r\n }\r\n }\r\n }\r\n }\r\n };\r\n}\r\n","// ----------------------------------------------------------------------\r\n\r\nexport default function Typography(theme) {\r\n return {\r\n MuiTypography: {\r\n styleOverrides: {\r\n paragraph: {\r\n marginBottom: theme.spacing(2)\r\n },\r\n gutterBottom: {\r\n marginBottom: theme.spacing(1)\r\n }\r\n }\r\n }\r\n };\r\n}\r\n","// ----------------------------------------------------------------------\r\n\r\nexport default function IconButton(theme) {\r\n return {\r\n MuiIconButton: {\r\n variants: [\r\n {\r\n props: { color: 'default' },\r\n style: {\r\n '&:hover': { backgroundColor: theme.palette.action.hover }\r\n }\r\n },\r\n {\r\n props: { color: 'inherit' },\r\n style: {\r\n '&:hover': { backgroundColor: theme.palette.action.hover }\r\n }\r\n }\r\n ],\r\n\r\n styleOverrides: {\r\n root: {}\r\n }\r\n }\r\n };\r\n}\r\n","// ----------------------------------------------------------------------\r\n\r\nexport default function Autocomplete(theme) {\r\n return {\r\n MuiAutocomplete: {\r\n styleOverrides: {\r\n paper: {\r\n boxShadow: theme.customShadows.z20\r\n }\r\n }\r\n }\r\n };\r\n}\r\n","// ----------------------------------------------------------------------\r\n\r\nexport default function Checkbox(theme) {\r\n\treturn {\r\n\t\tMuiCheckbox: {\r\n\t\t\tstyleOverrides: {\r\n\t\t\t\troot: {\r\n\t\t\t\t\tMuiSvgIcon: {\r\n\t\t\t\t\t\tstyleOverrides: {\r\n\t\t\t\t\t\t\troot: {\r\n\t\t\t\t\t\t\t\tfill: theme.palette.warning.main\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","// material\r\nimport { alpha } from '@mui/material/styles';\r\nimport palette from './lightPalette';\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nconst LIGHT_MODE = palette.grey[500];\r\n\r\nconst createShadow = (color) => {\r\n const transparent1 = alpha(color, 0.2);\r\n const transparent2 = alpha(color, 0.14);\r\n const transparent3 = alpha(color, 0.12);\r\n return [\r\n 'none',\r\n `0px 2px 1px -1px ${transparent1},0px 1px 1px 0px ${transparent2},0px 1px 3px 0px ${transparent3}`,\r\n `0px 3px 1px -2px ${transparent1},0px 2px 2px 0px ${transparent2},0px 1px 5px 0px ${transparent3}`,\r\n `0px 3px 3px -2px ${transparent1},0px 3px 4px 0px ${transparent2},0px 1px 8px 0px ${transparent3}`,\r\n `0px 2px 4px -1px ${transparent1},0px 4px 5px 0px ${transparent2},0px 1px 10px 0px ${transparent3}`,\r\n `0px 3px 5px -1px ${transparent1},0px 5px 8px 0px ${transparent2},0px 1px 14px 0px ${transparent3}`,\r\n `0px 3px 5px -1px ${transparent1},0px 6px 10px 0px ${transparent2},0px 1px 18px 0px ${transparent3}`,\r\n `0px 4px 5px -2px ${transparent1},0px 7px 10px 1px ${transparent2},0px 2px 16px 1px ${transparent3}`,\r\n `0px 5px 5px -3px ${transparent1},0px 8px 10px 1px ${transparent2},0px 3px 14px 2px ${transparent3}`,\r\n `0px 5px 6px -3px ${transparent1},0px 9px 12px 1px ${transparent2},0px 3px 16px 2px ${transparent3}`,\r\n `0px 6px 6px -3px ${transparent1},0px 10px 14px 1px ${transparent2},0px 4px 18px 3px ${transparent3}`,\r\n `0px 6px 7px -4px ${transparent1},0px 11px 15px 1px ${transparent2},0px 4px 20px 3px ${transparent3}`,\r\n `0px 7px 8px -4px ${transparent1},0px 12px 17px 2px ${transparent2},0px 5px 22px 4px ${transparent3}`,\r\n `0px 7px 8px -4px ${transparent1},0px 13px 19px 2px ${transparent2},0px 5px 24px 4px ${transparent3}`,\r\n `0px 7px 9px -4px ${transparent1},0px 14px 21px 2px ${transparent2},0px 5px 26px 4px ${transparent3}`,\r\n `0px 8px 9px -5px ${transparent1},0px 15px 22px 2px ${transparent2},0px 6px 28px 5px ${transparent3}`,\r\n `0px 8px 10px -5px ${transparent1},0px 16px 24px 2px ${transparent2},0px 6px 30px 5px ${transparent3}`,\r\n `0px 8px 11px -5px ${transparent1},0px 17px 26px 2px ${transparent2},0px 6px 32px 5px ${transparent3}`,\r\n `0px 9px 11px -5px ${transparent1},0px 18px 28px 2px ${transparent2},0px 7px 34px 6px ${transparent3}`,\r\n `0px 9px 12px -6px ${transparent1},0px 19px 29px 2px ${transparent2},0px 7px 36px 6px ${transparent3}`,\r\n `0px 10px 13px -6px ${transparent1},0px 20px 31px 3px ${transparent2},0px 8px 38px 7px ${transparent3}`,\r\n `0px 10px 13px -6px ${transparent1},0px 21px 33px 3px ${transparent2},0px 8px 40px 7px ${transparent3}`,\r\n `0px 10px 14px -6px ${transparent1},0px 22px 35px 3px ${transparent2},0px 8px 42px 7px ${transparent3}`,\r\n `0px 11px 14px -7px ${transparent1},0px 23px 36px 3px ${transparent2},0px 9px 44px 8px ${transparent3}`,\r\n `0px 11px 15px -7px ${transparent1},0px 24px 38px 3px ${transparent2},0px 9px 46px 8px ${transparent3}`\r\n ];\r\n};\r\n\r\nconst createCustomShadow = (color) => {\r\n const transparent = alpha(color, 0.24);\r\n\r\n return {\r\n z1: `0 1px 2px 0 ${transparent}`,\r\n z4: `0 4px 8px 0 ${transparent}`,\r\n z8: `0 8px 16px 0 ${transparent}`,\r\n z12: `0 0 2px 0 ${transparent}, 0 12px 24px 0 ${transparent}`,\r\n z16: `0 0 2px 0 ${transparent}, 0 16px 32px -4px ${transparent}`,\r\n z20: `0 0 2px 0 ${transparent}, 0 20px 40px -4px ${transparent}`,\r\n z24: `0 0 4px 0 ${transparent}, 0 24px 48px 0 ${transparent}`,\r\n primary: `0 8px 16px 0 ${alpha(palette.primary.main, 0.24)}`,\r\n secondary: `0 8px 16px 0 ${alpha(palette.secondary.main, 0.24)}`,\r\n info: `0 8px 16px 0 ${alpha(palette.info.main, 0.24)}`,\r\n success: `0 8px 16px 0 ${alpha(palette.success.main, 0.24)}`,\r\n warning: `0 8px 16px 0 ${alpha(palette.warning.main, 0.24)}`,\r\n error: `0 8px 16px 0 ${alpha(palette.error.main, 0.24)}`\r\n };\r\n};\r\n\r\nexport const customShadows = createCustomShadow(LIGHT_MODE);\r\n\r\nconst shadows = createShadow(LIGHT_MODE);\r\n\r\nexport default shadows;\r\n","import PropTypes from 'prop-types';\r\nimport { useEffect, useMemo, useState } from 'react';\r\n// material\r\nimport { CssBaseline } from '@mui/material';\r\nimport { ThemeProvider, createTheme, StyledEngineProvider } from '@mui/material/styles';\r\n//\r\nimport shape from './shape';\r\nimport lightPalette from './lightPalette';\r\nimport darkPalette from './darkPaletter';\r\nimport typography from './typography';\r\nimport componentsOverride from './overrides';\r\nimport shadows, { customShadows } from './shadows';\r\nimport { useAppSelector } from '../hooks/redux';\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nThemeConfig.propTypes = {\r\n children: PropTypes.node\r\n};\r\n\r\nexport default function ThemeConfig({ children }) {\r\n\r\n const dark = useAppSelector(state => state.appReducer.darkTheme)\r\n const [mode, setMode] = useState('light')\r\n\r\n useEffect(() => {\r\n dark ? setMode('dark') : setMode('light')\r\n }, [dark])\r\n\r\n const themeOptions = useMemo(\r\n () => ({\r\n palette: {mode, ...(\r\n dark ? darkPalette : lightPalette\r\n )},\r\n shape,\r\n typography,\r\n shadows,\r\n customShadows\r\n }),\r\n [dark]\r\n );\r\n\r\n const theme = createTheme(themeOptions);\r\n theme.components = componentsOverride(theme);\r\n\r\n return (\r\n \r\n \r\n \r\n {children}\r\n \r\n \r\n );\r\n}\r\n","// material\r\nimport { useTheme } from '@mui/material/styles'\r\nimport { GlobalStyles as GlobalThemeStyles } from '@mui/material'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nexport default function GlobalStyles() {\r\n\tconst theme = useTheme()\r\n\r\n\treturn (\r\n\t\t\r\n\t)\r\n}\r\n","import React, { useCallback, useEffect, useRef, useState } from 'react'\r\nimport { Alert, AlertTitle, IconButton, Typography } from '@mui/material'\r\nimport { useAppDispatch, useAppSelector } from '../../../hooks/redux'\r\nimport { appSlice } from '../../../redux/reducers/AppReducer'\r\nimport { styled } from '@mui/material/styles'\r\nimport { useTranslation } from 'react-i18next'\r\nimport close from '@iconify/icons-carbon/close-outline'\r\nimport { Icon } from '@iconify/react'\r\n\r\nconst AlertBoxWrapper = styled('div')({\r\n\tposition: 'fixed',\r\n\ttop: '2rem',\r\n\tleft: '3rem',\r\n\tmaxWidth: '90%',\r\n\tzIndex: 11111\r\n})\r\n\r\nconst AlertBox: React.FC = () => {\r\n\tconst dispatch = useAppDispatch()\r\n\tconst { t } = useTranslation()\r\n\tconst { message, type, show, autoHide } = useAppSelector(state => state.appReducer.systemAlert)\r\n\tconst timerRef = useRef(undefined)\r\n\tconst [countdown, setCountdown] = useState(30)\r\n\r\n\t// useEffect(() => {\r\n\t// \tif (!autoHide) {\r\n\t// \t\tclearTimeout(timerRef.current)\r\n\t// \t\treturn\r\n\t// \t}\r\n\t// \tif (show && autoHide) {\r\n\t// \t\ttimerRef.current = setTimeout(() => {\r\n\t// \t\t\thideAlert()\r\n\t// \t\t}, 3000)\r\n\t// \t}\r\n\t// }, [message, type, show, autoHide, timerRef])\r\n\t//\r\n\t// const hideAlert = useCallback(() => {\r\n\t// \tdispatch(appSlice.actions.toggleSystemAlert({ show: false, type: 'info', message: '' }))\r\n\t// }, [autoHide])\r\n\r\n\tconst hideAlert = useCallback(() => {\r\n\t\tdispatch(appSlice.actions.toggleSystemAlert({ show: false, type: 'info', message: '' }))\r\n\t\tclearTimeout(timerRef.current)\r\n\t\tsetCountdown(30)\r\n\t}, [dispatch])\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!show) {\r\n\t\t\tclearTimeout(timerRef.current)\r\n\t\t\tsetCountdown(30)\r\n\t\t\treturn\r\n\t\t}\r\n\r\n\t\tif (autoHide) {\r\n\t\t\ttimerRef.current = setTimeout(() => {\r\n\t\t\t\thideAlert()\r\n\t\t\t}, 3000)\r\n\t\t} else if (type === 'error') {\r\n\t\t\tlet counter = 30\r\n\t\t\tsetCountdown(counter)\r\n\r\n\t\t\tconst interval = setInterval(() => {\r\n\t\t\t\tcounter -= 1\r\n\t\t\t\tsetCountdown(counter)\r\n\r\n\t\t\t\tif (counter <= 0) {\r\n\t\t\t\t\tclearInterval(interval)\r\n\t\t\t\t\thideAlert()\r\n\t\t\t\t}\r\n\t\t\t}, 1000)\r\n\r\n\t\t\treturn () => {\r\n\t\t\t\tclearInterval(interval)\r\n\t\t\t\tclearTimeout(timerRef.current)\r\n\t\t\t}\r\n\t\t}\r\n\t}, [message, type, show, autoHide, hideAlert])\r\n\r\n\tif (show) {\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsx={{\r\n\t\t\t\t\t\tp: 2,\r\n\t\t\t\t\t\t...(type === 'error' && {\r\n\t\t\t\t\t\t\tbackgroundColor: '#ffe6e6',\r\n\t\t\t\t\t\t\tcolor: '#d32f2f',\r\n\t\t\t\t\t\t\tboxShadow: '0 4px 12px rgba(255, 0, 0, 0.3)', // Тень для выделения\r\n\t\t\t\t\t\t\tborderLeft: '6px solid #f44336', // Красная полоса сбоку\r\n\t\t\t\t\t\t\tmaxWidth: '600px'\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t...(type === 'success' && {\r\n\t\t\t\t\t\t\tbackgroundColor: '#d4edda',\r\n\t\t\t\t\t\t\tboxShadow: '0 4px 12px rgba(255, 0, 0, 0.3)',\r\n\t\t\t\t\t\t\tborderLeft: '6px solid #0DE718FF',\r\n\t\t\t\t\t\t\tcolor: '#155724',\r\n\t\t\t\t\t\t\tmaxWidth: '600px'\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}}\r\n\t\t\t\t>\r\n\t\t\t\t\t{t('alertTitles.' + type)}\r\n\t\t\t\t\t{message}\r\n\t\t\t\t\t{type === 'error' && (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{t('alertTitles.linkToSupport')}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\thttps://t.me/edocs_uz\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t{type === 'error' && !autoHide && (\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t{t('alertTitles.closeAlertAfter')}\r\n\t\t\t\t\t\t\t{countdown} сек.\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t)}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t)\r\n\t}\r\n\r\n\treturn null\r\n}\r\n\r\nexport default AlertBox\r\n","import React from 'react'\r\nimport { useEffect } from 'react'\r\nimport { useTranslation } from 'react-i18next'\r\n// redux\r\nimport { appSlice } from '../redux/reducers/AppReducer'\r\nimport { signData } from '../redux/actions/EimzoActions'\r\nimport { useAppDispatch, useAppSelector } from './redux'\r\nimport { fetchProfile } from '../redux/actions/ProfileActions'\r\nimport { getProfileStatus, refreshToken } from '../redux/actions/AuthActions'\r\nimport { fetchDocCounts } from '../redux/actions/DocumentsActions'\r\nimport { fetchAllMeasures, fetchMxikList } from '../redux/actions/GoodsActions'\r\n// fetch\r\nimport axios from 'axios'\r\nimport api from '../api/requests'\r\n// components\r\nimport { IProfile } from '../models/profile'\r\nimport { useProfileGetter, useProfileSetter } from './useProfile'\r\nimport {\r\n\tcheckRoumingErrorsBase,\r\n\tcheckErrorsBase,\r\n\tcheckFormFacturaErrorsBase,\r\n\tcheckFormWaybillLocalErrorsBase,\r\n\tcheckTTHErrorsBase\r\n} from '../utils/utils'\r\n// material\r\nimport { useSnackbar } from 'notistack'\r\nimport { useConfirm } from 'material-ui-confirm'\r\nimport { Icon } from '@iconify/react'\r\nimport Typography from '@mui/material/Typography'\r\nimport close from '@iconify/icons-eva/close-outline'\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nexport default function useApp() {\r\n\tconst dispatch = useAppDispatch()\r\n\tconst { t } = useTranslation()\r\n\tconst { enqueueSnackbar, closeSnackbar } = useSnackbar()\r\n\tconst { logout, updateProfileToken } = useProfileSetter()\r\n\tconst localProfile = useProfileGetter.useGetProfile() as IProfile | undefined\r\n\r\n\tconst localToken = localProfile?.token\r\n\tconst localTokenExpiration = localProfile?.tokenExpiration\r\n\tconst keyId = localProfile?.keyId || ''\r\n\r\n\tconst confirm = useConfirm()\r\n\tconst systemLoading = useAppSelector(state => state.appReducer.systemLoading)\r\n\r\n\taxios.defaults.headers.common['Authorization'] = `Bearer ${localToken}`\r\n\r\n\tconst isTokenExpired = !!localTokenExpiration ? Number(localProfile?.tokenExpiration) < Date.now() : false\r\n\r\n\tuseEffect(() => {\r\n\t\tif (isTokenExpired && !!localToken) {\r\n\t\t\trefreshToken(updateProfileToken)\r\n\t\t}\r\n\t}, [isTokenExpired])\r\n\r\n\tuseEffect(() => {\r\n\t\tconfigureAxiosMiddleware()\r\n\t\thandleToken()\r\n\t\tif (systemLoading) {\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tdispatch(appSlice.actions.toggleSystemLoading(false))\r\n\t\t\t}, 3000)\r\n\t\t}\r\n\t}, [localToken])\r\n\r\n\tconst errorMessageFn = (errorRespons: any): string | string[] | null => {\r\n\t\tconst errorMessage = errorRespons?.data?.errors?.msg\r\n\t\t// Обработка строки\r\n\t\tif (typeof errorMessage === 'string') {\r\n\t\t\tlet filteredErrorMessage = checkErrorsBase(errorMessage, t)\r\n\r\n\t\t\tif (!filteredErrorMessage && errorRespons.config.url.startsWith('/documents/waybillLocal/')) {\r\n\t\t\t\tfilteredErrorMessage = checkTTHErrorsBase(errorMessage, t)\r\n\t\t\t} else if (!filteredErrorMessage) {\r\n\t\t\t\tfilteredErrorMessage = checkRoumingErrorsBase(errorMessage, t)\r\n\t\t\t}\r\n\t\t\treturn filteredErrorMessage || errorMessage\r\n\t\t}\r\n\r\n\t\t// Обработка массива\r\n\t\tif (Array.isArray(errorMessage)) {\r\n\t\t\tif (errorRespons.config.url.startsWith('/documents/factura/')) {\r\n\t\t\t\treturn errorMessage\r\n\t\t\t\t\t.map((item, index) => {\r\n\t\t\t\t\t\tconst checkedValue = checkFormFacturaErrorsBase(item.param, t)\r\n\t\t\t\t\t\tconst valueToUse = checkedValue !== null ? checkedValue : item.param\r\n\t\t\t\t\t\treturn `${index + 1}) ${valueToUse}`\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.join(',\\n')\r\n\t\t\t} else if (errorRespons.config.url.startsWith('/documents/waybillLocal/')) {\r\n\t\t\t\treturn errorMessage\r\n\t\t\t\t\t.map((item, index) => {\r\n\t\t\t\t\t\tconst checkedValue = checkFormWaybillLocalErrorsBase(item.param, t)\r\n\t\t\t\t\t\tconst valueToUse = checkedValue !== null ? checkedValue : item.param\r\n\t\t\t\t\t\treturn `${index + 1}) ${valueToUse}`\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.join(',\\n')\r\n\t\t\t} else {\r\n\t\t\t\treturn errorMessage.map((item, index) => `${index + 1}) ${item.param}`).join(',\\n')\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Если тип данных не строка и не массив, возвращаем null\r\n\t\treturn null\r\n\t}\r\n\r\n\tconst getProfileStat = async () => {\r\n\t\tif (!localProfile) return\r\n\t\tlet { payload } = await dispatch(fetchProfile())\r\n\t\tawait dispatch(getProfileStatus(!!payload.personalNum ? payload.personalNum : payload.tin))\r\n\t\tpayload.tin = !!localProfile.tin?.length ? localProfile.tin : payload.tin\r\n\r\n\t\tcheckEdocsProvider(payload.tin)\r\n\t}\r\n\r\n\tconst checkEdocsProvider = async (tin: string) => {\r\n\t\tif (!localToken) return\r\n\r\n\t\tconst res = await api.getProviders()\r\n\t\tif (res.status === 200) {\r\n\t\t\tconst edocs = res.data.find((obj: any) => obj.providerTin === '300711863')\r\n\r\n\t\t\tif (edocs && !edocs.enabled) {\r\n\t\t\t\tawait confirm({\r\n\t\t\t\t\ttitle: t('alertTitles.warning'),\r\n\t\t\t\t\tdescription: 'У вас не установлен оператор E-DOCS, желаете установить?',\r\n\t\t\t\t\tcancellationText: t('NO'),\r\n\t\t\t\t\tconfirmationText: t('YES'),\r\n\t\t\t\t\tallowClose: false\r\n\t\t\t\t})\r\n\t\t\t\t\t.then(async () => {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tconst providers = res.data.filter((provider: any) => provider.enabled) || []\r\n\t\t\t\t\t\t\t// add edocs to provider list\r\n\t\t\t\t\t\t\tproviders.push(edocs)\r\n\t\t\t\t\t\t\tconst providerTins = providers.map((provider: any) => provider.providerTin)\r\n\t\t\t\t\t\t\tconst pkcs7 = await dispatch(\r\n\t\t\t\t\t\t\t\tsignData(\r\n\t\t\t\t\t\t\t\t\tJSON.stringify({\r\n\t\t\t\t\t\t\t\t\t\tClientTin: tin,\r\n\t\t\t\t\t\t\t\t\t\tproviderTins\r\n\t\t\t\t\t\t\t\t\t}),\r\n\t\t\t\t\t\t\t\t\tkeyId\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\tconst providersRes = await api.setProviders({ sign: pkcs7 })\r\n\t\t\t\t\t\t\tawait api.getProviders()\r\n\t\t\t\t\t\t\tif (providersRes?.data.success) {\r\n\t\t\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\t\t\t\tmessage: t('alertTitles.edocsInstalled'),\r\n\t\t\t\t\t\t\t\t\t\ttype: 'success',\r\n\t\t\t\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\t\t\t\tmessage: t('alertTitles.edocsInstallError'),\r\n\t\t\t\t\t\t\t\t\t\ttype: 'error',\r\n\t\t\t\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} catch (error) {\r\n\t\t\t\t\t\t\tconsole.log('setEdocs error', error)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.catch(e => console.error(e))\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tconst createSnackbarContent = (key: any, message: any, closeSnackbar: (key: any) => void) => {\r\n\t\treturn React.createElement(\r\n\t\t\t'div',\r\n\t\t\t{\r\n\t\t\t\tstyle: {\r\n\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\talignItems: 'center',\r\n\t\t\t\t\tjustifyContent: 'space-between',\r\n\t\t\t\t\tflexDirection: 'column',\r\n\t\t\t\t\tbackgroundColor: '#ffe6e6',\r\n\t\t\t\t\tpadding: '14px 18px',\r\n\t\t\t\t\tborderRadius: '12px',\r\n\t\t\t\t\tboxShadow: '0 2px 10px rgba(0, 0, 0, 0.1)',\r\n\t\t\t\t\twordWrap: 'break-word',\r\n\t\t\t\t\tmaxWidth: '600px'\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tReact.createElement(\r\n\t\t\t\t'div',\r\n\t\t\t\t{\r\n\t\t\t\t\tstyle: {\r\n\t\t\t\t\t\tdisplay: 'flex',\r\n\t\t\t\t\t\talignItems: 'center',\r\n\t\t\t\t\t\tjustifyContent: 'space-between',\r\n\t\t\t\t\t\twidth: '100%',\r\n\t\t\t\t\t\tpaddingBottom: '8px'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tReact.createElement(\r\n\t\t\t\t\tTypography,\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tstyle: {\r\n\t\t\t\t\t\t\tfontSize: '14px',\r\n\t\t\t\t\t\t\tfontFamily: 'cursive',\r\n\t\t\t\t\t\t\tfontWeight: 'bold',\r\n\t\t\t\t\t\t\tcolor: '#d32f2f'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\t'Кажется, возникла ошибка.'\r\n\t\t\t\t),\r\n\t\t\t\tReact.createElement(Icon, {\r\n\t\t\t\t\ticon: close,\r\n\t\t\t\t\tstyle: {\r\n\t\t\t\t\t\twidth: '24px',\r\n\t\t\t\t\t\theight: '24px',\r\n\t\t\t\t\t\tcolor: '#d32f2f',\r\n\t\t\t\t\t\tcursor: 'pointer'\r\n\t\t\t\t\t},\r\n\t\t\t\t\tonClick: () => closeSnackbar(key)\r\n\t\t\t\t})\r\n\t\t\t),\r\n\t\t\tReact.createElement(\r\n\t\t\t\t'div',\r\n\t\t\t\t{ style: { display: 'flex', alignItems: 'center', gap: '8px' } },\r\n\t\t\t\tReact.createElement(\r\n\t\t\t\t\tTypography,\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tstyle: {\r\n\t\t\t\t\t\t\tfontSize: '14px',\r\n\t\t\t\t\t\t\tcolor: '#d32f2f',\r\n\t\t\t\t\t\t\tfontFamily: 'cursive',\r\n\t\t\t\t\t\t\twhiteSpace: 'pre-line'\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tmessage\r\n\t\t\t\t)\r\n\t\t\t),\r\n\r\n\t\t\tReact.createElement(\r\n\t\t\t\tTypography,\r\n\t\t\t\t{\r\n\t\t\t\t\tstyle: {\r\n\t\t\t\t\t\tfontSize: '10px',\r\n\t\t\t\t\t\tcolor: '#716763',\r\n\t\t\t\t\t\tfontFamily: 'cursive',\r\n\t\t\t\t\t\twhiteSpace: 'pre-line',\r\n\t\t\t\t\t\tpaddingTop: '8px'\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tReact.createElement(\r\n\t\t\t\t\t'span',\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\t'Если указанный выше текст ошибки не помог решить проблему, ' +\r\n\t\t\t\t\t\t'пожалуйста, скопируйте его полностью и отправьте в техническую поддержку ',\r\n\t\t\t\t\tReact.createElement(\r\n\t\t\t\t\t\t'a',\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\thref: 'https://t.me/edocs_uz',\r\n\t\t\t\t\t\t\ttarget: '_blank',\r\n\t\t\t\t\t\t\trel: 'noopener noreferrer',\r\n\t\t\t\t\t\t\tstyle: { fontSize: '10px', color: '#716763', textDecoration: 'underline' }\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t'https://t.me/edocs_uz'\r\n\t\t\t\t\t)\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t)\r\n\t}\r\n\r\n\tconst configureAxiosMiddleware = () => {\r\n\t\taxios.interceptors.response.use(\r\n\t\t\tresponse => {\r\n\t\t\t\treturn response\r\n\t\t\t},\r\n\t\t\terror => {\r\n\t\t\t\tconst errorMessage = error.response?.data?.errors?.msg\r\n\t\t\t\tconst filteredErrorMessage = errorMessageFn(error.response)\r\n\r\n\t\t\t\tif (error?.response?.status === 401) {\r\n\t\t\t\t\tlogout()\r\n\t\t\t\t\tif (!!errorMessage) {\r\n\t\t\t\t\t\tenqueueSnackbar(t('alertTitles.notAuth'), {\r\n\t\t\t\t\t\t\tvariant: 'error',\r\n\t\t\t\t\t\t\tautoHideDuration: 6000\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (error.config.headers.hasOwnProperty('showSnackbar') && filteredErrorMessage) {\r\n\t\t\t\t\tif (error.config.headers['showSnackbar'] === 'true') {\r\n\t\t\t\t\t\tenqueueSnackbar(filteredErrorMessage, {\r\n\t\t\t\t\t\t\tautoHideDuration: 30000,\r\n\t\t\t\t\t\t\tcontent: (key, message) => createSnackbarContent(key, message, closeSnackbar)\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\terror.response &&\r\n\t\t\t\t\t\tfilteredErrorMessage &&\r\n\t\t\t\t\t\tenqueueSnackbar(filteredErrorMessage, {\r\n\t\t\t\t\t\t\tautoHideDuration: 30000,\r\n\t\t\t\t\t\t\tcontent: (key, message) => createSnackbarContent(key, message, closeSnackbar)\r\n\t\t\t\t\t\t})\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (errorMessage && filteredErrorMessage && !!localToken) {\r\n\t\t\t\t\tconst dataErrorsMsg = Array.isArray(error?.response?.data?.errors?.msg)\r\n\t\t\t\t\t\t? error?.response?.data?.errors?.msg\r\n\t\t\t\t\t\t\t\t.map((item: { param: any }, index: number) => `${index + 1}) ${item.param}`)\r\n\t\t\t\t\t\t\t\t.join(',\\n')\r\n\t\t\t\t\t\t: error?.response?.data?.errors?.msg\r\n\r\n\t\t\t\t\tapi.catchErrorMessage(\r\n\t\t\t\t\t\t`${error?.response?.status}, ${error?.response?.statusText}\r\n\r\n\t\t\t\t\t\t\tA) config.url:\\n${error?.response?.config.url}\r\n\r\n\t\t\t\t\t\t\tB) data.errors.msg:\\n${dataErrorsMsg}\r\n\r\n\t\t\t\t\t\t\tC) Пояснение в нашей базе:\\n${filteredErrorMessage}\r\n\t\t\t\t\t\t`\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn error.response\r\n\t\t\t}\r\n\t\t)\r\n\t}\r\n\r\n\tconst handleToken = () => {\r\n\t\tif (!!localToken) {\r\n\t\t\tPromise.all([\r\n\t\t\t\tgetProfileStat(),\r\n\t\t\t\tdispatch(fetchDocCounts('all')),\r\n\t\t\t\tdispatch(fetchMxikList()),\r\n\t\t\t\tdispatch(fetchAllMeasures())\r\n\t\t\t])\r\n\t\t}\r\n\t}\r\n}\r\n","import React, { useCallback, useEffect } from 'react'\r\nimport Router from './routes'\r\nimport ThemeConfig from './theme'\r\nimport GlobalStyles from './theme/globalStyles'\r\nimport './sass/main.scss'\r\nimport { useAppSelector, useAppDispatch } from './hooks/redux'\r\nimport AlertBox from './components/core/alert/Alert'\r\nimport LinearLoader from './components/core/linearLoader/LinearLoader'\r\nimport useApp from './hooks/useApp'\r\nimport { appSlice } from './redux/reducers/AppReducer'\r\nimport { version } from './version'\r\nimport { useProfileGetter, useProfileSetter } from './hooks/useProfile'\r\n// import Snowfall from './components/core/tables/ Snowfall/Snowfall'\r\n\r\nexport default function App() {\r\n\tconst { profileExit } = useProfileSetter()\r\n\tconst profile = useProfileGetter.useGetProfile() || {}\r\n\tconst { systemLoading, systemLoadingMsg } = useAppSelector(state => state.appReducer)\r\n\tconst dispatch = useAppDispatch()\r\n\r\n\tuseEffect(() => {\r\n\t\tdispatch(appSlice.actions.toggleSystemLoading(false))\r\n\r\n\t\tconst getVersion = async () => {\r\n\t\t\ttry {\r\n\t\t\t\tconst response = await fetch('/version.js', {\r\n\t\t\t\t\theaders: { 'Cache-Control': 'no-cache' }\r\n\t\t\t\t})\r\n\r\n\t\t\t\tif (!response?.ok) {\r\n\t\t\t\t\tconsole.log(`Error status: ${response.status}`)\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst responseText = await response.text()\r\n\t\t\t\tconst versionMatch = responseText.match(/export const version = '([^']*)'/)\r\n\r\n\t\t\t\tif (versionMatch && versionMatch[1] && versionMatch[1] !== version) {\r\n\t\t\t\t\tawait clearData()\r\n\t\t\t\t\tprofileExit()\r\n\t\t\t\t\tdispatch(\r\n\t\t\t\t\t\tappSlice.actions.toggleSystemAlert({\r\n\t\t\t\t\t\t\ttype: 'warning',\r\n\t\t\t\t\t\t\tmessage: 'Сайт был обновлен. Пожалуйста, перезагрузите страницу.',\r\n\t\t\t\t\t\t\tshow: true\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t)\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.error('Error:', error)\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst interval = setInterval(getVersion, 120000)\r\n\t\treturn () => clearInterval(interval)\r\n\t}, [])\r\n\r\n\tconst clearData = async () => {\r\n\t\tconst themeLightValue = localStorage.getItem('themeLight')\r\n\t\tconst i18nextLngValue = localStorage.getItem('i18nextLng')\r\n\r\n\t\tlocalStorage.clear()\r\n\t\tsessionStorage.clear()\r\n\r\n\t\tdocument.cookie.split(';').forEach(c => {\r\n\t\t\tdocument.cookie = c.replace(/^ +/, '').replace(/=.*/, '=;expires=' + new Date().toUTCString() + ';path=/')\r\n\t\t})\r\n\r\n\t\tif (themeLightValue !== null) {\r\n\t\t\tlocalStorage.setItem('themeLight', themeLightValue)\r\n\t\t}\r\n\r\n\t\tif (i18nextLngValue !== null) {\r\n\t\t\tlocalStorage.setItem('i18nextLng', i18nextLngValue)\r\n\t\t}\r\n\r\n\t\tif ('caches' in window) {\r\n\t\t\ttry {\r\n\t\t\t\tconst cacheNames = await caches.keys()\r\n\t\t\t\tfor (const cacheName of cacheNames) {\r\n\t\t\t\t\tawait caches.delete(cacheName)\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.error('Error clearing caches:', error)\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tuseEffect(() => {\r\n\t\tdocument.addEventListener('keydown', handleCustomHotKey)\r\n\r\n\t\treturn () => {\r\n\t\t\tdocument.removeEventListener('keydown', handleCustomHotKey)\r\n\t\t}\r\n\t}, [])\r\n\r\n\tconst handleCustomHotKey = useCallback(e => {\r\n\t\tif (e.shiftKey && e.key === 'F5') {\r\n\t\t\tclearData()\r\n\t\t}\r\n\t}, [])\r\n\r\n\tuseApp()\r\n\r\n\tuseEffect(() => {\r\n\t\tconst body = document.querySelector('body')\r\n\t\tbody.style.overflow = systemLoading ? 'hidden' : 'unset'\r\n\t}, [systemLoading])\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{systemLoading && }\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t{/**/}\r\n\t\t\t{/*\t*/}\r\n\t\t\t{/**/}\r\n\t\t\t{/*
*/}\r\n\t\t\t\r\n\t\t\t{/*
*/}\r\n\t\t
\r\n\t)\r\n}\r\n","export const version = '1.7.5'\r\n","/* eslint-disable */\r\n/* @ts-nocheck */\r\n\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://bit.ly/CRA-PWA\r\n\r\nconst isLocalhost = Boolean(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(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));\r\n\r\nexport function register(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}/sw.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('This web app is being served cache-first by a service ' +\r\n 'worker. To learn more, visit https://bit.ly/CRA-PWA');\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, config) {\r\n navigator\r\n .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('New content is available and will be used when all ' +\r\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.');\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, 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 (response.status === 404 ||\r\n (contentType != null && contentType.indexOf('javascript') === -1)) {\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 });\r\n}\r\n\r\nexport function unregister() {\r\n if ('serviceWorker' in navigator) {\r\n navigator\r\n .serviceWorker\r\n .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","const reportWebVitals = (onPerfEntry) => {\r\n if (onPerfEntry && onPerfEntry instanceof Function) {\r\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\r\n getCLS(onPerfEntry);\r\n getFID(onPerfEntry);\r\n getFCP(onPerfEntry);\r\n getLCP(onPerfEntry);\r\n getTTFB(onPerfEntry);\r\n });\r\n }\r\n};\r\n\r\nexport default reportWebVitals;\r\n","import { createSlice } from '@reduxjs/toolkit'\r\nimport { fetchDocCounts, fetchDocuments } from '../actions/DocumentsActions'\r\n\r\nconst initialState = {\r\n\ttableLoading: true,\r\n\tdocs: [],\r\n\thasNextPage: false,\r\n\thasPrevPage: false,\r\n\tlimit: 0,\r\n\tnextPage: 0,\r\n\tcurrent_page: 1,\r\n\tpagingCounter: 1,\r\n\tprevPage: null,\r\n\ttotalDocs: 0,\r\n\ttotalPages: 0,\r\n\tdocCounts: {\r\n\t\tin: {\r\n\t\t\tdeleted: 0,\r\n\t\t\tdrafts: 0,\r\n\t\t\trejected: 0,\r\n\t\t\tsended: 0,\r\n\t\t\tsigned: 0\r\n\t\t},\r\n\t\tout: {\r\n\t\t\tdrafts: 0,\r\n\t\t\tsened: 0,\r\n\t\t\tsigned: 0,\r\n\t\t\trejected: 0,\r\n\t\t\tdeleted: 0\r\n\t\t}\r\n\t},\r\n\tcommonDocCounts: {\r\n\t\tin: 0,\r\n\t\tout: 0\r\n\t}\r\n}\r\n\r\nexport const documentsSlice = createSlice({\r\n\tname: 'documents',\r\n\tinitialState,\r\n\treducers: {},\r\n\textraReducers: {\r\n\t\t[fetchDocuments.fulfilled.type]: (state, action) => {\r\n\t\t\tstate.tableLoading = false\r\n\t\t\tstate.docs = action.payload.docs\r\n\t\t\tstate.hasNextPage = action.payload.hasNextPage\r\n\t\t\tstate.hasPrevPage = action.payload.hasPrevPage\r\n\t\t\tstate.limit = action.payload.limit\r\n\t\t\tstate.nextPage = action.payload.nextPage\r\n\t\t\tstate.current_page = action.payload.page\r\n\t\t\tstate.pagingCounter = action.payload.pagingCounter\r\n\t\t\tstate.prevPage = action.payload.prevPage\r\n\t\t\tstate.totalDocs = action.payload.totalDocs\r\n\t\t\tstate.totalPages = action.payload.totalPages\r\n\t\t},\r\n\t\t[fetchDocuments.pending.type]: (state, action) => {\r\n\t\t\tstate.tableLoading = true\r\n\t\t},\r\n\t\t[fetchDocuments.rejected.type]: (state, action) => {\r\n\t\t\tconsole.log('rejected')\r\n\t\t},\r\n\t\t[fetchDocCounts.fulfilled.type]: (state, action) => {\r\n\t\t\tstate.docCounts = JSON.parse(JSON.stringify(action.payload))\r\n\t\t},\r\n\t\t[fetchDocCounts.rejected.type]: (state, action) => {\r\n\t\t\tconsole.log('rejected fetching doc counts')\r\n\t\t}\r\n\t}\r\n})\r\n\r\nexport default documentsSlice.reducer\r\n","import { createSlice } from '@reduxjs/toolkit'\r\nimport { fetchBankAccounts, fetchProfileRights, fetchWareHouses } from '../actions/ProfileActions'\r\n\r\nexport interface IBranch {\r\n\tid: number\r\n\tns10Code: number\r\n\tns10Name: string\r\n\tns11Code: number\r\n\tns11Name: string\r\n\ttin: string\r\n\tname: string\r\n\tbranchName: string\r\n\tbranchNum: string\r\n\tisDeleted: number\r\n\tcreatedDate: string\r\n\tdeletedDate: string\r\n\tdirectorTin: string\r\n\tdirectorName: string\r\n\tdirectorPinfl: number\r\n\tpinfl: number | string | null\r\n\tlatitude: number | string | null\r\n\tlongitude: number | string | null\r\n\tclientIp: number | string | null\r\n\turl: string | null\r\n\tlang: string | null\r\n\tsource: string | null\r\n\taddress: string | null\r\n}\r\n\r\nexport interface ITaxPayers {\r\n\ttin: string\r\n\tbranch?: string\r\n\troles: number[]\r\n}\r\n\r\nexport interface IState {\r\n\trights: {\r\n\t\ttin: string\r\n\t\ttaxpayers: ITaxPayers[]\r\n\t},\r\n\twarehouses: IWareHouse[],\r\n\tbankAccounts: IBankAccounts[],\r\n}\r\n\r\ninterface IWareHouse {\r\n\tid: number\r\n\twarehouseNumber: number\r\n\twarehouseName: string\r\n\twarehouseAddress: string\r\n}\r\n\r\ninterface IBankAccounts {\r\n\tbankId: string\r\n\taccount: string\r\n\tattribute: number\r\n\tcondition: number\r\n}\r\n\r\nconst initialState: IState = {\r\n\trights: {\r\n\t\ttin: '',\r\n\t\ttaxpayers: []\r\n\t},\r\n\twarehouses: [],\r\n\tbankAccounts: []\r\n}\r\n\r\nexport const profileSlice = createSlice({\r\n\tname: 'profile',\r\n\tinitialState,\r\n\treducers: {},\r\n\textraReducers: {\r\n\t\t[fetchProfileRights.fulfilled.type]: (state, action) => {\r\n\t\t\tstate.rights = action.payload\r\n\t\t},\r\n\t\t[fetchWareHouses.fulfilled.type]: (state, action) => {\r\n\t\t\tstate.warehouses = action.payload || []\r\n\t\t},\r\n\t\t[fetchBankAccounts.fulfilled.type]: (state, action) => {\r\n\t\t\tstate.bankAccounts = action.payload || []\r\n\t\t}\r\n\t}\r\n})\r\n\r\nexport default profileSlice.reducer\r\n","import { adminApi } from './../actions/AdminActions'\r\nimport { combineReducers } from 'redux'\r\nimport { configureStore } from '@reduxjs/toolkit'\r\nimport appReducer from './AppReducer'\r\nimport notificationsReducer, { notificationsApi } from './NotificationsReducer'\r\nimport eimzoReducer from './EimzoReducer'\r\nimport authReducer from './AuthReducer'\r\nimport documentsReducer from './DocumentsReducer'\r\nimport filterReducer from './FilterReducer'\r\nimport { listsApi } from '../actions/AdminBanksActions'\r\nimport goodsReducer from './GoodsReducer'\r\nimport profileReducer from './ProfileReducer'\r\nimport groupActionsReducer from './GroupActionsReducer'\r\nimport { fetchMoneyLeft } from '../actions/ProfileActions'\r\nimport { mxiksApi } from '../actions/GoodsActions'\r\nimport { persistStore, persistReducer } from 'redux-persist'\r\nimport storage from 'redux-persist/lib/storage'\r\nimport { newsApi } from '../actions/NewsActions'\r\n\r\nconst persistConfig = {\r\n\tkey: 'root',\r\n\tstorage,\r\n\tversion: 1,\r\n\tblacklist: [\r\n\t\t'documentsReducer',\r\n\t\t'goodsReducer',\r\n\t\tlistsApi.reducerPath,\r\n\t\tfetchMoneyLeft.reducerPath,\r\n\t\tmxiksApi.reducerPath,\r\n\t\tadminApi.reducerPath,\r\n\t\tnewsApi.reducerPath,\r\n\t\tnotificationsApi.reducerPath\r\n\t]\r\n}\r\n\r\nexport const rootReducer = combineReducers({\r\n\tappReducer,\r\n\teimzoReducer,\r\n\tauthReducer,\r\n\tdocumentsReducer,\r\n\tfilterReducer,\r\n\tgoodsReducer,\r\n\tnotificationsReducer,\r\n\tprofileReducer,\r\n\tgroupActionsReducer,\r\n\t[listsApi.reducerPath]: listsApi.reducer,\r\n\t[fetchMoneyLeft.reducerPath]: fetchMoneyLeft.reducer,\r\n\t[mxiksApi.reducerPath]: mxiksApi.reducer,\r\n\t[newsApi.reducerPath]: newsApi.reducer,\r\n\t[adminApi.reducerPath]: adminApi.reducer,\r\n\t[notificationsApi.reducerPath]: notificationsApi.reducer\r\n})\r\n\r\nconst persistedReducer = persistReducer(persistConfig, rootReducer)\r\n\r\nexport const setupStore = () => {\r\n\treturn configureStore({\r\n\t\treducer: persistedReducer,\r\n\t\tdevTools: process.env.NODE_ENV !== 'production',\r\n\t\tmiddleware: getDefaultMiddleware =>\r\n\t\t\tgetDefaultMiddleware({\r\n\t\t\t\tserializableCheck: false\r\n\t\t\t}).concat(\r\n\t\t\t\tlistsApi.middleware,\r\n\t\t\t\tfetchMoneyLeft.middleware,\r\n\t\t\t\tmxiksApi.middleware,\r\n\t\t\t\tadminApi.middleware,\r\n\t\t\t\tnewsApi.middleware,\r\n\t\t\t\tnotificationsApi.middleware\r\n\t\t\t)\r\n\t})\r\n}\r\n\r\nconst store = setupStore()\r\nexport const persistor = persistStore(store)\r\nexport default store\r\n\r\nexport type RootReducer = ReturnType\r\nexport type RootStore = ReturnType\r\nexport type RootDispatch = RootStore['dispatch']\r\n","import i18n from \"i18next\";\r\nimport {initReactI18next} from \"react-i18next\";\r\nimport HttpApi from 'i18next-http-backend';\r\nimport LanguageDetector from \"i18next-browser-languagedetector\";\r\n\r\n// translation languages\r\nimport RussianTranslation from '../locales/ru.json'\r\nimport UzbekTranslation from '../locales/uz.json'\r\n\r\nconst resources = {\r\n ru: {\r\n translation: RussianTranslation\r\n },\r\n uz: {\r\n translation: UzbekTranslation\r\n }\r\n}\r\n\r\ni18n\r\n .use(initReactI18next)\r\n .use(LanguageDetector)\r\n .use(HttpApi)\r\n .init({\r\n supportedLngs: ['ru', 'uz'],\r\n resources,\r\n fallbackLng: 'ru',\r\n debug: false,\r\n interpolation: {\r\n escapeValue: false\r\n }\r\n })\r\n\r\nexport default i18n\r\n","// scroll bar\r\nimport 'simplebar/src/simplebar.css'\r\nimport React from 'react'\r\nimport ReactDOM from 'react-dom'\r\nimport { BrowserRouter } from 'react-router-dom'\r\nimport { HelmetProvider } from 'react-helmet-async'\r\n//\r\nimport App from './App'\r\nimport * as serviceWorker from './serviceWorker'\r\nimport reportWebVitals from './reportWebVitals'\r\nimport { Provider } from 'react-redux'\r\nimport store, { persistor } from './redux/reducers/RootReducer'\r\nimport './utils/i18n'\r\nimport LoadingComponent from './components/core/loader/MainLoader'\r\nimport { ConfirmProvider } from 'material-ui-confirm'\r\nimport { SnackbarProvider } from 'notistack'\r\nimport { Button } from '@mui/material'\r\nimport { PersistGate } from 'redux-persist/integration/react'\r\nimport axios from 'axios'\r\nrequire('dotenv').config()\r\n\r\n// ----------------------------------------------------------------------\r\n\r\nwindow.addEventListener('load', async () => {\r\n\tif ('serviceWorker' in navigator) {\r\n\t\ttry {\r\n\t\t\tawait navigator.serviceWorker.register('/sw.js')\r\n\t\t} catch (e) {\r\n\t\t\tconsole.log(e)\r\n\t\t}\r\n\t}\r\n})\r\n\r\nconst notistackRef = React.createRef()\r\nconst onClickDismiss = key => () => {\r\n\tnotistackRef.current.closeSnackbar(key)\r\n}\r\n\r\naxios.defaults.baseURL = process.env.REACT_APP_DEVELOPMENT_URL\r\n\r\nReactDOM.render(\r\n\t\r\n\t\t} persistor={persistor}>\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t (\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\tmaxSnack={10}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t,\r\n\tdocument.getElementById('root')\r\n)\r\n\r\nserviceWorker.register()\r\n\r\nreportWebVitals()\r\n","import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'\r\nimport api from '../../api/requests'\r\nimport { createAsyncThunk } from '@reduxjs/toolkit'\r\nimport { IMxikProduct } from '../reducers/GoodsReducer'\r\nimport { RootReducer } from '../reducers/RootReducer'\r\n\r\nconst SERVER_ERROR = 'Ошибка на стороне сервера'\r\n\r\nexport const fetchMxikList = createAsyncThunk('goods/fetchMxikList', async (_, thunkAPI) => {\r\n\ttry {\r\n\t\tlet allData: any[] = []\r\n\t\tlet page = 0\r\n\t\tconst size = 1000\r\n\r\n\t\twhile (true) {\r\n\t\t\ttry {\r\n\t\t\t\tconst res = await api.getListOfMxiks({ size, page })\r\n\r\n\t\t\t\tif (res.status === 200 && Array.isArray(res.data)) {\r\n\t\t\t\t\tallData = [...allData, ...res.data]\r\n\r\n\t\t\t\t\tif (res.data.length < size) {\r\n\t\t\t\t\t\tbreak\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpage++\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tbreak\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn allData\r\n\t} catch (e) {\r\n\t\tconsole.error('Ошибка загрузки:', e)\r\n\t\treturn thunkAPI.rejectWithValue(SERVER_ERROR)\r\n\t}\r\n})\r\n\r\nexport const fetchMxikByKey = createAsyncThunk('goods/fetchMxikByKey', async (payload: string, thunkAPI) => {\r\n\ttry {\r\n\t\tconst res = await api.searchForMxik(payload)\r\n\t\treturn res\r\n\t} catch (e) {\r\n\t\treturn thunkAPI.rejectWithValue(SERVER_ERROR)\r\n\t}\r\n})\r\n\r\nexport const fetchAllMeasures = createAsyncThunk('goods/fetchAllMeasures', async (_, thunkAPI) => {\r\n\ttry {\r\n\t\tconst res = await api.getListOfAllMeasures()\r\n\t\treturn res.data\r\n\t} catch (e) {\r\n\t\treturn thunkAPI.rejectWithValue(SERVER_ERROR)\r\n\t}\r\n})\r\n\r\nexport const fetchSignRequest = async () => {\r\n\ttry {\r\n\t\treturn await api.signRequest()\r\n\t} catch (e) {\r\n\t\tconsole.log(e)\r\n\t}\r\n}\r\n\r\nexport const fetchLoginEcp = async (pkcs7: string) => {\r\n\ttry {\r\n\t\treturn await api.loginecp(pkcs7)\r\n\t} catch (e) {\r\n\t\tconsole.log(e)\r\n\t}\r\n}\r\n\r\nexport const searchNonConfirmatoryCompany = async (tin: string) => {\r\n\ttry {\r\n\t\treturn await api.getCheckNonConfirmatoryCompany(tin)\r\n\t} catch (e) {}\r\n}\r\n\r\nexport const fetchMxikLgotas = async (mxik: string, date: string) => {\r\n\ttry {\r\n\t\tconst res = await api.getCheckProduct(mxik, date)\r\n\t\tif (res.status === 200) {\r\n\t\t\treturn res\r\n\t\t}\r\n\t} catch (e) {}\r\n}\r\n\r\nexport const fetchMxikByCode = async (codes: any) => {\r\n\ttry {\r\n\t\treturn await api.searchForMxikByCode(codes)\r\n\t} catch (e) {}\r\n}\r\n\r\nexport const searchRailwayDocId = async (railwayDocId: any) => {\r\n\ttry {\r\n\t\treturn await api.searchRailwayDocId(railwayDocId)\r\n\t} catch (e) {}\r\n}\r\n\r\ninterface IDictionaryProps {\r\n\tpage?: number\r\n\tsize?: number\r\n\tTasnifCode?: string\r\n\tLgotaName?: string\r\n\tTasnifName?: string\r\n}\r\n\r\ntype IMxikMutation = {\r\n\tmxikCode: string\r\n\tpinfl?: string\r\n\ttin?: string\r\n\tmethod?: 'delete' | 'add'\r\n}\r\n\r\ninterface IMxikWithSearch {\r\n\tcode: number\r\n\tdata: IMxikProduct[]\r\n\tsuccess: boolean\r\n}\r\n\r\ntype IMxikCombine = IMxikProduct[] & IMxikWithSearch\r\n\r\nexport const mxiksApi = createApi({\r\n\treducerPath: 'mxiksApi',\r\n\tbaseQuery: fetchBaseQuery({\r\n\t\tbaseUrl: process.env.REACT_APP_DEVELOPMENT_URL,\r\n\t\tprepareHeaders: (headers, { getState }) => {\r\n\t\t\tconst token = (getState() as RootReducer).authReducer.profile.at(-1)?.token || ''\r\n\t\t\theaders.set('Authorization', `Bearer ${token}`)\r\n\t\t\treturn headers\r\n\t\t}\r\n\t}),\r\n\tendpoints: builder => ({\r\n\t\tgetSavedMxiksForCount: builder.query({\r\n\t\t\tquery: args => {\r\n\t\t\t\tconst { page, size, TasnifName } = args\r\n\t\t\t\tconst reqUrl = !!TasnifName ? `/goods/mxik/search/?size=1000&stext=${TasnifName}` : `/goods/product/list`\r\n\t\t\t\treturn {\r\n\t\t\t\t\turl: reqUrl,\r\n\t\t\t\t\tparams: { page, size }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}),\r\n\t\tgetSavedMxiks: builder.query({\r\n\t\t\tquery: args => {\r\n\t\t\t\tconst { TasnifName } = args\r\n\t\t\t\tconst reqUrl = !!TasnifName ? `/goods/mxik/search/?stext=${TasnifName}` : `/goods/product/list`\r\n\t\t\t\treturn {\r\n\t\t\t\t\turl: reqUrl\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}),\r\n\t\tmutateMxik: builder.mutation({\r\n\t\t\tquery: args => {\r\n\t\t\t\tconst reqUrl = args.method === 'add' ? `/goods/product/add` : `/goods/product/del`\r\n\t\t\t\tdelete args.method\r\n\t\t\t\treturn {\r\n\t\t\t\t\turl: reqUrl,\r\n\t\t\t\t\tmethod: 'POST',\r\n\t\t\t\t\tbody: { ...args }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}),\r\n\t\tgetGoodsWithPriveleges: builder.query({\r\n\t\t\tquery: args => {\r\n\t\t\t\tconst { page, size, TasnifCode, TasnifName, LgotaName } = args\r\n\t\t\t\treturn {\r\n\t\t\t\t\turl: `/goods/lgota/without-vat-products`,\r\n\t\t\t\t\tparams: { page, size, TasnifCode, TasnifName, LgotaName }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}),\r\n\t\tgetZeroVatRateServices: builder.query({\r\n\t\t\tquery: args => {\r\n\t\t\t\tconst { page, size, TasnifCode, TasnifName, LgotaName } = args\r\n\t\t\t\treturn {\r\n\t\t\t\t\turl: `/goods/lgota/zero-vat-products`,\r\n\t\t\t\t\tparams: { page, size, TasnifCode, TasnifName, LgotaName }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}),\r\n\t\tgetCompaniesWithPriveleges: builder.query({\r\n\t\t\tquery: args => {\r\n\t\t\t\tconst { page, size, TasnifCode, LgotaName } = args\r\n\t\t\t\treturn {\r\n\t\t\t\t\turl: `/goods/lgota/privileged-seller-companies`,\r\n\t\t\t\t\tparams: { page, size, LgotaName, Tin: TasnifCode }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}),\r\n\t\tgetZeroVatRateCompanies: builder.query({\r\n\t\t\tquery: args => {\r\n\t\t\t\tconst { page, size, TasnifCode, LgotaName } = args\r\n\t\t\t\treturn {\r\n\t\t\t\t\turl: `/goods/lgota/privileged-buyer-companies`,\r\n\t\t\t\t\tparams: { page, size, LgotaName, Tin: TasnifCode }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}),\r\n\t\tgetNoOffsetGoods: builder.query({\r\n\t\t\tquery: args => {\r\n\t\t\t\tconst { page, size, TasnifName } = args\r\n\t\t\t\treturn {\r\n\t\t\t\t\turl: `/goods/lgota/not-included-products`,\r\n\t\t\t\t\tparams: { page, size, SearchText: TasnifName }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}),\r\n\t\tgetCompensationServices: builder.query({\r\n\t\t\tquery: args => {\r\n\t\t\t\tconst { page, size, TasnifName } = args\r\n\t\t\t\treturn {\r\n\t\t\t\t\turl: `/goods/lgota/compensation-works`,\r\n\t\t\t\t\tparams: { page, size, SearchText: TasnifName }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}),\r\n\t\tgetNonConformityGoodsCompanies: builder.query({\r\n\t\t\tquery: args => {\r\n\t\t\t\tconst { page, size, TasnifName } = args\r\n\t\t\t\treturn {\r\n\t\t\t\t\turl: `/goods/utils/non-conformity-goods-companies`,\r\n\t\t\t\t\tparams: { page, size, SearchText: TasnifName }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n\t})\r\n})\r\n\r\nexport const {\r\n\tuseGetCompaniesWithPrivelegesQuery,\r\n\tuseGetCompensationServicesQuery,\r\n\tuseGetGoodsWithPrivelegesQuery,\r\n\tuseGetNoOffsetGoodsQuery,\r\n\tuseGetZeroVatRateCompaniesQuery,\r\n\tuseGetZeroVatRateServicesQuery,\r\n\tuseGetNonConformityGoodsCompaniesQuery,\r\n\tuseGetSavedMxiksQuery,\r\n\tuseMutateMxikMutation,\r\n\tuseGetSavedMxiksForCountQuery\r\n} = mxiksApi\r\n","import { createSlice, current, PayloadAction } from '@reduxjs/toolkit'\r\nimport { IProfile } from '../../models/profile'\r\n\r\ninterface IAuth {\r\n\tprofile: IProfile[]\r\n\taccountStatus: {\r\n\t\tdata: {\r\n\t\t\tcode: number\r\n\t\t\tname: string\r\n\t\t\tnameRu: string\r\n\t\t\tnameUz: string\r\n\t\t}\r\n\t}\r\n}\r\n\r\nconst initialState: IAuth = {\r\n\tprofile: [],\r\n\taccountStatus: {\r\n\t\tdata: {\r\n\t\t\tcode: 0,\r\n\t\t\tname: '',\r\n\t\t\tnameRu: '',\r\n\t\t\tnameUz: ''\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport const AuthSlice = createSlice({\r\n\tname: 'auth',\r\n\tinitialState,\r\n\treducers: {\r\n\t\tsetProfile(state, action: PayloadAction<{ profile: IProfile }>) {\r\n\t\t\tlet filteredProfiles = []\r\n\r\n\t\t\tconst { tin, isAuthWithPassword, isFizAuthToYurProfile } = action.payload.profile\r\n\t\t\tfilteredProfiles = current(state.profile).filter(\r\n\t\t\t\titem =>\r\n\t\t\t\t\t!(\r\n\t\t\t\t\t\titem.tin === tin &&\r\n\t\t\t\t\t\titem.isAuthWithPassword === isAuthWithPassword &&\r\n\t\t\t\t\t\titem.isFizAuthToYurProfile === isFizAuthToYurProfile\r\n\t\t\t\t\t)\r\n\t\t\t)\r\n\r\n\t\t\tstate.profile = [...filteredProfiles, action.payload.profile]\r\n\t\t},\r\n\t\tprofileLogout(state, action: PayloadAction) {\r\n\t\t\tconst { tin, isAuthWithPassword, isFizAuthToYurProfile } = action.payload\r\n\r\n\t\t\tstate.profile = state.profile.filter(\r\n\t\t\t\titem =>\r\n\t\t\t\t\t!(\r\n\t\t\t\t\t\titem.tin === tin &&\r\n\t\t\t\t\t\titem.isAuthWithPassword === isAuthWithPassword &&\r\n\t\t\t\t\t\titem.isFizAuthToYurProfile === isFizAuthToYurProfile\r\n\t\t\t\t\t)\r\n\t\t\t)\r\n\t\t},\r\n\t\tsetNewKeyId(state, action: PayloadAction<{ keyId: string; newKeyId: string }>) {\r\n\t\t\tconst { keyId, newKeyId } = action.payload\r\n\r\n\t\t\tstate.profile.forEach(profile => {\r\n\t\t\t\tif (profile.keyId === keyId) {\r\n\t\t\t\t\tprofile.keyId = newKeyId\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t},\r\n\t\tremoveFizInnProfiles(state) {\r\n\t\t\tstate.profile = state.profile.filter(profile => {\r\n\t\t\t\treturn !(profile.tin.length === 9 && ['4', '5', '6'].includes(profile.tin[0]))\r\n\t\t\t})\r\n\t\t},\r\n\t\tsetAccountStatus(state, action) {\r\n\t\t\tstate.accountStatus = action.payload\r\n\t\t},\r\n\t\tclearAccountStatus(state) {\r\n\t\t\tstate.accountStatus = {\r\n\t\t\t\tdata: { code: 0, name: '', nameRu: '', nameUz: '' }\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\textraReducers: {}\r\n})\r\n\r\nexport default AuthSlice.reducer\r\n","interface IDocTypes {\r\n\tid: number\r\n\tname: string\r\n\tpath: string | null\r\n}\r\n\r\ninterface IFilterDoc {\r\n\tid: number\r\n\tname: string\r\n}\r\n\r\nexport const listOfDocumentCategories: IDocTypes[] = [\r\n\t{\r\n\t\tid: 1,\r\n\t\tname: 'factura',\r\n\t\tpath: '/factura'\r\n\t},\r\n\t{\r\n\t\tid: 10,\r\n\t\tname: 'buildingFactura',\r\n\t\tpath: '/buildingFactura'\r\n\t},\r\n\t{\r\n\t\tid: 2,\r\n\t\tname: 'empowerment',\r\n\t\tpath: '/empowerment'\r\n\t},\r\n\t{\r\n\t\tid: 3,\r\n\t\tname: 'universal',\r\n\t\tpath: '/universal'\r\n\t},\r\n\t{\r\n\t\tid: 4,\r\n\t\tname: 'actWorkPerformed',\r\n\t\tpath: '/actWorkPerformed'\r\n\t},\r\n\t{\r\n\t\tid: 5,\r\n\t\tname: 'actGoodsAcceptance',\r\n\t\tpath: '/actGoodsAcceptance'\r\n\t},\r\n\t{\r\n\t\tid: 6,\r\n\t\tname: 'waybill',\r\n\t\tpath: '/waybill'\r\n\t},\r\n\t{\r\n\t\tid: 11,\r\n\t\tname: 'waybillLocal',\r\n\t\tpath: '/waybillLocal'\r\n\t},\r\n\t{\r\n\t\tid: 7,\r\n\t\tname: 'invoice',\r\n\t\tpath: '/invoice'\r\n\t},\r\n\t{\r\n\t\tid: 8,\r\n\t\tname: 'contract',\r\n\t\tpath: '/contract'\r\n\t},\r\n\t{\r\n\t\tid: 9,\r\n\t\tname: 'actVerification',\r\n\t\tpath: '/actverification'\r\n\t},\r\n\t{\r\n\t\tid: 12,\r\n\t\tname: 'letter',\r\n\t\tpath: '/letter'\r\n\t}\r\n]\r\n\r\nexport const listOfFilterDocuments: IFilterDoc[] = [\r\n\t{\r\n\t\tid: 0,\r\n\t\tname: 'all'\r\n\t},\r\n\t{\r\n\t\tid: 1,\r\n\t\tname: 'factura'\r\n\t},\r\n\t{\r\n\t\tid: 10,\r\n\t\tname: 'buildingFactura'\r\n\t},\r\n\t{\r\n\t\tid: 2,\r\n\t\tname: 'empowerment'\r\n\t},\r\n\t{\r\n\t\tid: 3,\r\n\t\tname: 'universal'\r\n\t},\r\n\t{\r\n\t\tid: 4,\r\n\t\tname: 'actWorkPerformed'\r\n\t},\r\n\t{\r\n\t\tid: 5,\r\n\t\tname: 'actGoodsAcceptance'\r\n\t},\r\n\t{\r\n\t\tid: 6,\r\n\t\tname: 'waybill'\r\n\t},\r\n\t{\r\n\t\tid: 11,\r\n\t\tname: 'waybillLocal'\r\n\t},\r\n\t{\r\n\t\tid: 7,\r\n\t\tname: 'invoice'\r\n\t},\r\n\t{\r\n\t\tid: 8,\r\n\t\tname: 'contract'\r\n\t},\r\n\t{\r\n\t\tid: 9,\r\n\t\tname: 'actVerification'\r\n\t},\r\n\t{\r\n\t\tid: 12,\r\n\t\tname: 'letter'\r\n\t}\r\n]\r\n\r\nexport interface IFacturaDirection {\r\n\tid: number\r\n\tname: string\r\n}\r\n\r\nexport const listOfDocumentDirections: IFacturaDirection[] = [\r\n\t{\r\n\t\tid: 0,\r\n\t\tname: '_0'\r\n\t},\r\n\t{\r\n\t\tid: 1,\r\n\t\tname: '_1'\r\n\t},\r\n\t{\r\n\t\tid: 2,\r\n\t\tname: '_2'\r\n\t},\r\n\t{\r\n\t\tid: 4,\r\n\t\tname: '_4'\r\n\t},\r\n\t{\r\n\t\tid: 5,\r\n\t\tname: '_5'\r\n\t},\r\n\t{\r\n\t\tid: 6,\r\n\t\tname: '_6'\r\n\t},\r\n\t{\r\n\t\tid: 7,\r\n\t\tname: '_7'\r\n\t},\r\n\t{\r\n\t\tid: 8,\r\n\t\tname: '_8'\r\n\t},\r\n\t{\r\n\t\tid: 9,\r\n\t\tname: '_9'\r\n\t},\r\n\t{\r\n\t\tid: 10,\r\n\t\tname: '_10'\r\n\t},\r\n\t{\r\n\t\tid: 11,\r\n\t\tname: '_11'\r\n\t},\r\n\t{\r\n\t\tid: 12,\r\n\t\tname: '_12'\r\n\t},\r\n\t{\r\n\t\tid: 13,\r\n\t\tname: '_13'\r\n\t}\r\n]\r\n\r\nexport const listOfFacturaTypes = [\r\n\t{\r\n\t\tid: 0,\r\n\t\tname: '_0'\r\n\t},\r\n\t{\r\n\t\tid: 1,\r\n\t\tname: '_1'\r\n\t},\r\n\t{\r\n\t\tid: 2,\r\n\t\tname: '_2'\r\n\t},\r\n\t{\r\n\t\tid: 3,\r\n\t\tname: '_3'\r\n\t},\r\n\t{\r\n\t\tid: 4,\r\n\t\tname: '_4'\r\n\t},\r\n\t{\r\n\t\tid: 5,\r\n\t\tname: '_5'\r\n\t},\r\n\t{\r\n\t\tid: 6,\r\n\t\tname: '_6'\r\n\t},\r\n\t{\r\n\t\tid: 8,\r\n\t\tname: '_8'\r\n\t},\r\n\t{\r\n\t\tid: 9,\r\n\t\tname: '_9'\r\n\t}\r\n]\r\n\r\nexport const listOfContractTypes = [\r\n\t{\r\n\t\tid: 0,\r\n\t\tname: '_0'\r\n\t},\r\n\t{\r\n\t\tid: 1,\r\n\t\tname: '_1'\r\n\t},\r\n\t{\r\n\t\tid: 2,\r\n\t\tname: '_2'\r\n\t},\r\n\t{\r\n\t\tid: 3,\r\n\t\tname: '_3'\r\n\t}\r\n]\r\n\r\nexport const listOfProductOrigins = [\r\n\t{\r\n\t\tid: 1,\r\n\t\tname: '_1'\r\n\t},\r\n\t{\r\n\t\tid: 2,\r\n\t\tname: '_2'\r\n\t},\r\n\t{\r\n\t\tid: 3,\r\n\t\tname: '_3'\r\n\t},\r\n\t{\r\n\t\tid: 4,\r\n\t\tname: '_4'\r\n\t}\r\n]\r\n","import {fetchBaseQuery, createApi} from \"@reduxjs/toolkit/dist/query/react\";\r\n\r\nexport interface IBanks {\r\n bankId: string\r\n nameRU: string\r\n nameUZ: string\r\n}\r\n\r\nexport interface IRegions {\r\n regionId: string\r\n nameRU: string\r\n nameUZ: string\r\n}\r\n\r\nexport interface IDistrict {\r\n districtId: string\r\n districtCode: string\r\n regionId: string\r\n nameRU: string\r\n nameUZ: string\r\n soato: number\r\n}\r\n\r\nexport interface IMahalla {\r\n code: number\r\n description: string | null\r\n districtId: number\r\n id: number\r\n kadastrCode: string\r\n name: string\r\n nameRu: string\r\n nameUzCyrl: string\r\n nameUzLatn: string\r\n regionId: number\r\n sector: number\r\n soato: number\r\n tin: string\r\n uzkadCode: string\r\n}\r\n\r\nexport interface ICountries {\r\n Code: string\r\n Name: string\r\n}\r\n\r\nexport interface IStation {\r\n stationId: string\r\n name?: string\r\n}\r\n\r\nexport const listsApi = createApi({\r\n reducerPath: 'listsApi',\r\n baseQuery: fetchBaseQuery({\r\n baseUrl: process.env.REACT_APP_DEVELOPMENT_URL,\r\n }),\r\n endpoints: (builder) => ({\r\n getBanks: builder.query({\r\n query: () => '/banks/all'\r\n }),\r\n getDistricts: builder.query({\r\n query: () => '/districts/all'\r\n }),\r\n getRegions: builder.query({\r\n query: () => '/regions/all'\r\n }),\r\n getStations: builder.query({\r\n query: () => '/stations/all'\r\n }),\r\n getCountries: builder.query({\r\n query: () => '/regions/getcountries'\r\n }),\r\n getWaybillLocalRegions: builder.query({\r\n query: () => '/utils/waybills-v2/catalogs/regions'\r\n }),\r\n getWaybillLocalDistricts: builder.query({\r\n query: (regionId: string) => `/utils/waybills-v2/catalogs/districts?regionId=${regionId}`\r\n }),\r\n getMahallas: builder.query({\r\n query: (soato: number) => `/utils/waybills-v2/catalogs/villages?soato=${soato}`\r\n })\r\n })\r\n})\r\n\r\nexport const {\r\n useGetBanksQuery,\r\n useGetDistrictsQuery,\r\n useGetRegionsQuery,\r\n useGetCountriesQuery,\r\n useGetStationsQuery,\r\n useGetWaybillLocalRegionsQuery,\r\n useGetWaybillLocalDistrictsQuery,\r\n useGetMahallasQuery,\r\n} = listsApi\r\n","import { TextField, TextFieldProps } from '@mui/material'\r\nimport { Controller, FieldErrors, FieldPath, RegisterOptions, useFormContext } from 'react-hook-form'\r\nimport { IDocsType } from '../../models'\r\nimport { fFloat, fNumber } from '../../utils/formatNumber'\r\n\r\nfunction ObjectByString(o: any, s: string) {\r\n\ts = s.replace(/\\[(\\w+)\\]/g, '.$1') // convert indexes to properties\r\n\ts = s.replace(/^\\./, '') // strip a leading dot\r\n\tvar a = s.split('.')\r\n\tfor (var i = 0, n = a.length; i < n; ++i) {\r\n\t\tvar k = a[i]\r\n\t\tif (k in o) {\r\n\t\t\to = o[k]\r\n\t\t} else {\r\n\t\t\treturn\r\n\t\t}\r\n\t}\r\n\treturn o\r\n}\r\n\r\ntype IControlledTextField = TextFieldProps & {\r\n\tname: FieldPath\r\n\trules?: RegisterOptions\r\n\terrors?: FieldErrors\r\n\tformat?: 'currency'\r\n\tformatOnBlur?: boolean\r\n\tformatOnChange?: boolean\r\n}\r\n\r\nconst ControlledTextField = ({\r\n\trules,\r\n\tname,\r\n\terrors,\r\n\tformat,\r\n\tformatOnBlur,\r\n\tformatOnChange,\r\n\t...props\r\n}: IControlledTextField) => {\r\n\tconst { control, setValue } = useFormContext()\r\n\r\n\tconst formatValue = (val: string): string => {\r\n\t\tlet str = val\r\n\r\n\t\tif (format === 'currency') {\r\n\t\t\tstr = fNumber(val)\r\n\t\t}\r\n\t\tif (formatOnChange) {\r\n\t\t\tstr = fFloat(str, 2)\r\n\t\t}\r\n\r\n\t\treturn str\r\n\t}\r\n\r\n\treturn (\r\n\t\t (\r\n\t\t\t\t {\r\n\t\t\t\t\t\tformatOnBlur && setValue(name, fFloat(e.target.value, 2))\r\n\t\t\t\t\t\tfield.onBlur()\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tInputLabelProps={{ shrink: Boolean(field.value) || field.value === 0 }}\r\n\t\t\t\t\terror={Boolean(Object.keys(errors || {}).length) && Boolean(ObjectByString(errors, field.name))}\r\n\t\t\t\t\thelperText={\r\n\t\t\t\t\t\tBoolean(Object.keys(errors || {}).length) && ObjectByString(errors, field.name)\r\n\t\t\t\t\t\t\t? ObjectByString(errors, field.name).message\r\n\t\t\t\t\t\t\t: ''\r\n\t\t\t\t\t}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t/>\r\n\t)\r\n}\r\n\r\nexport default ControlledTextField\r\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit'\r\n\r\nexport interface IFilter {\r\n\tdocType: string\r\n\ttin: string\r\n\tnumber: string\r\n\tminDate: Date | null | string\r\n\tmaxDate: Date | null | string\r\n\tcontractNumber: string\r\n\tcontractDate: Date | null | string\r\n}\r\n\r\nexport const filterState: IFilter = {\r\n\tdocType: 'all',\r\n\ttin: '',\r\n\tnumber: '',\r\n\tminDate: null,\r\n\tmaxDate: null,\r\n\tcontractDate: null,\r\n\tcontractNumber: ''\r\n}\r\n\r\ninterface FilterSliceState {\r\n\tfilters: { [profileTin: string]: IFilter }\r\n\tcurrentProfileTin: string | null\r\n\tfilter: IFilter\r\n}\r\n\r\nconst initialState: FilterSliceState = {\r\n\tfilters: {},\r\n\tcurrentProfileTin: null,\r\n\tfilter: filterState\r\n}\r\n\r\nexport const filterSlice = createSlice({\r\n\tname: 'filter',\r\n\tinitialState,\r\n\treducers: {\r\n\t\tsetFilter(state, action: PayloadAction) {\r\n\t\t\tconst profileTin = state.currentProfileTin\r\n\t\t\tif (profileTin) {\r\n\t\t\t\tif (!state.filters) {\r\n\t\t\t\t\tstate.filters = {}\r\n\t\t\t\t}\r\n\t\t\t\tif (!state.filters[profileTin]) {\r\n\t\t\t\t\tstate.filters[profileTin] = { ...filterState }\r\n\t\t\t\t}\r\n\t\t\t\tstate.filters[profileTin] = action.payload\r\n\t\t\t\tstate.filter = action.payload\r\n\t\t\t}\r\n\t\t},\r\n\t\tresetFilter(state) {\r\n\t\t\tconst profileTin = state.currentProfileTin\r\n\t\t\tif (profileTin) {\r\n\t\t\t\tif (!state.filters) {\r\n\t\t\t\t\tstate.filters = {}\r\n\t\t\t\t}\r\n\t\t\t\tif (!state.filters[profileTin]) {\r\n\t\t\t\t\tstate.filters[profileTin] = { ...filterState }\r\n\t\t\t\t}\r\n\t\t\t\tstate.filters[profileTin] = { ...filterState }\r\n\t\t\t\tstate.filter = { ...filterState }\r\n\t\t\t}\r\n\t\t},\r\n\t\tsetFilterProfile(state, action: PayloadAction) {\r\n\t\t\tconst profileTin = action.payload\r\n\t\t\tstate.currentProfileTin = profileTin\r\n\t\t\tif (!state.filters) {\r\n\t\t\t\tstate.filters = {}\r\n\t\t\t}\r\n\t\t\tif (!state.filters[profileTin]) {\r\n\t\t\t\tstate.filters[profileTin] = { ...filterState }\r\n\t\t\t}\r\n\t\t\tstate.filter = { ...state.filters[profileTin] }\r\n\t\t},\r\n\t\tresetAllFilters(state) {\r\n\t\t\tstate.filters = {}\r\n\t\t\tstate.filter = { ...filterState }\r\n\t\t},\r\n\t\tsetupDocTypeFilter(state, action: PayloadAction) {\r\n\t\t\tconst profileTin = state.currentProfileTin\r\n\t\t\tif (profileTin) {\r\n\t\t\t\tif (!state.filters[profileTin]) {\r\n\t\t\t\t\tstate.filters[profileTin] = { ...filterState }\r\n\t\t\t\t}\r\n\t\t\t\tstate.filters[profileTin].docType = action.payload\r\n\t\t\t\tstate.filter.docType = action.payload\r\n\t\t\t}\r\n\t\t},\r\n\t\tsetupTinFilter(state, action: PayloadAction) {\r\n\t\t\tconst profileTin = state.currentProfileTin\r\n\t\t\tif (profileTin) {\r\n\t\t\t\tif (!state.filters[profileTin]) {\r\n\t\t\t\t\tstate.filters[profileTin] = { ...filterState }\r\n\t\t\t\t}\r\n\t\t\t\tstate.filters[profileTin].tin = action.payload\r\n\t\t\t\tstate.filter.tin = action.payload\r\n\t\t\t}\r\n\t\t},\r\n\t\tsetupNumberFilter(state, action: PayloadAction) {\r\n\t\t\tconst profileTin = state.currentProfileTin\r\n\t\t\tif (profileTin) {\r\n\t\t\t\tif (!state.filters[profileTin]) {\r\n\t\t\t\t\tstate.filters[profileTin] = { ...filterState }\r\n\t\t\t\t}\r\n\t\t\t\tstate.filters[profileTin].number = action.payload\r\n\t\t\t\tstate.filter.number = action.payload\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n})\r\n\r\nexport default filterSlice.reducer\r\n","/* eslint-disable import/no-anonymous-default-export */\r\nimport axios from 'axios'\r\nimport { fShortDashedDate } from '../utils/formatTime'\r\n\r\nexport default {\r\n\tasync getProfile() {\r\n\t\treturn await axios.get('/profile')\r\n\t},\r\n\tasync getProfileByTin(tin: string) {\r\n\t\treturn await axios.get(`/profile/${tin}`)\r\n\t},\r\n\tasync getProfileByPinfl(pinfl: string) {\r\n\t\treturn await axios.get(`/profile/${pinfl}`)\r\n\t},\r\n\tasync getProfileType(tin: string, date: string) {\r\n\t\tdate = !!date ? date : fShortDashedDate(Date.now())\r\n\t\treturn await axios.get(`/profile/taxpayertype/${tin}/${date}`)\r\n\t},\r\n\tasync getProfileTypeCommitent(tin: string) {\r\n\t\treturn await axios.get(`/profile/taxpayertype/${tin}`)\r\n\t},\r\n\tasync getProfileRights() {\r\n\t\treturn await axios.get(`/profile/rights`)\r\n\t},\r\n\tasync getProfileBankAccounts(tin: string) {\r\n\t\treturn await axios.get(`/profile/bankaccounts/${tin}`)\r\n\t},\r\n\tasync getWarehouses(tin: string) {\r\n\t\treturn await axios.get(`/profile/warehouses/${tin}`)\r\n\t},\r\n\tasync getCurrentTurnOver(tin: string, year: string) {\r\n\t\treturn await axios.get(`/profile/currentturnover/${tin}/${year}`)\r\n\t},\r\n\tasync getRentContracts(from: string, to: string) {\r\n\t\treturn await axios.get(`/profile/rentcontracts/${from}/${to}`)\r\n\t}\r\n}\r\n\r\nexport const setProfileRights = async (rights: object) => {\r\n\tlet response: boolean = false\r\n\tawait axios.post(`/profile/rights`, rights).then(res => {\r\n\t\tif (res.status === 200) {\r\n\t\t\tresponse = true\r\n\t\t}\r\n\t})\r\n\treturn response\r\n}\r\n"],"sourceRoot":""}