import { default as dayjs } from 'dayjs'; import { FieldDisableConfig } from './constant'; export declare const isJsonParse: (jsonString?: string) => any; export declare const generateRandomId: (concatString?: string) => { uniqueStringId: string; uniqueNumberId: number; }; export declare const generateAndFormatStringFromObj: (obj?: any, keysInOrder?: string[]) => string; export declare const generateFields: (fieldsConfig: any) => any; export declare const generateQueryString: (rule: any) => string; export declare const getOperatorLabel: (rule: any, filterFields: any[]) => string; export declare const formatAmount: (amount?: number | string, format?: string, position?: "after" | "before", symbol?: string, fraction?: number) => string; export declare const filterCoaByCompanyIdOrNull: (allCoa: any[], { companyId }: { companyId?: number | string | null | any[]; }) => any[]; export declare const validateDiscountValidity: (date: any, discountDueDateBasedOn: any, discountValidity: any) => boolean; export declare const postImportSheet: (request: any, moduleName: string) => Promise; export declare const getExcelTemplateGenerateTemplate: (request: any) => Promise; export declare const getExcelExportTemplate: (request: any) => Promise; export declare const getPdfExportTemplate: (request: any) => Promise; export declare const removeIdStaticIdsFromMongoObject: (data: any) => any; export interface UploadOptions { onProgress?: (progress: ProgressInfo) => void; chunkSize?: number; retryAttempts?: number; retryDelay?: number; } export interface ProgressInfo { fileName: string; progress: number; bytesUploaded: number; totalBytes: number; fileIndex?: number; totalFiles?: number; } export interface FileUploadResponse { data: { preSignedData: { uploadId: string; fileName: string; preSignedUrls: Array<{ partNumber: number; presignedUrl: string; }>; location?: string; presignedUrl?: string; }; }; } export interface CompleteUploadResponse { data: { location: string; }; } export interface UploadPart { partNumber: number; etag: string; } export declare const handleRegularUpload: (files: File[], controller: AbortController, module: string, options?: UploadOptions) => Promise; /** * Main upload function - handles file validation and orchestrates the upload process * @param files - Single file or array of files to upload * @param module - Module name for the upload endpoint (default: "sales") * @param options - Optional upload configuration * @returns Promise - Array of uploaded file locations */ export declare const uploadFiles: (files: any, module?: string, options?: UploadOptions) => Promise; export declare const formatDateForPayload: (date: any) => string; export declare const formatTimeForPayload: (date: any) => string; export declare const formatDateTimeForPayload: (date: any) => string; export declare function isJSONString(str: string | undefined): any; export declare const getErrorMessage: (error?: any) => any; export declare const InvoiceStatus: { Approved: string; Rejected: string; }; /** * Get the default currency symbol from localStorage user data. * This is a utility function (not a hook) so it can be safely called anywhere. * @param currencyData - Optional pre-fetched currency data to avoid localStorage lookup */ export declare const defaultCurrencySymbol: (currencyData?: { symbol?: string; }) => any; export declare const getCurrencySymbol: (currencyData?: { symbol?: string; company_id?: number; }) => any; /** * Get the default currency format from localStorage user data. * This is a utility function (not a hook) so it can be safely called anywhere. * @param currencyData - Optional pre-fetched currency data to avoid localStorage lookup */ export declare const defaultCurrencyFormat: (currencyData?: { number_format?: string; }) => any; export declare const getCurrencyFormat: (currencyData?: { number_format?: string; company_id?: number; }) => any; /** * Get the default company from localStorage user data. * This is a utility function (not a hook) so it can be safely called anywhere. * @param userData - Optional pre-fetched user data to avoid localStorage lookup */ export declare const defaultCompany: (userData?: { accessCompanies?: number[]; company_id?: number | null; }) => number; export declare function omitDataKeys(obj: T, extra?: Array): T; export interface DataObject { [key: string]: any; } export interface LabelValueObject extends DataObject { label: string; value: string | number | null; } /** * A global function to process an array of objects and return formatted label-value pairs. * * @param {Array} dataArray - The array of objects to be processed. * @param {Array} fallbackArray - The fallback array if dataArray is empty. * @param {Array} labelKeys - The keys to be concatenated for the label. * @param {keyof T | string} valueKey - The key to be used for the value. * @param {Function} [labelFormatter] - Optional custom formatter for label. * @returns {Array} - The processed array of label-value objects. */ export declare const getLabelValuePairs: (dataArray: T[], fallbackArray: T[], labelKeys: (keyof T | string)[], valueKey: keyof T | string, labelFormatter?: (item: T) => string) => LabelValueObject[]; export declare function formatEmptyDataToNull(obj: T): T; export declare function downloadFile(fileUrl: string, fileName?: string): void; export declare const downloadDoc: ({ api, raw }: { api: string; fileName: string; raw: any; }) => Promise; export declare function formatResponseDatesToDayJS(obj: T): T; export declare const toFixedWithNumbers: (num: number, fraction?: number) => string | number; export declare const findById: (arr: Array, id: any) => any; export declare const getTaxAmountFromMultipleTaxCodes: (amount: number, taxCodes?: any[], detail?: boolean) => number | { id: any; name: any; rate: any; tax_amount: number; }[]; export declare const getTaxAmountDataFromMultipleTaxCodes: (grossAmount: number, netAmount: number, taxCodes?: any[], detail?: boolean) => { id: any; name: any; rate: any; tax_amount: number; }[] | { amount: number; rate: number; }; export declare const calculateAmountData: (quantity: number, rate: number, discount_rate: number | null, discounted_items: any, taxCodes?: any[], treatRateAsPercentage?: boolean) => { grossAmount: number; taxAmount: any; taxRate: any; discountAmount: number; netAmount: number; totalAmount: number; }; export type AnyObject = Record; export declare const hasValue: (object: AnyObject, skipFields?: string[]) => boolean; export declare const formatAmountWithCurrency: (amount: number, currencySymbol?: string) => string; export declare const formatAmountWithCurrencyData: (amount: number, currencySymbol?: string) => string; export type ManageItemsOptions = { key: string; action: "add" | "update" | "delete"; value: any; items: any[]; itemIndex: number; }; export declare const manageItems: ({ key, action, value, items, itemIndex }: ManageItemsOptions) => any[]; export declare function getPartyName(party: Record | null | undefined): string; export declare const partyEmailIds: (json: any) => string; export declare function formatResponseOnlyDatesToDayJS(obj: T): T; export declare const fetchExchageRate: (id: string, type?: string) => Promise<{ exchange_rate: any; reverse_rate: any; }>; export declare const showSnackBar: (error: any) => void; export declare const fetchCompanyLocations: (companyId: number) => Promise<{ label: any; value: any; }[]>; export declare const fetchItems: (itemId: number, attributes?: string) => Promise<{ label: any; value: any; }[]>; export declare const getOptionsData: (key: string, id: number, select?: any, isArray?: boolean) => Promise<{ label: any; value: any; } | { label: any; value: any; }[]>; export declare const fetchOptions: (key: string, filters: any, select?: any, isArray?: boolean) => Promise<{ label: any; value: any; } | { label: any; value: any; }[]>; export declare const createdOnAndBy: (data: any) => string; /** * Returns the full name of an object based on the provided keys. * The object is expected to have the keys as its properties. * If the object is empty, returns a default value. * @param {Record} obj - The object to process * @param {string[]} keys - The keys to use for forming the name * @returns {string} The full name of the object */ export declare const getName: (obj: Record, keys: string[]) => string; export declare const getToken: (token?: any) => { "x-token": any; "x-timezone": number; }; export declare const checkForDuplicate: (payload: any) => Promise; export declare const partyDuplicateCheck: (activeTab: number | string, fValues: Record, defaultValues?: Record) => Promise; export declare const displayPhone: (data: Record) => any; export declare const getPartyDependentData: (id: number, options?: any) => Promise<{ addresses: any[]; contacts: any[]; currencies: any; currencyIds: any; companies: any; companyIds: any; paymentTerm: any; defaultShipping: any; defaultBilling: any; salesperson: any; }>; export interface PayloadMapping { [key: string]: string | string[] | ((values: Record) => any); } export declare const mapApiPayload: (payloadMapping: PayloadMapping, values: Record) => Record; export declare const mapAsyncApiPayload: (payloadMapping: PayloadMapping, values: Record) => Promise>; export declare const isBetweenTheDates: (startDate: any, endDate: any) => boolean; export declare const setRateBasedOnPriceRules: (salesPrice: any, priceRules: any, addedQuantity: any) => any; export declare const uploadAttachments: (files: any) => Promise; export declare const addOrEditArray: (array: any[], data: any) => any[]; export declare const getDefaultUserData: () => any; export declare const getDefaultFraction: () => number; export declare const getAccessibleModules: (moduleNames?: string[]) => string[]; export declare const filterAccessibleModules: (menu: any, moduleNames?: string[]) => any; export declare const checkDuplicateTracking: (data: any, typeOfTrcebility: string, trackRows: any[]) => { isDuplicate: boolean; errorMsg?: undefined; } | { isDuplicate: boolean; errorMsg: any; }; export declare function getNestedValue(obj: any, path: any): any; export declare const calculatePeriods: (startDateTime: Date, endDateTime: Date, mode?: "Day" | "Week" | "Month" | "Calendar Month" | "Year" | "Hour") => string; export declare const removeIdFromObject: (array: any) => any; export declare const fetchRentalResponseItems: (filters: string) => Promise; export declare const fetchRfqItemsByIdForResponse: (filters: string) => Promise; export declare const appendConditionSafely: (original: string | undefined, newCondition: string) => string; export declare const fetchAssemblyItemData: (itemId: number) => Promise; export declare const getFileName: (file: any) => string; export declare const getFieldFilters: (fields: any[], fieldNames: string | string[]) => any; export declare const getNextScheduleDate: (currentDate: any, billingCycle: any) => dayjs.Dayjs; export declare const getCountryIdByName: (name: string) => Promise; export declare const getSlicedValue: (value: string, length: number) => string; export declare const skuGenerator: ({ name, category, sequence }: { name: string; category: string; sequence?: string; }) => string; export declare const checkSkuAndItemName: (payload: any) => Promise; export declare const checkUniqueFields: (payload: any) => Promise; export interface FormValues { [key: string]: any; } export interface UpdateFieldsDisabledConfig { data: any[]; materialCostingType: string; formValues: FormValues; fieldsConfig?: FieldDisableConfig; isEditMode?: boolean; isAddMode?: boolean; alwaysDisabledFields?: string[]; editModeDisabledFields?: string[]; addModeDisabledFields?: string[]; customDisabledFields?: string[]; } export declare const updateFieldsDisabledState: ({ data, materialCostingType, formValues, fieldsConfig, isEditMode, isAddMode, alwaysDisabledFields, editModeDisabledFields, addModeDisabledFields, customDisabledFields }: UpdateFieldsDisabledConfig) => any[]; export declare const remainingMaterialCostingTypes: (type: string | string[]) => string[]; export declare const matchedMaterialCostingTypeLabel: (type: string | string[]) => string; export declare const fetchDataLocally: (params: any, arr: any) => { data: any; pagination: { totalCount: any; }; };