diff --git a/.dockerignore b/.dockerignore index 6b45346d9d..2a7fc7dc85 100644 --- a/.dockerignore +++ b/.dockerignore @@ -28,3 +28,5 @@ CODE_OF_CONDUCT.md # Logs *.log +Dockerfile +Dockerfile.dev diff --git a/Dockerfile b/Dockerfile index 49e5498ea4..e65ae77544 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,12 @@ FROM node:20-alpine AS build WORKDIR /app -COPY . . +RUN apk add python3 build-base && corepack enable && corepack prepare pnpm@latest --activate -RUN apk add python3 build-base && \ - corepack enable && corepack prepare pnpm@latest --activate && \ - rm -rf /app/node_modules && \ - pnpm install && pnpm build +COPY package.json pnpm-lock.yaml pnpmfile.docker.cjs ./ +RUN pnpm install --pnpmfile=./pnpmfile.docker.cjs +COPY . . +RUN pnpm install && pnpm build FROM nginx:1.27-alpine diff --git a/cypress/e2e/10-resources/t50-edit-plan.cy.ts b/cypress/e2e/10-resources/t50-edit-plan.cy.ts index 1468b304b5..599c0aada9 100644 --- a/cypress/e2e/10-resources/t50-edit-plan.cy.ts +++ b/cypress/e2e/10-resources/t50-edit-plan.cy.ts @@ -30,7 +30,7 @@ describe('Edit plan', () => { cy.get('input[name="name"]').should('not.be.disabled') cy.get('input[name="code"]').should('not.be.disabled') cy.get('textarea[name="description"]', { timeout: 10000 }).should('not.be.disabled') - cy.get(`[data-test="fixed-fee-section-accordion"]`).within(() => { + cy.get(`[data-test="subscription-fee-section-accordion"]`).within(() => { cy.get(`.MuiAccordionSummary-root`).click({ force: true }) }) // cy.get('input[name="amountCents"]', { timeout: 10000 }).should('not.be.disabled') @@ -70,7 +70,7 @@ describe('Edit plan', () => { cy.get('[data-test="tab-internal-button-link-update-plan"]').click({ force: true }) cy.get('input[name="name"]').should('not.be.disabled') cy.get('textarea[name="description"]', { timeout: 10000 }).should('not.be.disabled') - cy.get(`[data-test="fixed-fee-section-accordion"]`).within(() => { + cy.get(`[data-test="subscription-fee-section-accordion"]`).within(() => { cy.get(`.MuiAccordionSummary-root`).click({ force: true }) }) cy.get('input[name="amountCents"]') diff --git a/package.json b/package.json index ac5cace382..1e8bdb41db 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "babel-jest": "^29.7.0", "class-variance-authority": "^0.7.0", "cssnano": "^7.0.6", - "cypress": "14.5.1", + "cypress": "15.2.0", "dotenv": "16.3.1", "eslint": "^9.32.0", "eslint-plugin-import": "^2.31.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6db6c75b5d..f2510caa84 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -233,8 +233,8 @@ importers: specifier: ^7.0.6 version: 7.0.6(postcss@8.4.49) cypress: - specifier: 14.5.1 - version: 14.5.1 + specifier: 15.2.0 + version: 15.2.0 dotenv: specifier: 16.3.1 version: 16.3.1 @@ -1475,8 +1475,8 @@ packages: peerDependencies: postcss: ^8.4 - '@cypress/request@3.0.8': - resolution: {integrity: sha512-h0NFgh1mJmm1nr4jCwkGHwKneVYKghUyWe6TMNrk0B9zsjAJxpg8C4/+BAcmLgCPa1vj1V8rNUaILl+zYRUWBQ==} + '@cypress/request@3.0.9': + resolution: {integrity: sha512-I3l7FdGRXluAS44/0NguwWlO83J18p0vlr2FYHrJkWdNYhgVoiYo61IXPqaOsL+vNxU1ZqMACzItGK3/KKDsdw==} engines: {node: '>= 6'} '@cypress/xvfb@1.2.4': @@ -3885,9 +3885,9 @@ packages: csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - cypress@14.5.1: - resolution: {integrity: sha512-vYBeZKW3UAtxwv5mFuSlOBCYhyO0H86TeDKRJ7TgARyHiREIaiDjeHtqjzrXRFrdz9KnNavqlm+z+hklC7v8XQ==} - engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + cypress@15.2.0: + resolution: {integrity: sha512-J4ehSzOSb58SkXyldCe9y/oZ8ep8Bl6+q9kDUjnkqNqc2ZKzDq5KSbhIc2lHFAFR5Jtj10oNqr9JRAZbr8DA8A==} + engines: {node: ^20.0.0 || ^22.0.0 || >=24.0.0} hasBin: true d3-array@3.2.4: @@ -4672,9 +4672,6 @@ packages: resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} engines: {node: '>= 0.4'} - getos@3.2.1: - resolution: {integrity: sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==} - getpass@0.1.7: resolution: {integrity: sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==} @@ -7337,6 +7334,12 @@ packages: resolution: {integrity: sha512-Q/XQKRaJiLiFIBNN+mndW7S/RHxvwzuZS6ZwmRzUBqJBv/5QIKCEwkBC8GBf8EQJKYnaFs0wOZbKTXBPj8L9oQ==} engines: {node: ^14.18.0 || >=16.0.0} + systeminformation@5.27.7: + resolution: {integrity: sha512-saaqOoVEEFaux4v0K8Q7caiauRwjXC4XbD2eH60dxHXbpKxQ8kH9Rf7Jh+nryKpOUSEFxtCdBlSUx0/lO6rwRg==} + engines: {node: '>=8.0.0'} + os: [darwin, linux, win32, freebsd, openbsd, netbsd, sunos, android] + hasBin: true + tailwind-merge@2.6.0: resolution: {integrity: sha512-P+Vu1qXfzediirmHOC3xKGAYeZtPcV9g76X+xg2FD4tYgR71ewMA35Y3sCz3zhiN/dwefRpJX0yBcgwi1fXNQA==} @@ -7398,6 +7401,10 @@ packages: resolution: {integrity: sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==} engines: {node: '>=14.14'} + tmp@0.2.5: + resolution: {integrity: sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==} + engines: {node: '>=14.14'} + tmpl@1.0.5: resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} @@ -9164,7 +9171,7 @@ snapshots: dependencies: postcss: 8.4.49 - '@cypress/request@3.0.8': + '@cypress/request@3.0.9': dependencies: aws-sign2: 0.7.0 aws4: 1.13.2 @@ -12023,9 +12030,9 @@ snapshots: csstype@3.1.3: {} - cypress@14.5.1: + cypress@15.2.0: dependencies: - '@cypress/request': 3.0.8 + '@cypress/request': 3.0.9 '@cypress/xvfb': 1.2.4(supports-color@8.1.1) '@types/sinonjs__fake-timers': 8.1.1 '@types/sizzle': 2.3.9 @@ -12050,7 +12057,6 @@ snapshots: extract-zip: 2.0.1(supports-color@8.1.1) figures: 3.2.0 fs-extra: 9.1.0 - getos: 3.2.1 hasha: 5.2.2 is-installed-globally: 0.4.0 lazy-ass: 1.6.0 @@ -12065,7 +12071,8 @@ snapshots: request-progress: 3.0.0 semver: 7.7.1 supports-color: 8.1.1 - tmp: 0.2.3 + systeminformation: 5.27.7 + tmp: 0.2.5 tree-kill: 1.2.2 untildify: 4.0.0 yauzl: 2.10.0 @@ -13063,10 +13070,6 @@ snapshots: es-errors: 1.3.0 get-intrinsic: 1.3.0 - getos@3.2.1: - dependencies: - async: 3.2.6 - getpass@0.1.7: dependencies: assert-plus: 1.0.0 @@ -16250,6 +16253,8 @@ snapshots: '@pkgr/core': 0.2.3 tslib: 2.8.1 + systeminformation@5.27.7: {} + tailwind-merge@2.6.0: {} tailwindcss@3.4.17(ts-node@10.9.2(@swc/core@1.10.6)(@types/node@22.15.17)(typescript@5.8.3)): @@ -16331,6 +16336,8 @@ snapshots: tmp@0.2.3: {} + tmp@0.2.5: {} + tmpl@1.0.5: {} to-fast-properties@2.0.0: {} diff --git a/pnpmfile.docker.cjs b/pnpmfile.docker.cjs new file mode 100644 index 0000000000..7fcb3a8436 --- /dev/null +++ b/pnpmfile.docker.cjs @@ -0,0 +1,14 @@ +module.exports = { + hooks: { + readPackage(pkg) { + // Block postinstall script for a specific package + if (pkg.name !== "lago-front") return pkg; + + delete pkg.scripts.postinstall; + delete pkg.dependencies["lago-design-system"]; + delete pkg.dependencies["lago-configs"]; + + return pkg; + } + } +} diff --git a/src/components/addOns/types.ts b/src/components/addOns/types.ts index bd3969ef41..0826c3e2b6 100644 --- a/src/components/addOns/types.ts +++ b/src/components/addOns/types.ts @@ -1,6 +1,6 @@ -import { CreateAddOnInput, TaxOnAddOnEditCreateFragment } from '~/generated/graphql' +import { CreateAddOnInput, TaxForTaxesSelectorSectionFragment } from '~/generated/graphql' export interface AddOnFormInput extends Omit { // NOTE: this is used for display purpose but will be replaced by taxCodes[] on save - taxes?: TaxOnAddOnEditCreateFragment[] + taxes?: TaxForTaxesSelectorSectionFragment[] } diff --git a/src/components/invoices/DisputeInvoiceDialog.tsx b/src/components/invoices/DisputeInvoiceDialog.tsx index 8ec97f16a8..f395ee46e8 100644 --- a/src/components/invoices/DisputeInvoiceDialog.tsx +++ b/src/components/invoices/DisputeInvoiceDialog.tsx @@ -46,7 +46,7 @@ export const DisputeInvoiceDialog = forwardRef((_, ref) }) } }, - refetchQueries: ['getInvoiceDetails'], + refetchQueries: ['getInvoiceSubscriptions'], }) useImperativeHandle(ref, () => ({ diff --git a/src/components/invoices/EditInvoiceDisplayName.tsx b/src/components/invoices/EditInvoiceDisplayName.tsx deleted file mode 100644 index cf5a4b6077..0000000000 --- a/src/components/invoices/EditInvoiceDisplayName.tsx +++ /dev/null @@ -1,92 +0,0 @@ -import { useFormik } from 'formik' -import { forwardRef, useImperativeHandle, useRef, useState } from 'react' -import { object, string } from 'yup' - -import { Button, Dialog, DialogRef } from '~/components/designSystem' -import { TextInputField } from '~/components/form' -import { InputMaybe } from '~/generated/graphql' -import { useInternationalization } from '~/hooks/core/useInternationalization' - -type EditInvoiceDisplayNameProps = { - invoiceDisplayName: InputMaybe | undefined - callback: (invoiceDisplayName: string) => void -} - -export interface EditInvoiceDisplayNameRef { - openDialog: (data: EditInvoiceDisplayNameProps) => unknown - closeDialog: () => unknown -} - -export const EditInvoiceDisplayName = forwardRef((_, ref) => { - const { translate } = useInternationalization() - const dialogRef = useRef(null) - const [data, setData] = useState() - - const formikProps = useFormik>({ - initialValues: { - invoiceDisplayName: data?.invoiceDisplayName || '', - }, - validationSchema: object().shape({ - invoiceDisplayName: string(), - }), - validateOnMount: true, - enableReinitialize: true, - onSubmit: async (values, formikBag) => { - data?.callback(values.invoiceDisplayName || '') - - dialogRef?.current?.closeDialog() - formikBag.resetForm() - }, - }) - - useImperativeHandle(ref, () => ({ - openDialog: (datas) => { - setData(datas) - dialogRef.current?.openDialog() - }, - closeDialog: () => dialogRef.current?.closeDialog(), - })) - - return ( - { - formikProps.resetForm() - formikProps.validateForm() - }} - actions={({ closeDialog }) => ( - <> - - - - )} - > - - - ) -}) - -EditInvoiceDisplayName.displayName = 'forwardRef' diff --git a/src/components/invoices/EditInvoiceDisplayNameDialog.tsx b/src/components/invoices/EditInvoiceDisplayNameDialog.tsx new file mode 100644 index 0000000000..375682e826 --- /dev/null +++ b/src/components/invoices/EditInvoiceDisplayNameDialog.tsx @@ -0,0 +1,94 @@ +import { useFormik } from 'formik' +import { forwardRef, useImperativeHandle, useRef, useState } from 'react' +import { object, string } from 'yup' + +import { Button, Dialog, DialogRef } from '~/components/designSystem' +import { TextInputField } from '~/components/form' +import { InputMaybe } from '~/generated/graphql' +import { useInternationalization } from '~/hooks/core/useInternationalization' + +type EditInvoiceDisplayNameDialogProps = { + invoiceDisplayName: InputMaybe | undefined + callback: (invoiceDisplayName: string) => void +} + +export interface EditInvoiceDisplayNameDialogRef { + openDialog: (data: EditInvoiceDisplayNameDialogProps) => unknown + closeDialog: () => unknown +} + +export const EditInvoiceDisplayNameDialog = forwardRef( + (_, ref) => { + const { translate } = useInternationalization() + const dialogRef = useRef(null) + const [data, setData] = useState() + + const formikProps = useFormik>({ + initialValues: { + invoiceDisplayName: data?.invoiceDisplayName || '', + }, + validationSchema: object().shape({ + invoiceDisplayName: string(), + }), + validateOnMount: true, + enableReinitialize: true, + onSubmit: async (values, formikBag) => { + data?.callback(values.invoiceDisplayName || '') + + dialogRef?.current?.closeDialog() + formikBag.resetForm() + }, + }) + + useImperativeHandle(ref, () => ({ + openDialog: (datas) => { + setData(datas) + dialogRef.current?.openDialog() + }, + closeDialog: () => dialogRef.current?.closeDialog(), + })) + + return ( + { + formikProps.resetForm() + formikProps.validateForm() + }} + actions={({ closeDialog }) => ( + <> + + + + )} + > + + + ) + }, +) + +EditInvoiceDisplayNameDialog.displayName = 'EditInvoiceDisplayNameDialog' diff --git a/src/components/invoices/InvoicesList.tsx b/src/components/invoices/InvoicesList.tsx index aaa0d59dd5..9211d56046 100644 --- a/src/components/invoices/InvoicesList.tsx +++ b/src/components/invoices/InvoicesList.tsx @@ -33,7 +33,7 @@ import { } from '~/components/invoices/FinalizeInvoiceDialog' import { VoidInvoiceDialog, VoidInvoiceDialogRef } from '~/components/invoices/VoidInvoiceDialog' import { PremiumWarningDialog, PremiumWarningDialogRef } from '~/components/PremiumWarningDialog' -import { addToast, envGlobalVar, hasDefinedGQLError } from '~/core/apolloClient' +import { addToast, hasDefinedGQLError } from '~/core/apolloClient' import { INVOICE_LIST_FILTER_PREFIX } from '~/core/constants/filters' import { invoiceStatusMapping, paymentStatusMapping } from '~/core/constants/statusInvoiceMapping' import { CustomerInvoiceDetailsTabsOptionsEnum } from '~/core/constants/tabsOptions' @@ -66,11 +66,8 @@ import { useInternationalization } from '~/hooks/core/useInternationalization' import { useCustomerHasActiveWallet } from '~/hooks/customer/useCustomerHasActiveWallet' import { useCurrentUser } from '~/hooks/useCurrentUser' import { useOrganizationInfos } from '~/hooks/useOrganizationInfos' -import { usePermissions } from '~/hooks/usePermissions' import { usePermissionsInvoiceActions } from '~/hooks/usePermissionsInvoiceActions' -const { disablePdfGeneration } = envGlobalVar() - type TInvoiceListProps = { error: ApolloError | undefined fetchMore: GetInvoicesListQueryResult['fetchMore'] @@ -89,7 +86,6 @@ const InvoicesList = ({ variables, }: TInvoiceListProps) => { const { translate } = useInternationalization() - const { hasPermissions } = usePermissions() const { isPremium } = useCurrentUser() const navigate = useNavigate() const [searchParams] = useSearchParams() @@ -201,31 +197,12 @@ const InvoicesList = ({ associatedActiveWalletPresent: invoice?.associatedActiveWalletPresent, }) - // TODO: Compare this with src/hooks/usePermissionsInvoiceActions.ts: - // We don't check the taxStatus here, is it an oversight? - const canDownload = - ![ - InvoiceStatusTypeEnum.Draft, - InvoiceStatusTypeEnum.Failed, - InvoiceStatusTypeEnum.Pending, - ].includes(invoice.status) && - hasPermissions(['invoicesView']) && - !disablePdfGeneration - - const canUpdatePaymentStatus = - ![ - InvoiceStatusTypeEnum.Draft, - InvoiceStatusTypeEnum.Voided, - InvoiceStatusTypeEnum.Failed, - InvoiceStatusTypeEnum.Pending, - ].includes(invoice.status) && hasPermissions(['invoicesUpdate']) - const isPartiallyPaid = Number(invoice.totalPaidAmountCents) > 0 && Number(invoice.totalAmountCents) - Number(invoice.totalPaidAmountCents) > 0 return [ - canDownload + actions.canDownload(invoice) ? { startIcon: 'download', title: translate('text_62b31e1f6a5b8b1b745ece42'), @@ -305,7 +282,7 @@ const InvoicesList = ({ } : null, - canUpdatePaymentStatus + actions.canUpdatePaymentStatus(invoice) ? { startIcon: 'coin-dollar', title: translate('text_63eba8c65a6c8043feee2a01'), diff --git a/src/components/invoices/details/DeleteAdjustedFeeDialog.tsx b/src/components/invoices/details/DeleteAdjustedFeeDialog.tsx index f781f52431..208069b640 100644 --- a/src/components/invoices/details/DeleteAdjustedFeeDialog.tsx +++ b/src/components/invoices/details/DeleteAdjustedFeeDialog.tsx @@ -46,7 +46,7 @@ export const DeleteAdjustedFeeDialog = forwardRef((_ }) } }, - refetchQueries: ['getInvoiceDetails'], + refetchQueries: ['getInvoiceSubscriptions'], }) useImperativeHandle(ref, () => ({ diff --git a/src/components/invoices/details/EditFeeDrawer.tsx b/src/components/invoices/details/EditFeeDrawer.tsx index 513c9fc6b2..0568d96c12 100644 --- a/src/components/invoices/details/EditFeeDrawer.tsx +++ b/src/components/invoices/details/EditFeeDrawer.tsx @@ -156,7 +156,7 @@ export const EditFeeDrawer = forwardRef((_, ref) => { formikProps.validateForm() } }, - refetchQueries: ['getInvoiceDetails'], + refetchQueries: ['getInvoiceSubscriptions'], }) const formikProps = useFormik< diff --git a/src/components/invoices/details/InvoiceDetailsTable.tsx b/src/components/invoices/details/InvoiceDetailsTable.tsx index 11e4c3719d..a3522b9b2b 100644 --- a/src/components/invoices/details/InvoiceDetailsTable.tsx +++ b/src/components/invoices/details/InvoiceDetailsTable.tsx @@ -12,6 +12,7 @@ import { InvoiceDetailsTableHeader } from '~/components/invoices/details/Invoice import { InvoiceDetailsTablePeriodLine } from '~/components/invoices/details/InvoiceDetailsTablePeriodLine' import { InvoiceFeeAdvanceDetailsTable } from '~/components/invoices/details/InvoiceFeeAdvanceDetailsTable' import { InvoiceFeeArrearsDetailsTable } from '~/components/invoices/details/InvoiceFeeArrearsDetailsTable' +import { InvoiceFeesForDisplay, InvoiceSubscriptionsForDisplay } from '~/components/invoices/types' import { _newDeepFormatFees, groupAndFormatFees, @@ -23,10 +24,11 @@ import { Customer, ErrorCodesEnum, Fee, + FeeForCustomerInvoiceRegenerateFragmentDoc, FeeForInvoiceDetailsTableBodyLineFragmentDoc, + FeeForInvoiceDetailsTableFragment, FeeForInvoiceFeeAdvanceDetailsTableFragmentDoc, FeeForInvoiceFeeArrearsDetailsTableFragmentDoc, - Invoice, InvoiceForDetailsTableFooterFragmentDoc, InvoiceForDetailsTableFragment, InvoiceStatusTypeEnum, @@ -64,70 +66,77 @@ gql` values } + walletTransaction { + id + name + wallet { + id + name + } + } + + ...FeeForCustomerInvoiceRegenerate ...FeeForInvoiceDetailsTableBodyLine ...FeeForInvoiceFeeArrearsDetailsTable ...FeeForInvoiceFeeAdvanceDetailsTable } - fragment InvoiceForDetailsTable on Invoice { - id - invoiceType - subTotalExcludingTaxesAmountCents - subTotalIncludingTaxesAmountCents - totalAmountCents - currency - issuingDate - allChargesHaveFees - versionNumber - errorDetails { - errorCode - errorDetails + fragment InvoiceSubscriptionForInvoiceDetailsTable on InvoiceSubscription { + fromDatetime + toDatetime + chargesFromDatetime + chargesToDatetime + inAdvanceChargesFromDatetime + inAdvanceChargesToDatetime + acceptNewChargeFees + subscriptionAmountCents + invoice { + chargeAmountCents + progressiveBillingCreditAmountCents } - fees { + subscription { id - ...FeeForInvoiceDetailsTable - } - invoiceSubscriptions { - fromDatetime - toDatetime - chargesFromDatetime - chargesToDatetime - inAdvanceChargesFromDatetime - inAdvanceChargesToDatetime - acceptNewChargeFees - subscriptionAmountCents - invoice { - chargeAmountCents - progressiveBillingCreditAmountCents + name + plan { + id + name + interval + amountCents + amountCurrency + invoiceDisplayName + billChargesMonthly } + } + fees { + id subscription { id name plan { id name - interval - amountCents - amountCurrency invoiceDisplayName - billChargesMonthly } } - fees { - id - subscription { - id - name - plan { - id - name - invoiceDisplayName - } - } - ...FeeForInvoiceDetailsTable - } + ...FeeForInvoiceDetailsTable + } + + ...InvoiceSubscriptionFormating + } - ...InvoiceSubscriptionFormating + fragment InvoiceForDetailsTable on Invoice { + id + invoiceType + subTotalExcludingTaxesAmountCents + subTotalIncludingTaxesAmountCents + totalAmountCents + currency + issuingDate + allChargesHaveFees + versionNumber + errorDetails { + errorCode + errorDetails } ...InvoiceForDetailsTableFooter @@ -138,17 +147,16 @@ gql` ${FeeForInvoiceDetailsTableBodyLineFragmentDoc} ${FeeForInvoiceFeeArrearsDetailsTableFragmentDoc} ${FeeForInvoiceFeeAdvanceDetailsTableFragmentDoc} + ${FeeForCustomerInvoiceRegenerateFragmentDoc} ` -const getOneTimeFeeDisplayName = < - T extends { itemName: string; invoiceDisplayName?: string | null }, ->({ +const getOneTimeFeeDisplayName = ({ invoiceType, fee, translate, }: { invoiceType: InvoiceTypeEnum - fee: T + fee: FeeForInvoiceDetailsTableFragment translate: TranslateFunc }): string => { if (invoiceType === InvoiceTypeEnum.AddOn) { @@ -158,7 +166,14 @@ const getOneTimeFeeDisplayName = < invoiceType === InvoiceTypeEnum.AdvanceCharges ) { return fee.invoiceDisplayName || fee.itemName + } else if (invoiceType === InvoiceTypeEnum.Credit) { + if (fee.walletTransaction?.wallet?.name) { + return fee.walletTransaction?.wallet?.name + } else if (fee.walletTransaction?.name) { + return `${translate('text_637ccf8133d2c9a7d11ce6e1')} - ${fee.walletTransaction?.name}` + } } + return translate('text_637ccf8133d2c9a7d11ce6e1') } @@ -168,7 +183,8 @@ interface InvoiceDetailsTableProps { editFeeDrawerRef: RefObject deleteAdjustedFeeDialogRef: RefObject isDraftOverride?: boolean - fees?: Invoice['fees'] + fees: InvoiceFeesForDisplay + invoiceSubscriptions: InvoiceSubscriptionsForDisplay onAdd?: OnRegeneratedFeeAdd onDelete?: (id: string) => void } @@ -275,6 +291,7 @@ export const InvoiceDetailsTable = memo( invoice, isDraftOverride, fees, + invoiceSubscriptions, onAdd, onDelete, }: InvoiceDetailsTableProps) => { @@ -286,7 +303,7 @@ export const InvoiceDetailsTable = memo( const hasOldZeroFeeManagement = !!premiumIntegrations?.includes( PremiumIntegrationTypeEnum.ZeroAmountFees, ) - const invoiceFees = fees || invoice?.fees + const invoiceFees = fees const hasTaxProviderError = !!invoice.errorDetails?.find( ({ errorCode }) => errorCode === ErrorCodesEnum.TaxError, @@ -358,8 +375,7 @@ export const InvoiceDetailsTable = memo( } const newFormattedInvoiceItemsMap = groupAndFormatFees({ - invoiceSubscriptions: - invoice?.invoiceSubscriptions as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + invoiceSubscriptions, hasOldZeroFeeManagement, }) diff --git a/src/components/invoices/details/InvoiceFeeAdvanceDetailsTable.tsx b/src/components/invoices/details/InvoiceFeeAdvanceDetailsTable.tsx index 51ddd18a3b..5b8af36c02 100644 --- a/src/components/invoices/details/InvoiceFeeAdvanceDetailsTable.tsx +++ b/src/components/invoices/details/InvoiceFeeAdvanceDetailsTable.tsx @@ -5,16 +5,15 @@ import { memo, RefObject, useState } from 'react' import { Button } from '~/components/designSystem' import { subscriptionTimestamps } from '~/components/invoices/details/utils' +import { InvoiceFeesForDisplay } from '~/components/invoices/types' import { TSubscriptionDataForDisplay } from '~/core/formats/formatInvoiceItemsMap' import { intlFormatDateTime } from '~/core/timezone' import { CurrencyEnum, Customer, - Fee, FeeForDeleteAdjustmentFeeDialogFragmentDoc, FeeForEditfeeDrawerFragmentDoc, FeeForInvoiceDetailsTableBodyLineFragmentDoc, - Invoice, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { OnRegeneratedFeeAdd } from '~/pages/CustomerInvoiceRegenerate' @@ -49,7 +48,7 @@ interface InvoiceFeeAdvanceDetailsTableProps { deleteAdjustedFeeDialogRef: RefObject onAdd?: OnRegeneratedFeeAdd onDelete?: (id: string) => void - fees?: Invoice['fees'] + fees?: InvoiceFeesForDisplay } export const InvoiceFeeAdvanceDetailsTable = memo( @@ -70,7 +69,7 @@ export const InvoiceFeeAdvanceDetailsTable = memo( const [areZeroFeesVisible, setAreZeroFeesVisible] = useState(false) const feesInAdvance = subscription?.feesInAdvance?.filter((fee) => { - if (onAdd && fees?.find((f: Fee) => f.id === fee.id)?.adjustedFee) { + if (onAdd && fees?.find((f) => f.id === fee.id)?.adjustedFee) { return false } @@ -78,7 +77,7 @@ export const InvoiceFeeAdvanceDetailsTable = memo( }) const feesInAdvanceZero = subscription?.feesInAdvanceZero?.filter((fee) => { - if (onAdd && fees?.find((f: Fee) => f.id === fee.id)?.adjustedFee) { + if (onAdd && fees?.find((f) => f.id === fee.id)?.adjustedFee) { return false } diff --git a/src/components/invoices/details/InvoiceFeeArrearsDetailsTable.tsx b/src/components/invoices/details/InvoiceFeeArrearsDetailsTable.tsx index bd4df979bc..9d58d8c74a 100644 --- a/src/components/invoices/details/InvoiceFeeArrearsDetailsTable.tsx +++ b/src/components/invoices/details/InvoiceFeeArrearsDetailsTable.tsx @@ -5,6 +5,7 @@ import { memo, RefObject, useState } from 'react' import { Button } from '~/components/designSystem' import { subscriptionTimestamps } from '~/components/invoices/details/utils' +import { InvoiceFeesForDisplay } from '~/components/invoices/types' import { TExtendedRemainingFee, TSubscriptionDataForDisplay, @@ -13,11 +14,9 @@ import { intlFormatDateTime } from '~/core/timezone' import { CurrencyEnum, Customer, - Fee, FeeForDeleteAdjustmentFeeDialogFragmentDoc, FeeForEditfeeDrawerFragmentDoc, FeeForInvoiceDetailsTableBodyLineFragmentDoc, - Invoice, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { OnRegeneratedFeeAdd } from '~/pages/CustomerInvoiceRegenerate' @@ -52,7 +51,7 @@ interface InvoiceFeeArrearsDetailsTableProps { deleteAdjustedFeeDialogRef: RefObject onAdd?: OnRegeneratedFeeAdd onDelete?: (id: string) => void - fees?: Invoice['fees'] + fees: InvoiceFeesForDisplay } export const InvoiceFeeArrearsDetailsTable = memo( @@ -73,7 +72,7 @@ export const InvoiceFeeArrearsDetailsTable = memo( const [areZeroFeesVisible, setAreZeroFeesVisible] = useState(false) const feesInArreras = subscription?.feesInArrears?.filter((fee) => { - if (onAdd && fees?.find((f: Fee) => f.id === fee.id)?.adjustedFee) { + if (onAdd && fees?.find((f) => f.id === fee.id)?.adjustedFee) { return false } @@ -81,7 +80,7 @@ export const InvoiceFeeArrearsDetailsTable = memo( }) const feesInArrerasZero = subscription?.feesInArrearsZero?.filter((fee) => { - if (onAdd && fees?.find((f: Fee) => f.id === fee.id)?.adjustedFee) { + if (onAdd && fees?.find((f) => f.id === fee.id)?.adjustedFee) { return false } diff --git a/src/components/invoices/types.ts b/src/components/invoices/types.ts index 19c2e52c22..f936796781 100644 --- a/src/components/invoices/types.ts +++ b/src/components/invoices/types.ts @@ -1,4 +1,10 @@ -import { CreateInvoiceInput, FeeInput, TaxInfosForCreateInvoiceFragment } from '~/generated/graphql' +import { + CreateInvoiceInput, + FeeInput, + GetInvoiceFeesQuery, + GetInvoiceSubscriptionsQuery, + TaxInfosForCreateInvoiceFragment, +} from '~/generated/graphql' export type LocalFeeInput = FeeInput & { // NOTE: this is used for display purpose but will be replaced by taxCodes[] on save @@ -8,3 +14,13 @@ export type LocalFeeInput = FeeInput & { export interface InvoiceFormInput extends Omit { fees: LocalFeeInput[] } + +export type InvoiceFeesForDisplay = + | NonNullable['fees'] + | null + | undefined + +export type InvoiceSubscriptionsForDisplay = + | NonNullable['invoiceSubscriptions'] + | null + | undefined diff --git a/src/components/plans/CommitmentsSection.tsx b/src/components/plans/CommitmentsSection.tsx index 05112a852a..1005b1f657 100644 --- a/src/components/plans/CommitmentsSection.tsx +++ b/src/components/plans/CommitmentsSection.tsx @@ -5,25 +5,22 @@ import { Icon } from 'lago-design-system' import { RefObject, useEffect, useMemo, useState } from 'react' import { Accordion, Button, Chip, Tooltip, Typography } from '~/components/designSystem' -import { AmountInputField, ComboBox, ComboboxItem } from '~/components/form' -import { EditInvoiceDisplayNameRef } from '~/components/invoices/EditInvoiceDisplayName' +import { AmountInputField } from '~/components/form' +import { EditInvoiceDisplayNameDialogRef } from '~/components/invoices/EditInvoiceDisplayNameDialog' import { PremiumWarningDialogRef } from '~/components/PremiumWarningDialog' -import { - MUI_INPUT_BASE_ROOT_CLASSNAME, - SEARCH_TAX_INPUT_FOR_MIN_COMMITMENT_CLASSNAME, -} from '~/core/constants/form' +import { TaxesSelectorSection } from '~/components/taxes/TaxesSelectorSection' +import { SEARCH_TAX_INPUT_FOR_MIN_COMMITMENT_CLASSNAME } from '~/core/constants/form' import { intlFormatNumber } from '~/core/formats/intlFormatNumber' -import { scrollToAndClickElement } from '~/core/utils/domUtils' import { CommitmentTypeEnum, CurrencyEnum, - useGetTaxesForCommitmentsLazyQuery, + TaxForTaxesSelectorSectionFragmentDoc, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { useCurrentUser } from '~/hooks/useCurrentUser' -import { mapChargeIntervalCopy } from './ChargeAccordion' import { PlanFormInput } from './types' +import { mapChargeIntervalCopy } from './UsageChargeAccordion' gql` query getTaxesForCommitments($limit: Int, $page: Int) { @@ -34,69 +31,34 @@ gql` } collection { id - ...TaxForPlanChargeAccordion + ...TaxForTaxesSelectorSection } } } + + ${TaxForTaxesSelectorSectionFragmentDoc} ` type CommitmentsSectionProps = { - editInvoiceDisplayNameRef: RefObject + editInvoiceDisplayNameDialogRef: RefObject formikProps: FormikProps premiumWarningDialogRef: RefObject } export const CommitmentsSection = ({ - editInvoiceDisplayNameRef, + editInvoiceDisplayNameDialogRef, formikProps, premiumWarningDialogRef, }: CommitmentsSectionProps) => { const { isPremium } = useCurrentUser() const { translate } = useInternationalization() - const [shouldDisplayTaxesInput, setShouldDisplayTaxesInput] = useState(false) const [displayMinimumCommitment, setDisplayMinimumCommitment] = useState( !isNaN(Number(formikProps.initialValues.minimumCommitment?.amountCents)), ) const hasErrorInGroup = !!formikProps?.errors?.minimumCommitment - const [getTaxes, { data: taxesData, loading: taxesLoading }] = useGetTaxesForCommitmentsLazyQuery( - { - variables: { limit: 500 }, - }, - ) - const { collection: taxesCollection } = taxesData?.taxes || {} - - const taxesDataForCombobox = useMemo(() => { - if (!taxesCollection) return [] - - const minCommitmentsTaxesIds = - formikProps.values.minimumCommitment?.taxes?.map((tax) => tax.id) || [] - - return taxesCollection.map(({ id: taxId, name, rate }) => { - const formatedRate = intlFormatNumber(Number(rate) / 100 || 0, { - style: 'percent', - }) - - return { - label: `${name} (${formatedRate})`, - labelNode: ( - - - {name} - - - {formatedRate} - - - ), - value: taxId, - disabled: minCommitmentsTaxesIds.includes(taxId), - } - }) - }, [formikProps.values.minimumCommitment?.taxes, taxesCollection]) - const taxValueForBadgeDisplay = useMemo((): string | undefined => { if (!formikProps?.values?.minimumCommitment?.taxes?.length) return @@ -143,7 +105,7 @@ export const CommitmentsSection = ({ onClick={(e) => { e.stopPropagation() - editInvoiceDisplayNameRef.current?.openDialog({ + editInvoiceDisplayNameDialogRef.current?.openDialog({ invoiceDisplayName: formikProps.values.minimumCommitment?.invoiceDisplayName, callback: (invoiceDisplayName: string) => { @@ -212,89 +174,17 @@ export const CommitmentsSection = ({ {translate('text_64be910fba8ef9208686a8e3')} -
- {!!formikProps?.values?.minimumCommitment?.taxes?.length && ( -
- {formikProps?.values?.minimumCommitment?.taxes.map( - ({ id: localTaxId, name, rate }) => ( - { - const newTaxedArray = - formikProps?.values?.minimumCommitment?.taxes?.filter( - (tax) => tax.id !== localTaxId, - ) || [] - - formikProps.setFieldValue('minimumCommitment.taxes', newTaxedArray) - }} - /> - ), - )} -
- )} - - {shouldDisplayTaxesInput ? ( -
- { - const previousTaxes = [ - ...(formikProps?.values?.minimumCommitment?.taxes || []), - ] - const newTaxObject = taxesData?.taxes?.collection.find( - (t) => t.id === newTaxId, - ) - formikProps.setFieldValue('minimumCommitment.taxes', [ - ...previousTaxes, - newTaxObject, - ]) - setShouldDisplayTaxesInput(false) - }} - /> - - -
- ) : ( - // Wrapping div to avoid the button to be full width, caused by the parent -
- -
- )} -
+ { + formikProps.setFieldValue('minimumCommitment.taxes', newTaxArray) + }} + onDelete={(newTaxArray) => { + formikProps.setFieldValue('minimumCommitment.taxes', newTaxArray) + }} + /> diff --git a/src/components/plans/PlanSettingsSection.tsx b/src/components/plans/PlanSettingsSection.tsx index ffbe8aa249..2a2b49e645 100644 --- a/src/components/plans/PlanSettingsSection.tsx +++ b/src/components/plans/PlanSettingsSection.tsx @@ -1,27 +1,18 @@ import { gql } from '@apollo/client' import { FormikProps } from 'formik' -import { memo, useEffect, useMemo, useState } from 'react' +import { memo, useEffect, useState } from 'react' -import { Button, Card, Chip, Tooltip, Typography } from '~/components/designSystem' -import { - ButtonSelectorField, - ComboBox, - ComboBoxField, - ComboboxItem, - TextInput, - TextInputField, -} from '~/components/form' +import { Button, Card, Tooltip, Typography } from '~/components/designSystem' +import { ButtonSelectorField, ComboBoxField, TextInput, TextInputField } from '~/components/form' +import { TaxesSelectorSection } from '~/components/taxes/TaxesSelectorSection' import { FORM_ERRORS_ENUM, FORM_TYPE_ENUM, getIntervalTranslationKey, - MUI_INPUT_BASE_ROOT_CLASSNAME, SEARCH_TAX_INPUT_FOR_PLAN_CLASSNAME, } from '~/core/constants/form' -import { intlFormatNumber } from '~/core/formats/intlFormatNumber' -import { scrollToAndClickElement } from '~/core/utils/domUtils' import { updateNameAndMaybeCode } from '~/core/utils/updateNameAndMaybeCode' -import { CurrencyEnum, PlanInterval, useGetTaxesForPlanLazyQuery } from '~/generated/graphql' +import { CurrencyEnum, PlanInterval } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { PlanFormInput } from './types' @@ -82,40 +73,7 @@ export const PlanSettingsSection = memo( const [shouldDisplayDescription, setShouldDisplayDescription] = useState( !!formikProps.initialValues.description, ) - const [shouldDisplayTaxesInput, setShouldDisplayTaxesInput] = useState(false) const plan = formikProps.values - const [getTaxes, { data: taxesData, loading: taxesLoading }] = useGetTaxesForPlanLazyQuery({ - variables: { limit: 20 }, - }) - const { collection: taxesCollection } = taxesData?.taxes || {} - - const taxesDataForCombobox = useMemo(() => { - if (!taxesCollection) return [] - - const planTaxesIds = plan.taxes?.map((tax) => tax.id) || [] - - return taxesCollection.map(({ id, name, rate }) => { - const formatedRate = intlFormatNumber(Number(rate) / 100 || 0, { - style: 'percent', - }) - - return { - label: `${name} (${formatedRate})`, - labelNode: ( - - - {name} - - - {formatedRate} - - - ), - value: id, - disabled: planTaxesIds.includes(id), - } - }) - }, [plan.taxes, taxesCollection]) useEffect(() => { setShouldDisplayDescription(!!formikProps.initialValues.description) @@ -238,88 +196,24 @@ export const PlanSettingsSection = memo( name="amountCurrency" /> - {!!plan?.taxes?.length && ( -
- +
+ {!!plan?.taxes?.length && ( + {translate('text_6661fc17337de3591e29e3e1')} -
- {plan.taxes.map(({ id, name, rate }) => ( - { - const newTaxedArray = plan.taxes?.filter((tax) => tax.id !== id) || [] - - formikProps.setFieldValue('taxes', newTaxedArray) - }} - /> - ))} -
-
- )} - - {shouldDisplayTaxesInput ? ( -
- {!plan.taxes?.length && ( - - {translate('text_6661fc17337de3591e29e3e1')} - - )} -
- { - const previousTaxes = [...(formikProps?.values?.taxes || [])] - const newTaxObject = taxesData?.taxes?.collection.find((t) => t.id === newTaxId) - - formikProps.setFieldValue('taxes', [...previousTaxes, newTaxObject]) - setShouldDisplayTaxesInput(false) - }} - /> - - -
-
- ) : ( - - )} + /> +
) }, diff --git a/src/components/plans/FixedFeeSection.tsx b/src/components/plans/SubscriptionFeeSection.tsx similarity index 93% rename from src/components/plans/FixedFeeSection.tsx rename to src/components/plans/SubscriptionFeeSection.tsx index 2cbbed445e..b508f5ca40 100644 --- a/src/components/plans/FixedFeeSection.tsx +++ b/src/components/plans/SubscriptionFeeSection.tsx @@ -6,7 +6,7 @@ import { memo, RefObject, useEffect, useState } from 'react' import { Accordion, Button, Card, Chip, Tooltip, Typography } from '~/components/designSystem' import { AmountInputField, RadioGroupField, TextInputField } from '~/components/form' -import { EditInvoiceDisplayNameRef } from '~/components/invoices/EditInvoiceDisplayName' +import { EditInvoiceDisplayNameDialogRef } from '~/components/invoices/EditInvoiceDisplayNameDialog' import { FORM_TYPE_ENUM, getIntervalTranslationKey } from '~/core/constants/form' import { getCurrencySymbol, intlFormatNumber } from '~/core/formats/intlFormatNumber' import { CurrencyEnum } from '~/generated/graphql' @@ -15,7 +15,7 @@ import { useInternationalization } from '~/hooks/core/useInternationalization' import { PlanFormInput } from './types' gql` - fragment PlanForFixedFeeSection on Plan { + fragment PlanForSubscriptionFeeSection on Plan { id amountCents payInAdvance @@ -24,26 +24,26 @@ gql` } ` -interface FixedFeeSectionProps { +interface SubscriptionFeeSectionProps { canBeEdited?: boolean isInSubscriptionForm?: boolean subscriptionFormType?: keyof typeof FORM_TYPE_ENUM - editInvoiceDisplayNameRef: RefObject + editInvoiceDisplayNameDialogRef: RefObject formikProps: FormikProps isEdition?: boolean isInitiallyOpen?: boolean } -export const FixedFeeSection = memo( +export const SubscriptionFeeSection = memo( ({ canBeEdited, isInSubscriptionForm, subscriptionFormType, - editInvoiceDisplayNameRef, + editInvoiceDisplayNameDialogRef, formikProps, isEdition, isInitiallyOpen, - }: FixedFeeSectionProps) => { + }: SubscriptionFeeSectionProps) => { const { translate } = useInternationalization() const [shouldDisplayTrialPeriod, setShouldDisplayTrialPeriod] = useState(false) const hasErrorInSection = @@ -84,7 +84,7 @@ export const FixedFeeSection = memo( onClick={(e) => { e.stopPropagation() - editInvoiceDisplayNameRef.current?.openDialog({ + editInvoiceDisplayNameDialogRef.current?.openDialog({ invoiceDisplayName: formikProps.values.invoiceDisplayName, callback: (invoiceDisplayName: string) => { formikProps.setFieldValue('invoiceDisplayName', invoiceDisplayName) @@ -120,7 +120,7 @@ export const FixedFeeSection = memo( } - data-test="fixed-fee-section-accordion" + data-test="subscription-fee-section-accordion" >
`charge-${chargeIndex}-default-property-accordion` gql` - fragment TaxForPlanChargeAccordion on Tax { - id - code - name - rate - } - - fragment ChargeAccordion on Charge { + fragment UsageChargeAccordion on Charge { id chargeModel invoiceable @@ -115,24 +104,11 @@ gql` } } taxes { - ...TaxForPlanChargeAccordion + ...TaxForTaxesSelectorSection } ...ChargeForChargeOptionsAccordion } - query getTaxesForCharges($limit: Int, $page: Int) { - taxes(limit: $limit, page: $page) { - metadata { - currentPage - totalPages - } - collection { - id - ...TaxForPlanChargeAccordion - } - } - } - ${GraduatedChargeFragmentDoc} ${GraduatedPercentageChargeFragmentDoc} ${VolumeRangesFragmentDoc} @@ -142,6 +118,7 @@ gql` ${CustomChargeFragmentDoc} ${ChargeForChargeOptionsAccordionFragmentDoc} ${DynamicChargeFragmentDoc} + ${TaxForTaxesSelectorSectionFragmentDoc} ` export const mapChargeIntervalCopy = (interval: string, forceMonthlyCharge: boolean): string => { @@ -160,7 +137,7 @@ export const mapChargeIntervalCopy = (interval: string, forceMonthlyCharge: bool return '' } -interface ChargeAccordionProps { +interface UsageChargeAccordionProps { currency: CurrencyEnum disabled?: boolean isInitiallyOpen?: boolean @@ -170,20 +147,20 @@ interface ChargeAccordionProps { index: number isUsedInSubscription?: boolean premiumWarningDialogRef?: RefObject - editInvoiceDisplayNameRef: RefObject + editInvoiceDisplayNameDialogRef: RefObject removeChargeWarningDialogRef?: RefObject subscriptionFormType?: keyof typeof FORM_TYPE_ENUM shouldDisplayAlreadyUsedChargeAlert: boolean } -export const ChargeAccordion = memo( +export const UsageChargeAccordion = memo( ({ currency, disabled, shouldDisplayAlreadyUsedChargeAlert, removeChargeWarningDialogRef, premiumWarningDialogRef, - editInvoiceDisplayNameRef, + editInvoiceDisplayNameDialogRef, isUsedInSubscription, isInitiallyOpen, isInSubscriptionForm, @@ -191,11 +168,9 @@ export const ChargeAccordion = memo( id, index, subscriptionFormType, - }: ChargeAccordionProps) => { + }: UsageChargeAccordionProps) => { const { translate } = useInternationalization() const { isPremium } = useCurrentUser() - const { type: actionType } = useDuplicatePlanVar() - const { hasAnyPricingUnitConfigured, pricingUnits } = useCustomPricingUnits() const { getChargeModelComboboxData, getIsPayInAdvanceOptionDisabled, @@ -206,7 +181,6 @@ export const ChargeAccordion = memo( const { chargeModelComboboxData, hasDefaultPropertiesErrors, - hasErrorInCharges, initialLocalCharge, isPayInAdvanceOptionDisabled, isProratedOptionDisabled, @@ -236,7 +210,6 @@ export const ChargeAccordion = memo( typeof chargeErrors === 'object' && typeof chargeErrors[index] === 'object' && typeof chargeErrors[index].properties === 'object', - hasErrorInCharges: Boolean(chargeErrors && chargeErrors[index]), initialLocalCharge: formikProps.initialValues.charges[index], isPayInAdvanceOptionDisabled: localIsPayInAdvanceOptionDisabled, isProratedOptionDisabled: localIsProratedOptionDisabled, @@ -253,54 +226,17 @@ export const ChargeAccordion = memo( isPremium, ]) - const [showSpendingMinimum, setShowSpendingMinimum] = useState( - !!initialLocalCharge?.minAmountCents && Number(initialLocalCharge?.minAmountCents) > 0, - ) - const [shouldDisplayTaxesInput, setShouldDisplayTaxesInput] = useState(false) - const [getTaxes, { data: taxesData, loading: taxesLoading }] = useGetTaxesForChargesLazyQuery({ - variables: { limit: 500 }, - }) - const { collection: taxesCollection } = taxesData?.taxes || {} - - useEffect(() => { - setShowSpendingMinimum( - !!initialLocalCharge?.minAmountCents && Number(initialLocalCharge?.minAmountCents) > 0, - ) - }, [initialLocalCharge?.minAmountCents]) - const handleUpdate = useCallback( - (name: string, value: unknown) => { - // IMPORTANT: This check should stay first in this function - // If user is not premium and try to switch to graduated percentage pricing - // We should show the premium modal and prevent any formik value change - if (name === 'chargeModel' && !isPremium && value === ChargeModelEnum.GraduatedPercentage) { - premiumWarningDialogRef?.current?.openDialog() - return - } - - // NOTE: We prevent going further if the change is about the charge model and the value remain the same - // It prevents fixing the properties to be wrongly reset to default on 2nd select. - if (name === 'chargeModel' && value === localCharge.chargeModel) return - - let currentChargeValues: LocalChargeInput = { - ...localCharge, - [name]: value, - } - - if (name === 'chargeModel') { - // Reset charge data to default when switching charge model - currentChargeValues = { - ...currentChargeValues, - payInAdvance: false, - prorated: false, - invoiceable: true, - properties: getPropertyShape({}), - filters: [], - taxes: [], - } - } - - formikProps.setFieldValue(`charges.${index}`, currentChargeValues) + (name: HandleUpdateChargesProps['name'], value: HandleUpdateChargesProps['value']) => { + handleUpdateCharges({ + formikProps, + index, + isPremium, + localCharge, + name, + premiumWarningDialogRef, + value, + }) }, // eslint-disable-next-line react-hooks/exhaustive-deps @@ -316,34 +252,6 @@ export const ChargeAccordion = memo( return String(formikProps?.values?.taxes?.reduce((acc, cur) => acc + cur.rate, 0)) }, [formikProps?.values?.taxes, localCharge.taxes]) - const taxesDataForCombobox = useMemo(() => { - if (!taxesCollection) return [] - - const chargeTaxesIds = localCharge.taxes?.map((tax) => tax.id) || [] - - return taxesCollection.map(({ id: taxId, name, rate }) => { - const formatedRate = intlFormatNumber(Number(rate) / 100 || 0, { - style: 'percent', - }) - - return { - label: `${name} (${formatedRate})`, - labelNode: ( - - - {name} - - - {formatedRate} - - - ), - value: taxId, - disabled: chargeTaxesIds.includes(taxId), - } - }) - }, [localCharge.taxes, taxesCollection]) - const chargePayInAdvanceDescription = useMemo(() => { if (localCharge.chargeModel === ChargeModelEnum.Volume) { return translate('text_6669b493fae79a0095e639bc') @@ -356,41 +264,6 @@ export const ChargeAccordion = memo( return translate('text_6661fc17337de3591e29e435') }, [localCharge.chargeModel, localCharge.billableMetric.aggregationType, translate]) - const pricingUnitDataForCombobox = useMemo(() => { - const formatedPricingUnits = pricingUnits.map((pricingUnit) => ({ - label: pricingUnit.name, - value: `${pricingUnit.code}${CUSTOM_PRICING_UNIT_SEPARATOR}${pricingUnit.shortName}${CUSTOM_PRICING_UNIT_SEPARATOR}${LocalPricingUnitType.Custom}`, - labelNode: ( - - - {pricingUnit.name} - - - {pricingUnit.code} - - - ), - })) - - return [ - { - label: currency, - value: `${currency}${CUSTOM_PRICING_UNIT_SEPARATOR}${currency}${CUSTOM_PRICING_UNIT_SEPARATOR}${LocalPricingUnitType.Fiat}`, - labelNode: ( - - - {currency} - - - {translate('text_1750411499858a87tkuylqms')} - - - ), - }, - ...formatedPricingUnits, - ] - }, [currency, pricingUnits, translate]) - const chargePricingUnitShortName = useMemo( () => (localCharge.appliedPricingUnit?.type === LocalPricingUnitType.Custom && @@ -432,46 +305,23 @@ export const ChargeAccordion = memo( {localCharge.invoiceDisplayName || localCharge?.billableMetric?.name} - -
{localCharge?.billableMetric?.code}
- - - + {!!taxValueForBadgeDisplay && ( - {!isInSubscriptionForm && ( - -
} data-test={`charge-accordion-${index}`} > <> - {/* Pricing unit configuration */} - {!!hasAnyPricingUnitConfigured && ( -
- { - const [code, shortName, type] = value.split(CUSTOM_PRICING_UNIT_SEPARATOR) - - return handleUpdate('appliedPricingUnit', { - code, - shortName, - type, - conversionRate: - type === LocalPricingUnitType.Custom - ? localCharge.appliedPricingUnit?.conversionRate - : undefined, - }) - }} - /> - - {localCharge.appliedPricingUnit?.type === LocalPricingUnitType.Custom && ( -
- - {translate('text_1750411499858qxgqjoqtr3e')} - - - - {translate('text_1750411499858su5b7bbp5t9')} - - -
-
- 1 -
- -
- = -
-
- - { - handleUpdate('appliedPricingUnit', { - ...localCharge.appliedPricingUnit, - conversionRate: value, - }) - }} - InputProps={{ - endAdornment: ( - - {getCurrencySymbol(currency)} - - ), - }} - /> -
- )} -
- )} - - {/* Charge main infos */} -
- {!!shouldDisplayAlreadyUsedChargeAlert && ( - - {translate('text_6435895831d323008a47911f')} - - )} - handleUpdate('chargeModel', value)} - /> -
+ + + {(!!localCharge.properties || !!localCharge?.filters?.length) && ( <> @@ -645,20 +405,7 @@ export const ChargeAccordion = memo(
- - - + - -
- - - +
- {!showSpendingMinimum ? ( - - ) : ( -
- handleUpdate('minAmountCents', value)} - InputProps={{ - endAdornment: ( - - {chargePricingUnitShortName || getCurrencySymbol(currency)} - - ), - }} - /> - -
- )} - - )} - -
-
- - {translate('text_6661fc17337de3591e29e3e1')} - - - {translate('text_6662c316125d2400f7995ff6')} - -
- {!!localCharge?.taxes?.length && ( -
- {localCharge.taxes.map(({ id: localTaxId, name, rate }) => ( - { - const newTaxedArray = - localCharge.taxes?.filter((tax) => tax.id !== localTaxId) || [] - - formikProps.setFieldValue(`charges.${index}.taxes`, newTaxedArray) - }} - /> - ))} -
- )} - - {!shouldDisplayTaxesInput ? ( - - ) : ( -
- { - const previousTaxes = [...(localCharge?.taxes || [])] - const newTaxObject = taxesData?.taxes.collection.find( - (t) => t.id === newTaxId, - ) as TaxForPlanChargeAccordionFragment - - handleUpdate('taxes', [...previousTaxes, newTaxObject]) - setShouldDisplayTaxesInput(false) - }} - /> + /> +
+ )} - -
- )} +
+ + {translate('text_6661fc17337de3591e29e3e1')} + + + {translate('text_6662c316125d2400f7995ff6')} +
+ + { + handleUpdate('taxes', newTaxArray) + }} + onDelete={(newTaxArray) => { + handleUpdate('taxes', newTaxArray) + }} + /> @@ -1112,4 +736,4 @@ export const ChargeAccordion = memo( }, ) -ChargeAccordion.displayName = 'ChargeAccordion' +UsageChargeAccordion.displayName = 'UsageChargeAccordion' diff --git a/src/components/plans/ChargesSection.tsx b/src/components/plans/UsageChargesSection.tsx similarity index 96% rename from src/components/plans/ChargesSection.tsx rename to src/components/plans/UsageChargesSection.tsx index ca059f8bc3..43db221ad0 100644 --- a/src/components/plans/ChargesSection.tsx +++ b/src/components/plans/UsageChargesSection.tsx @@ -4,7 +4,7 @@ import { memo, RefObject, useEffect, useMemo, useRef, useState } from 'react' import { Button, Card, Popper, Tooltip, Typography } from '~/components/designSystem' import { ComboBox, ComboboxItem, SwitchField } from '~/components/form' -import { EditInvoiceDisplayNameRef } from '~/components/invoices/EditInvoiceDisplayName' +import { EditInvoiceDisplayNameDialogRef } from '~/components/invoices/EditInvoiceDisplayNameDialog' import { PremiumWarningDialogRef } from '~/components/PremiumWarningDialog' import { FORM_TYPE_ENUM, @@ -25,21 +25,21 @@ import { useInternationalization } from '~/hooks/core/useInternationalization' import { useCustomPricingUnits } from '~/hooks/plans/useCustomPricingUnits' import { MenuPopper } from '~/styles' -import { ChargeAccordion } from './ChargeAccordion' import { RemoveChargeWarningDialog, RemoveChargeWarningDialogRef, } from './RemoveChargeWarningDialog' import { LocalChargeInput, LocalPricingUnitType, PlanFormInput } from './types' +import { UsageChargeAccordion } from './UsageChargeAccordion' const RESULT_LIMIT = 50 gql` - fragment PlanForChargeAccordion on Plan { + fragment PlanForUsageChargeAccordion on Plan { billChargesMonthly } - fragment BillableMetricForChargeSection on BillableMetric { + fragment BillableMetricForUsageChargeSection on BillableMetric { id name code @@ -56,7 +56,7 @@ gql` billableMetrics(page: $page, limit: $limit, searchTerm: $searchTerm, recurring: false) { collection { id - ...BillableMetricForChargeSection + ...BillableMetricForUsageChargeSection } } } @@ -65,15 +65,15 @@ gql` billableMetrics(page: $page, limit: $limit, searchTerm: $searchTerm, recurring: true) { collection { id - ...BillableMetricForChargeSection + ...BillableMetricForUsageChargeSection } } } ` -interface ChargesSectionProps { +interface UsageProps { alreadyExistingCharges?: LocalChargeInput[] | null - editInvoiceDisplayNameRef: RefObject + editInvoiceDisplayNameDialogRef: RefObject premiumWarningDialogRef: RefObject canBeEdited?: boolean isInitiallyOpen?: boolean @@ -85,10 +85,10 @@ interface ChargesSectionProps { const getNewChargeId = (id: string, index: number) => `plan-charge-${id}-${index}` -export const ChargesSection = memo( +export const UsageChargesSection = memo( ({ alreadyExistingCharges, - editInvoiceDisplayNameRef, + editInvoiceDisplayNameDialogRef, canBeEdited, isInitiallyOpen, isInSubscriptionForm, @@ -96,7 +96,7 @@ export const ChargesSection = memo( isEdition, premiumWarningDialogRef, subscriptionFormType, - }: ChargesSectionProps) => { + }: UsageProps) => { const { translate } = useInternationalization() const { hasAnyPricingUnitConfigured } = useCustomPricingUnits() const hasAnyCharge = !!formikProps.values.charges.length @@ -321,7 +321,7 @@ export const ChargesSection = memo( (alreadyUsedBmsIds.get(charge.billableMetric.id) || 0) > 1 return ( - 1 return ( - { + const UsageChargeAccordionMock = () => { const formikProps = useFormik>({ initialValues: { charges: [ @@ -55,22 +55,22 @@ async function prepare({ filters, properties }: PrepareProps = {}) { }) return ( - } - editInvoiceDisplayNameRef={{} as React.RefObject} + editInvoiceDisplayNameDialogRef={{} as React.RefObject} /> ) } await act(() => { - render() + render() }) } -describe('ChargeAccordion', () => { +describe('UsageChargeAccordion', () => { afterEach(cleanup) describe('basic rendering with dom element assessment', () => { diff --git a/src/components/plans/ChargeBillingRadioGroup.tsx b/src/components/plans/chargeAccordion/ChargeBillingRadioGroup.tsx similarity index 100% rename from src/components/plans/ChargeBillingRadioGroup.tsx rename to src/components/plans/chargeAccordion/ChargeBillingRadioGroup.tsx diff --git a/src/components/plans/ChargeFilter.tsx b/src/components/plans/chargeAccordion/ChargeFilter.tsx similarity index 98% rename from src/components/plans/ChargeFilter.tsx rename to src/components/plans/chargeAccordion/ChargeFilter.tsx index 927d78cf3e..6d205d6f74 100644 --- a/src/components/plans/ChargeFilter.tsx +++ b/src/components/plans/chargeAccordion/ChargeFilter.tsx @@ -11,8 +11,8 @@ import { import { BillableMetricFilter } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' -import { LocalChargeFilterInput } from './types' -import { transformFilterObjectToString } from './utils' +import { LocalChargeFilterInput } from '../types' +import { transformFilterObjectToString } from '../utils' export const buildChargeFilterAddFilterButtonId = (chargeIndex: number, filterIndex: number) => `charge-${chargeIndex}-add-filter-${filterIndex}` diff --git a/src/components/plans/chargeAccordion/ChargeModelSelector.tsx b/src/components/plans/chargeAccordion/ChargeModelSelector.tsx new file mode 100644 index 0000000000..a6640e9015 --- /dev/null +++ b/src/components/plans/chargeAccordion/ChargeModelSelector.tsx @@ -0,0 +1,48 @@ +import { Alert } from 'lago-design-system' + +import { BasicComboBoxData, ComboBox } from '~/components/form' +import { HandleUpdateChargesProps } from '~/components/plans/chargeAccordion/utils' +import { LocalChargeInput } from '~/components/plans/types' +import { getChargeModelHelpTextTranslationKey } from '~/core/constants/form' +import { useInternationalization } from '~/hooks/core/useInternationalization' + +export const ChargeModelSelector = ({ + shouldDisplayAlreadyUsedChargeAlert, + isInSubscriptionForm, + disabled, + localCharge, + chargeModelComboboxData, + handleUpdate, +}: { + shouldDisplayAlreadyUsedChargeAlert: boolean + isInSubscriptionForm: boolean | undefined + disabled: boolean | undefined + localCharge: LocalChargeInput + chargeModelComboboxData: BasicComboBoxData[] + handleUpdate: ( + name: HandleUpdateChargesProps['name'], + value: HandleUpdateChargesProps['value'], + ) => void +}) => { + const { translate } = useInternationalization() + + return ( +
+ {!!shouldDisplayAlreadyUsedChargeAlert && ( + + {translate('text_6435895831d323008a47911f')} + + )} + handleUpdate('chargeModel', value)} + /> +
+ ) +} diff --git a/src/components/plans/ChargeOptionsAccordion.tsx b/src/components/plans/chargeAccordion/ChargeOptionsAccordion.tsx similarity index 99% rename from src/components/plans/ChargeOptionsAccordion.tsx rename to src/components/plans/chargeAccordion/ChargeOptionsAccordion.tsx index 9bbb0bdc12..e2c95546f7 100644 --- a/src/components/plans/ChargeOptionsAccordion.tsx +++ b/src/components/plans/chargeAccordion/ChargeOptionsAccordion.tsx @@ -9,7 +9,7 @@ import { CurrencyEnum, RegroupPaidFeesEnum } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { NAV_HEIGHT, theme } from '~/styles' -import { LocalChargeInput } from './types' +import { LocalChargeInput } from '../types' gql` fragment ChargeForChargeOptionsAccordion on Charge { diff --git a/src/components/plans/ChargeWrapperSwitch.tsx b/src/components/plans/chargeAccordion/ChargeWrapperSwitch.tsx similarity index 100% rename from src/components/plans/ChargeWrapperSwitch.tsx rename to src/components/plans/chargeAccordion/ChargeWrapperSwitch.tsx diff --git a/src/components/plans/chargeAccordion/CustomPricingUnitSelector.tsx b/src/components/plans/chargeAccordion/CustomPricingUnitSelector.tsx new file mode 100644 index 0000000000..8354357139 --- /dev/null +++ b/src/components/plans/chargeAccordion/CustomPricingUnitSelector.tsx @@ -0,0 +1,139 @@ +import { InputAdornment } from '@mui/material' +import { Typography } from 'lago-design-system' +import { useMemo } from 'react' + +import { ComboBox, ComboboxItem, TextInput } from '~/components/form' +import { HandleUpdateChargesProps } from '~/components/plans/chargeAccordion/utils' +import { LocalChargeInput, LocalPricingUnitType } from '~/components/plans/types' +import { getCurrencySymbol } from '~/core/formats/intlFormatNumber' +import { CurrencyEnum } from '~/generated/graphql' +import { useInternationalization } from '~/hooks/core/useInternationalization' +import { useCustomPricingUnits } from '~/hooks/plans/useCustomPricingUnits' + +const CUSTOM_PRICING_UNIT_SEPARATOR = '::-::' + +export const CustomPricingUnitSelector = ({ + currency, + isInSubscriptionForm, + disabled, + localCharge, + handleUpdate, +}: { + currency: CurrencyEnum + isInSubscriptionForm: boolean | undefined + disabled: boolean | undefined + localCharge: LocalChargeInput + handleUpdate: ( + name: HandleUpdateChargesProps['name'], + value: HandleUpdateChargesProps['value'], + ) => void +}) => { + const { translate } = useInternationalization() + const { hasAnyPricingUnitConfigured, pricingUnits } = useCustomPricingUnits() + + const pricingUnitDataForCombobox = useMemo(() => { + const formatedPricingUnits = pricingUnits.map((pricingUnit) => ({ + label: pricingUnit.name, + value: `${pricingUnit.code}${CUSTOM_PRICING_UNIT_SEPARATOR}${pricingUnit.shortName}${CUSTOM_PRICING_UNIT_SEPARATOR}${LocalPricingUnitType.Custom}`, + labelNode: ( + + + {pricingUnit.name} + + + {pricingUnit.code} + + + ), + })) + + return [ + { + label: currency, + value: `${currency}${CUSTOM_PRICING_UNIT_SEPARATOR}${currency}${CUSTOM_PRICING_UNIT_SEPARATOR}${LocalPricingUnitType.Fiat}`, + labelNode: ( + + + {currency} + + + {translate('text_1750411499858a87tkuylqms')} + + + ), + }, + ...formatedPricingUnits, + ] + }, [currency, pricingUnits, translate]) + + return ( + <> + {!!hasAnyPricingUnitConfigured && ( +
+ { + const [code, shortName, type] = value.split(CUSTOM_PRICING_UNIT_SEPARATOR) + + return handleUpdate('appliedPricingUnit', { + code, + shortName, + type, + conversionRate: + type === LocalPricingUnitType.Custom + ? localCharge.appliedPricingUnit?.conversionRate + : undefined, + }) + }} + /> + + {localCharge.appliedPricingUnit?.type === LocalPricingUnitType.Custom && ( +
+ + {translate('text_1750411499858qxgqjoqtr3e')} + + + + {translate('text_1750411499858su5b7bbp5t9')} + + +
+
+ 1 +
+ +
+ = +
+
+ + { + handleUpdate('appliedPricingUnit', { + ...localCharge.appliedPricingUnit, + conversionRate: value, + }) + }} + InputProps={{ + endAdornment: ( + {getCurrencySymbol(currency)} + ), + }} + /> +
+ )} +
+ )}{' '} + + ) +} diff --git a/src/components/plans/chargeAccordion/EditInvoiceDisplayNameButton.tsx b/src/components/plans/chargeAccordion/EditInvoiceDisplayNameButton.tsx new file mode 100644 index 0000000000..5665ff28e4 --- /dev/null +++ b/src/components/plans/chargeAccordion/EditInvoiceDisplayNameButton.tsx @@ -0,0 +1,35 @@ +import { Button, Tooltip } from 'lago-design-system' +import { RefObject } from 'react' + +import { EditInvoiceDisplayNameDialogRef } from '~/components/invoices/EditInvoiceDisplayNameDialog' +import { useInternationalization } from '~/hooks/core/useInternationalization' + +export const EditInvoiceDisplayNameButton = ({ + editInvoiceDisplayNameDialogRef, + currentInvoiceDisplayName, + onEdit, +}: { + editInvoiceDisplayNameDialogRef: RefObject + currentInvoiceDisplayName: string | null | undefined + onEdit: (invoiceDisplayName: string) => void +}) => { + const { translate } = useInternationalization() + + return ( + + + ) : ( +
+ handleUpdate('minAmountCents', value)} + InputProps={{ + endAdornment: ( + + {chargePricingUnitShortName || getCurrencySymbol(currency)} + + ), + }} + /> + +
+ )} + + ) +} diff --git a/src/components/plans/chargeAccordion/ValidationIcon.tsx b/src/components/plans/chargeAccordion/ValidationIcon.tsx new file mode 100644 index 0000000000..10df0d5218 --- /dev/null +++ b/src/components/plans/chargeAccordion/ValidationIcon.tsx @@ -0,0 +1,24 @@ +import { Icon, Tooltip } from 'lago-design-system' + +import { useInternationalization } from '~/hooks/core/useInternationalization' + +export const ValidationIcon = ({ hasError }: { hasError: boolean }) => { + const { translate } = useInternationalization() + + return ( + + + + ) +} diff --git a/src/components/plans/chargeAccordion/utils.ts b/src/components/plans/chargeAccordion/utils.ts new file mode 100644 index 0000000000..309c59b245 --- /dev/null +++ b/src/components/plans/chargeAccordion/utils.ts @@ -0,0 +1,58 @@ +import { FormikProps } from 'formik' +import { RefObject } from 'react' + +import { LocalChargeInput, PlanFormInput } from '~/components/plans/types' +import { PremiumWarningDialogRef } from '~/components/PremiumWarningDialog' +import getPropertyShape from '~/core/serializers/getPropertyShape' +import { ChargeModelEnum } from '~/generated/graphql' + +export type HandleUpdateChargesProps = { + formikProps: FormikProps + index: number + isPremium: boolean + localCharge: LocalChargeInput + name: string + premiumWarningDialogRef: RefObject | undefined + value: unknown +} +export const handleUpdateCharges = ({ + formikProps, + index, + isPremium, + localCharge, + name, + premiumWarningDialogRef, + value, +}: HandleUpdateChargesProps) => { + // IMPORTANT: This check should stay first in this function + // If user is not premium and try to switch to graduated percentage pricing + // We should show the premium modal and prevent any formik value change + if (name === 'chargeModel' && !isPremium && value === ChargeModelEnum.GraduatedPercentage) { + premiumWarningDialogRef?.current?.openDialog() + return + } + + // NOTE: We prevent going further if the change is about the charge model and the value remain the same + // It prevents fixing the properties to be wrongly reset to default on 2nd select. + if (name === 'chargeModel' && value === localCharge.chargeModel) return + + let currentChargeValues: LocalChargeInput = { + ...localCharge, + [name]: value, + } + + if (name === 'chargeModel') { + // Reset charge data to default when switching charge model + currentChargeValues = { + ...currentChargeValues, + payInAdvance: false, + prorated: false, + invoiceable: true, + properties: getPropertyShape({}), + filters: [], + taxes: [], + } + } + + formikProps.setFieldValue(`charges.${index}`, currentChargeValues) +} diff --git a/src/components/plans/details/PlanDetailsFixedFeeAccordion.tsx b/src/components/plans/details/PlanDetailsAdvancedFeeAccordion.tsx similarity index 90% rename from src/components/plans/details/PlanDetailsFixedFeeAccordion.tsx rename to src/components/plans/details/PlanDetailsAdvancedFeeAccordion.tsx index 2a6e29fc60..a102897866 100644 --- a/src/components/plans/details/PlanDetailsFixedFeeAccordion.tsx +++ b/src/components/plans/details/PlanDetailsAdvancedFeeAccordion.tsx @@ -5,7 +5,11 @@ import { deserializeAmount } from '~/core/serializers/serializeAmount' import { CurrencyEnum, EditPlanFragment } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' -export const PlanDetailsFixedFeeAccordion = ({ plan }: { plan?: EditPlanFragment | null }) => { +export const PlanDetailsSubscriptionFeeAccordion = ({ + plan, +}: { + plan?: EditPlanFragment | null +}) => { const { translate } = useInternationalization() return ( @@ -18,7 +22,7 @@ export const PlanDetailsFixedFeeAccordion = ({ plan }: { plan?: EditPlanFragment >
( -
+
{tax.name} ( {intlFormatNumber(Number(tax.rate) / 100 || 0, { diff --git a/src/components/plans/details/PlanDetailsAdvancedSettingsSection.tsx b/src/components/plans/details/PlanDetailsAdvancedSettingsSection.tsx index 05d267ab4b..146dc475e8 100644 --- a/src/components/plans/details/PlanDetailsAdvancedSettingsSection.tsx +++ b/src/components/plans/details/PlanDetailsAdvancedSettingsSection.tsx @@ -1,6 +1,6 @@ import { Accordion, ChargeTable, Typography } from '~/components/designSystem' import { DetailsPage } from '~/components/layouts/DetailsPage' -import { mapChargeIntervalCopy } from '~/components/plans/ChargeAccordion' +import { mapChargeIntervalCopy } from '~/components/plans/UsageChargeAccordion' import { getEntitlementFormattedValue } from '~/components/plans/utils' import { PROGRESSIVE_BILLING_DOC_URL } from '~/core/constants/externalUrls' import { getIntervalTranslationKey } from '~/core/constants/form' @@ -176,7 +176,7 @@ export const PlanDetailsAdvancedSettingsSection = ({ value: !!plan?.minimumCommitment?.taxes?.length ? plan?.minimumCommitment?.taxes?.map((tax, i) => ( diff --git a/src/components/plans/details/PlanDetailsChargesSection.tsx b/src/components/plans/details/PlanDetailsChargesSection.tsx index bd1ac37a9b..78945d7850 100644 --- a/src/components/plans/details/PlanDetailsChargesSection.tsx +++ b/src/components/plans/details/PlanDetailsChargesSection.tsx @@ -1,7 +1,7 @@ import { Accordion, Typography } from '~/components/designSystem' import { DetailsPage } from '~/components/layouts/DetailsPage' -import { mapChargeIntervalCopy } from '~/components/plans/ChargeAccordion' import { PlanDetailsChargesSectionAccordion } from '~/components/plans/details/PlanDetailsChargesSectionAccordion' +import { mapChargeIntervalCopy } from '~/components/plans/UsageChargeAccordion' import { chargeModelLookupTranslation } from '~/core/constants/form' import { intlFormatNumber } from '~/core/formats/intlFormatNumber' import { deserializeAmount } from '~/core/serializers/serializeAmount' diff --git a/src/components/plans/details/PlanDetailsOverview.tsx b/src/components/plans/details/PlanDetailsOverview.tsx index 21deb4fba7..622b74455f 100644 --- a/src/components/plans/details/PlanDetailsOverview.tsx +++ b/src/components/plans/details/PlanDetailsOverview.tsx @@ -11,9 +11,9 @@ import { } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' +import { PlanDetailsSubscriptionFeeAccordion } from './PlanDetailsAdvancedFeeAccordion' import { PlanDetailsAdvancedSettingsSection } from './PlanDetailsAdvancedSettingsSection' import { PlanDetailsChargesSection } from './PlanDetailsChargesSection' -import { PlanDetailsFixedFeeAccordion } from './PlanDetailsFixedFeeAccordion' gql` query getPlanForDetailsOverviewSection($plan: ID!) { @@ -91,7 +91,7 @@ export const PlanDetailsOverview = ({ {translate('text_642d5eb2783a2ad10d670332')} - + {!!plan?.charges?.length && (
diff --git a/src/components/plans/types.ts b/src/components/plans/types.ts index 86d4b4c745..543acdeeae 100644 --- a/src/components/plans/types.ts +++ b/src/components/plans/types.ts @@ -10,8 +10,8 @@ import { PrivilegeValueTypeEnum, PropertiesInput, TaxForPlanAndChargesInPlanFormFragment, - TaxForPlanChargeAccordionFragment, TaxForPlanSettingsSectionFragment, + TaxForTaxesSelectorSectionFragment, UsageThresholdInput, } from '~/generated/graphql' @@ -45,7 +45,7 @@ export type LocalChargeInput = Omit< properties?: PropertiesInput filters?: LocalChargeFilterInput[] // NOTE: this is used for display purpose but will be replaced by taxCodes[] on save - taxes?: TaxForPlanChargeAccordionFragment[] | null + taxes?: TaxForTaxesSelectorSectionFragment[] | null } export type LocalUsageThresholdInput = UsageThresholdInput diff --git a/src/components/subscriptions/SubscriptionCurrentUsageTable.tsx b/src/components/subscriptions/SubscriptionCurrentUsageTable.tsx index d9ad7710ce..ca303eeba3 100644 --- a/src/components/subscriptions/SubscriptionCurrentUsageTable.tsx +++ b/src/components/subscriptions/SubscriptionCurrentUsageTable.tsx @@ -683,6 +683,9 @@ export const SubscriptionCurrentUsageTable = ({ } = useUsageForSubscriptionUsageQuery({ ...queryParams, skip: queryParams.skip || fetchProjected, + // Removing the no-cache policies will break the rendered data + fetchPolicy: 'no-cache', + nextFetchPolicy: 'no-cache', }) const { @@ -693,6 +696,9 @@ export const SubscriptionCurrentUsageTable = ({ } = useProjectedUsageForSubscriptionUsageQuery({ ...queryParams, skip: queryParams.skip || !fetchProjected, + // Removing the no-cache policies will break the rendered data + fetchPolicy: 'no-cache', + nextFetchPolicy: 'no-cache', }) const refetchUsage = (forceProjected?: boolean) => diff --git a/src/components/taxes/TaxesSelectorSection.tsx b/src/components/taxes/TaxesSelectorSection.tsx new file mode 100644 index 0000000000..58c771890c --- /dev/null +++ b/src/components/taxes/TaxesSelectorSection.tsx @@ -0,0 +1,159 @@ +import { gql } from '@apollo/client' +import { Button, Chip, Tooltip, Typography } from 'lago-design-system' +import { useMemo, useState } from 'react' + +import { ComboBox, ComboboxItem } from '~/components/form' +import { MUI_INPUT_BASE_ROOT_CLASSNAME } from '~/core/constants/form' +import { intlFormatNumber } from '~/core/formats/intlFormatNumber' +import { scrollToAndClickElement } from '~/core/utils/domUtils' +import { + TaxForTaxesSelectorSectionFragment, + TaxForTaxesSelectorSectionFragmentDoc, + useGetTaxesForTaxesSelectorSectionLazyQuery, +} from '~/generated/graphql' +import { useInternationalization } from '~/hooks/core/useInternationalization' + +gql` + fragment TaxForTaxesSelectorSection on Tax { + id + code + name + rate + } + + query getTaxesForTaxesSelectorSection($limit: Int, $page: Int, $searchTerm: String) { + taxes(limit: $limit, page: $page, searchTerm: $searchTerm) { + metadata { + currentPage + totalPages + } + collection { + id + ...TaxForTaxesSelectorSection + } + } + } + + ${TaxForTaxesSelectorSectionFragmentDoc} +` + +export const TaxesSelectorSection = ({ + taxes, + comboboxSelector, + onUpdate, + onDelete, +}: { + taxes: T[] + comboboxSelector: string + onUpdate: (newTaxArray: T[]) => void + onDelete: (newTaxArray: T[]) => void +}) => { + const { translate } = useInternationalization() + const [shouldDisplayTaxesInput, setShouldDisplayTaxesInput] = useState(false) + + const [getTaxes, { data: taxesData, loading: taxesLoading }] = + useGetTaxesForTaxesSelectorSectionLazyQuery({ + variables: { limit: 500 }, + }) + const { collection: taxesCollection } = taxesData?.taxes || {} + + const taxesDataForCombobox = useMemo(() => { + if (!taxesCollection) return [] + + const chargeTaxesIds = taxes?.map((tax) => tax.id) || [] + + return taxesCollection.map(({ id: taxId, name, rate }) => { + const formatedRate = intlFormatNumber(Number(rate) / 100 || 0, { + style: 'percent', + }) + + return { + label: `${name} (${formatedRate})`, + labelNode: ( + + + {name} + + + {formatedRate} + + + ), + value: taxId, + disabled: chargeTaxesIds.includes(taxId), + } + }) + }, [taxes, taxesCollection]) + + return ( +
+ {!!taxes?.length && ( +
+ {taxes.map(({ id: localTaxId, name, rate }) => ( + { + const newTaxedArray = taxes?.filter((tax) => tax.id !== localTaxId) || [] + + onDelete(newTaxedArray) + }} + /> + ))} +
+ )} + + {!shouldDisplayTaxesInput ? ( + + ) : ( +
+ { + const previousTaxes = [...(taxes || [])] + const newTaxObject = taxesData?.taxes.collection.find((t) => t.id === newTaxId) + + onUpdate([...previousTaxes, newTaxObject] as T[]) + setShouldDisplayTaxesInput(false) + }} + /> + + +
+ )} +
+ ) +} diff --git a/src/core/formats/__tests__/formatInvoiceItemsMap.test.ts b/src/core/formats/__tests__/formatInvoiceItemsMap.test.ts index 16aa5e49ba..12ccfb04f9 100644 --- a/src/core/formats/__tests__/formatInvoiceItemsMap.test.ts +++ b/src/core/formats/__tests__/formatInvoiceItemsMap.test.ts @@ -1,3 +1,4 @@ +import { InvoiceSubscriptionsForDisplay } from '~/components/invoices/types' import { ALL_FILTER_VALUES } from '~/core/constants/form' import { composeChargeFilterDisplayName, @@ -7,7 +8,6 @@ import { groupAndFormatFees, TExtendedRemainingFee, } from '~/core/formats/formatInvoiceItemsMap' -import { InvoiceForDetailsTableFragment } from '~/generated/graphql' import { chargeZeroAmount, @@ -81,8 +81,7 @@ describe('formatInvoiceItemsMap', () => { }) it('should return default values if there are no fees', () => { const result = groupAndFormatFees({ - invoiceSubscriptions: - noFees as unknown as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + invoiceSubscriptions: noFees as unknown as InvoiceSubscriptionsForDisplay, hasOldZeroFeeManagement: true, }) @@ -90,8 +89,7 @@ describe('formatInvoiceItemsMap', () => { }) it('should return default values if there are only sub fee with 0 amountCents', () => { const result = groupAndFormatFees({ - invoiceSubscriptions: - subZeroAmount as unknown as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + invoiceSubscriptions: subZeroAmount as unknown as InvoiceSubscriptionsForDisplay, hasOldZeroFeeManagement: true, }) @@ -99,8 +97,7 @@ describe('formatInvoiceItemsMap', () => { }) it('should return default values if there are only sub fee with 0 amountCents and 0 units', () => { const result = groupAndFormatFees({ - invoiceSubscriptions: - chargeZeroAmount as unknown as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + invoiceSubscriptions: chargeZeroAmount as unknown as InvoiceSubscriptionsForDisplay, hasOldZeroFeeManagement: true, }) @@ -109,7 +106,7 @@ describe('formatInvoiceItemsMap', () => { it('should return all values if invoice has draft status', () => { const result = groupAndFormatFees({ invoiceSubscriptions: - chargeZeroAmountDraftInvoice as unknown as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + chargeZeroAmountDraftInvoice as unknown as InvoiceSubscriptionsForDisplay, hasOldZeroFeeManagement: true, }) @@ -117,8 +114,7 @@ describe('formatInvoiceItemsMap', () => { }) it('should return the correct values if there are 1 subscription', () => { const result = groupAndFormatFees({ - invoiceSubscriptions: - oneSubscription as unknown as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + invoiceSubscriptions: oneSubscription as unknown as InvoiceSubscriptionsForDisplay, hasOldZeroFeeManagement: true, }) @@ -126,8 +122,7 @@ describe('formatInvoiceItemsMap', () => { }) it('should return the correct values if there are 2 subscription', () => { const result = groupAndFormatFees({ - invoiceSubscriptions: - twoSubscriptions as unknown as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + invoiceSubscriptions: twoSubscriptions as unknown as InvoiceSubscriptionsForDisplay, hasOldZeroFeeManagement: true, }) @@ -136,7 +131,7 @@ describe('formatInvoiceItemsMap', () => { it('should return the correct order for a given subscription', () => { const result = groupAndFormatFees({ invoiceSubscriptions: - unorderedSubscriptionWithFees as unknown as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + unorderedSubscriptionWithFees as unknown as InvoiceSubscriptionsForDisplay, hasOldZeroFeeManagement: true, }) @@ -158,8 +153,7 @@ describe('formatInvoiceItemsMap', () => { }) it('should return default values if there are no fees', () => { const result = groupAndFormatFees({ - invoiceSubscriptions: - noFees as unknown as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + invoiceSubscriptions: noFees as unknown as InvoiceSubscriptionsForDisplay, hasOldZeroFeeManagement: false, }) @@ -167,8 +161,7 @@ describe('formatInvoiceItemsMap', () => { }) it('should return default values if there are only sub fee with 0 amountCents', () => { const result = groupAndFormatFees({ - invoiceSubscriptions: - subZeroAmount as unknown as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + invoiceSubscriptions: subZeroAmount as unknown as InvoiceSubscriptionsForDisplay, hasOldZeroFeeManagement: false, }) @@ -176,8 +169,7 @@ describe('formatInvoiceItemsMap', () => { }) it('should return default values if there are only sub fee with 0 amountCents and 0 units', () => { const result = groupAndFormatFees({ - invoiceSubscriptions: - chargeZeroAmount as unknown as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + invoiceSubscriptions: chargeZeroAmount as unknown as InvoiceSubscriptionsForDisplay, hasOldZeroFeeManagement: false, }) @@ -186,7 +178,7 @@ describe('formatInvoiceItemsMap', () => { it('should return all values if invoice has draft status', () => { const result = groupAndFormatFees({ invoiceSubscriptions: - chargeZeroAmountDraftInvoice as unknown as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + chargeZeroAmountDraftInvoice as unknown as InvoiceSubscriptionsForDisplay, hasOldZeroFeeManagement: false, }) @@ -194,8 +186,7 @@ describe('formatInvoiceItemsMap', () => { }) it('should return the correct values if there are 1 subscription', () => { const result = groupAndFormatFees({ - invoiceSubscriptions: - oneSubscription as unknown as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + invoiceSubscriptions: oneSubscription as unknown as InvoiceSubscriptionsForDisplay, hasOldZeroFeeManagement: false, }) @@ -203,8 +194,7 @@ describe('formatInvoiceItemsMap', () => { }) it('should return the correct values if there are 2 subscription', () => { const result = groupAndFormatFees({ - invoiceSubscriptions: - twoSubscriptions as unknown as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + invoiceSubscriptions: twoSubscriptions as unknown as InvoiceSubscriptionsForDisplay, hasOldZeroFeeManagement: false, }) @@ -213,7 +203,7 @@ describe('formatInvoiceItemsMap', () => { it('should return the correct order for a given subscription', () => { const result = groupAndFormatFees({ invoiceSubscriptions: - unorderedSubscriptionWithFees as unknown as InvoiceForDetailsTableFragment['invoiceSubscriptions'], + unorderedSubscriptionWithFees as unknown as InvoiceSubscriptionsForDisplay, hasOldZeroFeeManagement: false, }) diff --git a/src/core/formats/formatInvoiceItemsMap.ts b/src/core/formats/formatInvoiceItemsMap.ts index 875b95d78b..4d9a2047b7 100644 --- a/src/core/formats/formatInvoiceItemsMap.ts +++ b/src/core/formats/formatInvoiceItemsMap.ts @@ -1,13 +1,8 @@ import { gql } from '@apollo/client' +import { InvoiceSubscriptionsForDisplay } from '~/components/invoices/types' import { ALL_FILTER_VALUES } from '~/core/constants/form' -import { - Fee, - FeeTypesEnum, - InvoiceForDetailsTableFragment, - InvoiceStatusTypeEnum, - InvoiceSubscription, -} from '~/generated/graphql' +import { Fee, FeeTypesEnum, InvoiceStatusTypeEnum, InvoiceSubscription } from '~/generated/graphql' gql` fragment InvoiceSubscriptionFormating on InvoiceSubscription { @@ -173,7 +168,7 @@ export const groupAndFormatFees = ({ invoiceSubscriptions, hasOldZeroFeeManagement, }: { - invoiceSubscriptions: InvoiceForDetailsTableFragment['invoiceSubscriptions'] | null | undefined + invoiceSubscriptions: InvoiceSubscriptionsForDisplay hasOldZeroFeeManagement: boolean }): TFormatedInvoiceSubscriptionDataForDisplay => { let hasAnyFeeParsed = false diff --git a/src/generated/graphql.tsx b/src/generated/graphql.tsx index f677a6a3e1..4b945d9ff1 100644 --- a/src/generated/graphql.tsx +++ b/src/generated/graphql.tsx @@ -298,6 +298,22 @@ export enum AggregationTypeEnum { WeightedSumAgg = 'weighted_sum_agg' } +export type AiConversation = { + __typename?: 'AiConversation'; + createdAt: Scalars['ISO8601DateTime']['output']; + id: Scalars['ID']['output']; + mistralConversationId?: Maybe; + name: Scalars['String']['output']; + organization: Organization; + updatedAt: Scalars['ISO8601DateTime']['output']; +}; + +export type AiConversationStream = { + __typename?: 'AiConversationStream'; + chunk?: Maybe; + done: Scalars['Boolean']['output']; +}; + export type Alert = { __typename?: 'Alert'; alertType: AlertTypeEnum; @@ -1442,6 +1458,14 @@ export type CreateAdjustedFeeInput = { units?: InputMaybe; }; +/** Autogenerated input type of CreateAiConversation */ +export type CreateAiConversationInput = { + /** A unique identifier for the client performing the mutation. */ + clientMutationId?: InputMaybe; + conversationId?: InputMaybe; + message: Scalars['String']['input']; +}; + /** Autogenerated input type of CreateAnrokIntegration */ export type CreateAnrokIntegrationInput = { apiKey: Scalars['String']['input']; @@ -3663,6 +3687,16 @@ export type GraduatedRangeInput = { toValue?: InputMaybe; }; +export type GraphqlSubscription = { + __typename?: 'GraphqlSubscription'; + aiConversationStreamed: AiConversationStream; +}; + + +export type GraphqlSubscriptionAiConversationStreamedArgs = { + id: Scalars['ID']['input']; +}; + export type GrossRevenue = { __typename?: 'GrossRevenue'; amountCents?: Maybe; @@ -4261,6 +4295,8 @@ export type Mutation = { createAddOn?: Maybe; /** Creates Adjusted Fee */ createAdjustedFee?: Maybe; + /** Creates an AI conversation and appends a message to it */ + createAiConversation?: Maybe; /** Create Anrok integration */ createAnrokIntegration?: Maybe; /** Creates a new API key */ @@ -4594,6 +4630,11 @@ export type MutationCreateAdjustedFeeArgs = { }; +export type MutationCreateAiConversationArgs = { + input: CreateAiConversationInput; +}; + + export type MutationCreateAnrokIntegrationArgs = { input: CreateAnrokIntegrationInput; }; @@ -5509,6 +5550,8 @@ export type Permissions = { addonsDelete: Scalars['Boolean']['output']; addonsUpdate: Scalars['Boolean']['output']; addonsView: Scalars['Boolean']['output']; + aiConversationsCreate: Scalars['Boolean']['output']; + aiConversationsView: Scalars['Boolean']['output']; analyticsOverdueBalancesView: Scalars['Boolean']['output']; analyticsView: Scalars['Boolean']['output']; auditLogsView: Scalars['Boolean']['output']; @@ -9594,7 +9637,7 @@ export type DisputeInvoiceMutationVariables = Exact<{ }>; -export type DisputeInvoiceMutation = { __typename?: 'Mutation', loseInvoiceDispute?: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum, invoiceType: InvoiceTypeEnum, number: string, paymentStatus: InvoicePaymentStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, totalAmountCents: any, currency?: CurrencyEnum | null, refundableAmountCents: any, creditableAmountCents: any, voidable: boolean, paymentDisputeLostAt?: any | null, integrationSyncable: boolean, externalIntegrationId?: string | null, taxProviderVoidable: boolean, integrationHubspotSyncable: boolean, associatedActiveWalletPresent: boolean, voidedAt?: any | null, voidedInvoiceId?: string | null, regeneratedInvoiceId?: string | null, issuingDate: any, taxProviderId?: string | null, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, totalPaidAmountCents: any, couponsAmountCents: any, creditNotesAmountCents: any, totalDueAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, applicableTimezone: TimezoneEnum, deletedAt?: any | null, accountType: CustomerAccountTypeEnum }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, addOn?: { __typename?: 'AddOn', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null, billingEntity: { __typename?: 'BillingEntity', name: string, code: string }, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, invoiceSubscriptions?: Array<{ __typename?: 'InvoiceSubscription', fromDatetime?: any | null, toDatetime?: any | null, chargesFromDatetime?: any | null, chargesToDatetime?: any | null, inAdvanceChargesFromDatetime?: any | null, inAdvanceChargesToDatetime?: any | null, acceptNewChargeFees: boolean, subscriptionAmountCents: any, invoice: { __typename?: 'Invoice', chargeAmountCents: any, progressiveBillingCreditAmountCents: any, id: string, status: InvoiceStatusTypeEnum }, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | null, billChargesMonthly?: boolean | null } }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null, interval: PlanInterval } } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; +export type DisputeInvoiceMutation = { __typename?: 'Mutation', loseInvoiceDispute?: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum, invoiceType: InvoiceTypeEnum, number: string, paymentStatus: InvoicePaymentStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, totalAmountCents: any, currency?: CurrencyEnum | null, refundableAmountCents: any, creditableAmountCents: any, voidable: boolean, paymentDisputeLostAt?: any | null, integrationSyncable: boolean, externalIntegrationId?: string | null, taxProviderVoidable: boolean, integrationHubspotSyncable: boolean, associatedActiveWalletPresent: boolean, voidedAt?: any | null, voidedInvoiceId?: string | null, regeneratedInvoiceId?: string | null, issuingDate: any, taxProviderId?: string | null, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, totalPaidAmountCents: any, couponsAmountCents: any, creditNotesAmountCents: any, totalDueAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, applicableTimezone: TimezoneEnum, deletedAt?: any | null, accountType: CustomerAccountTypeEnum }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, addOn?: { __typename?: 'AddOn', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, billableMetric: { __typename?: 'BillableMetric', id: string, name: string } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null }> | null, billingEntity: { __typename?: 'BillingEntity', name: string, code: string }, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; export type TaxForInvoiceEditTaxDialogFragment = { __typename?: 'Tax', id: string, name: string, rate: number, code: string }; @@ -9615,7 +9658,7 @@ export type UpdateInvoicePaymentStatusMutationVariables = Exact<{ }>; -export type UpdateInvoicePaymentStatusMutation = { __typename?: 'Mutation', updateInvoice?: { __typename?: 'Invoice', id: string, paymentStatus: InvoicePaymentStatusTypeEnum, status: InvoiceStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, paymentOverdue: boolean, number: string, issuingDate: any, totalAmountCents: any, totalDueAmountCents: any, totalPaidAmountCents: any, currency?: CurrencyEnum | null, voidable: boolean, paymentDisputeLostAt?: any | null, taxProviderVoidable: boolean, invoiceType: InvoiceTypeEnum, creditableAmountCents: any, refundableAmountCents: any, associatedActiveWalletPresent: boolean, voidedInvoiceId?: string | null, regeneratedInvoiceId?: string | null, integrationSyncable: boolean, externalIntegrationId?: string | null, integrationHubspotSyncable: boolean, voidedAt?: any | null, taxProviderId?: string | null, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, customer: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, applicableTimezone: TimezoneEnum, paymentProvider?: ProviderTypeEnum | null, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, deletedAt?: any | null, accountType: CustomerAccountTypeEnum }, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, billingEntity: { __typename?: 'BillingEntity', name: string, code: string }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, addOn?: { __typename?: 'AddOn', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, invoiceSubscriptions?: Array<{ __typename?: 'InvoiceSubscription', fromDatetime?: any | null, toDatetime?: any | null, chargesFromDatetime?: any | null, chargesToDatetime?: any | null, inAdvanceChargesFromDatetime?: any | null, inAdvanceChargesToDatetime?: any | null, acceptNewChargeFees: boolean, subscriptionAmountCents: any, invoice: { __typename?: 'Invoice', chargeAmountCents: any, progressiveBillingCreditAmountCents: any, id: string, status: InvoiceStatusTypeEnum }, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | null, billChargesMonthly?: boolean | null } }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null, interval: PlanInterval } } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; +export type UpdateInvoicePaymentStatusMutation = { __typename?: 'Mutation', updateInvoice?: { __typename?: 'Invoice', id: string, paymentStatus: InvoicePaymentStatusTypeEnum, status: InvoiceStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, paymentOverdue: boolean, number: string, issuingDate: any, totalAmountCents: any, totalDueAmountCents: any, totalPaidAmountCents: any, currency?: CurrencyEnum | null, voidable: boolean, paymentDisputeLostAt?: any | null, taxProviderVoidable: boolean, invoiceType: InvoiceTypeEnum, creditableAmountCents: any, refundableAmountCents: any, associatedActiveWalletPresent: boolean, voidedInvoiceId?: string | null, regeneratedInvoiceId?: string | null, integrationSyncable: boolean, externalIntegrationId?: string | null, integrationHubspotSyncable: boolean, voidedAt?: any | null, taxProviderId?: string | null, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, customer: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, applicableTimezone: TimezoneEnum, paymentProvider?: ProviderTypeEnum | null, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, deletedAt?: any | null, accountType: CustomerAccountTypeEnum }, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, billingEntity: { __typename?: 'BillingEntity', name: string, code: string }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, addOn?: { __typename?: 'AddOn', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, billableMetric: { __typename?: 'BillableMetric', id: string, name: string } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null }> | null, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; export type InvoiceForFinalizeInvoiceFragment = { __typename?: 'Invoice', id: string, issuingDate: any, customer: { __typename?: 'Customer', id: string, applicableTimezone: TimezoneEnum } }; @@ -9624,7 +9667,7 @@ export type FinalizeInvoiceMutationVariables = Exact<{ }>; -export type FinalizeInvoiceMutation = { __typename?: 'Mutation', finalizeInvoice?: { __typename?: 'Invoice', id: string, invoiceType: InvoiceTypeEnum, number: string, paymentStatus: InvoicePaymentStatusTypeEnum, status: InvoiceStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, totalAmountCents: any, currency?: CurrencyEnum | null, refundableAmountCents: any, creditableAmountCents: any, voidable: boolean, paymentDisputeLostAt?: any | null, integrationSyncable: boolean, externalIntegrationId?: string | null, taxProviderVoidable: boolean, integrationHubspotSyncable: boolean, associatedActiveWalletPresent: boolean, voidedAt?: any | null, voidedInvoiceId?: string | null, regeneratedInvoiceId?: string | null, issuingDate: any, taxProviderId?: string | null, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, totalPaidAmountCents: any, couponsAmountCents: any, creditNotesAmountCents: any, totalDueAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, applicableTimezone: TimezoneEnum, deletedAt?: any | null, accountType: CustomerAccountTypeEnum }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, addOn?: { __typename?: 'AddOn', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null, billingEntity: { __typename?: 'BillingEntity', name: string, code: string }, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, invoiceSubscriptions?: Array<{ __typename?: 'InvoiceSubscription', fromDatetime?: any | null, toDatetime?: any | null, chargesFromDatetime?: any | null, chargesToDatetime?: any | null, inAdvanceChargesFromDatetime?: any | null, inAdvanceChargesToDatetime?: any | null, acceptNewChargeFees: boolean, subscriptionAmountCents: any, invoice: { __typename?: 'Invoice', chargeAmountCents: any, progressiveBillingCreditAmountCents: any, id: string, status: InvoiceStatusTypeEnum }, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | null, billChargesMonthly?: boolean | null } }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null, interval: PlanInterval } } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; +export type FinalizeInvoiceMutation = { __typename?: 'Mutation', finalizeInvoice?: { __typename?: 'Invoice', id: string, invoiceType: InvoiceTypeEnum, number: string, paymentStatus: InvoicePaymentStatusTypeEnum, status: InvoiceStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, totalAmountCents: any, currency?: CurrencyEnum | null, refundableAmountCents: any, creditableAmountCents: any, voidable: boolean, paymentDisputeLostAt?: any | null, integrationSyncable: boolean, externalIntegrationId?: string | null, taxProviderVoidable: boolean, integrationHubspotSyncable: boolean, associatedActiveWalletPresent: boolean, voidedAt?: any | null, voidedInvoiceId?: string | null, regeneratedInvoiceId?: string | null, issuingDate: any, taxProviderId?: string | null, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, totalPaidAmountCents: any, couponsAmountCents: any, creditNotesAmountCents: any, totalDueAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, applicableTimezone: TimezoneEnum, deletedAt?: any | null, accountType: CustomerAccountTypeEnum }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, addOn?: { __typename?: 'AddOn', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, billableMetric: { __typename?: 'BillableMetric', id: string, name: string } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null }> | null, billingEntity: { __typename?: 'BillingEntity', name: string, code: string }, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; export type InvoiceActivityLogsQueryVariables = Exact<{ page?: InputMaybe; @@ -9669,7 +9712,7 @@ export type VoidInvoiceMutationVariables = Exact<{ }>; -export type VoidInvoiceMutation = { __typename?: 'Mutation', voidInvoice?: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, paymentStatus: InvoicePaymentStatusTypeEnum, paymentOverdue: boolean, number: string, issuingDate: any, totalAmountCents: any, totalDueAmountCents: any, totalPaidAmountCents: any, currency?: CurrencyEnum | null, voidable: boolean, paymentDisputeLostAt?: any | null, taxProviderVoidable: boolean, invoiceType: InvoiceTypeEnum, creditableAmountCents: any, refundableAmountCents: any, associatedActiveWalletPresent: boolean, voidedInvoiceId?: string | null, regeneratedInvoiceId?: string | null, integrationSyncable: boolean, externalIntegrationId?: string | null, integrationHubspotSyncable: boolean, voidedAt?: any | null, taxProviderId?: string | null, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, customer: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, applicableTimezone: TimezoneEnum, paymentProvider?: ProviderTypeEnum | null, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, deletedAt?: any | null, accountType: CustomerAccountTypeEnum }, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, billingEntity: { __typename?: 'BillingEntity', name: string, code: string }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, addOn?: { __typename?: 'AddOn', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, invoiceSubscriptions?: Array<{ __typename?: 'InvoiceSubscription', fromDatetime?: any | null, toDatetime?: any | null, chargesFromDatetime?: any | null, chargesToDatetime?: any | null, inAdvanceChargesFromDatetime?: any | null, inAdvanceChargesToDatetime?: any | null, acceptNewChargeFees: boolean, subscriptionAmountCents: any, invoice: { __typename?: 'Invoice', chargeAmountCents: any, progressiveBillingCreditAmountCents: any, id: string, status: InvoiceStatusTypeEnum }, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | null, billChargesMonthly?: boolean | null } }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null, interval: PlanInterval } } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; +export type VoidInvoiceMutation = { __typename?: 'Mutation', voidInvoice?: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, paymentStatus: InvoicePaymentStatusTypeEnum, paymentOverdue: boolean, number: string, issuingDate: any, totalAmountCents: any, totalDueAmountCents: any, totalPaidAmountCents: any, currency?: CurrencyEnum | null, voidable: boolean, paymentDisputeLostAt?: any | null, taxProviderVoidable: boolean, invoiceType: InvoiceTypeEnum, creditableAmountCents: any, refundableAmountCents: any, associatedActiveWalletPresent: boolean, voidedInvoiceId?: string | null, regeneratedInvoiceId?: string | null, integrationSyncable: boolean, externalIntegrationId?: string | null, integrationHubspotSyncable: boolean, voidedAt?: any | null, taxProviderId?: string | null, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, customer: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, applicableTimezone: TimezoneEnum, paymentProvider?: ProviderTypeEnum | null, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, deletedAt?: any | null, accountType: CustomerAccountTypeEnum }, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, billingEntity: { __typename?: 'BillingEntity', name: string, code: string }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, addOn?: { __typename?: 'AddOn', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, billableMetric: { __typename?: 'BillableMetric', id: string, name: string } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null }> | null, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; export type FeeForDeleteAdjustmentFeeDialogFragment = { __typename?: 'Fee', id: string }; @@ -9698,9 +9741,11 @@ export type CreateAdjustedFeeMutationVariables = Exact<{ export type CreateAdjustedFeeMutation = { __typename?: 'Mutation', createAdjustedFee?: { __typename?: 'Fee', id: string } | null }; -export type FeeForInvoiceDetailsTableFragment = { __typename?: 'Fee', id: string, amountCents: any, description?: string | null, feeType: FeeTypesEnum, invoiceDisplayName?: string | null, invoiceName?: string | null, itemName: string, units: number, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }; +export type FeeForInvoiceDetailsTableFragment = { __typename?: 'Fee', id: string, amountCents: any, description?: string | null, feeType: FeeTypesEnum, invoiceDisplayName?: string | null, invoiceName?: string | null, itemName: string, units: number, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, minAmountCents: any, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, walletTransaction?: { __typename?: 'WalletTransaction', id: string, name?: string | null, wallet?: { __typename?: 'Wallet', id: string, name?: string | null } | null } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxCode: string, taxRate: number }> | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }; -export type InvoiceForDetailsTableFragment = { __typename?: 'Invoice', id: string, invoiceType: InvoiceTypeEnum, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, totalAmountCents: any, currency?: CurrencyEnum | null, issuingDate: any, allChargesHaveFees: boolean, versionNumber: number, couponsAmountCents: any, creditNotesAmountCents: any, totalDueAmountCents: any, totalPaidAmountCents: any, status: InvoiceStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, description?: string | null, feeType: FeeTypesEnum, invoiceDisplayName?: string | null, invoiceName?: string | null, itemName: string, units: number, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null, invoiceSubscriptions?: Array<{ __typename?: 'InvoiceSubscription', fromDatetime?: any | null, toDatetime?: any | null, chargesFromDatetime?: any | null, chargesToDatetime?: any | null, inAdvanceChargesFromDatetime?: any | null, inAdvanceChargesToDatetime?: any | null, acceptNewChargeFees: boolean, subscriptionAmountCents: any, invoice: { __typename?: 'Invoice', chargeAmountCents: any, progressiveBillingCreditAmountCents: any, id: string, status: InvoiceStatusTypeEnum }, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | null, billChargesMonthly?: boolean | null } }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null, interval: PlanInterval } } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null }; +export type InvoiceSubscriptionForInvoiceDetailsTableFragment = { __typename?: 'InvoiceSubscription', fromDatetime?: any | null, toDatetime?: any | null, chargesFromDatetime?: any | null, chargesToDatetime?: any | null, inAdvanceChargesFromDatetime?: any | null, inAdvanceChargesToDatetime?: any | null, acceptNewChargeFees: boolean, subscriptionAmountCents: any, invoice: { __typename?: 'Invoice', chargeAmountCents: any, progressiveBillingCreditAmountCents: any, id: string, status: InvoiceStatusTypeEnum }, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | null, billChargesMonthly?: boolean | null } }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null, interval: PlanInterval } } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, minAmountCents: any, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, walletTransaction?: { __typename?: 'WalletTransaction', id: string, name?: string | null, wallet?: { __typename?: 'Wallet', id: string, name?: string | null } | null } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxCode: string, taxRate: number }> | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null }; + +export type InvoiceForDetailsTableFragment = { __typename?: 'Invoice', id: string, invoiceType: InvoiceTypeEnum, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, totalAmountCents: any, currency?: CurrencyEnum | null, issuingDate: any, allChargesHaveFees: boolean, versionNumber: number, couponsAmountCents: any, creditNotesAmountCents: any, totalDueAmountCents: any, totalPaidAmountCents: any, status: InvoiceStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null }; export type FeeForInvoiceDetailsTableBodyLineFragment = { __typename?: 'Fee', id: string, units: number, preciseUnitAmount: number, amountCents: any, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, charge?: { __typename?: 'Charge', id: string, chargeModel: ChargeModelEnum, minAmountCents: any, payInAdvance: boolean, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, recurring: boolean } } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }; @@ -9720,44 +9765,8 @@ export type FeeForInvoiceFeeAdvanceDetailsTableFragment = { __typename?: 'Fee', export type FeeForInvoiceFeeArrearsDetailsTableFragment = { __typename?: 'Fee', id: string, units: number, preciseUnitAmount: number, amountCents: any, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, charge?: { __typename?: 'Charge', id: string, chargeModel: ChargeModelEnum, minAmountCents: any, payInAdvance: boolean, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, recurring: boolean } } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }; -export type TaxForPlanChargeAccordionFragment = { __typename?: 'Tax', id: string, code: string, name: string, rate: number }; - -export type ChargeAccordionFragment = { __typename?: 'Charge', id: string, chargeModel: ChargeModelEnum, invoiceable: boolean, minAmountCents: any, payInAdvance: boolean, prorated: boolean, invoiceDisplayName?: string | null, regroupPaidFees?: RegroupPaidFeesEnum | null, properties?: { __typename?: 'Properties', amount?: string | null, packageSize?: any | null, freeUnits?: any | null, pricingGroupKeys?: Array | null, fixedAmount?: string | null, freeUnitsPerEvents?: any | null, freeUnitsPerTotalAggregation?: string | null, rate?: string | null, perTransactionMinAmount?: string | null, perTransactionMaxAmount?: string | null, customProperties?: any | null, graduatedRanges?: Array<{ __typename?: 'GraduatedRange', flatAmount: string, fromValue: any, perUnitAmount: string, toValue?: any | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'GraduatedPercentageRange', flatAmount: string, fromValue: any, rate: string, toValue?: any | null }> | null, volumeRanges?: Array<{ __typename?: 'VolumeRange', flatAmount: string, fromValue: any, perUnitAmount: string, toValue?: any | null }> | null } | null, filters?: Array<{ __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any, properties: { __typename?: 'Properties', amount?: string | null, packageSize?: any | null, freeUnits?: any | null, pricingGroupKeys?: Array | null, fixedAmount?: string | null, freeUnitsPerEvents?: any | null, freeUnitsPerTotalAggregation?: string | null, rate?: string | null, perTransactionMinAmount?: string | null, perTransactionMaxAmount?: string | null, customProperties?: any | null, graduatedRanges?: Array<{ __typename?: 'GraduatedRange', flatAmount: string, fromValue: any, perUnitAmount: string, toValue?: any | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'GraduatedPercentageRange', flatAmount: string, fromValue: any, rate: string, toValue?: any | null }> | null, volumeRanges?: Array<{ __typename?: 'VolumeRange', flatAmount: string, fromValue: any, perUnitAmount: string, toValue?: any | null }> | null } }> | null, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean, filters?: Array<{ __typename?: 'BillableMetricFilter', key: string, values: Array }> | null }, taxes?: Array<{ __typename?: 'Tax', id: string, code: string, name: string, rate: number }> | null }; - -export type GetTaxesForChargesQueryVariables = Exact<{ - limit?: InputMaybe; - page?: InputMaybe; -}>; - - -export type GetTaxesForChargesQuery = { __typename?: 'Query', taxes: { __typename?: 'TaxCollection', metadata: { __typename?: 'CollectionMetadata', currentPage: number, totalPages: number }, collection: Array<{ __typename?: 'Tax', id: string, code: string, name: string, rate: number }> } }; - -export type ChargeForChargeOptionsAccordionFragment = { __typename?: 'Charge', id: string, invoiceable: boolean, minAmountCents: any, payInAdvance: boolean, regroupPaidFees?: RegroupPaidFeesEnum | null }; - export type PercentageChargeFragment = { __typename?: 'Properties', fixedAmount?: string | null, freeUnitsPerEvents?: any | null, freeUnitsPerTotalAggregation?: string | null, rate?: string | null, perTransactionMinAmount?: string | null, perTransactionMaxAmount?: string | null }; -export type PlanForChargeAccordionFragment = { __typename?: 'Plan', billChargesMonthly?: boolean | null }; - -export type BillableMetricForChargeSectionFragment = { __typename?: 'BillableMetric', id: string, name: string, code: string, aggregationType: AggregationTypeEnum, recurring: boolean, filters?: Array<{ __typename?: 'BillableMetricFilter', id: string, key: string, values: Array }> | null }; - -export type GetMeteredBillableMetricsQueryVariables = Exact<{ - page?: InputMaybe; - limit?: InputMaybe; - searchTerm?: InputMaybe; -}>; - - -export type GetMeteredBillableMetricsQuery = { __typename?: 'Query', billableMetrics: { __typename?: 'BillableMetricCollection', collection: Array<{ __typename?: 'BillableMetric', id: string, name: string, code: string, aggregationType: AggregationTypeEnum, recurring: boolean, filters?: Array<{ __typename?: 'BillableMetricFilter', id: string, key: string, values: Array }> | null }> } }; - -export type GetRecurringBillableMetricsQueryVariables = Exact<{ - page?: InputMaybe; - limit?: InputMaybe; - searchTerm?: InputMaybe; -}>; - - -export type GetRecurringBillableMetricsQuery = { __typename?: 'Query', billableMetrics: { __typename?: 'BillableMetricCollection', collection: Array<{ __typename?: 'BillableMetric', id: string, name: string, code: string, aggregationType: AggregationTypeEnum, recurring: boolean, filters?: Array<{ __typename?: 'BillableMetricFilter', id: string, key: string, values: Array }> | null }> } }; - export type GetTaxesForCommitmentsQueryVariables = Exact<{ limit?: InputMaybe; page?: InputMaybe; @@ -9801,8 +9810,6 @@ export type GetFeatureDetailsForFeatureEntitlementPrivilegeSectionQueryVariables export type GetFeatureDetailsForFeatureEntitlementPrivilegeSectionQuery = { __typename?: 'Query', feature: { __typename?: 'FeatureObject', id: string, code: string, name?: string | null, privileges: Array<{ __typename?: 'PrivilegeObject', id: string, name?: string | null, code: string, valueType: PrivilegeValueTypeEnum, config: { __typename?: 'PrivilegeConfigObject', selectOptions?: Array | null } }> } }; -export type PlanForFixedFeeSectionFragment = { __typename?: 'Plan', id: string, amountCents: any, payInAdvance: boolean, trialPeriod?: number | null, invoiceDisplayName?: string | null }; - export type GraduatedChargeFragment = { __typename?: 'Properties', graduatedRanges?: Array<{ __typename?: 'GraduatedRange', flatAmount: string, fromValue: any, perUnitAmount: string, toValue?: any | null }> | null }; export type GraduatedPercentageChargeFragment = { __typename?: 'Properties', graduatedPercentageRanges?: Array<{ __typename?: 'GraduatedPercentageRange', flatAmount: string, fromValue: any, rate: string, toValue?: any | null }> | null }; @@ -9824,8 +9831,36 @@ export type GetTaxesForPlanQuery = { __typename?: 'Query', taxes: { __typename?: export type StandardChargeFragment = { __typename?: 'Properties', amount?: string | null, pricingGroupKeys?: Array | null }; +export type PlanForSubscriptionFeeSectionFragment = { __typename?: 'Plan', id: string, amountCents: any, payInAdvance: boolean, trialPeriod?: number | null, invoiceDisplayName?: string | null }; + +export type UsageChargeAccordionFragment = { __typename?: 'Charge', id: string, chargeModel: ChargeModelEnum, invoiceable: boolean, minAmountCents: any, payInAdvance: boolean, prorated: boolean, invoiceDisplayName?: string | null, regroupPaidFees?: RegroupPaidFeesEnum | null, properties?: { __typename?: 'Properties', amount?: string | null, packageSize?: any | null, freeUnits?: any | null, pricingGroupKeys?: Array | null, fixedAmount?: string | null, freeUnitsPerEvents?: any | null, freeUnitsPerTotalAggregation?: string | null, rate?: string | null, perTransactionMinAmount?: string | null, perTransactionMaxAmount?: string | null, customProperties?: any | null, graduatedRanges?: Array<{ __typename?: 'GraduatedRange', flatAmount: string, fromValue: any, perUnitAmount: string, toValue?: any | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'GraduatedPercentageRange', flatAmount: string, fromValue: any, rate: string, toValue?: any | null }> | null, volumeRanges?: Array<{ __typename?: 'VolumeRange', flatAmount: string, fromValue: any, perUnitAmount: string, toValue?: any | null }> | null } | null, filters?: Array<{ __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any, properties: { __typename?: 'Properties', amount?: string | null, packageSize?: any | null, freeUnits?: any | null, pricingGroupKeys?: Array | null, fixedAmount?: string | null, freeUnitsPerEvents?: any | null, freeUnitsPerTotalAggregation?: string | null, rate?: string | null, perTransactionMinAmount?: string | null, perTransactionMaxAmount?: string | null, customProperties?: any | null, graduatedRanges?: Array<{ __typename?: 'GraduatedRange', flatAmount: string, fromValue: any, perUnitAmount: string, toValue?: any | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'GraduatedPercentageRange', flatAmount: string, fromValue: any, rate: string, toValue?: any | null }> | null, volumeRanges?: Array<{ __typename?: 'VolumeRange', flatAmount: string, fromValue: any, perUnitAmount: string, toValue?: any | null }> | null } }> | null, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean, filters?: Array<{ __typename?: 'BillableMetricFilter', key: string, values: Array }> | null }, taxes?: Array<{ __typename?: 'Tax', id: string, code: string, name: string, rate: number }> | null }; + +export type PlanForUsageChargeAccordionFragment = { __typename?: 'Plan', billChargesMonthly?: boolean | null }; + +export type BillableMetricForUsageChargeSectionFragment = { __typename?: 'BillableMetric', id: string, name: string, code: string, aggregationType: AggregationTypeEnum, recurring: boolean, filters?: Array<{ __typename?: 'BillableMetricFilter', id: string, key: string, values: Array }> | null }; + +export type GetMeteredBillableMetricsQueryVariables = Exact<{ + page?: InputMaybe; + limit?: InputMaybe; + searchTerm?: InputMaybe; +}>; + + +export type GetMeteredBillableMetricsQuery = { __typename?: 'Query', billableMetrics: { __typename?: 'BillableMetricCollection', collection: Array<{ __typename?: 'BillableMetric', id: string, name: string, code: string, aggregationType: AggregationTypeEnum, recurring: boolean, filters?: Array<{ __typename?: 'BillableMetricFilter', id: string, key: string, values: Array }> | null }> } }; + +export type GetRecurringBillableMetricsQueryVariables = Exact<{ + page?: InputMaybe; + limit?: InputMaybe; + searchTerm?: InputMaybe; +}>; + + +export type GetRecurringBillableMetricsQuery = { __typename?: 'Query', billableMetrics: { __typename?: 'BillableMetricCollection', collection: Array<{ __typename?: 'BillableMetric', id: string, name: string, code: string, aggregationType: AggregationTypeEnum, recurring: boolean, filters?: Array<{ __typename?: 'BillableMetricFilter', id: string, key: string, values: Array }> | null }> } }; + export type VolumeRangesFragment = { __typename?: 'Properties', volumeRanges?: Array<{ __typename?: 'VolumeRange', flatAmount: string, fromValue: any, perUnitAmount: string, toValue?: any | null }> | null }; +export type ChargeForChargeOptionsAccordionFragment = { __typename?: 'Charge', id: string, invoiceable: boolean, minAmountCents: any, payInAdvance: boolean, regroupPaidFees?: RegroupPaidFeesEnum | null }; + export type PlanDetailsActivityLogsQueryVariables = Exact<{ page?: InputMaybe; limit?: InputMaybe; @@ -10912,6 +10947,17 @@ export type DeleteTaxMutationVariables = Exact<{ export type DeleteTaxMutation = { __typename?: 'Mutation', destroyTax?: { __typename?: 'DestroyTaxPayload', id?: string | null } | null }; +export type TaxForTaxesSelectorSectionFragment = { __typename?: 'Tax', id: string, code: string, name: string, rate: number }; + +export type GetTaxesForTaxesSelectorSectionQueryVariables = Exact<{ + limit?: InputMaybe; + page?: InputMaybe; + searchTerm?: InputMaybe; +}>; + + +export type GetTaxesForTaxesSelectorSectionQuery = { __typename?: 'Query', taxes: { __typename?: 'TaxCollection', metadata: { __typename?: 'CollectionMetadata', currentPage: number, totalPages: number }, collection: Array<{ __typename?: 'Tax', id: string, code: string, name: string, rate: number }> } }; + export type CustomerWalletFragment = { __typename?: 'Wallet', id: string, expirationAt?: any | null, name?: string | null, rateAmount: number, invoiceRequiresSuccessfulPayment: boolean, balanceCents: any, consumedAmountCents: any, consumedCredits: number, createdAt: any, creditsBalance: number, currency: CurrencyEnum, lastBalanceSyncAt?: any | null, lastConsumedCreditAt?: any | null, lastOngoingBalanceSyncAt?: any | null, status: WalletStatusEnum, terminatedAt?: any | null, ongoingBalanceCents: any, creditsOngoingBalance: number, ongoingUsageBalanceCents: any, creditsOngoingUsageBalance: number, appliesTo?: { __typename?: 'WalletAppliesTo', feeTypes?: Array | null, billableMetrics?: Array<{ __typename?: 'BillableMetric', id: string, name: string, code: string }> | null } | null, recurringTransactionRules?: Array<{ __typename?: 'RecurringTransactionRule', expirationAt?: any | null, grantedCredits: string, interval?: RecurringTransactionIntervalEnum | null, invoiceRequiresSuccessfulPayment: boolean, lagoId: string, method: RecurringTransactionMethodEnum, paidCredits: string, startedAt?: any | null, targetOngoingBalance?: string | null, thresholdCredits?: string | null, transactionName?: string | null, trigger: RecurringTransactionTriggerEnum, transactionMetadata?: Array<{ __typename?: 'TransactionMetadata', key: string, value: string }> | null }> | null }; export type GetCustomerWalletListQueryVariables = Exact<{ @@ -11042,16 +11088,14 @@ export type CreateCreditNoteMutationVariables = Exact<{ export type CreateCreditNoteMutation = { __typename?: 'Mutation', createCreditNote?: { __typename?: 'CreditNote', id: string } | null }; -export type TaxOnAddOnEditCreateFragment = { __typename?: 'Tax', id: string, name: string, code: string, rate: number }; - -export type EditAddOnFragment = { __typename?: 'AddOn', id: string, name: string, code: string, description?: string | null, amountCents: any, amountCurrency: CurrencyEnum, taxes?: Array<{ __typename?: 'Tax', id: string, name: string, code: string, rate: number }> | null }; +export type EditAddOnFragment = { __typename?: 'AddOn', id: string, name: string, code: string, description?: string | null, amountCents: any, amountCurrency: CurrencyEnum, taxes?: Array<{ __typename?: 'Tax', id: string, code: string, name: string, rate: number }> | null }; export type GetSingleAddOnQueryVariables = Exact<{ id: Scalars['ID']['input']; }>; -export type GetSingleAddOnQuery = { __typename?: 'Query', addOn?: { __typename?: 'AddOn', id: string, name: string, code: string, description?: string | null, amountCents: any, amountCurrency: CurrencyEnum, taxes?: Array<{ __typename?: 'Tax', id: string, name: string, code: string, rate: number }> | null } | null }; +export type GetSingleAddOnQuery = { __typename?: 'Query', addOn?: { __typename?: 'AddOn', id: string, name: string, code: string, description?: string | null, amountCents: any, amountCurrency: CurrencyEnum, taxes?: Array<{ __typename?: 'Tax', id: string, code: string, name: string, rate: number }> | null } | null }; export type CreateAddOnMutationVariables = Exact<{ input: CreateAddOnInput; @@ -11378,27 +11422,18 @@ export type CouponsQueryVariables = Exact<{ export type CouponsQuery = { __typename?: 'Query', coupons: { __typename?: 'CouponCollection', metadata: { __typename?: 'CollectionMetadata', currentPage: number, totalPages: number }, collection: Array<{ __typename?: 'Coupon', id: string, name: string, customersCount: number, status: CouponStatusEnum, amountCurrency?: CurrencyEnum | null, amountCents?: any | null, expiration: CouponExpiration, expirationAt?: any | null, couponType: CouponTypeEnum, percentageRate?: number | null, frequency: CouponFrequency, frequencyDuration?: number | null, appliedCouponsCount: number }> } }; -export type GetTaxesForAddOnFormQueryVariables = Exact<{ - limit?: InputMaybe; - page?: InputMaybe; - searchTerm?: InputMaybe; -}>; - - -export type GetTaxesForAddOnFormQuery = { __typename?: 'Query', taxes: { __typename?: 'TaxCollection', metadata: { __typename?: 'CollectionMetadata', currentPage: number, totalPages: number }, collection: Array<{ __typename?: 'Tax', id: string, name: string, rate: number, code: string }> } }; - export type EditBillableMetricFragment = { __typename?: 'BillableMetric', id: string, name: string, code: string, expression?: string | null, description?: string | null, aggregationType: AggregationTypeEnum, fieldName?: string | null, hasSubscriptions: boolean, hasPlans: boolean, recurring: boolean, roundingFunction?: RoundingFunctionEnum | null, roundingPrecision?: number | null, filters?: Array<{ __typename?: 'BillableMetricFilter', key: string, values: Array }> | null }; export type CreateCreditNoteInvoiceFragment = { __typename?: 'Invoice', id: string, currency?: CurrencyEnum | null, number: string, status: InvoiceStatusTypeEnum, paymentStatus: InvoicePaymentStatusTypeEnum, creditableAmountCents: any, refundableAmountCents: any, subTotalIncludingTaxesAmountCents: any, availableToCreditAmountCents: any, totalPaidAmountCents: any, totalAmountCents: any, paymentDisputeLostAt?: any | null, invoiceType: InvoiceTypeEnum, couponsAmountCents: any, feesAmountCents: any, versionNumber: number, fees?: Array<{ __typename?: 'Fee', id: string, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxName: string, taxRate: number }> | null }> | null }; export type TaxInfosForCreateInvoiceFragment = { __typename?: 'Tax', id: string, name: string, code: string, rate: number }; -export type GetInvoiceFeesQueryVariables = Exact<{ +export type GetInvoiceFeesForCreateInvoiceQueryVariables = Exact<{ id: Scalars['ID']['input']; }>; -export type GetInvoiceFeesQuery = { __typename?: 'Query', invoice?: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, itemName: string, description?: string | null, groupedBy: any, units: number, preciseUnitAmount: number, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxCode: string, tax?: { __typename?: 'Tax', id: string, name: string, rate: number, code: string } | null }> | null, addOn?: { __typename?: 'AddOn', id: string, taxes?: Array<{ __typename?: 'Tax', id: string, name: string, rate: number, code: string }> | null } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, billableMetric: { __typename?: 'BillableMetric', id: string, name: string } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null }> | null } | null }; +export type GetInvoiceFeesForCreateInvoiceQuery = { __typename?: 'Query', invoice?: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, itemName: string, description?: string | null, groupedBy: any, units: number, preciseUnitAmount: number, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxCode: string, tax?: { __typename?: 'Tax', id: string, name: string, rate: number, code: string } | null }> | null, addOn?: { __typename?: 'AddOn', id: string, taxes?: Array<{ __typename?: 'Tax', id: string, name: string, rate: number, code: string }> | null } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, billableMetric: { __typename?: 'BillableMetric', id: string, name: string } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null }> | null } | null }; export type GetInfosForCreateInvoiceQueryVariables = Exact<{ id: Scalars['ID']['input']; @@ -11542,7 +11577,7 @@ export type GetCustomerInfosForDraftInvoicesListQueryVariables = Exact<{ export type GetCustomerInfosForDraftInvoicesListQuery = { __typename?: 'Query', customer?: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, applicableTimezone: TimezoneEnum } | null, customerInvoices: { __typename?: 'InvoiceCollection', metadata: { __typename?: 'CollectionMetadata', totalCount: number } } }; -export type AllInvoiceDetailsForCustomerInvoiceDetailsFragment = { __typename?: 'Invoice', id: string, invoiceType: InvoiceTypeEnum, number: string, paymentStatus: InvoicePaymentStatusTypeEnum, status: InvoiceStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, totalAmountCents: any, currency?: CurrencyEnum | null, refundableAmountCents: any, creditableAmountCents: any, voidable: boolean, paymentDisputeLostAt?: any | null, integrationSyncable: boolean, externalIntegrationId?: string | null, taxProviderVoidable: boolean, integrationHubspotSyncable: boolean, associatedActiveWalletPresent: boolean, voidedAt?: any | null, voidedInvoiceId?: string | null, regeneratedInvoiceId?: string | null, issuingDate: any, taxProviderId?: string | null, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, totalPaidAmountCents: any, couponsAmountCents: any, creditNotesAmountCents: any, totalDueAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, applicableTimezone: TimezoneEnum, deletedAt?: any | null, accountType: CustomerAccountTypeEnum }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, addOn?: { __typename?: 'AddOn', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null, billingEntity: { __typename?: 'BillingEntity', name: string, code: string }, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, invoiceSubscriptions?: Array<{ __typename?: 'InvoiceSubscription', fromDatetime?: any | null, toDatetime?: any | null, chargesFromDatetime?: any | null, chargesToDatetime?: any | null, inAdvanceChargesFromDatetime?: any | null, inAdvanceChargesToDatetime?: any | null, acceptNewChargeFees: boolean, subscriptionAmountCents: any, invoice: { __typename?: 'Invoice', chargeAmountCents: any, progressiveBillingCreditAmountCents: any, id: string, status: InvoiceStatusTypeEnum }, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | null, billChargesMonthly?: boolean | null } }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null, interval: PlanInterval } } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null }; +export type AllInvoiceDetailsForCustomerInvoiceDetailsFragment = { __typename?: 'Invoice', id: string, invoiceType: InvoiceTypeEnum, number: string, paymentStatus: InvoicePaymentStatusTypeEnum, status: InvoiceStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, totalAmountCents: any, currency?: CurrencyEnum | null, refundableAmountCents: any, creditableAmountCents: any, voidable: boolean, paymentDisputeLostAt?: any | null, integrationSyncable: boolean, externalIntegrationId?: string | null, taxProviderVoidable: boolean, integrationHubspotSyncable: boolean, associatedActiveWalletPresent: boolean, voidedAt?: any | null, voidedInvoiceId?: string | null, regeneratedInvoiceId?: string | null, issuingDate: any, taxProviderId?: string | null, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, totalPaidAmountCents: any, couponsAmountCents: any, creditNotesAmountCents: any, totalDueAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, applicableTimezone: TimezoneEnum, deletedAt?: any | null, accountType: CustomerAccountTypeEnum }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, addOn?: { __typename?: 'AddOn', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, billableMetric: { __typename?: 'BillableMetric', id: string, name: string } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null }> | null, billingEntity: { __typename?: 'BillingEntity', name: string, code: string }, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null }; export type CustomerForInvoiceDetailsFragment = { __typename?: 'Customer', id: string, name?: string | null, paymentProvider?: ProviderTypeEnum | null, avalaraCustomer?: { __typename?: 'AvalaraCustomer', id: string, integrationId?: string | null } | null, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null } | null }; @@ -11551,7 +11586,21 @@ export type GetInvoiceDetailsQueryVariables = Exact<{ }>; -export type GetInvoiceDetailsQuery = { __typename?: 'Query', invoice?: { __typename?: 'Invoice', id: string, invoiceType: InvoiceTypeEnum, number: string, paymentStatus: InvoicePaymentStatusTypeEnum, status: InvoiceStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, totalAmountCents: any, currency?: CurrencyEnum | null, refundableAmountCents: any, creditableAmountCents: any, voidable: boolean, paymentDisputeLostAt?: any | null, integrationSyncable: boolean, externalIntegrationId?: string | null, taxProviderVoidable: boolean, integrationHubspotSyncable: boolean, associatedActiveWalletPresent: boolean, voidedAt?: any | null, voidedInvoiceId?: string | null, regeneratedInvoiceId?: string | null, issuingDate: any, taxProviderId?: string | null, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, totalPaidAmountCents: any, couponsAmountCents: any, creditNotesAmountCents: any, totalDueAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, applicableTimezone: TimezoneEnum, deletedAt?: any | null, accountType: CustomerAccountTypeEnum }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, addOn?: { __typename?: 'AddOn', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null, billingEntity: { __typename?: 'BillingEntity', name: string, code: string }, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, invoiceSubscriptions?: Array<{ __typename?: 'InvoiceSubscription', fromDatetime?: any | null, toDatetime?: any | null, chargesFromDatetime?: any | null, chargesToDatetime?: any | null, inAdvanceChargesFromDatetime?: any | null, inAdvanceChargesToDatetime?: any | null, acceptNewChargeFees: boolean, subscriptionAmountCents: any, invoice: { __typename?: 'Invoice', chargeAmountCents: any, progressiveBillingCreditAmountCents: any, id: string, status: InvoiceStatusTypeEnum }, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | null, billChargesMonthly?: boolean | null } }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null, interval: PlanInterval } } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; +export type GetInvoiceDetailsQuery = { __typename?: 'Query', invoice?: { __typename?: 'Invoice', id: string, invoiceType: InvoiceTypeEnum, number: string, paymentStatus: InvoicePaymentStatusTypeEnum, status: InvoiceStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, totalAmountCents: any, currency?: CurrencyEnum | null, refundableAmountCents: any, creditableAmountCents: any, voidable: boolean, paymentDisputeLostAt?: any | null, integrationSyncable: boolean, externalIntegrationId?: string | null, taxProviderVoidable: boolean, integrationHubspotSyncable: boolean, associatedActiveWalletPresent: boolean, voidedAt?: any | null, voidedInvoiceId?: string | null, regeneratedInvoiceId?: string | null, issuingDate: any, taxProviderId?: string | null, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, totalPaidAmountCents: any, couponsAmountCents: any, creditNotesAmountCents: any, totalDueAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, applicableTimezone: TimezoneEnum, deletedAt?: any | null, accountType: CustomerAccountTypeEnum }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, addOn?: { __typename?: 'AddOn', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, billableMetric: { __typename?: 'BillableMetric', id: string, name: string } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null }> | null, billingEntity: { __typename?: 'BillingEntity', name: string, code: string }, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; + +export type GetInvoiceFeesQueryVariables = Exact<{ + id: Scalars['ID']['input']; +}>; + + +export type GetInvoiceFeesQuery = { __typename?: 'Query', invoice?: { __typename?: 'Invoice', id: string, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, description?: string | null, feeType: FeeTypesEnum, invoiceDisplayName?: string | null, invoiceName?: string | null, itemName: string, units: number, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, minAmountCents: any, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, walletTransaction?: { __typename?: 'WalletTransaction', id: string, name?: string | null, wallet?: { __typename?: 'Wallet', id: string, name?: string | null } | null } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxCode: string, taxRate: number }> | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null } | null }; + +export type GetInvoiceSubscriptionsQueryVariables = Exact<{ + id: Scalars['ID']['input']; +}>; + + +export type GetInvoiceSubscriptionsQuery = { __typename?: 'Query', invoice?: { __typename?: 'Invoice', id: string, invoiceSubscriptions?: Array<{ __typename?: 'InvoiceSubscription', fromDatetime?: any | null, toDatetime?: any | null, chargesFromDatetime?: any | null, chargesToDatetime?: any | null, inAdvanceChargesFromDatetime?: any | null, inAdvanceChargesToDatetime?: any | null, acceptNewChargeFees: boolean, subscriptionAmountCents: any, invoice: { __typename?: 'Invoice', chargeAmountCents: any, progressiveBillingCreditAmountCents: any, id: string, status: InvoiceStatusTypeEnum }, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | null, billChargesMonthly?: boolean | null } }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null, interval: PlanInterval } } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, minAmountCents: any, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, walletTransaction?: { __typename?: 'WalletTransaction', id: string, name?: string | null, wallet?: { __typename?: 'Wallet', id: string, name?: string | null } | null } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxCode: string, taxRate: number }> | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null }> | null } | null }; export type GetInvoiceCustomerQueryVariables = Exact<{ id: Scalars['ID']['input']; @@ -11593,7 +11642,7 @@ export type RefreshInvoiceMutationVariables = Exact<{ }>; -export type RefreshInvoiceMutation = { __typename?: 'Mutation', refreshInvoice?: { __typename?: 'Invoice', id: string, invoiceType: InvoiceTypeEnum, number: string, paymentStatus: InvoicePaymentStatusTypeEnum, status: InvoiceStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, totalAmountCents: any, currency?: CurrencyEnum | null, refundableAmountCents: any, creditableAmountCents: any, voidable: boolean, paymentDisputeLostAt?: any | null, integrationSyncable: boolean, externalIntegrationId?: string | null, taxProviderVoidable: boolean, integrationHubspotSyncable: boolean, associatedActiveWalletPresent: boolean, voidedAt?: any | null, voidedInvoiceId?: string | null, regeneratedInvoiceId?: string | null, issuingDate: any, taxProviderId?: string | null, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, totalPaidAmountCents: any, couponsAmountCents: any, creditNotesAmountCents: any, totalDueAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, applicableTimezone: TimezoneEnum, deletedAt?: any | null, accountType: CustomerAccountTypeEnum }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, addOn?: { __typename?: 'AddOn', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null, billingEntity: { __typename?: 'BillingEntity', name: string, code: string }, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, invoiceSubscriptions?: Array<{ __typename?: 'InvoiceSubscription', fromDatetime?: any | null, toDatetime?: any | null, chargesFromDatetime?: any | null, chargesToDatetime?: any | null, inAdvanceChargesFromDatetime?: any | null, inAdvanceChargesToDatetime?: any | null, acceptNewChargeFees: boolean, subscriptionAmountCents: any, invoice: { __typename?: 'Invoice', chargeAmountCents: any, progressiveBillingCreditAmountCents: any, id: string, status: InvoiceStatusTypeEnum }, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | null, billChargesMonthly?: boolean | null } }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, description?: string | null, feeType: FeeTypesEnum, itemName: string, preciseUnitAmount: number, eventsCount?: any | null, adjustedFee: boolean, adjustedFeeType?: AdjustedFeeTypeEnum | null, succeededAt?: any | null, currency: CurrencyEnum, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null, interval: PlanInterval } } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum, recurring: boolean } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, properties?: { __typename?: 'FeeProperties', fromDatetime?: any | null, toDatetime?: any | null } | null, pricingUnitUsage?: { __typename?: 'PricingUnitUsage', amountCents: any, conversionRate: number, shortName: string, preciseUnitAmount: number } | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, amountDetails?: { __typename?: 'FeeAmountDetails', freeUnits?: string | null, fixedFeeUnitAmount?: string | null, flatUnitAmount?: string | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, paidUnits?: string | null, perPackageSize?: number | null, perPackageUnitAmount?: string | null, fixedFeeTotalAmount?: string | null, freeEvents?: number | null, minMaxAdjustmentTotalAmount?: string | null, paidEvents?: number | null, rate?: string | null, units?: string | null, graduatedRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitAmount?: string | null, perUnitTotalAmount?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null, graduatedPercentageRanges?: Array<{ __typename?: 'FeeAmountDetailsGraduatedPercentageRange', toValue?: any | null, flatUnitAmount?: string | null, fromValue?: any | null, perUnitTotalAmount?: string | null, rate?: string | null, totalWithFlatAmount?: string | null, units?: string | null }> | null } | null }> | null }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; +export type RefreshInvoiceMutation = { __typename?: 'Mutation', refreshInvoice?: { __typename?: 'Invoice', id: string, invoiceType: InvoiceTypeEnum, number: string, paymentStatus: InvoicePaymentStatusTypeEnum, status: InvoiceStatusTypeEnum, taxStatus?: InvoiceTaxStatusTypeEnum | null, totalAmountCents: any, currency?: CurrencyEnum | null, refundableAmountCents: any, creditableAmountCents: any, voidable: boolean, paymentDisputeLostAt?: any | null, integrationSyncable: boolean, externalIntegrationId?: string | null, taxProviderVoidable: boolean, integrationHubspotSyncable: boolean, associatedActiveWalletPresent: boolean, voidedAt?: any | null, voidedInvoiceId?: string | null, regeneratedInvoiceId?: string | null, issuingDate: any, taxProviderId?: string | null, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, totalPaidAmountCents: any, couponsAmountCents: any, creditNotesAmountCents: any, totalDueAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', id: string, name?: string | null, displayName: string, legalNumber?: string | null, legalName?: string | null, taxIdentificationNumber?: string | null, email?: string | null, addressLine1?: string | null, addressLine2?: string | null, state?: string | null, country?: CountryCode | null, city?: string | null, zipcode?: string | null, applicableTimezone: TimezoneEnum, deletedAt?: any | null, accountType: CustomerAccountTypeEnum }, fees?: Array<{ __typename?: 'Fee', id: string, amountCents: any, invoiceName?: string | null, invoiceDisplayName?: string | null, units: number, groupedBy: any, addOn?: { __typename?: 'AddOn', id: string } | null, charge?: { __typename?: 'Charge', id: string, payInAdvance: boolean, minAmountCents: any, billableMetric: { __typename?: 'BillableMetric', id: string, name: string } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null, subscription?: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, interval: PlanInterval, name: string } } | null }> | null, billingEntity: { __typename?: 'BillingEntity', name: string, code: string }, creditNotes?: Array<{ __typename?: 'CreditNote', id: string, couponsAdjustmentAmountCents: any, number: string, subTotalExcludingTaxesAmountCents: any, currency: CurrencyEnum, totalAmountCents: any, appliedTaxes?: Array<{ __typename?: 'CreditNoteAppliedTax', id: string, amountCents: any, baseAmountCents: any, taxRate: number, taxName: string }> | null, items: Array<{ __typename?: 'CreditNoteItem', amountCents: any, amountCurrency: CurrencyEnum, fee: { __typename?: 'Fee', id: string, amountCents: any, eventsCount?: any | null, units: number, feeType: FeeTypesEnum, groupedBy: any, itemName: string, invoiceName?: string | null, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | null, charge?: { __typename?: 'Charge', id: string, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, aggregationType: AggregationTypeEnum } } | null, subscription?: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, invoiceDisplayName?: string | null } } | null, chargeFilter?: { __typename?: 'ChargeFilter', invoiceDisplayName?: string | null, values: any } | null } }> }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, taxCode: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; export type SyncIntegrationInvoiceMutationVariables = Exact<{ input: SyncIntegrationInvoiceInput; @@ -11630,6 +11679,8 @@ export type RetryTaxProviderVoidingMutationVariables = Exact<{ export type RetryTaxProviderVoidingMutation = { __typename?: 'Mutation', retryTaxProviderVoiding?: { __typename?: 'Invoice', id: string } | null }; +export type FeeForCustomerInvoiceRegenerateFragment = { __typename?: 'Fee', id: string, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxCode: string }> | null }; + export type RegenerateInvoiceMutationVariables = Exact<{ input: RegenerateInvoiceInput; }>; @@ -13597,142 +13648,498 @@ export const InvoiceSubscriptionForCreateFeeDrawerFragmentDoc = gql` } } `; -export const BillableMetricForChargeSectionFragmentDoc = gql` - fragment BillableMetricForChargeSection on BillableMetric { +export const FeeForCustomerInvoiceRegenerateFragmentDoc = gql` + fragment FeeForCustomerInvoiceRegenerate on Fee { id - name - code - aggregationType - recurring - filters { + appliedTaxes { id - key - values + taxCode } } `; -export const FeatureObjectEntitlementPrivilegeForPlanFragmentDoc = gql` - fragment FeatureObjectEntitlementPrivilegeForPlan on FeatureObject { +export const FeeForInvoiceDetailsTableBodyLineGraduatedFragmentDoc = gql` + fragment FeeForInvoiceDetailsTableBodyLineGraduated on Fee { id - code - name - privileges { + appliedTaxes { id - name - code - valueType - config { - selectOptions + taxRate + } + amountDetails { + graduatedRanges { + flatUnitAmount + fromValue + perUnitAmount + perUnitTotalAmount + toValue + totalWithFlatAmount + units } } + pricingUnitUsage { + shortName + } } `; -export const DeleteOktaIntegrationDialogFragmentDoc = gql` - fragment DeleteOktaIntegrationDialog on OktaIntegration { +export const FeeForInvoiceDetailsTableBodyLineGraduatedPercentageFragmentDoc = gql` + fragment FeeForInvoiceDetailsTableBodyLineGraduatedPercentage on Fee { id - name + appliedTaxes { + id + taxRate + } + amountDetails { + graduatedPercentageRanges { + flatUnitAmount + fromValue + perUnitTotalAmount + rate + toValue + totalWithFlatAmount + units + } + } + pricingUnitUsage { + shortName + } } `; -export const AddOktaIntegrationDialogFragmentDoc = gql` - fragment AddOktaIntegrationDialog on OktaIntegration { +export const FeeForInvoiceDetailsTableBodyLineVolumeFragmentDoc = gql` + fragment FeeForInvoiceDetailsTableBodyLineVolume on Fee { id - domain - clientId - clientSecret - organizationName - ...DeleteOktaIntegrationDialog + units + appliedTaxes { + id + taxRate + } + amountDetails { + flatUnitAmount + perUnitAmount + perUnitTotalAmount + } + pricingUnitUsage { + shortName + } } - ${DeleteOktaIntegrationDialogFragmentDoc}`; -export const DeleteCampaignFragmentDoc = gql` - fragment DeleteCampaign on DunningCampaign { + `; +export const FeeForInvoiceDetailsTableBodyLinePackageFragmentDoc = gql` + fragment FeeForInvoiceDetailsTableBodyLinePackage on Fee { id - appliedToOrganization + units + amountCents + appliedTaxes { + id + taxRate + } + amountDetails { + freeUnits + paidUnits + perPackageSize + perPackageUnitAmount + } + pricingUnitUsage { + amountCents + shortName + } } `; -export const OrganizationInfoForPreviewDunningCampaignFragmentDoc = gql` - fragment OrganizationInfoForPreviewDunningCampaign on CurrentOrganization { - name - email - logoUrl +export const FeeForInvoiceDetailsTableBodyLinePercentageFragmentDoc = gql` + fragment FeeForInvoiceDetailsTableBodyLinePercentage on Fee { + id + units + amountCents + appliedTaxes { + id + taxRate + } + amountDetails { + fixedFeeTotalAmount + fixedFeeUnitAmount + freeEvents + freeUnits + minMaxAdjustmentTotalAmount + paidEvents + paidUnits + perUnitTotalAmount + rate + units + } + pricingUnitUsage { + shortName + } } `; -export const AddAdyenProviderDialogFragmentDoc = gql` - fragment AddAdyenProviderDialog on AdyenProvider { +export const FeeForEditfeeDrawerFragmentDoc = gql` + fragment FeeForEditfeeDrawer on Fee { id - name - code - apiKey - hmacKey - livePrefix - merchantAccount + currency + charge { + id + chargeModel + prorated + } } `; -export const AddCashfreeProviderDialogFragmentDoc = gql` - fragment AddCashfreeProviderDialog on CashfreeProvider { +export const FeeForDeleteAdjustmentFeeDialogFragmentDoc = gql` + fragment FeeForDeleteAdjustmentFeeDialog on Fee { id - name - code - clientId - clientSecret - successRedirectUrl } `; -export const AdyenForCreateAndEditSuccessRedirectUrlFragmentDoc = gql` - fragment AdyenForCreateAndEditSuccessRedirectUrl on AdyenProvider { +export const FeeForInvoiceDetailsTableBodyLineFragmentDoc = gql` + fragment FeeForInvoiceDetailsTableBodyLine on Fee { id - successRedirectUrl + units + preciseUnitAmount + amountCents + eventsCount + adjustedFee + adjustedFeeType + succeededAt + properties { + fromDatetime + toDatetime + } + pricingUnitUsage { + amountCents + conversionRate + shortName + preciseUnitAmount + } + charge { + id + chargeModel + minAmountCents + payInAdvance + prorated + billableMetric { + id + recurring + } + } + appliedTaxes { + id + taxRate + } + amountDetails { + freeUnits + fixedFeeUnitAmount + flatUnitAmount + graduatedRanges { + toValue + } + graduatedPercentageRanges { + toValue + } + } + ...FeeForInvoiceDetailsTableBodyLineGraduated + ...FeeForInvoiceDetailsTableBodyLineGraduatedPercentage + ...FeeForInvoiceDetailsTableBodyLineVolume + ...FeeForInvoiceDetailsTableBodyLinePackage + ...FeeForInvoiceDetailsTableBodyLinePercentage + ...FeeForEditfeeDrawer + ...FeeForDeleteAdjustmentFeeDialog } - `; -export const CashfreeForCreateAndEditSuccessRedirectUrlFragmentDoc = gql` - fragment CashfreeForCreateAndEditSuccessRedirectUrl on CashfreeProvider { + ${FeeForInvoiceDetailsTableBodyLineGraduatedFragmentDoc} +${FeeForInvoiceDetailsTableBodyLineGraduatedPercentageFragmentDoc} +${FeeForInvoiceDetailsTableBodyLineVolumeFragmentDoc} +${FeeForInvoiceDetailsTableBodyLinePackageFragmentDoc} +${FeeForInvoiceDetailsTableBodyLinePercentageFragmentDoc} +${FeeForEditfeeDrawerFragmentDoc} +${FeeForDeleteAdjustmentFeeDialogFragmentDoc}`; +export const FeeForInvoiceFeeArrearsDetailsTableFragmentDoc = gql` + fragment FeeForInvoiceFeeArrearsDetailsTable on Fee { id - successRedirectUrl + ...FeeForInvoiceDetailsTableBodyLine + ...FeeForDeleteAdjustmentFeeDialog + ...FeeForEditfeeDrawer } - `; -export const FlutterwaveForCreateAndEditSuccessRedirectUrlFragmentDoc = gql` - fragment FlutterwaveForCreateAndEditSuccessRedirectUrl on FlutterwaveProvider { + ${FeeForInvoiceDetailsTableBodyLineFragmentDoc} +${FeeForDeleteAdjustmentFeeDialogFragmentDoc} +${FeeForEditfeeDrawerFragmentDoc}`; +export const FeeForInvoiceFeeAdvanceDetailsTableFragmentDoc = gql` + fragment FeeForInvoiceFeeAdvanceDetailsTable on Fee { id - successRedirectUrl + ...FeeForInvoiceDetailsTableBodyLine + ...FeeForDeleteAdjustmentFeeDialog + ...FeeForEditfeeDrawer } - `; -export const GocardlessForCreateAndEditSuccessRedirectUrlFragmentDoc = gql` - fragment gocardlessForCreateAndEditSuccessRedirectUrl on GocardlessProvider { + ${FeeForInvoiceDetailsTableBodyLineFragmentDoc} +${FeeForDeleteAdjustmentFeeDialogFragmentDoc} +${FeeForEditfeeDrawerFragmentDoc}`; +export const FeeForInvoiceDetailsTableFragmentDoc = gql` + fragment FeeForInvoiceDetailsTable on Fee { id - successRedirectUrl + amountCents + description + feeType + invoiceDisplayName + invoiceName + itemName + units + preciseUnitAmount + charge { + id + payInAdvance + invoiceDisplayName + billableMetric { + id + name + aggregationType + } + } + chargeFilter { + invoiceDisplayName + values + } + walletTransaction { + id + name + wallet { + id + name + } + } + ...FeeForCustomerInvoiceRegenerate + ...FeeForInvoiceDetailsTableBodyLine + ...FeeForInvoiceFeeArrearsDetailsTable + ...FeeForInvoiceFeeAdvanceDetailsTable } - `; -export const StripeForCreateAndEditSuccessRedirectUrlFragmentDoc = gql` - fragment StripeForCreateAndEditSuccessRedirectUrl on StripeProvider { - id - successRedirectUrl + ${FeeForCustomerInvoiceRegenerateFragmentDoc} +${FeeForInvoiceDetailsTableBodyLineFragmentDoc} +${FeeForInvoiceFeeArrearsDetailsTableFragmentDoc} +${FeeForInvoiceFeeAdvanceDetailsTableFragmentDoc}`; +export const InvoiceSubscriptionFormatingFragmentDoc = gql` + fragment InvoiceSubscriptionFormating on InvoiceSubscription { + fromDatetime + toDatetime + chargesFromDatetime + chargesToDatetime + inAdvanceChargesFromDatetime + inAdvanceChargesToDatetime + fees { + id + amountCents + invoiceName + invoiceDisplayName + units + groupedBy + charge { + id + payInAdvance + minAmountCents + billableMetric { + id + name + } + } + chargeFilter { + invoiceDisplayName + values + } + subscription { + id + plan { + id + interval + } + } + } + subscription { + id + name + plan { + id + name + invoiceDisplayName + } + } + invoice { + id + status + chargeAmountCents + progressiveBillingCreditAmountCents + } } `; -export const MoneyhashForCreateAndEditSuccessRedirectUrlFragmentDoc = gql` - fragment MoneyhashForCreateAndEditSuccessRedirectUrl on MoneyhashProvider { - id - flowId - successRedirectUrl +export const InvoiceSubscriptionForInvoiceDetailsTableFragmentDoc = gql` + fragment InvoiceSubscriptionForInvoiceDetailsTable on InvoiceSubscription { + fromDatetime + toDatetime + chargesFromDatetime + chargesToDatetime + inAdvanceChargesFromDatetime + inAdvanceChargesToDatetime + acceptNewChargeFees + subscriptionAmountCents + invoice { + chargeAmountCents + progressiveBillingCreditAmountCents + } + subscription { + id + name + plan { + id + name + interval + amountCents + amountCurrency + invoiceDisplayName + billChargesMonthly + } + } + fees { + id + subscription { + id + name + plan { + id + name + invoiceDisplayName + } + } + ...FeeForInvoiceDetailsTable + } + ...InvoiceSubscriptionFormating } - `; -export const AddFlutterwaveProviderDialogFragmentDoc = gql` - fragment AddFlutterwaveProviderDialog on FlutterwaveProvider { + ${FeeForInvoiceDetailsTableFragmentDoc} +${InvoiceSubscriptionFormatingFragmentDoc}`; +export const FeatureObjectEntitlementPrivilegeForPlanFragmentDoc = gql` + fragment FeatureObjectEntitlementPrivilegeForPlan on FeatureObject { id - name code - secretKey - webhookSecret - successRedirectUrl -} - `; -export const AddGocardlessProviderDialogFragmentDoc = gql` - fragment AddGocardlessProviderDialog on GocardlessProvider { - id name - code + privileges { + id + name + code + valueType + config { + selectOptions + } + } } `; -export const AddMoneyhashProviderDialogFragmentDoc = gql` - fragment AddMoneyhashProviderDialog on MoneyhashProvider { +export const BillableMetricForUsageChargeSectionFragmentDoc = gql` + fragment BillableMetricForUsageChargeSection on BillableMetric { + id + name + code + aggregationType + recurring + filters { + id + key + values + } +} + `; +export const DeleteOktaIntegrationDialogFragmentDoc = gql` + fragment DeleteOktaIntegrationDialog on OktaIntegration { + id + name +} + `; +export const AddOktaIntegrationDialogFragmentDoc = gql` + fragment AddOktaIntegrationDialog on OktaIntegration { + id + domain + clientId + clientSecret + organizationName + ...DeleteOktaIntegrationDialog +} + ${DeleteOktaIntegrationDialogFragmentDoc}`; +export const DeleteCampaignFragmentDoc = gql` + fragment DeleteCampaign on DunningCampaign { + id + appliedToOrganization +} + `; +export const OrganizationInfoForPreviewDunningCampaignFragmentDoc = gql` + fragment OrganizationInfoForPreviewDunningCampaign on CurrentOrganization { + name + email + logoUrl +} + `; +export const AddAdyenProviderDialogFragmentDoc = gql` + fragment AddAdyenProviderDialog on AdyenProvider { + id + name + code + apiKey + hmacKey + livePrefix + merchantAccount +} + `; +export const AddCashfreeProviderDialogFragmentDoc = gql` + fragment AddCashfreeProviderDialog on CashfreeProvider { + id + name + code + clientId + clientSecret + successRedirectUrl +} + `; +export const AdyenForCreateAndEditSuccessRedirectUrlFragmentDoc = gql` + fragment AdyenForCreateAndEditSuccessRedirectUrl on AdyenProvider { + id + successRedirectUrl +} + `; +export const CashfreeForCreateAndEditSuccessRedirectUrlFragmentDoc = gql` + fragment CashfreeForCreateAndEditSuccessRedirectUrl on CashfreeProvider { + id + successRedirectUrl +} + `; +export const FlutterwaveForCreateAndEditSuccessRedirectUrlFragmentDoc = gql` + fragment FlutterwaveForCreateAndEditSuccessRedirectUrl on FlutterwaveProvider { + id + successRedirectUrl +} + `; +export const GocardlessForCreateAndEditSuccessRedirectUrlFragmentDoc = gql` + fragment gocardlessForCreateAndEditSuccessRedirectUrl on GocardlessProvider { + id + successRedirectUrl +} + `; +export const StripeForCreateAndEditSuccessRedirectUrlFragmentDoc = gql` + fragment StripeForCreateAndEditSuccessRedirectUrl on StripeProvider { + id + successRedirectUrl +} + `; +export const MoneyhashForCreateAndEditSuccessRedirectUrlFragmentDoc = gql` + fragment MoneyhashForCreateAndEditSuccessRedirectUrl on MoneyhashProvider { + id + flowId + successRedirectUrl +} + `; +export const AddFlutterwaveProviderDialogFragmentDoc = gql` + fragment AddFlutterwaveProviderDialog on FlutterwaveProvider { + id + name + code + secretKey + webhookSecret + successRedirectUrl +} + `; +export const AddGocardlessProviderDialogFragmentDoc = gql` + fragment AddGocardlessProviderDialog on GocardlessProvider { + id + name + code +} + `; +export const AddMoneyhashProviderDialogFragmentDoc = gql` + fragment AddMoneyhashProviderDialog on MoneyhashProvider { id name code @@ -14574,11 +14981,11 @@ export const InvoiceCreateCreditNoteFragmentDoc = gql` } ${InvoiceFeeFragmentDoc} ${CreateCreditNoteInvoiceFragmentDoc}`; -export const TaxOnAddOnEditCreateFragmentDoc = gql` - fragment TaxOnAddOnEditCreate on Tax { +export const TaxForTaxesSelectorSectionFragmentDoc = gql` + fragment TaxForTaxesSelectorSection on Tax { id - name code + name rate } `; @@ -14592,10 +14999,10 @@ export const EditAddOnFragmentDoc = gql` amountCurrency taxes { id - ...TaxOnAddOnEditCreate + ...TaxForTaxesSelectorSection } } - ${TaxOnAddOnEditCreateFragmentDoc}`; + ${TaxForTaxesSelectorSectionFragmentDoc}`; export const BillingEntityItemFragmentDoc = gql` fragment BillingEntityItem on BillingEntity { id @@ -15005,14 +15412,6 @@ export const DynamicChargeFragmentDoc = gql` pricingGroupKeys } `; -export const TaxForPlanChargeAccordionFragmentDoc = gql` - fragment TaxForPlanChargeAccordion on Tax { - id - code - name - rate -} - `; export const ChargeForChargeOptionsAccordionFragmentDoc = gql` fragment ChargeForChargeOptionsAccordion on Charge { id @@ -15022,8 +15421,8 @@ export const ChargeForChargeOptionsAccordionFragmentDoc = gql` regroupPaidFees } `; -export const ChargeAccordionFragmentDoc = gql` - fragment ChargeAccordion on Charge { +export const UsageChargeAccordionFragmentDoc = gql` + fragment UsageChargeAccordion on Charge { id chargeModel invoiceable @@ -15067,7 +15466,7 @@ export const ChargeAccordionFragmentDoc = gql` } } taxes { - ...TaxForPlanChargeAccordion + ...TaxForTaxesSelectorSection } ...ChargeForChargeOptionsAccordion } @@ -15079,10 +15478,10 @@ ${StandardChargeFragmentDoc} ${PercentageChargeFragmentDoc} ${CustomChargeFragmentDoc} ${DynamicChargeFragmentDoc} -${TaxForPlanChargeAccordionFragmentDoc} +${TaxForTaxesSelectorSectionFragmentDoc} ${ChargeForChargeOptionsAccordionFragmentDoc}`; -export const PlanForChargeAccordionFragmentDoc = gql` - fragment PlanForChargeAccordion on Plan { +export const PlanForUsageChargeAccordionFragmentDoc = gql` + fragment PlanForUsageChargeAccordion on Plan { billChargesMonthly } `; @@ -15107,8 +15506,8 @@ export const PlanForSettingsSectionFragmentDoc = gql` } } ${TaxForPlanSettingsSectionFragmentDoc}`; -export const PlanForFixedFeeSectionFragmentDoc = gql` - fragment PlanForFixedFeeSection on Plan { +export const PlanForSubscriptionFeeSectionFragmentDoc = gql` + fragment PlanForSubscriptionFeeSection on Plan { id amountCents payInAdvance @@ -15186,7 +15585,7 @@ export const EditPlanFragmentDoc = gql` code ...BillableMetricForPlan } - ...ChargeAccordion + ...UsageChargeAccordion chargeModel } usageThresholds { @@ -15195,17 +15594,17 @@ export const EditPlanFragmentDoc = gql` recurring thresholdDisplayName } - ...PlanForChargeAccordion + ...PlanForUsageChargeAccordion ...PlanForSettingsSection - ...PlanForFixedFeeSection + ...PlanForSubscriptionFeeSection ...FeatureEntitlementForPlan } ${TaxForPlanAndChargesInPlanFormFragmentDoc} ${BillableMetricForPlanFragmentDoc} -${ChargeAccordionFragmentDoc} -${PlanForChargeAccordionFragmentDoc} +${UsageChargeAccordionFragmentDoc} +${PlanForUsageChargeAccordionFragmentDoc} ${PlanForSettingsSectionFragmentDoc} -${PlanForFixedFeeSectionFragmentDoc} +${PlanForSubscriptionFeeSectionFragmentDoc} ${FeatureEntitlementForPlanFragmentDoc}`; export const CustomerForExternalAppsAccordionFragmentDoc = gql` fragment CustomerForExternalAppsAccordion on Customer { @@ -15439,361 +15838,13 @@ export const InvoiceDetailsForInvoiceOverviewFragmentDoc = gql` taxProviderVoidable integrationHubspotSyncable externalHubspotIntegrationId - integrationSalesforceSyncable - externalSalesforceIntegrationId - fees { - id - addOn { - id - } - amountCents - invoiceName - invoiceDisplayName - units - groupedBy - charge { - id - payInAdvance - minAmountCents - billableMetric { - id - name - } - } - chargeFilter { - invoiceDisplayName - values - } - subscription { - id - plan { - id - interval - name - } - } - } - billingEntity { - name - code - } -} - `; -export const InvoiceForCreditNotesTableFragmentDoc = gql` - fragment InvoiceForCreditNotesTable on Invoice { - id - customer { - id - } - creditNotes { - id - couponsAdjustmentAmountCents - number - subTotalExcludingTaxesAmountCents - currency - totalAmountCents - appliedTaxes { - id - amountCents - baseAmountCents - taxRate - taxName - } - items { - amountCents - amountCurrency - fee { - id - amountCents - eventsCount - units - feeType - groupedBy - itemName - invoiceName - appliedTaxes { - id - taxRate - } - trueUpParentFee { - id - } - charge { - id - billableMetric { - id - name - aggregationType - } - } - subscription { - id - name - plan { - id - name - invoiceDisplayName - } - } - chargeFilter { - invoiceDisplayName - values - } - } - } - } -} - `; -export const FeeForInvoiceDetailsTableBodyLineGraduatedFragmentDoc = gql` - fragment FeeForInvoiceDetailsTableBodyLineGraduated on Fee { - id - appliedTaxes { - id - taxRate - } - amountDetails { - graduatedRanges { - flatUnitAmount - fromValue - perUnitAmount - perUnitTotalAmount - toValue - totalWithFlatAmount - units - } - } - pricingUnitUsage { - shortName - } -} - `; -export const FeeForInvoiceDetailsTableBodyLineGraduatedPercentageFragmentDoc = gql` - fragment FeeForInvoiceDetailsTableBodyLineGraduatedPercentage on Fee { - id - appliedTaxes { - id - taxRate - } - amountDetails { - graduatedPercentageRanges { - flatUnitAmount - fromValue - perUnitTotalAmount - rate - toValue - totalWithFlatAmount - units - } - } - pricingUnitUsage { - shortName - } -} - `; -export const FeeForInvoiceDetailsTableBodyLineVolumeFragmentDoc = gql` - fragment FeeForInvoiceDetailsTableBodyLineVolume on Fee { - id - units - appliedTaxes { - id - taxRate - } - amountDetails { - flatUnitAmount - perUnitAmount - perUnitTotalAmount - } - pricingUnitUsage { - shortName - } -} - `; -export const FeeForInvoiceDetailsTableBodyLinePackageFragmentDoc = gql` - fragment FeeForInvoiceDetailsTableBodyLinePackage on Fee { - id - units - amountCents - appliedTaxes { - id - taxRate - } - amountDetails { - freeUnits - paidUnits - perPackageSize - perPackageUnitAmount - } - pricingUnitUsage { - amountCents - shortName - } -} - `; -export const FeeForInvoiceDetailsTableBodyLinePercentageFragmentDoc = gql` - fragment FeeForInvoiceDetailsTableBodyLinePercentage on Fee { - id - units - amountCents - appliedTaxes { - id - taxRate - } - amountDetails { - fixedFeeTotalAmount - fixedFeeUnitAmount - freeEvents - freeUnits - minMaxAdjustmentTotalAmount - paidEvents - paidUnits - perUnitTotalAmount - rate - units - } - pricingUnitUsage { - shortName - } -} - `; -export const FeeForEditfeeDrawerFragmentDoc = gql` - fragment FeeForEditfeeDrawer on Fee { - id - currency - charge { - id - chargeModel - prorated - } -} - `; -export const FeeForDeleteAdjustmentFeeDialogFragmentDoc = gql` - fragment FeeForDeleteAdjustmentFeeDialog on Fee { - id -} - `; -export const FeeForInvoiceDetailsTableBodyLineFragmentDoc = gql` - fragment FeeForInvoiceDetailsTableBodyLine on Fee { - id - units - preciseUnitAmount - amountCents - eventsCount - adjustedFee - adjustedFeeType - succeededAt - properties { - fromDatetime - toDatetime - } - pricingUnitUsage { - amountCents - conversionRate - shortName - preciseUnitAmount - } - charge { - id - chargeModel - minAmountCents - payInAdvance - prorated - billableMetric { - id - recurring - } - } - appliedTaxes { - id - taxRate - } - amountDetails { - freeUnits - fixedFeeUnitAmount - flatUnitAmount - graduatedRanges { - toValue - } - graduatedPercentageRanges { - toValue - } - } - ...FeeForInvoiceDetailsTableBodyLineGraduated - ...FeeForInvoiceDetailsTableBodyLineGraduatedPercentage - ...FeeForInvoiceDetailsTableBodyLineVolume - ...FeeForInvoiceDetailsTableBodyLinePackage - ...FeeForInvoiceDetailsTableBodyLinePercentage - ...FeeForEditfeeDrawer - ...FeeForDeleteAdjustmentFeeDialog -} - ${FeeForInvoiceDetailsTableBodyLineGraduatedFragmentDoc} -${FeeForInvoiceDetailsTableBodyLineGraduatedPercentageFragmentDoc} -${FeeForInvoiceDetailsTableBodyLineVolumeFragmentDoc} -${FeeForInvoiceDetailsTableBodyLinePackageFragmentDoc} -${FeeForInvoiceDetailsTableBodyLinePercentageFragmentDoc} -${FeeForEditfeeDrawerFragmentDoc} -${FeeForDeleteAdjustmentFeeDialogFragmentDoc}`; -export const FeeForInvoiceFeeArrearsDetailsTableFragmentDoc = gql` - fragment FeeForInvoiceFeeArrearsDetailsTable on Fee { - id - ...FeeForInvoiceDetailsTableBodyLine - ...FeeForDeleteAdjustmentFeeDialog - ...FeeForEditfeeDrawer -} - ${FeeForInvoiceDetailsTableBodyLineFragmentDoc} -${FeeForDeleteAdjustmentFeeDialogFragmentDoc} -${FeeForEditfeeDrawerFragmentDoc}`; -export const FeeForInvoiceFeeAdvanceDetailsTableFragmentDoc = gql` - fragment FeeForInvoiceFeeAdvanceDetailsTable on Fee { - id - ...FeeForInvoiceDetailsTableBodyLine - ...FeeForDeleteAdjustmentFeeDialog - ...FeeForEditfeeDrawer -} - ${FeeForInvoiceDetailsTableBodyLineFragmentDoc} -${FeeForDeleteAdjustmentFeeDialogFragmentDoc} -${FeeForEditfeeDrawerFragmentDoc}`; -export const FeeForInvoiceDetailsTableFragmentDoc = gql` - fragment FeeForInvoiceDetailsTable on Fee { - id - amountCents - description - feeType - invoiceDisplayName - invoiceName - itemName - units - preciseUnitAmount - charge { - id - payInAdvance - invoiceDisplayName - billableMetric { - id - name - aggregationType - } - } - chargeFilter { - invoiceDisplayName - values - } - ...FeeForInvoiceDetailsTableBodyLine - ...FeeForInvoiceFeeArrearsDetailsTable - ...FeeForInvoiceFeeAdvanceDetailsTable -} - ${FeeForInvoiceDetailsTableBodyLineFragmentDoc} -${FeeForInvoiceFeeArrearsDetailsTableFragmentDoc} -${FeeForInvoiceFeeAdvanceDetailsTableFragmentDoc}`; -export const InvoiceSubscriptionFormatingFragmentDoc = gql` - fragment InvoiceSubscriptionFormating on InvoiceSubscription { - fromDatetime - toDatetime - chargesFromDatetime - chargesToDatetime - inAdvanceChargesFromDatetime - inAdvanceChargesToDatetime + integrationSalesforceSyncable + externalSalesforceIntegrationId fees { id + addOn { + id + } amountCents invoiceName invoiceDisplayName @@ -15817,23 +15868,78 @@ export const InvoiceSubscriptionFormatingFragmentDoc = gql` plan { id interval + name } } } - subscription { - id + billingEntity { name - plan { - id - name - invoiceDisplayName - } + code } - invoice { +} + `; +export const InvoiceForCreditNotesTableFragmentDoc = gql` + fragment InvoiceForCreditNotesTable on Invoice { + id + customer { id - status - chargeAmountCents - progressiveBillingCreditAmountCents + } + creditNotes { + id + couponsAdjustmentAmountCents + number + subTotalExcludingTaxesAmountCents + currency + totalAmountCents + appliedTaxes { + id + amountCents + baseAmountCents + taxRate + taxName + } + items { + amountCents + amountCurrency + fee { + id + amountCents + eventsCount + units + feeType + groupedBy + itemName + invoiceName + appliedTaxes { + id + taxRate + } + trueUpParentFee { + id + } + charge { + id + billableMetric { + id + name + aggregationType + } + } + subscription { + id + name + plan { + id + name + invoiceDisplayName + } + } + chargeFilter { + invoiceDisplayName + values + } + } + } } } `; @@ -15880,56 +15986,9 @@ export const InvoiceForDetailsTableFragmentDoc = gql` errorCode errorDetails } - fees { - id - ...FeeForInvoiceDetailsTable - } - invoiceSubscriptions { - fromDatetime - toDatetime - chargesFromDatetime - chargesToDatetime - inAdvanceChargesFromDatetime - inAdvanceChargesToDatetime - acceptNewChargeFees - subscriptionAmountCents - invoice { - chargeAmountCents - progressiveBillingCreditAmountCents - } - subscription { - id - name - plan { - id - name - interval - amountCents - amountCurrency - invoiceDisplayName - billChargesMonthly - } - } - fees { - id - subscription { - id - name - plan { - id - name - invoiceDisplayName - } - } - ...FeeForInvoiceDetailsTable - } - ...InvoiceSubscriptionFormating - } ...InvoiceForDetailsTableFooter } - ${FeeForInvoiceDetailsTableFragmentDoc} -${InvoiceSubscriptionFormatingFragmentDoc} -${InvoiceForDetailsTableFooterFragmentDoc}`; + ${InvoiceForDetailsTableFooterFragmentDoc}`; export const InvoiceForInvoiceInfosFragmentDoc = gql` fragment InvoiceForInvoiceInfos on Invoice { number @@ -22604,167 +22663,19 @@ export type CreateAdjustedFeeMutationFn = Apollo.MutationFunction) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useMutation(CreateAdjustedFeeDocument, options); - } -export type CreateAdjustedFeeMutationHookResult = ReturnType; -export type CreateAdjustedFeeMutationResult = Apollo.MutationResult; -export type CreateAdjustedFeeMutationOptions = Apollo.BaseMutationOptions; -export const GetTaxesForChargesDocument = gql` - query getTaxesForCharges($limit: Int, $page: Int) { - taxes(limit: $limit, page: $page) { - metadata { - currentPage - totalPages - } - collection { - id - ...TaxForPlanChargeAccordion - } - } -} - ${TaxForPlanChargeAccordionFragmentDoc}`; - -/** - * __useGetTaxesForChargesQuery__ - * - * To run a query within a React component, call `useGetTaxesForChargesQuery` and pass it any options that fit your needs. - * When your component renders, `useGetTaxesForChargesQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetTaxesForChargesQuery({ - * variables: { - * limit: // value for 'limit' - * page: // value for 'page' - * }, - * }); - */ -export function useGetTaxesForChargesQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetTaxesForChargesDocument, options); - } -export function useGetTaxesForChargesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetTaxesForChargesDocument, options); - } -export function useGetTaxesForChargesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(GetTaxesForChargesDocument, options); - } -export type GetTaxesForChargesQueryHookResult = ReturnType; -export type GetTaxesForChargesLazyQueryHookResult = ReturnType; -export type GetTaxesForChargesSuspenseQueryHookResult = ReturnType; -export type GetTaxesForChargesQueryResult = Apollo.QueryResult; -export const GetMeteredBillableMetricsDocument = gql` - query getMeteredBillableMetrics($page: Int, $limit: Int, $searchTerm: String) { - billableMetrics( - page: $page - limit: $limit - searchTerm: $searchTerm - recurring: false - ) { - collection { - id - ...BillableMetricForChargeSection - } - } -} - ${BillableMetricForChargeSectionFragmentDoc}`; - -/** - * __useGetMeteredBillableMetricsQuery__ - * - * To run a query within a React component, call `useGetMeteredBillableMetricsQuery` and pass it any options that fit your needs. - * When your component renders, `useGetMeteredBillableMetricsQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetMeteredBillableMetricsQuery({ - * variables: { - * page: // value for 'page' - * limit: // value for 'limit' - * searchTerm: // value for 'searchTerm' - * }, - * }); - */ -export function useGetMeteredBillableMetricsQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetMeteredBillableMetricsDocument, options); - } -export function useGetMeteredBillableMetricsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetMeteredBillableMetricsDocument, options); - } -export function useGetMeteredBillableMetricsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(GetMeteredBillableMetricsDocument, options); - } -export type GetMeteredBillableMetricsQueryHookResult = ReturnType; -export type GetMeteredBillableMetricsLazyQueryHookResult = ReturnType; -export type GetMeteredBillableMetricsSuspenseQueryHookResult = ReturnType; -export type GetMeteredBillableMetricsQueryResult = Apollo.QueryResult; -export const GetRecurringBillableMetricsDocument = gql` - query getRecurringBillableMetrics($page: Int, $limit: Int, $searchTerm: String) { - billableMetrics( - page: $page - limit: $limit - searchTerm: $searchTerm - recurring: true - ) { - collection { - id - ...BillableMetricForChargeSection - } - } -} - ${BillableMetricForChargeSectionFragmentDoc}`; - -/** - * __useGetRecurringBillableMetricsQuery__ - * - * To run a query within a React component, call `useGetRecurringBillableMetricsQuery` and pass it any options that fit your needs. - * When your component renders, `useGetRecurringBillableMetricsQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetRecurringBillableMetricsQuery({ - * variables: { - * page: // value for 'page' - * limit: // value for 'limit' - * searchTerm: // value for 'searchTerm' - * }, - * }); - */ -export function useGetRecurringBillableMetricsQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetRecurringBillableMetricsDocument, options); - } -export function useGetRecurringBillableMetricsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetRecurringBillableMetricsDocument, options); - } -export function useGetRecurringBillableMetricsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(GetRecurringBillableMetricsDocument, options); - } -export type GetRecurringBillableMetricsQueryHookResult = ReturnType; -export type GetRecurringBillableMetricsLazyQueryHookResult = ReturnType; -export type GetRecurringBillableMetricsSuspenseQueryHookResult = ReturnType; -export type GetRecurringBillableMetricsQueryResult = Apollo.QueryResult; + * const [createAdjustedFeeMutation, { data, loading, error }] = useCreateAdjustedFeeMutation({ + * variables: { + * input: // value for 'input' + * }, + * }); + */ +export function useCreateAdjustedFeeMutation(baseOptions?: Apollo.MutationHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useMutation(CreateAdjustedFeeDocument, options); + } +export type CreateAdjustedFeeMutationHookResult = ReturnType; +export type CreateAdjustedFeeMutationResult = Apollo.MutationResult; +export type CreateAdjustedFeeMutationOptions = Apollo.BaseMutationOptions; export const GetTaxesForCommitmentsDocument = gql` query getTaxesForCommitments($limit: Int, $page: Int) { taxes(limit: $limit, page: $page) { @@ -22774,11 +22685,11 @@ export const GetTaxesForCommitmentsDocument = gql` } collection { id - ...TaxForPlanChargeAccordion + ...TaxForTaxesSelectorSection } } } - ${TaxForPlanChargeAccordionFragmentDoc}`; + ${TaxForTaxesSelectorSectionFragmentDoc}`; /** * __useGetTaxesForCommitmentsQuery__ @@ -22982,6 +22893,106 @@ export type GetTaxesForPlanQueryHookResult = ReturnType; export type GetTaxesForPlanSuspenseQueryHookResult = ReturnType; export type GetTaxesForPlanQueryResult = Apollo.QueryResult; +export const GetMeteredBillableMetricsDocument = gql` + query getMeteredBillableMetrics($page: Int, $limit: Int, $searchTerm: String) { + billableMetrics( + page: $page + limit: $limit + searchTerm: $searchTerm + recurring: false + ) { + collection { + id + ...BillableMetricForUsageChargeSection + } + } +} + ${BillableMetricForUsageChargeSectionFragmentDoc}`; + +/** + * __useGetMeteredBillableMetricsQuery__ + * + * To run a query within a React component, call `useGetMeteredBillableMetricsQuery` and pass it any options that fit your needs. + * When your component renders, `useGetMeteredBillableMetricsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetMeteredBillableMetricsQuery({ + * variables: { + * page: // value for 'page' + * limit: // value for 'limit' + * searchTerm: // value for 'searchTerm' + * }, + * }); + */ +export function useGetMeteredBillableMetricsQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetMeteredBillableMetricsDocument, options); + } +export function useGetMeteredBillableMetricsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetMeteredBillableMetricsDocument, options); + } +export function useGetMeteredBillableMetricsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { + const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return Apollo.useSuspenseQuery(GetMeteredBillableMetricsDocument, options); + } +export type GetMeteredBillableMetricsQueryHookResult = ReturnType; +export type GetMeteredBillableMetricsLazyQueryHookResult = ReturnType; +export type GetMeteredBillableMetricsSuspenseQueryHookResult = ReturnType; +export type GetMeteredBillableMetricsQueryResult = Apollo.QueryResult; +export const GetRecurringBillableMetricsDocument = gql` + query getRecurringBillableMetrics($page: Int, $limit: Int, $searchTerm: String) { + billableMetrics( + page: $page + limit: $limit + searchTerm: $searchTerm + recurring: true + ) { + collection { + id + ...BillableMetricForUsageChargeSection + } + } +} + ${BillableMetricForUsageChargeSectionFragmentDoc}`; + +/** + * __useGetRecurringBillableMetricsQuery__ + * + * To run a query within a React component, call `useGetRecurringBillableMetricsQuery` and pass it any options that fit your needs. + * When your component renders, `useGetRecurringBillableMetricsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetRecurringBillableMetricsQuery({ + * variables: { + * page: // value for 'page' + * limit: // value for 'limit' + * searchTerm: // value for 'searchTerm' + * }, + * }); + */ +export function useGetRecurringBillableMetricsQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetRecurringBillableMetricsDocument, options); + } +export function useGetRecurringBillableMetricsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetRecurringBillableMetricsDocument, options); + } +export function useGetRecurringBillableMetricsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { + const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return Apollo.useSuspenseQuery(GetRecurringBillableMetricsDocument, options); + } +export type GetRecurringBillableMetricsQueryHookResult = ReturnType; +export type GetRecurringBillableMetricsLazyQueryHookResult = ReturnType; +export type GetRecurringBillableMetricsSuspenseQueryHookResult = ReturnType; +export type GetRecurringBillableMetricsQueryResult = Apollo.QueryResult; export const PlanDetailsActivityLogsDocument = gql` query PlanDetailsActivityLogs($page: Int, $limit: Int, $resourceTypes: [ResourceTypeEnum!], $resourceIds: [String!]) { activityLogs( @@ -27861,6 +27872,55 @@ export function useDeleteTaxMutation(baseOptions?: Apollo.MutationHookOptions; export type DeleteTaxMutationResult = Apollo.MutationResult; export type DeleteTaxMutationOptions = Apollo.BaseMutationOptions; +export const GetTaxesForTaxesSelectorSectionDocument = gql` + query getTaxesForTaxesSelectorSection($limit: Int, $page: Int, $searchTerm: String) { + taxes(limit: $limit, page: $page, searchTerm: $searchTerm) { + metadata { + currentPage + totalPages + } + collection { + id + ...TaxForTaxesSelectorSection + } + } +} + ${TaxForTaxesSelectorSectionFragmentDoc}`; + +/** + * __useGetTaxesForTaxesSelectorSectionQuery__ + * + * To run a query within a React component, call `useGetTaxesForTaxesSelectorSectionQuery` and pass it any options that fit your needs. + * When your component renders, `useGetTaxesForTaxesSelectorSectionQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetTaxesForTaxesSelectorSectionQuery({ + * variables: { + * limit: // value for 'limit' + * page: // value for 'page' + * searchTerm: // value for 'searchTerm' + * }, + * }); + */ +export function useGetTaxesForTaxesSelectorSectionQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetTaxesForTaxesSelectorSectionDocument, options); + } +export function useGetTaxesForTaxesSelectorSectionLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetTaxesForTaxesSelectorSectionDocument, options); + } +export function useGetTaxesForTaxesSelectorSectionSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { + const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return Apollo.useSuspenseQuery(GetTaxesForTaxesSelectorSectionDocument, options); + } +export type GetTaxesForTaxesSelectorSectionQueryHookResult = ReturnType; +export type GetTaxesForTaxesSelectorSectionLazyQueryHookResult = ReturnType; +export type GetTaxesForTaxesSelectorSectionSuspenseQueryHookResult = ReturnType; +export type GetTaxesForTaxesSelectorSectionQueryResult = Apollo.QueryResult; export const GetCustomerWalletListDocument = gql` query getCustomerWalletList($customerId: ID!, $page: Int, $limit: Int) { wallets(customerId: $customerId, page: $page, limit: $limit) { @@ -30148,59 +30208,8 @@ export type CouponsQueryHookResult = ReturnType; export type CouponsLazyQueryHookResult = ReturnType; export type CouponsSuspenseQueryHookResult = ReturnType; export type CouponsQueryResult = Apollo.QueryResult; -export const GetTaxesForAddOnFormDocument = gql` - query getTaxesForAddOnForm($limit: Int, $page: Int, $searchTerm: String) { - taxes(limit: $limit, page: $page, searchTerm: $searchTerm) { - metadata { - currentPage - totalPages - } - collection { - id - name - rate - ...TaxOnAddOnEditCreate - } - } -} - ${TaxOnAddOnEditCreateFragmentDoc}`; - -/** - * __useGetTaxesForAddOnFormQuery__ - * - * To run a query within a React component, call `useGetTaxesForAddOnFormQuery` and pass it any options that fit your needs. - * When your component renders, `useGetTaxesForAddOnFormQuery` returns an object from Apollo Client that contains loading, error, and data properties - * you can use to render your UI. - * - * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; - * - * @example - * const { data, loading, error } = useGetTaxesForAddOnFormQuery({ - * variables: { - * limit: // value for 'limit' - * page: // value for 'page' - * searchTerm: // value for 'searchTerm' - * }, - * }); - */ -export function useGetTaxesForAddOnFormQuery(baseOptions?: Apollo.QueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetTaxesForAddOnFormDocument, options); - } -export function useGetTaxesForAddOnFormLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { - const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetTaxesForAddOnFormDocument, options); - } -export function useGetTaxesForAddOnFormSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { - const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(GetTaxesForAddOnFormDocument, options); - } -export type GetTaxesForAddOnFormQueryHookResult = ReturnType; -export type GetTaxesForAddOnFormLazyQueryHookResult = ReturnType; -export type GetTaxesForAddOnFormSuspenseQueryHookResult = ReturnType; -export type GetTaxesForAddOnFormQueryResult = Apollo.QueryResult; -export const GetInvoiceFeesDocument = gql` - query getInvoiceFees($id: ID!) { +export const GetInvoiceFeesForCreateInvoiceDocument = gql` + query getInvoiceFeesForCreateInvoice($id: ID!) { invoice(id: $id) { id status @@ -30261,37 +30270,37 @@ export const GetInvoiceFeesDocument = gql` ${FeeForInvoiceFeesToFeeInputFragmentDoc}`; /** - * __useGetInvoiceFeesQuery__ + * __useGetInvoiceFeesForCreateInvoiceQuery__ * - * To run a query within a React component, call `useGetInvoiceFeesQuery` and pass it any options that fit your needs. - * When your component renders, `useGetInvoiceFeesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * To run a query within a React component, call `useGetInvoiceFeesForCreateInvoiceQuery` and pass it any options that fit your needs. + * When your component renders, `useGetInvoiceFeesForCreateInvoiceQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example - * const { data, loading, error } = useGetInvoiceFeesQuery({ + * const { data, loading, error } = useGetInvoiceFeesForCreateInvoiceQuery({ * variables: { * id: // value for 'id' * }, * }); */ -export function useGetInvoiceFeesQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: GetInvoiceFeesQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { +export function useGetInvoiceFeesForCreateInvoiceQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: GetInvoiceFeesForCreateInvoiceQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useQuery(GetInvoiceFeesDocument, options); + return Apollo.useQuery(GetInvoiceFeesForCreateInvoiceDocument, options); } -export function useGetInvoiceFeesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { +export function useGetInvoiceFeesForCreateInvoiceLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return Apollo.useLazyQuery(GetInvoiceFeesDocument, options); + return Apollo.useLazyQuery(GetInvoiceFeesForCreateInvoiceDocument, options); } -export function useGetInvoiceFeesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { +export function useGetInvoiceFeesForCreateInvoiceSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} - return Apollo.useSuspenseQuery(GetInvoiceFeesDocument, options); + return Apollo.useSuspenseQuery(GetInvoiceFeesForCreateInvoiceDocument, options); } -export type GetInvoiceFeesQueryHookResult = ReturnType; -export type GetInvoiceFeesLazyQueryHookResult = ReturnType; -export type GetInvoiceFeesSuspenseQueryHookResult = ReturnType; -export type GetInvoiceFeesQueryResult = Apollo.QueryResult; +export type GetInvoiceFeesForCreateInvoiceQueryHookResult = ReturnType; +export type GetInvoiceFeesForCreateInvoiceLazyQueryHookResult = ReturnType; +export type GetInvoiceFeesForCreateInvoiceSuspenseQueryHookResult = ReturnType; +export type GetInvoiceFeesForCreateInvoiceQueryResult = Apollo.QueryResult; export const GetInfosForCreateInvoiceDocument = gql` query getInfosForCreateInvoice($id: ID!) { customer(id: $id) { @@ -31062,6 +31071,92 @@ export type GetInvoiceDetailsQueryHookResult = ReturnType; export type GetInvoiceDetailsSuspenseQueryHookResult = ReturnType; export type GetInvoiceDetailsQueryResult = Apollo.QueryResult; +export const GetInvoiceFeesDocument = gql` + query getInvoiceFees($id: ID!) { + invoice(id: $id) { + id + fees { + ...FeeForInvoiceDetailsTable + } + } +} + ${FeeForInvoiceDetailsTableFragmentDoc}`; + +/** + * __useGetInvoiceFeesQuery__ + * + * To run a query within a React component, call `useGetInvoiceFeesQuery` and pass it any options that fit your needs. + * When your component renders, `useGetInvoiceFeesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetInvoiceFeesQuery({ + * variables: { + * id: // value for 'id' + * }, + * }); + */ +export function useGetInvoiceFeesQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: GetInvoiceFeesQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetInvoiceFeesDocument, options); + } +export function useGetInvoiceFeesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetInvoiceFeesDocument, options); + } +export function useGetInvoiceFeesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { + const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return Apollo.useSuspenseQuery(GetInvoiceFeesDocument, options); + } +export type GetInvoiceFeesQueryHookResult = ReturnType; +export type GetInvoiceFeesLazyQueryHookResult = ReturnType; +export type GetInvoiceFeesSuspenseQueryHookResult = ReturnType; +export type GetInvoiceFeesQueryResult = Apollo.QueryResult; +export const GetInvoiceSubscriptionsDocument = gql` + query getInvoiceSubscriptions($id: ID!) { + invoice(id: $id) { + id + invoiceSubscriptions { + ...InvoiceSubscriptionForInvoiceDetailsTable + } + } +} + ${InvoiceSubscriptionForInvoiceDetailsTableFragmentDoc}`; + +/** + * __useGetInvoiceSubscriptionsQuery__ + * + * To run a query within a React component, call `useGetInvoiceSubscriptionsQuery` and pass it any options that fit your needs. + * When your component renders, `useGetInvoiceSubscriptionsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetInvoiceSubscriptionsQuery({ + * variables: { + * id: // value for 'id' + * }, + * }); + */ +export function useGetInvoiceSubscriptionsQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: GetInvoiceSubscriptionsQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetInvoiceSubscriptionsDocument, options); + } +export function useGetInvoiceSubscriptionsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetInvoiceSubscriptionsDocument, options); + } +export function useGetInvoiceSubscriptionsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { + const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return Apollo.useSuspenseQuery(GetInvoiceSubscriptionsDocument, options); + } +export type GetInvoiceSubscriptionsQueryHookResult = ReturnType; +export type GetInvoiceSubscriptionsLazyQueryHookResult = ReturnType; +export type GetInvoiceSubscriptionsSuspenseQueryHookResult = ReturnType; +export type GetInvoiceSubscriptionsQueryResult = Apollo.QueryResult; export const GetInvoiceCustomerDocument = gql` query getInvoiceCustomer($id: ID!) { customer(id: $id) { diff --git a/src/hooks/__tests__/usePermissionsInvoiceActions.test.ts b/src/hooks/__tests__/usePermissionsInvoiceActions.test.ts index 8e7b01aec2..6dafdcec38 100644 --- a/src/hooks/__tests__/usePermissionsInvoiceActions.test.ts +++ b/src/hooks/__tests__/usePermissionsInvoiceActions.test.ts @@ -32,6 +32,7 @@ jest.mock('~/core/apolloClient', () => ({ const DEFAULT_PERMISSIONS = { invoicesView: true, invoicesUpdate: true, + draftInvoicesUpdate: true, invoicesSend: true, invoicesVoid: true, creditNotesCreate: true, @@ -259,6 +260,39 @@ describe('usePermissionsInvoiceActions', () => { expect(result.current.canFinalize({ status: InvoiceStatusTypeEnum.Draft })).toBe(false) }) + it('should return false when user does not have draftInvoicesUpdate permission', async () => { + const { result } = await prepare({ draftInvoicesUpdate: false }) + + expect(result.current.canFinalize({ status: InvoiceStatusTypeEnum.Draft })).toBe(false) + }) + + it('should return false when user has invoicesUpdate but not draftInvoicesUpdate', async () => { + const { result } = await prepare({ + invoicesUpdate: true, + draftInvoicesUpdate: false, + }) + + expect(result.current.canFinalize({ status: InvoiceStatusTypeEnum.Draft })).toBe(false) + }) + + it('should return false when user has draftInvoicesUpdate but not invoicesUpdate', async () => { + const { result } = await prepare({ + invoicesUpdate: false, + draftInvoicesUpdate: true, + }) + + expect(result.current.canFinalize({ status: InvoiceStatusTypeEnum.Draft })).toBe(false) + }) + + it('should return true when user has both invoicesUpdate and draftInvoicesUpdate permissions', async () => { + const { result } = await prepare({ + invoicesUpdate: true, + draftInvoicesUpdate: true, + }) + + expect(result.current.canFinalize({ status: InvoiceStatusTypeEnum.Draft })).toBe(true) + }) + it('should return true for voided invoice', async () => { const { result } = await prepare() diff --git a/src/hooks/useCreateEditAddOn.ts b/src/hooks/useCreateEditAddOn.ts index 08a1d3cab7..fa2c9de442 100644 --- a/src/hooks/useCreateEditAddOn.ts +++ b/src/hooks/useCreateEditAddOn.ts @@ -12,6 +12,7 @@ import { CreateAddOnInput, EditAddOnFragment, LagoApiError, + TaxForTaxesSelectorSectionFragmentDoc, UpdateAddOnInput, useCreateAddOnMutation, useGetSingleAddOnQuery, @@ -19,13 +20,6 @@ import { } from '~/generated/graphql' gql` - fragment TaxOnAddOnEditCreate on Tax { - id - name - code - rate - } - fragment EditAddOn on AddOn { id name @@ -35,7 +29,7 @@ gql` amountCurrency taxes { id - ...TaxOnAddOnEditCreate + ...TaxForTaxesSelectorSection } } @@ -58,6 +52,7 @@ gql` } ${AddOnItemFragmentDoc} + ${TaxForTaxesSelectorSectionFragmentDoc} ` type UseCreateEditAddOnReturn = { diff --git a/src/hooks/usePermissionsInvoiceActions.ts b/src/hooks/usePermissionsInvoiceActions.ts index 810450aa9a..ad84d22bd9 100644 --- a/src/hooks/usePermissionsInvoiceActions.ts +++ b/src/hooks/usePermissionsInvoiceActions.ts @@ -32,7 +32,9 @@ export const usePermissionsInvoiceActions = () => { InvoiceStatusTypeEnum.Failed, InvoiceStatusTypeEnum.Pending, InvoiceStatusTypeEnum.Finalized, - ].includes(invoice.status) && hasPermissions(['invoicesUpdate']) + ].includes(invoice.status) && + hasPermissions(['invoicesUpdate']) && + hasPermissions(['draftInvoicesUpdate']) ) } diff --git a/src/pages/CreateAddOn.tsx b/src/pages/CreateAddOn.tsx index c2f516b424..1837764c2f 100644 --- a/src/pages/CreateAddOn.tsx +++ b/src/pages/CreateAddOn.tsx @@ -1,61 +1,25 @@ -import { gql } from '@apollo/client' import { useFormik } from 'formik' -import { useEffect, useMemo, useRef, useState } from 'react' +import { useEffect, useRef, useState } from 'react' import { generatePath, useNavigate, useParams } from 'react-router-dom' import { number, object, string } from 'yup' import { AddOnCodeSnippet } from '~/components/addOns/AddOnCodeSnippet' import { AddOnFormInput } from '~/components/addOns/types' -import { Button, Card, Chip, Skeleton, Tooltip, Typography } from '~/components/designSystem' -import { - AmountInputField, - ComboBox, - ComboBoxField, - ComboboxItem, - TextInput, - TextInputField, -} from '~/components/form' +import { Button, Card, Skeleton, Tooltip, Typography } from '~/components/designSystem' +import { AmountInputField, ComboBoxField, TextInput, TextInputField } from '~/components/form' +import { TaxesSelectorSection } from '~/components/taxes/TaxesSelectorSection' import { WarningDialog, WarningDialogRef } from '~/components/WarningDialog' -import { - FORM_ERRORS_ENUM, - MUI_INPUT_BASE_ROOT_CLASSNAME, - SEARCH_TAX_INPUT_FOR_ADD_ON_CLASSNAME, -} from '~/core/constants/form' -import { intlFormatNumber } from '~/core/formats/intlFormatNumber' +import { FORM_ERRORS_ENUM, SEARCH_TAX_INPUT_FOR_ADD_ON_CLASSNAME } from '~/core/constants/form' import { ADD_ON_DETAILS_ROUTE, ADD_ONS_ROUTE } from '~/core/router' import { deserializeAmount } from '~/core/serializers/serializeAmount' -import { scrollToAndClickElement } from '~/core/utils/domUtils' import { updateNameAndMaybeCode } from '~/core/utils/updateNameAndMaybeCode' -import { - CurrencyEnum, - TaxOnAddOnEditCreateFragmentDoc, - useGetTaxesForAddOnFormLazyQuery, -} from '~/generated/graphql' +import { CurrencyEnum } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { useCreateEditAddOn } from '~/hooks/useCreateEditAddOn' import { useOrganizationInfos } from '~/hooks/useOrganizationInfos' import { PageHeader } from '~/styles' import { Main, Side, Subtitle, Title } from '~/styles/mainObjectsForm' -gql` - query getTaxesForAddOnForm($limit: Int, $page: Int, $searchTerm: String) { - taxes(limit: $limit, page: $page, searchTerm: $searchTerm) { - metadata { - currentPage - totalPages - } - collection { - id - name - rate - ...TaxOnAddOnEditCreate - } - } - } - - ${TaxOnAddOnEditCreateFragmentDoc} -` - const CreateAddOn = () => { const { translate } = useInternationalization() const navigate = useNavigate() @@ -63,10 +27,6 @@ const CreateAddOn = () => { const { addOnId } = useParams() const { isEdition, loading, addOn, errorCode, onSave } = useCreateEditAddOn() const warningDialogRef = useRef(null) - const [getTaxes, { data: taxesData, loading: taxesLoading }] = useGetTaxesForAddOnFormLazyQuery({ - variables: { limit: 20 }, - }) - const { collection: taxesCollection } = taxesData?.taxes || {} const formikProps = useFormik({ initialValues: { @@ -95,35 +55,6 @@ const CreateAddOn = () => { onSubmit: onSave, }) - const taxesDataForCombobox = useMemo(() => { - if (!taxesCollection) return [] - - const addOnTaxesIds = formikProps?.values?.taxes?.map((tax) => tax.id) || [] - - return taxesCollection.map(({ id, name, rate }) => { - const formatedRate = intlFormatNumber(Number(rate) / 100 || 0, { - style: 'percent', - }) - - return { - label: `${name} (${formatedRate})`, - labelNode: ( - - - {name} - - - {formatedRate} - - - ), - value: id, - disabled: addOnTaxesIds.includes(id), - } - }) - }, [formikProps?.values?.taxes, taxesCollection]) - - const [shouldDisplayTaxesInput, setShouldDisplayTaxesInput] = useState(false) const [shouldDisplayDescription, setShouldDisplayDescription] = useState( !!formikProps.initialValues.description, ) @@ -288,7 +219,26 @@ const CreateAddOn = () => { />
- {!!formikProps?.values?.taxes?.length && ( +
+ {!!formikProps?.values?.taxes?.length && ( + + {translate('text_6661fc17337de3591e29e3e1')} + + )} + + { + formikProps.setFieldValue('taxes', newTaxArray) + }} + onDelete={(newTaxArray) => { + formikProps.setFieldValue('taxes', newTaxArray) + }} + /> +
+ + {/* {!!formikProps?.values?.taxes?.length && (
{translate('text_64be910fba8ef9208686a8e3')} @@ -375,7 +325,7 @@ const CreateAddOn = () => { > {translate('text_64be910fba8ef9208686a8c9')} - )} + )} */}
diff --git a/src/pages/CreateInvoice.tsx b/src/pages/CreateInvoice.tsx index d10c288652..2b2248c226 100644 --- a/src/pages/CreateInvoice.tsx +++ b/src/pages/CreateInvoice.tsx @@ -24,9 +24,9 @@ import { EditFeeBillingPeriodRef, } from '~/components/invoices/EditFeeBillingPeriod' import { - EditInvoiceDisplayName, - EditInvoiceDisplayNameRef, -} from '~/components/invoices/EditInvoiceDisplayName' + EditInvoiceDisplayNameDialog, + EditInvoiceDisplayNameDialogRef, +} from '~/components/invoices/EditInvoiceDisplayNameDialog' import { EditInvoiceItemDescriptionDialog, EditInvoiceItemDescriptionDialogRef, @@ -65,7 +65,7 @@ import { useGetAddonListForInfoiceLazyQuery, useGetBillingEntityQuery, useGetInfosForCreateInvoiceQuery, - useGetInvoiceFeesQuery, + useGetInvoiceFeesForCreateInvoiceQuery, useVoidInvoiceMutation, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' @@ -84,7 +84,7 @@ gql` rate } - query getInvoiceFees($id: ID!) { + query getInvoiceFeesForCreateInvoice($id: ID!) { invoice(id: $id) { id status @@ -259,7 +259,7 @@ const CreateInvoice = () => { const warningDialogRef = useRef(null) const editDescriptionDialogRef = useRef(null) const editTaxDialogRef = useRef(null) - const editInvoiceDisplayNameRef = useRef(null) + const editInvoiceDisplayNameDialogRef = useRef(null) const editFeeBillingPeriodDialogRef = useRef(null) const handleClosePage = useCallback(() => { @@ -273,7 +273,7 @@ const CreateInvoice = () => { }) const { customer, taxes } = data || {} - const { data: prefillData } = useGetInvoiceFeesQuery({ + const { data: prefillData } = useGetInvoiceFeesForCreateInvoiceQuery({ variables: { id: voidedInvoiceId as string }, skip: !voidedInvoiceId, }) @@ -850,7 +850,7 @@ const CreateInvoice = () => { onClick={(e) => { e.stopPropagation() - editInvoiceDisplayNameRef.current?.openDialog({ + editInvoiceDisplayNameDialogRef.current?.openDialog({ invoiceDisplayName: fee.invoiceDisplayName, callback: (invoiceDisplayName: string) => { formikProps.setFieldValue( @@ -890,6 +890,7 @@ const CreateInvoice = () => { /> { /> - + ) diff --git a/src/pages/CreatePlan.tsx b/src/pages/CreatePlan.tsx index 13d89fc17c..f0cccb6454 100644 --- a/src/pages/CreatePlan.tsx +++ b/src/pages/CreatePlan.tsx @@ -5,13 +5,11 @@ import { generatePath, useNavigate, useSearchParams } from 'react-router-dom' import { Button, Card, Skeleton, Typography } from '~/components/designSystem' import { - EditInvoiceDisplayName, - EditInvoiceDisplayNameRef, -} from '~/components/invoices/EditInvoiceDisplayName' -import { ChargesSection } from '~/components/plans/ChargesSection' + EditInvoiceDisplayNameDialog, + EditInvoiceDisplayNameDialogRef, +} from '~/components/invoices/EditInvoiceDisplayNameDialog' import { CommitmentsSection } from '~/components/plans/CommitmentsSection' import { FeatureEntitlementSection } from '~/components/plans/FeatureEntitlementSection' -import { FixedFeeSection } from '~/components/plans/FixedFeeSection' import { ImpactOverridenSubscriptionsDialog, ImpactOverridenSubscriptionsDialogRef, @@ -19,7 +17,9 @@ import { import { PlanCodeSnippet } from '~/components/plans/PlanCodeSnippet' import { PlanSettingsSection } from '~/components/plans/PlanSettingsSection' import { ProgressiveBillingSection } from '~/components/plans/ProgressiveBillingSection' +import { SubscriptionFeeSection } from '~/components/plans/SubscriptionFeeSection' import { LocalChargeInput } from '~/components/plans/types' +import { UsageChargesSection } from '~/components/plans/UsageChargesSection' import { PremiumWarningDialog, PremiumWarningDialogRef } from '~/components/PremiumWarningDialog' import { REDIRECTION_ORIGIN_SUBSCRIPTION_USAGE } from '~/components/subscriptions/SubscriptionUsageLifetimeGraph' import { WarningDialog, WarningDialogRef } from '~/components/WarningDialog' @@ -36,11 +36,11 @@ import { PLANS_ROUTE, } from '~/core/router' import { - ChargeAccordionFragmentDoc, FeatureEntitlementForPlanFragmentDoc, - PlanForChargeAccordionFragmentDoc, - PlanForFixedFeeSectionFragmentDoc, PlanForSettingsSectionFragmentDoc, + PlanForSubscriptionFeeSectionFragmentDoc, + PlanForUsageChargeAccordionFragmentDoc, + UsageChargeAccordionFragmentDoc, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { usePlanForm } from '~/hooks/plans/usePlanForm' @@ -115,7 +115,7 @@ gql` code ...BillableMetricForPlan } - ...ChargeAccordion + ...UsageChargeAccordion chargeModel } usageThresholds { @@ -125,16 +125,16 @@ gql` thresholdDisplayName } - ...PlanForChargeAccordion + ...PlanForUsageChargeAccordion ...PlanForSettingsSection - ...PlanForFixedFeeSection + ...PlanForSubscriptionFeeSection ...FeatureEntitlementForPlan } - ${ChargeAccordionFragmentDoc} - ${PlanForChargeAccordionFragmentDoc} + ${UsageChargeAccordionFragmentDoc} + ${PlanForUsageChargeAccordionFragmentDoc} ${PlanForSettingsSectionFragmentDoc} - ${PlanForFixedFeeSectionFragmentDoc} + ${PlanForSubscriptionFeeSectionFragmentDoc} ${FeatureEntitlementForPlanFragmentDoc} ` @@ -147,7 +147,7 @@ const CreatePlan = () => { const { errorCode, formikProps, isEdition, loading, plan, type } = usePlanForm({}) const warningDialogRef = useRef(null) const impactOverridenSubscriptionsDialogRef = useRef(null) - const editInvoiceDisplayNameRef = useRef(null) + const editInvoiceDisplayNameDialogRef = useRef(null) const canBeEdited = !plan?.subscriptionsCount @@ -250,21 +250,21 @@ const CreatePlan = () => {
- -
@@ -283,7 +283,7 @@ const CreatePlan = () => { { onContinue={() => planCloseRedirection()} /> - +
) diff --git a/src/pages/CustomerInvoiceDetails.tsx b/src/pages/CustomerInvoiceDetails.tsx index 7a4e47a308..f3973c70ff 100644 --- a/src/pages/CustomerInvoiceDetails.tsx +++ b/src/pages/CustomerInvoiceDetails.tsx @@ -34,7 +34,7 @@ import { InvoiceCreditNoteList } from '~/components/invoices/InvoiceCreditNoteLi import { InvoicePaymentList } from '~/components/invoices/InvoicePaymentList' import { VoidInvoiceDialog, VoidInvoiceDialogRef } from '~/components/invoices/VoidInvoiceDialog' import { PremiumWarningDialog, PremiumWarningDialogRef } from '~/components/PremiumWarningDialog' -import { addToast, envGlobalVar, hasDefinedGQLError, LagoGQLError } from '~/core/apolloClient' +import { addToast, hasDefinedGQLError, LagoGQLError } from '~/core/apolloClient' import { LocalTaxProviderErrorsEnum } from '~/core/constants/form' import { invoiceStatusMapping, paymentStatusMapping } from '~/core/constants/statusInvoiceMapping' import { @@ -75,6 +75,7 @@ import { InvoiceForInvoiceInfosFragmentDoc, InvoiceForUpdateInvoicePaymentStatusFragmentDoc, InvoiceStatusTypeEnum, + InvoiceSubscriptionForInvoiceDetailsTableFragmentDoc, InvoiceTaxStatusTypeEnum, LagoApiError, NetsuiteIntegration, @@ -85,6 +86,8 @@ import { useGeneratePaymentUrlMutation, useGetInvoiceCustomerQuery, useGetInvoiceDetailsQuery, + useGetInvoiceFeesQuery, + useGetInvoiceSubscriptionsQuery, useIntegrationsListForCustomerInvoiceDetailsQuery, useRefreshInvoiceMutation, useRetryInvoiceMutation, @@ -103,8 +106,6 @@ import InvoiceOverview from '~/pages/InvoiceOverview' import ErrorImage from '~/public/images/maneki/error.svg' import { MenuPopper, PageHeader } from '~/styles' -const { disablePdfGeneration } = envGlobalVar() - gql` fragment AllInvoiceDetailsForCustomerInvoiceDetails on Invoice { id @@ -134,6 +135,7 @@ gql` customer { id } + ...InvoiceDetailsForInvoiceOverview ...InvoiceForCreditNotesTable ...InvoiceForDetailsTable @@ -176,6 +178,24 @@ gql` } } + query getInvoiceFees($id: ID!) { + invoice(id: $id) { + id + fees { + ...FeeForInvoiceDetailsTable + } + } + } + + query getInvoiceSubscriptions($id: ID!) { + invoice(id: $id) { + id + invoiceSubscriptions { + ...InvoiceSubscriptionForInvoiceDetailsTable + } + } + } + query getInvoiceCustomer($id: ID!) { customer(id: $id) { id @@ -284,6 +304,7 @@ gql` ${SalesforceIntegrationInfosForInvoiceOverviewFragmentDoc} ${AvalaraIntegrationInfosForInvoiceOverviewFragmentDoc} ${CustomerForInvoiceOverviewFragmentDoc} + ${InvoiceSubscriptionForInvoiceDetailsTableFragmentDoc} ` const getErrorMessageFromErrorDetails = ( @@ -352,7 +373,26 @@ const CustomerInvoiceDetails = () => { variables: { id: invoiceId as string }, skip: !invoiceId, }) + const { + data: feesData, + loading: feesLoading, + error: feesError, + } = useGetInvoiceFeesQuery({ + variables: { id: invoiceId as string }, + skip: !invoiceId, + }) + const { + data: invoiceSubscriptionData, + loading: invoiceSubscriptionLoading, + error: invoiceSubscriptionError, + } = useGetInvoiceSubscriptionsQuery({ + variables: { id: invoiceId as string }, + skip: !invoiceId, + notifyOnNetworkStatusChange: true, + }) const invoice = data?.invoice + const invoiceFees = feesData?.invoice?.fees + const invoiceSubscriptions = invoiceSubscriptionData?.invoice?.invoiceSubscriptions const { data: customerData, loading: customerLoading } = useGetInvoiceCustomerQuery({ variables: { id: invoice?.customer?.id as string }, @@ -562,7 +602,9 @@ const CustomerInvoiceDetails = () => { const canRecordPayment = !!invoice && actions.canRecordPayment(invoice) - const hasError = (!!error || !data?.invoice) && !loading + const isLoading = loading || customerLoading || feesLoading || invoiceSubscriptionLoading + const hasError = + (!!error || !!feesError || !!invoiceSubscriptionError || !data?.invoice) && !isLoading const hasTaxProviderError = errorDetails?.find( ({ errorCode }) => errorCode === ErrorCodesEnum.TaxError, ) @@ -618,8 +660,10 @@ const CustomerInvoiceDetails = () => { hasError={hasError} hasTaxProviderError={!!hasTaxProviderError} invoice={data?.invoice as Invoice} - loading={loading || customerLoading} + loading={isLoading} customer={customer} + fees={invoiceFees} + invoiceSubscriptions={invoiceSubscriptions} loadingInvoiceDownload={loadingInvoiceDownload} loadingRefreshInvoice={loadingRefreshInvoice} loadingRetryInvoice={loadingRetryInvoice} @@ -723,9 +767,10 @@ const CustomerInvoiceDetails = () => { hasError, hasTaxProviderError, data?.invoice, - loading, - customerLoading, + isLoading, customer, + invoiceFees, + invoiceSubscriptions, loadingInvoiceDownload, loadingRefreshInvoice, loadingRetryInvoice, @@ -749,16 +794,6 @@ const CustomerInvoiceDetails = () => { canRecordPayment, ]) - // TODO: Compare this with src/hooks/usePermissionsInvoiceActions.ts: - // We don't check the same permissions here, but we could refactor this to use the same logic - const canFinalizeInvoice = - status === InvoiceStatusTypeEnum.Draft && - taxStatus !== InvoiceTaxStatusTypeEnum.Pending && - hasPermissions(['draftInvoicesUpdate']) - const canDownloadInvoice = - (status !== InvoiceStatusTypeEnum.Pending || taxStatus !== InvoiceTaxStatusTypeEnum.Pending) && - !disablePdfGeneration - return ( <> @@ -795,7 +830,7 @@ const CustomerInvoiceDetails = () => { > {translate('text_1724164767403kyknbaw13mg')} - ) : canFinalizeInvoice ? ( + ) : actions.canFinalize({ status }) ? ( <> - ) : canDownloadInvoice ? ( + ) : actions.canDownload({ status, taxStatus }) ? (
diff --git a/src/pages/InvoiceOverview.tsx b/src/pages/InvoiceOverview.tsx index 45f98e04be..48c8115604 100644 --- a/src/pages/InvoiceOverview.tsx +++ b/src/pages/InvoiceOverview.tsx @@ -22,6 +22,7 @@ import { import { InvoiceCreditNotesTable } from '~/components/invoices/InvoiceCreditNotesTable' import { InvoiceCustomerInfos } from '~/components/invoices/InvoiceCustomerInfos' import { Metadatas } from '~/components/invoices/Metadatas' +import { InvoiceFeesForDisplay, InvoiceSubscriptionsForDisplay } from '~/components/invoices/types' import { envGlobalVar } from '~/core/apolloClient' import { buildAnrokInvoiceUrl, @@ -189,6 +190,8 @@ interface InvoiceOverviewProps { syncSalesforceIntegrationInvoice: SyncSalesforceInvoiceMutationFn loadingSyncHubspotIntegrationInvoice: boolean loadingSyncSalesforceIntegrationInvoice: boolean + fees: InvoiceFeesForDisplay + invoiceSubscriptions: InvoiceSubscriptionsForDisplay } const InlineLink = ({ children, ...props }: LinkProps) => { @@ -337,6 +340,8 @@ const InvoiceOverview = memo( loadingSyncHubspotIntegrationInvoice, loadingSyncSalesforceIntegrationInvoice, customer, + fees, + invoiceSubscriptions, }: InvoiceOverviewProps) => { const { translate } = useInternationalization() const { invoiceId } = useParams() @@ -562,6 +567,8 @@ const InvoiceOverview = memo( invoice={invoice as Invoice} editFeeDrawerRef={editFeeDrawerRef} deleteAdjustedFeeDialogRef={deleteAdjustedFeeDialogRef} + fees={fees} + invoiceSubscriptions={invoiceSubscriptions} /> {!!formattedCreditNotes?.length && invoice?.status !== InvoiceStatusTypeEnum.Draft && diff --git a/src/pages/subscriptions/CreateSubscription.tsx b/src/pages/subscriptions/CreateSubscription.tsx index bab4cb15e5..94cc2388d7 100644 --- a/src/pages/subscriptions/CreateSubscription.tsx +++ b/src/pages/subscriptions/CreateSubscription.tsx @@ -32,15 +32,15 @@ import { TextInputField, } from '~/components/form' import { - EditInvoiceDisplayName, - EditInvoiceDisplayNameRef, -} from '~/components/invoices/EditInvoiceDisplayName' -import { ChargesSection } from '~/components/plans/ChargesSection' + EditInvoiceDisplayNameDialog, + EditInvoiceDisplayNameDialogRef, +} from '~/components/invoices/EditInvoiceDisplayNameDialog' import { CommitmentsSection } from '~/components/plans/CommitmentsSection' -import { FixedFeeSection } from '~/components/plans/FixedFeeSection' import { PlanSettingsSection } from '~/components/plans/PlanSettingsSection' import { ProgressiveBillingSection } from '~/components/plans/ProgressiveBillingSection' +import { SubscriptionFeeSection } from '~/components/plans/SubscriptionFeeSection' import { LocalChargeInput } from '~/components/plans/types' +import { UsageChargesSection } from '~/components/plans/UsageChargesSection' import { PremiumWarningDialog, PremiumWarningDialogRef } from '~/components/PremiumWarningDialog' import { REDIRECTION_ORIGIN_SUBSCRIPTION_USAGE } from '~/components/subscriptions/SubscriptionUsageLifetimeGraph' import { WarningDialog, WarningDialogRef } from '~/components/WarningDialog' @@ -220,7 +220,7 @@ const CreateSubscription = () => { const { formatTimeOrgaTZ } = useOrganizationInfos() const { isRunningInSalesForceIframe } = useSalesForceConfig() - const editInvoiceDisplayNameRef = useRef(null) + const editInvoiceDisplayNameDialogRef = useRef(null) const warningDialogRef = useRef(null) const premiumWarningDialogRef = useRef(null) const [showCurrencyError, setShowCurrencyError] = useState(false) @@ -854,20 +854,20 @@ const CreateSubscription = () => {
- -
@@ -888,7 +888,7 @@ const CreateSubscription = () => { @@ -917,7 +917,7 @@ const CreateSubscription = () => { }} /> - + ) diff --git a/translations/base.json b/translations/base.json index 69e4558757..3042ada5de 100644 --- a/translations/base.json +++ b/translations/base.json @@ -951,7 +951,6 @@ "text_6661fc17337de3591e29e3d1": "Billing period", "text_6661fc17337de3591e29e3d3": "Frequency at which the subscription recurs.", "text_6661fc17337de3591e29e3e1": "Tax rates", - "text_6661fc17337de3591e29e3e3": "Select a tax rate", "text_6661fc17337de3591e29e3e7": "Pricing settings", "text_6661fc17337de3591e29e3e9": "Customize the pricing structure of the plan.", "text_6661fc17337de3591e29e3ed": "{{interval}} recurring amount paid by the customer regardless of their usage consumption.", diff --git a/translations/pt-BR.json b/translations/pt-BR.json index 1b51a307db..7586732917 100644 --- a/translations/pt-BR.json +++ b/translations/pt-BR.json @@ -951,7 +951,6 @@ "text_6661fc17337de3591e29e3d1": "Período de faturamento", "text_6661fc17337de3591e29e3d3": "Frequência com que a assinatura se repete.", "text_6661fc17337de3591e29e3e1": "Alíquotas de imposto", - "text_6661fc17337de3591e29e3e3": "Selecione uma alíquota de imposto", "text_6661fc17337de3591e29e3e7": "Configurações de preço", "text_6661fc17337de3591e29e3e9": "Personalize a estrutura de preços do plano.", "text_6661fc17337de3591e29e3ed": "Valor recorrente {{interval}} pago pelo cliente, independentemente do consumo de uso.",