import { NestedAccountHierarchyForReport } from '../../../../commonStateTypes/accountView/nestedAccountID'; import { AllowedValueWithCode } from '../../../../commonStateTypes/allowedValue'; import { Amount } from '../../../../commonStateTypes/amount'; import { NestedClassHierarchyForReport } from '../../../../commonStateTypes/classesView/nestedClassID'; import { FetchStateAndError, ID } from '../../../../commonStateTypes/common'; import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport'; import { BillPayInfo, BillPaymentMethod, BillStageCodeType, BillTransaction } from '../../../../entity/billPay/billTransaction/billTransactionState'; import { InternationalTransferFeeBearerPaymentMethod } from '../../../../entity/billPay/billTransaction/internationalTransferFeeBearerPaymentMethod'; import { RecurringBillState } from '../../../../entity/billPay/recurringBills/recurringBillsState'; import { PaymentAccount } from '../../../../entity/paymentAccount/paymentAccountState'; import { PiLabel } from '../../../../entity/paymentInstrument/paymentInstrument'; import { LoggedInUser } from '../../../../entity/tenant/tenantState'; import { Attachment } from '../../../../entity/transaction/stateTypes/attachment'; import { RecommendationByLineId } from '../../../../entity/transaction/stateTypes/transaction'; import { TransactionWithAccountAndClassLine } from '../../../../entity/transaction/stateTypes/transactionLine'; import { User } from '../../../../entity/user/userState'; import { Vendor } from '../../../../entity/vendor/vendorState'; import { RootState } from '../../../../rootStateTypes'; import { ZeniDate } from '../../../../zeniDayJS'; import { AccountListSelectorView } from '../../../accountList/accountListSelector'; import { ClassListSelectorView } from '../../../classList/classListSelector'; import { VendorDetailLocalData } from '../../../commonVendorView/vendorView/vendorViewState'; import { ActivityHistorySelectorView } from '../../commonHistoryView/commonHistorySelector'; import { FundingAccount } from '../../commonSetup/setupViewState'; import { PlaidConnectionDetails } from '../../plaidAccount/plaidAccountViewState'; import { AccountTypeSubConfigCodeKeyType, BillPayConfig, BillPayConfigState } from '../billPayConfig/billPayConfigState'; import { DuplicateBillsSelectorView } from '../billPayReview/getDuplicateBills'; import { ApprovalRuleWithUser, BillActivity, BillPaySetupApproverView } from '../billPaySetupApproverView/billPaySetupApproverViewSelectorTypes'; import { PreviousBillsSelectorView } from '../previousBills/previousBillsSelector'; import { AddBillAutoFields, LineItemRecommendationsLocalData, PaymentDetailsSection, PaymentMode, PaymentModeType, RecurringBillConfigLocalData, RecurringBillInstance, WhatForSection } from './editBillViewState'; export type PaymentToOption = { bankAccountIban: string; bankAccountName: string; bankAccountNumber: string; bankAccountType: string; bankName: string; bankRoutingNumberAch: string; bankRoutingNumberWireTransfer: string; bankSwiftCode: string; email: string; id: ID; maxValidAmount: number | null; minValidAmount: number; piLabels: PiLabel[]; piName: string; type: PaymentModeType; createTime?: ZeniDate; }; export interface EditBillDetailSelectorView extends SelectorView { accountList: AccountListSelectorView; accountsHierarchyList: NestedAccountHierarchyForReport[]; addBillAutoFields: AddBillAutoFields; approvalRules: BillPaySetupApproverView; billActivities: BillActivity[]; billHistory: ActivityHistorySelectorView; billPayConfigList: BillPayConfig[]; billStage: BillStageCodeType; classHierarchyList: NestedClassHierarchyForReport[]; classList: ClassListSelectorView; createdBy: User | undefined; deleteStatus: FetchStateAndError; duplicateBills: DuplicateBillsSelectorView; file: Attachment | undefined; isCancelled: boolean; isCollectToAccountInfoFromVendorContact: boolean; isDeleted: boolean; isProcessing: boolean; isRecurring: boolean; lineDetailSection: Record; paymentDetailsSection: PaymentDetailsSectionView | undefined; paymentToList: PaymentToOption[]; plaidConnectionDetails: PlaidConnectionDetails; previousBills: PreviousBillsSelectorView; saveStatus: FetchStateAndError | undefined; showAutofill: boolean; showVendorGptRecommendationText: boolean; uploadStatus: FetchStateAndError | undefined; vendor: Vendor | undefined; whatForSection: WhatForSection; withdrawFromList: FundingAccount[]; billPayInfo?: BillPayInfo; bookCloseDate?: ZeniDate; /** * Bill-level accounting class id. Approval Rules 3.0 'department' * criteria match against this — selectors needing to evaluate a * department-narrowed rule against the current bill should read * this rather than digging through 'state.billTransactionState'. */ classId?: ID; createTime?: ZeniDate; editBillInitialDetails?: EditBillInitialDetails; internationalWireOnboardingStatus?: AllowedValueWithCode; isBillMarkedForRetry?: boolean; isEligibleForRetryOBP?: boolean; lastRecommendedVendorName?: string; latestApprovedDate?: ZeniDate; newAddedBillPaymentAccountId?: ID; paymentAccount?: PaymentAccount; payNowCutOffTime?: ZeniDate; qboId?: ID; recommendationByLineID?: RecommendationByLineId; recommendedVendor?: Vendor; recurringBillInstances?: RecurringBillInstance[]; recurringConfig?: RecurringBillConfigLocalData; toAccountVendorEmail?: string; vendorContactSaveStatus?: FetchStateAndError; vendorDetailLocalData?: VendorDetailLocalData; } export interface EditBillInitialDetails { lineDetailSection: Record>; paymentDetailsSection?: PaymentDetailsSectionView; recipientTotalAmount?: Amount; totalAmount?: Amount; vendor?: Vendor; whatForSection?: WhatForSection; } export declare const getEditBillDetail: (state: RootState, isVendorRecommendationFeatureEnabled: boolean, isZeniAccountsEnabled: boolean, billId?: ID) => EditBillDetailSelectorView; export declare const getBillPayConfigList: (billPayConfigState: BillPayConfigState) => BillPayConfig[]; export declare const getPaymentMethodType: (billPayConfigState: BillPayConfigState, accType?: AccountTypeSubConfigCodeKeyType, paymentMethod?: BillPaymentMethod, internationalTransferFeeBearerPaymentMethod?: InternationalTransferFeeBearerPaymentMethod) => BillPayConfig | undefined; export declare function getWhatForSection(updatedWhatForSection: WhatForSection | undefined): WhatForSection; export declare function getPaymentSection(state: RootState, withdrawFromList: FundingAccount[], updatedPaymentSection: PaymentDetailsSection, companyId?: string, billPayInfo?: BillPayInfo): PaymentDetailsSectionView; export declare function toPaymentToOption(paymentMode: PaymentMode): PaymentToOption; export interface PaymentDetailsSectionView { conversionRate?: number; defaultSelectedAccount?: FundingAccount; internationalTransferFeeBearerPaymentMethod?: InternationalTransferFeeBearerPaymentMethod; paymentDate?: ZeniDate; paymentTo?: PaymentToOption; paymentType?: BillPayConfig; withdrawFrom?: FundingAccount; withdrawFromAccountingName?: string; } export declare const getRecurringBillLocalData: (recurringBillState: RecurringBillState, transaction: BillTransaction) => { recurringBillInstancesLocalData: RecurringBillInstance[]; recurringConfigLocalData?: RecurringBillConfigLocalData; }; export declare const getInvoiceDate: (billStageCode: BillStageCodeType, invoiceDate: ZeniDate, bookCloseDate?: ZeniDate) => import("dayjs").Dayjs; export declare const getDueDate: (billStageCode: BillStageCodeType, dueDate: ZeniDate, invoiceDate?: ZeniDate, bookCloseDate?: ZeniDate) => import("dayjs").Dayjs; export declare const getWithdrawFrom: (state: RootState, fromAccountId?: ID, fromAccountType?: string, companyId?: ID, lastSelectedFromAccount?: { accountId: ID; accountType: AccountTypeSubConfigCodeKeyType; }) => FundingAccount | undefined; export declare const getDefaultWithdrawFromAccount: (state: RootState, depositAccounts: ID[], companyId: ID, lastSelectedFromAccount?: { accountId: ID; accountType: AccountTypeSubConfigCodeKeyType; }) => FundingAccount | undefined; export declare const checkIfCreatorIsApprover: (billAmount: number, approvalRules: ApprovalRuleWithUser[], signedInUser?: LoggedInUser, billVendorId?: ID, billDepartmentId?: ID) => boolean;