{"version":3,"sources":["components/Spinner/Spinner.module.css","components/Spinner/Spinner.js","components/common/Inputs/PhoneNumber/CountryCodes.js","components/common/Inputs/PhoneNumber/PhoneNumber.js","assets/no-image-icon-6.png","components/common/Functions.js","components/Password/Forgot.js","components/Settings/Billing/index.js","AppContext.js","components/Footer/Footer.js","components/common/Tab/tab.js","api/data.js","components/Header/EmailSender.js","components/Header/WhatsAppSender.js","components/common/MutilpleStations.js","components/Header/InvoiceButton.js","components/Header/SessionExpireWarning.js","components/Header/Header.js","components/Home/assets/img/hero-img.png","components/Home/assets/img/bg_hero_1.svg","components/Login/Login.js","Route.js","components/Home/Home.js","components/common/Loader.js","assets/sidebar/jss/Typography.js","assets/sidebar/jss/Theme-variable.js","components/Sidebar/NavItems.js","components/Sidebar/data.js","assets/sidebar/images/backgrounds/admin.jpg","components/Sidebar/Profile.js","components/Sidebar/Distribution.js","components/Sidebar/Sidebar.js","NotPaid.js","AdminRoute.js","index.js","api/useApiRes.js","api/PostData.js","api/index.js"],"names":["module","exports","Spinner","_jsx","className","styles","container","children","loader","countryCodes","code","dialCode","PhoneNumberInput","_ref","onChange","defultValues","selectedCountry","setSelectedCountry","useState","phoneNumber","setPhoneNumber","error","setError","useEffect","PhoneNumber","async","response","axios","get","params","apiKey","country","concat","data","calling_code","country_code2","console","fetchCountryCode","length","checkValidity","fullPhoneNumber","valid","isValidPhoneNumber","_jsxs","Grid","spacing","alignItems","item","xs","FormControl","fullWidth","Autocomplete","size","id","options","getOptionLabel","option","value","handleCountryChange","event","newValue","renderInput","TextField","label","variant","validateState","helperText","inputNumber","target","accountingFormat","num","undefined","Math","abs","toLocaleString","minimumFractionDigits","maximumFractionDigits","getDefaultImageAsBase64","type","arguments","fetch","DefaultImage","then","arrayBuffer","buffer","binary","slice","call","Uint8Array","base64String","btoa","map","charCode","String","fromCharCode","join","base64","catch","state","name","log","trim","isNaN","DateTimeFormat","dateAdded","userTimeZone","Intl","resolvedOptions","timeZone","nairobiDate","Date","getTime","offsetDiff","getTimezoneOffset","adjustedDate","year","month","day","hour","minute","second","hour12","getNairobiTimeFromLocal","date","localTime","DefaultContextDateRange","timeRange","monthFirstDay","getFullYear","getMonth","todayStart","setHours","now","startTime","endTime","valueOf","setMonth","VendorProductCheck","ProductID","locd","useContext","AppContext","products","VendorLocationCratoProductArray","some","product","CratoProductID","Forgot","setForgot","history","useHistory","form","setForm","PassCode","NewPassword","ConfirmPassword","step","setStep","loading","setLoading","handleChange","e","commonStyles","formContainer","paddingTop","paddingBottom","display","justifyContent","minHeight","backgroundColor","paper","padding","borderRadius","boxShadow","width","maxWidth","heading","fontSize","fontWeight","textAlign","marginBottom","color","button","marginTop","cursor","textTransform","letterSpacing","transition","buttonSpacing","buttonSecondary","border","errorText","successIcon","buttonContainer","gap","input","margin","outline","inputFocus","borderColor","style","Container","component","Paper","Typography","onSubmit","preventDefault","GetPassCode","Response","json","result","Error","toast","success","Message","placeholder","required","CircularProgress","Button","onClick","handleSubmit","ResetPassword","push","header","borderBottom","headerGrid","gridTemplateColumns","businessDetails","customerDetails","companyName","detailsText","documentTitle","statementInfo","table","borderCollapse","th","td","totalRow","amount","fontFamily","debit","credit","modal","position","top","left","transform","zIndex","overlay","right","bottom","marginRight","FinancialStatement","_result$Response","_checkresult$Response","_profile$StationsArra","_statement","invoice","encryptSession","getItem","profile","GetVendorProfile","timerRef","useRef","countdown","setCountdown","paymentMethod","setPaymentMethod","showPaymentModal","setShowPaymentModal","ContactPhone","onSuccess","handleFormSubmit","HandleSTKRequest","AddVendorAccountPayment","InvoiceNO","checkloading","checkresult","HandleSTKCheckResult","CheckSTKPushAccountPayment","CheckoutRequestID","completeloading","completeresult","handleConfirm","ConfirmAccountPayment","TransID","current","clearTimeout","timer","setInterval","prevCountdown","clearInterval","_checkresult$Response2","ResultCode","setTimeout","_checkresult$Response3","ResultDesc","dateRange","getLast12MonthsRange","endDate","startDate","setFullYear","toISOString","split","statement","GetVendorStatement","DateRange","VendorName","accountNo","stations","StationsArray","phone","email","ContactEmail","formatCurrency","handlePaymentMethodChange","method","totals","reduce","acc","transaction","totalDebit","Debit","totalCredit","Credit","toLocaleDateString","index","description","Balance","colSpan","_Fragment","marginLeft","disabled","InvoiceAmount","handlePaymentSubmit","React","createContext","Footer","Tabs","props","active","setActive","localStorage","anchorEl","setAnchorEl","menuIdx","setMenuIdx","Headers","handleTabs","lastPart","window","location","href","pop","_Headers$","_Headers$$children","newIndex","findIndex","url","tab","tabIndex","child","idx","background","icon","VendorID","NavBar","Dns","PermMedia","People","Settings","ProductionQuantityLimits","IconBoxModel","Support","TimeToLeaveOutlined","Phonelink","House","SendEmailDialog","recipients","setRecipients","reportName","setReportName","body","setBody","setEmail","IconButton","handleAddRecipient","AddIcon","maxHeight","overflow","List","dense","recipient","ListItem","secondaryAction","edge","filter","_","i","handleDeleteRecipient","DeleteIcon","ListItemText","primary","multiline","rows","EmailSender","_ref2","setOpen","open","pdfBlob","context","reporttitle","handleClose","handleUpload","SendEmailReport","emails","pdfBase64","VendorLocationName","TradingName","Body","Dialog","onClose","DialogTitle","DialogContent","src","height","title","DialogActions","setReport","report","_value$dialCode","_value$dialCode2","replace","CountryCode","WhatsAppSender","reports","setReports","SendWhatsAppReport","FileName","ReportName","CompanyPhone","SearchableDropdown","locations","storedValues","isVisible","setIsVisible","searchTerm","setSearchTerm","selectedOptions","setSelectedOptions","isMultiSelect","setIsMultiSelect","setContext","setVendorImage","setLocd","dropdownRef","dropdownHeight","setDropdownHeight","filteredOptions","_option$VendorLocatio","toLowerCase","includes","handleOnChange","useCallback","newValues","updateValue","VendorLocationID","VendorLocationIDs","selectedOption","v","vendorLocationIDs","ImageID","prevContext","setItem","JSON","stringify","handleDateChange","start","end","_context$DateRange_","_context$DateRange_2","currentStartDate","DateRange_","currentEndDate","newStartDate","newEndDate","handleClickOutside","contains","document","addEventListener","removeEventListener","calculateHeight","_dropdownRef$current","innerHeight","getBoundingClientRect","max","handleOptionChange","newSelectedOptions","renderDateInputs","_context$DateRange","_context$DateRange2","startType","endType","moment","format","station","ref","boxSizing","readOnly","fetching","role","flexDirection","listStyleType","overflowY","flexGrow","scrollbarWidth","msOverflowStyle","checked","WarningMessage","dueDate","handleClick","animation","viewBox","fill","stroke","strokeWidth","flexShrink","cx","cy","r","x1","y1","x2","y2","overlayStyle","modalStyle","buttonStyle","continueButtonStyle","logoutButtonStyle","WarningModal","onExtendSession","counter","setCounter","initiallocd","logo","Header","pageHeader","setPageHeader","timeoutIdRef","DueDate","handleActivity","mouseMoveHandler","keyDownHandler","warningTimeoutIdRef","domain1","newPageHeader","el","toLocaleLowerCase","logout","caches","keys","forEach","delete","key","sessionStorage","clear","reload","setShowWarning","user","customer","VendorImage","setPhone","file","setFile","showWarning","componentRef","parse","hostname","handleReload","firstObject","selectedYear","selectedMonth","Array","isArray","exportToPdf","generatePDF","Promise","resolve","convertpf","byteCharacters","atob","byteNumbers","charCodeAt","byteArray","blob","Blob","URL","createObjectURL","a","createElement","download","appendChild","click","revokeObjectURL","removeChild","element","filename","html2canvas","scale","scrollX","scrollY","scrollWidth","scrollHeight","windowWidth","windowHeight","useCORS","jsPDF","unit","orientation","clonedElement","cloneNode","clonedHeight","offsetHeight","currentPosition","pageHeight","from","elemHeight","fitsInCurrentPage","classList","add","innerHTML","head","html2pdf","set","outputPdf","pdfDataUrl","base64data","isDueDateLessThan5Days","AppBar","elevation","Toolbar","isSidebarOpen","Hidden","mdDown","toggleSidebar","sx","Menu","lgUp","toggleMobileSidebar","toLocaleUpperCase","WarningButton","Location","float","Tooltip","p","Avatar","isOnline","alt","textColor","Tab","ReactToPrint","trigger","Print","content","pageStyle","PrintSharp","exportToExcel","_componentRef$current","querySelector","_context$reporttitle","worksheet","XLSX","table_to_sheet","workbook","book_new","truncatedSheetName","substring","book_append_sheet","InsertDriveFile","Email","WhatsApp","SessionExpireWarning","extendSession","firstDay","lastDay","SignUp","isLoggedIn","setIsLoggedIn","values","setValues","password","twoFA","setTwoFA","isTwoFactorEnabled","setIsTwoFactorEnabled","twoFactorCode","setTwoFactorCode","isHovered","setIsHovered","showTwoFactorOptions","setShowTwoFactorOptions","showPassword","setShowPassword","setType","forgot","assetloading","HandleLogin","UserLogin","customerloading","customerResult","HandleCustomerLogin","UserLoginCustomer","SetDefaultRange","_locations$","_locations$2","_locations$3","_locations$4","_locations$5","Slogan","VendorStatusID","TwoFA","storedType","handleCustomerLoginSuccess","UserToken","UserID","CustomerName","CustomerID","StatusID","VendorLocationPhone","UserTypeID","FirstName","handleLoginSuccess","_result$VendorCratoPr","VendorParentID","AssignedStationArray","VendorTypeID","VendorCratoProductArray","resetloading","HandleResetTwoFA","ResetTwoFactoAuthentication","lineHeight","grid","register","formField","passwordInput","backgroundImage","backgroundRepeat","backgroundSize","backgroundPosition","toggleIcon","forgotPasswordLink","textDecoration","submitButton","checkboxContainer","customCheckboxGroup","customCheckbox","tickIcon","tick","tickVisible","xmlns","offset","stopColor","d","h2","htmlFor","explanation","decodedPasscode","encodedPasscode","TwoFACode","onMouseEnter","onMouseLeave","info","emailInput","togglePasswordVisibility","VisibilityOff","Visibility","strokeLinecap","strokeLinejoin","link","InvoiceDetails","lazy","Dashboard","Reset","Pump","Nozzle","Download","Help","Profile","Billing","AuditLog","Manual","StockReport","StockAction","Purchase","Inventory","Supplier","Offloading","SaleHistory","SalesDashboard","ClientList","ClockManagement","ShiftSummary","Statement","Expense","Transfer","Payroll","Tax","CustomerDash","ConDashboard","LotSummary","DaillySummary","DistributionDashboard","LoyaltyCardDashboard","LoyaltyCustomers","VendorCards","LoyaltySettings","LoyaltyProduct","LoyaltyRewards","LoyaltyRedeems","FuelCardCardDashboard","FuelCardCards","FuelCardTransactionCards","FuelCardCustomerCards","DistributionOrders","DistributionPurchase","DistributionVehicle","ViewTicket","route","path","layout","Background","class","Typical","loop","Infinity","wrapper","steps","homepage","Login","LoadingSpinner","typography","body1","h1","h3","h4","h5","h6","defaultTheme","createTheme","direction","palette","main","secondary","status","danger","overrides","MuiToolbar","gutters","breakpoints","up","paddingLeft","paddingRight","useStyles","makeStyles","theme","minWidth","text","fontWeightMedium","Navitems","Icon","rest","classes","disableGutters","activeClassName","NavLink","to","ListItemIcon","Menuitems","HomeTwoTone","ShoppingBag","MonetizationOn","Summarize","Business","AutoModeOutlined","piclarge","profileBg","bgprofile","profileTextBg","menuitem","vendorName","userProfile","avatar","jobTitle","toUpperCase","handleRedirect","Box","Close","currentTarget","ExpandMoreIcon","getContentAnchorEl","anchorOrigin","vertical","horizontal","transformOrigin","Boolean","MenuItem","Loyalty","PaymentsRounded","IconDatabase","IconManualGearbox","LogoutOutlined","Distribution","m","bgcolor","mt","disableElevation","mobileSidebar","desktopSidebar","borderRight","Sidebar","list2","productIDs","SidebarContent","Divider","Drawer","anchor","isMobileSidebarOpen","onSidebarClose","NotPaid","flexWrap","Company","AdminRoute","_locd$VendorLocationC","_locd$VendorLocationC2","vtype","setSidebarOpen","setMobileSidebarOpen","setIsOnline","navigator","onLine","handleOnlineStatusChange","root","dark","flex","hideFullSidebar","contentContainer","Copyright","align","Link","CssBaseline","BrowserRouter","SnackbarProvider","ToastContainer","Switch","Suspense","fallback","routes","prop","Route","exact","memo","queryClient","QueryClient","App","useMemo","refresh","fetchError","currentPath","pathname","isExcludedPath","memoizedContextValue","Provider","ReactDOM","render","StrictMode","QueryClientProvider","client","getElementById","lastFetchTimeMap","Map","useApiRes","api","useLocation","setData","network","setNetwork","visible","setVisible","FETCH_INTERVAL","manageCache","cacheNames","cacheName","cache","request","timestamp","searchParams","parseInt","err","addDataIntoCache","timestampedUrl","toString","startsWith","put","getCachedData","cachedResponse","match","ok","fetchData","abortController","retries","signal","errors","cachedData","controller","AbortController","lastFetchTime","updateData","abort","handleVisibilityChange","visibilityState","handleOnlineStatus","useAsyncSubmit","successFns","errorFns","submitted","setSubmitted","setSuccess","setResult","token","handleAsyncSubmit","apiURL","requestBody","bypass","headers","Authorization","fn","useVendorID","Main_URL","Funguo","EncryptStorage","encAlgorithm","storageType","ParentID","successFn","errorFn","asyncSubmit","Password","userID","addedBy","Accept","resetCode","UserCustomerRegistration","customerID","countryCode","firstName","lastName","userImage","GetNozzleReadingType","readingtype","GetLocations","GetTank","LocationID","tank","mutate","gettank","AddVendorTank","TankName","TankCapacity","AddedBy","TankParentID","UpdateVendorTank","TankID","RemoveVendorTank","GetDipReading","reading","GetNozzle","PumpID","nozzle","GetVendorLocationNozzle","GetNozzleReading","GetShiftNozzleReading","ShiftClockNO","readings","AddDipReading","ShiftClockNo","TankParentArray","dip","AddSingleDipReading","shiftClockNO","shiftRefNO","ShiftRefNO","vendorID","vendorLocationID","clockDate","ClockDate","tankParentArray","UpdateSecondDipReading","parentDipNO","ParentDipNO","tankDipArray","dipNO","DipNO","secondReading","NewReading","DeleteDipReading","tankParentID","GetPump","pump","AddVendorPump","PumpName","UpdateVendorPump","RemoveVendorPump","GetProduct","ProductCategoryID","GetClockProduct","ClockNO","GetCustomer","AddVendorProduct","productName","ProductName","uom","productImageID","buyingTax","TaxRate","IsStockItem","sellingTax","productCategoryID","productCategoryBrandID","ProductCategoryBrandID","productVolumeSizeID","ProductVolumeSizeID","productCategoryTypeID","ProductCategoryTypeID","GetSalesHistory","sales","GetProductDailySales","GetVendorLocationDailyDIscount","discount","GetDailyDipVariance","variance","GetProductSalesReport","GetInvoiceCustomerSalesHistory","GetAttendantClockSales","AddVendorClock","clockTypeID","ClockTypeID","userClockArray","UserClockArray","accountBalanceArray","ApproveVendorShift","approvedBy","statusID","ApproveVendorClock","clockNO","AddVendorShift","currentTime","passedDate","dipStatusID","DipStatusID","AddVendorShiftTimeAllowance","timeAdded","TimeAdded","CloseVendorShift","vendorLocationName","shiftType","ShiftType","shiftPDF","ShiftPDF","dipVarianceReason","DipVarianceReason","accountBalances","AccountBalances","contactLists","ContactLists","GetOpenShifts","GetVendorUser","users","GetVendorGeneralSalesTax","TaxDate","salestax","GetVendorWithHoldingTax","wtax","GetVendorGeneralPurchaseTax","ptax","UpdateInvoiceWithholdingTax","saleIDs","Sales","GetVendorClockFreeUser","AddVendorUserRole","userPolicyArray","UserPolicyArray","RemoveVendorUserRole","AddVendorUser","LastName","canSell","CanSell","UserImage","stationsAssignmentArray","StationArray","UpdateVendorUser","RemoveVendorUser","VendorUserID","ResetUserPassword","GetVendorClock","clocks","GetVendorShifts","shifts","GetVendorShiftsAdminACtions","actions","GetVendorDailyNozzleReadingSummary","MeterReading","GetVendorDailyShiftSummary","daily","GetVendorShiftsDetails","details","GetUserType","types","GetVendorStorageLocation","stores","AddStorageLocation","storageLocationName","vendorStorageLocationID","productCategories","UpdateVendorStorageLocation","VendorStorageLocationID","RemoveVendorStorageLocation","AddStockMovement","movementTypeID","MovementTypeID","SourceLocationID","DestinationLocationID","TransactionDate","StockNO","MonthlyBalance","StockMovementDetailArray","stocks","AddVendorProductWriteOff","writeOffID","productID","quantity","Quantity","writeOffValue","WriteoffValue","writeOffReason","WriteOffReason","vendoStorageLocationID","AddStockTakeItem","stockNO","previousQuantity","StockDate","stockDate","productPrice","ProductPrice","PurchasePrice","UpdateStockMovement","monthlyBalance","AddStockTransfer","sourceLocationID","shiftID","ShiftID","transferInfo","transferNO","transferDetailArray","DeleteStockTransfer","TransferNO","UpdateStockTakeItem","PreviousQuantity","DateAdded","StockMovementDetailID","GetStockMovement","movement","GetStockMovementDetail","GetStockTransfer","transfer","ReceiveTransfer","stockTransferDetailID","StockTransferDetailID","stockInTankID","StockInTankID","ReceivedQuantity","receivedBy","AddProductPrice","Amount","AddCashCollection","VendorPaymentMethodID","CashDropCollectionID","CollectionNO","CollectedAmount","CollectionTypeID","Comment","UpdateCashDrop","VendorCashDropID","GetCashDrop","drops","GetClockSummary","summary","GetVendorSalesDashboard","GetVendorClockRTT","rtt","ReverseClockRTT","vendorRttID","VendorRTTID","ApproveClockRTT","AddClockRTT","vendorTankParentNozzleID","VendorTankParentNozzleID","shiftNO","ShiftNO","totalAmount","TotalAmount","tankID","rttReason","RTTReason","GetDropCollection","collection","GetClockMpesaAdmin","mpesa","GetPayments","payment","isLoading","GetUnusedPayments","GetParentTanks","parent","CloseClock","varianceReason","VarianceReason","ExpectedAmount","accountedAmount","AccountedAmount","varianceAmount","VarianceAmount","ClockedOutBy","ReopenClock","AddPumpNozzle","NozzleName","UpdatePumpNozzle","NozzleID","RemovePumpNozzle","PostVendorCustomer","customerName","customerPhone","CustomerPhone","VendorParentCardGroupID","customerTypeID","CustomerTypeID","CustomerIdentityImageID","customerMail","CustomerMail","kraPin","KraPin","openingBalance","OpeningBalance","creditLimit","CreditLimit","paymentTerms","PaymentTerms","isPrepayCustomer","creditLimitNotification","CreditLimits","isCreditLimitMandatory","IsCreditLimitMandatory","fuelingLocationArray","FuelingLocationArray","customerAssetsArray","CustomerAssetsArray","cardArray","CardArray","stationID","usersArray","UsersArray","DeleteCustomer","vendorParentCardGroupName","VendorParentCardGroupName","UpdateCustomer","prevOpeningBalance","PrevOpeningBalance","KRAPin","CreditLimitNotification","isWithholding","IsWithholding","isTemporary","IsTemporary","StartDate","AddCustomerAssets","AssetName","IsDelivery","IsAssetStation","StationID","RemoveCustomerAssets","assetID","AssetID","AddVendorLocation","NozzleReadingTypeID","ContactPerson","isStockMandatory","isMandatory","GetVendorLocationDetails","GetProductCategory","category","GetVendorPaymentMethod","methods","AddVendorSupplierPayment","vendorSupplierID","SupplierID","vendorPaymentMethodID","referenceNO","ReferenceNO","topUpAmount","transactionDate","GetVendorPaymentMethodBalances","AddVendorPaymentMethod","vendorPaymentMethodName","VendorPaymentMethodName","paymentMethodID","PaymentMethodID","holdingLimit","HoldingLimit","isVisibleToAttendant","IsVisibleToAttendant","isHashed","IsHashed","isRecon","IsRecon","UpdateVendorPaymentMethod","RemoveVendorPaymentMethod","AddPumpAssignment","pumpArray","pumpx","GetPumpsByClock","cpumps","ConfirmNozzleReading","OpenNozzleReading","eOpeningReading","EOpeningReading","mOpeningReading","MOpeningReading","cOpeningReading","COpeningReading","CloseNozzleReading","automationPumpTransactionID","AutomationPumpTransactionID","eClosingReading","EClosingReading","mClosingReading","MClosingReading","cClosingReading","CClosingReading","closedBy","ResetDipReading","dipMonth","DipMonth","dipYear","DipYear","AddVendorPurchase","tankTransactionDeliveryID","vendorSupplierTransporterAssetID","vendorSupplierTransporterID","PurchaseNO","VendorSupplierID","OtherCost","Subtotal","PurchaseDetailArray","PurchasePaymentArray","payments","UpdateVendorPurchase","_data$DetailArray","vendorPurchaseID","VendorPurchaseID","supplierID","otherCost","DetailArray","b","BuyingTax","invoiceNO","purchaseDetailArray","ReceiveVendorPurchase","ReverseVendorPurchase","purchaseNO","GetDashBoardData","dashboard","GetVolumeSalesPerCategory","salescategory","GetSalesPerCategoryPredictions","predictions","GetDailySalesReport","dsr","AddVendorSupplier","VendorSupplierName","SupplierName","ContactName","AssetMileage","supplierLocationArray","GetVendorSupplier","supplier","GetVendorSupplierList","GetVendorDebtors","debtors","GetVendorSupplierStatement","GetVendorSupplierPurchases","purchase","GetVendorSupplierPayments","GetVendorCustomerCreditNote","creditnote","AddVendorCustomerCreditNote","creditNoteID","VendorCustomerID","Description","GetVendorCustomerOverdraft","AddVendorCustomerOverdraft","customerOverdraftID","expiryDate","DeleteVendorCustomerOverdraft","CustomerOverdraftID","DeleteVendorSupplierPayment","vendorSupplierTopUpID","VendorSupplierTopUpID","UpdateVendorCustomerCreditNote","CreditNoteID","GetVendorCustomerDebitNote","AddVendorCustomerDebitNote","Reason","DeleteVendorCustomerDebitNote","debitNoteID","DebitNoteID","Decription","GetPurchase","GetProductPerfomance","GetFuelStockReport","GetWetStockStockVariance","GetVendorTankParent","dateadded","RerunCummulativeVariance","GetVendorTankByParent","UpdateProduct","ProductImageID","UOM","DeleteVendorProduct","GetVendorProductCategory","GetVendorAllProducts","allProduct","SearchVendorProduct","searchText","suggestion","transID","GetShiftDipReading","dips","GetCustomerPrePayment","prepayment","GetPrimaryTopupType","AddVendorTopUpType","vendorTopUpTypeName","VendorTopUpTypeName","topUpTypeID","TopUpTypeID","GetVendorTopUpTypes","AddCustomerTopUp","vendorTopUpTypeID","VendorTopUpTypeID","refNO","comment","AddCustomerPrepayment","vendorCustomerID","ReverseCustomerTopUp","vendorTopUpID","VendorTopUpID","AdminReverseCustomerTopUp","vendorCustomerTopUpID","VendorCustomerTopUpID","GetStockLevel","GetVendorLocationStockLevel","StoreID","GetExpense","expense","AddVendorExpense","shiftClockNo","ExpenseAmount","VendorExpenseTypeID","UpdateVendorExpense","vendorExpenseID","VendorExpenseID","actionedBy","ReverseVendorSale","SaleID","UpdateDipReading","DipID","DateDipped","UpdateNozzleReading","changeType","GetPaymentMethod","pmethods","GetShiftSUmmary","ShiftDate","GetShiftDetailedReport","ReverseMarkedPayment","ID","userClockPaymentTransActionID","reversedBy","reversedAmount","TransAmount","ApproveExpense","ApprovedAmount","ActionedBy","RejectExpense","DeactivatePayment","ReactivatePayment","ReopenNozzle","ReverseCollection","VendorPaymentCollectionID","ReversedBy","GetPumpAssignment","assignment","GetClockExpense","GetClockDiscount","ActionClockDiscount","saleID","GetClockSales","GetCustomerSales","PostClockSale","isStation","MoreInfo","saleDetailArray","selected","salePaymentArray","receipt","PostClockPoints","vendorCustomerCardID","VendorCustomerCardID","vendorCustomerCardChildID","VendorCustomerCardChildID","pumpImageID","vehicleImageID","UpdateClockSale","_data$SaleDetailArray","_data$SaleDetailArray2","saleOrder","receivedAmount","ReceivedAmount","SaleDetailArray","moreInfo","saleOrderInvoice","saleOrderInvoiceID","saleDetails","GetCustomerUsers","GetShiftRefs","newDate","ShiftInfoList","GetCustomerPayments","GetCustomerStations","AddCustomerLocation","contactEmail","vendorLocationPhone","DeleteCustomerLocation","vendorCustomerLocationID","VendorCustomerLocationID","GetCustomerDiscount","PostCustomerDiscount","discountAmount","DeactivateCustomerDiscount","customerDiscountID","CustomerDiscountID","GetCustomerStatement","GetCustomerAssets","assets","GetExpenseType","AddExpenseType","VendorExpenseTypeName","ExpenseType","UpdateExpenseType","RemoveExpenseType","GetProductStatment","GetAllProductPurchase","GetCashIn","cashIn","GetCashFlow","Year","cashflow","GetVendorLocationAttendanceVariance","GetVendorAttendanceStatement","GetVendorAttendantVariance","variace","GetVendorAttendantVariancePayment","AddAttendantVariancePayment","vendorAttendantVariancePaymentID","TransDate","amountPaid","ReverseAttendantVariancePayment","VendorAttendantVariancePaymentID","WriteOffAttendantVariance","variences","variances","GetCashOut","cashOut","AddMpesaPayment","_data$CustomerName","TransTime","Transtime","MpesaAmount","TransactionCost","AccountBalance","AddMpesaBulkPayment","_data$CustomerName2","isClosingBalance","GetIncomestatement","income","GetTransactionMessages","messages","GetPaymentMethodTransactions","trans","AddVendor","vendorClientID","slogan","vendorImageID","stationsArray","MarkMpesaPayment","MarkedPaymentArray","GetVendorOpenTankNozzle","opennozzle","GetAccountTransfer","transfers","GetVendorShiftAccountRecon","recon","GetAccountStatement","AddAccountTransfer","accountTransferID","creditAccountID","CreditAccountID","debitAccountID","DebitAccountID","AccountTypeID","transactionCost","transDate","UpdateAccountTransfer","AccountTransferID","ReverseAccountTransfer","transferDate","GetUserTypePolicy","policy","GetUserTypePolicyAssignment","roles","GetUserPolicyAssingment","urole","GetNotificationTypes","UseCase","GetNotificationRecipient","AddNotificationRecipient","notificationTypeID","NotificationTypeID","mediumChannelID","RemoveNotificationRecipient","notificationUserID","NotificationUserID","GetAgeingReport","GetConsolidatedReport","GetConsolidatedAccountBalances","GetAuditTrail","GetAuditLogAnalytics","analytics","BackdateLocationData","AddGoogleSheetCredentials","userGoogleSheetCredentialsID","googleSheetCredentials","GoogleSheetID","additionalInfo","AddDistributorPurchase","_data$stocks","deliveryAssetID","purchaseDate","LineTotal","deliveryCost","purchasePaymentArray","ReverseDistributorPurchase","GetDistributorDashbord","dash","Data","GetDistributorOrders","order","GetDistributorCustomers","GetDistributorPurchase","GetDistributorAllAssets","asset","AddDistributorOrder","saleType","DeliveryAssetID","eta","ETA","dateDelivered","deliveredByID","handlingCost","HandlingCost","DeliveryCost","deliveryDetail","DistributorCompleteDelivery","SaleOrderBulkID","vendorAssetID","DistributorLoadTruck","DistributorVehicle","vendorAssetName","VendorAssetName","AssignDistributorVehicle","VendorAssetID","GetUserManual","manual","GetCardCustomerGroup","GetRewardPointsTypes","DeleteCardCustomerGroup","vendorParentCardGroupID","AddCardCustomerGroup","vendorParentID","GetRewardLoyaltyRule","AddRewardLoyaltyRule","pointRewardName","PointRewardName","EndDate","rewardDetailArray","RewardDetailArray","rewardProductArray","ProductArray","rewardRuleArray","RewardRule","RemoveRewardLoyaltyRule","rewardRefNO","RewardRefNO","GetCardRedeemIniator","GetCardCustomer","GetLoyaltyDashBoard","GetLoyaltyStationSummary","GetLoyaltyAllCustomersCards","PageSize","SearchTerm","GetLoyaltyCustomers","AddVendorCustomerPointAdjustment","points","Points","reason","typeID","TypeID","GetLoyaltyCustomersPointAdjustment","GetLoyaltyCustomersCards","GetCustomerLinkedCards","GetLoyaltyCustomersPoints","GetLoyaltyCustomersRedeemedPoints","GetLoyaltyCustomersRedeemedOption","GetLoyaltyVendorRedeemOption","AddVendorRedeemOption","redeemOptionName","RedeemOptionName","DeactivateChildCard","DeactivateParentCard","RemoveVendorRedeemOption","vendorParentCardRedeemOptionID","VendorParentCardRedeemOptionID","GetLoyaltyVendorRedeemOptionPoints","AddVendorRedeemOptionPoints","rewardPoint","RewardPoint","rewardValue","RewardValue","AddVendorRedeemOptionBulkPoints","cardRedeemTypeID","initiatedBy","dateInitiated","redeemRefNO","cardRedeemArray","AddVendorRedeemCollection","redeemNO","RedeemNO","otpCode","OTPCode","AddVendorCustomerCard","cardSerialNO","CardSerialNO","openingAmount","openingPoints","expiryMonthYear","cardTypeID","isImageRequired","isPasswordProtected","isMileageRequired","isProductRestricted","isTimeRestricted","isLocationRestricted","isAssetRestricted","cardRedeemInitiatorID","canHoldPayment","vendorCustomerCardName","cardPolicyProductArray","cardPolicyTime","cardPolicyVendorLocation","cardPolicyAsset","AddVendorCustomerCardProductPolicy","UpdateCardRegisteredStation","AddVendorCustomerCardAssetPolicy","AddVendorCustomerCardStationPolicy","AddVendorCustomerCardChild","CardTypeID","RequestRedeemCustomerLoyaltyPoints","vendorParentCardRedeemOptionName","VendorParentCardRedeemOptionName","VendorCustomerCardName","redeemedPoints","RedeemedPoints","redeemValue","RedeemValue","redeemValueUOM","RedeemValueUOM","redemptionDate","pointsBalance","PointsBalance","notificationChannelID","NotificationChannelID","RedeemCustomerLoyaltyPoints","CardRedeemTypeID","RedeemOTP","ReverseCustomerLoyaltyRedeemedPoints","vendorCustomerCardRedeemedPointID","VendorCustomerCardRedeemedPointID","GetLoyaltyVendorCards","CardPanNO","DeactivateLoyaltyCustomerCard","GetLoyaltyCustomerStatement","GetLoyaltyCustomerStatementAmount","AutomationCloseDIps","dipID","automationTankTransactionID","AutomationTankTransactionID","dateTimeStart","DateTimeStart","SecondReading","recipientEmailArray","supervisorName","shiftDate","clockType","senderMail","hostName","port","receiverPhone","templateName","fileName","fileLink","messageParam1","messageParam2","messageParam3","messageParam4","headerMessage","GetCratoAutomationDashBoard","GetPTSStatusReport","ptsID","GetCratoAutomationDetailTransaction","closing","invoive","loyalty","GetAutomationDeliveries","GetAutomationTransporterReport","GetAutomationTransporters","GetAutomationSalesPerAttendant","GetAutomationTankVariance","_moment","_moment2","GetAutomationDailyTankVariance","_moment3","_moment4","VendorProductID","GetAutomationTankTransactions","AddFuelPTSPumpFix","GetFuelCardCustomers"],"mappings":"sFACAA,EAAOC,QAAU,CAAC,OAAS,wBAAwB,KAAO,sBAAsB,UAAY,2B,mCCD5F,kCAWeC,IARCA,IAERC,cAAA,OAAKC,UAAWC,IAAOC,UAAUC,SAC7BJ,cAAA,OAAKC,UAAWC,IAAOG,OAAOD,SAAC,O,2FCNpC,MAAME,EAAe,CAC1B,CAAEC,KAAM,KAAMC,SAAU,OACxB,CAAED,KAAM,KAAMC,SAAU,QACxB,CAAED,KAAM,KAAMC,SAAU,QACxB,CAAED,KAAM,KAAMC,SAAU,UACxB,CAAED,KAAM,KAAMC,SAAU,QACxB,CAAED,KAAM,KAAMC,SAAU,QACxB,CAAED,KAAM,KAAMC,SAAU,U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AcsiB,EAC7CnN,EAAQ0B,IAAOrM,EAAU,IAAIsM,OAAO,oBACpC1B,EAAMyB,IAAOrM,EAAU,IAAIsM,OAAO,qBAClC,KAAEvd,EAAI,MAAEZ,GAAU+7B,EACtByD,EAAQ,uDAAA7+B,OACiDkb,EAAgB,eAAAlb,OAAc6b,EAAK,aAAA7b,OAAY8b,EAAG,qBAAA9b,OAAoB0G,EAAS,eACxI,CAAE2zB,YAGJ,MAAO,CAAEp6B,OAAMZ,QAAO,EAGjB,SAASs5D,GAAkB14D,EAAMk/B,EAAWC,GACjD,MAAMC,EAAcxB,EAAesB,EAAWC,GACxCd,EAASO,EAAW,4BACpBN,EAAc,CAClB6D,iBAAkBniC,EAAKib,iBACvBskB,QAASpU,GAMX,MAAO,CACLtjB,QAASu3B,EAAYv3B,QACrBk2B,UAAWqB,EAAYrB,UACvB3yB,QAASg0B,EAAYh0B,QACrB4yB,aAAcoB,EAAYpB,aAC1BjvB,iBATuBvP,UACvB4/B,EAAYhB,kBAAkBC,EAAQC,EAAY,EAUtD,CAEO,MAAMq6B,GAAuBA,CAAC5vC,EAAQqR,KAC3C,MAAM,UAAEnpB,EAAS,iBAAEgK,EAAgB,WAAEoQ,GAAetC,EAC9CnN,EAAQ0B,IAAOrM,EAAU,IAAIsM,OAAO,oBACpC1B,EAAMyB,IAAOrM,EAAU,IAAIsM,OAAO,qBAClC,KAAEvd,EAAI,MAAEZ,GAAU+7B,EACtByD,EAAQ,uDAAA7+B,OACiDk/B,EAAQ,sBAAAl/B,OAAqBkb,EAAgB,sBAAAlb,OAAqBsrB,EAAU,wBAAAtrB,OAAuB6b,EAAK,aAAA7b,OAAY8b,EAAG,6BAChL,CAAEue,YAGJ,MAAO,CAAEp6B,OAAMZ,QAAO,C","file":"static/js/main.a520754d.chunk.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"loader\":\"Spinner_loader__GhzUR\",\"spin\":\"Spinner_spin__3XG0h\",\"container\":\"Spinner_container__216oW\"};","import React from 'react'\r\nimport styles from './Spinner.module.css'\r\n\r\nconst Spinner = () => {\r\n return (\r\n
\r\n
\r\n
\r\n )\r\n}\r\n\r\nexport default Spinner\r\n","export const countryCodes = [\r\n { code: \"AF\", dialCode: \"+93\" },\r\n { code: \"AL\", dialCode: \"+355\" },\r\n { code: \"DZ\", dialCode: \"+213\" },\r\n { code: \"AS\", dialCode: \"+1-684\" },\r\n { code: \"AD\", dialCode: \"+376\" },\r\n { code: \"AO\", dialCode: \"+244\" },\r\n { code: \"AI\", dialCode: \"+1-264\" },\r\n { code: \"AQ\", dialCode: \"+672\" },\r\n { code: \"AG\", dialCode: \"+1-268\" },\r\n { code: \"AR\", dialCode: \"+54\" },\r\n { code: \"AM\", dialCode: \"+374\" },\r\n { code: \"AW\", dialCode: \"+297\" },\r\n { code: \"AU\", dialCode: \"+61\" },\r\n { code: \"AT\", dialCode: \"+43\" },\r\n { code: \"AZ\", dialCode: \"+994\" },\r\n { code: \"BS\", dialCode: \"+1-242\" },\r\n { code: \"BH\", dialCode: \"+973\" },\r\n { code: \"BD\", dialCode: \"+880\" },\r\n { code: \"BB\", dialCode: \"+1-246\" },\r\n { code: \"BY\", dialCode: \"+375\" },\r\n { code: \"BE\", dialCode: \"+32\" },\r\n { code: \"BZ\", dialCode: \"+501\" },\r\n { code: \"BJ\", dialCode: \"+229\" },\r\n { code: \"BM\", dialCode: \"+1-441\" },\r\n { code: \"BT\", dialCode: \"+975\" },\r\n { code: \"BO\", dialCode: \"+591\" },\r\n { code: \"BA\", dialCode: \"+387\" },\r\n { code: \"BW\", dialCode: \"+267\" },\r\n { code: \"BR\", dialCode: \"+55\" },\r\n { code: \"IO\", dialCode: \"+246\" },\r\n { code: \"VG\", dialCode: \"+1-284\" },\r\n { code: \"BN\", dialCode: \"+673\" },\r\n { code: \"BG\", dialCode: \"+359\" },\r\n { code: \"BF\", dialCode: \"+226\" },\r\n { code: \"BI\", dialCode: \"+257\" },\r\n { code: \"KH\", dialCode: \"+855\" },\r\n { code: \"CM\", dialCode: \"+237\" },\r\n { code: \"CA\", dialCode: \"+1\" },\r\n { code: \"CV\", dialCode: \"+238\" },\r\n { code: \"KY\", dialCode: \"+1-345\" },\r\n { code: \"CF\", dialCode: \"+236\" },\r\n { code: \"TD\", dialCode: \"+235\" },\r\n { code: \"CL\", dialCode: \"+56\" },\r\n { code: \"CN\", dialCode: \"+86\" },\r\n { code: \"CX\", dialCode: \"+61\" },\r\n { code: \"CC\", dialCode: \"+61\" },\r\n { code: \"CO\", dialCode: \"+57\" },\r\n { code: \"KM\", dialCode: \"+269\" },\r\n { code: \"CD\", dialCode: \"+243\" },\r\n { code: \"CG\", dialCode: \"+242\" },\r\n { code: \"CK\", dialCode: \"+682\" },\r\n { code: \"CR\", dialCode: \"+506\" },\r\n { code: \"CI\", dialCode: \"+225\" },\r\n { code: \"HR\", dialCode: \"+385\" },\r\n { code: \"CU\", dialCode: \"+53\" },\r\n { code: \"CW\", dialCode: \"+599\" },\r\n { code: \"CY\", dialCode: \"+357\" },\r\n { code: \"CZ\", dialCode: \"+420\" },\r\n { code: \"DK\", dialCode: \"+45\" },\r\n { code: \"DJ\", dialCode: \"+253\" },\r\n { code: \"DM\", dialCode: \"+1-767\" },\r\n { code: \"DO\", dialCode: \"+1-809\" },\r\n { code: \"EC\", dialCode: \"+593\" },\r\n { code: \"EG\", dialCode: \"+20\" },\r\n { code: \"SV\", dialCode: \"+503\" },\r\n { code: \"GQ\", dialCode: \"+240\" },\r\n { code: \"ER\", dialCode: \"+291\" },\r\n { code: \"EE\", dialCode: \"+372\" },\r\n { code: \"ET\", dialCode: \"+251\" },\r\n { code: \"FK\", dialCode: \"+500\" },\r\n { code: \"FO\", dialCode: \"+298\" },\r\n { code: \"FJ\", dialCode: \"+679\" },\r\n { code: \"FI\", dialCode: \"+358\" },\r\n { code: \"FR\", dialCode: \"+33\" },\r\n { code: \"GF\", dialCode: \"+594\" },\r\n { code: \"PF\", dialCode: \"+689\" },\r\n { code: \"GA\", dialCode: \"+241\" },\r\n { code: \"GM\", dialCode: \"+220\" },\r\n { code: \"GE\", dialCode: \"+995\" },\r\n { code: \"DE\", dialCode: \"+49\" },\r\n { code: \"GH\", dialCode: \"+233\" },\r\n { code: \"GI\", dialCode: \"+350\" },\r\n { code: \"GR\", dialCode: \"+30\" },\r\n { code: \"GL\", dialCode: \"+299\" },\r\n { code: \"GD\", dialCode: \"+1-473\" },\r\n { code: \"GP\", dialCode: \"+590\" },\r\n { code: \"GU\", dialCode: \"+1-671\" },\r\n { code: \"GT\", dialCode: \"+502\" },\r\n { code: \"GG\", dialCode: \"+44-1481\" },\r\n { code: \"GN\", dialCode: \"+224\" },\r\n { code: \"GW\", dialCode: \"+245\" },\r\n { code: \"GY\", dialCode: \"+592\" },\r\n { code: \"HT\", dialCode: \"+509\" },\r\n { code: \"HN\", dialCode: \"+504\" },\r\n { code: \"HK\", dialCode: \"+852\" },\r\n { code: \"HU\", dialCode: \"+36\" },\r\n { code: \"IS\", dialCode: \"+354\" },\r\n { code: \"IN\", dialCode: \"+91\" },\r\n { code: \"ID\", dialCode: \"+62\" },\r\n { code: \"IR\", dialCode: \"+98\" },\r\n { code: \"IQ\", dialCode: \"+964\" },\r\n { code: \"IE\", dialCode: \"+353\" },\r\n { code: \"IM\", dialCode: \"+44-1624\" },\r\n { code: \"IL\", dialCode: \"+972\" },\r\n { code: \"IT\", dialCode: \"+39\" },\r\n { code: \"JM\", dialCode: \"+1-876\" },\r\n { code: \"JP\", dialCode: \"+81\" },\r\n { code: \"JE\", dialCode: \"+44-1534\" },\r\n { code: \"JO\", dialCode: \"+962\" },\r\n { code: \"KZ\", dialCode: \"+7\" },\r\n { code: \"KE\", dialCode: \"+254\" },\r\n { code: \"KI\", dialCode: \"+686\" },\r\n { code: \"KW\", dialCode: \"+965\" },\r\n { code: \"KG\", dialCode: \"+996\" },\r\n { code: \"LA\", dialCode: \"+856\" },\r\n { code: \"LV\", dialCode: \"+371\" },\r\n { code: \"LB\", dialCode: \"+961\" },\r\n { code: \"LS\", dialCode: \"+266\" },\r\n { code: \"LR\", dialCode: \"+231\" },\r\n { code: \"LY\", dialCode: \"+218\" },\r\n { code: \"LI\", dialCode: \"+423\" },\r\n { code: \"LT\", dialCode: \"+370\" },\r\n { code: \"LU\", dialCode: \"+352\" },\r\n { code: \"MO\", dialCode: \"+853\" },\r\n { code: \"MK\", dialCode: \"+389\" },\r\n { code: \"MG\", dialCode: \"+261\" },\r\n { code: \"MW\", dialCode: \"+265\" },\r\n { code: \"MY\", dialCode: \"+60\" },\r\n { code: \"MV\", dialCode: \"+960\" },\r\n { code: \"ML\", dialCode: \"+223\" },\r\n { code: \"MT\", dialCode: \"+356\" },\r\n { code: \"MH\", dialCode: \"+692\" },\r\n { code: \"MQ\", dialCode: \"+596\" },\r\n { code: \"MR\", dialCode: \"+222\" },\r\n { code: \"MU\", dialCode: \"+230\" },\r\n { code: \"YT\", dialCode: \"+262\" },\r\n { code: \"MX\", dialCode: \"+52\" },\r\n { code: \"FM\", dialCode: \"+691\" },\r\n { code: \"MD\", dialCode: \"+373\" },\r\n { code: \"MC\", dialCode: \"+377\" },\r\n { code: \"MN\", dialCode: \"+976\" },\r\n { code: \"ME\", dialCode: \"+382\" },\r\n { code: \"MS\", dialCode: \"+1-664\" },\r\n { code: \"MA\", dialCode: \"+212\" },\r\n { code: \"MZ\", dialCode: \"+258\" },\r\n { code: \"MM\", dialCode: \"+95\" },\r\n { code: \"NA\", dialCode: \"+264\" },\r\n { code: \"NR\", dialCode: \"+674\" },\r\n { code: \"NP\", dialCode: \"+977\" },\r\n { code: \"NL\", dialCode: \"+31\" },\r\n { code: \"NC\", dialCode: \"+687\" },\r\n { code: \"NZ\", dialCode: \"+64\" },\r\n { code: \"NI\", dialCode: \"+505\" },\r\n { code: \"NE\", dialCode: \"+227\" },\r\n { code: \"NG\", dialCode: \"+234\" },\r\n { code: \"NU\", dialCode: \"+683\" },\r\n { code: \"NF\", dialCode: \"+672\" },\r\n { code: \"KP\", dialCode: \"+850\" },\r\n { code: \"MP\", dialCode: \"+1-670\" },\r\n { code: \"NO\", dialCode: \"+47\" },\r\n { code: \"OM\", dialCode: \"+968\" },\r\n { code: \"PK\", dialCode: \"+92\" },\r\n { code: \"PW\", dialCode: \"+680\" },\r\n { code: \"PS\", dialCode: \"+970\" },\r\n { code: \"PA\", dialCode: \"+507\" },\r\n { code: \"PG\", dialCode: \"+675\" },\r\n { code: \"PY\", dialCode: \"+595\" },\r\n { code: \"PE\", dialCode: \"+51\" },\r\n { code: \"PH\", dialCode: \"+63\" },\r\n { code: \"PL\", dialCode: \"+48\" },\r\n { code: \"PT\", dialCode: \"+351\" },\r\n { code: \"PR\", dialCode: \"+1-787\" },\r\n { code: \"QA\", dialCode: \"+974\" },\r\n { code: \"RE\", dialCode: \"+262\" },\r\n { code: \"RO\", dialCode: \"+40\" },\r\n { code: \"RU\", dialCode: \"+7\" },\r\n { code: \"RW\", dialCode: \"+250\" },\r\n { code: \"BL\", dialCode: \"+590\" },\r\n { code: \"SH\", dialCode: \"+290\" },\r\n { code: \"KN\", dialCode: \"+1-869\" },\r\n { code: \"LC\", dialCode: \"+1-758\" },\r\n { code: \"MF\", dialCode: \"+590\" },\r\n { code: \"PM\", dialCode: \"+508\" },\r\n { code: \"VC\", dialCode: \"+1-784\" },\r\n { code: \"WS\", dialCode: \"+685\" },\r\n { code: \"SM\", dialCode: \"+378\" },\r\n { code: \"ST\", dialCode: \"+239\" },\r\n { code: \"SA\", dialCode: \"+966\" },\r\n { code: \"SN\", dialCode: \"+221\" },\r\n { code: \"RS\", dialCode: \"+381\" },\r\n { code: \"SC\", dialCode: \"+248\" },\r\n { code: \"SL\", dialCode: \"+232\" },\r\n { code: \"SG\", dialCode: \"+65\" },\r\n { code: \"SX\", dialCode: \"+1-721\" },\r\n { code: \"SK\", dialCode: \"+421\" },\r\n { code: \"SI\", dialCode: \"+386\" },\r\n { code: \"SB\", dialCode: \"+677\" },\r\n { code: \"SO\", dialCode: \"+252\" },\r\n { code: \"ZA\", dialCode: \"+27\" },\r\n { code: \"KR\", dialCode: \"+82\" },\r\n { code: \"SS\", dialCode: \"+211\" },\r\n { code: \"ES\", dialCode: \"+34\" },\r\n { code: \"LK\", dialCode: \"+94\" },\r\n { code: \"SD\", dialCode: \"+249\" },\r\n { code: \"SR\", dialCode: \"+597\" },\r\n { code: \"SJ\", dialCode: \"+47\" },\r\n { code: \"SZ\", dialCode: \"+268\" },\r\n { code: \"SE\", dialCode: \"+46\" },\r\n { code: \"CH\", dialCode: \"+41\" },\r\n { code: \"SY\", dialCode: \"+963\" },\r\n { code: \"TW\", dialCode: \"+886\" },\r\n { code: \"TJ\", dialCode: \"+992\" },\r\n { code: \"TZ\", dialCode: \"+255\" },\r\n { code: \"TH\", dialCode: \"+66\" },\r\n { code: \"TL\", dialCode: \"+670\" },\r\n { code: \"TG\", dialCode: \"+228\" },\r\n { code: \"TK\", dialCode: \"+690\" },\r\n { code: \"TO\", dialCode: \"+676\" },\r\n { code: \"TT\", dialCode: \"+1-868\" },\r\n { code: \"TN\", dialCode: \"+216\" },\r\n { code: \"TR\", dialCode: \"+90\" },\r\n { code: \"TM\", dialCode: \"+993\" },\r\n { code: \"TC\", dialCode: \"+1-649\" },\r\n { code: \"TV\", dialCode: \"+688\" },\r\n { code: \"UG\", dialCode: \"+256\" },\r\n { code: \"UA\", dialCode: \"+380\" },\r\n { code: \"AE\", dialCode: \"+971\" },\r\n { code: \"GB\", dialCode: \"+44\" },\r\n { code: \"US\", dialCode: \"+1\" },\r\n { code: \"UY\", dialCode: \"+598\" },\r\n { code: \"UZ\", dialCode: \"+998\" },\r\n { code: \"VU\", dialCode: \"+678\" },\r\n { code: \"VA\", dialCode: \"+379\" },\r\n { code: \"VE\", dialCode: \"+58\" },\r\n { code: \"VN\", dialCode: \"+84\" },\r\n { code: \"WF\", dialCode: \"+681\" },\r\n { code: \"EH\", dialCode: \"+212\" },\r\n { code: \"YE\", dialCode: \"+967\" },\r\n { code: \"ZM\", dialCode: \"+260\" },\r\n { code: \"ZW\", dialCode: \"+263\" },\r\n];\r\n","import React, { useEffect, useState } from \"react\";\r\nimport { TextField, Grid, FormControl, Autocomplete } from \"@mui/material\";\r\nimport { isValidPhoneNumber } from \"libphonenumber-js\";\r\nimport { countryCodes } from \"./CountryCodes\"; // Ensure this has correct structure\r\nimport { validateState } from \"../../Functions\";\r\nimport axios from \"axios\";\r\n\r\nconst PhoneNumberInput = ({ onChange, defultValues }) => {\r\n const [selectedCountry, setSelectedCountry] = useState(null);\r\n const [phoneNumber, setPhoneNumber] = useState(\"\");\r\n const [error, setError] = useState(false);\r\n\r\n useEffect(() => {\r\n const fetchCountryCode = async () => {\r\n try {\r\n const response = await axios.get(\"https://api.ipgeolocation.io/ipgeo\", {\r\n params: {\r\n apiKey: \"e43ab96aeb96433c8506f23f00c1f4cc\",\r\n },\r\n });\r\n const country = {\r\n dialCode: `${response.data.calling_code}`,\r\n code: response.data.country_code2,\r\n };\r\n setSelectedCountry(country);\r\n } catch (error) {\r\n console.error(\"Error fetching the country code:\", error);\r\n }\r\n };\r\n if (defultValues?.dialCode) {\r\n setSelectedCountry(defultValues?.dialCode);\r\n setPhoneNumber(defultValues?.PhoneNumber)\r\n } else {\r\n fetchCountryCode();\r\n }\r\n }, []);\r\n\r\n const handleCountryChange = (event, newValue) => {\r\n setSelectedCountry(newValue);\r\n checkValidity(newValue?.dialCode + phoneNumber); // Use newValue which is the full country object\r\n };\r\n\r\n const handlePhoneNumberChange = (event) => {\r\n const inputNumber = event.target.value;\r\n setPhoneNumber(inputNumber);\r\n };\r\n\r\n useEffect(() => {\r\n if (phoneNumber.length > 0) {\r\n checkValidity(selectedCountry?.dialCode + phoneNumber);\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [phoneNumber, selectedCountry?.dialCode]);\r\n\r\n const checkValidity = (fullPhoneNumber) => {\r\n const valid = isValidPhoneNumber(fullPhoneNumber);\r\n setError(!valid);\r\n onChange({ ...selectedCountry, phoneNumber });\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n `${option.dialCode} (${option.code})`} // Display text\r\n value={selectedCountry}\r\n onChange={handleCountryChange}\r\n renderInput={(params) => (\r\n \r\n )}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default PhoneNumberInput;\r\n","export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAANhklEQVR4nO3daW8bVRuA4ScLpDQtktWmNEAKCASRqkp84v//AVAdh7Qhi50QL+Nt4mW8ZmbeD1V4p26SepkzZx77vj5C8Dkq6p1zjmdZC8MwFABQYN32BABgWgQLgBoEC4AaBAuAGgQLgBoEC4AaBAuAGgQLgBoEC4AaBAuAGgQLgBoEC4AaBAuAGgQLgBoEC4AaBAuAGgQLgBoEC4AaBAuAGgQLgBoEC4AaBAuAGgQLgBoEC4AaBAuAGgQLgBoEC4AaBAuAGgQLgBoEC4AaBAuAGpu2JyAi0mw2JZ/P254GgAe8evVKdnZ2rM4hFcEaj8fS6XRsTwPAA8bjse0psCUEoAfBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgRioekRy39fV1efnype1pAFY5jiO+79ueRqyWNli//vqr7WkAVjWbzaULFltCAGoQLABqECwAahAsAGoQLABqECwAahAsAGoQLABqECwAahAsAGoQLABqECwAahAsAGoQLABqECwAahAsAGoQLABqECwAahAsAGoQLABqECwAahAsAGoQLABqECwAahAsAGoQLABqECwAahAsAGoQLABqbNqeAD4YDAYyHo9lY2NDHj9+bHs6QCoRLAvCMBTXdaXRaEi9XpfhcPjJz2xubkomk5EXL15IJpORzU3+VwH8LUhYuVyWQqFwZ6Sibm5upFarSa1Wk42NDdnb25O9vT3Z2NhIaKZA+hCshHieJ0dHR+J53sz/re/7UigUpFQqyW+//SbPnj0zMEMg/Th0T0Cj0ZC//vprrlhFjUYjye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QKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoAbBAqAGwQKgBsECoMZaGIah7UkAwDRYYQFQg2ABUINgAVCDYAFQg2ABUINgAVCDYAFQg2ABUINgAVCDYAFQg2ABUINgAVCDYAFQg2ABUINgAVCDYAFQg2ABUINgAVCDYAFQg2ABUINgAVCDYAFQg2ABUINgAVCDYAFQg2ABUINgAVCDYAFQg2ABUINgAVCDYAFQg2ABUINgAVDjfwXxayX33T/OAAAAAElFTkSuQmCC\"","import { useContext } from \"react\";\r\nimport { encryptSession } from \"../../api\";\r\nimport DefaultImage from \"../../assets/no-image-icon-6.png\";\r\nimport { AppContext } from \"../../AppContext\";\r\n\r\nexport function accountingFormat(num) {\r\n if (num === null || num === undefined) {\r\n return \"\";\r\n }\r\n if (num < 0) {\r\n return (\r\n \"(\" +\r\n Math.abs(num).toLocaleString(undefined, {\r\n minimumFractionDigits: 2,\r\n maximumFractionDigits: 2,\r\n }) +\r\n \")\"\r\n );\r\n } else {\r\n return num.toLocaleString(undefined, {\r\n minimumFractionDigits: 2,\r\n maximumFractionDigits: 2,\r\n });\r\n }\r\n}\r\n\r\nexport default function getDefaultImageAsBase64(type = \"png\") {\r\n return fetch(DefaultImage)\r\n .then((response) => response.arrayBuffer())\r\n .then((buffer) => {\r\n const binary = [].slice.call(new Uint8Array(buffer));\r\n const base64String = btoa(\r\n binary.map((charCode) => String.fromCharCode(charCode)).join(\"\")\r\n );\r\n const prefix =\r\n type === \"png\" ? \"data:image/png;base64,\" : \"data:image/jpeg;base64,\";\r\n const base64 = `${prefix}${base64String}`;\r\n return { DefaultImage, base64 };\r\n })\r\n .catch((error) => {\r\n console.error(\"Error loading default image:\", error);\r\n return { DefaultImage, base64: \"\" };\r\n });\r\n}\r\n\r\nexport function validateState(state, name) {\r\n // Check if the field exists and is not null\r\n if (state[name] == null) {\r\n console.log(`Field '${name}' is null.`);\r\n return false;\r\n }\r\n\r\n // Specific check for text fields\r\n if (typeof state[name] === \"string\") {\r\n if (state[name].trim() === \"\") {\r\n console.log(`Text field '${name}' is empty.`);\r\n return false; // Invalid if text field is empty\r\n }\r\n }\r\n\r\n // Specific check for numeric fields\r\n if (typeof state[name] === \"number\") {\r\n if (isNaN(state[name])) {\r\n console.log(`Numeric field '${name}' is NaN.`);\r\n return false; // Invalid if number field is NaN (not a possible case unless set explicitly)\r\n }\r\n }\r\n\r\n // Valid field\r\n console.log(`Field '${name}' is valid.`);\r\n return true;\r\n}\r\n\r\nexport function DateTimeFormat(dateAdded, type) {\r\n try {\r\n // Get user's timezone\r\n const userTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\r\n\r\n // Create date object directly first\r\n const nairobiDate = new Date(dateAdded);\r\n \r\n // Check if date is valid\r\n if (isNaN(nairobiDate.getTime())) {\r\n return \"Invalid Date\";\r\n }\r\n\r\n // Get the offset difference between Nairobi (UTC+3) and local timezone\r\n const nairobiOffset = 180; // Nairobi is UTC+3, so offset is 180 minutes\r\n const localOffset = -new Date().getTimezoneOffset(); // Get local offset in minutes\r\n \r\n // Calculate the difference and adjust the time\r\n const offsetDiff = nairobiOffset - localOffset;\r\n const adjustedDate = new Date(nairobiDate.getTime() - (offsetDiff * 60 * 1000));\r\n\r\n // Define options based on the type parameter\r\n let options;\r\n switch (type) {\r\n case \"dateonly\":\r\n options = { year: \"numeric\", month: \"2-digit\", day: \"2-digit\" };\r\n break;\r\n case \"timeonly\":\r\n options = {\r\n hour: \"2-digit\",\r\n minute: \"2-digit\",\r\n second: \"2-digit\",\r\n hour12: false,\r\n };\r\n break;\r\n case \"monthday\":\r\n options = { month: \"2-digit\", day: \"2-digit\" };\r\n break;\r\n case \"datetime\":\r\n default:\r\n options = {\r\n year: \"numeric\",\r\n month: \"2-digit\",\r\n day: \"2-digit\",\r\n hour: \"2-digit\",\r\n minute: \"2-digit\",\r\n second: \"2-digit\",\r\n hour12: false,\r\n };\r\n break;\r\n }\r\n\r\n // Set the output timezone\r\n options.timeZone = userTimeZone;\r\n\r\n return adjustedDate.toLocaleString(\"en-US\", options);\r\n } catch (error) {\r\n console.error(\"Error in DateTimeFormat:\", error);\r\n return \"Invalid Date\";\r\n }\r\n}\r\n\r\nexport function getNairobiTimeFromLocal(date) {\r\n // Get the current local time\r\n const localTime = new Date(date);\r\n\r\n // Check if the date is valid\r\n if (isNaN(localTime.getTime())) {\r\n return \"Invalid Date\";\r\n }\r\n\r\n // Convert the local time to Nairobi time\r\n const nairobiTime = localTime.toLocaleString(\"en-US\", {\r\n timeZone: \"Africa/Nairobi\",\r\n year: \"numeric\",\r\n month: \"2-digit\",\r\n day: \"2-digit\",\r\n hour: \"2-digit\",\r\n minute: \"2-digit\",\r\n second: \"2-digit\",\r\n hour12: false,\r\n });\r\n\r\n return nairobiTime;\r\n}\r\n\r\nexport function DefaultContextDateRange(timeRange) {\r\n const monthFirstDay = new Date(\r\n new Date().getFullYear(),\r\n new Date().getMonth(),\r\n 1\r\n );\r\n const todayStart = new Date(new Date().setHours(0, 0, 0, 0)); // Start of today\r\n const now = new Date(); // Current time\r\n\r\n let startTime, endTime;\r\n switch (timeRange) {\r\n case \"time\":\r\n startTime = new Date(now.valueOf() - 1000 * 60 * 60 * 24); // Last 24 hours\r\n endTime = now;\r\n break;\r\n case \"day\":\r\n startTime = todayStart;\r\n endTime = now;\r\n break;\r\n case \"month\":\r\n startTime = monthFirstDay;\r\n endTime = now;\r\n break;\r\n case \"biannual\":\r\n startTime = new Date(now.setMonth(now.getMonth() - 6)); // Last 6 months\r\n endTime = new Date(); // Reset to current time after setMonth\r\n break;\r\n case \"annual\":\r\n startTime = new Date(now.setMonth(now.getMonth() - 12)); // Last 12 months\r\n endTime = new Date(); // Reset to current time after setMonth\r\n break;\r\n default:\r\n startTime = new Date(now.valueOf() - 1000 * 60 * 60 * 168); // Past week (168 hours)\r\n endTime = now;\r\n break;\r\n }\r\n\r\n return [startTime, endTime];\r\n}\r\n\r\nexport function VendorProductCheck(ProductID) {\r\n const { locd } = useContext(AppContext);\r\n const products = locd?.VendorLocationCratoProductArray;\r\n // Check if the ProductID exists in the products array\r\n const exists = products?.some(\r\n (product) => product.CratoProductID === ProductID\r\n );\r\n\r\n return exists;\r\n}\r\n","import React, { useState } from \"react\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport {\r\n Button,\r\n Paper,\r\n Typography,\r\n Container,\r\n Grid,\r\n CircularProgress,\r\n} from \"@material-ui/core\";\r\nimport { toast } from \"react-toastify\";\r\nimport { GetPassCode, ResetPassword } from \"../../api\";\r\n\r\nconst Forgot = ({ setForgot }) => {\r\n const history = useHistory();\r\n const [form, setForm] = useState({\r\n PassCode: \"\",\r\n NewPassword: \"\",\r\n ConfirmPassword: \"\",\r\n });\r\n const [step, setStep] = useState(0);\r\n const [error, setError] = useState(null);\r\n const [loading, setLoading] = useState(false);\r\n\r\n function validateForm() {\r\n if (form.NewPassword !== form.ConfirmPassword) {\r\n setError(\"The passwords do not match\");\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n const GetRestPassCode = (e) => {\r\n e.preventDefault();\r\n setLoading(true);\r\n GetPassCode(form.PhoneNumber)\r\n .then((Response) => Response.json())\r\n .then((result) => {\r\n setLoading(false);\r\n if (result.Error === false) {\r\n toast.success(`${result.Message}`);\r\n setStep(1);\r\n } else {\r\n toast.error(`${result.Message}`);\r\n setError(result.Message);\r\n }\r\n });\r\n };\r\n\r\n const handleSubmit = () => {\r\n if (!validateForm()) return;\r\n setLoading(true);\r\n ResetPassword(form)\r\n .then((Response) => Response.json())\r\n .then((result) => {\r\n setLoading(false);\r\n if (result.Error === false) {\r\n toast.success(`${result.Message}`);\r\n history.push(\"/login\");\r\n } else {\r\n toast.error(`${result.Message}`);\r\n setError(result.Message);\r\n }\r\n });\r\n };\r\n\r\n const handleChange = (e) => {\r\n setForm({ ...form, [e.target.name]: e.target.value });\r\n };\r\n\r\n const commonStyles = {\r\n formContainer: {\r\n paddingTop: \"100px\",\r\n paddingBottom: \"100px\",\r\n display: \"flex\",\r\n justifyContent: \"center\",\r\n alignItems: \"center\",\r\n minHeight: \"100vh\",\r\n backgroundColor: \"#2c3d4e\", // Updated to dark blue\r\n },\r\n paper: {\r\n padding: \"40px 30px\",\r\n borderRadius: \"12px\",\r\n boxShadow: \"0px 4px 25px rgba(0, 0, 0, 0.1)\",\r\n backgroundColor: \"#fff\",\r\n width: \"100%\",\r\n maxWidth: \"400px\",\r\n },\r\n heading: {\r\n fontSize: \"24px\",\r\n fontWeight: \"bold\",\r\n textAlign: \"center\",\r\n marginBottom: \"25px\",\r\n color: \"#2c3d4e\", // Updated to dark blue\r\n },\r\n button: {\r\n marginTop: \"20px\",\r\n padding: \"12px\",\r\n backgroundColor: \"#44dc94\", // Updated to green\r\n color: \"#2c3d4e\", // Updated text color to dark blue for contrast\r\n borderRadius: \"8px\",\r\n cursor: \"pointer\",\r\n textAlign: \"center\",\r\n width: \"100%\",\r\n textTransform: \"uppercase\",\r\n fontWeight: \"500\",\r\n letterSpacing: \"0.5px\",\r\n boxShadow: \"0px 3px 8px rgba(0, 0, 0, 0.1)\",\r\n transition: \"all 0.3s ease-in-out\",\r\n },\r\n buttonSpacing: {\r\n marginTop: \"15px\",\r\n },\r\n buttonSecondary: {\r\n backgroundColor: \"#fff\",\r\n color: \"#44dc94\", // Updated to green\r\n border: \"1px solid #44dc94\", // Updated to green\r\n },\r\n errorText: {\r\n color: \"#ff6b6b\", // A shade of red that works well with the new color scheme\r\n fontSize: \"14px\",\r\n marginTop: \"10px\",\r\n textAlign: \"center\",\r\n },\r\n successIcon: {\r\n fontSize: \"60px\",\r\n color: \"#44dc94\", // Updated to green\r\n marginBottom: \"20px\",\r\n },\r\n buttonContainer: {\r\n display: \"flex\",\r\n justifyContent: \"space-between\",\r\n gap: \"20px\",\r\n marginTop: \"25px\",\r\n },\r\n input: {\r\n width: \"100%\",\r\n padding: \"12px 15px\",\r\n margin: \"10px 0\",\r\n borderRadius: \"8px\",\r\n border: \"1px solid #ccc\",\r\n fontSize: \"14px\",\r\n outline: \"none\",\r\n transition: \"border-color 0.3s ease-in-out\",\r\n },\r\n inputFocus: {\r\n borderColor: \"#44dc94\", // Updated to green\r\n },\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n {step === 0 && (\r\n
\r\n \r\n Forgot your password? Enter your phone number\r\n \r\n
\r\n \r\n \r\n \r\n \r\n {error &&
{error}
}\r\n \r\n {loading ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n setForgot(false)}\r\n style={{\r\n ...commonStyles.button,\r\n ...commonStyles.buttonSecondary,\r\n }}\r\n >\r\n Back to Login\r\n \r\n \r\n
\r\n
\r\n
\r\n )}\r\n\r\n {step === 1 && (\r\n
\r\n
\r\n \r\n
\r\n \r\n A passcode has been sent to your phone. Please reset your\r\n password below.\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {error &&
{error}
}\r\n
\r\n {loading ? (\r\n \r\n ) : (\r\n
\r\n setStep(0)}\r\n variant=\"outlined\"\r\n size=\"small\"\r\n style={{\r\n ...commonStyles.button,\r\n ...commonStyles.buttonSecondary,\r\n }}\r\n >\r\n Resend Code\r\n \r\n \r\n Save Changes\r\n \r\n
\r\n )}\r\n
\r\n )}\r\n\r\n {step === 2 && (\r\n
\r\n
\r\n \r\n
\r\n \r\n Please check your internet connection and try again.\r\n \r\n
\r\n history.push(\"/\")}\r\n variant=\"outlined\"\r\n style={commonStyles.button}\r\n >\r\n Back to Home\r\n \r\n setStep(0)}\r\n variant=\"contained\"\r\n style={commonStyles.button}\r\n >\r\n Resend Link\r\n \r\n
\r\n
\r\n )}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Forgot;\r\n","import React, { useEffect, useRef, useState } from \"react\";\r\nimport {\r\n AddVendorAccountPayment,\r\n CheckSTKPushAccountPayment,\r\n ConfirmAccountPayment,\r\n encryptSession,\r\n} from \"../../../api\";\r\nimport { GetVendorProfile, GetVendorStatement } from \"../../../api\";\r\nimport { accountingFormat } from \"../../common/Functions\";\r\nimport { CircularProgress } from \"@mui/material\";\r\nimport { toast } from \"react-toastify\";\r\n\r\nconst styles = {\r\n container: {\r\n padding: \"40px\",\r\n maxWidth: \"1000px\",\r\n margin: \"20px auto\",\r\n backgroundColor: \"#fff\",\r\n borderRadius: \"8px\",\r\n boxShadow: \"0 4px 6px rgba(0, 0, 0, 0.1)\",\r\n },\r\n header: {\r\n marginBottom: \"40px\",\r\n borderBottom: \"2px solid #333\",\r\n paddingBottom: \"20px\",\r\n },\r\n headerGrid: {\r\n display: \"grid\",\r\n gridTemplateColumns: \"1fr 1fr\",\r\n gap: \"20px\",\r\n },\r\n businessDetails: {\r\n textAlign: \"left\",\r\n },\r\n customerDetails: {\r\n textAlign: \"right\",\r\n },\r\n companyName: {\r\n fontSize: \"24px\",\r\n fontWeight: \"bold\",\r\n marginBottom: \"8px\",\r\n },\r\n detailsText: {\r\n fontSize: \"14px\",\r\n color: \"#666\",\r\n marginBottom: \"4px\",\r\n },\r\n documentTitle: {\r\n fontSize: \"20px\",\r\n fontWeight: \"bold\",\r\n marginBottom: \"24px\",\r\n textAlign: \"center\",\r\n textTransform: \"uppercase\",\r\n },\r\n statementInfo: {\r\n display: \"flex\",\r\n justifyContent: \"space-between\",\r\n marginBottom: \"32px\",\r\n },\r\n table: {\r\n width: \"100%\",\r\n borderCollapse: \"collapse\",\r\n marginBottom: \"32px\",\r\n },\r\n th: {\r\n backgroundColor: \"#f8f9fa\",\r\n padding: \"12px\",\r\n borderBottom: \"2px solid #dee2e6\",\r\n textAlign: \"left\",\r\n fontSize: \"14px\",\r\n fontWeight: \"bold\",\r\n },\r\n td: {\r\n padding: \"12px\",\r\n borderBottom: \"1px solid #dee2e6\",\r\n fontSize: \"14px\",\r\n },\r\n totalRow: {\r\n backgroundColor: \"#f8f9fa\",\r\n fontWeight: \"bold\",\r\n },\r\n amount: {\r\n textAlign: \"right\",\r\n fontFamily: \"monospace\",\r\n },\r\n debit: {\r\n color: \"#dc3545\",\r\n },\r\n credit: {\r\n color: \"#198754\",\r\n },\r\n modal: {\r\n position: \"fixed\",\r\n top: \"50%\",\r\n left: \"50%\",\r\n transform: \"translate(-50%, -50%)\",\r\n backgroundColor: \"#fff\",\r\n padding: \"24px\",\r\n borderRadius: \"8px\",\r\n boxShadow: \"0 4px 6px rgba(0, 0, 0, 0.1)\",\r\n width: \"90%\",\r\n maxWidth: \"400px\",\r\n zIndex: 1000,\r\n },\r\n overlay: {\r\n position: \"fixed\",\r\n top: 0,\r\n left: 0,\r\n right: 0,\r\n bottom: 0,\r\n backgroundColor: \"rgba(0, 0, 0, 0.5)\",\r\n zIndex: 999,\r\n },\r\n button: {\r\n padding: \"8px 16px\",\r\n backgroundColor: \"#0d6efd\",\r\n color: \"#fff\",\r\n border: \"none\",\r\n borderRadius: \"4px\",\r\n cursor: \"pointer\",\r\n fontSize: \"14px\",\r\n marginRight: \"8px\",\r\n },\r\n input: {\r\n width: \"100%\",\r\n padding: \"8px\",\r\n marginBottom: \"16px\",\r\n border: \"1px solid #dee2e6\",\r\n borderRadius: \"4px\",\r\n },\r\n};\r\n\r\nconst FinancialStatement = () => {\r\n const businessDetails = {\r\n name: \"ESQUE KENYA LIMITED\",\r\n address: \"Applewood Plaza 6th fr\",\r\n city: \"Nairobi\",\r\n phone: \"+254 702 628 741\",\r\n email: \"info@esquekenya.com\",\r\n taxId: \"P051868787M\",\r\n };\r\n\r\n const invoice = encryptSession.getItem(\"invoice\");\r\n const { profile } = GetVendorProfile();\r\n const timerRef = useRef(null);\r\n const [countdown, setCountdown] = useState(20);\r\n const [paymentMethod, setPaymentMethod] = useState();\r\n const [phoneNumber, setPhoneNumber] = useState(\"\");\r\n const [showPaymentModal, setShowPaymentModal] = useState(false);\r\n\r\n useEffect(() => {\r\n if (phoneNumber === \"\") {\r\n setPhoneNumber(profile?.ContactPhone);\r\n }\r\n }, [profile]);\r\n\r\n const onSuccess = () => {};\r\n\r\n const {\r\n loading,\r\n result,\r\n handleFormSubmit: HandleSTKRequest,\r\n } = AddVendorAccountPayment(\r\n { PhoneNumber: phoneNumber, InvoiceNO: invoice?.InvoiceNO },\r\n [onSuccess]\r\n );\r\n\r\n const {\r\n loading: checkloading,\r\n result: checkresult,\r\n handleFormSubmit: HandleSTKCheckResult,\r\n } = CheckSTKPushAccountPayment({\r\n CheckoutRequestID: result?.Response?.CheckoutRequestID,\r\n });\r\n\r\n const {\r\n loading: completeloading,\r\n result: completeresult,\r\n handleFormSubmit: handleConfirm,\r\n } = ConfirmAccountPayment(\r\n { TransID: checkresult?.Response?.TransID, InvoiceNO: invoice?.InvoiceNO },\r\n [onSuccess]\r\n );\r\n\r\n useEffect(() => {\r\n if (checkloading) return; // Exit early if checkloading is true\r\n \r\n if (timerRef.current) {\r\n clearTimeout(timerRef.current);\r\n }\r\n \r\n if (result && paymentMethod === \"stk\") {\r\n setCountdown(20);\r\n const timer = setInterval(() => {\r\n setCountdown((prevCountdown) => {\r\n if (prevCountdown > 0) {\r\n return prevCountdown - 1;\r\n } else {\r\n clearInterval(timer);\r\n HandleSTKCheckResult();\r\n return 0;\r\n }\r\n });\r\n }, 1000);\r\n timerRef.current = timer;\r\n }\r\n \r\n return () => {\r\n if (timerRef.current) {\r\n clearInterval(timerRef.current); // Clear the interval when the component unmounts or effect re-runs\r\n }\r\n };\r\n }, [result, paymentMethod, checkloading]);\r\n\r\n \r\n\r\n \r\n\r\n useEffect(() => {\r\n if (timerRef.current) {\r\n clearTimeout(timerRef.current);\r\n }\r\n\r\n if (checkresult?.Response?.ResultCode===0) {\r\n timerRef.current = setTimeout(() => {\r\n handleConfirm();\r\n }, 3000);\r\n } else if (checkresult) {\r\n toast.error(checkresult?.Response?.ResultDesc);\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [checkresult]);\r\n\r\n const getLast12MonthsRange = () => {\r\n const endDate = new Date();\r\n const startDate = new Date();\r\n startDate.setFullYear(startDate.getFullYear() - 1);\r\n return [\r\n startDate.toISOString().split(\"T\")[0],\r\n endDate.toISOString().split(\"T\")[0],\r\n ];\r\n };\r\n\r\n const dateRange = getLast12MonthsRange();\r\n const { statement } = GetVendorStatement({ DateRange: dateRange });\r\n\r\n const calculateTotals = () => {\r\n return statement.reduce(\r\n (acc, transaction) => ({\r\n totalDebit: acc.totalDebit + (transaction.Debit || 0),\r\n totalCredit: acc.totalCredit + (transaction.Credit || 0),\r\n }),\r\n { totalDebit: 0, totalCredit: 0 }\r\n );\r\n };\r\n\r\n const customerDetails = {\r\n name: profile?.VendorName,\r\n accountNo: profile?.VendorName,\r\n stations: profile?.StationsArray?.length,\r\n phone: profile?.ContactPhone,\r\n email: profile?.ContactEmail,\r\n };\r\n\r\n const formatCurrency = (amount) => {\r\n return `KES ${amount?.toLocaleString()}`;\r\n };\r\n\r\n const handlePaymentMethodChange = (method) => {\r\n setPaymentMethod(method);\r\n };\r\n\r\n const handlePhoneNumberChange = (e) => {\r\n setPhoneNumber(e.target.value);\r\n };\r\n\r\n const handlePaymentSubmit = () => {\r\n if (paymentMethod === \"stk\") {\r\n HandleSTKRequest();\r\n }\r\n console.log(\"Processing payment...\", { paymentMethod, phoneNumber });\r\n };\r\n\r\n const totals = calculateTotals();\r\n\r\n return (\r\n
\r\n
\r\n
\r\n
\r\n
{businessDetails.name}
\r\n
{businessDetails.address}
\r\n
{businessDetails.city}
\r\n
Tel: {businessDetails.phone}
\r\n
Email: {businessDetails.email}
\r\n
\r\n Tax ID: {businessDetails.taxId}\r\n
\r\n
\r\n
\r\n
{customerDetails.name}
\r\n
\r\n ACC: {customerDetails.accountNo}\r\n
\r\n
\r\n Stations: {customerDetails.stations}\r\n
\r\n
Tel: {customerDetails.phone}
\r\n
Email: {customerDetails.email}
\r\n
\r\n
\r\n
\r\n\r\n

Financial Statement

\r\n\r\n
\r\n
\r\n Statement Date: {new Date().toLocaleDateString()}\r\n
\r\n \r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {statement.map((transaction, index) => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ))}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
DateDescriptionDebitCreditBalance
\r\n {new Date(transaction.Date).toLocaleDateString()}\r\n {transaction.description}\r\n {transaction.Debit > 0\r\n ? formatCurrency(transaction.Debit)\r\n : \"-\"}\r\n \r\n {transaction.Credit > 0\r\n ? formatCurrency(transaction.Credit)\r\n : \"-\"}\r\n \r\n {formatCurrency(transaction.Balance)}\r\n
\r\n Totals\r\n \r\n {formatCurrency(totals.totalDebit)}\r\n \r\n {formatCurrency(totals.totalCredit)}\r\n \r\n {formatCurrency(statement[statement.length - 1]?.Balance)}\r\n
\r\n\r\n {showPaymentModal && (\r\n <>\r\n setShowPaymentModal(false)}\r\n />\r\n
\r\n

Make Payment

\r\n
\r\n \r\n \r\n
\r\n {paymentMethod === \"stk\" && (\r\n <>\r\n \r\n \r\n \r\n {countdown > 0 && countdown !== 20 && (\r\n
Time remaining: {countdown} seconds
\r\n )}\r\n \r\n )}\r\n {loading || checkloading || completeloading ? (\r\n \r\n ) : (\r\n countdown === 20 && (\r\n \r\n )\r\n )}\r\n {countdown === 20 && (\r\n setShowPaymentModal(false)}\r\n >\r\n Cancel\r\n \r\n )}\r\n {paymentMethod === \"manual\" && (\r\n \r\n

Payment Instructions:

\r\n

Name: ESQUE-SERVICES

\r\n

Till Number: 5857505

\r\n {/*

Branch: Main Branch

\r\n

Reference: {customerDetails.accountNo}

*/}\r\n
\r\n )}\r\n
\r\n \r\n )}\r\n \r\n );\r\n};\r\n\r\nexport default FinancialStatement;\r\n","import React from \"react\";\r\n\r\n\r\nconst AppContext = React.createContext();\r\n\r\nconst AppProvider = ({ children }) => {\r\n return {children};\r\n};\r\n\r\nexport { AppProvider, AppContext };\r\n","import React from \"react\";\r\n\r\nconst Footer = () => {\r\n return (\r\n \r\n
\r\n {/* \r\n \r\n \r\n \r\n footer-frame\r\n \r\n */}\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default Footer;\r\n","import React, { useEffect, useState } from \"react\";\r\nimport \"./styles.css\";\r\nimport { Menu, MenuItem } from \"@mui/material\";\r\nimport ArrowRightIcon from \"@mui/icons-material/ArrowRight\";\r\n\r\nconst Tabs = (props) => {\r\n const [active, setActive] = useState(localStorage.getItem(\"tab\"));\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const [menuIdx, setMenuIdx] = useState(null);\r\n const { Headers, handleTabs } = props;\r\n\r\n // const handleClick = (child, idx, option) => {\r\n // handleTabs(child, option);\r\n // localStorage.setItem(\"tab\", idx);\r\n // setActive(idx);\r\n // handleMenuClose();\r\n // };\r\n\r\n const currentUrl = window.location.href;\r\n const lastPart = currentUrl.split(\"/\").pop();\r\n\r\n useEffect(() => {\r\n const newIndex = Headers[0]?.children?.findIndex(\r\n (item) => item.url.split(\"/\").pop() === lastPart\r\n );\r\n setActive(newIndex);\r\n }, [Headers, lastPart]);\r\n\r\n // const handleMenuOpen = (event, idx) => {\r\n // setAnchorEl(event.currentTarget);\r\n // setMenuIdx(idx);\r\n // };\r\n\r\n // const handleMenuClose = () => {\r\n // setAnchorEl(null);\r\n // setMenuIdx(null);\r\n // };\r\n\r\n // useEffect(() => {\r\n // const handleClickOutside = (event) => {\r\n // if (anchorEl && !anchorEl.contains(event.target)) {\r\n // handleMenuClose();\r\n // }\r\n // };\r\n\r\n // document.addEventListener(\"mousedown\", handleClickOutside);\r\n // return () => {\r\n // document.removeEventListener(\"mousedown\", handleClickOutside);\r\n // };\r\n // }, [anchorEl]);\r\n\r\n return (\r\n
\r\n
\r\n {Headers.map((tab, tabIndex) => (\r\n
    \r\n {tab.children.map((child, idx) => (\r\n handleMenuOpen(event, idx)}\r\n onClick={(event) => handleTabs(child, idx)}\r\n // onMouseLeave={handleMenuClose}\r\n >\r\n {child.icon} {child.id}\r\n \r\n \r\n ))}\r\n
\r\n ))}\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Tabs;\r\n","import { Settings, TimeToLeaveOutlined } from \"@material-ui/icons\";\r\nimport {\r\n Dns,\r\n House,\r\n People,\r\n PermMedia,\r\n Phonelink,\r\n ProductionQuantityLimits,\r\n Support,\r\n} from \"@mui/icons-material\";\r\nimport { IconBoxModel } from \"@tabler/icons\";\r\nimport { encryptSession } from \".\";\r\n\r\nconst VendorID = encryptSession.getItem(\"ci\");\r\n\r\nexport const NavBar = [\r\n {\r\n id: \"sales\",\r\n children: [\r\n { id: \"saledash\", icon: , url: \"sales/saledash\" },\r\n { id: \"report\", icon: , url: \"sales/history\" },\r\n { id: \"customer\", icon: , url: \"sales/customer\" },\r\n // { id: \"invoice\", icon: , url: \"sales/invoice\" },\r\n ],\r\n },\r\n {\r\n id: \"inventory\",\r\n children: [\r\n { id: \"report\", icon: , url: \"inventory/report\" },\r\n // {\r\n // id: \"action\",\r\n // icon: ,\r\n // url: \"inventory/action\",\r\n // },\r\n {\r\n id: VendorID === 30 ? \"offloading\" : \"purchase\",\r\n icon: ,\r\n url: VendorID === 30 ? \"inventory/offloading\" : \"inventory/purchase\",\r\n },\r\n { id: \"products\", icon: , url: \"inventory/inventory\" },\r\n { id: \"supplier\", icon: , url: \"inventory/supplier\" },\r\n ],\r\n },\r\n {\r\n id: \"finance\",\r\n children: [\r\n { id: \"statements\", icon: , url: \"finance/statement\" },\r\n {\r\n id: \"expense\",\r\n icon: ,\r\n url: \"finance/expense\",\r\n },\r\n { id: \"payroll\", icon: , url: \"finance/payroll\" },\r\n { id: \"Tax\", icon: , url: \"finance/tax\" },\r\n // { id: \"finance\", icon: , url: \"finance/transfer\" },\r\n // { id: \"supplier\", icon: , url: \"inventory/supplier\" },\r\n ],\r\n },\r\n {\r\n id: \"shift\",\r\n children: [\r\n { id: \"shift\", icon: , url: \"shift/clock\" },\r\n\r\n { id: \"DailySummary\", icon: , url: \"shift/DailySummary\" },\r\n // { id: \"transfer\", icon: , url: \"shift/transfer\" },\r\n // { id: \"supplier\", icon: , url: \"inventory/supplier\" },\r\n ],\r\n },\r\n];\r\n","import React, { useState, useContext } from \"react\";\r\nimport {\r\n Button,\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n TextField,\r\n IconButton,\r\n Paper,\r\n List,\r\n ListItem,\r\n ListItemText,\r\n Grid,\r\n Typography,\r\n CircularProgress,\r\n} from \"@mui/material\";\r\nimport { Add as AddIcon, Delete as DeleteIcon } from \"@mui/icons-material\";\r\nimport { SendEmailReport } from \"../../api\";\r\nimport { AppContext } from \"../../AppContext\";\r\nimport { toast } from \"react-toastify\";\r\n\r\nconst SendEmailDialog = ({\r\n recipients,\r\n setRecipients,\r\n reportName,\r\n setReportName,\r\n body,\r\n setBody,\r\n}) => {\r\n const [email, setEmail] = useState(\"\");\r\n\r\n const handleAddRecipient = () => {\r\n if (email) {\r\n setRecipients([...recipients, email]);\r\n setEmail(\"\");\r\n }\r\n };\r\n\r\n const handleDeleteRecipient = (index) => {\r\n setRecipients(recipients.filter((_, i) => i !== index));\r\n };\r\n\r\n return (\r\n \r\n \r\n setReportName(e.target.value)}\r\n fullWidth\r\n margin=\"normal\"\r\n />\r\n \r\n\r\n \r\n setEmail(e.target.value)}\r\n fullWidth\r\n margin=\"normal\"\r\n type=\"email\"\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n Recipients\r\n \r\n {recipients.map((recipient, index) => (\r\n handleDeleteRecipient(index)}\r\n >\r\n \r\n \r\n }\r\n >\r\n \r\n \r\n ))}\r\n \r\n \r\n \r\n \r\n setBody(e.target.value)}\r\n fullWidth\r\n multiline\r\n rows={4}\r\n margin=\"normal\"\r\n />\r\n \r\n \r\n );\r\n};\r\n\r\nconst EmailSender = ({ setOpen, open, pdfBlob }) => {\r\n const { context } = useContext(AppContext);\r\n const [recipients, setRecipients] = useState([]);\r\n const [reportName, setReportName] = useState(context.reporttitle);\r\n const [body, setBody] = useState(\"find attached\");\r\n\r\n const handleClose = () => setOpen(false);\r\n const onSuccess = () => {\r\n setOpen(false);\r\n };\r\n\r\n const { loading, handleFormSubmit: handleUpload } = SendEmailReport(\r\n {\r\n emails: recipients,\r\n pdfBase64: pdfBlob,\r\n reportName: reportName,\r\n VendorLocationName: context?.VendorLocationName,\r\n TradingName: context.TradingName,\r\n Body: body,\r\n },\r\n [onSuccess]\r\n );\r\n\r\n return (\r\n \r\n Send Email\r\n \r\n \r\n \r\n \r\n PDF Preview\r\n {pdfBlob ? (\r\n \r\n ) : (\r\n No PDF available\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {loading ? (\r\n \r\n ) : (\r\n \r\n recipients.length > 0\r\n ? handleUpload()\r\n : toast.error(\"At least one recipient is required.\")\r\n }\r\n >\r\n Share Report\r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default EmailSender;\r\n","import React, { useState, useContext } from \"react\";\r\nimport {\r\n Button,\r\n Dialog,\r\n DialogActions,\r\n DialogContent,\r\n DialogTitle,\r\n TextField,\r\n Paper,\r\n Grid,\r\n Typography,\r\n CircularProgress,\r\n} from \"@mui/material\";\r\nimport { SendWhatsAppReport } from \"../../api\";\r\nimport { AppContext } from \"../../AppContext\";\r\nimport PhoneNumberInput from \"../common/Inputs/PhoneNumber/PhoneNumber\";\r\nimport { DateTimeFormat } from \"../common/Functions\";\r\n\r\nconst SendEmailDialog = ({ setReport, report }) => {\r\n const handlePhoneNumber = (value) => {\r\n setReport({\r\n ...report,\r\n PhoneNumber: value?.dialCode?.replace(\"+\", \"\") + value?.phoneNumber,\r\n CountryCode: value?.dialCode?.replace(\"+\", \"\"),\r\n });\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n setReport({ ...report, body: e.target.value })}\r\n fullWidth\r\n multiline\r\n rows={4}\r\n margin=\"normal\"\r\n />\r\n \r\n \r\n );\r\n};\r\n\r\nconst WhatsAppSender = ({ setOpen, open, pdfBlob }) => {\r\n const [reports, setReports] = useState({ body: \"\" });\r\n const { context } = useContext(AppContext);\r\n\r\n const handleClose = () => setOpen(false);\r\n\r\n const onSuccess = () => {\r\n setOpen(false);\r\n };\r\n\r\n const { loading, handleFormSubmit: handleUpload } = SendWhatsAppReport(\r\n {\r\n PhoneNumber: reports?.PhoneNumber,\r\n pdfBase64: pdfBlob,\r\n FileName: context.reporttitle,\r\n ReportName: \"\",\r\n VendorLocationName: context?.VendorLocationName,\r\n TradingName: context.TradingName + \"-\" + reports?.body,\r\n DateRange:\r\n DateTimeFormat(context?.DateRange[0], \"dateonly\") +\r\n \" to \" +\r\n DateTimeFormat(context?.DateRange[1], \"dateonly\"),\r\n Body: reports?.body,\r\n CompanyPhone: \"254-702628741\",\r\n },\r\n [onSuccess]\r\n );\r\n\r\n return (\r\n \r\n Send Email\r\n \r\n \r\n \r\n \r\n PDF Preview\r\n {pdfBlob ? (\r\n \r\n ) : (\r\n ... loading please wait\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {loading ? (\r\n \r\n ) : (\r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default WhatsAppSender;\r\n","import React, {\r\n useState,\r\n useEffect,\r\n useContext,\r\n useCallback,\r\n useRef,\r\n } from \"react\";\r\n import { AppContext } from \"../../AppContext\";\r\n import { encryptSession } from \"../../api\";\r\n import moment from \"moment\";\r\n import { DateTimeFormat, DefaultContextDateRange, getNairobiTimeFromLocal } from \"./Functions\";\r\n \r\n const SearchableDropdown = ({ locations, storedValues }) => {\r\n const [isVisible, setIsVisible] = useState(false);\r\n const [searchTerm, setSearchTerm] = useState(\"\");\r\n const [selectedOptions, setSelectedOptions] = useState(\r\n storedValues ? [storedValues] : [locations[0]]\r\n );\r\n const [isMultiSelect, setIsMultiSelect] = useState(false);\r\n const { context, setContext, setVendorImage, setLocd } =\r\n useContext(AppContext);\r\n const [startTime, endTime] = DefaultContextDateRange(\"day\");\r\n const dropdownRef = useRef(null);\r\n const [dropdownHeight, setDropdownHeight] = useState(300);\r\n \r\n const filteredOptions = locations?.filter((option) =>\r\n option.VendorLocationName?.toLowerCase().includes(searchTerm.toLowerCase())\r\n );\r\n \r\n const handleOnChange = useCallback(\r\n (newValues) => {\r\n let updateValue;\r\n \r\n if (newValues.length === 0) {\r\n // If no options are selected, use a default value\r\n updateValue = {\r\n VendorLocationID: 0,\r\n VendorLocationIDs: \"\",\r\n VendorLocationName: \"\",\r\n VendorID: encryptSession.getItem(\"ci\"),\r\n locd: encryptSession.getItem(\"locd\"),\r\n };\r\n } else if (newValues.length === 1) {\r\n // If only one option is selected, use its values\r\n const selectedOption = newValues[0];\r\n updateValue = {\r\n ...selectedOption,\r\n };\r\n } else {\r\n // If multiple options are selected\r\n const vendorLocationNames = newValues\r\n .map((v) => v.VendorLocationName)\r\n .join(\", \");\r\n const vendorLocationIDs = newValues\r\n .map((v) => v.VendorLocationID)\r\n .join(\",\");\r\n updateValue = {\r\n VendorLocationID: 0,\r\n VendorLocationIDs: vendorLocationIDs,\r\n VendorLocationName: `${newValues.length} Stations Selected`,\r\n VendorID: encryptSession.getItem(\"ci\"),\r\n locd: newValues?.locd,\r\n ImageID: newValues[0].ImageID,\r\n TradingName: newValues[0].TradingName,\r\n ...newValues[0],\r\n };\r\n }\r\n \r\n setContext((prevContext) => ({\r\n ...prevContext,\r\n ...updateValue,\r\n }));\r\n setVendorImage(updateValue.ImageID);\r\n localStorage.setItem(\"values\", JSON.stringify(updateValue));\r\n setLocd(updateValue);\r\n encryptSession.setItem(\"cn\", updateValue.TradingName);\r\n encryptSession.setItem(\"cim\", updateValue.ImageID);\r\n encryptSession.setItem(\"locd\", updateValue);\r\n encryptSession.setItem(\"ci\", updateValue.VendorID);\r\n },\r\n [setContext, setVendorImage, setLocd]\r\n );\r\n \r\n const handleDateChange = useCallback(\r\n (start, end) => {\r\n // Use the current context dates as fallbacks instead of startTime/endTime\r\n const currentStartDate = context?.DateRange_?.[0] || startTime;\r\n const currentEndDate = context?.DateRange_?.[1] || endTime;\r\n \r\n // When changing start date, keep the existing end date\r\n // When changing end date, keep the existing start date\r\n const newStartDate = start || currentStartDate;\r\n const newEndDate = end || currentEndDate;\r\n \r\n setContext((prevContext) => ({\r\n ...prevContext,\r\n DateRange: [\r\n getNairobiTimeFromLocal(newStartDate),\r\n getNairobiTimeFromLocal(newEndDate),\r\n ],\r\n DateRange_: [newStartDate, newEndDate],\r\n }));\r\n },\r\n [context, setContext, startTime, endTime]\r\n );\r\n \r\n useEffect(() => {\r\n if (!context?.DateRange) {\r\n setContext((prevContext) => ({\r\n ...prevContext,\r\n DateRange: [\r\n getNairobiTimeFromLocal(startTime, \"datetime\"),\r\n getNairobiTimeFromLocal(endTime, \"datetime\"),\r\n ],\r\n DateRange_: [startTime, endTime],\r\n }));\r\n }\r\n }, [context, setContext, startTime, endTime]);\r\n \r\n useEffect(() => {\r\n const handleClickOutside = (event) => {\r\n if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {\r\n setIsVisible(false);\r\n }\r\n };\r\n document.addEventListener(\"mousedown\", handleClickOutside);\r\n return () => {\r\n document.removeEventListener(\"mousedown\", handleClickOutside);\r\n };\r\n }, [dropdownRef]);\r\n \r\n useEffect(() => {\r\n if (isVisible) {\r\n const calculateHeight = () => {\r\n const windowHeight = window.innerHeight;\r\n const dropdownTop =\r\n dropdownRef.current?.getBoundingClientRect().top || 0;\r\n const maxHeight = windowHeight - dropdownTop - 20;\r\n setDropdownHeight(Math.max(300, maxHeight));\r\n };\r\n \r\n calculateHeight();\r\n window.addEventListener(\"resize\", calculateHeight);\r\n \r\n return () => window.removeEventListener(\"resize\", calculateHeight);\r\n }\r\n }, [isVisible]);\r\n \r\n const renderDateInputs = () => {\r\n const startType = context?.timeRange === \"time\" ? \"datetime-local\" : \"date\";\r\n const endType = context?.timeRange === \"time\" ? \"datetime-local\" : \"date\";\r\n return (\r\n <>\r\n handleDateChange(e.target.value, null)}\r\n placeholder=\"Start Date\"\r\n className=\"form-control\"\r\n style={{\r\n width: \"200px\",\r\n borderRadius: \"10px\",\r\n padding: \"8px\",\r\n marginRight: \"10px\",\r\n }}\r\n />\r\n handleDateChange(null, e.target.value)}\r\n placeholder=\"End Date\"\r\n className=\"form-control\"\r\n style={{\r\n width: \"200px\",\r\n borderRadius: \"10px\",\r\n padding: \"8px\",\r\n marginRight: \"10px\",\r\n }}\r\n />\r\n \r\n );\r\n };\r\n \r\n const handleOptionChange = (option) => {\r\n let newSelectedOptions;\r\n if (isMultiSelect) {\r\n newSelectedOptions = selectedOptions.some(\r\n (item) => item.VendorLocationID === option.VendorLocationID\r\n )\r\n ? selectedOptions.filter(\r\n (item) => item.VendorLocationID !== option.VendorLocationID\r\n )\r\n : [...selectedOptions, option];\r\n } else {\r\n newSelectedOptions = [option];\r\n setIsVisible(false);\r\n }\r\n setSelectedOptions(newSelectedOptions);\r\n handleOnChange(newSelectedOptions);\r\n setSearchTerm(\"\");\r\n encryptSession.setItem(\"cn\", newSelectedOptions[0].TradingName);\r\n encryptSession.setItem(\"cim\", newSelectedOptions[0].ImageID);\r\n encryptSession.setItem(\"locd\", newSelectedOptions[0]);\r\n encryptSession.setItem(\"ci\", newSelectedOptions[0].VendorID);\r\n };\r\n \r\n const toggleMultiSelect = () => {\r\n setIsMultiSelect(!isMultiSelect);\r\n if (!isMultiSelect) {\r\n setSelectedOptions([]);\r\n handleOnChange([]);\r\n } else {\r\n setSelectedOptions([selectedOptions[0] || locations[0]]);\r\n handleOnChange([selectedOptions[0] || locations[0]]);\r\n }\r\n };\r\n \r\n return (\r\n
\r\n {context.timeRange === \"nodate\" ? null : renderDateInputs()}\r\n {context?.station !== \"none\" && (\r\n
\r\n option.VendorLocationName)\r\n .join(\", \")\r\n }\r\n className=\"form-control fc-datepicker\"\r\n onClick={() => setIsVisible(!isVisible)}\r\n placeholder=\"Select option(s)\"\r\n style={{\r\n width: \"100%\",\r\n padding: \"8px\",\r\n boxSizing: \"border-box\",\r\n borderRadius: \"10px\",\r\n }}\r\n readOnly\r\n />\r\n {context?.fetching && (\r\n \r\n
\r\n Loading...\r\n
\r\n
\r\n )}\r\n {isVisible && (\r\n \r\n \r\n \r\n {/* \r\n \r\n Select Multiple\r\n */}\r\n
\r\n setSearchTerm(e.target.value)}\r\n style={{\r\n width: \"100%\",\r\n padding: \"8px\",\r\n boxSizing: \"border-box\",\r\n }}\r\n />\r\n \r\n \r\n \r\n {filteredOptions.map((option) => (\r\n handleOptionChange(option)}\r\n style={{\r\n padding: \"8px\",\r\n cursor: \"pointer\",\r\n backgroundColor: \"#FFF\",\r\n color: \"black\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n }}\r\n >\r\n \r\n item.VendorLocationID === option.VendorLocationID\r\n )}\r\n onChange={() => handleOptionChange(option)}\r\n style={{ marginRight: \"10px\" }}\r\n />\r\n {option.VendorLocationName}\r\n \r\n ))}\r\n \r\n \r\n )}\r\n \r\n )}\r\n \r\n );\r\n };\r\n \r\n export default SearchableDropdown;\r\n ","import React from \"react\";\r\nimport { DateTimeFormat } from \"../common/Functions\";\r\n\r\nconst WarningMessage = ({ dueDate }) => {\r\n const handleClick = () => {\r\n window.location.href = \"/settings/billing\";\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Your account has a pending invoice due date {DateTimeFormat(dueDate, 'date')}\r\n \r\n\r\n \r\n \r\n );\r\n};\r\n\r\nexport default WarningMessage;\r\n","import React, { useState, useEffect } from 'react';\r\n\r\n// Styling for the modal background overlay\r\nconst overlayStyle = {\r\n position: 'fixed',\r\n top: 0,\r\n left: 0,\r\n width: '100%',\r\n height: '100%',\r\n backgroundColor: 'rgba(0, 0, 0, 0.5)', // Semi-transparent black\r\n zIndex: 999\r\n};\r\n\r\n// Styling for the modal itself\r\nconst modalStyle = {\r\n position: 'fixed',\r\n top: '50%',\r\n left: '50%',\r\n transform: 'translate(-50%, -50%)',\r\n backgroundColor: 'white',\r\n padding: '20px',\r\n zIndex: 1000,\r\n boxShadow: '0 4px 8px rgba(0,0,0,0.1)',\r\n borderRadius: '8px',\r\n textAlign: 'center'\r\n};\r\n\r\nconst buttonStyle = {\r\n margin: '10px 5px',\r\n padding: '10px 20px',\r\n border: 'none',\r\n borderRadius: '5px',\r\n cursor: 'pointer',\r\n fontSize: '16px'\r\n};\r\n\r\nconst continueButtonStyle = {\r\n ...buttonStyle,\r\n backgroundColor: '#4CAF50',\r\n color: 'white'\r\n};\r\n\r\nconst logoutButtonStyle = {\r\n ...buttonStyle,\r\n backgroundColor: '#f44336',\r\n color: 'white'\r\n};\r\n\r\nconst WarningModal = ({ onClose, onExtendSession }) => {\r\n const [counter, setCounter] = useState(60); // 60 seconds countdown\r\n\r\n useEffect(() => {\r\n const timer = counter > 0 && setInterval(() => setCounter(counter - 1), 1000);\r\n if (counter === 0) {\r\n onClose(); // Automatically logout or close modal if time runs out\r\n }\r\n return () => clearInterval(timer);\r\n }, [counter, onClose]);\r\n\r\n return (\r\n <>\r\n
\r\n
\r\n

Session Timeout Warning

\r\n

Your session will expire in {counter} seconds. Do you want to continue?

\r\n \r\n \r\n
\r\n \r\n );\r\n};\r\n\r\nexport default WarningModal;","import * as React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport AppBar from \"@mui/material/AppBar\";\r\nimport Avatar from \"@mui/material/Avatar\";\r\nimport Button from \"@mui/material/Button\";\r\nimport Grid from \"@mui/material/Grid\";\r\nimport IconButton from \"@mui/material/IconButton\";\r\nimport Tabs from \"@mui/material/Tabs\";\r\nimport Toolbar from \"@mui/material/Toolbar\";\r\nimport Typography from \"@mui/material/Typography\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport {\r\n Menu,\r\n Print,\r\n PrintSharp,\r\n Email,\r\n WhatsApp,\r\n InsertDriveFile,\r\n} from \"@material-ui/icons\";\r\nimport { Hidden, Tooltip } from \"@mui/material\";\r\nimport { AppContext } from \"../../AppContext\";\r\nimport ReactToPrint from \"react-to-print\";\r\nimport Tab from \"../common/Tab/tab\";\r\nimport { NavBar } from \"../../api/data\";\r\nimport { encryptSession } from \"../../api\";\r\nimport * as XLSX from \"xlsx\";\r\nimport html2pdf from \"html2pdf.js\";\r\nimport EmailSender from \"./EmailSender\";\r\nimport WhatsAppSender from \"./WhatsAppSender\";\r\nimport MutilpleStations from \"../common/MutilpleStations\";\r\nimport WarningButton from \"./InvoiceButton\";\r\nimport SearchableDropdown from \"../common/MutilpleStations\";\r\nimport SessionExpireWarning from \"./SessionExpireWarning\";\r\n\r\n//const lightColor = \"rgba(255, 255, 255, 0.7)\";\r\nconst locations = encryptSession.getItem(\"loc\") || [];\r\nconst initiallocd = encryptSession.getItem(\"locd\") || {};\r\n\r\nconst styles = {\r\n border: \"#44dc94\",\r\n padding: \"12px 30px\",\r\n borderRadius: \"50px\",\r\n backgroundColor: \"white\",\r\n color: \"#44dc94\",\r\n cursor: \"pointer\",\r\n fontSize: \"15px\",\r\n outline: \"none\",\r\n marginRight: \"20px\",\r\n};\r\n\r\nconst logo = {\r\n height: \"70px\",\r\n fontWeight: \"bold\",\r\n fontSize: \"40px\",\r\n color: \"white\",\r\n cursor: \"pointer\",\r\n marginTop: \"10px\",\r\n};\r\n\r\nfunction Header(props) {\r\n const history = useHistory();\r\n const [pageHeader, setPageHeader] = React.useState([]);\r\n const timeoutIdRef = React.useRef(null);\r\n\r\n const DueDate = encryptSession.getItem(\"DueDate\");\r\n\r\n React.useEffect(() => {\r\n handleActivity();\r\n const mouseMoveHandler = () => handleActivity();\r\n const keyDownHandler = () => handleActivity();\r\n\r\n window.addEventListener(\"mousemove\", mouseMoveHandler);\r\n window.addEventListener(\"keydown\", keyDownHandler);\r\n\r\n return () => {\r\n clearTimeout(timeoutIdRef.current);\r\n clearTimeout(warningTimeoutIdRef.current);\r\n window.removeEventListener(\"mousemove\", mouseMoveHandler);\r\n window.removeEventListener(\"keydown\", keyDownHandler);\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n\r\n var domain1 = window.location.href.split(\"/\");\r\n React.useEffect(() => {\r\n const newPageHeader = NavBar.filter(\r\n (el) =>\r\n el.id.toLocaleLowerCase() ===\r\n domain1[domain1.length - 2].toLocaleLowerCase()\r\n );\r\n setPageHeader(newPageHeader);\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [window.location.href]);\r\n\r\n function handleTabs(tab) {\r\n history.push(`/${tab.url}`);\r\n }\r\n\r\n const logout = async () => {\r\n const cacheKeys = await caches.keys();\r\n cacheKeys.forEach(async (key) => {\r\n await caches.delete(key);\r\n });\r\n sessionStorage.clear();\r\n history.push(\"/\");\r\n window.location.reload();\r\n setShowWarning(false); // Close the modal when logout is initiated\r\n };\r\n\r\n const user = encryptSession.getItem(\"usn\");\r\n const customer = encryptSession.getItem(\"cn\");\r\n\r\n const { context, setContext, VendorImage, locd, setLocd } =\r\n React.useContext(AppContext);\r\n\r\n const [email, setEmail] = React.useState(false);\r\n const [phone, setPhone] = React.useState(false);\r\n const [file, setFile] = React.useState(null);\r\n const [showWarning, setShowWarning] = React.useState(false);\r\n const warningTimeoutIdRef = React.useRef(null);\r\n const componentRef = React.useRef();\r\n\r\n const storedValues = JSON.parse(localStorage.getItem(\"values\"));\r\n\r\n const handleActivity = React.useCallback(() => {\r\n if (window.location.hostname !== \"localhost\" && user) {\r\n clearTimeout(timeoutIdRef.current);\r\n clearTimeout(warningTimeoutIdRef.current);\r\n \r\n warningTimeoutIdRef.current = setTimeout(() => {\r\n setShowWarning(true);\r\n }, 14 * 60 * 1000); // 14 minutes for warning\r\n\r\n timeoutIdRef.current = setTimeout(() => {\r\n if (!showWarning) setShowWarning(true); // If warning wasn't shown, show it now\r\n else logout();\r\n }, 15 * 60 * 1000); // 15 minutes for logout\r\n }\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n const handleReload = () => {\r\n console.log(\"Reloading window...\");\r\n window.location.reload();\r\n };\r\n\r\n if (context?.VendorID) {\r\n console.log(\"Adding event listener...\");\r\n window.addEventListener(\"reload\", handleReload);\r\n }\r\n\r\n return () => {\r\n console.log(\"Removing event listener...\");\r\n window.removeEventListener(\"reload\", handleReload);\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n\r\n React.useEffect(() => {\r\n if (!context.VendorID) {\r\n const firstObject = locations[0];\r\n\r\n setContext((prevContext) => ({\r\n ...prevContext,\r\n selectedYear: new Date().getFullYear(),\r\n selectedMonth: new Date().getMonth() + 1,\r\n TradingName: encryptSession.getItem(\"cn\"),\r\n VendorID: encryptSession.getItem(\"ci\"),\r\n ImageID: VendorImage,\r\n ref: componentRef,\r\n locd: locd,\r\n VendorLocationID:\r\n storedValues?.VendorLocationID || firstObject?.VendorLocationID,\r\n VendorLocationName:\r\n storedValues?.VendorLocationName || firstObject?.VendorLocationName,\r\n }));\r\n setLocd(initiallocd);\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [context?.VendorLocationName]);\r\n\r\n if (!storedValues && Array.isArray(locations) && locations.length > 0) {\r\n setContext({\r\n ...context,\r\n VendorLocationID: locations[0].VendorLocationID,\r\n VendorID: locations[0].VendorID,\r\n VendorLocationName: locations[0].VendorLocationName,\r\n ImageID: locations[0].ImageID,\r\n });\r\n }\r\n\r\n const exportToExcel = () => {\r\n const table = componentRef?.current?.querySelector(\"table\");\r\n\r\n if (table) {\r\n const worksheet = XLSX.utils.table_to_sheet(table);\r\n const workbook = XLSX.utils.book_new();\r\n const truncatedSheetName = context.reporttitle\r\n ? context.reporttitle?.substring(0, 31)\r\n : \"sheet1\";\r\n XLSX.utils.book_append_sheet(workbook, worksheet, truncatedSheetName);\r\n XLSX.writeFile(workbook, truncatedSheetName + \".xlsx\");\r\n }\r\n };\r\n\r\n const convertpf = () => {\r\n const byteCharacters = atob(file);\r\n const byteNumbers = new Array(byteCharacters.length);\r\n for (let i = 0; i < byteCharacters.length; i++) {\r\n byteNumbers[i] = byteCharacters.charCodeAt(i);\r\n }\r\n const byteArray = new Uint8Array(byteNumbers);\r\n const blob = new Blob([byteArray], { type: \"application/pdf\" });\r\n\r\n const url = URL.createObjectURL(blob);\r\n const a = document.createElement(\"a\");\r\n a.style.display = \"none\";\r\n a.href = url;\r\n a.download = context?.reporttitle || \"crato\";\r\n document.body.appendChild(a);\r\n a.click();\r\n window.URL.revokeObjectURL(url);\r\n document.body.removeChild(a);\r\n };\r\n\r\n const extractBase64Part = (fullBase64String) => {\r\n const base64Content = fullBase64String.split(\",\")[1];\r\n return base64Content;\r\n };\r\n\r\n const exportToPdf = async () => {\r\n await generatePDF();\r\n await new Promise((resolve) => setTimeout(resolve, 7000));\r\n await convertpf();\r\n };\r\n\r\n const generatePDF = async () => {\r\n const element = componentRef.current;\r\n const margin = 10; // Define the margin\r\n\r\n const options = {\r\n filename: `${context.reporttitle}.pdf`,\r\n html2canvas: {\r\n scale: 2,\r\n scrollX: 0,\r\n scrollY: 0,\r\n width: element?.scrollWidth + margin * 2, // Add margins\r\n height: element?.scrollHeight + margin * 2, // Add margins\r\n windowWidth: element?.scrollWidth + margin * 2, // Add margins\r\n windowHeight: element?.scrollHeight + margin * 2, // Add margins\r\n useCORS: true,\r\n },\r\n jsPDF: {\r\n unit: \"pt\",\r\n format: \"a4\",\r\n orientation: \"portrait\",\r\n },\r\n };\r\n\r\n const clonedElement = element?.cloneNode(true);\r\n document.body.appendChild(clonedElement);\r\n\r\n // Adjust styles to fit all content within the PDF including margins\r\n clonedElement.style.width = `${element.scrollWidth + margin * 2}px`;\r\n clonedElement.style.height = `${element.scrollHeight + margin * 2}px`;\r\n clonedElement.style.padding = `${margin}px`;\r\n\r\n // Calculate total height of cloned element\r\n const clonedHeight = clonedElement.offsetHeight;\r\n let currentPosition = 0;\r\n let pageHeight = 0;\r\n\r\n // Function to check if an element fits in the current page\r\n const fitsInCurrentPage = (elemHeight) => {\r\n return currentPosition + elemHeight <= pageHeight;\r\n };\r\n\r\n // Iterate through child elements and handle page breaks\r\n Array.from(clonedElement.children).forEach((child) => {\r\n const elemHeight = child.offsetHeight;\r\n\r\n if (!fitsInCurrentPage(elemHeight)) {\r\n currentPosition = 0;\r\n pageHeight = 0;\r\n child.classList.add(\"pagebreak\");\r\n }\r\n\r\n currentPosition += elemHeight;\r\n pageHeight = Math.max(pageHeight, clonedHeight);\r\n });\r\n\r\n // Add CSS for page breaks\r\n const style = document.createElement(\"style\");\r\n style.innerHTML = `\r\n @media print {\r\n .pagebreak {\r\n page-break-before: always;\r\n }\r\n }\r\n `;\r\n document.head.appendChild(style);\r\n\r\n html2pdf()\r\n .from(clonedElement)\r\n .set(options)\r\n .outputPdf(\"dataurlstring\")\r\n .then((pdfDataUrl) => {\r\n const base64data = extractBase64Part(pdfDataUrl);\r\n setFile(base64data);\r\n document.body.removeChild(clonedElement);\r\n document.head.removeChild(style); // Remove the style element\r\n })\r\n .catch((error) => {\r\n console.error(\"Error generating PDF:\", error);\r\n document.body.removeChild(clonedElement);\r\n document.head.removeChild(style); // Remove the style element\r\n });\r\n };\r\n\r\n const dueDate = new Date(DueDate);\r\n const currentDate = new Date();\r\n const isDueDateLessThan5Days =\r\n (dueDate - currentDate) / (1000 * 60 * 60 * 24) <= 5;\r\n\r\n const extendSession = () => {\r\n setShowWarning(false);\r\n handleActivity(); // This will reset both timers\r\n };\r\n\r\n \r\n return (\r\n \r\n {user && (\r\n \r\n \r\n {!props.isSidebarOpen ? (\r\n \r\n \r\n \r\n \r\n \r\n ) : null}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {!user ? (\r\n
Esque Kenya
\r\n ) : (\r\n \r\n {domain1[domain1.length - 2] === \"customer\"\r\n ? customer?.toLocaleUpperCase()\r\n : domain1[domain1.length - 2].toLocaleUpperCase()}\r\n \r\n )}\r\n
\r\n {isDueDateLessThan5Days && (\r\n \r\n \r\n \r\n )}\r\n\r\n {user && (\r\n <>\r\n \r\n {Location && (\r\n
\r\n \r\n
\r\n //
\r\n // \r\n //
\r\n )}\r\n
\r\n\r\n \r\n \r\n logout()}\r\n >\r\n \r\n \r\n \r\n \r\n \r\n )}\r\n {!user && (\r\n \r\n \r\n \r\n )}\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n (\r\n \r\n Print\r\n \r\n )}\r\n content={() => componentRef.current}\r\n pageStyle=\"@page { size: A4; margin: 0; } @media print { body { margin: 1cm; } }\"\r\n />\r\n exportToPdf()}\r\n >\r\n \r\n pdf\r\n \r\n exportToExcel()}\r\n >\r\n \r\n Excel\r\n \r\n {\r\n generatePDF();\r\n setEmail(!email);\r\n }}\r\n >\r\n \r\n email\r\n \r\n {\r\n generatePDF();\r\n setPhone(!phone);\r\n }}\r\n >\r\n \r\n phone\r\n \r\n \r\n \r\n \r\n )}\r\n {showWarning && }\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nHeader.propTypes = {\r\n onDrawerToggle: PropTypes.func.isRequired,\r\n};\r\n\r\nexport default Header;\r\n","export default __webpack_public_path__ + \"static/media/hero-img.417077fb.png\";","export default __webpack_public_path__ + \"static/media/bg_hero_1.7bcda4ed.svg\";","import React, { useContext, useEffect, useState } from \"react\";\r\nimport {\r\n encryptSession,\r\n ResetTwoFactoAuthentication,\r\n UserLogin,\r\n UserLoginCustomer,\r\n} from \"../../api\";\r\nimport { AppContext } from \"../../AppContext\";\r\nimport moment from \"moment\";\r\nimport { toast } from \"react-toastify\";\r\nimport { CircularProgress } from \"@material-ui/core\";\r\nimport { Visibility, VisibilityOff } from \"@material-ui/icons\";\r\nimport Forgot from \"../Password/Forgot\";\r\n\r\nvar firstDay = new Date(new Date().valueOf() - 1000 * 60 * 60 * 164);\r\nvar lastDay = new Date();\r\n\r\nconst tpy =\r\n localStorage.getItem(\"tpy\") !== null ? localStorage.getItem(\"tpy\") : 1;\r\n\r\nfunction SignUp() {\r\n const [isLoggedIn, setIsLoggedIn] = useState(false);\r\n const { context, setContext } = useContext(AppContext);\r\n const [values, setValues] = useState({ password: \"\", email: \"\" });\r\n const [twoFA, setTwoFA] = useState(0);\r\n const [isTwoFactorEnabled, setIsTwoFactorEnabled] = useState(false);\r\n const [twoFactorCode, setTwoFactorCode] = useState(\"\");\r\n const [isHovered, setIsHovered] = useState(false);\r\n const [showTwoFactorOptions, setShowTwoFactorOptions] = useState(false);\r\n const [showPassword, setShowPassword] = useState(false);\r\n const [type, setType] = useState(1);\r\n const [forgot, setForgot] = useState(false);\r\n\r\n const onSuccess = () => {\r\n setIsLoggedIn(true);\r\n };\r\n\r\n const {\r\n loading: assetloading,\r\n result,\r\n handleFormSubmit: HandleLogin,\r\n } = UserLogin({ ...values }, [onSuccess]);\r\n\r\n const {\r\n loading: customerloading,\r\n result: customerResult,\r\n handleFormSubmit: HandleCustomerLogin,\r\n } = UserLoginCustomer({ ...values }, [onSuccess]);\r\n\r\n useEffect(() => {\r\n setIsTwoFactorEnabled(+result?.TwoFA === 1);\r\n setTwoFA(+result?.TwoFA);\r\n }, [result]);\r\n\r\n useEffect(() => {\r\n const storedType = localStorage.getItem(\"tpy\");\r\n if (storedType) {\r\n setType(storedType);\r\n }\r\n }, []);\r\n\r\n function SetDefaultRange(locations) {\r\n encryptSession.setItem(\"cn\", locations[0].TradingName);\r\n encryptSession.setItem(\"sl\", locations[0].Slogan);\r\n encryptSession.setItem(\"cim\", locations[0].ImageID);\r\n encryptSession.setItem(\"locd\", locations[0]);\r\n setContext({\r\n ...context,\r\n VendorName: locations[0]?.TradingName,\r\n VendorImage: locations[0]?.ImageID,\r\n VendorLocationID: locations[0]?.VendorLocationID,\r\n VendorID: locations[0]?.VendorID,\r\n VendorStatusID: locations[0]?.VendorStatusID,\r\n });\r\n localStorage.setItem(\r\n \"values\",\r\n JSON.stringify({\r\n VendorLocationID: locations[0].VendorLocationID,\r\n VendorLocationName: locations[0].VendorLocationName,\r\n DateRange: [firstDay, lastDay],\r\n startDate: moment(firstDay).format(\"YYYY-MM-DD\"),\r\n endDate: moment(lastDay).format(\"YYYY-MM-DD\"),\r\n })\r\n );\r\n }\r\n\r\n const handleLogin = (e) => {\r\n e.preventDefault();\r\n if (+type === 1) {\r\n HandleLogin();\r\n setShowTwoFactorOptions(true);\r\n } else {\r\n HandleCustomerLogin();\r\n }\r\n };\r\n\r\n function decodePasscode(encodedPasscode) {\r\n const decodedPasscode = atob(encodedPasscode);\r\n return decodedPasscode;\r\n }\r\n\r\n useEffect(() => {\r\n if (customerResult) {\r\n handleCustomerLoginSuccess();\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [customerResult]);\r\n\r\n const handleTwoFactorSubmit = async (e) => {\r\n e.preventDefault();\r\n\r\n const decodedPasscode = decodePasscode(result?.TwoFACode);\r\n if (decodedPasscode?.toLowerCase() === twoFactorCode?.toLowerCase()) {\r\n if (twoFA !== result?.TwoFA) {\r\n HandleResetTwoFA();\r\n } else {\r\n handleLoginSuccess();\r\n }\r\n } else {\r\n toast.error(\"The code does not match, please retry\");\r\n }\r\n };\r\n\r\n const handleCustomerLoginSuccess = () => {\r\n encryptSession.setItem(\"tk\", customerResult.UserToken);\r\n encryptSession.setItem(\"us\", customerResult.UserID);\r\n encryptSession.setItem(\"cn\", customerResult.CustomerName);\r\n encryptSession.setItem(\"vcn\", customerResult.CustomerName);\r\n encryptSession.setItem(\"cid\", customerResult.CustomerID);\r\n encryptSession.setItem(\r\n \"loc\",\r\n JSON.stringify([\r\n {\r\n VendorLocationID: customerResult?.VendorLocationID,\r\n StatusID: 1,\r\n TradingName: customerResult.TradingName,\r\n ContactEmail: customerResult.ContactEmail,\r\n ImageID: customerResult.ImageID,\r\n VendorLocationName: customerResult.VendorLocationName,\r\n VendorLocationPhone: customerResult.VendorLocationPhone,\r\n },\r\n ])\r\n );\r\n SetDefaultRange([\r\n {\r\n VendorLocationID: customerResult.VendorLocationID,\r\n StatusID: 1,\r\n TradingName: customerResult.TradingName,\r\n ContactEmail: customerResult.ContactEmail,\r\n ImageID: customerResult.ImageID,\r\n VendorLocationName: customerResult.VendorLocationName,\r\n VendorLocationPhone: customerResult.VendorLocationPhone,\r\n },\r\n ]);\r\n encryptSession.setItem(\"ust\", customerResult.UserTypeID);\r\n // api.encryptSession.setItem(\"cim\", data.UserImageID);\r\n encryptSession.setItem(\"usn\", customerResult.FirstName);\r\n encryptSession.setItem(\"phn\", customerResult.PhoneNumber);\r\n encryptSession.setItem(\"u\", customerResult);\r\n localStorage.setItem(\"tpy\", 0);\r\n localStorage.setItem(\"index\", 0);\r\n window.location.href = \"/customer/dashboard\";\r\n };\r\n\r\n const handleLoginSuccess = () => {\r\n localStorage.setItem(\"profile\", result.UserID);\r\n encryptSession.setItem(\"tk\", result.UserToken);\r\n encryptSession.setItem(\"us\", result.UserID);\r\n encryptSession.setItem(\"ci\", result.VendorID);\r\n encryptSession.setItem(\"pi\", result.VendorParentID);\r\n encryptSession.setItem(\"ust\", result.UserTypeID);\r\n encryptSession.setItem(\"usn\", result.FirstName);\r\n encryptSession.setItem(\"phn\", result.PhoneNumber);\r\n encryptSession.setItem(\"loc\", result.AssignedStationArray);\r\n encryptSession.setItem(\"DueDate\", result.DueDate);\r\n encryptSession.setItem(\"InvoiceNO\", result.InvoiceNO);\r\n encryptSession.setItem(\"InvoiceAmount\", result.InvoiceAmount);\r\n SetDefaultRange(result.AssignedStationArray);\r\n encryptSession.setItem(\"u\", result);\r\n encryptSession.setItem(\"type\", result.VendorTypeID);\r\n encryptSession.setItem(\"pro\", result.VendorCratoProductArray);\r\n //VendorCratoProductArray\r\n localStorage.setItem(\"tpy\", 1);\r\n localStorage.setItem(\"index\", 0);\r\n window.location.href =\r\n //result.VendorCratoProductArray.legnth === 1 &&\r\n result.VendorCratoProductArray[0]?.CratoProductID === 2\r\n ? \"/loyalty/dashboard\"\r\n : \"/dashboard/dashboard\";\r\n };\r\n\r\n const handleContinue = async () => {\r\n try {\r\n if (twoFA !== result?.TwoFA) {\r\n HandleResetTwoFA();\r\n } else {\r\n toast.info(\"Proceeded without two-factor authentication\");\r\n handleLoginSuccess();\r\n }\r\n } catch (error) {\r\n toast.error(error);\r\n }\r\n };\r\n\r\n const { loading: resetloading, handleFormSubmit: HandleResetTwoFA } =\r\n ResetTwoFactoAuthentication({ twoFA: twoFA, UserID: result?.UserID }, [\r\n handleLoginSuccess,\r\n ]);\r\n\r\n const togglePasswordVisibility = () => {\r\n setShowPassword(!showPassword);\r\n };\r\n\r\n useEffect(() => {\r\n if (result) {\r\n encryptSession.setItem(\"ci\", result?.VendorID);\r\n encryptSession.setItem(\r\n \"invoice\",\r\n JSON.stringify({\r\n DueDate: result.DueDate,\r\n InvoiceNO: result.InvoiceNO,\r\n InvoiceAmount: result.InvoiceAmount,\r\n })\r\n );\r\n if (+result?.VendorStatusID === 2 && result?.VendorID !== 134) {\r\n window.location.href = \"/suspended\";\r\n }\r\n }\r\n }, [result]);\r\n\r\n const styles = {\r\n body: {\r\n backgroundColor: \"#2c3d4e\",\r\n color: \"#7fa7ba\",\r\n fontFamily: \"Helvetica Neue, sans-serif\",\r\n fontWeight: 300,\r\n fontSize: \"1rem\",\r\n lineHeight: 1.5,\r\n margin: 0,\r\n minHeight: \"100vh\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n },\r\n grid: {\r\n maxWidth: \"25rem\",\r\n width: \"100%\",\r\n margin: \"0 auto\",\r\n },\r\n register: {\r\n boxShadow: \"0 0 250px #000\",\r\n textAlign: \"center\",\r\n padding: \"4rem 2rem\",\r\n backgroundColor: \"#2c3d4e\",\r\n borderRadius: \"10px\",\r\n },\r\n formField: {\r\n marginBottom: \"1rem\",\r\n position: \"relative\",\r\n },\r\n input: {\r\n border: \"1px solid #44dc94\",\r\n borderRadius: \"999px\",\r\n backgroundColor: \"transparent\",\r\n textAlign: \"center\",\r\n padding: \".5rem 1rem\",\r\n width: \"100%\",\r\n outline: \"0\",\r\n color: \"#FFFFFF\",\r\n },\r\n passwordInput: {\r\n backgroundImage: \"url(data:image/svg+xml;base64,...)\",\r\n backgroundRepeat: \"no-repeat\",\r\n backgroundSize: \"1.5rem\",\r\n backgroundPosition: \"1rem 50%\",\r\n },\r\n toggleIcon: {\r\n position: \"absolute\",\r\n right: \"10px\",\r\n top: \"50%\",\r\n transform: \"translateY(-50%)\",\r\n cursor: \"pointer\",\r\n color: \"#7fa7ba\",\r\n },\r\n forgotPasswordLink: {\r\n color: \"#7fa7ba\",\r\n textDecoration: \"none\",\r\n fontSize: \"0.875rem\",\r\n },\r\n submitButton: {\r\n backgroundColor: isHovered ? \"#37b379\" : \"#44dc94\",\r\n color: \"#2c3d4e\",\r\n border: \"none\",\r\n borderRadius: \"25px\",\r\n padding: \"0.75rem 1.5rem\",\r\n fontSize: \"1.25rem\",\r\n fontWeight: 600,\r\n cursor: \"pointer\",\r\n transition: \"background-color 0.3s ease\",\r\n marginBottom: \"1rem\",\r\n width: \"100%\",\r\n textTransform: \"uppercase\",\r\n },\r\n checkboxContainer: {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n margin: \"1rem auto\",\r\n justifyContent: \"space-between\",\r\n width: \"80%\",\r\n },\r\n customCheckboxGroup: {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n },\r\n customCheckbox: {\r\n display: \"none\", // Hide the checkbox input\r\n },\r\n tickIcon: {\r\n width: \"1rem\",\r\n height: \"1rem\",\r\n border: \"2px solid #44dc94\",\r\n borderRadius: \"4px\",\r\n backgroundColor: \"transparent\",\r\n cursor: \"pointer\",\r\n position: \"relative\",\r\n display: \"inline-block\",\r\n marginRight: \"0.5rem\", // Spacing between tick icon and label\r\n transition: \"background-color 0.3s, border-color 0.3s\",\r\n },\r\n checked: {\r\n backgroundColor: \"#44dc94\", // Background color when checked\r\n },\r\n label: {\r\n color: \"#7fa7ba\",\r\n fontSize: \"1rem\",\r\n lineHeight: 1.5,\r\n marginLeft: \"0.5rem\", // Space between tick icon and label\r\n },\r\n tick: {\r\n position: \"absolute\",\r\n top: \"50%\",\r\n left: \"50%\",\r\n transform: \"translate(-50%, -50%)\",\r\n color: \"#fff\",\r\n display: \"none\",\r\n },\r\n tickVisible: {\r\n display: \"block\", // Show tick icon when checked\r\n },\r\n };\r\n\r\n return (\r\n
\r\n
\r\n {forgot ? (\r\n \r\n ) : (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n

Sign In

\r\n\r\n {!isLoggedIn ? (\r\n
\r\n
\r\n \r\n setValues({ ...values, email: e.target.value })\r\n }\r\n type=\"text\"\r\n placeholder=\"0700000000\"\r\n style={{ ...styles.input, ...styles.emailInput }}\r\n />\r\n
\r\n\r\n
\r\n \r\n setValues({ ...values, password: e.target.value })\r\n }\r\n type={showPassword ? \"text\" : \"password\"}\r\n placeholder=\"••••••••••••\"\r\n style={{ ...styles.input, ...styles.passwordInput }}\r\n />\r\n \r\n {showPassword ? : }\r\n \r\n
\r\n
\r\n
\r\n setType(1)} // Set type to 1 on clicking the icon\r\n >\r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n setType(0)} // Set type to 0 on clicking the icon\r\n >\r\n \r\n \r\n \r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n setForgot(!forgot)} // Toggle forgot password view\r\n style={{\r\n ...styles.forgotPasswordLink, // Apply same link style\r\n cursor: \"pointer\", // Make it clickable\r\n }}\r\n >\r\n Forgot Password?\r\n
\r\n
\r\n\r\n
\r\n {assetloading || customerloading ? (\r\n \r\n ) : (\r\n setIsHovered(true)}\r\n onMouseLeave={() => setIsHovered(false)}\r\n />\r\n )}\r\n
\r\n \r\n ) : (\r\n <>\r\n {showTwoFactorOptions && (\r\n
\r\n
\r\n {\r\n setIsTwoFactorEnabled(!isTwoFactorEnabled);\r\n setTwoFA(!twoFA);\r\n }}\r\n />\r\n \r\n Enable Two-Factor Authentication\r\n \r\n
\r\n

\r\n This will require you to use a one-time passcode sent to\r\n your{\" \"}\r\n WhatsApp and{\" \"}\r\n Email every\r\n time you log in to authenticate you signing in.\r\n

\r\n\r\n {result?.TwoFA === 1 && (\r\n
\r\n
\r\n setTwoFactorCode(e.target.value)}\r\n style={styles.input}\r\n />\r\n
\r\n\r\n
\r\n {resetloading ? (\r\n \r\n ) : (\r\n setIsHovered(true)}\r\n onMouseLeave={() => setIsHovered(false)}\r\n />\r\n )}\r\n
\r\n
\r\n )}\r\n {result?.TwoFA !== 1 && (\r\n
\r\n \r\n SKIP 2FA\r\n \r\n
\r\n )}\r\n
\r\n )}\r\n \r\n )}\r\n\r\n {!isLoggedIn && (\r\n

\r\n Already have an account?{\" \"}\r\n \r\n Sign up\r\n \r\n

\r\n )}\r\n \r\n )}\r\n \r\n \r\n );\r\n}\r\n\r\nexport default SignUp;\r\n","import \"react-toastify/dist/ReactToastify.css\";\r\nimport Home from \"./components/Home/Home\";\r\nimport Login from \"./components/Login/Login\";\r\nimport { lazy } from \"react\";\r\n\r\nconst InvoiceDetails = lazy(() =>\r\n import(\"./components/InvoiceDetails/InvoiceDetails\")\r\n);\r\n// const Login = lazy(() => import(\"./components/Login/Login\"));\r\nconst SignUp = lazy(() => import(\"./components/Login/SignUp\"));\r\nconst Dashboard = lazy(() => import(\"./components/Dashboard\"));\r\nconst Forgot = lazy(() => import(\"./components/Password/Forgot\"));\r\nconst Reset = lazy(() => import(\"./components/Password/Reset\"));\r\n// Settings\r\nconst Pump = lazy(() => import(\"./components/Settings/Pump\"));\r\nconst Nozzle = lazy(() => import(\"./components/Settings/Nozzle\"));\r\nconst Location = lazy(() => import(\"./components/Settings/Location\"));\r\nconst Download = lazy(() =>\r\n import(\"./components/Settings/DownLoads/Downloads\")\r\n);\r\nconst Help = lazy(() => import(\"./components/Settings/Help/index\"));\r\nconst Profile = lazy(() => import(\"./components/Settings/Settings\"));\r\nconst Billing = lazy(() => import(\"./components/Settings/Billing/index\"));\r\nconst AuditLog = lazy(() =>\r\n import(\"./components/Settings/AuditLogs/AuditTrail\")\r\n);\r\nconst Manual = lazy(() => import(\"./components/Settings/Manual/Manual\"));\r\n//stock\r\nconst StockReport = lazy(() => import(\"./components/Stock/Report\"));\r\nconst StockAction = lazy(() => import(\"./components/Stock/StockAction\"));\r\nconst Purchase = lazy(() => import(\"./components/Stock/Purchase\"));\r\nconst Inventory = lazy(() => import(\"./components/Stock/Inventory\"));\r\nconst Supplier = lazy(() => import(\"./components/Stock/Supplier/Suppliers\"));\r\nconst Offloading = lazy(() =>\r\n import(\"./components/Stock/PurchaseDetails/Offloading\")\r\n);\r\n//sales\r\nconst SaleHistory = lazy(() => import(\"./components/Invoice/SalesReport\"));\r\nconst SalesDashboard = lazy(() =>\r\n import(\"./components/Invoice/SalesDashboard\")\r\n);\r\nconst ClientList = lazy(() => import(\"./components/Invoice/ClientList\"));\r\n//Admin\r\nconst ClockManagement = lazy(() =>\r\n import(\"./components/Admin/ClockManagement\")\r\n);\r\nconst Error = lazy(() => import(\"./components/common/error\"));\r\nconst ShiftSummary = lazy(() =>\r\n import(\"./components/Admin/LotSummary/ShiftSummary/index\")\r\n);\r\n// AdminReports\r\n\r\n// Finance\r\nconst Statement = lazy(() => import(\"./components/Finance/Statement\"));\r\nconst Expense = lazy(() => import(\"./components/Finance/Expense\"));\r\nconst Transfer = lazy(() =>\r\n import(\"./components/Finance/FinanceDash/MainDashboard\")\r\n);\r\nconst Payroll = lazy(() => import(\"./components/Finance/payrollsheet/Payroll\"));\r\nconst Tax = lazy(() => import(\"./components/Finance/Tax/Tax\"));\r\n//CustomerPage\r\nconst CustomerDash = lazy(() =>\r\n import(\"./components/CustomerPortal/dashboard\")\r\n);\r\n//Consilidated\r\nconst ConDashboard = lazy(() =>\r\n import(\"./components/Consolidated/Consolidated\")\r\n);\r\nconst LotSummary = lazy(() => import(\"./components/Admin/LotSummary\"));\r\nconst DaillySummary = lazy(() =>\r\n import(\"./components/Admin/DailyShiftSummary\")\r\n);\r\n//DIstributor\r\nconst DistributionDashboard = lazy(() =>\r\n import(\"./components/Distribution/DashBoard/index\")\r\n);\r\n//LoyaltyCards\r\nconst LoyaltyCardDashboard = lazy(() =>\r\n import(\"./components/LoyaltyCard/DashBoard/index\")\r\n);\r\nconst LoyaltyCustomers = lazy(() =>\r\n import(\"./components/LoyaltyCard/Customers/Customers\")\r\n);\r\n\r\nconst VendorCards = lazy(() =>\r\n import(\"./components/LoyaltyCard/Cards/Cards\")\r\n);\r\n\r\nconst LoyaltySettings = lazy(() =>\r\n import(\"./components/LoyaltyCard/Settings/Setting\")\r\n);\r\nconst LoyaltyProduct = lazy(() =>\r\n import(\"./components/LoyaltyCard/Product/Product\")\r\n);\r\nconst LoyaltyRewards = lazy(() =>\r\n import(\"./components/LoyaltyCard/Report/Rewards\")\r\n);\r\nconst LoyaltyRedeems = lazy(() =>\r\n import(\"./components/LoyaltyCard/Report/Redeems\")\r\n);\r\n//FUEL CARD\r\nconst FuelCardCardDashboard = lazy(() =>\r\n import(\"./components/FuelCard/DashBoard\")\r\n);\r\nconst FuelCardCards = lazy(() => import(\"./components/FuelCard/VendorCard\"));\r\nconst FuelCardTransactionCards = lazy(() =>\r\n import(\"./components/FuelCard/Transactions\")\r\n);\r\nconst FuelCardCustomerCards = lazy(() =>\r\n import(\"./components/FuelCard/Customer\")\r\n);\r\n//Distributor\r\nconst DistributionOrders = lazy(() =>\r\n import(\"./components/Distribution/Orders/Orders\")\r\n);\r\nconst DistributionPurchase = lazy(() =>\r\n import(\"./components/Distribution/Stock/Purchase\")\r\n);\r\nconst DistributionVehicle = lazy(() =>\r\n import(\"./components/Distribution/Vehicle/Vehicle\")\r\n);\r\n//ticketing\r\nconst ViewTicket = lazy(() => import(\"./components/Ticketing/ViewTickets \"));\r\n//general\r\nconst PrivacyPolicy = lazy(() => import(\"./api/privacypolicy\"));\r\nconst VendorContract = lazy(() => import(\"./VendorContract\"));\r\nconst Suspenstion = lazy(() => import(\"./Suspension\"));\r\n\r\n//Automation\r\nconst AutomationDashBoard = lazy(() =>\r\n import(\"./components/Automation/Dashboard\")\r\n);\r\n\r\n//crm\r\nconst CRM = lazy(() =>\r\n import(\"./components/CRM/crm\")\r\n);\r\nexport const route = [\r\n { path: \"/\", layout: \"public\", component: Home },\r\n { path: \"/invoice/:id\", component: InvoiceDetails },\r\n { path: \"/privacypolicy\", component: PrivacyPolicy },\r\n { path: \"/contract\", component: VendorContract },\r\n { path: \"/suspended\", component: Suspenstion },\r\n { path: \"/login\", layout: \"public\", component: Login },\r\n { path: \"/signup\", component: SignUp },\r\n { path: \"/dashboard/dashboard\", component: Dashboard },\r\n { path: \"/customers\", component: ClientList },\r\n { path: \"/forgot\", component: Forgot },\r\n { path: \"/reset/:token\", component: Reset },\r\n { path: \"/profile/profile\", component: Profile },\r\n { path: \"/settings/pump\", component: Pump },\r\n { path: \"/settings/nozzle\", component: Nozzle },\r\n { path: \"/settings/billing\", component: Billing },\r\n { path: \"/settings/download\", component: Download },\r\n { path: \"/settings/auditlogs\", component: AuditLog },\r\n { path: \"/settings/manual\", component: Manual },\r\n { path: \"/location/location\", component: Location },\r\n { path: \"/help/help\", component: Help },\r\n { path: \"/sales/saledash\", component: SalesDashboard },\r\n { path: \"/sales/history\", component: SaleHistory },\r\n { path: \"/sales/customer\", component: ClientList },\r\n { path: \"/sales/invoice/history\", component: InvoiceDetails },\r\n { path: \"/inventory/report\", component: StockReport },\r\n { path: \"/inventory/action\", component: StockAction },\r\n { path: \"/inventory/purchase\", component: Purchase },\r\n { path: \"/inventory/offloading\", component: Offloading },\r\n { path: \"/inventory/inventory\", component: Inventory },\r\n { path: \"/inventory/supplier\", component: Supplier },\r\n { path: \"/finance/statement\", component: Statement },\r\n { path: \"/finance/transfer\", component: Transfer },\r\n { path: \"/finance/tax\", component: Tax },\r\n { path: \"/finance/expense\", component: Expense },\r\n { path: \"/finance/payroll\", component: Payroll },\r\n { path: \"/shift/clock\", component: ClockManagement },\r\n { path: \"/lotsummary\", component: LotSummary },\r\n { path: \"/error\", component: Error },\r\n { path: \"/shift/ShiftRecon\", component: ShiftSummary },\r\n { path: \"/shift/DailySummary\", component: DaillySummary },\r\n { path: \"/customer/dashboard\", component: CustomerDash },\r\n { path: \"/consolidated/dashboard\", component: ConDashboard },\r\n { path: \"/distribution/dashboard\", component: DistributionDashboard },\r\n { path: \"/distribution/orders\", component: DistributionOrders },\r\n { path: \"/distribution/purchase\", component: DistributionPurchase },\r\n { path: \"/distribution/vehicle\", component: DistributionVehicle },\r\n { path: \"/loyalty/dashboard\", component: LoyaltyCardDashboard },\r\n { path: \"/loyalty/customers\", component: LoyaltyCustomers },\r\n { path: \"/loyalty/cards\", component: VendorCards },\r\n { path: \"/loyalty/invoice\", component: ClientList },\r\n { path: \"/loyalty/settings\", component: LoyaltySettings },\r\n { path: \"/loyalty/product\", component: LoyaltyProduct },\r\n { path: \"/loyalty/rewards\", component: LoyaltyRewards },\r\n { path: \"/loyalty/redeems\", component: LoyaltyRedeems },\r\n { path: \"/fuelcard/dashboard\", component: FuelCardCardDashboard },\r\n { path: \"/fuelcard/cards\", component: FuelCardCards },\r\n { path: \"/fuelcard/transactions\", component: FuelCardTransactionCards },\r\n { path: \"/fuelcard/customers\", component: FuelCardCustomerCards },\r\n { path: \"/ticketing/viewtickets\", component: ViewTicket },\r\n { path: \"/ticketing/viewtickets\", component: ViewTicket },\r\n { path: \"/automation/automation\", component: AutomationDashBoard },\r\n { path: \"/crm/dashboard\", component: CRM },\r\n];\r\n","import \"./assets/css/style.css\";\r\nimport \"./assets/css/bootstrap.css\";\r\n//background images\r\nimport homepage from \"./assets/img/hero-img.png\";\r\nimport Background from \"./assets/img/bg_hero_1.svg\";\r\nimport Typical from \"react-typical\";\r\n\r\nexport default function Home() {\r\n return (\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n We help to {\"\"}\r\n \r\n
\r\n
\r\n

\r\n NO 1, Fuel Stations Solution in Africa today\r\n

\r\n

\r\n Use crato to automate your fuel station operations
\r\n and minimize your chances of getting loses.\r\n

\r\n \r\n Get Started Now\r\n \r\n \r\n Learn more\r\n \r\n
\r\n
\r\n
\r\n \"\"\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n );\r\n}\r\n","import Spinner from \"../Spinner/Spinner\";\r\n\r\nexport const LoadingSpinner = () => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n","const typography = {\r\n fontFamily: \"'Poppins', sans-serif\",\r\n body1: {\r\n fontWeight:400 // or 'bold'\r\n },\r\n h1: {\r\n fontWeight:500,\r\n fontSize: 35,\r\n letterSpacing: '-0.24px'\r\n },\r\n h2: {\r\n fontWeight:500,\r\n fontSize: 29,\r\n letterSpacing: '-0.24px'\r\n },\r\n h3: {\r\n fontWeight:500,\r\n fontSize: 24,\r\n letterSpacing: '-0.06px'\r\n },\r\n h4: {\r\n fontWeight:500,\r\n fontSize: 20,\r\n letterSpacing: '-0.06px'\r\n },\r\n h5: {\r\n fontWeight:500,\r\n fontSize: 16,\r\n letterSpacing: '-0.05px'\r\n },\r\n h6: {\r\n fontWeight:500,\r\n fontSize: 14,\r\n letterSpacing: '-0.05px'\r\n }\r\n};\r\n\r\nexport default typography;","import { createTheme } from \"@material-ui/core\";\r\nimport typography from \"./Typography\";\r\n\r\n// ##############################\r\n// // // Global Variables\r\n// ##############################\r\nconst defaultTheme = createTheme();\r\n\r\nconst theme = createTheme({\r\n direction: \"ltr\",\r\n palette: {\r\n primary: {\r\n main: \"#0b70fb\",\r\n },\r\n secondary: {\r\n main: \"#f64e60\",\r\n },\r\n },\r\n status: {\r\n danger: \"#e53e3e\",\r\n },\r\n overrides: {\r\n MuiToolbar: {\r\n gutters: {\r\n [defaultTheme.breakpoints.up(\"sm\")]: {\r\n paddingLeft: \"15px\",\r\n paddingRight: \"15px\",\r\n },\r\n },\r\n },\r\n },\r\n typography,\r\n});\r\nconst SidebarWidth = 245;\r\nconst primaryColor = \"#9c27b0\";\r\nconst warningColor = \"#ff9800\";\r\nconst dangerColor = \"#f44336\";\r\nconst successColor = \"#26c6da\";\r\nconst infoColor = \"#6ac3fd\";\r\n\r\nexport {\r\n theme,\r\n primaryColor,\r\n SidebarWidth,\r\n warningColor,\r\n dangerColor,\r\n successColor,\r\n infoColor,\r\n};\r\n","import React from \"react\";\r\nimport {\r\n Button,\r\n ListItem,\r\n makeStyles,\r\n ListItemIcon,\r\n ListItemText,\r\n} from \"@material-ui/core\";\r\nimport { NavLink } from \"react-router-dom\";\r\n\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n icon: {\r\n marginRight: theme.spacing(1),\r\n marginLeft: theme.spacing(1),\r\n minWidth: \"auto\",\r\n },\r\n item: {\r\n display: \"flex\",\r\n paddingTop: 0,\r\n paddingBottom: 5,\r\n },\r\n title: {\r\n marginRight: \"auto\",\r\n fontWeight: \"400\",\r\n },\r\n \r\n active: {\r\n backgroundColor: \"#2c3d4e\",\r\n \"&:hover\": {\r\n backgroundColor: \"#44dc94\",\r\n },\r\n \"& $title\": {\r\n color: \"white\",\r\n },\r\n \"& $icon\": {\r\n color: \"white\",\r\n },\r\n },\r\n button: {\r\n color: theme.palette.text.secondary,\r\n fontWeight: theme.typography.fontWeightMedium,\r\n justifyContent: \"flex-start\",\r\n letterSpacing: 0,\r\n padding: \"7px 6px\",\r\n textTransform: \"none\",\r\n width: \"100%\",\r\n },\r\n}));\r\n\r\nconst Navitems = ({ className, href, icon: Icon, title, ...rest }) => {\r\n const classes = useStyles();\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {title}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default Navitems;\r\n","import {\r\n MonetizationOn,\r\n HomeTwoTone,\r\n ProductionQuantityLimits,\r\n ShoppingBag,\r\n Summarize,\r\n Business,\r\n AutoModeOutlined,\r\n} from \"@mui/icons-material\";\r\n\r\nconst Menuitems = [\r\n {\r\n href: \"/dashboard/dashboard\",\r\n icon: HomeTwoTone,\r\n title: \"DASHBOARD\",\r\n type: [1],\r\n },\r\n {\r\n href: \"/sales/customer\",\r\n icon: ShoppingBag,\r\n title: \"SALES\",\r\n type: [1],\r\n },\r\n {\r\n href: \"/inventory/report\",\r\n icon: ProductionQuantityLimits,\r\n title: \"INVENTORY\",\r\n type: [1],\r\n },\r\n {\r\n href: \"/finance/statement\",\r\n icon: MonetizationOn,\r\n title: \"FINANCE\",\r\n type: [1],\r\n },\r\n {\r\n href: \"/shift/clock\",\r\n icon: Summarize,\r\n title: \"SHIFT ADMIN\",\r\n type: [1],\r\n },\r\n {\r\n href: \"/consolidated/dashboard\",\r\n icon: Business,\r\n title: \"SUMMARY\",\r\n type: [1],\r\n },\r\n {\r\n href: \"/automation/automation\",\r\n icon: AutoModeOutlined,\r\n title: \"AUTOMATION\",\r\n type: [4, 5, 7, 8],\r\n },\r\n];\r\n\r\nexport default Menuitems;\r\n","export default __webpack_public_path__ + \"static/media/admin.fc97a290.jpg\";","import React, { useContext, useState } from \"react\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { NavLink } from \"react-router-dom\";\r\nimport {\r\n Avatar,\r\n Box,\r\n Typography,\r\n makeStyles,\r\n Menu,\r\n MenuItem,\r\n} from \"@material-ui/core\";\r\nimport ExpandMoreIcon from \"@material-ui/icons/ExpandMore\";\r\n// import uimage from \"../../assets/sidebar/images/users/user_1.png\";\r\nimport bgprofile from \"../../assets/sidebar/images/backgrounds/admin.jpg\";\r\nimport { Hidden, IconButton } from \"@mui/material\";\r\nimport {\r\n Close,\r\n Download,\r\n LogoutOutlined,\r\n Loyalty,\r\n PaymentsRounded,\r\n} from \"@mui/icons-material\";\r\nimport { AppContext } from \"../../AppContext\";\r\nimport { Message, Settings } from \"@material-ui/icons\";\r\nimport {\r\n IconDatabase,\r\n IconManualGearbox,\r\n IconSportBillard,\r\n} from \"@tabler/icons\";\r\nimport { encryptSession } from \"../../api\";\r\nimport { VendorProductCheck } from \"../common/Functions\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n piclarge: {\r\n width: theme.spacing(6),\r\n height: theme.spacing(6),\r\n },\r\n profileBg: {\r\n backgroundImage: `url(${bgprofile})`,\r\n backgroundPosition: \"center\",\r\n backgroundSize: \"cover\",\r\n backgroundRepeat: \"no-repeat\",\r\n },\r\n profileTextBg: {\r\n cursor: \"pointer\",\r\n backgroundColor: \"rgba(0, 0, 0,0.5)\",\r\n padding: \"5px 10px\",\r\n display: \"flex\",\r\n },\r\n menuitem: {\r\n width: 200,\r\n border: \"1px solid #ccc\",\r\n margin: \"4px\",\r\n borderRadius: \"10px\",\r\n minWidth: \"200px\",\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"flex-start\",\r\n padding: \"8px\",\r\n },\r\n}));\r\n\r\nconst type = +encryptSession.getItem(\"type\");\r\n\r\nconst Profile = (props) => {\r\n const { context, VendorImage } = useContext(AppContext);\r\n const vendorName = context.VendorName;\r\n const history = useHistory();\r\n const classes = useStyles();\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n\r\n const userProfile = {\r\n avatar: `https://api.crato.co.ke/api/File/VendorImage?ImageID=${VendorImage}`,\r\n jobTitle: \"Senior Developer\",\r\n name:\r\n vendorName?.length <= 15\r\n ? vendorName?.toUpperCase()\r\n : vendorName?.slice(0, 15).toUpperCase() + \"...\",\r\n href: \"/\",\r\n };\r\n\r\n const handleClick = (event) => {\r\n setAnchorEl(event.currentTarget);\r\n };\r\n\r\n const handleClose = () => {\r\n setAnchorEl(null);\r\n };\r\n\r\n const logout = async () => {\r\n const cacheKeys = await caches.keys();\r\n cacheKeys.forEach(async (key) => {\r\n await caches.delete(key);\r\n });\r\n };\r\n\r\n const handleRedirect = (link) => {\r\n history.push(`${link}`);\r\n handleClose();\r\n };\r\n\r\n return (\r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n {userProfile.name}\r\n \r\n \r\n \r\n \r\n {VendorProductCheck(2) && (\r\n handleRedirect(\"/loyalty/dashboard\")}\r\n className={classes.menuitem}\r\n >\r\n \r\n LOYALTY CARD\r\n \r\n )}\r\n {VendorProductCheck(3) && (\r\n handleRedirect(\"/fuelcard/dashboard\")}\r\n className={classes.menuitem}\r\n >\r\n \r\n FUEL CARD\r\n \r\n )}\r\n {(type === 4 || type === 5) && (\r\n handleRedirect(\"/crm/dashboard\")}\r\n className={classes.menuitem}\r\n >\r\n \r\n CRM\r\n \r\n )}\r\n handleRedirect(\"/location/location\")}\r\n className={classes.menuitem}\r\n >\r\n \r\n SET UP\r\n \r\n\r\n handleRedirect(\"/settings/billing\")}\r\n className={classes.menuitem}\r\n >\r\n \r\n BILLING\r\n \r\n\r\n handleRedirect(\"/settings/auditlogs\")}\r\n className={classes.menuitem}\r\n >\r\n AUDIT LOGS\r\n \r\n\r\n handleRedirect(\"/settings/download\")}\r\n >\r\n DOWNLOADS\r\n \r\n\r\n handleRedirect(\"/settings/manual\")}\r\n className={classes.menuitem}\r\n >\r\n USER GUIDE\r\n \r\n\r\n logout()} className={classes.menuitem}>\r\n CLEAR CACHE\r\n \r\n
\r\n \r\n );\r\n};\r\n\r\nexport default Profile;\r\n","import React from \"react\";\r\nimport { Box, Button } from \"@material-ui/core\";\r\n\r\nconst Distribution = () => {\r\n return (\r\n \r\n \r\n {\r\n window.location.href = \"/distribution/dashboard\";\r\n }}\r\n style={{ backgroundColor: \"#2c3d4e\", color: \"white\" }}\r\n component=\"a\"\r\n disableElevation\r\n variant=\"contained\"\r\n >\r\n Distribution\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Distribution;\r\n","import React, { useContext } from \"react\";\r\nimport Navitems from \"./NavItems\";\r\nimport { Divider, Drawer, Hidden, makeStyles } from \"@material-ui/core\";\r\nimport { Box, List } from \"@mui/material\";\r\nimport { SidebarWidth } from \"../../assets/sidebar/jss/Theme-variable\";\r\nimport Menuitems from \"./data\";\r\nimport Profile from \"./Profile\";\r\nimport Distribution from \"./Distribution\";\r\nimport { encryptSession } from \"../../api\";\r\nimport { VendorProductCheck } from \"../common/Functions\";\r\nimport { AppContext } from \"../../AppContext\";\r\n\r\nconst useStyles = makeStyles((theme) => ({\r\n mobileSidebar: {\r\n width: SidebarWidth,\r\n },\r\n desktopSidebar: {\r\n width: SidebarWidth,\r\n top: 0,\r\n borderRight: \"0px\",\r\n height: \"calc(100%)\",\r\n boxShadow: \"1px 0px 20px rgba(0, 0, 0, 0.08)\",\r\n },\r\n}));\r\n\r\nconst Sidebar = (props) => {\r\n const classes = useStyles();\r\n const { locd } = useContext(AppContext);\r\n\r\n let list2 = locd?.VendorLocationCratoProductArray;\r\n\r\n const productIDs = Array.isArray(list2)\r\n ? list2.map((item) => item.CratoProductID)\r\n : [];\r\n\r\n const SidebarContent = (\r\n \r\n \r\n \r\n \r\n \r\n {Menuitems?.filter((m) =>\r\n productIDs?.some((id) => m.type.includes(id))\r\n ).map((m, index) => (\r\n \r\n ))}\r\n \r\n \r\n\r\n {props.children}\r\n\r\n \r\n\r\n {VendorProductCheck(6) && }\r\n \r\n );\r\n\r\n return (\r\n <>\r\n \r\n \r\n {SidebarContent}\r\n \r\n \r\n\r\n \r\n \r\n {SidebarContent}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default Sidebar;\r\n","import React, { useContext } from \"react\";\r\nimport Billing from \"./components/Settings/Billing\";\r\nimport { AppContext } from \"./AppContext\";\r\nimport { Button } from \"@mui/material\";\r\nimport { useHistory } from \"react-router-dom/cjs/react-router-dom\";\r\n\r\nexport default function NotPaid() {\r\n const { context } = useContext(AppContext);\r\n const history = useHistory();\r\n const containerStyle = {\r\n display: \"flex\",\r\n flexWrap: \"wrap\",\r\n flexDirection: \"column\",\r\n alignItems: \"center\",\r\n justifyContent: \"center\",\r\n minHeight: \"100vh\", // Set minHeight for full viewport height\r\n fontFamily: \"Arial, sans-serif\",\r\n };\r\n\r\n const titleStyle = {\r\n fontWeight: \"bold\",\r\n fontSize: \"3rem\", // Adjust font size for larger screens\r\n color: \"red\",\r\n marginBottom: \"1rem\", // Adjust margin for smaller screens\r\n };\r\n\r\n const subTitleStyle = {\r\n fontWeight: \"bold\",\r\n fontSize: \"2.5rem\", // Adjust font size for larger screens\r\n marginBottom: \"1rem\", // Adjust margin for smaller screens\r\n };\r\n\r\n const logout = async () => {\r\n const cacheKeys = await caches.keys();\r\n cacheKeys.forEach(async (key) => {\r\n await caches.delete(key);\r\n });\r\n sessionStorage.clear();\r\n // localStorage.clear();\r\n history.push(\"/\");\r\n window.location.reload();\r\n };\r\n\r\n return (\r\n
\r\n
NOT PAID !!
\r\n
\r\n {context?.VendorName + \" \"} ACCOUNT IS SUSPENDED\r\n
\r\n {/*
INVOICE AMOUNT: 8000
*/}\r\n \r\n \r\n
\r\n );\r\n}\r\n","import React from \"react\";\r\nimport { BrowserRouter, Route, Switch, Link } from \"react-router-dom\";\r\nimport SnackbarProvider from \"react-simple-snackbar\";\r\nimport { ToastContainer } from \"react-toastify\";\r\nimport \"react-toastify/dist/ReactToastify.css\";\r\nimport Footer from \"./components/Footer/Footer\";\r\nimport Header from \"./components/Header/Header\";\r\nimport { Box, CssBaseline, Typography } from \"@mui/material\";\r\nimport { makeStyles } from \"@material-ui/core/styles\";\r\nimport { encryptSession } from \"./api\";\r\nimport { route } from \"./Route\";\r\nimport { Suspense } from \"react\";\r\nimport { LoadingSpinner } from \"./components/common/Loader\";\r\nimport { SidebarWidth } from \"./assets/sidebar/jss/Theme-variable\";\r\nimport Sidebar from \"./components/Sidebar/Sidebar\";\r\nimport NotPaid from \"./NotPaid\";\r\nimport { useContext } from \"react\";\r\nimport { AppContext } from \"./AppContext\";\r\n\r\nconst Company = encryptSession.getItem(\"cn\");\r\nconst locations = encryptSession.getItem(\"loc\");\r\nconst type = +localStorage.getItem(\"tpy\");\r\n\r\nfunction AdminRoute() {\r\n const { context, setContext, locd } = useContext(AppContext);\r\n\r\n const vtype =\r\n locd?.VendorLocationCratoProductArray?.[0]?.CratoProductID === 2 ? 4 : 1;\r\n\r\n const [isSidebarOpen, setSidebarOpen] = React.useState(vtype !== 4);\r\n const [isMobileSidebarOpen, setMobileSidebarOpen] = React.useState(false);\r\n const [isOnline, setIsOnline] = React.useState(navigator.onLine);\r\n React.useEffect(() => {\r\n function handleOnlineStatusChange() {\r\n setIsOnline(navigator.onLine);\r\n localStorage.setItem(\"online\", isOnline);\r\n }\r\n\r\n window.addEventListener(\"online\", handleOnlineStatusChange);\r\n window.addEventListener(\"offline\", handleOnlineStatusChange);\r\n\r\n return () => {\r\n window.removeEventListener(\"online\", handleOnlineStatusChange);\r\n window.removeEventListener(\"offline\", handleOnlineStatusChange);\r\n };\r\n }, [isOnline]);\r\n const storedValues = JSON.parse(localStorage.getItem(\"values\"));\r\n\r\n React.useEffect(() => {\r\n if (!storedValues && Array.isArray(locations) && locations.length > 0) {\r\n setContext({\r\n ...context,\r\n VendorLocationID: locations[0].VendorLocationID,\r\n VendorID: locations[0].VendorID,\r\n VendorLocationName: locations[0].VendorLocationName,\r\n ImageID: locations[0].ImageID,\r\n });\r\n }\r\n // setSidebarOpen(vtype !==4 )\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [storedValues, locations, context, setContext]);\r\n\r\n const useStyles = makeStyles((theme) => ({\r\n root: {\r\n backgroundColor: theme.palette.background.dark,\r\n height: \"100%\",\r\n overflow: \"hidden\",\r\n width: \"100%\",\r\n },\r\n wrapper: {\r\n display: \"flex\",\r\n flex: \"1 1 auto\",\r\n overflow: \"hidden\",\r\n // paddingTop: 64,\r\n },\r\n hideFullSidebar: {\r\n [theme.breakpoints.up(\"lg\")]: {\r\n paddingLeft: type === 1 && Company ? SidebarWidth : 0,\r\n },\r\n },\r\n contentContainer: {\r\n display: \"flex\",\r\n flex: \"1 1 auto\",\r\n overflow: \"hidden\",\r\n },\r\n content: {\r\n flexGrow: 1,\r\n height: \"calc(100vh)\",\r\n overflow: \"auto\",\r\n marginRight: \"-15px\",\r\n },\r\n }));\r\n\r\n const classes = useStyles();\r\n\r\n function Copyright() {\r\n return (\r\n \r\n {\"Copyright © \"}\r\n \r\n www.esquekenya.com\r\n {\" \"}\r\n {new Date().getFullYear()}.\r\n \r\n );\r\n }\r\n\r\n const getRoutes = (routes) => {\r\n return routes.map((prop, key) => {\r\n return (\r\n \r\n );\r\n });\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n \r\n {context?.VendorStatusID === 2 ? (\r\n \r\n ) : Company && type === 1 ? (\r\n setMobileSidebarOpen(false)}\r\n toggleSidebar={() => setSidebarOpen(!isSidebarOpen)}\r\n // setNavWidth={setNavWidth}\r\n />\r\n ) : null}\r\n {context?.VendorStatusID !== 2 && (\r\n \r\n
\r\n setSidebarOpen(!isSidebarOpen)}\r\n toggleMobileSidebar={() => setMobileSidebarOpen(true)}\r\n isSidebarOpen={isSidebarOpen}\r\n />\r\n\r\n \r\n }>\r\n {getRoutes(route)}\r\n {/* {type !== \"public\" && } */}\r\n \r\n \r\n \r\n \r\n \r\n {/* {UserID && } */}\r\n
\r\n
\r\n )}\r\n\r\n
\r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nexport default React.memo(AdminRoute);\r\n","import React, { useEffect, useState, useMemo } from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport { QueryClient, QueryClientProvider } from \"react-query\";\r\nimport \"./index.css\";\r\nimport AdminRoute from \"./AdminRoute\";\r\nimport { AppContext } from \"./AppContext\";\r\nimport { encryptSession } from \"./api\";\r\nimport { DefaultContextDateRange, getNairobiTimeFromLocal } from \"./components/common/Functions\";\r\n\r\nconst queryClient = new QueryClient();\r\n\r\nfunction App() {\r\n const UserID = useMemo(() => encryptSession.getItem(\"us\"), []);\r\n const [startTime, endTime] = DefaultContextDateRange(\"week\");\r\n\r\n const [context, setContext] = useState(() => ({\r\n VendorName: encryptSession.getItem(\"cn\"),\r\n Slogan: encryptSession.getItem(\"sl\"),\r\n VendorImage: encryptSession.getItem(\"cim\"),\r\n DateRange: [\r\n getNairobiTimeFromLocal(startTime),\r\n getNairobiTimeFromLocal(endTime),\r\n ],\r\n refresh: 0,\r\n fetching: false,\r\n reporttitle: \"crato\",\r\n fetchError: false,\r\n }));\r\n\r\n const [VendorImage, setVendorImage] = useState(encryptSession.getItem(\"cim\"));\r\n const [locd, setLocd] = useState(encryptSession.getItem(\"locd\"));\r\n\r\n useEffect(() => {\r\n // Get current URL\r\n const currentPath = window.location.pathname;\r\n const isExcludedPath = [\r\n \"/privacypolicy\",\r\n \"/signup\",\r\n \"/login\",\r\n \"/suspended\",\r\n '/settings/billing',\r\n \"/\",\r\n ].includes(currentPath);\r\n\r\n if (!UserID && !isExcludedPath) {\r\n sessionStorage.clear();\r\n window.location.href = \"/\";\r\n }\r\n }, [UserID]);\r\n\r\n const memoizedContextValue = useMemo(() => {\r\n return {\r\n context,\r\n setContext,\r\n VendorImage,\r\n setVendorImage,\r\n locd,\r\n setLocd,\r\n };\r\n }, [context, VendorImage, locd]);\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n}\r\n\r\nReactDOM.render(\r\n \r\n \r\n \r\n \r\n ,\r\n document.getElementById(\"root\")\r\n);\r\n","import { useContext, useState, useEffect, useRef, useCallback } from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\nimport { AppContext } from \"../AppContext\";\r\n\r\nconst EXPIRATION_TIME = 172800000; // 2 days in milliseconds\r\nconst RETRY_COUNT = 3; // Number of retries for fetching\r\nconst lastFetchTimeMap = new Map();\r\n\r\nexport const useApiRes = (api, options) => {\r\n const { refresh } = options;\r\n const location = useLocation();\r\n const [data, setData] = useState([]);\r\n const [error, setError] = useState(null);\r\n const [network, setNetwork] = useState(navigator.onLine);\r\n const [visible, setVisible] = useState(true);\r\n const { context, setContext } = useContext(AppContext);\r\n const prevRefreshRef = useRef(refresh);\r\n const prevRefresh = prevRefreshRef.current;\r\n const FETCH_INTERVAL = prevRefresh !== context.refresh ? 0 : 30000;\r\n\r\n const manageCache = useCallback(async () => {\r\n try {\r\n const cacheNames = await caches.keys();\r\n const now = Date.now();\r\n\r\n for (const cacheName of cacheNames) {\r\n const cache = await caches.open(cacheName);\r\n const keys = await cache.keys();\r\n\r\n for (const request of keys) {\r\n const url = new URL(request.url);\r\n const timestamp = url.searchParams.get(\"timestamp\");\r\n\r\n if (timestamp && now - parseInt(timestamp, 10) > EXPIRATION_TIME) {\r\n await cache.delete(request);\r\n }\r\n }\r\n }\r\n } catch (err) {\r\n console.error(\"Error managing cache: \", err);\r\n }\r\n }, []);\r\n\r\n const addDataIntoCache = useCallback(\r\n async (api, response) => {\r\n try {\r\n const data = new Response(JSON.stringify(response));\r\n if (\"caches\" in window) {\r\n const cache = await caches.open(api);\r\n await manageCache();\r\n const timestampedUrl = new URL(api);\r\n timestampedUrl.searchParams.set(\"timestamp\", Date.now().toString());\r\n\r\n // Clear old cache entries for this API\r\n const keys = await cache.keys();\r\n for (const request of keys) {\r\n if (request.url.startsWith(api)) {\r\n await cache.delete(request);\r\n }\r\n }\r\n\r\n await cache.put(timestampedUrl.toString(), data);\r\n }\r\n } catch (err) {\r\n console.error(\"Error adding data to cache: \", err);\r\n }\r\n },\r\n [manageCache]\r\n );\r\n\r\n const getCachedData = useCallback(async (api) => {\r\n try {\r\n if (typeof caches === \"undefined\") return null;\r\n const cacheNames = await caches.keys();\r\n\r\n for (const cacheName of cacheNames) {\r\n const cache = await caches.open(cacheName);\r\n const keys = await cache.keys();\r\n\r\n for (const request of keys) {\r\n if (request.url.startsWith(api)) {\r\n const cachedResponse = await cache.match(request);\r\n if (cachedResponse && cachedResponse.ok) {\r\n return cachedResponse.json();\r\n }\r\n }\r\n }\r\n }\r\n return null;\r\n } catch (err) {\r\n console.error(\"Error getting cached data: \", err);\r\n return null;\r\n }\r\n }, []);\r\n\r\n const fetchData = useCallback(\r\n async (abortController, retries = RETRY_COUNT) => {\r\n setContext((prevContext) => ({ ...prevContext, fetching: true })); // Set fetching to true when fetching starts\r\n try {\r\n const response = await fetch(api, { signal: abortController.signal });\r\n if (!response.ok) {\r\n throw new Error(\"Network response was not ok\");\r\n }\r\n const data = await response.json();\r\n if (!api.includes(\"undefined\") && !data.errors) {\r\n await addDataIntoCache(api, data);\r\n setData(data); // Update the state with the new data after caching\r\n lastFetchTimeMap.set(api, Date.now()); // Update the last fetch time\r\n setError(null);\r\n } else {\r\n throw new Error(\"API returned undefined or errors\");\r\n }\r\n } catch (error) {\r\n if (error.name !== \"AbortError\" && retries > 0) {\r\n console.log(`Retrying... Attempts left: ${retries}`);\r\n await fetchData(abortController, retries - 1); // Retry fetching data\r\n } else {\r\n const cachedData = await getCachedData(api);\r\n if (cachedData) {\r\n setData(cachedData);\r\n setError(\"Fetch failed, showing cached data.\");\r\n } else {\r\n setError(\"Fetch failed and no cached data available.\");\r\n }\r\n }\r\n } finally {\r\n setContext((prevContext) => ({ ...prevContext, fetching: false })); // Set fetching to false when fetching ends\r\n }\r\n },\r\n [api, addDataIntoCache, getCachedData, setContext]\r\n );\r\n\r\n useEffect(() => {\r\n const controller = new AbortController();\r\n\r\n const updateData = async () => {\r\n const cachedData = await getCachedData(api);\r\n if (cachedData) {\r\n setData(cachedData); // Update the state with cached data\r\n setContext((prevContext) => ({ ...prevContext, fetching: false }));\r\n } else {\r\n setContext((prevContext) => ({ ...prevContext, fetching: true }));\r\n }\r\n\r\n const lastFetchTime = lastFetchTimeMap.get(api);\r\n const now = Date.now();\r\n if (network) {\r\n if (!lastFetchTime || now - lastFetchTime >= FETCH_INTERVAL) {\r\n await fetchData(controller); // Fetch new data in the background\r\n } else {\r\n setContext((prevContext) => ({ ...prevContext, fetching: false }));\r\n }\r\n } else {\r\n if (!cachedData) {\r\n setError(\"No internet connection and no cached data available.\");\r\n setContext((prevContext) => ({ ...prevContext, fetching: false }));\r\n }\r\n }\r\n };\r\n\r\n updateData();\r\n\r\n return () => {\r\n controller.abort();\r\n };\r\n }, [api, location, refresh, network, visible, getCachedData, fetchData, setContext]);\r\n\r\n useEffect(() => {\r\n const handleVisibilityChange = () => {\r\n setVisible(document.visibilityState === \"visible\");\r\n };\r\n document.addEventListener(\"visibilitychange\", handleVisibilityChange);\r\n return () => {\r\n document.removeEventListener(\"visibilitychange\", handleVisibilityChange);\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n const handleOnlineStatus = () => {\r\n setNetwork(navigator.onLine);\r\n };\r\n window.addEventListener(\"online\", handleOnlineStatus);\r\n window.addEventListener(\"offline\", handleOnlineStatus);\r\n return () => {\r\n window.removeEventListener(\"online\", handleOnlineStatus);\r\n window.removeEventListener(\"offline\", handleOnlineStatus);\r\n };\r\n }, []);\r\n\r\n return { data, error, loading: context.fetching };\r\n};\r\n","import { useState } from \"react\";\r\nimport { toast } from \"react-toastify\";\r\n\r\nimport { AppContext } from \"../AppContext\";\r\nimport { useContext } from \"react\";\r\nimport { encryptSession } from \".\";\r\n\r\nconst useAsyncSubmit = (successFns = [], errorFns = []) => {\r\n const [loading, setLoading] = useState(false);\r\n const [submitted, setSubmitted] = useState(false);\r\n const [success, setSuccess] = useState(false);\r\n const [result, setResult] = useState(null);\r\n const { context, setContext } = useContext(AppContext);\r\n const token = encryptSession.getItem(\"tk\");\r\n const values = JSON.parse(localStorage.getItem(\"values\"));\r\n\r\n const handleAsyncSubmit = async (apiURL, requestBody, bypass) => {\r\n if (values?.VendorLocationID !== 0) {\r\n setSubmitted(true);\r\n\r\n if (!context.error || bypass) {\r\n setLoading(true);\r\n\r\n try {\r\n const response = await fetch(apiURL, {\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n Authorization: `Bearer ${token}`,\r\n },\r\n method: \"post\",\r\n body: JSON.stringify(requestBody),\r\n });\r\n\r\n const result = await response.json();\r\n\r\n if (result.Error === false) {\r\n result?.Message !== \"None\" && toast.success(`${result.Message} 👌`);\r\n setContext((prevContext) => ({\r\n ...prevContext, \r\n refresh: prevContext.refresh + 1,\r\n }));\r\n setSuccess(true);\r\n setResult(result); // Set the result state with the received data\r\n successFns.forEach((fn) => fn());\r\n } else {\r\n toast.error(`${result.Message} 😲`);\r\n errorFns.forEach((fn) => fn());\r\n }\r\n } catch (error) {\r\n toast.error(\"An error occurred while submitting the form 😲\");\r\n console.error(error);\r\n errorFns.forEach((fn) => fn());\r\n } finally {\r\n setLoading(false);\r\n }\r\n }\r\n } else {\r\n toast?.error(\"Please choose a Station you are transacting from\");\r\n }\r\n };\r\n\r\n setTimeout(() => {\r\n setSuccess(false);\r\n }, 8000);\r\n\r\n return {\r\n loading,\r\n submitted,\r\n success,\r\n result,\r\n setSubmitted,\r\n handleAsyncSubmit,\r\n };\r\n};\r\n\r\nexport default useAsyncSubmit;\r\n","import { EncryptStorage } from \"encrypt-storage\";\r\nimport moment from \"moment\";\r\n// import { toast } from \"react-toastify\";\r\nimport \"react-toastify/dist/ReactToastify.css\";\r\nimport { useApiRes } from \"./useApiRes\";\r\nimport { AddToApi, saveToIndexedDB } from \"./IndexDB/PostData\";\r\nimport useAsyncSubmit from \"./PostData\";\r\nimport {\r\n DateTimeFormat,\r\n accountingFormat,\r\n} from \"../components/common/Functions\";\r\nimport { useContext } from \"react\";\r\nimport { AppContext } from \"../AppContext\";\r\nimport { result } from \"lodash\";\r\n\r\nconst useVendorID = () => {\r\n const { context } = useContext(AppContext);\r\n return context?.VendorID || 0;\r\n};\r\n//export default useVendorID;\r\n\r\n// const Main_URL = \"https://api.crato.co.ke/api/\";\r\nconst Main_URL = \"https://api.crato.africa/api/\";\r\nconst Funguo = \"LaHNcG1xClzAqZpegrr83gbxmSkZsniZ\";\r\n\r\nconst isOnline = localStorage.getItem(\"online\");\r\n// const chatgptkey = \"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\";\r\n// const cratchatkey = \"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\";\r\n// const geminikey = \"AIzaSyAs5ttlzPuvPN4t11F41q6UioUVSthEykY\";\r\n//colors\r\n//green- #44dc94\r\n//dark blue - #2c3d4e\r\n//white - #7fa7ba\r\n//grey - #7fa7ba;\r\n\r\nconst primarycolor = \"\";\r\nconst secondarycolor = \"\";\r\n\r\nexport function SendSMS(data) {\r\n return fetch(`https://wakish.esquekenya.com/api/Company/SendMessage`, {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n PhoneNumber: data.PhoneNumber,\r\n Message: data.Message,\r\n }),\r\n });\r\n}\r\n\r\nexport const encryptStorage = new EncryptStorage(\"secret-key\", {\r\n encAlgorithm: \"Rabbit\",\r\n});\r\n\r\nexport const encryptSession = new EncryptStorage(\"secret-key\", {\r\n storageType: \"sessionStorage\",\r\n});\r\n\r\nconst ParentID =\r\n encryptSession.getItem(\"pi\") === undefined ? 0 : encryptSession.getItem(\"pi\");\r\nconst UserID = encryptSession.getItem(\"us\");\r\n\r\nexport function UserLogin(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Users/UserLogin\";\r\n const requestBody = {\r\n PhoneNumber: data.email,\r\n Password: data.password,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ResetTwoFactoAuthentication(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Users/SetTwoFactorAuthorisation\";\r\n const requestBody = {\r\n userID: data.UserID,\r\n twoFA: data.twoFA ? 1 : 0,\r\n addedBy: data.UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function GetPassCode(phone) {\r\n return fetch(Main_URL + \"Users/RequestPasscode\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n phoneNumber: phone,\r\n }),\r\n });\r\n}\r\n\r\nexport function ResetPassword(data) {\r\n return fetch(Main_URL + \"Users/ConfirmResetPassword\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n resetCode: data.PassCode,\r\n password: data.NewPassword,\r\n phoneNumber: data.PhoneNumber,\r\n }),\r\n });\r\n}\r\n\r\nexport function UserLoginCustomer(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Users/LoginCustomerUser\";\r\n const requestBody = {\r\n PhoneNumber: data.email,\r\n Password: data.password,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddCompanyLocation(data, ProviderID) {\r\n const address = localStorage.getItem(\"address\");\r\n const lat = localStorage.getItem(\"lat\");\r\n const lng = localStorage.getItem(\"lng\");\r\n return fetch(Main_URL + \"AddProviderServiceLocation\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n ProviderID: ProviderID,\r\n CityID: data.CityID,\r\n LocationName: data.locationName,\r\n ContactPhone: data.ContactPhone,\r\n Area: address,\r\n Street: address,\r\n ProviderImage: 0,\r\n Latitude: lat,\r\n Longitude: lng,\r\n AddedBy: 0,\r\n }),\r\n });\r\n}\r\n\r\nexport function UserRegistration(data) {\r\n return fetch(Main_URL + \"Admin/VendorUserRegistration\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n UserID: 0,\r\n VendorID: 0,\r\n VendorLocationID: 0,\r\n AddedBy: 0,\r\n UserTypeID: 0,\r\n FirstName: data.firstName,\r\n LastName: data.lastName,\r\n PhoneNumber: data.phoneNumber,\r\n Email: data.email,\r\n UserImage: data.logo,\r\n }),\r\n });\r\n}\r\n\r\nexport function UserCustomerRegistration(data) {\r\n return fetch(Main_URL + \"Customer/VendorCustomerUserRegistration\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n userID: 0,\r\n customerID: data.CustomerID,\r\n countryCode: data.countryCode,\r\n addedBy: UserID,\r\n firstName: data.firstName,\r\n lastName: data.lastName,\r\n phoneNumber: data.phoneNumber,\r\n email: data.email,\r\n userImage: 0,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetNozzleReadingType = (refresh) => {\r\n const { data: readingtype, error } = useApiRes(\r\n Main_URL + `Admin/GetNozzleReadingType`,\r\n { refresh }\r\n );\r\n return { readingtype, error };\r\n};\r\n\r\nexport const GetLocations = (refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: locations, error } = useApiRes(\r\n Main_URL + `Admin/GetVendorLocation?VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { locations, error };\r\n};\r\n\r\nexport const GetTank = (LocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: tank, mutate: gettank } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorTank?VendorID=${VendorID}&VendorLocationID=${LocationID}`,\r\n { refresh }\r\n );\r\n return { tank, gettank };\r\n};\r\n\r\nexport function AddVendorTank(data) {\r\n const VendorID = encryptSession.getItem(\"ci\");\r\n return fetch(Main_URL + \"Stock/AddVendorTank\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n ProductID: data.ProductID,\r\n TankName: data.TankName,\r\n VendorLocationID: data.VendorLocationID,\r\n VendorID: VendorID,\r\n TankCapacity: data.TankCapacity,\r\n AddedBy: UserID,\r\n TankParentID: data.TankParentID,\r\n }),\r\n });\r\n}\r\n\r\nexport function UpdateVendorTank(data) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n return fetch(Main_URL + \"Stock/UpdateVendorTank\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n ProductID: data.ProductID,\r\n TankID: data.TankID,\r\n TankName: data.TankName,\r\n VendorLocationID: data.VendorLocationID,\r\n VendorID: VendorID,\r\n TankCapacity: data.TankCapacity,\r\n AddedBy: UserID,\r\n TankParentID: data.TankParentID,\r\n }),\r\n });\r\n}\r\n\r\nexport function RemoveVendorTank(data) {\r\n return fetch(Main_URL + \"Stock/RemoveVendorTank\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n TankID: data.TankID,\r\n AddedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetDipReading = (TankID, refresh) => {\r\n const { data: reading, error } = useApiRes(\r\n Main_URL + `Stock/GetVendorTankDip?TankID=${TankID}`,\r\n { refresh }\r\n );\r\n return { reading, error };\r\n};\r\n\r\nexport const GetNozzle = (PumpID, refresh) => {\r\n const { data: nozzle, error } = useApiRes(\r\n Main_URL + `Stock/GetVendorPumpNozzle?PumpID=${PumpID}`,\r\n { refresh }\r\n );\r\n return { nozzle, error };\r\n};\r\n\r\nexport const GetVendorLocationNozzle = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: nozzle, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorPumpNozzles?VendorLocationID=${VendorLocationID}&VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { nozzle, error };\r\n};\r\n\r\nexport const GetNozzleReading = (DateRange, PumpID, refresh) => {\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: reading, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorPumpNozzleReading?PumpID=${PumpID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { reading, error };\r\n};\r\n\r\nexport const GetShiftNozzleReading = (\r\n VendorLocationID,\r\n ShiftClockNO,\r\n refresh\r\n) => {\r\n const { data: readings, error } = useApiRes(\r\n Main_URL +\r\n `Supervisor/GetShiftNozzleReadings?VendorLocationID=${VendorLocationID}&ShiftClockNO=${ShiftClockNO}`,\r\n { refresh }\r\n );\r\n return { readings, error };\r\n};\r\n\r\nexport function AddDipReading(data) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n return fetch(Main_URL + \"Stock/PostDipReading\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n VendorID: VendorID,\r\n ShiftClockNo: data.ShiftClockNo,\r\n VendorLocationID: data.VendorLocationID,\r\n AddedBy: UserID,\r\n TankParentArray: data.dip,\r\n }),\r\n });\r\n}\r\n\r\nexport function AddSingleDipReading(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/PostNewDipReading\";\r\n const requestBody = {\r\n addedBy: UserID,\r\n shiftClockNO: data.ShiftClockNO,\r\n shiftRefNO: data.ShiftRefNO,\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n clockDate: data.ClockDate,\r\n tankParentArray: data.TankParentArray,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateSecondDipReading(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/UpdateBackdatedClosedParentDipReading\";\r\n const requestBody = {\r\n parentDipNO: data.ParentDipNO,\r\n addedBy: UserID,\r\n tankDipArray: [\r\n {\r\n dipNO: data.DipNO,\r\n secondReading: data.NewReading,\r\n },\r\n ],\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function DeleteDipReading(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/DeactivateDipReading\";\r\n const requestBody = {\r\n tankParentID: data.TankParentID,\r\n vendorLocationID: data.VendorLocationID,\r\n parentDipNO: data.ParentDipNO,\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function CloseShift(data) {\r\n return fetch(Main_URL + \"Stock/CloseTankPumpNozzleReading\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n ShiftID: data.ShiftID,\r\n ClosingReading: data.ClosingReading,\r\n ClosedBy: UserID,\r\n VendorTankParentNozzleID: data.VendorTankParentNozzleID,\r\n }),\r\n });\r\n}\r\n\r\nexport function OpenShift(data) {\r\n return fetch(Main_URL + \"Stock/OpenTankPumpNozzleReading\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n OpeningReading: data.OpeningReading,\r\n AddedBy: UserID,\r\n PumpID: data.PumpID,\r\n NozzleID: data.NozzleID,\r\n VendorTankParentNozzleID: data.VendorTankParentNozzleID,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetPump = (LocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: pump, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorLocationPump?VendorLocationID=${LocationID}&VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { pump, error };\r\n};\r\n\r\nexport function AddVendorPump(data) {\r\n const VendorID = encryptSession.getItem(\"ci\");\r\n return fetch(Main_URL + \"Stock/AddVendorLocationPump\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n PumpName: data.PumpName,\r\n AddedBy: UserID,\r\n VendorLocationID: data.VendorLocationID,\r\n VendorID: VendorID,\r\n }),\r\n });\r\n}\r\n\r\nexport function UpdateVendorPump(data) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n return fetch(Main_URL + \"Stock/UpdateVendorLocationPump\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n PumpID: data.PumpID,\r\n PumpName: data.PumpName,\r\n AddedBy: UserID,\r\n VendorLocationID: data.VendorLocationID,\r\n VendorID: VendorID,\r\n }),\r\n });\r\n}\r\n\r\nexport function RemoveVendorPump(data) {\r\n return fetch(Main_URL + \"Stock/RemoveVendorLocationPump\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n PumpID: data.PumpID,\r\n AddedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetProduct = (VendorLocationID, ProductCategoryID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: product, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorLocationProduct?VendorLocationID=${VendorLocationID}&VendorID=${VendorID}&ProductCategoryID=${ProductCategoryID}`,\r\n { refresh }\r\n );\r\n return { product, error };\r\n};\r\n\r\nexport const GetClockProduct = (\r\n VendorLocationID,\r\n ClockNO,\r\n ProductCategoryID,\r\n refresh\r\n) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: product, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetAttendantLocationProduct?VendorLocationID=${VendorLocationID}&VendorID=${VendorID}&ClockNO=${ClockNO}&ProductCategoryID=${ProductCategoryID}`,\r\n { refresh }\r\n );\r\n return { product, error };\r\n};\r\n\r\nexport const GetCustomer = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: customer, error } = useApiRes(\r\n Main_URL +\r\n `Customer/GetVendorCustomers?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { customer, error };\r\n};\r\n\r\nexport const GetAllCustomerStatement = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const {\r\n data: customer,\r\n error,\r\n loading,\r\n } = useApiRes(\r\n Main_URL +\r\n `Customer/GetVendorAllCustomersSatement?VendorID=${start}&VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { customer, error, loading };\r\n};\r\n\r\nexport const GetCustomerType = (refresh) => {\r\n const { data, error, loading } = useApiRes(\r\n Main_URL + `Customer/GetCustomerType`,\r\n { refresh }\r\n );\r\n return { data, error, loading };\r\n};\r\n\r\nexport const GetCustomerExpense = (CustomerID, refresh) => {\r\n const { data: expense, error } = useApiRes(\r\n Main_URL + `Finance/GetVendorCustomerExpense?CustomerID=${CustomerID}`,\r\n { refresh }\r\n );\r\n return { expense, error };\r\n};\r\n\r\nexport function AddVendorProduct(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/AddVendorProduct\";\r\n const requestBody = {\r\n productName: data.ProductName,\r\n uom: \"\",\r\n productImageID: data.base64,\r\n addedBy: UserID,\r\n vendorID: VendorID,\r\n buyingTax: data.TaxRate,\r\n IsStockItem: data.IsStockItem ? 1 : 0,\r\n sellingTax: data.TaxRate,\r\n productCategoryID: data.ProductCategoryID,\r\n productCategoryBrandID: data.ProductCategoryBrandID,\r\n productVolumeSizeID: data.ProductVolumeSizeID,\r\n productCategoryTypeID: data.ProductCategoryTypeID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetSalesHistory = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: sales, loading } = useApiRes(\r\n Main_URL +\r\n `Sales/GetSaleHistory?VendorLocationID=${VendorLocationID}&VendorID=${VendorID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n\r\n return { sales, loading };\r\n};\r\n\r\nexport const GetProductDailySales = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: sales, loading } = useApiRes(\r\n Main_URL +\r\n `SalesReport/GetProductDailySales?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n\r\n return { sales, loading };\r\n};\r\n\r\nexport const GetVendorLocationDailyDIscount = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: discount, loading } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetVendorLocationDailyDiscount?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n\r\n return { discount, loading };\r\n};\r\n\r\nexport const GetDailyDipVariance = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: variance, loading } = useApiRes(\r\n Main_URL +\r\n `StockReport/GetVendorDailyTotalDipVariance?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n\r\n return { variance, loading };\r\n};\r\n\r\nexport const GetProductSalesReport = (values, refresh) => {\r\n const { DateRange, VendorLocationID, ProductCategoryID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: sales, loading } = useApiRes(\r\n Main_URL +\r\n `SalesReport/GetProductSales?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}&ProductCategoryID=${ProductCategoryID}`,\r\n { refresh }\r\n );\r\n\r\n return { sales, loading };\r\n};\r\n\r\nexport const GetInvoiceCustomerSalesHistory = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: invoice, loading } = useApiRes(\r\n Main_URL +\r\n `Sales/GetVendorCustomerInvoiceSales?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n\r\n return { invoice, loading };\r\n};\r\n\r\nexport const GetAttendantClockSales = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: sales, loading } = useApiRes(\r\n Main_URL +\r\n `SalesReport/GetAttendantClockSales?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n\r\n return { sales, loading };\r\n};\r\n\r\nexport function AddVendorSale(data) {\r\n return fetch(Main_URL + \"Finance/AddVendorPaymentMethod\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n userID: 0,\r\n clockNO: \"string\",\r\n vendorID: 0,\r\n vendorLocationID: 0,\r\n customerID: 0,\r\n assetID: 0,\r\n totalAmount: 0,\r\n saleID: \"string\",\r\n saleDetailArray: data.saleDetail,\r\n salePaymentArray: data.receipt,\r\n }),\r\n });\r\n}\r\n\r\nexport function AddVendorClock(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Supervisor/AddVendorShiftUserClock\";\r\n const requestBody = {\r\n addedBy: UserID,\r\n clockTypeID: data.ClockTypeID,\r\n shiftClockNO: data.ShiftClockNO,\r\n shiftRefNO: data.ShiftRefNO,\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n clockDate: data.ClockDate,\r\n userClockArray: data.UserClockArray,\r\n accountBalanceArray: [],\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ApproveVendorShift(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Supervisor/ApproveShiftClock\";\r\n const requestBody = {\r\n shiftClockNO: data.ShiftClockNO,\r\n vendorLocationID: data.VendorLocationID,\r\n approvedBy: UserID,\r\n statusID: 2,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateMpesaStartTime(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/UpdateShiftMpesaStartTime\";\r\n const requestBody = {\r\n shiftRefNO: data.ShiftRefNO,\r\n mpesaStartTime: data.MpesaStartTime,\r\n mpesaStartAmount: data.MpesaAmount,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ApproveVendorClock(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Supervisor/ApproveUserClock\";\r\n const requestBody = {\r\n clockNO: data.ClockNO,\r\n approvedBy: UserID,\r\n VendorLocationID: data.VendorLocationID,\r\n statusID: 2,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVendorShift(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const currentTime = moment().format(\"HH:mm:ss\");\r\n const passedDate = moment(data.ClockDate).format(\"YYYY-MM-DD\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Supervisor/AddVendorShift\";\r\n const requestBody = {\r\n addedBy: UserID,\r\n clockTypeID: data.ClockTypeID,\r\n dipStatusID: data.DipStatusID,\r\n shiftClockNO: data.ShiftClockNO,\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n clockDate: `${passedDate} ${currentTime}`,\r\n userClockArray: data.UserClockArray,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVendorShiftTimeAllowance(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/AddShiftTimeAllowance\";\r\n const requestBody = {\r\n addedBy: UserID,\r\n shiftRefNO: data.ShiftRefNO,\r\n timeAdded: data.TimeAdded,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function CloseVendorShift(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Supervisor/CloseVendorShift\";\r\n const requestBody = {\r\n addedBy: UserID,\r\n vendorLocationID: data.VendorLocationID,\r\n vendorID: VendorID,\r\n shiftRefNO: data.ShiftRefNO,\r\n shiftClockNO: data.ShiftClockNO,\r\n vendorName: data.VendorName,\r\n vendorLocationName: data.VendorLocationName,\r\n shiftType: data.ShiftType,\r\n shiftPDF: data.ShiftPDF,\r\n dipVarianceReason: data.DipVarianceReason,\r\n userClockArray: data.UserClockArray,\r\n tankParentArray: data.TankParentArray,\r\n accountBalances: data.AccountBalances,\r\n contactLists: data.ContactLists,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetOpenShifts = (VendorLocationID, refresh) => {\r\n const { data, error } = useApiRes(\r\n Main_URL + `Supervisor/GetOpenShiftS?VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetVendorUser = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: users, error } = useApiRes(\r\n Main_URL +\r\n `Admin/GetVendorUsers?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}&UserTypeID=0`,\r\n { refresh }\r\n );\r\n return { users, error };\r\n};\r\n\r\nexport const GetVendorGeneralSalesTax = (\r\n VendorLocationID,\r\n TaxDate,\r\n refresh\r\n) => {\r\n const { data: salestax, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetGeneratedTax?VendorLocationID=${VendorLocationID}&TaxDate=${TaxDate}`,\r\n { refresh }\r\n );\r\n return { salestax, error };\r\n};\r\n\r\nexport const GetVendorWithHoldingTax = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: wtax, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetVendorWithholdingInvoice?StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { wtax, error };\r\n};\r\n\r\nexport const GetVendorGeneralPurchaseTax = (\r\n VendorLocationID,\r\n TaxDate,\r\n refresh\r\n) => {\r\n const { data: ptax, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetGeneralPurchaseTax?VendorLocationID=${VendorLocationID}&TaxDate=${TaxDate}`,\r\n { refresh }\r\n );\r\n return { ptax, error };\r\n};\r\n\r\nexport function UpdateInvoiceWithholdingTax(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/UpdateWithholdingTaxInvoice\";\r\n const requestBody = {\r\n saleIDs: data?.Sales,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n result: asyncSubmit.result,\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetVendorClockFreeUser = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: users, error } = useApiRes(\r\n Main_URL +\r\n `Admin/GetVendorClockFreeUsers?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { users, error };\r\n};\r\n\r\nexport function AddVendorUserRole(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Admin/PostUserPolicyAssignment\";\r\n const requestBody = {\r\n userID: data.UserID,\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n userPolicyArray: data.UserPolicyArray,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n result: asyncSubmit.result,\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function RemoveVendorUserRole(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Admin/RemoveUserPolicyAssignment\";\r\n const requestBody = {\r\n userID: data.UserID,\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n userPolicyArray: data.UserPolicyArray,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n result: asyncSubmit.result,\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVendorUser(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Admin/VendorUserRegistration\";\r\n const requestBody = {\r\n UserID: 0,\r\n VendorID: VendorID,\r\n VendorLocationID: data.VendorLocationID,\r\n AddedBy: UserID,\r\n FirstName: data.FirstName,\r\n countryCode: data.CountryCode,\r\n LastName: data.LastName,\r\n PhoneNumber: data.PhoneNumber,\r\n UserTypeID: data.UserTypeID,\r\n canSell: data.CanSell,\r\n Email: data.Email,\r\n UserImage: 0,\r\n stationsAssignmentArray: data.StationArray,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n result: asyncSubmit.result,\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateVendorUser(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Admin/UpdateVendorUser\";\r\n const requestBody = {\r\n userID: data.UserID,\r\n firstName: data.FirstName,\r\n lastName: data.LastName,\r\n\r\n phoneNumber: data.PhoneNumber,\r\n email: data.Email,\r\n addedBy: UserID,\r\n stationsAssignmentArray: data?.StationArray,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n result: asyncSubmit.result,\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function RemoveVendorUser(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Admin/RemoveVendorUser\";\r\n const requestBody = {\r\n VendorLocationID: data.VendorLocationID,\r\n VendorUserID: data.VendorUserID,\r\n AddedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ResetUserPassword(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Users/AdminResetRequestPasscode\";\r\n const requestBody = {\r\n phoneNumber: data.PhoneNumber,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n result: asyncSubmit.result,\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetVendorClock = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: clocks, error } = useApiRes(\r\n Main_URL +\r\n `Supervisor/GetVendorUserClock?VendorLocationID=${VendorLocationID}&VendorID=${VendorID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { clocks, error };\r\n};\r\n\r\nexport const GetVendorShifts = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: shifts, error } = useApiRes(\r\n Main_URL +\r\n `Supervisor/GetShiftClockSummary?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { shifts, error };\r\n};\r\n\r\nexport const GetVendorShiftsAdminACtions = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, user } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: actions, error } = useApiRes(\r\n Main_URL +\r\n `AdminReport/GetAdminAction?StartDate=${start}&EndDate=${end}&VendorID=${VendorID}&UserID=${user}`,\r\n { refresh }\r\n );\r\n return { actions, error };\r\n};\r\n\r\nexport const GetVendorDailyNozzleReadingSummary = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: MeterReading, error } = useApiRes(\r\n Main_URL +\r\n `Supervisor/GetVendorDailySummaryNozzleReading?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { MeterReading, error };\r\n};\r\n\r\nexport const GetVendorDailyShiftSummary = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: daily, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetShiftSummaryDailyClocks?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { daily, error };\r\n};\r\n\r\nexport const GetVendorShiftsDetails = (\r\n VendorLocationID,\r\n ShiftClockNO,\r\n refresh\r\n) => {\r\n const { data: details, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetShiftClockDetail?VendorLocationID=${VendorLocationID}&ShiftClockNO=${ShiftClockNO}`,\r\n { refresh }\r\n );\r\n return { details, error };\r\n};\r\n\r\nexport const GetVendorDailyShiftsDetails = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: shifts, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetShiftSummaryDailyClocks?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { shifts, error };\r\n};\r\n\r\nexport const GetUserType = (refresh) => {\r\n const { data: types, error } = useApiRes(Main_URL + `Admin/GetUserType`, {\r\n refresh,\r\n });\r\n return { types, error };\r\n};\r\n\r\nexport const GetVendorStorageLocation = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: stores, error } = useApiRes(\r\n Main_URL +\r\n `Admin/GetVendorStorageLocation?VendorLocationID=${VendorLocationID}&VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { stores, error };\r\n};\r\n\r\nexport function AddStorageLocation(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Admin/AddVendorStorageLocation\";\r\n const requestBody = {\r\n storageLocationName: data.storageLocationName,\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n productCategoryID: 0,\r\n vendorStorageLocationID: 0,\r\n productCategories: data.productCategories,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateVendorStorageLocation(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Admin/UpdateVendorStorageLocation\";\r\n const requestBody = {\r\n storageLocationName: data.storageLocationName,\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n productCategoryID: 0,\r\n vendorStorageLocationID: data.VendorStorageLocationID,\r\n productCategories: data.productCategories,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function RemoveVendorStorageLocation(data) {\r\n return fetch(Main_URL + \"Admin/UpdateVendorStorageLocation\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n VendorStorageLocationID: data.VendorStorageLocationID,\r\n AddedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport function AddStockMovement(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/PostStockMovementTx\";\r\n const requestBody = {\r\n VendorID: VendorID,\r\n shiftClockNO: data.ShiftClockNO,\r\n VendorLocationID: data.VendorLocationID,\r\n movementTypeID: data.MovementTypeID,\r\n SourceLocationID: data.SourceLocationID || 0,\r\n DestinationLocationID: data.DestinationLocationID || 0,\r\n TransactionDate: data.TransactionDate || new Date(),\r\n AddedBy: UserID,\r\n StockNO: 0,\r\n MonthlyBalance: data.MonthlyBalance,\r\n StockMovementDetailArray: data.stocks,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVendorProductWriteOff(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/AddProductWriteOff\";\r\n const requestBody = {\r\n writeOffID: 0,\r\n productID: data.ProductID,\r\n productName: data.ProductName,\r\n quantity: data.Quantity,\r\n writeOffValue: data.WriteoffValue,\r\n writeOffReason: data.WriteOffReason,\r\n dateAdded: new Date(),\r\n vendoStorageLocationID: data.VendorStorageLocationID,\r\n VendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n statusID: 1,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddStockTakeItem(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/PostStockTakeItem\";\r\n const requestBody = {\r\n stockNO: data.StockNO,\r\n productID: data.ProductID,\r\n quantity: data.Quantity,\r\n previousQuantity: 0,\r\n dateAdded: data.StockDate,\r\n stockDate: data.StockDate,\r\n statusID: 1,\r\n addedBy: UserID,\r\n productPrice: data.ProductPrice,\r\n PurchasePrice: data.PurchasePrice,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateStockMovement(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/UpdateStockMovement\";\r\n const requestBody = {\r\n stockNO: data.StockNO,\r\n stockDate: data.StockDate,\r\n monthlyBalance: data.MonthlyBalance,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddStockTransfer(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/PostStockTransferTx\";\r\n const requestBody = {\r\n addedBy: UserID,\r\n vendorID: VendorID,\r\n sourceLocationID: data.VendorLocationID,\r\n shiftID: data.ShiftID,\r\n transferInfo: \"\",\r\n transferNO: \"\",\r\n transferDetailArray: data.stocks,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function DeleteStockTransfer(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/DeleteStockTransfer\";\r\n const requestBody = {\r\n addedBy: UserID,\r\n transferNO: data.TransferNO,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateStockTakeItem(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/UpdateStockTakeItem\";\r\n const requestBody = {\r\n ProductID: data.ProductID,\r\n Quantity: data.Quantity,\r\n PreviousQuantity: data.PreviousQuantity,\r\n PurchasePrice: data.PurchasePrice,\r\n StockDate: data.DateAdded,\r\n StockNO: data.StockNO,\r\n AddedBy: UserID,\r\n StockMovementDetailID: data.StockMovementDetailID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetStockMovement = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: movement, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorStockMovement?VendorLocationID=${VendorLocationID}&VendorID=${VendorID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { movement, error };\r\n};\r\n\r\nexport const GetStockMovementDetail = (StockNO, refresh) => {\r\n const { data: movement, error } = useApiRes(\r\n Main_URL + `Stock/GetVendorStockMovementDetail?StockNO=${StockNO}`,\r\n { refresh }\r\n );\r\n return { movement, error };\r\n};\r\n\r\nexport const GetStockTransfer = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: transfer, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetStockTransfer?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDAte=${end}`,\r\n { refresh }\r\n );\r\n return { transfer, error };\r\n};\r\n\r\nexport const GetStocInboundkTransfer = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: inbound, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetStockInTransfer?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { inbound, error };\r\n};\r\n\r\nexport function ReceiveTransfer(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/ReceiveStockTransferDetail\";\r\n const requestBody = {\r\n stockTransferDetailID: data.StockTransferDetailID,\r\n stockInTankID: data.StockInTankID,\r\n quantity: data.ReceivedQuantity,\r\n receivedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddProductPrice(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/SaveProductPrice\";\r\n const requestBody = {\r\n VendorID: VendorID,\r\n VendorLocationID: data.VendorLocationID,\r\n ProductID: data.ProductID,\r\n Amount: data.ProductPrice,\r\n AddedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddCashCollection(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/SaveVendorPaymentCollection\";\r\n const requestBody = {\r\n VendorID: VendorID,\r\n VendorLocationID: data.VendorLocationID,\r\n VendorPaymentMethodID: +data.VendorPaymentMethodID,\r\n CashDropCollectionID: 0,\r\n ClockNO: data.ClockNO,\r\n CollectionNO: 0,\r\n CollectedAmount: +data.Amount,\r\n AddedBy: UserID,\r\n CollectionTypeID: 1,\r\n Comment: data.Comment || \"\",\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddClockCashDrop(data) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n return fetch(Main_URL + \"Finance/SaveClockCashDrop\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n vendorID: VendorID,\r\n vendorPaymentMethodID: data.VendorPaymentMethodID,\r\n vendorLocationID: data.VendorLocationID,\r\n clockNO: data.ClockNO,\r\n amount: data.Amount,\r\n addedBy: UserID,\r\n cashDropTypeID: 0,\r\n refNO: data.Comment,\r\n }),\r\n });\r\n}\r\n\r\nexport function UpdateCashDrop(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/UpdateClockCashDrop\";\r\n const requestBody = {\r\n VendorCashDropID: data.VendorCashDropID,\r\n Amount: data.Amount,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetCashDrop = (ClockNO, refresh) => {\r\n const { data: drops, error } = useApiRes(\r\n Main_URL + `Finance/GetClockCashDrop?ClockNO=${ClockNO}`,\r\n { refresh }\r\n );\r\n return { drops, error };\r\n};\r\n\r\nexport const GetClockSummary = (ClockNO, refresh) => {\r\n const { data: summary, error } = useApiRes(\r\n Main_URL + `Sales/GetClockSaleSummaryDashBoard?ClockNO=${ClockNO}`,\r\n { refresh }\r\n );\r\n return { summary, error };\r\n};\r\n\r\nexport const GetVendorSalesDashboard = (VendorLocationID, refresh) => {\r\n const { data: summary, error } = useApiRes(\r\n Main_URL +\r\n `SalesReport/GetSalesDashBoardReport?VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { summary, error };\r\n};\r\n\r\nexport const GetVendorClockRTT = (ClockNO, refresh) => {\r\n const { data: rtt, error } = useApiRes(\r\n Main_URL + `Stock/GetClockRTT?ClockNO=${ClockNO}`,\r\n { refresh }\r\n );\r\n return { rtt, error };\r\n};\r\n\r\nexport const GetDailySHiftRTTDetail = (\r\n ClockDate,\r\n VendorLocationID,\r\n refresh\r\n) => {\r\n const { data: rtt, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorShiftDailyDetailRTT?ClockDate=${ClockDate}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { rtt, error };\r\n};\r\n\r\nexport function ReverseClockRTT(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/ReverseClockRTT\";\r\n const requestBody = {\r\n vendorRttID: data.VendorRTTID,\r\n clockNO: data.ClockNO,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ApproveClockRTT(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/ApproveClockRTT\";\r\n const requestBody = {\r\n vendorRttID: data.VendorRTTID,\r\n clockNO: data.ClockNO,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddClockRTT(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/AddVendorClockRTT\";\r\n const requestBody = {\r\n clockNO: data.ClockNO,\r\n vendorTankParentNozzleID: data.VendorTankParentNozzleID,\r\n shiftNO: data.ShiftNO,\r\n totalAmount: data.TotalAmount,\r\n productPrice: data.ProductPrice,\r\n productID: data.ProductID,\r\n tankID: data.TankID,\r\n addedBy: UserID,\r\n rttReason: data.RTTReason,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetShiftTransfer = (ClockNO, refresh) => {\r\n const { data: summary, error } = useApiRes(\r\n Main_URL + `Sales/GetClockSaleSummaryDashBoard?ClockNO=${ClockNO}`,\r\n { refresh }\r\n );\r\n return { summary, error };\r\n};\r\n\r\nexport const GetClockPumps = (ClockNO, VendorLocationID, refresh) => {\r\n const { data: summary, error } = useApiRes(\r\n Main_URL +\r\n `Supervisor/GetVendorLocationClockPump?VendorLocationID=${VendorLocationID}&ClockNO=${ClockNO}`,\r\n { refresh }\r\n );\r\n return { summary, error };\r\n};\r\n\r\nexport const GetCashDropCollection = (ClockNO, refresh) => {\r\n const { data: collection, error } = useApiRes(\r\n Main_URL + `Finance/GetUserClockPayment?ClockNO=${ClockNO}`,\r\n { refresh }\r\n );\r\n return { collection, error };\r\n};\r\n\r\nexport const GetDropCollection = (ClockNO, refresh) => {\r\n const { data: collection, error } = useApiRes(\r\n Main_URL + `Finance/GetClockPaymentCollection?ClockNO=${ClockNO}`,\r\n { refresh }\r\n );\r\n return { collection, error };\r\n};\r\n\r\nexport const GetClockMpesaCollection = (ClockNO, refresh) => {\r\n const { data: mpesa, error } = useApiRes(\r\n Main_URL + `Finance/GetUserClockPayment?ClockNO=${ClockNO}`,\r\n { refresh }\r\n );\r\n return { mpesa, error };\r\n};\r\n\r\nexport const GetClockMpesaAdmin = (ClockNO, VendorPaymentMethodID, refresh) => {\r\n const { data: mpesa, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetAdminUserClockPayment?ClockNO=${ClockNO}&VendorPaymentMethodID=${VendorPaymentMethodID}`,\r\n { refresh }\r\n );\r\n return { mpesa, error };\r\n};\r\n\r\nexport function GetPayments(values, refresh) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const controller = \"Finance/GetPaymentTransAction\";\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const url = `?VendorLocationID=${VendorLocationID}&VendorID=${VendorID}&StartDate=${start}&EndDate=${end}`;\r\n const {\r\n data: payment,\r\n loading: isLoading,\r\n // getData,\r\n } = useApiRes(Main_URL + controller + url, { refresh });\r\n\r\n return { payment, isLoading };\r\n}\r\n\r\nexport const GetUnusedPayments = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data: payment, error } = useApiRes(\r\n Main_URL +\r\n `TransAction/GetVendorUnusedAdminTransAction?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { payment, error };\r\n};\r\n\r\nexport const GetMarkedPayments = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: markedlist, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetMarkedTransAction?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n\r\n return { markedlist, error };\r\n};\r\n\r\nexport const GetParentTanks = (refresh) => {\r\n const { data: parent, error } = useApiRes(Main_URL + `Stock/GetTankParent`, {\r\n refresh,\r\n });\r\n return { parent, error };\r\n};\r\n\r\nexport function AddTankNozzle(data) {\r\n return fetch(Main_URL + \"Stock/AddVendorTankParentNozzle\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n TankParentID: data.TankID,\r\n AddedBy: UserID,\r\n NozzleID: data.NozzleID,\r\n }),\r\n });\r\n}\r\n\r\nexport function CloseClock(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Supervisor/CloseUserClock\";\r\n const requestBody = {\r\n ClockNO: data.ClockNO,\r\n varianceReason: data.VarianceReason,\r\n ExpectedAmount: data.TotalAmount,\r\n accountedAmount: data.AccountedAmount,\r\n varianceAmount: data.VarianceAmount,\r\n ClockedOutBy: UserID,\r\n StatusID: data.StatusID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ReopenClock(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Supervisor/ReOpenUserClock\";\r\n const requestBody = {\r\n ClockNO: data.ClockNO,\r\n AddedBy: UserID,\r\n VendorLocationID: data.VendorLocationID,\r\n clockDate: new Date(data.ClockDate),\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetPumpNozzles = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: nozzles, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorLocationPumpNozzle?VendorLocationID=${VendorLocationID}&VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { nozzles, error };\r\n};\r\n\r\nexport function AddPumpNozzle(data) {\r\n const VendorID = encryptSession.getItem(\"ci\");\r\n return fetch(Main_URL + \"Stock/AddVendorLocationPumpNozzle\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n NozzleName: data.NozzleName,\r\n PumpID: data.PumpID,\r\n AddedBy: UserID,\r\n VendorLocationID: data.VendorLocationID,\r\n VendorID: VendorID,\r\n TankParentID: data.TankParentID,\r\n }),\r\n });\r\n}\r\n\r\nexport function UpdatePumpNozzle(data) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n return fetch(Main_URL + \"Stock/UpdateVendorTankParentNozzle\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n NozzleID: data.NozzleID,\r\n VendorTankParentNozzleID: data.VendorTankParentNozzleID,\r\n NozzleName: data.NozzleName,\r\n PumpID: data.PumpID,\r\n AddedBy: UserID,\r\n VendorLocationID: data.VendorLocationID,\r\n VendorID: VendorID,\r\n TankParentID: data.TankParentID,\r\n }),\r\n });\r\n}\r\n\r\nexport function RemovePumpNozzle(data) {\r\n return fetch(Main_URL + \"Stock/RemoveVendorLocationPumpNozzle\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n NozzleID: data.NozzleID,\r\n AddedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetTankNozzle = (TankID, refresh) => {\r\n const { data: nozzles, error } = useApiRes(\r\n Main_URL + `Stock/GetVendorTankPumpNozzle?TankID=${TankID}`,\r\n { refresh }\r\n );\r\n return { nozzles, error };\r\n};\r\n\r\nexport function RemoveAssignment(NozzleID) {\r\n return fetch(Main_URL + \"Stock/RemoveVendorLocationTankNozzle\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n VendorTankNozzleID: NozzleID,\r\n StatusID: 2,\r\n }),\r\n });\r\n}\r\n\r\nexport function PostVendorCustomer(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Customer/PostVendorCustomer\";\r\n const requestBody = {\r\n customerName: data.CustomerName,\r\n customerPhone: data.CustomerPhone,\r\n VendorParentCardGroupID: data.VendorParentCardGroupID,\r\n countryCode: data.CountryCode,\r\n customerTypeID: data.CustomerTypeID,\r\n CustomerIdentityImageID: 0,\r\n customerMail: data.CustomerMail,\r\n kraPin: data.KraPin,\r\n openingBalance: data.OpeningBalance,\r\n creditLimit: data.CreditLimit,\r\n paymentTerms: data.PaymentTerms,\r\n addedBy: UserID,\r\n vendorID: VendorID,\r\n isPrepayCustomer: data.isPrepayCustomer,\r\n creditLimitNotification: data.CreditLimits,\r\n isCreditLimitMandatory: data.IsCreditLimitMandatory,\r\n fuelingLocationArray: data.FuelingLocationArray,\r\n customerAssetsArray: data.CustomerAssetsArray,\r\n cardArray: data.CardArray,\r\n stationID: data.StatusID || 1,\r\n usersArray: data.UsersArray,\r\n startDate: new Date(),\r\n endDate: new Date(new Date().setFullYear(new Date().getFullYear() + 2)),\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n result: asyncSubmit.result,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddCustomer(data) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n return fetch(Main_URL + \"Customer/AddVendorCustomer\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n CustomerName: data.CustomerName,\r\n CustomerPhone: data.CustomerPhone,\r\n CustomerMail: data.CustomerMail,\r\n OpeningBalance: data.OpeningBalance,\r\n CreditLimit: data.CreditLimit,\r\n PaymentTerms: data.PaymentTerms,\r\n KRAPin: data.KRAPin,\r\n AddedBy: UserID,\r\n VendorLocationID: data.VendorLocationID,\r\n VendorID: VendorID,\r\n IsCreditLimitMandatory: data.IsCreditLimitMandatory,\r\n CreditLimitNotification: data.CreditLimitNotification,\r\n }),\r\n });\r\n}\r\n\r\nexport function DeleteCustomer(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Customer/UpdateVendorCustomerStatus\";\r\n const requestBody = {\r\n customerID: data.CustomerID,\r\n addedBy: UserID,\r\n statusID: data.StatusID || 0,\r\n vendorID: VendorID,\r\n customerTypeID: data.CustomerTypeID,\r\n vendorParentCardGroupName: data.VendorParentCardGroupName,\r\n vendorName: data.VendorName,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddAsset(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Customer/AddVendorCustomerAsset\";\r\n const requestBody = {\r\n customerID: data.VendorCustomerID,\r\n assetName: data.AssetName,\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateCustomer(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Customer/UpdateVendorCustomer\";\r\n const requestBody = {\r\n OpeningBalance: data.OpeningBalance,\r\n prevOpeningBalance: data.PrevOpeningBalance,\r\n CustomerID: data.CustomerID,\r\n CustomerTypeID: data.CustomerTypeID,\r\n CustomerName: data.CustomerName,\r\n CustomerPhone: data.CustomerPhone,\r\n CustomerMail: data.CustomerMail,\r\n CreditLimit: data.CreditLimit,\r\n IsCreditLimitMandatory: data.IsCreditLimitMandatory,\r\n KRAPin: data.KRAPin,\r\n CreditLimitNotification: data.CreditLimitNotification,\r\n PaymentTerms: data.PaymentTerms,\r\n isWithholding: data.IsWithholding,\r\n isTemporary: data.IsTemporary,\r\n AddedBy: UserID,\r\n StartDate: data.StartDate,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddCustomerAssets(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Customer/AddVendorCustomerAsset\";\r\n const requestBody = {\r\n CustomerID: data.CustomerID,\r\n AssetName: data.AssetName,\r\n AddedBy: UserID,\r\n IsDelivery: data.IsDelivery,\r\n IsAssetStation: data.IsAssetStation,\r\n StationID: data.StationID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function RemoveCustomerAssets(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Customer/RemoveVendorCustomerAsset\";\r\n const requestBody = {\r\n assetID: data.AssetID,\r\n AddedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVendorLocation(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Admin/AddVendorLocation\";\r\n const requestBody = {\r\n VendorLocationID: 0,\r\n VendorID: VendorID,\r\n AddedBy: UserID,\r\n UserID: data.UserID,\r\n NozzleReadingTypeID: data.NozzleReadingTypeID,\r\n VendorLocationName: data.VendorLocationName,\r\n ContactPerson: data.ContactPerson,\r\n VendorLocationPhone: data.VendorLocationPhone,\r\n TradingName: data.TradingName,\r\n isStockMandatory: data.isMandatory ? 1 : 0,\r\n Slogan: \"\",\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetVendorLocationDetails = (VendorLocationID, refresh) => {\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Admin/GetVendorLocationDetails?VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport function UpdateVendorLocation(data) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n return fetch(Main_URL + \"Admin/UpdateVendorLocationDetails\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n vendorLocationID: data.VendorLocationID,\r\n vendorID: VendorID,\r\n vendorLocationName: data.VendorLocationName,\r\n contactPerson: data.ContactPerson,\r\n vendorLocationPhone: data.VendorLocationPhone,\r\n contactEmail: data.ContactEmail,\r\n address: data.Address,\r\n tradingName: data.TradingName,\r\n imageID: data.ImageID,\r\n nozzleReadingTypeID: data.NozzleReadingTypeID,\r\n ptsID: data.PtsID,\r\n acceptedVariance: data.AcceptedVariance,\r\n is24Hr: data.Is24Hr,\r\n isStockMandatory: data.IsStockMandatory,\r\n slogan: data.Slogan,\r\n minAcceptedVariance: data.MinAcceptedVariance,\r\n maxAcceptedVariance: data.MaxAcceptedVariance,\r\n shiftTimeAllowance: data.ShiftTimeAllowance,\r\n currencyCode: data.CurrencyCode,\r\n dipImageMandatory: data.DipImageMandatory,\r\n accountImageMandatory: data.AccountImageMandatory,\r\n nozzleImageMandatory: data.NozzleImageMandatory,\r\n dipShift: data.DipShift,\r\n addedBy: data.AddedBy,\r\n dateAdded: data.DateAdded,\r\n statusID: data.StatusID,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetProductCategory = (refresh) => {\r\n const { data: category, error } = useApiRes(\r\n Main_URL + `Stock/GetProductCategory`,\r\n { refresh }\r\n );\r\n return { category, error };\r\n};\r\n\r\nexport const GetVendorPaymentMethod = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: methods, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetVendorPaymentMethod?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { methods, error };\r\n};\r\n\r\nexport function AddVendorSupplierPayment(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/AddVendorSupplierTopUp\";\r\n const requestBody = {\r\n vendorSupplierID: data.SupplierID,\r\n vendorPaymentMethodID: data.VendorPaymentMethodID,\r\n referenceNO: data.ReferenceNO,\r\n topUpAmount: data.TotalAmount,\r\n addedBy: UserID,\r\n vendorID: VendorID,\r\n transactionDate: data.TransactionDate,\r\n vendorLocationID: data.VendorLocationID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetVendorPaymentMethodBalances = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: methods, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetPaymentMethodBalances?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { methods, error };\r\n};\r\n\r\nexport function AddVendorPaymentMethod(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/AddVendorPaymentMethod\";\r\n const requestBody = {\r\n vendorPaymentMethodID: 0,\r\n vendorPaymentMethodName: data.VendorPaymentMethodName,\r\n paymentMethodID: data.PaymentMethodID,\r\n openingBalance: data.OpeningBalance,\r\n holdingLimit: data.HoldingLimit,\r\n referenceNO: \"\",\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n isVisibleToAttendant: data.IsVisibleToAttendant,\r\n isHashed: data.IsHashed,\r\n isRecon: data.IsRecon,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateVendorPaymentMethod(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/UpdateVendorPaymentMethod\";\r\n const requestBody = {\r\n vendorPaymentMethodID: data.VendorPaymentMethodID,\r\n vendorPaymentMethodName: data.VendorPaymentMethodName,\r\n paymentMethodID: data.PaymentMethodID,\r\n openingBalance: data.OpeningBalance,\r\n holdingLimit: data.HoldingLimit,\r\n referenceNO: \"\",\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n isVisibleToAttendant: data.IsVisibleToAttendant,\r\n isHashed: data.IsHashed,\r\n isRecon: data.IsRecon,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function RemoveVendorPaymentMethod(data) {\r\n return fetch(Main_URL + \"Finance/RemoveVendorPaymentMethod\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n VendorPaymentMethodID: data.VendorPaymentMethodID,\r\n AddedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport function AddPumpAssignment(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Supervisor/AddUserPumpAssignmentTx\";\r\n const requestBody = {\r\n clockNO: data.ClockNO,\r\n userID: data.UserID,\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n pumpArray: [data.pumpx],\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetPumpsByClock = (VendorLocationID, ClockNO, refresh) => {\r\n const { data: cpumps, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetAttendantPumpNozzle?VendorLocationID=${VendorLocationID}&ClockNO=${ClockNO}`,\r\n { refresh }\r\n );\r\n return { cpumps, error };\r\n};\r\n\r\nexport function RemoveAssignePump(data) {\r\n return fetch(Main_URL + \"Supervisor/DeactivateUserPumpAssignment\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n userPumpAssignmentID: data.UserPumpAssignmentID,\r\n userID: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport function ConfirmNozzleReading(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/AcceptTankPumpNozzleReading\";\r\n const requestBody = {\r\n AddedBy: data.UserID,\r\n ShiftID: data.ShiftID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function OpenNozzleReading(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/OpenTankPumpNozzleReadings\";\r\n const requestBody = {\r\n clockNO: data.ClockNO,\r\n vendorTankParentNozzleID: data.VendorTankParentNozzleID,\r\n eOpeningReading: data.EOpeningReading,\r\n mOpeningReading: data.MOpeningReading,\r\n cOpeningReading: data.COpeningReading,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: data.UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function CloseNozzleReading(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/CloseTankPumpNozzleReadings\";\r\n const requestBody = {\r\n automationPumpTransactionID: data.AutomationPumpTransactionID,\r\n shiftID: data.ShiftID,\r\n VendorTankParentNozzleID: data.VendorTankParentNozzleID,\r\n eClosingReading: data.EClosingReading,\r\n mClosingReading: data.MClosingReading,\r\n cClosingReading: data.CClosingReading,\r\n closedBy: data.UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ResetDipReading(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/PostDipReadingVarianceReset\";\r\n const requestBody = {\r\n dipMonth: data.DipMonth,\r\n dipYear: data.DipYear,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVendorPurchase(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const currentTime = moment().format(\"HH:mm:ss\");\r\n const passedDate = moment(data.DateAdded).format(\"YYYY-MM-DD\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/PostVendorPurchaseTx\";\r\n const requestBody = {\r\n VendorID: VendorID,\r\n tankTransactionDeliveryID: data.tankTransactionDeliveryID,\r\n vendorSupplierTransporterAssetID: data.vendorSupplierTransporterAssetID,\r\n vendorSupplierTransporterID: data.vendorSupplierTransporterID,\r\n PurchaseNO: 0,\r\n shiftRefNO: data.ShiftRefNO,\r\n SupplierID: data.VendorSupplierID,\r\n VendorLocationID: data.VendorLocationID,\r\n OtherCost: data.OtherCost,\r\n AddedBy: UserID,\r\n DateAdded: `${passedDate} ${currentTime}`,\r\n TotalAmount: data.Subtotal + data.OtherCost,\r\n InvoiceNO: data.InvoiceNO,\r\n PurchaseDetailArray: data.rows,\r\n PurchasePaymentArray: data.payments,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateVendorPurchase(data, successFn, errorFn) {\r\n const currentTime = moment().format(\"HH:mm:ss\");\r\n const passedDate = moment(data?.DateAdded).format(\"YYYY-MM-DD\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/UpdateVendorPurchaseOrder\";\r\n const requestBody = {\r\n vendorPurchaseID: data.VendorPurchaseID,\r\n supplierID: data.SupplierID,\r\n otherCost: data.OtherCost,\r\n dateAdded: `${passedDate} ${currentTime}`,\r\n totalAmount:\r\n data.DetailArray?.reduce(\r\n (a, b) => a + b.Quantity * b.PurchasePrice * (1 + b.BuyingTax),\r\n 0\r\n ) + +data.OtherCost,\r\n invoiceNO: data.InvoiceNO,\r\n shiftRefNO: data.ShiftRefNO,\r\n addedBy: UserID,\r\n statusID: 1,\r\n purchaseDetailArray: data.DetailArray,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ReceiveVendorPurchase(data) {\r\n return fetch(Main_URL + \"Stock/ReceivePurchaseDelivery\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n vendorPurchaseID: data.VendorPurchaseID,\r\n invoiceNO: data.InvoiceNO,\r\n addedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport function ReverseVendorPurchase(data) {\r\n return fetch(Main_URL + \"Stock/ReversePurchase\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n vendorPurchaseID: data.VendorPurchaseID,\r\n purchaseNO: data.PurchaseNO,\r\n invoiceNO: data.InvoiceNO,\r\n addedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport function AddVendorPurchasePayment(data) {\r\n return fetch(Main_URL + \"Stock/AddPurchasePayment\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n purchaseNO: data.PurchaseNO,\r\n amountPaid: data.AmountPaid,\r\n vendorPaymentMethodID: data.VendorPaymentMethodID,\r\n referenceNO: data.ReferenceNO,\r\n addedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetDashBoardData = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: dashboard, mutate } = useApiRes(\r\n Main_URL +\r\n `AdminReport/GetAdminDashBoardReport?StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { dashboard, mutate };\r\n};\r\n\r\nexport const GetVolumeSalesPerCategory = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: salescategory } = useApiRes(\r\n Main_URL +\r\n `SalesReport/GetProductCategoryDailySales?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { salescategory };\r\n};\r\n\r\nexport const GetSalesPerCategoryPredictions = (VendorLocationID, refresh) => {\r\n const { data: predictions } = useApiRes(\r\n Main_URL +\r\n `SalesReport/PredictMonthlySalesByCategory?VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { predictions };\r\n};\r\n\r\nexport const GetThisMonthDashBoardData = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: thimonth, mutate } = useApiRes(\r\n Main_URL +\r\n `AdminReport/GetAdminDashBoardReport?StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { thimonth, mutate };\r\n};\r\n\r\nexport const GetDailySalesReport = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: dsr, error } = useApiRes(\r\n Main_URL +\r\n `SalesReport/GetDailySalesReport?StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { dsr, error };\r\n};\r\n\r\nexport const GetUserSalesReport = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: udsr, error } = useApiRes(\r\n Main_URL +\r\n `SalesReport/GetUserSalesReport?StartDate=${start}&EndDate=${end}&UserID=${UserID}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { udsr, error };\r\n};\r\n\r\nexport function AddVendorSupplier(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Admin/PostVendorSupplier\";\r\n const requestBody = {\r\n VendorSupplierID: 0,\r\n VendorID: VendorID,\r\n AddedBy: UserID,\r\n VendorSupplierName: data.SupplierName,\r\n ContactName: data.SupplierName,\r\n ContactPhone: data.ContactPhone,\r\n AssetMileage: data.AssetMileage,\r\n ContactEmail: data.ContactEmail,\r\n kraPin: data.KRAPin,\r\n OpeningBalance: data.OpeningBalance,\r\n supplierLocationArray: data.StationArray,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetVendorSupplier = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: supplier, error } = useApiRes(\r\n Main_URL + `Admin/GetVendorSupplier?VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { supplier, error };\r\n};\r\n\r\nexport const GetVendorSupplierAllStatement = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: supplier, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetAllSupplierVendorStatement?VendorSupplierID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { supplier, error };\r\n};\r\n\r\nexport const GetVendorSupplierList = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: supplier, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetVendorSupplierList?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { supplier, error };\r\n};\r\n\r\nexport const GetVendorDebtors = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID, CustomerTypeID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: debtors, error } = useApiRes(\r\n Main_URL +\r\n `Customer/GetVendorDebtors?VendorLocationID=${VendorLocationID}&VendorID=${VendorID}&CustomerTypeID=${CustomerTypeID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { debtors, error };\r\n};\r\n\r\nexport const GetVendorSupplierStatement = (values, refresh) => {\r\n const { DateRange, SupplierID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: statement, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetVendorSupplierStatement?SupplierID=${SupplierID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { statement, error };\r\n};\r\n\r\nexport const GetVendorSupplierPurchases = (values, refresh) => {\r\n const { DateRange, SupplierID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: purchase, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorSupplierPurchase?StartDate=${start}&EndDate=${end}&SupplierID=${SupplierID}`,\r\n { refresh }\r\n );\r\n return { purchase, error };\r\n};\r\n\r\nexport const GetVendorSupplierPayments = (values, refresh) => {\r\n const { DateRange, SupplierID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: payments, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetSupplierPayment?VendorSupplierID=${SupplierID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { payments, error };\r\n};\r\n\r\nexport const GetVendorCustomerCreditNote = (CustomerID, refresh) => {\r\n // const { DateRange, VendorLocationID } = values;\r\n // const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n // const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: creditnote, error } = useApiRes(\r\n Main_URL + `Finance/GetVendorCustomerCreditNote?CustomerID=${CustomerID}`,\r\n { refresh }\r\n );\r\n return { creditnote, error };\r\n};\r\n\r\nexport function AddVendorCustomerCreditNote(data, successFn, errorFn) {\r\n const currentTime = moment().format(\"HH:mm:ss\");\r\n const passedDate = moment(data.DateAdded).format(\"YYYY-MM-DD\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/AddVendorCreditNote\";\r\n const requestBody = {\r\n creditNoteID: 0,\r\n customerID: data.VendorCustomerID,\r\n vendorLocationID: data.VendorLocationID,\r\n dateAdded: `${passedDate} ${currentTime}`,\r\n amount: data.Amount,\r\n statusID: 1,\r\n description: data.Description,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetVendorCustomerOverdraft = (values, refresh) => {\r\n const { DateRange, CustomerID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetVendorCustomerOverdraft?StartDate=${start}&EndDate=${end}&CustomerID=${CustomerID}`,\r\n { refresh }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport function AddVendorCustomerOverdraft(data, successFn, errorFn) {\r\n const currentTime = moment().format(\"HH:mm:ss\");\r\n const passedDate = moment(data.DateAdded).format(\"YYYY-MM-DD\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/AddVendorCustomerOverdraft\";\r\n const requestBody = {\r\n customerOverdraftID: 0,\r\n customerID: data.customerID,\r\n amount: data.amount,\r\n description: data.description,\r\n expiryDate: data.expiryDate,\r\n dateAdded: `${passedDate} ${currentTime}`,\r\n statusID: 1,\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function DeleteVendorCustomerOverdraft(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/DeleteVendorCustomerOverdraft\";\r\n const requestBody = {\r\n customerOverdraftID: data?.CustomerOverdraftID,\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function DeleteVendorSupplierPayment(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/ReverseVendorSupplierTopUp\";\r\n const requestBody = {\r\n vendorSupplierTopUpID: data?.VendorSupplierTopUpID,\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateVendorCustomerCreditNote(data, successFn, errorFn) {\r\n const currentTime = moment().format(\"HH:mm:ss\");\r\n const passedDate = moment(data.DateAdded).format(\"YYYY-MM-DD\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/UpdateVendorCreditNote\";\r\n const requestBody = {\r\n creditNoteID: data.CreditNoteID,\r\n customerID: data.CustomerID,\r\n dateAdded: `${passedDate} ${currentTime}`,\r\n amount: data.Amount,\r\n statusID: 0,\r\n description: data.Description,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetVendorCustomerDebitNote = (CustomerID, refresh) => {\r\n // const { DateRange, VendorLocationID } = values;\r\n // const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n // const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: creditnote, error } = useApiRes(\r\n Main_URL + `Finance/GetVendorCustomerDebitNote?CustomerID=${CustomerID}`,\r\n { refresh }\r\n );\r\n return { creditnote, error };\r\n};\r\n\r\nexport function AddVendorCustomerDebitNote(data, successFn, errorFn) {\r\n const currentTime = moment().format(\"HH:mm:ss\");\r\n const passedDate = moment(data.DateAdded).format(\"YYYY-MM-DD\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/AddVendorDebitNote\";\r\n const requestBody = {\r\n creditNoteID: 0,\r\n customerID: data.VendorCustomerID,\r\n vendorLocationID: data.VendorLocationID,\r\n dateAdded: `${passedDate} ${currentTime}`,\r\n amount: data.Amount,\r\n statusID: 1,\r\n description: data.Reason,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function DeleteVendorCustomerDebitNote(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/UpdateVendorDebitNote\";\r\n const requestBody = {\r\n debitNoteID: data.DebitNoteID,\r\n customerID: data.CustomerID,\r\n dateAdded: data.DateAdded,\r\n amount: data.Amount,\r\n description: data.Decription,\r\n statusID: 0,\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddDipFuelTesting(data) {\r\n return fetch(Main_URL + \"Stock/AddTankDipTesting\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n DipNO: data.DipNO,\r\n Quantity: data.Quantity,\r\n AddedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetPurchase = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: purchase, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorPurchase?StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}&VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { purchase, error };\r\n};\r\n\r\nexport const GetProductPerfomance = (VendorLocationID, refresh) => {\r\n const { data: report, error } = useApiRes(\r\n Main_URL +\r\n `SalesReport/GetProductReport?VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { report, error };\r\n};\r\n\r\nexport const GetFuelStockReport = (\r\n VendorLocationID,\r\n DateRange,\r\n TankParentID,\r\n refresh\r\n) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: report, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorTankParentDip?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}&TankParentID=${TankParentID}`,\r\n { refresh }\r\n );\r\n return { report, error };\r\n};\r\n\r\nexport const GetWetStockStockVariance = (\r\n VendorLocationID,\r\n DateRange,\r\n TankParentID,\r\n refresh\r\n) => {\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: report, error } = useApiRes(\r\n Main_URL +\r\n `StockReport/GetVendorWetSTockVariance?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}&TankParentID=${TankParentID}`,\r\n { refresh }\r\n );\r\n return { report, error };\r\n};\r\n\r\nexport const GetVendorTankParent = (VendorLocationID, ClockDate, refresh) => {\r\n const dateadded = ClockDate\r\n ? ClockDate\r\n : DateTimeFormat(new Date(), \"dateonly\");\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: parent, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorTankParent?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}&ClockDate=${dateadded}`,\r\n { refresh }\r\n );\r\n return { parent, error };\r\n};\r\n\r\nexport function RerunCummulativeVariance(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/PostDipReadingVarianceReset\";\r\n const requestBody = {\r\n dipMonth: data.DipMonth,\r\n dipYear: data.DipYear,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetVendorTankByParent = (VendorLocationID, ParentID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: tank, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorTankByParent?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}&TankParentID=${ParentID}`,\r\n { refresh }\r\n );\r\n return { tank, error };\r\n};\r\n\r\nexport function UpdateProduct(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/UpdateVendorProduct\";\r\n const requestBody = {\r\n productName: data.ProductName,\r\n productImageID: data.ProductImageID,\r\n uom: data.UOM,\r\n buyingTax: data.TaxRate,\r\n sellingTax: data.TaxRate,\r\n IsStockItem: data.IsStockItem ? 1 : 0,\r\n productCategoryID: data.ProductCategoryID,\r\n productCategoryBrandID: data.productCategoryBrandID,\r\n productVolumeSizeID: data.productVolumeSizeID,\r\n productCategoryTypeID: data.ProductCategoryTypeID,\r\n addedBy: UserID,\r\n productID: data.ProductID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function DeleteVendorProduct(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/RemoveVendorProduct\";\r\n const requestBody = {\r\n AddedBy: UserID,\r\n ProductID: data.ProductID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetVendorProductCategory = (VendorLocationID, refresh) => {\r\n const { data: category, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorProductCategory?VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { category, error };\r\n};\r\n\r\nexport const GetVendorAllProducts = (refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: allProduct, error } = useApiRes(\r\n Main_URL + `Stock/GetVendorProduct?VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { allProduct, error };\r\n};\r\n\r\nexport const SearchVendorProduct = (searchText, refresh) => {\r\n const { data: suggestion, error } = useApiRes(\r\n Main_URL + `Stock/SearchVendorProduct?SearchTerm=${searchText}`,\r\n { refresh }\r\n );\r\n return { suggestion, error };\r\n};\r\n\r\nexport const GetVendorProfile = (refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: profile, error } = useApiRes(\r\n Main_URL + `Admin/GetVendorProfile?VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { profile, error };\r\n};\r\n\r\nexport const GetVendorInvoice = (refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: invoice, error } = useApiRes(\r\n Main_URL + `CratoAdmin/GetInvoicesForVendor?VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { invoice, error };\r\n};\r\n\r\nexport const GetVendorPayments = (refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: payments, error } = useApiRes(\r\n Main_URL + `CratoAdmin/GetPaymentsForVendor?VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { payments, error };\r\n};\r\n\r\nexport const GetVendorStatement = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: statement, error } = useApiRes(\r\n Main_URL +\r\n `CratoAdmin/GetCratoAdminVendorStatement?VendorID=${VendorID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { statement, error };\r\n};\r\n\r\nexport function AddVendorAccountPayment(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Account/RequestSTKPush\";\r\n const requestBody = {\r\n phoneNumber: data.PhoneNumber,\r\n invoiceNO: data.InvoiceNO,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ConfirmAccountPayment(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Account/CompleteServicePayment\";\r\n const requestBody = {\r\n transID: data.TransID,\r\n invoiceNO: data.InvoiceNO,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function CheckSTKPushAccountPayment(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL =\r\n Main_URL +\r\n `Account/CheckStkPush?CheckoutRequestID=${data.CheckoutRequestID}`;\r\n const requestBody = {\r\n phoneNumber: data.PhoneNumber,\r\n invoiceNO: data.InvoiceNO,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n result: asyncSubmit.result,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function CompleteAccountPayment(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Account/RequestSTKPush\";\r\n const requestBody = {\r\n phoneNumber: data.PhoneNumber,\r\n invoiceNO: data.InvoiceNO,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetCashClockSales = (ClockNO, refresh) => {\r\n const { data: sales, error } = useApiRes(\r\n Main_URL + `Sales/GetClockAllSales?ClockNO=${ClockNO}`,\r\n { refresh }\r\n );\r\n return { sales, error };\r\n};\r\n\r\nexport const GetShiftDailySales = (ClockDate, VendorLocationID, refresh) => {\r\n const { data: sales, error } = useApiRes(\r\n Main_URL +\r\n `Sales/GetShiftDailyDetailSales?ClockDate=${ClockDate}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { sales, error };\r\n};\r\n\r\nexport const GetShiftDipReading = (ShiftRefNO, refresh) => {\r\n const { data: dips, error } = useApiRes(\r\n Main_URL + `Stock/GetShiftDipReading?ShiftRefNO=${ShiftRefNO}`,\r\n { refresh }\r\n );\r\n return { dips, error };\r\n};\r\n\r\nexport function AddSalePayment(data) {\r\n return fetch(Main_URL + \"Finance/UsePaymentCollection\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n VendorPaymentCollectionID: data.VendorPaymentCollectionID,\r\n VendorPaymentMethodID: data.VendorPaymentMethodID,\r\n SaleID: data.SaleID,\r\n TransID: data.TransID,\r\n TransAmount: data.TransAmount,\r\n AddedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetCustomerPrePayment = (refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: prepayment, error } = useApiRes(\r\n Main_URL + `Finance/GetVendorPrepayAccount?VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { prepayment, error };\r\n};\r\n\r\nexport function AddSalesTX(data) {\r\n return fetch(Main_URL + \"Finance/UsePaymentCollection\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n UserID: UserID,\r\n ClockNO: \"string\",\r\n VendorID: 0,\r\n VendorLocationID: 0,\r\n CustomerID: 0,\r\n AssetID: 0,\r\n TotalAmount: 0,\r\n SaleID: \"string\",\r\n SaleDetailArray: [\r\n {\r\n ShiftNO: \"string\",\r\n ProductID: 0,\r\n PumpID: 0,\r\n VendorTankParentNozzleID: 0,\r\n ProductPrice: 0,\r\n Quantity: 0,\r\n TotalAmount: 0,\r\n },\r\n ],\r\n SalePaymentArray: [],\r\n }),\r\n });\r\n}\r\n\r\nexport const GetPrimaryTopupType = (VendorLocationID, refresh) => {\r\n const { data: types, error } = useApiRes(\r\n Main_URL + `Finance/GetPrimaryTopUpType`,\r\n { refresh }\r\n );\r\n return { types, error };\r\n};\r\n\r\nexport const GetDailyShiftNonshift = (ClockDate, VendorLocationID, refresh) => {\r\n const { data: nonshift, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetShiftDailyDetailNonShift?ClockDate=${ClockDate}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { nonshift, error };\r\n};\r\n\r\nexport function AddVendorTopUpType(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/AddVendorTopupType\";\r\n const requestBody = {\r\n vendorTopUpTypeName: data.VendorTopUpTypeName,\r\n topUpTypeID: data.TopUpTypeID,\r\n addedBy: UserID,\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetVendorTopUpTypes = (VendorLocationID, refresh) => {\r\n const { data: types, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetVendorTopUpType?VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { types, error };\r\n};\r\n\r\nexport function AddCustomerTopUp(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/SaveClockTopUp\";\r\n const requestBody = {\r\n vendorID: VendorID,\r\n vendorPaymentMethodID: data.VendorPaymentMethodID,\r\n vendorLocationID: data.VendorLocationID,\r\n clockNO: data.ClockNO,\r\n ShiftClockNO: data.ShiftClockNO,\r\n amount: data.Amount,\r\n UserID: data.UserID,\r\n addedBy: UserID,\r\n topUpTypeID: data.TopUpTypeID,\r\n vendorTopUpTypeID: data.VendorTopUpTypeID,\r\n customerID: data.CustomerID,\r\n refNO: data.ReferenceNO,\r\n comment: data.Comment,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddCustomerPrepayment(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/AddVendorTopUpPrepay\";\r\n const requestBody = {\r\n vendorCustomerID: data?.VendorCustomerID,\r\n vendorPaymentMethodID: data?.VendorPaymentMethodID,\r\n referenceNO: data?.ReferenceNO,\r\n topUpAmount: data?.Amount,\r\n addedBy: UserID,\r\n vendorID: VendorID,\r\n transactionDate: data?.TransactionDate,\r\n vendorLocationID: data?.VendorLocationID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ReverseCustomerTopUp(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/ReverseClockTopUp\";\r\n const requestBody = {\r\n vendorTopUpID: data.VendorTopUpID,\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AdminReverseCustomerTopUp(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/ReverseVendorTopUpPrepay\";\r\n const requestBody = {\r\n vendorCustomerTopUpID: data.VendorCustomerTopUpID,\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetStockLevel = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: stocks, loading: isLoading } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorStockLevel?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { stocks, isLoading };\r\n};\r\n\r\nexport const GetVendorLocationStockLevel = (values, refresh) => {\r\n const { DateRange, VendorLocationID, ProductCategoryID, StoreID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: stocks, loading: isLoading } = useApiRes(\r\n Main_URL +\r\n `StockReport/GetProductStockLevel?StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}&ProductCategoryID=${ProductCategoryID}&StoreID=${StoreID}`,\r\n { refresh }\r\n );\r\n return { stocks, isLoading };\r\n};\r\n\r\nexport function UpdateStockLevel(data) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n return fetch(Main_URL + \"Stock/UpdateStockLevel\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n StockLevelID: data.StockLevelID,\r\n Quantity: data.Quantity,\r\n vendorStorageLocationID: data.VendorStorageLocationID,\r\n PreviousQuantity: data.PreviousQty,\r\n ProductID: data.ProductID,\r\n VendorID: VendorID,\r\n VendorLocationID: data.VendorLocationID,\r\n AddedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetExpense = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: expense, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetVendorExpense?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { expense, error };\r\n};\r\n\r\nexport function AddVendorExpense(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/AddVendorExpense\";\r\n const requestBody = {\r\n ClockNO: data.ClockNO ? data.ClockNO : \"\",\r\n shiftClockNo: data.ShiftClockNo,\r\n VendorPaymentMethodID: data.VendorPaymentMethodID,\r\n UserID: UserID,\r\n customerID: data.CustomerID,\r\n VendorID: VendorID,\r\n VendorLocationID: data.VendorLocationID,\r\n Description: data.Description,\r\n ExpenseAmount: data.ExpenseAmount,\r\n VendorExpenseTypeID: data.VendorExpenseTypeID,\r\n AddedBy: UserID,\r\n transactionDate: data.TransactionDate,\r\n type: data.ClockNO ? 0 : 1,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateVendorExpense(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/UpdateVendorExpense\";\r\n const requestBody = {\r\n vendorExpenseID: data.VendorExpenseID,\r\n description: data.Description,\r\n transactionDate: data.TransactionDate,\r\n actionedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ReverseVendorSale(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Sales/ReverseSaleTx\";\r\n const requestBody = {\r\n UserID: UserID,\r\n SaleID: data.SaleID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateDipReading(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/UpdateDipReading\";\r\n const requestBody = {\r\n DipID: data.DipID,\r\n NewReading: data.NewReading,\r\n VendorLocationID: data.VendorLocationID,\r\n DateDipped: new Date(data.DateDipped),\r\n AddedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetAccounts = (refresh) => {\r\n const { data: accounts, error } = useApiRes(\r\n Main_URL + `Finance/GetAccounts`,\r\n { refresh }\r\n );\r\n return { accounts, error };\r\n};\r\n\r\nexport function UpdateNozzleReading(data, successFn, errorFn) {\r\n const noerrorcheck = true;\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/UpdateTankPumpNozzleReadings\";\r\n const requestBody = {\r\n shiftID: data.ShiftID,\r\n clockNO: data.ClockNO,\r\n eOpeningReading: +data.EOpeningReading,\r\n mOpeningReading: +data.MOpeningReading,\r\n cOpeningReading: +data.COpeningReading,\r\n eClosingReading: +data.EClosingReading,\r\n mClosingReading: +data.MClosingReading,\r\n cClosingReading: +data.CClosingReading,\r\n VendorLocationID: data.VendorLocationID,\r\n changeType: data.changeType,\r\n closedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody, noerrorcheck);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetPaymentMethod = (refresh) => {\r\n const { data: pmethods, error } = useApiRes(\r\n Main_URL + `Finance/GetPaymentMethod`,\r\n { refresh }\r\n );\r\n return { pmethods, error };\r\n};\r\n\r\nexport const GetLotSUmmary = (\r\n VendorLocationID,\r\n ShiftNO,\r\n clockType,\r\n refresh\r\n) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: lots, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetLotRecon?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}&LotDate=${ShiftNO}&ClockTypeID=${clockType}`,\r\n { refresh }\r\n );\r\n return { lots, error };\r\n};\r\n\r\nexport const GetShiftSUmmary = (\r\n VendorLocationID,\r\n ShiftNO,\r\n ShiftDate,\r\n refresh\r\n) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: summary, error } = useApiRes(\r\n Main_URL +\r\n `SalesReport/GetShiftSummaryReport?ShiftDate=${ShiftDate}&ShiftTypeID=1&VendorLocationID=${VendorLocationID}&VendorID=${VendorID}&LotNO=${ShiftNO}`,\r\n { refresh }\r\n );\r\n return { summary, error };\r\n};\r\n\r\nexport const GetShiftDetailedReport = (\r\n VendorLocationID,\r\n ShiftClockNo,\r\n refresh\r\n) => {\r\n const { data: report, error } = useApiRes(\r\n Main_URL +\r\n `SalesReport/GetShiftSummaryResult?VendorLocationID=${VendorLocationID}&ShiftClockNO=${ShiftClockNo}`,\r\n { refresh }\r\n );\r\n return { report, error };\r\n};\r\n\r\nexport const GetLotCollection = (\r\n VendorLocationID,\r\n ShiftNO,\r\n clockType,\r\n refresh\r\n) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: collection, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetLotCollection?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}&LotDate=${ShiftNO}&ClockTypeID=${clockType}`,\r\n { refresh }\r\n );\r\n return { collection, error };\r\n};\r\n\r\nexport function AddLotCollection(data, VendorLocationID, ShiftNO) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n return fetch(Main_URL + \"Finance/PostVendorLotCollectionTx\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n UserID: UserID,\r\n LotNO: moment(ShiftNO).format(\"YYYYMMDD\"),\r\n VendorID: VendorID,\r\n VendorLocationID: VendorLocationID,\r\n LotCollectionArray: [data],\r\n }),\r\n });\r\n}\r\n\r\nexport function ReverseMarkedPayment(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/ReverseMarkedPayment\";\r\n const requestBody = {\r\n id: data.ID,\r\n userClockPaymentTransActionID: data.ID,\r\n reversedBy: UserID,\r\n transID: data.TransID,\r\n reversedAmount: data.TransAmount,\r\n clockNO: data.ClockNO,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ApproveExpense(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/ApproveVendorExpense\";\r\n const requestBody = {\r\n VendorExpenseID: data.VendorExpenseID,\r\n ApprovedAmount: data.ApprovedAmount,\r\n ActionedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function RejectExpense(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/RejectVendorExpense\";\r\n const requestBody = {\r\n VendorExpenseID: data.VendorExpenseID,\r\n comment: \"\",\r\n ActionedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function DeactivatePayment(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/DeactivateTransAction\";\r\n const requestBody = {\r\n ID: data.ID,\r\n UserID: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ReactivatePayment(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/ReActivateTransAction\";\r\n const requestBody = {\r\n ID: data.ID,\r\n UserID: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ReopenNozzle(data, successFn, errorFn) {\r\n const noerrorcheck = true;\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/ReopenTankPumpNozzleReading\";\r\n const requestBody = {\r\n ShiftNO: data.ShiftNO,\r\n ClockNO: data.ClockNO,\r\n AddedBy: UserID,\r\n ShiftID: data.ShiftID,\r\n VendorLocationID: data.VendorLocationID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody, noerrorcheck);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ReverseCollection(data, successFn, errorFn) {\r\n const noerrorcheck = true;\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/ReverseCollection\";\r\n const requestBody = {\r\n VendorPaymentCollectionID: data.VendorPaymentCollectionID,\r\n CollectionNO: data.CollectionNO,\r\n ClockNO: data.ClockNO,\r\n ReversedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody, noerrorcheck);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function BillClockAttendant(data) {\r\n return fetch(Main_URL + \"Finance/PostUserClockBilling\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n ClockNO: data.ClockNO,\r\n UserID: data.UserID,\r\n BillingAmount: data.Variance,\r\n Comment: data.Comment,\r\n AddedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport function UserAccountPayment(data) {\r\n return fetch(Main_URL + \"Finance/PostUserClockBillPayment\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n VendorPaymentMethodID: data.VendorPaymentMethodID,\r\n PaidAmount: data.PaidAmount,\r\n UserClockBillingAccountID: data.UserClockBillingAccountID,\r\n Comment: data.Comment,\r\n AddedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetPumpAssignment = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: assignment, error } = useApiRes(\r\n Main_URL +\r\n `Supervisor/GetUserPumpAssignment?VendorLocationID=${VendorLocationID}&VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { assignment, error };\r\n};\r\n\r\nexport const GetUserDeductions = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: variace, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetVendorUserClockAccount?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { variace, error };\r\n};\r\n\r\nexport const GetClockExpense = (ClockNO, refresh) => {\r\n const { data: expense, error } = useApiRes(\r\n Main_URL + `Finance/GetVendorClockExpense?ClockNO=${ClockNO}`,\r\n { refresh }\r\n );\r\n return { expense, error };\r\n};\r\n\r\nexport const GetClockDiscount = (ClockNO, refresh) => {\r\n const { data, error } = useApiRes(\r\n Main_URL + `FinanceReport/GetVendorClockDiscount?ClockNO=${ClockNO}`,\r\n { refresh }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport function ActionClockDiscount(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/ApproveRejectClockDiscount\";\r\n const requestBody = {\r\n saleID: data.SaleID,\r\n statusID: data.StatusID,\r\n ActionedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetDailyShiftExpense = (ClockDate, VendorLocationID, refresh) => {\r\n const { data: expense, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetShiftDailyDetailExpense?ClockDate=${ClockDate}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { expense, error };\r\n};\r\n\r\nexport const GetClockSales = (ClockNO,VendorLocationID, refresh) => {\r\n const { data: sales, error } = useApiRes(\r\n Main_URL + `Sales/GetClockAllSales?ClockNO=${ClockNO}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { sales, error };\r\n};\r\n\r\nexport const GetCustomerSales = (CustomerID, DateRange, refresh) => {\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: sales, error } = useApiRes(\r\n Main_URL +\r\n `Sales/GetCustomerSaleHistory?CustomerID=${CustomerID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { sales, error };\r\n};\r\n\r\nexport function PostClockSale(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const currentTime = moment().format(\"HH:mm:ss\");\r\n const passedDate = moment(data.DateAdded).format(\"YYYY-MM-DD\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Sales/PostVendorSale\";\r\n const requestBody = {\r\n userID: UserID,\r\n clockNO: data.ClockNO,\r\n AssetMileage: data.AssetMileage,\r\n DateAdded: `${passedDate} ${currentTime}`,\r\n isStation: 0,\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n customerID: data.CustomerID,\r\n customerTypeID: data.CustomerTypeID,\r\n assetID: data.AssetID,\r\n totalAmount: data.TotalAmount,\r\n MoreInfo: data.MoreInfo || \"\",\r\n saleID: \"0\",\r\n saleDetailArray: data.selected,\r\n salePaymentArray: data.receipt,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function PostClockPoints(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostScanReceipt\";\r\n const requestBody = {\r\n saleID: data.SaleID,\r\n addedBy: UserID,\r\n vendorCustomerID: data.CustomerID,\r\n vendorCustomerCardID: data.VendorCustomerCardID,\r\n vendorCustomerCardChildID: data.VendorCustomerCardChildID,\r\n pumpImageID: \"\",\r\n vehicleImageID: \"0\",\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateClockSale(data, successFn, errorFn) {\r\n const currentTime = moment().format(\"HH:mm:ss\");\r\n const passedDate = moment(data.DateAdded).format(\"YYYY-MM-DD\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Supervisor/UpdateSaleData\";\r\n const requestBody = {\r\n saleOrder: {\r\n id: data.ID,\r\n receivedAmount: data.ReceivedAmount,\r\n TotalAmount: data?.SaleDetailArray?.filter(\r\n (p) => p.StatusID === 1\r\n )?.reduce((a, b) => {\r\n return +a + +b.TotalAmount;\r\n }, 0),\r\n dateAdded: `${passedDate} ${currentTime}`,\r\n moreInfo: data.MoreInfo,\r\n },\r\n saleOrderInvoice: {\r\n saleOrderInvoiceID: 0,\r\n saleID: data.SaleID,\r\n customerID: data.CustomerID,\r\n assetID: data.AssetID,\r\n },\r\n saleDetails: data?.SaleDetailArray,\r\n addedBy: UserID,\r\n ClockNO: data.ClockNO,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetCustomerUsers = (CustomerID, refresh) => {\r\n const { data: users, error } = useApiRes(\r\n Main_URL + `Customer/GetVendorCustomerUsers?CustomerID=${CustomerID}`,\r\n { refresh }\r\n );\r\n return { users, error };\r\n};\r\n\r\nexport const GetShiftRefs = (VendorLocationID, date, refresh) => {\r\n const newDate = moment(date).format(\"YYYY-MM-DD\");\r\n const { data: ShiftInfoList, error } = useApiRes(\r\n Main_URL +\r\n `Supervisor/GetShiftRefNosByDateAndVendorLocation?DateClockedIN=${newDate}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { ShiftInfoList, error };\r\n};\r\n\r\nexport const GetCustomerPayments = (CustomerID, DateRange, refresh) => {\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: payments, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetCustomerPayment?CustomerID=${CustomerID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { payments, error };\r\n};\r\n\r\nexport const GetCustomerStations = (CustomerID, refresh) => {\r\n const { data: stations, error } = useApiRes(\r\n Main_URL + `Customer/GetVendorCustomerLocation?CustomerID=${CustomerID}`,\r\n { refresh }\r\n );\r\n return { stations, error };\r\n};\r\n\r\nexport function AddCustomerLocation(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Customer/AddCustomerFuelingLocation\";\r\n const requestBody = {\r\n vendorLocationID: data.VendorLocationID,\r\n vendorID: VendorID,\r\n vendorCustomerID: data.VendorCustomerID,\r\n contactEmail: \"\",\r\n vendorLocationPhone: \"\",\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function DeleteCustomerLocation(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Customer/DeleteCustomerFuelingLocation\";\r\n const requestBody = {\r\n vendorCustomerLocationID: data.VendorCustomerLocationID,\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetCustomerDiscount = (CustomerID, refresh) => {\r\n const { data: discount, error } = useApiRes(\r\n Main_URL + `Finance/GetVendorCustomerDiscount?CustomerID=${CustomerID}`,\r\n { refresh }\r\n );\r\n return { discount, error };\r\n};\r\n\r\nexport function PostCustomerDiscount(data) {\r\n console.log(data);\r\n return fetch(Main_URL + \"Finance/AddVendorCustomerDiscount\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n productID: data.ProductID,\r\n discountAmount: data.Amount,\r\n addedBy: UserID,\r\n customerID: data.VendorCustomerID,\r\n }),\r\n });\r\n}\r\n\r\nexport function DeactivateCustomerDiscount(data) {\r\n return fetch(Main_URL + \"Finance/DisableCustomerDiscount\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n customerDiscountID: data.CustomerDiscountID,\r\n addedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetCustomerStatement = (\r\n CustomerID,\r\n VendorLocationID,\r\n DateRange,\r\n refresh\r\n) => {\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: statement, loading } = useApiRes(\r\n Main_URL +\r\n `Sales/GetnewCustomerStatement?CustomerID=${CustomerID}&VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { statement, loading };\r\n};\r\n\r\nexport const GetCustomerAssets = (CustomerID, DateRange, refresh) => {\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: assets, error } = useApiRes(\r\n Main_URL +\r\n `Sales/GetCustomerAsset?CustomerID=${CustomerID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { assets, error };\r\n};\r\n\r\nexport const GetExpenseType = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: types, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetVendorExpenseType?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { types, error };\r\n};\r\n\r\nexport function AddExpenseType(data, successFn, errorFn) {\r\n const VendorID = 128; // encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/AddVendorExpenseType\";\r\n const requestBody = {\r\n VendorID: VendorID,\r\n VendorLocationID: data.VendorLocationID,\r\n VendorExpenseTypeName: data.ExpenseType,\r\n AddedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateExpenseType(data) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n return fetch(Main_URL + \"Finance/UpdateVendorExpenseType\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n VendorID: VendorID,\r\n VendorLocationID: data.VendorLocationID,\r\n VendorExpenseTypeName: data.VendorExpenseTypeName,\r\n AddedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport function RemoveExpenseType(data) {\r\n return fetch(Main_URL + \"Finance/UpdateVendorExpenseType\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n VendorExpenseTypeID: data.VendorExpenseTypeID,\r\n AddedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetProductSales = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID, ProductID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: sales, error } = useApiRes(\r\n Main_URL +\r\n `StockReport/GetStockProductSalesReport?StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}&VendorID=${VendorID}&ProductID=${ProductID}`,\r\n { refresh }\r\n );\r\n return { sales, error };\r\n};\r\n\r\nexport const GetProductStatment = (values, refresh) => {\r\n const { DateRange, VendorLocationID, ProductID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: statement, error } = useApiRes(\r\n Main_URL +\r\n `StockReport/GetVendorProductStatement?StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}&ProductID=${ProductID}`,\r\n { refresh }\r\n );\r\n return { statement, error };\r\n};\r\n\r\nexport const GetAllProductPurchase = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: purchase, error } = useApiRes(\r\n Main_URL +\r\n `StockReport/GetProductPurchaseReport?StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { purchase, error };\r\n};\r\n\r\nexport const GetProductPurchase = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID, ProductID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: purchase, error } = useApiRes(\r\n Main_URL +\r\n `StockReport/GetStockProductPurchaseReport?StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}&VendorID=${VendorID}&ProductID=${ProductID}`,\r\n { refresh }\r\n );\r\n return { purchase, error };\r\n};\r\n\r\nexport const GetBalanceSheet = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: balance, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetBalanceSheet?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { balance, error };\r\n};\r\n\r\nexport const GetTrailBalance = (VendorLocationID, year, month, refresh) => {\r\n const { data: balance, loading } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetTrialBalance?VendorLocationID=${VendorLocationID}&Month=${month}&Year=${year}`,\r\n { refresh }\r\n );\r\n return { balance, loading };\r\n};\r\n\r\nexport const GetCashIn = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: cashIn, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetVendorCashIN?VendorID=${VendorID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { cashIn, error };\r\n};\r\n\r\nexport const GetCashFlow = (VendorLocationID, Year, refresh) => {\r\n const { data: cashflow, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetCashflowStatement?VendorLocationID=${VendorLocationID}&Year=${Year}`,\r\n { refresh }\r\n );\r\n return { cashflow, error };\r\n};\r\n\r\nexport const GetVendorLocationAttendanceVariance = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: variance, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetVendorLocationAttendnantVariance?StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { variance, error };\r\n};\r\n\r\nexport const GetVendorAttendanceStatement = (values, refresh) => {\r\n const { DateRange, UserID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: statement, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetVendorAttendantVarianceStatement?StartDate=${start}&EndDate=${end}&UserID=${UserID}`,\r\n { refresh }\r\n );\r\n return { statement, error };\r\n};\r\n\r\nexport const GetVendorAttendantVariance = (values, refresh) => {\r\n const { DateRange, UserID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: variace, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetVendorAttendantVariance?StartDate=${start}&EndDate=${end}&UserID=${UserID}`,\r\n { refresh }\r\n );\r\n return { variace, error };\r\n};\r\n\r\nexport const GetVendorAttendantVariancePayment = (values, refresh) => {\r\n const { DateRange, UserID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: payment, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetVendorAttendantVariancePayment?StartDate=${start}&EndDate=${end}&UserID=${UserID}`,\r\n { refresh }\r\n );\r\n return { payment, error };\r\n};\r\n\r\nexport function AddAttendantVariancePayment(data, successFn, errorFn) {\r\n const noerrorcheck = true;\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/AddAttendnatVariancePayment\";\r\n const requestBody = {\r\n vendorAttendantVariancePaymentID: 0,\r\n vendorPaymentMethodID: data.VendorPaymentMethodID,\r\n userID: data.UserID,\r\n dateAdded: data.TransDate,\r\n amountPaid: data.Amount,\r\n vendorTopUpID: 0,\r\n clockNO: data.ClockNO,\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody, noerrorcheck);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ReverseAttendantVariancePayment(data, successFn, errorFn) {\r\n const noerrorcheck = true;\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/ReverseAttendantVariancePayment\";\r\n const requestBody = {\r\n vendorAttendantVariancePaymentID: data.VendorAttendantVariancePaymentID,\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody, noerrorcheck);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function WriteOffAttendantVariance(data, successFn, errorFn) {\r\n const noerrorcheck = true;\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/WriteOffAttendnantVariance\";\r\n const requestBody = {\r\n variences: data.variances,\r\n addedBy: UserID,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody, noerrorcheck);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetCashOut = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: cashOut, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetVendorCashOut?VendorID=${VendorID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { cashOut, error };\r\n};\r\n\r\nexport function AddMpesaPayment(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const noerrorcheck = true;\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/AddPaymentMessage\";\r\n const requestBody = {\r\n VendorID: VendorID,\r\n VendorLocationID: data.VendorLocationID,\r\n VendorPaymentMethodID: data.VendorPaymentMethodID,\r\n TransID: data.TransID,\r\n ClockNO: data.ClockNO || \"\",\r\n TransTime: moment(data.Transtime).format(\"hh:mm A\"),\r\n TransDate: moment(data.Transtime).format(\"DD/MM/YY\"),\r\n MpesaAmount: accountingFormat(+data.MpesaAmount),\r\n TransactionCost: accountingFormat(+data.TransactionCost || 0),\r\n AccountBalance: accountingFormat(+data.AccountBalance || 0),\r\n AddedBy: UserID,\r\n UserID: 0,\r\n CustomerName: data.CustomerName?.trim(),\r\n CustomerPhone: \"254\" + data.CustomerPhone,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody, noerrorcheck);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddMpesaBulkPayment(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const noerrorcheck = true;\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/AddPaymentMessages\";\r\n const requestBody = {\r\n VendorID: VendorID,\r\n VendorLocationID: data.VendorLocationID,\r\n VendorPaymentMethodID: data.VendorPaymentMethodID,\r\n TransID: data.TransID,\r\n ClockNO: data.ClockNO || \"\",\r\n TransTime: moment(data.Transtime).format(\"hh:mm A\"),\r\n TransDate: moment(data.Transtime).format(\"DD/MM/YY\"),\r\n MpesaAmount: accountingFormat(+data.MpesaAmount),\r\n TransactionCost: accountingFormat(+data.TransactionCost || 0),\r\n AccountBalance: accountingFormat(+data.AccountBalance || 0),\r\n AddedBy: UserID,\r\n UserID: 0,\r\n CustomerName: data.CustomerName?.trim(),\r\n CustomerPhone: \"254\" + data.CustomerPhone,\r\n isClosingBalance: 0,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody, noerrorcheck);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetIncomestatement = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data: income, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetVendorIncomeStatement?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { income, error };\r\n};\r\n\r\nexport const GetTransactionMessages = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data: messages, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetPaymentTransActionMessage?VendorLocationID=${VendorLocationID}&VendorID=${VendorID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n return { messages, error };\r\n};\r\n\r\nexport const GetPaymentMethodTransactions = (values, refresh) => {\r\n const { DateRange, VendorPaymentMethodID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data: trans, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetVendorPaymentMethodTrasaction?StartDate=${start}&EndDate=${end}&VendorPaymentMethodID=${VendorPaymentMethodID}`,\r\n { refresh }\r\n );\r\n return { trans, error };\r\n};\r\n\r\nexport function AddVendor(data) {\r\n return fetch(Main_URL + \"Admin/PostVendorRegistrationTx\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n userID: 0,\r\n vendorID: 0,\r\n vendorClientID: 0,\r\n vendorLocationID: 0,\r\n addedBy: 0,\r\n vendorName: data.VendorName,\r\n countryCode: data.CountryCode,\r\n firstName: data.FirstName,\r\n lastName: data.LastName,\r\n phoneNumber: data.PhoneNumber,\r\n email: data.Email,\r\n slogan: \"\",\r\n vendorImageID: 0,\r\n stationsArray: data.StationsArray,\r\n }),\r\n });\r\n}\r\n\r\nexport function MarkMpesaPayment(data, successFn, errorFn) {\r\n const noerrorcheck = true;\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/MarkTransActionMultiple\";\r\n const requestBody = {\r\n UserID: UserID,\r\n ClockNO: data.ClockNO,\r\n MarkedPaymentArray: data.MarkedPaymentArray,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody, noerrorcheck);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetMonthlyReport = (refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: report, error } = useApiRes(\r\n Main_URL + `SalesReport/GetMonthlyReport?VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { report, error };\r\n};\r\n\r\nexport const GetVendorPayroll = (refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: payroll, error } = useApiRes(\r\n Main_URL + `Payroll/GetVendorPayroll?VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { payroll, error };\r\n};\r\n\r\nexport function AddVendorPayroll(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Payroll/AddVendorPayroll\";\r\n const requestBody = {\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n startDate: moment(data.startDate).format(\"YYYY-MM-DD\"),\r\n endDate: moment(data.endDate).format(\"YYYY-MM-DD\"),\r\n payrollNO: \"\",\r\n dateAdded: new Date(),\r\n addedBy: UserID,\r\n statusID: 1,\r\n payrollDetailArray: data.payrollDetailArray,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetVendorPayrollSalary = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: salary, error } = useApiRes(\r\n Main_URL +\r\n `Payroll/GetVendorPayrollSalary?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { salary, error };\r\n};\r\n\r\nexport function AddPayrollSalary(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Payroll/AddVendorPayrollSalary\";\r\n const requestBody = {\r\n vendorPayrollSalaryID: 0,\r\n userID: data.UserID,\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n paymentType: data.PaymentType,\r\n salary: 0,\r\n statusID: 1,\r\n dateAdded: new Date(),\r\n addedBy: UserID,\r\n taxRate: data.TaxRate,\r\n idNumber: data.IDNumber,\r\n pinNumber: data.PinNumber,\r\n bankAccount: data.BankAccount,\r\n bankName: data.BankName,\r\n salaryItem: \"\",\r\n salaryItems: data.SalaryItems,\r\n };\r\n\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetVendorPayrollDeductions = (PayrollDetailID, refresh) => {\r\n const { data: deductions, error } = useApiRes(\r\n Main_URL + `Payroll/yrollDeduction?PayrollDetailID=${PayrollDetailID}`,\r\n { refresh }\r\n );\r\n return { deductions, error };\r\n};\r\n\r\nexport function AddPayrollDeduction(data) {\r\n return fetch(Main_URL + \"Payroll/AddVendorPayrollDeduction\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n vendorPayrollDeductionID: 0,\r\n payrollDetailID: data.PayrollDetailID,\r\n deductionItemID: data.VendorPayrollDeductionItemID,\r\n amount: data.Amount,\r\n userID: data.UserID,\r\n dateAdded: new Date(),\r\n description: data.Description,\r\n addedBy: UserID,\r\n statusID: 1,\r\n }),\r\n });\r\n}\r\n\r\nexport function UpdateUserClockVariance(UserClockVarianceID) {\r\n return fetch(\r\n Main_URL +\r\n `Payroll/UpdateUserClockVariance?UserClockVarianceID=${UserClockVarianceID}`,\r\n {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n // body: JSON.stringify({\r\n // vendorPayrollDeductionID: 0,\r\n // payrollDetailID: data.PayrollDetailID,\r\n // deductionItemID: data.VendorPayrollDeductionItemID,\r\n // amount: data.Amount,\r\n // userID: data.UserID,\r\n // dateAdded: new Date(),\r\n // description: data.Description,\r\n // addedBy: UserID,\r\n // statusID: 1,\r\n // }),\r\n }\r\n );\r\n}\r\n\r\nexport const GetVendorPayrollSalaryItems = (VendorLocationID, refresh) => {\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Payroll/GetVendorPayrollSalaryItem?VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport function AddVendorSalaryItem(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Payroll/AddVendorPayrollSalaryItem\";\r\n const requestBody = {\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n salaryItem: data.SalaryItem,\r\n itemType: data.ItemType,\r\n dateAdded: new Date(),\r\n statusID: 1,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVendorBenefitItem(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Payroll/AddVendorBenefitItem\";\r\n const requestBody = {\r\n benefitItem: data.BenefitItem,\r\n vendorID: VendorID,\r\n dateAdded: new Date(),\r\n addedBy: UserID,\r\n statusID: 1,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetVendorPayrollBenefit = (PayrollDetailID, refresh) => {\r\n const { data: benefits, error } = useApiRes(\r\n Main_URL +\r\n `Payroll/GetVendorPayrollBenefit?PayrollDetailID=${PayrollDetailID}`,\r\n { refresh }\r\n );\r\n return { benefits, error };\r\n};\r\n\r\nexport function AddPayrollBenefit(data) {\r\n return fetch(Main_URL + \"Payroll/AddVendorPayrollBenefit\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n vendorPayrollBenefit: 0,\r\n payrollDetailID: data.PayrollDetailID,\r\n benefitItemID: data.VendorPayrollBenefitItemID,\r\n amount: data.Amount,\r\n userID: data.UserID,\r\n dateAdded: new Date(),\r\n description: data.Description,\r\n addedBy: UserID,\r\n statusID: 1,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetVendorPayrollBenefitItem = (refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: benefititem, error } = useApiRes(\r\n Main_URL + `Payroll/GetVendorBenefitItem?VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n return { benefititem, error };\r\n};\r\n\r\nexport const GetVendorUserClockVariance = (values, refresh) => {\r\n const { DateRange, UserID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data: variance, error } = useApiRes(\r\n Main_URL +\r\n `Payroll/GetUserClockVariance?StartDate=${start}&EndDate=${end}&UserID=${UserID}`,\r\n { refresh }\r\n );\r\n return { variance, error };\r\n};\r\n\r\nexport const GetVendorOpenTankNozzle = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: opennozzle, error } = useApiRes(\r\n Main_URL +\r\n `Stock/GetVendorOpenTankNozzle?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n return { opennozzle, error };\r\n};\r\n\r\nexport function sendHelpRequest(request) {\r\n return fetch(`https://graph.facebook.com/v15.0/111373551751141/messages`, {\r\n headers: new Headers({\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n Authorization:\r\n \"Bearer \" +\r\n \"EAASyPtQ8v4gBAPmgXV16ySDF8ZA19tHLbZCwD8Epg4wYXEYxEKLD11XjJXZBv5FnBuEiz3qXIzIlkzHhItQ14ZAVeJJezmrDaA4rZC3OaAnS1FZCsdKZAmURXOCP1dIz1AV6Mz80cfbnRSZCsDO8lMjDW2XT4TlNmjcaP8tnHgJ7fPXfzRbfDqh3\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n messaging_product: \"whatsapp\",\r\n recipient_type: \"individual\",\r\n to: request.PhoneNumber,\r\n type: \"template\",\r\n template: {\r\n name: \"esque_auth\",\r\n language: {\r\n code: \"en_US\",\r\n },\r\n components: [\r\n {\r\n type: \"body\",\r\n parameters: [\r\n {\r\n type: \"text\",\r\n text: \"1234\",\r\n },\r\n ],\r\n },\r\n ],\r\n },\r\n }),\r\n });\r\n}\r\n\r\nexport const GetAccountTransfer = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: transfers, error } = useApiRes(\r\n Main_URL +\r\n `Finance/GetAccountsTransfer?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { transfers, error };\r\n};\r\n\r\nexport const GetVendorShiftAccountRecon = (\r\n ShiftRefNO,\r\n ShiftClockNO,\r\n VendorLocationID,\r\n refresh\r\n) => {\r\n const { data: recon, error } = useApiRes(\r\n Main_URL +\r\n `FinanceReport/GetPaymentMethodShiftBalances?ShiftRefNO=${ShiftRefNO}&ShiftClockNO=${ShiftClockNO}&VendorLocationID=${VendorLocationID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { recon, error };\r\n};\r\n\r\nexport const GetAccountStatement = (values, refresh) => {\r\n const { DateRange, VendorPaymentMethodID, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: statement, loading } = useApiRes(\r\n Main_URL +\r\n `Finance/GetAccountsStatement?PaymentMethodID=${VendorPaymentMethodID}&VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { statement, loading };\r\n};\r\n\r\nexport function AddAccountTransfer(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/PostAccountTransfer\";\r\n const requestBody = {\r\n accountTransferID: 0,\r\n shiftClockNO: data.ShiftClockNO,\r\n creditAccountID: data.CreditAccountID,\r\n debitAccountID: data.DebitAccountID,\r\n AccountTypeID: data.AccountTypeID,\r\n transactionCost: 0,\r\n amount: data.Amount,\r\n dateAdded: new Date(),\r\n vendorLocationID: data.VendorLocationID,\r\n vendorID: VendorID,\r\n transDate: data.TransDate,\r\n description: data.Description,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateAccountTransfer(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/UpdateAccountTransfer\";\r\n const requestBody = {\r\n accountTransferID: data.AccountTransferID,\r\n creditAccountID: data.CreditAccountID,\r\n shiftClockNO: data.ShiftClockNO,\r\n debitAccountID: data.DebitAccountID,\r\n amount: data.Amount,\r\n transactionCost: data.TransactionCost,\r\n dateAdded: new Date(),\r\n vendorLocationID: data.VendorLocationID,\r\n vendorID: VendorID,\r\n transDate: data.TransDate,\r\n description: data.Description,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ReverseAccountTransfer(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Finance/ReverseAccountTransfer\";\r\n const requestBody = {\r\n accountTransferID: data.AccountTransferID,\r\n debitAccountID: data.DebitAccountID,\r\n VendorLocationID: data.VendorLocationID,\r\n amount: data.Amount,\r\n addedBy: UserID,\r\n transferDate: data.DateAdded,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetDistributorVendors = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: vendors, error } = useApiRes(\r\n Main_URL + `Distributor/GetDistributorVendor?VendorID=${VendorID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { vendors, error };\r\n};\r\n\r\nexport function AddDistributorDeliveryPoint(data) {\r\n return fetch(Main_URL + \"Distributor/PostDistributorLpoDeliveryTx\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n purchaseNO: data.PurchaseNO,\r\n orderNO: data.OrderNO,\r\n eta: moment(new Date()).format(\"YYYY-MM-DD\"),\r\n deliveryCost: data.DeliveryCost,\r\n vendorID: data.VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n deliveryDetail: data.DeliveryDetail,\r\n purchaseDeliveryType: 0,\r\n addedBy: UserID,\r\n purchaseDeliveryArray: data.PurchaseDeliveryArray,\r\n }),\r\n });\r\n}\r\n\r\nexport const GetUserRoleAssignment = (refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: urole, error } = useApiRes(\r\n Main_URL + `Admin/GetUserRolesWithDetails?VendorID=${VendorID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { urole, error };\r\n};\r\n\r\nexport const GetUserTypePolicy = (refresh) => {\r\n const { data: policy, error } = useApiRes(\r\n Main_URL + `Admin/GetUserTypePolicy`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { policy, error };\r\n};\r\n\r\nexport const GetUserTypePolicyAssignment = (UserTypeID, refresh) => {\r\n const { data: roles, error } = useApiRes(\r\n Main_URL + `Admin/GetUserTypePolicyAssignment?userTypeID=${UserTypeID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { roles, error };\r\n};\r\n\r\nexport const GetUserPolicyAssingment = (UserID, refresh) => {\r\n const { data: urole, error } = useApiRes(\r\n Main_URL + `Admin/GetUserPolicyAssignment?UserID=${UserID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { urole, error };\r\n};\r\n\r\nexport const GetUserTypeRole = (UserType, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: roles, error } = useApiRes(\r\n Main_URL +\r\n `Admin/GetUserTypeRoles?vendorID=${VendorID}&userTypeID=${UserType}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { roles, error };\r\n};\r\n\r\nexport const GetNotificationTypes = (UseCase, refresh) => {\r\n const { data: types, error } = useApiRes(\r\n Main_URL + `Notifications/GetNotificationType?UseCase=${UseCase}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { types, error };\r\n};\r\n\r\nexport const GetNotificationRecipient = (\r\n VendorLocationID,\r\n CustomerID,\r\n refresh\r\n) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: recipient, error } = useApiRes(\r\n Main_URL +\r\n `Notifications/GetNotificationUsers?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}&CustomerID=${\r\n CustomerID || 0\r\n }`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { recipient, error };\r\n};\r\n\r\nexport function AddNotificationRecipient(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Notifications/AddNotificationUser\";\r\n const requestBody = {\r\n userID: data.UserID,\r\n notificationTypeID: data.NotificationTypeID,\r\n vendorID: VendorID,\r\n customerID: data.VendorCustomerID,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n mediumChannelID: 2,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function RemoveNotificationRecipient(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Notifications/RemoveWhatsAppReportRecipient\";\r\n const requestBody = {\r\n notificationUserID: data.NotificationUserID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddUserTypeRole(data, onSuccess, onError) {\r\n const url = Main_URL + \"Admin/AddUserRoles\";\r\n isOnline\r\n ? saveToIndexedDB(data, \"AddUserRoles\", \"UserRoleID\")\r\n : AddToApi(url, data, \"AddUserRoles\", onSuccess, onError);\r\n}\r\n\r\nexport const GetAgeingReport = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: report, loading } = useApiRes(\r\n Main_URL +\r\n `Customer/GetAgeingReport?VendorLocationID=${VendorLocationID}&VendorID=${VendorID}&StartDate=${start}&EndDate=${end}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { report, loading };\r\n};\r\n\r\nexport const GetConsolidatedReport = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: report, error } = useApiRes(\r\n Main_URL +\r\n `AdminReport/GetConsolidatedVendorReport?UserID=${UserID}&VendorID=${VendorID}&StartDate=${start}&EndDate=${end}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { report, error };\r\n};\r\n\r\nexport const GetConsolidatedAccountBalances = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange } = values;\r\n const start = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: report, error } = useApiRes(\r\n Main_URL +\r\n `AdminReport/GetConsolidatedVendorAccountBalances?UserID=${UserID}&VendorID=${VendorID}&StartDate=${start}&EndDate=${end}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { report, error };\r\n};\r\n\r\nexport const GetAuditTrail = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data: report, error } = useApiRes(\r\n Main_URL +\r\n `AuditTrail/GetAuditTrail?StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { report, error };\r\n};\r\n\r\nexport const GetAuditLogAnalytics = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data: analytics, error } = useApiRes(\r\n Main_URL +\r\n `AuditTrail/GetAuditTrailAnalysis?StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { analytics, error };\r\n};\r\n\r\nexport function sendAttendantClockSummary(request) {\r\n return fetch(`https://graph.facebook.com/v15.0/111373551751141/messages`, {\r\n headers: new Headers({\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n Authorization:\r\n \"Bearer \" +\r\n \"EAASyPtQ8v4gBAPmgXV16ySDF8ZA19tHLbZCwD8Epg4wYXEYxEKLD11XjJXZBv5FnBuEiz3qXIzIlkzHhItQ14ZAVeJJezmrDaA4rZC3OaAnS1FZCsdKZAmURXOCP1dIz1AV6Mz80cfbnRSZCsDO8lMjDW2XT4TlNmjcaP8tnHgJ7fPXfzRbfDqh3\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n messaging_product: \"whatsapp\",\r\n recipient_type: \"individual\",\r\n to: 254727337354,\r\n type: \"template\",\r\n template: {\r\n name: \"help_request\",\r\n language: {\r\n code: \"en_US\",\r\n },\r\n components: [\r\n {\r\n type: \"header\",\r\n parameters: [\r\n {\r\n type: \"image\",\r\n image: {\r\n link: \"https://api.crato.co.ke/api/File/VendorImage?ImageID=help\",\r\n },\r\n },\r\n ],\r\n },\r\n {\r\n type: \"body\",\r\n parameters: [\r\n {\r\n type: \"text\",\r\n text: request.FullName,\r\n },\r\n {\r\n type: \"text\",\r\n text: request.Message || \"N/A\",\r\n },\r\n ],\r\n },\r\n ],\r\n },\r\n }),\r\n });\r\n}\r\n\r\nexport function BackdateLocationData(data, successFn, errorFn) {\r\n const currentTime = moment().format(\"HH:mm:ss\");\r\n const passedDate = moment(data?.DateAdded).format(\"YYYY-MM-DD\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Supervisor/BackdateVendorLocationData\";\r\n const requestBody = {\r\n ClockTypeID: data.ClockTypeID,\r\n VendorLocationID: data.VendorLocationID,\r\n DateAdded: `${passedDate} ${currentTime}`,\r\n shiftClockNo: data.ShiftNO,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddGoogleSheetCredentials(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"GoogleSheets/AddGoogleSheetCredentials\";\r\n const requestBody = {\r\n userGoogleSheetCredentialsID: 0,\r\n googleSheetCredentials: data.GoogleSheetID,\r\n additionalInfo: \"\",\r\n vendorLocationID: data.VendorLocationID,\r\n dateAdded: new Date(),\r\n statusID: 1,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function BackupGoogleSheet(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"GoogleSheets/PostToGoogleSheet\";\r\n const requestBody = {\r\n vendorLocationID: data.VendorLocationID,\r\n sheetName: \"\",\r\n googleSheetID: data.GoogleSheetID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddDistributorPurchase(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Distributor/PostDistributorPurchaseOrderTx\";\r\n const requestBody = {\r\n vendorID: VendorID,\r\n purchaseNO: \"\",\r\n supplierID: data?.VendorSupplierID,\r\n deliveryAssetID: data?.AssetID,\r\n purchaseDate: data?.DateAdded,\r\n statusID: 2,\r\n addedBy: UserID,\r\n totalAmount:\r\n data?.stocks?.reduce((a, b) => a + b.LineTotal, 0) + +data?.OtherCost,\r\n deliveryCost: data?.OtherCost,\r\n invoiceNO: data?.InvoiceNO,\r\n purchaseDetailArray: data?.stocks,\r\n purchasePaymentArray: [],\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ReverseDistributorPurchase(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Distributor/ReverseDistributorPurchase\";\r\n const requestBody = {\r\n vendorPurchaseID: data.VendorPurchaseID,\r\n purchaseNO: data.PurchaseNO,\r\n invoiceNO: data.InvoiceNO,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetDistributorDashbord = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: dash, loading } = useApiRes(\r\n Main_URL +\r\n `Distributor/GetDistributorDashBoard?StartDate=${start}&EndDate=${end}&VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n\r\n return { dash: dash?.Data || [], loading };\r\n};\r\n\r\nexport const GetDistributorOrders = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data: order, loading } = useApiRes(\r\n Main_URL +\r\n `Distributor/GetDistributorSaleOrderHistory?VendorID=${VendorID}&StartDate=${start}&EndDate=${end}&PageNO=1&PageSize=1000`,\r\n { refresh }\r\n );\r\n\r\n return { order: order?.Data || [], loading };\r\n};\r\n\r\nexport const GetDistributorAssets = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: assets, error } = useApiRes(\r\n Main_URL +\r\n `Supervisor/GetVendorAssetAssignment?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { assets, error };\r\n};\r\n\r\nexport const GetDistributorCustomers = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data: customer, error } = useApiRes(\r\n Main_URL + `Distributor/GetBulkCustomers?VendorID=${VendorID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { customer: customer.Data, error };\r\n};\r\n\r\nexport const GetDistributorSupplier = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Distributor/GetDistributorSupplier?VendorID=${VendorID}&StartDate=${start}&EndDate=${end}&PageNO=1&PageSize=10`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { supplier: data?.Data, error };\r\n};\r\n\r\nexport const GetDistributorPurchase = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Distributor/GetDistributorPurchase?VendorID=${VendorID}&StartDate=${start}&EndDate=${end}&PageNO=1&PageSize=1000`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { purchase: data.Data, error };\r\n};\r\n\r\nexport const GetDistributorAllAssets = (VendorLocationID, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Customer/GetDistributorVendorAllClientAsset?VendorID=${VendorID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { asset: data, error };\r\n};\r\n\r\nexport function AddDistributorFulfillDelivery(data) {\r\n return fetch(Main_URL + \"Distributor/FulfillDelivery\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n id: data.DistributorPurchaseDeliveryID,\r\n addedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport function AddDistributorPurchasePayment(data) {\r\n return fetch(Main_URL + \"Distributor/SaveLpoPayment\", {\r\n headers: new Headers({\r\n Funguo: Funguo,\r\n Accept: \"application/json\",\r\n \"Content-Type\": \"application/json\",\r\n }),\r\n method: \"post\",\r\n body: JSON.stringify({\r\n purchaseNO: data.PurchaseNO,\r\n amountPaid: data.AmountPaid,\r\n transActionCost: data.TransactionCost,\r\n vendorPaymentMethodID: data.VendorPaymentMethodID,\r\n referenceNO: data.ReferenceNO,\r\n addedBy: UserID,\r\n }),\r\n });\r\n}\r\n\r\nexport function AddDistributorOrder(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Distributor/PostDistributorSaleOrderTx\";\r\n const requestBody = {\r\n userID: UserID,\r\n vendorID: VendorID,\r\n purchaseNO: data.PurchaseNO,\r\n customerID: data.CustomerID,\r\n customerTypeID: data.CustomerTypeID,\r\n assetID: data.AssetID,\r\n saleType: 4,\r\n isStation: data.StationID > 0 ? 1 : 0,\r\n stationID: data.StationID,\r\n deliveryAssetID: data.DeliveryAssetID,\r\n eta: data.ETA,\r\n dateDelivered: \"\",\r\n deliveredByID: 0,\r\n statusID: 1,\r\n handlingCost: data.HandlingCost,\r\n deliveryCost: data.DeliveryCost,\r\n deliveryDetail: \"\",\r\n totalAmount: data.TotalAmount,\r\n saleDetailArray: data.stocks,\r\n salePaymentArray: [],\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function DistributorCompleteDelivery(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Driver/CompleteDelivery\";\r\n const requestBody = {\r\n id: data.SaleOrderBulkID,\r\n addedBy: UserID,\r\n vendorAssetID: data.DeliveryAssetID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function DistributorLoadTruck(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Driver/CompleteLoading\";\r\n const requestBody = {\r\n id: data.VendorPurchaseID,\r\n addedBy: UserID,\r\n vendorAssetID: data.DeliveryAssetID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function DistributorVehicle(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Distributor/AddDeliveryAsset\";\r\n const requestBody = {\r\n vendorAssetID: 0,\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n vendorAssetName: data.VendorAssetName,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AssignDistributorVehicle(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Distributor/AddDeliveryAssetAssignment\";\r\n const requestBody = {\r\n vendorAssetID: data.VendorAssetID,\r\n userID: data.UserID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddDistributorCustomer(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Distributor/AddDistributorCustomer\";\r\n const requestBody = {\r\n customerName: data.CustomerName,\r\n customerPhone: data.CustomerPhone,\r\n customerMail: data.CustomerMail,\r\n kraPin: data.KRAPin,\r\n openingBalance: data.OpeningBalance,\r\n creditLimit: data.CreditLimit,\r\n paymentTerms: data.PaymentTerms,\r\n addedBy: UserID,\r\n vendorID: VendorID,\r\n creditLimitNotification: data.CreditLimitNotification,\r\n isCreditLimitMandatory: data.IsCreditLimitMandatory,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetUserManual = (refresh) => {\r\n const { data, error } = useApiRes(Main_URL + `AdminReport/GetUserManual`, {\r\n refresh,\r\n });\r\n return { manual: data, error };\r\n};\r\n\r\n//cards\r\nexport const GetCardCustomerGroup = (refresh) => {\r\n const { data, error } = useApiRes(\r\n Main_URL + `FuelCard/GetVendorParentCardGroup?VendorParentID=${ParentID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetRewardPointsTypes = (refresh) => {\r\n const { data, error } = useApiRes(Main_URL + `FuelCard/GetCardPointReward`, {\r\n refresh,\r\n });\r\n return { data, error };\r\n};\r\n\r\nexport function DeleteCardCustomerGroup(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/RemoveVendorParentCardGroup\";\r\n const requestBody = {\r\n vendorParentCardGroupID: data.VendorParentCardGroupID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddCardCustomerGroup(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostVendorParentCardGroup\";\r\n const requestBody = {\r\n vendorParentCardGroupName: data.VendorParentCardGroupName,\r\n vendorParentID: ParentID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetRewardLoyaltyRule = (values, refresh) => {\r\n const { DateRange } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetVendorParentCardPointReward?VendorParentID=${ParentID}&StartDate=${start}&EndDate=${end}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport function AddRewardLoyaltyRule(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostVendorParentCardPointRewardTx\";\r\n const requestBody = {\r\n pointRewardName: data.PointRewardName,\r\n vendorParentCardGroupID: data.VendorParentCardGroupID,\r\n vendorParentID: ParentID,\r\n startDate: data.StartDate,\r\n endDate: data.EndDate,\r\n addedBy: UserID,\r\n rewardDetailArray: data.RewardDetailArray,\r\n rewardProductArray: data.ProductArray,\r\n rewardRuleArray: data.RewardRule,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function RemoveRewardLoyaltyRule(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/CloseVendorParentCardPointReward\";\r\n const requestBody = {\r\n rewardRefNO: data?.RewardRefNO,\r\n endDate: data.EndDate,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetCardRedeemIniator = (refresh) => {\r\n const { data, error } = useApiRes(\r\n Main_URL + `FuelCard/GetCardRedeemInitiator`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetCardCustomer = (values, refresh) => {\r\n const { DateRange, CustomerID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetVendorCardCustomerPoints?VendorParentID=${ParentID}&VendorCustomerID=${CustomerID}&UserID=0&StartDate=${start}&EndDate=${end}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetLoyaltyDashBoard = (values, refresh) => {\r\n const { DateRange } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetFuelCardWebDashBoard?VendorParentID=${ParentID}&StartDate=${start}&EndDate=${end}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetLoyaltyStationSummary = (values, refresh) => {\r\n const { DateRange } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetStationFuelCardSummary?VendorParentID=${ParentID}&StartDate=${start}&EndDate=${end}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetLoyaltyAllCustomersCards = (values, refresh) => {\r\n const { DateRange, CustomerID, PageSize, SearchTerm, VendorLocationID } =\r\n values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data, error, loading } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetVendorCardCustomerPoints?VendorParentID=${ParentID}&StartDate=${start}&EndDate=${end}&SearchTerm=${SearchTerm}&VendorCustomerID=${CustomerID}&VendorLocationID=${VendorLocationID}&PageNO=1&PageSize=${PageSize}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, loading, error };\r\n};\r\n\r\nexport const GetFuelcardAllCustomersCards = (values, refresh) => {\r\n const { DateRange, CustomerID, PageSize, SearchTerm, VendorLocationID } =\r\n values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data, error, loading } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetVendorCardCustomerAmount?VendorParentID=${ParentID}&StartDate=${start}&EndDate=${end}&SearchTerm=${SearchTerm}&VendorCustomerID=${CustomerID}&VendorLocationID=${VendorLocationID}&PageNO=1&PageSize=${PageSize}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, loading, error };\r\n};\r\n\r\nexport const GetLoyaltyCustomers = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, CustomerID, PageSize, SearchTerm } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data, error, loading } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetFuelCardCustomer?VendorID=${VendorID}&VendorParentID=${ParentID}&StartDate=${start}&EndDate=${end}&SearchTerm=${SearchTerm}&VendorCustomerID=${CustomerID}&PageNO=1&PageSize=${PageSize}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, loading, error };\r\n};\r\n\r\nexport function AddVendorCustomerPointAdjustment(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostCardCreditDebitPoint\";\r\n const requestBody = {\r\n vendorCustomerCardID: data.VendorCustomerCardID,\r\n points: data.Points,\r\n VendorCustomerID: data.VendorCustomerID,\r\n reason: data.Reason,\r\n typeID: data.TypeID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetLoyaltyCustomersPointAdjustment = (values, refresh) => {\r\n const { DateRange, VendorCustomerCardID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetVendorCustomerCardCreditDebit?VendorCustomerCardID=${VendorCustomerCardID}&TypeID=0&StartDate=${start}&EndDate=${end}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetLoyaltyCustomersCards = (CustomerID, refresh) => {\r\n const { data, error } = useApiRes(\r\n Main_URL + `FuelCard/GetVendorCustomerCard?VendorCustomerID=${CustomerID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetLoyaltyCustomersCardChild = (\r\n CardSerialNO,\r\n VendorLocationID,\r\n refresh\r\n) => {\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetFuelCardChildInfo?CardSerialNO=${CardSerialNO}&VendorLocationID=${VendorLocationID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetCustomerLinkedCards = (VendorCustomerCardID, refresh) => {\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetVendorCustomerCardChild?VendorCustomerCardID=${VendorCustomerCardID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetLoyaltyCustomersPoints = (values, refresh) => {\r\n const { DateRange, VendorCustomerCardID, CustomerID, VendorLocationID } =\r\n values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetCardEarnedPoints?VendorParentID=${ParentID}&VendorLocationID=${VendorLocationID}&UserID=0&VendorCustomerID=${CustomerID}&VendorCustomerCardID=${VendorCustomerCardID}&isLatest=0&StartDate=${start}&EndDate=${end}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetLoyaltyCustomersRedeemedPoints = (\r\n VendorLocationID,\r\n CustomerID,\r\n DateRange,\r\n VendorCustomerCardID,\r\n refresh\r\n) => {\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetCardRedeemedPoints?VendorParentID=${ParentID}&VendorLocationID=${VendorLocationID}&UserID=0&VendorCustomerID=${CustomerID}&VendorCustomerCardID=${VendorCustomerCardID}&isLatest=0&StartDate=${start}&EndDate=${end}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetLoyaltyCustomersRedeemedOption = (CustomerID, refresh) => {\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetVendorParentCardRedeemConversion?VendorParentID=${ParentID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetLoyaltyVendorRedeemOption = (CustomerID, refresh) => {\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetVendorParentCardRedeemOption?VendorParentID=${ParentID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport function AddVendorRedeemOption(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostVendorParentCardRedeemOption\";\r\n const requestBody = {\r\n redeemOptionName: data?.RedeemOptionName,\r\n uom: data.UOM,\r\n vendorParentID: ParentID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function DeactivateChildCard(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/DeactivateVendorCustomerCardChild\";\r\n const requestBody = {\r\n vendorCustomerCardChildID: data.VendorCustomerCardChildID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function DeactivateParentCard(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/BlockVendorCustomerCard\";\r\n const requestBody = {\r\n vendorCustomerCardID: data.VendorCustomerCardID,\r\n addedBy: UserID,\r\n statusID: data.StatusID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function RemoveVendorRedeemOption(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/RemoveVendorParentCardRedeemOption\";\r\n const requestBody = {\r\n vendorParentCardRedeemOptionID: data?.VendorParentCardRedeemOptionID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetLoyaltyVendorRedeemOptionPoints = (CustomerID, refresh) => {\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetVendorParentCardRedeemConversion?VendorParentID=${ParentID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport function AddVendorRedeemOptionPoints(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostVendorParentCardRedeemConversion\";\r\n const requestBody = {\r\n vendorParentCardRedeemOptionID: data.VendorParentCardRedeemOptionID,\r\n vendorParentID: ParentID,\r\n addedBy: UserID,\r\n rewardPoint: data.RewardPoint,\r\n vendorCustomerID: data.VendorCustomerID,\r\n rewardValue: data.RewardValue,\r\n startDate: new Date(data.StartDate),\r\n endDate: new Date(data.EndDate),\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVendorRedeemOptionBulkPoints(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostVendorCustomerCardRedeemedPointsBulk\";\r\n const requestBody = {\r\n cardRedeemTypeID: data.cardRedeemTypeID,\r\n vendorID: VendorID,\r\n vendorParentID: ParentID,\r\n initiatedBy: UserID,\r\n dateInitiated: data.dateInitiated,\r\n expiryDate: data.expiryDate,\r\n vendorParentCardRedeemOptionID: data.vendorParentCardRedeemOptionID,\r\n redeemRefNO: \"\",\r\n cardRedeemArray: data.cardRedeemArray,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVendorRedeemCollection(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostVendorCustomerCardRedeemedCollection\";\r\n const requestBody = {\r\n redeemNO: data?.RedeemNO,\r\n otpCode: data.OTPCode,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVendorCustomerCard(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostVendorCustomerCard\";\r\n const requestBody = {\r\n vendorCustomerID: data.vendorCustomerID,\r\n vendorParentID: ParentID,\r\n vendorID: VendorID,\r\n vendorLocationID: data.VendorLocationID,\r\n cardSerialNO: data.CardSerialNO,\r\n openingAmount: data.openingAmount,\r\n openingPoints: data.openingPoints,\r\n expiryMonthYear: data.expiryMonthYear,\r\n cardTypeID: data.cardTypeID,\r\n isImageRequired: data.isImageRequired ? 1 : 0,\r\n isPasswordProtected: data.isPasswordProtected ? 1 : 0,\r\n isMileageRequired: data.isMileageRequired ? 1 : 0,\r\n isProductRestricted: data.isProductRestricted ? 1 : 0,\r\n isTimeRestricted: data.isTimeRestricted ? 1 : 0,\r\n isLocationRestricted: data.isLocationRestricted ? 1 : 0,\r\n isAssetRestricted: data.isAssetRestricted ? 1 : 0,\r\n cardRedeemInitiatorID: data.cardRedeemInitiatorID,\r\n addedBy: UserID,\r\n canHoldPayment: data.canHoldPayment ? 1 : 0,\r\n vendorCustomerCardName: data.vendorCustomerCardName,\r\n statusID: 1,\r\n cardPolicyProductArray: data.cardPolicyProductArray,\r\n cardPolicyTime: data.cardPolicyTime,\r\n cardPolicyVendorLocation: data.cardPolicyVendorLocation,\r\n cardPolicyAsset: data.cardPolicyAsset,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVendorCustomerCardProductPolicy(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostVendorCustomerCard\";\r\n const requestBody = {\r\n vendorCustomerCardID: data.VendorCustomerCardID,\r\n productID: data.ProductID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateCardRegisteredStation(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/ChangeVendorCustomerCardLocation\";\r\n const requestBody = {\r\n vendorCustomerCardID: data.VendorCustomerCardID,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVendorCustomerCardAssetPolicy(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostVendorCustomerCardPolicyAsset\";\r\n const requestBody = {\r\n vendorCustomerCardID: data.VendorCustomerCardID,\r\n assetID: data.AssetID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVendorCustomerCardStationPolicy(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostVendorCustomerCardPolicyLocation\";\r\n const requestBody = {\r\n vendorCustomerCardID: data.VendorCustomerCardID,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVendorCustomerCardChild(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostVendorCustomerCardChild\";\r\n const requestBody = {\r\n vendorCustomerCardID: data.VendorCustomerCardID,\r\n vendorParentID: ParentID,\r\n cardSerialNO: data.CardSerialNO,\r\n cardTypeID: data.CardTypeID,\r\n addedBy: UserID,\r\n statusID: 1,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function RequestRedeemCustomerLoyaltyPoints(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostFuelCardRedeemOTPRequest\";\r\n const requestBody = {\r\n vendorCustomerID: data.VendorCustomerID,\r\n VendorLocationID: data.VendorLocationID,\r\n vendorID: VendorID,\r\n vendorName: data.VendorName,\r\n addedBy: UserID,\r\n vendorParentCardRedeemOptionName: data.VendorParentCardRedeemOptionName,\r\n vendorLocationName: data.VendorLocationName,\r\n vendorCustomerCardName: data.VendorCustomerCardName,\r\n redeemedPoints: data.RedeemedPoints,\r\n redeemValue: data.RedeemValue,\r\n redeemValueUOM: data.RedeemValueUOM,\r\n redemptionDate: new Date(),\r\n pointsBalance: data.PointsBalance,\r\n notificationChannelID: data.NotificationChannelID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n result: asyncSubmit.result,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function RedeemCustomerLoyaltyPoints(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostVendorCustomerCardRedeemedPoints\";\r\n const requestBody = {\r\n redeemedPoints: data.RewardPoint,\r\n VendorCustomerID: data.VendorCustomerID,\r\n cardRedeemTypeID: data.CardRedeemTypeID,\r\n vendorParentID: ParentID,\r\n vendorLocationID: data.VendorLocationID,\r\n vendorCustomerCardID: data.VendorCustomerCardID,\r\n initiatedBy: UserID,\r\n redeemNO: data.RedeemNO,\r\n otpCode: data.RedeemOTP,\r\n dateInitiated: moment(new Date()).format(\"YYYY-MM-DD HH:mm\"),\r\n expiryDate: moment(new Date()).format(\"YYYY-MM-DD HH:mm\"),\r\n vendorParentCardRedeemOptionID: data.VendorParentCardRedeemOptionID,\r\n redeemValue: data?.RedeemValue,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function ReverseCustomerLoyaltyRedeemedPoints(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/ReverseVendorCustomerCardRedeemedPoints\";\r\n const requestBody = {\r\n vendorCustomerCardRedeemedPointID: data?.VendorCustomerCardRedeemedPointID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetLoyaltyVendorCards = (CardPanNO, refresh) => {\r\n const { data, error } = useApiRes(\r\n Main_URL + `FuelCard/GetVendorParentCard?VendorParentID=${ParentID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport function DeactivateLoyaltyCustomerCard(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"FuelCard/PostVendorCustomerCardRedeemedPoints\";\r\n const requestBody = {\r\n redeemedPoints: data.RedeemedPoints,\r\n cardRedeemTypeID: data.CardRedeemTypeID,\r\n vendorLocationID: data.VendorLocationID,\r\n vendorCustomerCardID: data.VendorCustomerCardID,\r\n initiatedBy: UserID,\r\n dateInitiated: new Date(),\r\n expiryDate: new Date(),\r\n vendorParentCardRedeemOptionID: data.VendorParentCardRedeemOptionID,\r\n redeemValue: data?.RedeemValue,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function AddVirtualLoyaltyCustomer(data, successFn, errorFn) {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Customer/PostVendorCustomerVirtual\";\r\n const requestBody = {\r\n customerName: data.CustomerName,\r\n customerPhone: data.CustomerPhone,\r\n customerMail: data.CustomerMail || \"\",\r\n countryCode: data.CountryCode,\r\n CustomerIdentityImageID: 0,\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n vendorID: VendorID,\r\n vendorParentID: ParentID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetLoyaltyCustomerStatement = (values, refresh) => {\r\n const { DateRange, CustomerID, VendorCustomerCardID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetCustomerCardPointStatement?VendorCustomerID=${CustomerID}&StartDate=${start}&EndDate=${end}&VendorCustomerCardID=${VendorCustomerCardID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetLoyaltyCustomerStatementAmount = (values, refresh) => {\r\n const { DateRange, CustomerID, VendorCustomerCardID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetCustomerCardAmountStatement?VendorCustomerID=${CustomerID}&StartDate=${start}&EndDate=${end}&VendorCustomerCardID=${VendorCustomerCardID}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport const GetPTSSPumpSales = (\r\n userID,\r\n VendorLocationID,\r\n ClockNO,\r\n refresh\r\n) => {\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Automation/GetUserClockAutomationSummary?UserID=${userID}&VendorLocationID=${VendorLocationID}&ClockNO=${ClockNO}`,\r\n {\r\n refresh,\r\n }\r\n );\r\n return { data, error };\r\n};\r\n\r\nexport function AutomationCloseDIps(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Stock/CloseAutomationDipReading\";\r\n const requestBody = {\r\n parentDipNO: data.ParentDipNO,\r\n dipNO: data.DipNO,\r\n dipID: data.DipID,\r\n automationTankTransactionID: data.AutomationTankTransactionID,\r\n dateTimeStart: data.DateTimeStart,\r\n secondReading: data.SecondReading,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function SendEmailReport(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"GoogleSheets/SendEmailReport\";\r\n const requestBody = {\r\n shiftRefNO: \"\",\r\n recipientEmailArray: data?.emails,\r\n vendorLocationName: data.VendorLocationName,\r\n supervisorName: \"\",\r\n endDate: \"2024-06-17T13:46:04.565Z\",\r\n shiftClockNO: \"string\",\r\n shiftDate: \"string\",\r\n clockType: \"string\",\r\n senderMail: \"no-reply@crato.co.ke\",\r\n vendorName: data.TradingName,\r\n hostName: \"mail.crato.co.ke\",\r\n port: 587,\r\n password: \"Crato@2023!\",\r\n body: data?.Body,\r\n pdfBase64: data?.pdfBase64,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function SendWhatsAppReport(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"GoogleSheets/SendWhatsAppReport\";\r\n const requestBody = {\r\n receiverPhone: data.PhoneNumber,\r\n templateName: \"\",\r\n fileName: data.FileName,\r\n fileLink: data.pdfBase64,\r\n messageParam1: data.TradingName,\r\n messageParam2: data.VendorLocationName,\r\n messageParam3: data.DateRange,\r\n messageParam4: \"+254-702628741\",\r\n headerMessage: \"\",\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetCratoChat = (values, refresh) => {\r\n const { DateRange, UserID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `CratoAdmin/GetCratoAdminChatMessage?StartDate=${start}&EndDate=${end}&UserID=${UserID}`,\r\n { refresh }\r\n );\r\n\r\n return { data, error };\r\n};\r\n\r\nexport function AddCratoChat(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"CratoAdmin/AddCratoAdminChatMessage\";\r\n const requestBody = {\r\n messageID: 0,\r\n senderID: UserID,\r\n receiverID: 0,\r\n vendorLocationID: data.VendorLocationID,\r\n messageText: data.Messange,\r\n messageMediaID: data.MessangeFile,\r\n sentAt: new Date(),\r\n statusID: 1,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport function UpdateCratoChatStatus(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"CratoAdmin/UpdateCratoAdminChatMessageStatus\";\r\n const requestBody = data;\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetCratoAutomationDashBoard = (values, refresh) => {\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Automation/GetAutomationDashBoard?StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}`,\r\n { refresh }\r\n );\r\n\r\n return { data, error };\r\n};\r\n\r\nexport const GetPTSStatusReport = (ptsID, refresh) => {\r\n const { data, error } = useApiRes(\r\n Main_URL + `Automation/PtsStatus?PtsID=004000363233511335383836`,\r\n { refresh }\r\n );\r\n\r\n return { data, error };\r\n};\r\n\r\nexport const GetCratoAutomationDetailTransaction = (values, refresh) => {\r\n const { DateRange, VendorLocationID, ProductID, closing, invoive, loyalty } =\r\n values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Automation/GetPumpTransactionArray?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}&VendorProductID=${ProductID}&isLoyalty=${loyalty}&isInvoice=${invoive}&isCloseShift=${closing}`,\r\n { refresh }\r\n );\r\n\r\n return { data, error };\r\n};\r\n\r\nexport const GetCratoTankTransactionArray = (values, refresh) => {\r\n const { DateRange, VendorLocationID, ProductID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Automation/GetPumpTransactionArray?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}&VendorProductID=${ProductID}`,\r\n { refresh }\r\n );\r\n\r\n return { data, error };\r\n};\r\n\r\nexport const GetPTSNozzleIntegrations = (ptsID, refresh) => {\r\n const { data, error } = useApiRes(\r\n Main_URL + `Automation/GetNozzleIntergration?PtsID=${ptsID}`,\r\n { refresh }\r\n );\r\n\r\n return { data, error };\r\n};\r\n\r\nexport const GetAutomationDeliveries = (values, refresh) => {\r\n const { DateRange, VendorLocationID, ProductID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Automation/GetTankTransactionDeliveryArray?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}&VendorProductID=${ProductID}&isLatest=0`,\r\n { refresh }\r\n );\r\n\r\n return { data, error };\r\n};\r\n\r\nexport const GetAutomationTransporterReport = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Automation/GetDeliverySummaryTransporterReport?VendorID=${VendorID}&StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}&VendorProductID=0&VendorSupplierTransporterID=0`,\r\n { refresh }\r\n );\r\n\r\n return { data, error };\r\n};\r\n\r\nexport const GetAutomationTransporters = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { data, error } = useApiRes(\r\n Main_URL + `Admin/GetVendorSupplierTransporter?VendorID=${VendorID}`,\r\n { refresh }\r\n );\r\n\r\n return { data, error };\r\n};\r\n\r\nexport const GetAutomationSalesPerAttendant = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Automation/GetAttendantSalesReport?VendorID=${VendorID}&StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}&VendorProductID=0&UserID=0`,\r\n { refresh }\r\n );\r\n\r\n return { data, error };\r\n};\r\n\r\nexport const GetAutomationTankVariance = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID } = values;\r\n\r\n // Set start time to 00:00 and end time to 23:59\r\n const start = moment(DateRange[0])?.format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1])?.format(\"YYYY-MM-DD HH:mm\");\r\n\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Automation/GetTankVarianceReport?VendorID=${VendorID}&StartDate=${start}&EndDate=${end}&VendorLocationID=${VendorLocationID}&VendorProductID=0`,\r\n { refresh }\r\n );\r\n\r\n return { data, error };\r\n};\r\n\r\nexport const GetAutomationDailyTankVariance = (values, refresh) => {\r\n const VendorID = useVendorID() || encryptSession.getItem(\"ci\");\r\n const { DateRange, VendorLocationID, VendorProductID } = values;\r\n\r\n const start = moment(DateRange[0])?.format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1])?.format(\"YYYY-MM-DD HH:mm\");\r\n\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Automation/GetDailyTankVarianceReport?VendorID=${VendorID}&VendorLocationID=${VendorLocationID}&VendorProductID=${VendorProductID}&StartDate=${start}&EndDate=${end}`,\r\n { refresh }\r\n );\r\n\r\n return { data, error };\r\n};\r\n\r\nexport const GetAutomationTankTransactions = (values, refresh) => {\r\n const { DateRange, VendorLocationID, ProductID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `Automation/GetTankTransactionArray?VendorLocationID=${VendorLocationID}&StartDate=${start}&EndDate=${end}&VendorProductID=${ProductID}&isLatest=0`,\r\n { refresh }\r\n );\r\n\r\n return { data, error };\r\n};\r\n\r\nexport function AddFuelPTSPumpFix(data, successFn, errorFn) {\r\n const asyncSubmit = useAsyncSubmit(successFn, errorFn);\r\n const apiURL = Main_URL + \"Automation/FuelPTSPumpFix\";\r\n const requestBody = {\r\n vendorLocationID: data.VendorLocationID,\r\n addedBy: UserID,\r\n };\r\n const handleFormSubmit = async () => {\r\n asyncSubmit.handleAsyncSubmit(apiURL, requestBody);\r\n };\r\n\r\n return {\r\n loading: asyncSubmit.loading,\r\n submitted: asyncSubmit.submitted,\r\n success: asyncSubmit.success,\r\n setSubmitted: asyncSubmit.setSubmitted,\r\n handleFormSubmit,\r\n };\r\n}\r\n\r\nexport const GetFuelCardCustomers = (values, refresh) => {\r\n const { DateRange, VendorLocationID, CustomerID } = values;\r\n const start = moment(DateRange[0]).format(\"YYYY-MM-DD HH:mm\");\r\n const end = moment(DateRange[1]).format(\"YYYY-MM-DD HH:mm\");\r\n const { data, error } = useApiRes(\r\n Main_URL +\r\n `FuelCard/GetVendorCardCustomerAmount?VendorParentID=${ParentID}&VendorLocationID=${VendorLocationID}&VendorCustomerID=${CustomerID}&UserID=0&StartDate=${start}&EndDate=${end}&PageNO=1000&PageSize=300`,\r\n { refresh }\r\n );\r\n\r\n return { data, error };\r\n};\r\n"],"sourceRoot":""}