diff --git a/src/components/form/ComboBox/types.ts b/src/components/form/ComboBox/types.ts index aacb57ef1..7c69bfdc9 100644 --- a/src/components/form/ComboBox/types.ts +++ b/src/components/form/ComboBox/types.ts @@ -29,7 +29,7 @@ interface BasicComboboxProps extends Omit { - data: ComboboxDataGrouped[] + data?: ComboboxDataGrouped[] renderGroupHeader?: Record } diff --git a/src/components/invoices/details/DeleteAdjustedFeeDialog.tsx b/src/components/invoices/details/DeleteAdjustedFeeDialog.tsx index fb57d4af9..05cddb85d 100644 --- a/src/components/invoices/details/DeleteAdjustedFeeDialog.tsx +++ b/src/components/invoices/details/DeleteAdjustedFeeDialog.tsx @@ -3,6 +3,7 @@ import { forwardRef, useImperativeHandle, useRef, useState } from 'react' import { Typography } from '~/components/designSystem' import { WarningDialog, WarningDialogRef } from '~/components/WarningDialog' +import { addToast } from '~/core/apolloClient' import { TExtendedRemainingFee } from '~/core/formats/formatInvoiceItemsMap' import { useDestroyAdjustedFeeMutation } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' @@ -37,6 +38,11 @@ export const DeleteAdjustedFeeDialog = forwardRef((_ onCompleted({ destroyAdjustedFee }) { if (destroyAdjustedFee?.id) { dialogRef.current?.closeDialog() + + addToast({ + message: translate('text_1738084927595tzdnuy6oxyu'), + severity: 'success', + }) } }, refetchQueries: ['getInvoiceDetails'], @@ -64,7 +70,7 @@ export const DeleteAdjustedFeeDialog = forwardRef((_ }, }) }} - continueText={translate('text_65a6b4e2cb38d9b70ec53c67')} + continueText={translate('text_65a6b4e2cb38d9b70ec54035')} /> ) }) diff --git a/src/components/invoices/details/EditFeeDrawer.tsx b/src/components/invoices/details/EditFeeDrawer.tsx index 34406b9ef..378bc1263 100644 --- a/src/components/invoices/details/EditFeeDrawer.tsx +++ b/src/components/invoices/details/EditFeeDrawer.tsx @@ -1,13 +1,14 @@ import { gql } from '@apollo/client' import { InputAdornment } from '@mui/material' import { useFormik } from 'formik' -import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react' +import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react' import styled from 'styled-components' import { number, object, string } from 'yup' -import { Alert, Button, Drawer, DrawerRef, Typography } from '~/components/designSystem' +import { Alert, Button, Drawer, DrawerRef, Skeleton, Typography } from '~/components/designSystem' import { AmountInputField, ComboBoxField, TextInputField } from '~/components/form' import { DrawerLayout } from '~/components/layouts/Drawer' +import { ALL_FILTER_VALUES } from '~/core/constants/form' import { TExtendedRemainingFee } from '~/core/formats/formatInvoiceItemsMap' import { getCurrencySymbol, intlFormatNumber } from '~/core/formats/intlFormatNumber' import { @@ -16,17 +17,74 @@ import { CreateAdjustedFeeInput, CurrencyEnum, useCreateAdjustedFeeMutation, + useGetInvoiceDetailsForCreateFeeDrawerQuery, } from '~/generated/graphql' import { useInternationalization } from '~/hooks/core/useInternationalization' import { theme } from '~/styles' import { InvoiceWrapper } from './InvoiceDetailsTable' import { InvoiceDetailsTableBodyLine } from './InvoiceDetailsTableBodyLine' +import { + getChargesComboboxDataFromInvoiceSubscription, + getChargesFiltersComboboxDataFromInvoiceSubscription, +} from './utils' gql` + fragment InvoiceSubscriptionForCreateFeeDrawer on InvoiceSubscription { + subscription { + id + plan { + id + charges { + id + invoiceDisplayName + chargeModel + prorated + filters { + id + invoiceDisplayName + values + } + billableMetric { + id + name + code + } + } + } + } + fees { + id + charge { + id + filters { + id + values + } + } + chargeFilter { + id + } + } + } + fragment FeeForEditfeeDrawer on Fee { id currency + charge { + id + chargeModel + prorated + } + } + + query getInvoiceDetailsForCreateFeeDrawer($invoiceId: ID!) { + invoice(id: $invoiceId) { + id + invoiceSubscriptions { + ...InvoiceSubscriptionForCreateFeeDrawer + } + } } mutation createAdjustedFee($input: CreateAdjustedFeeInput!) { @@ -37,11 +95,13 @@ gql` ` type EditFeeDrawerProps = { + invoiceId: string + invoiceSubscriptionId?: string fee?: TExtendedRemainingFee | undefined } -export interface EditFeeDrawerRef extends DrawerRef { - openDrawer: (data?: EditFeeDrawerProps) => unknown +export interface EditFeeDrawerRef { + openDrawer: (data: EditFeeDrawerProps) => unknown closeDrawer: () => unknown } @@ -51,6 +111,21 @@ export const EditFeeDrawer = forwardRef((_, ref) => { const [localData, setLocalData] = useState(undefined) const fee = localData?.fee const currency = fee?.currency || CurrencyEnum.Usd + + console.log('fee', fee?.charge?.chargeModel) + + const { loading: invoiceLoading, data: invoiceData } = + useGetInvoiceDetailsForCreateFeeDrawerQuery({ + variables: { + invoiceId: localData?.invoiceId || '', + }, + skip: !localData?.invoiceId && !localData?.invoiceSubscriptionId, + }) + const currentInvoiceSubscription = invoiceData?.invoice?.invoiceSubscriptions?.find( + (invoiceSubscription) => + invoiceSubscription.subscription.id === localData?.invoiceSubscriptionId, + ) + const [createFee] = useCreateAdjustedFeeMutation({ onCompleted({ createAdjustedFee }) { if (createAdjustedFee?.id) { @@ -62,6 +137,7 @@ export const EditFeeDrawer = forwardRef((_, ref) => { }, refetchQueries: ['getInvoiceDetails'], }) + const formikProps = useFormik< Omit, 'feeId'> & { adjustmentType?: AdjustedFeeTypeEnum.AdjustedAmount | AdjustedFeeTypeEnum.AdjustedUnits @@ -69,12 +145,23 @@ export const EditFeeDrawer = forwardRef((_, ref) => { >({ initialValues: { invoiceDisplayName: fee?.invoiceDisplayName || '', + chargeFilterId: '', + chargeId: '', unitPreciseAmount: undefined, units: undefined, adjustmentType: undefined, }, validationSchema: object().shape({ invoiceDisplayName: string(), + chargeId: string().test({ + test: function (value) { + // If it's a fee edition context, this validation is not needed + if (!!fee) return true + + return !!value + }, + }), + chargeFilterId: string(), unitPreciseAmount: number().test({ test: function (value, { from }) { if ( @@ -97,32 +184,78 @@ export const EditFeeDrawer = forwardRef((_, ref) => { return true }, }), - adjustmentType: string(), + adjustmentType: string().required(''), }), validateOnMount: true, enableReinitialize: true, onSubmit: async ({ adjustmentType, unitPreciseAmount, units, ...values }) => { - await createFee({ - variables: { - input: { - ...values, - feeId: fee?.id as string, - units: !!adjustmentType ? Number(units || 0) : undefined, - unitPreciseAmount: - adjustmentType === AdjustedFeeTypeEnum.AdjustedAmount - ? String(unitPreciseAmount) - : undefined, - invoiceDisplayName: values.invoiceDisplayName || undefined, + const defaultPayload: CreateAdjustedFeeInput = { + invoiceId: localData?.invoiceId || '', + units: !!adjustmentType ? Number(units || 0) : undefined, + unitPreciseAmount: + adjustmentType === AdjustedFeeTypeEnum.AdjustedAmount + ? String(unitPreciseAmount) + : undefined, + invoiceDisplayName: values.invoiceDisplayName || undefined, + } + + if (!!fee) { + // Edit scenario + await createFee({ + variables: { + input: { + ...defaultPayload, + feeId: fee?.id, + }, }, - }, - }) + }) + } else { + // Creation scenario + await createFee({ + variables: { + input: { + ...defaultPayload, + chargeId: values.chargeId, + chargeFilterId: + values.chargeFilterId === ALL_FILTER_VALUES + ? null + : values.chargeFilterId || undefined, + subscriptionId: localData?.invoiceSubscriptionId || '', + }, + }, + }) + } }, }) - // Reset unitPreciseAmount and units if adjustmentType changes + const chargesComboboxData = useMemo(() => { + return getChargesComboboxDataFromInvoiceSubscription({ + invoiceSubscription: currentInvoiceSubscription, + }) + }, [currentInvoiceSubscription]) + + const chargeFiltersComboboxData = useMemo(() => { + return getChargesFiltersComboboxDataFromInvoiceSubscription({ + defaultFilterOptionLabel: translate('text_64e620bca31226337ffc62ad'), + invoiceSubscription: currentInvoiceSubscription, + selectedChargeId: formikProps.values.chargeId, + }) + }, [currentInvoiceSubscription, formikProps.values.chargeId, translate]) + + const isChargeFilterIdValid: boolean = useMemo(() => { + if (!fee && !!chargeFiltersComboboxData?.length && !formikProps.values.chargeFilterId) { + return false + } + + return true + }, [chargeFiltersComboboxData?.length, fee, formikProps.values.chargeFilterId]) + + // Reset unitPreciseAmount and units if adjustmentType changes, also triggers again validations useEffect(() => { - formikProps.setFieldValue('unitPreciseAmount', undefined) - formikProps.setFieldValue('units', undefined) + const newValues = { ...formikProps.values, unitPreciseAmount: undefined, units: undefined } + + formikProps.setValues(newValues) + // eslint-disable-next-line react-hooks/exhaustive-deps }, [formikProps.values.adjustmentType]) @@ -134,14 +267,60 @@ export const EditFeeDrawer = forwardRef((_, ref) => { closeDrawer: () => drawerRef.current?.closeDrawer(), })) + const { displayChargeIdField, displayChargeFilterIdField, displayAdjustmentInputs } = + useMemo(() => { + const hasChargeFiltersComboboxData = !!chargeFiltersComboboxData?.length + + return { + displayChargeIdField: !fee, + displayChargeFilterIdField: !fee && hasChargeFiltersComboboxData, + displayAdjustmentInputs: + !!fee || + (hasChargeFiltersComboboxData + ? !!formikProps.values.chargeFilterId + : !!formikProps.values.chargeId), + } + }, [ + chargeFiltersComboboxData?.length, + fee, + formikProps.values.chargeFilterId, + formikProps.values.chargeId, + ]) + + const isUnitAdjustmentTypeDisabled = useMemo(() => { + if (!!fee) { + return ( + fee?.charge?.chargeModel === ChargeModelEnum.Percentage || + fee?.charge?.chargeModel === ChargeModelEnum.Dynamic || + (fee?.charge?.chargeModel === ChargeModelEnum.Graduated && fee.charge.prorated) + ) + } + + const selectedCharge = currentInvoiceSubscription?.subscription.plan.charges?.find( + (charge) => charge.id === formikProps.values.chargeId, + ) + + if (!selectedCharge) return false + + return ( + selectedCharge?.chargeModel === ChargeModelEnum.Percentage || + selectedCharge?.chargeModel === ChargeModelEnum.Dynamic || + (selectedCharge?.chargeModel === ChargeModelEnum.Graduated && selectedCharge.prorated) + ) + }, [currentInvoiceSubscription?.subscription.plan.charges, fee, formikProps.values.chargeId]) + return ( { formikProps.resetForm() formikProps.validateForm() @@ -151,10 +330,18 @@ export const EditFeeDrawer = forwardRef((_, ref) => { {!!fee && ( <> @@ -213,94 +400,127 @@ export const EditFeeDrawer = forwardRef((_, ref) => { />
- - - - {!!formikProps.values.adjustmentType && ( + {!fee && invoiceLoading ? ( + + ) : ( <> - - + )} - {formikProps.values.adjustmentType === AdjustedFeeTypeEnum.AdjustedAmount && ( - <> - - {getCurrencySymbol(currency)} - - ), - }} - /> - - - - {translate('text_65a6b4e2cb38d9b70ec53d83')} - - - {intlFormatNumber( - Number( - Number(formikProps.values.units || 0) * - Number(formikProps.values.unitPreciseAmount || 0) || 0, - ), - { - currencyDisplay: 'symbol', - currency: currency, - maximumFractionDigits: 15, - }, + {displayChargeFilterIdField && ( + + )} + + {displayAdjustmentInputs && ( + <> + + + + {!!formikProps.values.adjustmentType && ( + <> +
+ + + {formikProps.values.adjustmentType === + AdjustedFeeTypeEnum.AdjustedAmount && ( + <> + + {getCurrencySymbol(currency)} + + ), + }} + /> + +
+ + {translate('text_65a6b4e2cb38d9b70ec53d83')} + + + {intlFormatNumber( + Number( + Number(formikProps.values.units || 0) * + Number(formikProps.values.unitPreciseAmount || 0) || 0, + ), + { + currencyDisplay: 'symbol', + currency: currency, + maximumFractionDigits: 15, + }, + )} + +
+ )} - - - - )} - - - {!!fee?.charge && ( - - {translate( - formikProps.values.adjustmentType === AdjustedFeeTypeEnum.AdjustedAmount - ? 'text_65a6b4e2cb38d9b70ec53d93' - : 'text_6613b48da4efd500cacc44d3', +
+ + {!!fee?.charge && ( + + {translate( + formikProps.values.adjustmentType === + AdjustedFeeTypeEnum.AdjustedAmount + ? 'text_65a6b4e2cb38d9b70ec53d93' + : 'text_6613b48da4efd500cacc44d3', + )} + + )} + )} - + )} )} @@ -315,7 +535,7 @@ export const EditFeeDrawer = forwardRef((_, ref) => { +
+ + + )} ) @@ -538,13 +571,6 @@ export const InvoiceWrapper = styled.section<{ padding: 0 !important; } - .inner-table { - thead { - /* hide header */ - visibility: collapse; - } - } - .collapse-header { display: block; width: 100%; diff --git a/src/components/invoices/details/InvoiceDetailsTableBodyLine.tsx b/src/components/invoices/details/InvoiceDetailsTableBodyLine.tsx index 143276d5b..243fd0765 100644 --- a/src/components/invoices/details/InvoiceDetailsTableBodyLine.tsx +++ b/src/components/invoices/details/InvoiceDetailsTableBodyLine.tsx @@ -2,6 +2,7 @@ import { gql } from '@apollo/client' import { Stack } from '@mui/material' import { memo, RefObject } from 'react' +import { useParams } from 'react-router-dom' import styled from 'styled-components' import { Button, Popper, Tooltip, Typography } from '~/components/designSystem' @@ -170,6 +171,7 @@ export const InvoiceDetailsTableBodyLine = memo( succeededDate, hasTaxProviderError, }: InvoiceDetailsTableBodyLineProps) => { + const { invoiceId = '' } = useParams() const { translate } = useInternationalization() const chargeModel = fee?.charge?.chargeModel const isTrueUpFee = !!fee?.metadata?.isTrueUpFee && !!fee?.charge?.minAmountCents @@ -318,7 +320,7 @@ export const InvoiceDetailsTableBodyLine = memo( if (isAdjustedFee) { deleteAdjustedFeeDialogRef?.current?.openDialog({ fee }) } else { - editFeeDrawerRef?.current?.openDrawer({ fee }) + editFeeDrawerRef?.current?.openDrawer({ fee, invoiceId }) } closePopper() }} diff --git a/src/components/invoices/details/InvoiceDetailsTableHeader.tsx b/src/components/invoices/details/InvoiceDetailsTableHeader.tsx index e77980399..95a50e43d 100644 --- a/src/components/invoices/details/InvoiceDetailsTableHeader.tsx +++ b/src/components/invoices/details/InvoiceDetailsTableHeader.tsx @@ -2,20 +2,28 @@ import { memo } from 'react' import { Typography } from '~/components/designSystem' import { useInternationalization } from '~/hooks/core/useInternationalization' +import { tw } from '~/styles/utils' type InvoiceDetailsTableHeaderProps = { canHaveUnitPrice: boolean displayName: string isDraftInvoice: boolean + className?: string hideVat?: boolean } export const InvoiceDetailsTableHeader = memo( - ({ canHaveUnitPrice, displayName, isDraftInvoice, hideVat }: InvoiceDetailsTableHeaderProps) => { + ({ + canHaveUnitPrice, + className, + displayName, + isDraftInvoice, + hideVat, + }: InvoiceDetailsTableHeaderProps) => { const { translate } = useInternationalization() return ( - + diff --git a/src/components/invoices/details/InvoiceFeeAdvanceDetailsTable.tsx b/src/components/invoices/details/InvoiceFeeAdvanceDetailsTable.tsx index 7f0cc1096..ba7072328 100644 --- a/src/components/invoices/details/InvoiceFeeAdvanceDetailsTable.tsx +++ b/src/components/invoices/details/InvoiceFeeAdvanceDetailsTable.tsx @@ -38,6 +38,7 @@ interface InvoiceFeeAdvanceDetailsTableProps { subscription: TSubscriptionDataForDisplay['subscription'] customer: Customer canHaveUnitPrice: boolean + hasOldZeroFeeManagement: boolean isDraftInvoice: boolean currency: CurrencyEnum editFeeDrawerRef: RefObject @@ -49,6 +50,7 @@ export const InvoiceFeeAdvanceDetailsTable = memo( subscription, customer, canHaveUnitPrice, + hasOldZeroFeeManagement, isDraftInvoice, currency, editFeeDrawerRef, @@ -98,57 +100,56 @@ export const InvoiceFeeAdvanceDetailsTable = memo( ) })} {/* Should be only displayed for draft invoices */} - {subscription.feesInAdvanceZero.length > 0 && ( - <> - - -
- -
- - - {/* This header is hidden in css. Only present to give the body the correct shape */} - - - {subscription.feesInAdvanceZero.map((feeInAdvanceZero) => { - return ( - - ) - })} - -
-
- - - + {hasOldZeroFeeManagement && subscription.feesInAdvanceZero.length > 0 && ( + + +
+ +
+ + + {/* This header is hidden in css. Only present to give the body the correct shape */} + + + {subscription.feesInAdvanceZero.map((feeInAdvanceZero) => { + return ( + + ) + })} + +
+
+ + )} )} diff --git a/src/components/invoices/details/InvoiceFeeArrearsDetailsTable.tsx b/src/components/invoices/details/InvoiceFeeArrearsDetailsTable.tsx index 4d7fdba6b..14fad1c52 100644 --- a/src/components/invoices/details/InvoiceFeeArrearsDetailsTable.tsx +++ b/src/components/invoices/details/InvoiceFeeArrearsDetailsTable.tsx @@ -41,6 +41,7 @@ interface InvoiceFeeArrearsDetailsTableProps { subscription: TSubscriptionDataForDisplay['subscription'] customer: Customer canHaveUnitPrice: boolean + hasOldZeroFeeManagement: boolean isDraftInvoice: boolean currency: CurrencyEnum editFeeDrawerRef: RefObject @@ -52,6 +53,7 @@ export const InvoiceFeeArrearsDetailsTable = memo( subscription, customer, canHaveUnitPrice, + hasOldZeroFeeManagement, isDraftInvoice, currency, editFeeDrawerRef, @@ -100,59 +102,58 @@ export const InvoiceFeeArrearsDetailsTable = memo( ) })} {/* Should be only displayed for draft invoices */} - {subscription.feesInArrearsZero.length > 0 && ( - <> - - -
- +
+ + + {/* This header is hidden in css. Only present to give the body the correct shape */} + + + {(subscription.feesInArrearsZero as TExtendedRemainingFee[]).map( + (feeInArrearZero) => { + return ( + + ) }, - subscription.feesInArrearsZero.length, )} - - - -
- {/* This header is hidden in css. Only present to give the body the correct shape */} - - - {(subscription.feesInArrearsZero as TExtendedRemainingFee[]).map( - (feeInArrearZero) => { - return ( - - ) - }, - )} - -
-
- - - + + + + + )} )} diff --git a/src/components/invoices/details/__tests__/fixture.ts b/src/components/invoices/details/__tests__/fixture.ts new file mode 100644 index 000000000..7d8148c90 --- /dev/null +++ b/src/components/invoices/details/__tests__/fixture.ts @@ -0,0 +1,437 @@ +export const invoiceSubTwoChargeOneFilter = { + subscription: { + id: '0cf2e2dd-7371-4541-b04f-00f5d20f5aba', + plan: { + id: '203adc17-6898-4c33-948e-c2fb97d9b053', + charges: [ + { + id: 'c53a7a35-fa5e-407b-bf87-2b96dc1dead2', + invoiceDisplayName: '', + filters: [], + billableMetric: { + id: 'e30d1853-461b-4107-a92a-55dd0752663a', + name: 'Count BM', + code: 'count_bm', + }, + }, + { + id: '5de3ebeb-1d6d-4aa1-8866-1fffc948224a', + invoiceDisplayName: '', + filters: [ + { + id: 'f10c88e6-bc95-4c1e-92fe-e0f94ac66571', + invoiceDisplayName: null, + values: { + payment_type: ['__ALL_FILTER_VALUES__'], + region: ['asia'], + }, + }, + { + id: '77d0f439-1e06-4766-a754-537a8aeecf72', + invoiceDisplayName: null, + values: { + payment_type: ['card'], + region: ['eu', 'us'], + }, + }, + ], + billableMetric: { + id: '2a9dae43-b07b-4717-bf23-1b8d704d4ec5', + name: 'bm with filters', + code: 'bm_with_filters', + }, + }, + { + id: '9191b741-ee76-4cae-b9e2-c34f2f0d7b15', + invoiceDisplayName: '', + filters: [], + billableMetric: { + id: '2020007c-1c98-4df6-90c9-747990cc988f', + name: 'Sum BM', + code: 'sum_bm', + }, + }, + ], + }, + }, + fees: [ + { + id: '1ff3324c-9f9b-4120-b10c-5af62774b9ff', + charge: { + id: '9191b741-ee76-4cae-b9e2-c34f2f0d7b15', + filters: [], + }, + chargeFilter: null, + }, + { + id: 'f435a64d-f470-4cec-97a8-52c08d665af7', + charge: null, + chargeFilter: null, + }, + { + id: 'bf091d61-df22-4642-a5d5-30f814bb5b7f', + charge: { + id: '5de3ebeb-1d6d-4aa1-8866-1fffc948224a', + filters: [ + { + id: 'f10c88e6-bc95-4c1e-92fe-e0f94ac66571', + values: { + payment_type: ['__ALL_FILTER_VALUES__'], + region: ['asia'], + }, + }, + { + id: '77d0f439-1e06-4766-a754-537a8aeecf72', + values: { + payment_type: ['card'], + region: ['eu', 'us'], + }, + }, + ], + }, + chargeFilter: { + id: '77d0f439-1e06-4766-a754-537a8aeecf72', + }, + }, + ], +} +export const invoiceSubTwoChargeOneFilterDefaultAlreadySelected = { + subscription: { + id: '0cf2e2dd-7371-4541-b04f-00f5d20f5aba', + plan: { + id: '203adc17-6898-4c33-948e-c2fb97d9b053', + charges: [ + { + id: 'c53a7a35-fa5e-407b-bf87-2b96dc1dead2', + invoiceDisplayName: '', + filters: [], + billableMetric: { + id: 'e30d1853-461b-4107-a92a-55dd0752663a', + name: 'Count BM', + code: 'count_bm', + }, + }, + { + id: '5de3ebeb-1d6d-4aa1-8866-1fffc948224a', + invoiceDisplayName: '', + filters: [ + { + id: 'f10c88e6-bc95-4c1e-92fe-e0f94ac66571', + invoiceDisplayName: null, + values: { + payment_type: ['__ALL_FILTER_VALUES__'], + region: ['asia'], + }, + }, + { + id: '77d0f439-1e06-4766-a754-537a8aeecf72', + invoiceDisplayName: null, + values: { + payment_type: ['card'], + region: ['eu', 'us'], + }, + }, + ], + billableMetric: { + id: '2a9dae43-b07b-4717-bf23-1b8d704d4ec5', + name: 'bm with filters', + code: 'bm_with_filters', + }, + }, + { + id: '9191b741-ee76-4cae-b9e2-c34f2f0d7b15', + invoiceDisplayName: '', + filters: [], + billableMetric: { + id: '2020007c-1c98-4df6-90c9-747990cc988f', + name: 'Sum BM', + code: 'sum_bm', + }, + }, + ], + }, + }, + fees: [ + { + id: '9faf3047-55f6-4465-a32a-dd871b5d7c6e', + charge: null, + chargeFilter: null, + }, + { + id: '550f45e1-f6b7-4fdf-87bb-d526938d24c4', + charge: { + id: '5de3ebeb-1d6d-4aa1-8866-1fffc948224a', + filters: [ + { + id: 'f10c88e6-bc95-4c1e-92fe-e0f94ac66571', + values: { + payment_type: ['__ALL_FILTER_VALUES__'], + region: ['asia'], + }, + }, + { + id: '77d0f439-1e06-4766-a754-537a8aeecf72', + values: { + payment_type: ['card'], + region: ['eu', 'us'], + }, + }, + ], + }, + chargeFilter: { + id: '77d0f439-1e06-4766-a754-537a8aeecf72', + }, + }, + { + id: 'b25d4141-c21a-4ec9-8902-28c650c009bc', + charge: { + id: '5de3ebeb-1d6d-4aa1-8866-1fffc948224a', + filters: [ + { + id: 'f10c88e6-bc95-4c1e-92fe-e0f94ac66571', + values: { + payment_type: ['__ALL_FILTER_VALUES__'], + region: ['asia'], + }, + }, + { + id: '77d0f439-1e06-4766-a754-537a8aeecf72', + values: { + payment_type: ['card'], + region: ['eu', 'us'], + }, + }, + ], + }, + chargeFilter: null, + }, + ], +} + +export const invoiceSubThreeChargesMultipleFilters = { + subscription: { + id: '0cf2e2dd-7371-4541-b04f-00f5d20f5aba', + plan: { + id: '203adc17-6898-4c33-948e-c2fb97d9b053', + charges: [ + { + id: 'c53a7a35-fa5e-407b-bf87-2b96dc1dead2', + invoiceDisplayName: '', + filters: [], + billableMetric: { + id: 'e30d1853-461b-4107-a92a-55dd0752663a', + name: 'Count BM', + code: 'count_bm', + }, + }, + { + id: '5de3ebeb-1d6d-4aa1-8866-1fffc948224a', + invoiceDisplayName: '', + filters: [ + { + id: 'f10c88e6-bc95-4c1e-92fe-e0f94ac66571', + invoiceDisplayName: null, + values: { + payment_type: ['__ALL_FILTER_VALUES__'], + region: ['asia'], + }, + }, + { + id: '77d0f439-1e06-4766-a754-537a8aeecf72', + invoiceDisplayName: null, + values: { + payment_type: ['card'], + region: ['eu', 'us'], + }, + }, + ], + billableMetric: { + id: '2a9dae43-b07b-4717-bf23-1b8d704d4ec5', + name: 'bm with filters', + code: 'bm_with_filters', + }, + }, + { + id: '9191b741-ee76-4cae-b9e2-c34f2f0d7b15', + invoiceDisplayName: '', + filters: [], + billableMetric: { + id: '2020007c-1c98-4df6-90c9-747990cc988f', + name: 'Sum BM', + code: 'sum_bm', + }, + }, + ], + }, + }, + fees: [ + { + id: '8760bb62-946a-43e9-8b2b-29cc1fb26785', + charge: null, + chargeFilter: null, + }, + { + id: '03f8948e-c2ef-4227-9890-d17b96b7b747', + charge: { + id: '5de3ebeb-1d6d-4aa1-8866-1fffc948224a', + filters: [ + { + id: 'f10c88e6-bc95-4c1e-92fe-e0f94ac66571', + values: { + payment_type: ['__ALL_FILTER_VALUES__'], + region: ['asia'], + }, + }, + { + id: '77d0f439-1e06-4766-a754-537a8aeecf72', + values: { + payment_type: ['card'], + region: ['eu', 'us'], + }, + }, + ], + }, + chargeFilter: { + id: '77d0f439-1e06-4766-a754-537a8aeecf72', + }, + }, + ], +} + +export const invoiceSubAllFilterChargesSelected = { + subscription: { + id: '071e90fc-b9cb-4732-a416-06bbac7f3514', + plan: { + id: '234d2ce0-7107-4701-8b31-3aa5515156f0', + charges: [ + { + id: '332a641c-d82d-4c9e-bfbe-298b9fc2d1de', + invoiceDisplayName: '', + filters: [], + billableMetric: { + id: 'e30d1853-461b-4107-a92a-55dd0752663a', + name: 'Count BM', + code: 'count_bm', + }, + }, + { + id: '5b5e9402-d503-4e1f-8642-09634b2b763c', + invoiceDisplayName: '', + filters: [ + { + id: '203c0ec9-7811-4a46-8762-94504b1872ac', + invoiceDisplayName: null, + values: { + payment_type: ['__ALL_FILTER_VALUES__'], + region: ['asia'], + }, + }, + { + id: 'ababbf42-80d7-4d20-9561-c4f19ca7f9e1', + invoiceDisplayName: null, + values: { + payment_type: ['card'], + region: ['eu', 'us'], + }, + }, + ], + billableMetric: { + id: '2a9dae43-b07b-4717-bf23-1b8d704d4ec5', + name: 'bm with filters', + code: 'bm_with_filters', + }, + }, + { + id: '6ca2019f-af61-45e1-a58e-b616ad5615ef', + invoiceDisplayName: '', + filters: [], + billableMetric: { + id: '2020007c-1c98-4df6-90c9-747990cc988f', + name: 'Sum BM', + code: 'sum_bm', + }, + }, + ], + }, + }, + fees: [ + { + id: '824f455a-f865-4b7c-a318-d1527c488b84', + charge: null, + chargeFilter: null, + }, + { + id: 'cbdb54f4-b717-4417-be10-2c2d96784199', + charge: { + id: '5b5e9402-d503-4e1f-8642-09634b2b763c', + filters: [ + { + id: '203c0ec9-7811-4a46-8762-94504b1872ac', + values: { + payment_type: ['__ALL_FILTER_VALUES__'], + region: ['asia'], + }, + }, + { + id: 'ababbf42-80d7-4d20-9561-c4f19ca7f9e1', + values: { + payment_type: ['card'], + region: ['eu', 'us'], + }, + }, + ], + }, + chargeFilter: { + id: '203c0ec9-7811-4a46-8762-94504b1872ac', + }, + }, + { + id: 'fb479c76-56de-4335-a343-880840ccf790', + charge: { + id: '5b5e9402-d503-4e1f-8642-09634b2b763c', + filters: [ + { + id: '203c0ec9-7811-4a46-8762-94504b1872ac', + values: { + payment_type: ['__ALL_FILTER_VALUES__'], + region: ['asia'], + }, + }, + { + id: 'ababbf42-80d7-4d20-9561-c4f19ca7f9e1', + values: { + payment_type: ['card'], + region: ['eu', 'us'], + }, + }, + ], + }, + chargeFilter: { + id: 'ababbf42-80d7-4d20-9561-c4f19ca7f9e1', + }, + }, + { + id: 'd87e44fa-3814-4c6b-a1e8-4894add44f06', + charge: { + id: '5b5e9402-d503-4e1f-8642-09634b2b763c', + filters: [ + { + id: '203c0ec9-7811-4a46-8762-94504b1872ac', + values: { + payment_type: ['__ALL_FILTER_VALUES__'], + region: ['asia'], + }, + }, + { + id: 'ababbf42-80d7-4d20-9561-c4f19ca7f9e1', + values: { + payment_type: ['card'], + region: ['eu', 'us'], + }, + }, + ], + }, + chargeFilter: null, + }, + ], +} diff --git a/src/components/invoices/details/__tests__/utils.test.ts b/src/components/invoices/details/__tests__/utils.test.ts new file mode 100644 index 000000000..dc80dc55a --- /dev/null +++ b/src/components/invoices/details/__tests__/utils.test.ts @@ -0,0 +1,170 @@ +import { + invoiceSubAllFilterChargesSelected, + invoiceSubThreeChargesMultipleFilters, + invoiceSubTwoChargeOneFilter, + invoiceSubTwoChargeOneFilterDefaultAlreadySelected, +} from './fixture' + +import { + getChargesComboboxDataFromInvoiceSubscription, + getChargesFiltersComboboxDataFromInvoiceSubscription, +} from '../utils' + +describe('Invoices > Details > Utils', () => { + describe('getChargesComboboxDataFromInvoiceSubscription', () => { + it('returns an empty array of no invoiceSubscription passed', () => { + const result = getChargesComboboxDataFromInvoiceSubscription({ + invoiceSubscription: undefined, + }) + + expect(result).toEqual([]) + }) + + it('returns correct Combobox Data for two charges and one with filters', () => { + const result = getChargesComboboxDataFromInvoiceSubscription({ + invoiceSubscription: invoiceSubTwoChargeOneFilter, + }) + + expect(result).toEqual([ + { + description: 'count_bm', + label: 'Count BM', + value: 'c53a7a35-fa5e-407b-bf87-2b96dc1dead2', + }, + { + description: 'bm_with_filters', + label: 'bm with filters', + value: '5de3ebeb-1d6d-4aa1-8866-1fffc948224a', + }, + ]) + }) + + it('returns correct Combobox Data for 3 charges and one with multiple filters', () => { + const result = getChargesComboboxDataFromInvoiceSubscription({ + invoiceSubscription: invoiceSubThreeChargesMultipleFilters, + }) + + expect(result).toEqual([ + { + description: 'count_bm', + label: 'Count BM', + value: 'c53a7a35-fa5e-407b-bf87-2b96dc1dead2', + }, + { + description: 'bm_with_filters', + label: 'bm with filters', + value: '5de3ebeb-1d6d-4aa1-8866-1fffc948224a', + }, + { + description: 'sum_bm', + label: 'Sum BM', + value: '9191b741-ee76-4cae-b9e2-c34f2f0d7b15', + }, + ]) + }) + + it('returns correct Combobox Data if all charge with filter have fees', () => { + const result = getChargesComboboxDataFromInvoiceSubscription({ + invoiceSubscription: invoiceSubAllFilterChargesSelected, + }) + + expect(result).toEqual([ + { + description: 'count_bm', + label: 'Count BM', + value: '332a641c-d82d-4c9e-bfbe-298b9fc2d1de', + }, + { + description: 'sum_bm', + label: 'Sum BM', + value: '6ca2019f-af61-45e1-a58e-b616ad5615ef', + }, + ]) + }) + }) + + describe('getChargesFiltersComboboxDataFromInvoiceSubscription', () => { + it('returns an empty array of no invoiceSubscription passed', () => { + const result = getChargesFiltersComboboxDataFromInvoiceSubscription({ + defaultFilterOptionLabel: 'defaultFilterOptionLabel', + invoiceSubscription: undefined, + selectedChargeId: 'selectedChargeId', + }) + + expect(result).toEqual([]) + }) + + it('returns an empty array of no selectedChargeId passed', () => { + const result = getChargesFiltersComboboxDataFromInvoiceSubscription({ + defaultFilterOptionLabel: 'defaultFilterOptionLabel', + invoiceSubscription: invoiceSubTwoChargeOneFilter, + selectedChargeId: undefined, + }) + + expect(result).toEqual([]) + }) + + it('returns correct Combobox Data Filters for two charges and one with filters', () => { + const result = getChargesFiltersComboboxDataFromInvoiceSubscription({ + defaultFilterOptionLabel: 'defaultFilterOptionLabel', + invoiceSubscription: invoiceSubTwoChargeOneFilter, + selectedChargeId: '5de3ebeb-1d6d-4aa1-8866-1fffc948224a', + }) + + expect(result).toEqual([ + { + label: 'defaultFilterOptionLabel', + value: '__ALL_FILTER_VALUES__', + }, + { + label: 'payment_type • asia', + value: 'f10c88e6-bc95-4c1e-92fe-e0f94ac66571', + }, + ]) + }) + + it('returns correct Combobox Data Filters for two charges and one with filters while default filter already has a fee', () => { + const result = getChargesFiltersComboboxDataFromInvoiceSubscription({ + defaultFilterOptionLabel: 'defaultFilterOptionLabel', + invoiceSubscription: invoiceSubTwoChargeOneFilterDefaultAlreadySelected, + selectedChargeId: '5de3ebeb-1d6d-4aa1-8866-1fffc948224a', + }) + + expect(result).toEqual([ + { + label: 'payment_type • asia', + value: 'f10c88e6-bc95-4c1e-92fe-e0f94ac66571', + }, + ]) + }) + + it('returns correct Combobox Data Filters for 3 charges and one with multiple filters', () => { + const result = getChargesFiltersComboboxDataFromInvoiceSubscription({ + defaultFilterOptionLabel: 'defaultFilterOptionLabel', + invoiceSubscription: invoiceSubThreeChargesMultipleFilters, + selectedChargeId: '5de3ebeb-1d6d-4aa1-8866-1fffc948224a', + }) + + expect(result).toEqual([ + { + label: 'defaultFilterOptionLabel', + value: '__ALL_FILTER_VALUES__', + }, + { + label: 'payment_type • asia', + value: 'f10c88e6-bc95-4c1e-92fe-e0f94ac66571', + }, + ]) + }) + + it('returns correct Combobox Data Filters if all charge with filter have fees', () => { + const result = getChargesFiltersComboboxDataFromInvoiceSubscription({ + defaultFilterOptionLabel: 'defaultFilterOptionLabel', + invoiceSubscription: invoiceSubAllFilterChargesSelected, + selectedChargeId: '332a641c-d82d-4c9e-bfbe-298b9fc2d1de', + }) + + expect(result).toEqual([]) + }) + }) +}) diff --git a/src/components/invoices/details/utils.ts b/src/components/invoices/details/utils.ts new file mode 100644 index 000000000..df0f6d3ca --- /dev/null +++ b/src/components/invoices/details/utils.ts @@ -0,0 +1,108 @@ +import { ComboBoxProps } from '~/components/form' +import { ALL_FILTER_VALUES } from '~/core/constants/form' +import { composeChargeFilterDisplayName } from '~/core/formats/formatInvoiceItemsMap' +import { InvoiceSubscriptionForCreateFeeDrawerFragment } from '~/generated/graphql' + +export const getChargesComboboxDataFromInvoiceSubscription = ({ + invoiceSubscription, +}: { + invoiceSubscription: InvoiceSubscriptionForCreateFeeDrawerFragment | undefined +}): ComboBoxProps['data'] => { + if (!invoiceSubscription) return [] + // Create charge list + const planChargesWithoutAssociatedFees = invoiceSubscription.subscription.plan.charges?.filter( + (charge) => { + const chargeFeeExistsInAllFees = !invoiceSubscription?.fees?.some( + (invoiceSubFee) => invoiceSubFee.charge?.id === charge.id && !invoiceSubFee.chargeFilter, + ) + + // If charge has no filters + if (!charge.filters?.length) return chargeFeeExistsInAllFees + // If charge has filters, check if all filters are associated with a charge + return charge.filters?.some((filter) => { + const defaultFilterExistsInAllFees = invoiceSubscription?.fees?.find( + (invoiceSubFee) => + invoiceSubFee.charge?.id === charge.id && + !invoiceSubFee.chargeFilter && + !!invoiceSubFee.charge.filters, + ) + const chargeFilterExistsInAllFees = invoiceSubscription?.fees?.some( + (invoiceSubFee) => + invoiceSubFee.charge?.id === charge.id && invoiceSubFee.chargeFilter?.id === filter.id, + ) + + return !chargeFilterExistsInAllFees || !defaultFilterExistsInAllFees + }) + }, + ) + + return (planChargesWithoutAssociatedFees || []).map((planChargesWithoutAssociatedFee) => { + const { billableMetric, id, invoiceDisplayName } = planChargesWithoutAssociatedFee + + return { + label: invoiceDisplayName || billableMetric?.name, + description: billableMetric?.code, + value: id, + } + }) +} + +export const getChargesFiltersComboboxDataFromInvoiceSubscription = ({ + defaultFilterOptionLabel, + invoiceSubscription, + selectedChargeId, +}: { + defaultFilterOptionLabel: string + invoiceSubscription: InvoiceSubscriptionForCreateFeeDrawerFragment | undefined + selectedChargeId: string | null | undefined +}): ComboBoxProps['data'] => { + if (!invoiceSubscription || !selectedChargeId) return [] + + const selectedCharge = invoiceSubscription.subscription.plan.charges?.find( + (charge) => charge.id === selectedChargeId, + ) + + if (!selectedCharge?.filters?.length) return [] + + const selectedPlanChargeFiltersWithoutAssociatedFees = selectedCharge.filters.filter((filter) => { + const associatedFee = invoiceSubscription?.fees?.some( + (invoiceSubFee) => + invoiceSubFee.charge?.id === selectedCharge.id && + invoiceSubFee.chargeFilter?.id === filter.id, + ) + + return !associatedFee + }) + + // Check if default filter is associated with a charge + const defaultFilterExistsInAllFees = invoiceSubscription?.fees?.find( + (invoiceSubFee) => + invoiceSubFee.charge?.id === selectedCharge.id && + !invoiceSubFee.chargeFilter && + !!invoiceSubFee.charge.filters, + ) + + const comboboxData = (selectedPlanChargeFiltersWithoutAssociatedFees || []).map( + (planChargesWithoutAssociatedFee) => { + const { id, invoiceDisplayName } = planChargesWithoutAssociatedFee + + const paddedDisplayValues: string = + invoiceDisplayName || composeChargeFilterDisplayName(planChargesWithoutAssociatedFee) + + return { + label: paddedDisplayValues, + value: id, + } + }, + ) + + if (!defaultFilterExistsInAllFees) { + // Add the default value at the beginning of the list + comboboxData.unshift({ + label: defaultFilterOptionLabel, + value: ALL_FILTER_VALUES, + }) + } + + return comboboxData +} diff --git a/src/core/formats/__tests__/fixture.ts b/src/core/formats/__tests__/fixture.ts index 5f9f01ec2..c30848c96 100644 --- a/src/core/formats/__tests__/fixture.ts +++ b/src/core/formats/__tests__/fixture.ts @@ -2494,6 +2494,9 @@ export const noFees = [ chargesToDatetime: '2024-01-09T13:01:38Z', inAdvanceChargesFromDatetime: '2024-01-01T00:00:00+00:00', inAdvanceChargesToDatetime: '2024-01-09T00:00:00+00:00', + invoice: { + id: '1234', + }, subscription: { id: '59514df0-1abe-47dd-be36-445c9279240e', name: '', @@ -2525,6 +2528,106 @@ export const noFeesResult = { fromDatetime: '2024-01-01T00:00:00Z', inAdvanceChargesFromDatetime: '2024-01-01T00:00:00+00:00', inAdvanceChargesToDatetime: '2024-01-09T00:00:00+00:00', + invoiceId: '1234', + subscriptionDisplayName: 'maxi plan', + toDatetime: '2024-01-09T13:01:38Z', + }, + }, + }, +} + +export const newNoFeesResult = { + metadata: { hasAnyFeeParsed: false, hasAnyPositiveFeeParsed: false }, + subscriptions: { + '59514df0-1abe-47dd-be36-445c9279240e': { + feesInArrears: [], + feesInArrearsZero: [], + feesInAdvance: [], + feesInAdvanceZero: [], + metadata: { + chargesFromDatetime: '2024-01-01T00:00:00Z', + chargesToDatetime: '2024-01-09T13:01:38Z', + differentBoundariesForSubscriptionAndCharges: false, + fromDatetime: '2024-01-01T00:00:00Z', + inAdvanceChargesFromDatetime: '2024-01-01T00:00:00+00:00', + inAdvanceChargesToDatetime: '2024-01-09T00:00:00+00:00', + invoiceId: '1234', + subscriptionDisplayName: 'maxi plan', + toDatetime: '2024-01-09T13:01:38Z', + }, + }, + }, +} + +export const chargeZeroAmountResult = { + metadata: { hasAnyFeeParsed: true, hasAnyPositiveFeeParsed: true }, + subscriptions: { + '59514df0-1abe-47dd-be36-445c9279240e': { + feesInArrears: [ + { + amountCents: '0', + amountDetails: { + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + flatUnitAmount: null, + freeEvents: null, + freeUnits: null, + graduatedPercentageRanges: null, + graduatedRanges: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + rate: null, + units: null, + }, + appliedTaxes: [ + { + id: '19f72015-a550-41cf-8839-126538807aef', + taxRate: 20, + }, + ], + charge: null, + description: null, + feeType: 'subscription', + id: '069a3be4-73bf-4d18-bfce-d6c74185d491', + invoiceDisplayName: null, + invoiceName: 'sub fee', + itemName: 'maxi plan', + metadata: { + displayName: 'Monthly subscription fee - maxi plan', + isSubscriptionFee: true, + }, + preciseUnitAmount: 0, + subscription: { + id: '59514df0-1abe-47dd-be36-445c9279240e', + name: '', + plan: { + id: 'da8abf9d-022f-482c-a949-466c0131e080', + interval: 'monthly', + invoiceDisplayName: 'sub fee', + name: 'maxi plan', + }, + }, + trueUpFee: null, + trueUpParentFee: null, + units: 0, + }, + ], + feesInArrearsZero: [], + feesInAdvance: [], + feesInAdvanceZero: [], + metadata: { + chargesFromDatetime: '2024-01-01T00:00:00Z', + chargesToDatetime: '2024-01-09T13:01:38Z', + differentBoundariesForSubscriptionAndCharges: false, + fromDatetime: '2024-01-01T00:00:00Z', + inAdvanceChargesFromDatetime: '2024-01-01T00:00:00+00:00', + inAdvanceChargesToDatetime: '2024-01-09T00:00:00+00:00', + invoiceId: '1234', subscriptionDisplayName: 'maxi plan', toDatetime: '2024-01-09T13:01:38Z', }, @@ -2692,6 +2795,9 @@ export const chargeZeroAmount = [ differentBoundariesForSubscriptionAndCharges: false, inAdvanceChargesFromDatetime: '2024-01-01T00:00:00+00:00', inAdvanceChargesToDatetime: '2024-01-09T00:00:00+00:00', + invoice: { + id: '1234', + }, subscription: { id: '59514df0-1abe-47dd-be36-445c9279240e', name: '', @@ -3003,6 +3109,135 @@ export const chargeZeroAmountDraftInvoiceResult = { fromDatetime: '2024-01-01T00:00:00Z', inAdvanceChargesFromDatetime: '2024-01-01T00:00:00+00:00', inAdvanceChargesToDatetime: '2024-01-09T00:00:00+00:00', + invoiceId: '1234', + subscriptionDisplayName: 'maxi plan', + toDatetime: '2024-01-09T13:01:38Z', + }, + }, + }, +} + +export const newChargeZeroAmountDraftInvoiceResult = { + metadata: { hasAnyFeeParsed: true, hasAnyPositiveFeeParsed: true }, + subscriptions: { + '59514df0-1abe-47dd-be36-445c9279240e': { + feesInAdvance: [], + feesInAdvanceZero: [], + feesInArrearsZero: [], + feesInArrears: [ + { + amountCents: '0', + amountDetails: { + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + flatUnitAmount: null, + freeEvents: null, + freeUnits: null, + graduatedPercentageRanges: null, + graduatedRanges: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + rate: null, + units: null, + }, + appliedTaxes: [ + { + id: '19f72015-a550-41cf-8839-126538807aef', + taxRate: 20, + }, + ], + charge: null, + description: null, + feeType: 'subscription', + id: '069a3be4-73bf-4d18-bfce-d6c74185d491', + invoiceDisplayName: null, + invoiceName: 'sub fee', + itemName: 'maxi plan', + metadata: { + displayName: 'Monthly subscription fee - maxi plan', + isSubscriptionFee: true, + }, + preciseUnitAmount: 0, + subscription: { + id: '59514df0-1abe-47dd-be36-445c9279240e', + name: '', + plan: { + id: 'da8abf9d-022f-482c-a949-466c0131e080', + interval: 'monthly', + invoiceDisplayName: 'sub fee', + name: 'maxi plan', + }, + }, + trueUpFee: null, + trueUpParentFee: null, + units: 0, + }, + { + amountCents: '0', + amountDetails: { + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + flatUnitAmount: null, + freeEvents: null, + freeUnits: null, + graduatedPercentageRanges: null, + graduatedRanges: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + rate: null, + units: null, + }, + appliedTaxes: [ + { + id: '19f72015-a550-41cf-8839-126538807aef', + taxRate: 20, + }, + ], + charge: null, + description: null, + feeType: 'charge', + id: '069a3be4-73bf-4d18-bfce-d6c74185', + invoiceDisplayName: null, + invoiceName: 'sub fee', + itemName: 'maxi plan', + metadata: { + displayName: 'sub fee', + isNormalFee: true, + }, + preciseUnitAmount: 0, + subscription: { + id: '59514df0-1abe-47dd-be36-445c9279240e', + name: '', + plan: { + id: 'da8abf9d-022f-482c-a949-466c0131e080', + interval: 'monthly', + invoiceDisplayName: 'sub fee', + name: 'maxi plan', + }, + }, + trueUpFee: null, + trueUpParentFee: null, + units: 0, + }, + ], + metadata: { + chargesFromDatetime: '2024-01-01T00:00:00Z', + chargesToDatetime: '2024-01-09T13:01:38Z', + differentBoundariesForSubscriptionAndCharges: false, + fromDatetime: '2024-01-01T00:00:00Z', + inAdvanceChargesFromDatetime: '2024-01-01T00:00:00+00:00', + inAdvanceChargesToDatetime: '2024-01-09T00:00:00+00:00', + invoiceId: '1234', subscriptionDisplayName: 'maxi plan', toDatetime: '2024-01-09T13:01:38Z', }, @@ -3018,6 +3253,9 @@ export const unorderedSubscriptionWithFees = [ chargesToDatetime: '2024-02-29T23:59:59Z', inAdvanceChargesFromDatetime: null, inAdvanceChargesToDatetime: null, + invoice: { + id: '1234', + }, subscription: { id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', name: '', @@ -4305,6 +4543,9 @@ export const unorderedSubscriptionWithFees = [ chargesToDatetime: '2024-03-10T23:59:59Z', inAdvanceChargesFromDatetime: null, inAdvanceChargesToDatetime: null, + invoice: { + id: '1234', + }, subscription: { id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', name: '', @@ -5585,6 +5826,2429 @@ export const unorderedSubscriptionWithFees = [ ], }, ] +export const newOrderedSubscriptionWithFees = { + metadata: { hasAnyFeeParsed: true, hasAnyPositiveFeeParsed: true }, + subscriptions: { + '0b9e37a0-9589-49d0-9da1-e39887d89ac2': { + feesInArrears: [ + { + id: 'cc0dc739-46f6-41a8-94f3-284d07d2c4c7', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'Count BM', + itemName: 'Count BM', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: 'a4358d5c-77e0-4173-9b12-342763a72a03', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '34fd251e-7210-410d-ab87-91b77a6a075b', + payInAdvance: false, + invoiceDisplayName: '', + billableMetric: { + id: 'efd12be5-f4fd-4f22-8c81-9fb0cd98b0a8', + name: 'Count BM', + aggregationType: 'count_agg', + }, + chargeModel: 'graduated', + minAmountCents: '0', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: [ + { + flatUnitAmount: '0.0', + fromValue: 0, + perUnitAmount: '0.0', + perUnitTotalAmount: '0.0', + toValue: 1, + totalWithFlatAmount: '0.0', + units: '0.0', + }, + ], + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'Count BM' }, + }, + { + id: 'd354a597-5bf4-4a3c-89c3-6ce16ec7406d', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears graduated', + itemName: 'Sum BM', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '1f2b9996-c3e4-4946-ba5d-471a8d7c90f0', taxRate: 25 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '05df220f-85dd-41a2-a0c3-dc5cc0eef533', + payInAdvance: false, + invoiceDisplayName: 'metered arrears graduated', + billableMetric: { + id: '869d5637-5eb3-40db-8dbc-a87b8cd7a3f8', + name: 'Sum BM', + aggregationType: 'sum_agg', + }, + chargeModel: 'graduated', + minAmountCents: '0', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: [ + { + flatUnitAmount: '0.0', + fromValue: 0, + perUnitAmount: '0.0', + perUnitTotalAmount: '0.0', + toValue: 1, + totalWithFlatAmount: '0.0', + units: '0.0', + }, + ], + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'metered arrears graduated' }, + }, + { + id: '077afb3e-b1b5-45e7-9151-afd608b89766', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears graduated percentage', + itemName: 'Count BM', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '63a6de02-1794-4fc4-8b5a-ae7683155d5a', taxRate: 0 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '6e40b8bf-b9f3-447f-9bd3-14e6b3be3cd0', + payInAdvance: false, + invoiceDisplayName: 'metered arrears graduated percentage', + billableMetric: { + id: 'efd12be5-f4fd-4f22-8c81-9fb0cd98b0a8', + name: 'Count BM', + aggregationType: 'count_agg', + }, + chargeModel: 'graduated_percentage', + minAmountCents: '0', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: [ + { + flatUnitAmount: '0.0', + fromValue: 0, + perUnitTotalAmount: '0.0', + rate: '1.0', + toValue: 1, + totalWithFlatAmount: '0.0', + units: '0.0', + }, + ], + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'metered arrears graduated percentage' }, + }, + { + id: '27d61806-c220-42dd-befd-a90c4f652ff4', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears package 1 dim', + itemName: 'Count BM - One dimension', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '87af0e98-1ba3-470b-986c-d85a0d959129', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '9ed0da11-0c27-4c45-a5a2-ae1a64e00cea', + payInAdvance: false, + invoiceDisplayName: 'metered arrears package 1 dim', + billableMetric: { + id: 'e78c6d05-db1c-4485-b82c-fc5c056d19be', + name: 'Count BM - One dimension', + aggregationType: 'count_agg', + }, + chargeModel: 'package', + minAmountCents: '0', + prorated: false, + }, + chargeFilter: { values: { region: ['france'] } }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: '0.0', + paidUnits: '0.0', + perPackageSize: 0, + perPackageUnitAmount: '0.0', + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { + isFilterChildFee: true, + displayName: 'metered arrears package 1 dim • france', + }, + }, + { + id: 'ed477cf0-5459-43f7-9cd3-f5262519a26d', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears package 1 dim', + itemName: 'Count BM - One dimension', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '4e16e526-27d8-422f-aa33-035ed2d396bd', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '9ed0da11-0c27-4c45-a5a2-ae1a64e00cea', + payInAdvance: false, + invoiceDisplayName: 'metered arrears package 1 dim', + billableMetric: { + id: 'e78c6d05-db1c-4485-b82c-fc5c056d19be', + name: 'Count BM - One dimension', + aggregationType: 'count_agg', + }, + chargeModel: 'package', + minAmountCents: '0', + prorated: false, + }, + chargeFilter: { values: { region: ['italy'] } }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: '0.0', + paidUnits: '0.0', + perPackageSize: 0, + perPackageUnitAmount: '0.0', + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { + isFilterChildFee: true, + displayName: 'metered arrears package 1 dim • italy', + }, + }, + { + id: '98f1c632-ff4d-4e4e-86a0-28748321a662', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears percentage 2 dim', + itemName: 'Count BM - Two dimensions', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: 'f8612c1d-ffd1-4876-8471-381b0b84d143', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '25b455e4-1333-4c76-afc3-7398e5d58892', + payInAdvance: false, + invoiceDisplayName: 'metered arrears percentage 2 dim', + billableMetric: { + id: '1bcd941b-6ac4-4849-a4b8-7c793f6cebad', + name: 'Count BM - Two dimensions', + aggregationType: 'count_agg', + }, + chargeModel: 'percentage', + minAmountCents: '0', + prorated: false, + }, + chargeFilter: { values: { provider: ['AWS'], region: ['europe'] } }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: '0.0', + freeUnits: '0.0', + paidUnits: '0.0', + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: '0.0', + fixedFeeUnitAmount: '0.0', + freeEvents: 0, + minMaxAdjustmentTotalAmount: '0.0', + paidEvents: 0, + rate: '1.0', + units: '0.0', + }, + metadata: { + isFilterChildFee: true, + displayName: 'metered arrears percentage 2 dim • AWS • europe', + }, + }, + { + id: 'cb1bf837-e4f7-4112-b532-eacc2b36317e', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears percentage 2 dim', + itemName: 'Count BM - Two dimensions', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: 'd606c4a1-ac30-482e-89fb-b6a2ee7c2d57', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '25b455e4-1333-4c76-afc3-7398e5d58892', + payInAdvance: false, + invoiceDisplayName: 'metered arrears percentage 2 dim', + billableMetric: { + id: '1bcd941b-6ac4-4849-a4b8-7c793f6cebad', + name: 'Count BM - Two dimensions', + aggregationType: 'count_agg', + }, + chargeModel: 'percentage', + minAmountCents: '0', + prorated: false, + }, + chargeFilter: { values: { provider: ['AWS'], region: ['usa'] } }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: '0.0', + freeUnits: '0.0', + paidUnits: '0.0', + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: '0.0', + fixedFeeUnitAmount: '0.0', + freeEvents: 0, + minMaxAdjustmentTotalAmount: '0.0', + paidEvents: 0, + rate: '2.0', + units: '0.0', + }, + metadata: { + isFilterChildFee: true, + displayName: 'metered arrears percentage 2 dim • AWS • usa', + }, + }, + { + id: '8e699c82-e254-4197-a8d6-5e9a5170d778', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears percentage 2 dim', + itemName: 'Count BM - Two dimensions', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '57b53d82-91bf-4a53-94bf-e4c9714a52e7', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '25b455e4-1333-4c76-afc3-7398e5d58892', + payInAdvance: false, + invoiceDisplayName: 'metered arrears percentage 2 dim', + billableMetric: { + id: '1bcd941b-6ac4-4849-a4b8-7c793f6cebad', + name: 'Count BM - Two dimensions', + aggregationType: 'count_agg', + }, + chargeModel: 'percentage', + minAmountCents: '0', + prorated: false, + }, + chargeFilter: { + invoiceDisplayName: 'GOOOOOOOO USA!', + values: { provider: ['Google'], region: ['usa'] }, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: '0.0', + freeUnits: '0.0', + paidUnits: '0.0', + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: '0.0', + fixedFeeUnitAmount: '0.0', + freeEvents: 0, + minMaxAdjustmentTotalAmount: '0.0', + paidEvents: 0, + rate: '3.0', + units: '0.0', + }, + metadata: { + isFilterChildFee: true, + displayName: 'metered arrears percentage 2 dim • GOOOOOOOO USA!', + }, + }, + { + id: '061e4abe-9e92-4477-b5fb-987304f16735', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears percentage minimum spending', + itemName: 'Count BM', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '219b207a-ff39-4284-922f-0009deef66ca', taxRate: 20 }], + trueUpFee: { id: '72dbfa60-2cf4-43d7-9884-8107ada8d60a' }, + trueUpParentFee: null, + charge: { + id: '34e6b422-b03e-4512-9778-93c1ad465c21', + payInAdvance: false, + invoiceDisplayName: 'metered arrears percentage minimum spending', + billableMetric: { + id: 'efd12be5-f4fd-4f22-8c81-9fb0cd98b0a8', + name: 'Count BM', + aggregationType: 'count_agg', + }, + chargeModel: 'standard', + minAmountCents: '1100000', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { + isNormalFee: true, + displayName: 'metered arrears percentage minimum spending', + }, + }, + { + id: '72dbfa60-2cf4-43d7-9884-8107ada8d60a', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '1100000', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears percentage minimum spending', + itemName: 'Count BM', + units: 1, + preciseUnitAmount: 11000, + appliedTaxes: [{ id: 'cebee521-58f7-4dfd-919e-cd51e3ccd8fc', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: { id: '061e4abe-9e92-4477-b5fb-987304f16735' }, + charge: { + id: '34e6b422-b03e-4512-9778-93c1ad465c21', + payInAdvance: false, + invoiceDisplayName: 'metered arrears percentage minimum spending', + billableMetric: { + id: 'efd12be5-f4fd-4f22-8c81-9fb0cd98b0a8', + name: 'Count BM', + aggregationType: 'count_agg', + }, + chargeModel: 'standard', + minAmountCents: '1100000', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { + isTrueUpFee: true, + displayName: 'metered arrears percentage minimum spending - True-up', + }, + }, + { + id: '82d7195a-1e42-4c86-930f-859a43b1693e', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears standard', + itemName: 'Sum BM', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: 'b02f802a-bc06-4738-9573-553fbc4653d5', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '8c17937b-d5b5-42ab-bb6e-6b89651564db', + payInAdvance: false, + invoiceDisplayName: 'metered arrears standard', + billableMetric: { + id: '869d5637-5eb3-40db-8dbc-a87b8cd7a3f8', + name: 'Sum BM', + aggregationType: 'sum_agg', + }, + chargeModel: 'standard', + minAmountCents: '0', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'metered arrears standard' }, + }, + { + id: '9eab70e0-c840-4fc3-aad0-0d445241ba88', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears volume', + itemName: 'Count BM', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '8877b6f0-24d7-422d-aadf-e08f8a33d7c2', taxRate: 0 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '06b2b65b-b1a7-4e43-82fc-dc5ed9738b3c', + payInAdvance: false, + invoiceDisplayName: 'metered arrears volume', + billableMetric: { + id: 'efd12be5-f4fd-4f22-8c81-9fb0cd98b0a8', + name: 'Count BM', + aggregationType: 'count_agg', + }, + chargeModel: 'volume', + minAmountCents: '0', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: '0.0', + perUnitAmount: '0.0', + perUnitTotalAmount: '0.0', + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'metered arrears volume' }, + }, + { + id: 'f9aeb27c-4261-495b-86cb-c4ebea335ca5', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '1000', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'rec count', + itemName: 'rec count', + units: 1, + preciseUnitAmount: 10, + appliedTaxes: [{ id: 'e3e9793f-0f4c-4e6a-ae92-1f0f24658f38', taxRate: 20 }], + trueUpFee: { id: 'cff1026b-baec-4fe2-a725-99532769865a' }, + trueUpParentFee: null, + charge: { + id: '8b6a6273-6f61-4616-946d-8604edf49f4e', + payInAdvance: false, + invoiceDisplayName: '', + billableMetric: { + id: 'aecf4a46-c08c-48a0-88c1-dc1c894f9bf2', + name: 'rec count', + aggregationType: 'unique_count_agg', + }, + chargeModel: 'standard', + minAmountCents: '9999900', + prorated: false, + }, + eventsCount: '1', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'rec count' }, + }, + { + id: 'cff1026b-baec-4fe2-a725-99532769865a', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '9998900', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'rec count', + itemName: 'rec count', + units: 1, + preciseUnitAmount: 99989, + appliedTaxes: [{ id: 'baddf7d2-f84c-4424-a970-d0e9075eb0b3', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: { id: 'f9aeb27c-4261-495b-86cb-c4ebea335ca5' }, + charge: { + id: '8b6a6273-6f61-4616-946d-8604edf49f4e', + payInAdvance: false, + invoiceDisplayName: '', + billableMetric: { + id: 'aecf4a46-c08c-48a0-88c1-dc1c894f9bf2', + name: 'rec count', + aggregationType: 'unique_count_agg', + }, + chargeModel: 'standard', + minAmountCents: '9999900', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isTrueUpFee: true, displayName: 'rec count - True-up' }, + }, + { + id: '1d19eec2-3ba6-49bc-8767-66f8e4b8b83a', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '200', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'rec count prorated graduated', + itemName: 'rec count', + units: 1, + preciseUnitAmount: 2, + appliedTaxes: [{ id: '1c1b3281-73e7-4113-a3de-650f462b0157', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: 'bc29cfb6-998f-422d-858f-6107dd905530', + payInAdvance: false, + invoiceDisplayName: 'rec count prorated graduated', + billableMetric: { + id: 'aecf4a46-c08c-48a0-88c1-dc1c894f9bf2', + name: 'rec count', + aggregationType: 'unique_count_agg', + }, + chargeModel: 'graduated', + minAmountCents: '0', + prorated: true, + }, + eventsCount: '1', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'rec count prorated graduated' }, + }, + { + id: '2398dd5c-6558-45df-b97c-3e913f79c3ea', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '200', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'rec count prorated volume', + itemName: 'rec count', + units: 1, + preciseUnitAmount: 2, + appliedTaxes: [{ id: '83e835ea-ae89-4a1e-aa49-3d48286262d9', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '5575dc4f-f78c-4491-8ef0-9c778f1b4435', + payInAdvance: false, + invoiceDisplayName: 'rec count prorated volume', + billableMetric: { + id: 'aecf4a46-c08c-48a0-88c1-dc1c894f9bf2', + name: 'rec count', + aggregationType: 'unique_count_agg', + }, + chargeModel: 'volume', + minAmountCents: '0', + prorated: true, + }, + eventsCount: '1', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: '1.0', + perUnitAmount: '1.0', + perUnitTotalAmount: '1.0', + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'rec count prorated volume' }, + }, + { + id: '7b1557a9-5b94-4d2a-b453-a1f749fc27e3', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'Sum BM', + itemName: 'Sum BM', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '4effc63f-c169-4ede-8dc7-6e9e23154dc3', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '422e93d6-1c10-4339-b327-2a3ca61581f5', + payInAdvance: false, + invoiceDisplayName: '', + billableMetric: { + id: '869d5637-5eb3-40db-8dbc-a87b8cd7a3f8', + name: 'Sum BM', + aggregationType: 'sum_agg', + }, + chargeModel: 'percentage', + minAmountCents: '0', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: '0.0', + freeUnits: '0.0', + paidUnits: '0.0', + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: '0.0', + fixedFeeUnitAmount: '0.0', + freeEvents: 0, + minMaxAdjustmentTotalAmount: '0.0', + paidEvents: 0, + rate: '11.0', + units: '0.0', + }, + metadata: { isNormalFee: true, displayName: 'Sum BM' }, + }, + ], + feesInArrearsZero: [], + feesInAdvance: [ + { + id: '817ea1cc-f47b-4b48-806f-6a0ce03747a1', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '10000', + description: null, + feeType: 'subscription', + invoiceDisplayName: null, + invoiceName: 'sub fee', + itemName: 'maxi plan sub arrears', + units: 1, + preciseUnitAmount: 100, + appliedTaxes: [{ id: '03241fa4-63d6-4dfe-b038-8e6c7ba27e99', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: null, + eventsCount: null, + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { + isSubscriptionFee: true, + displayName: 'Monthly subscription fee - maxi plan sub arrears', + }, + }, + { + id: '9032acd1-a5c4-4c80-b500-94700d997d32', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '9999900', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'Advance recurring', + itemName: 'rec count', + units: 1, + preciseUnitAmount: 99999, + appliedTaxes: [{ id: '7375835a-359d-4740-b8f7-a4d8c823ccb7', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '0fc08fb5-7cc1-43bd-a7d2-d3fac8835d0c', + payInAdvance: true, + invoiceDisplayName: 'Advance recurring', + billableMetric: { + id: 'aecf4a46-c08c-48a0-88c1-dc1c894f9bf2', + name: 'rec count', + aggregationType: 'unique_count_agg', + }, + chargeModel: 'standard', + minAmountCents: '0', + prorated: false, + }, + eventsCount: '1', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'Advance recurring' }, + }, + { + id: 'a54a6f27-ac59-45b7-bc0d-4a42415c1e47', + subscription: { + id: '0b9e37a0-9589-49d0-9da1-e39887d89ac2', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '66700', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'rec count prorated advance', + itemName: 'rec count', + units: 1, + preciseUnitAmount: 667, + appliedTaxes: [{ id: 'ea35ee38-2d5f-4453-8a87-ba7a92269837', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '054ca896-1e1c-4190-ad42-eed7c24b9270', + payInAdvance: true, + invoiceDisplayName: 'rec count prorated advance', + billableMetric: { + id: 'aecf4a46-c08c-48a0-88c1-dc1c894f9bf2', + name: 'rec count', + aggregationType: 'unique_count_agg', + }, + chargeModel: 'standard', + minAmountCents: '0', + prorated: true, + }, + eventsCount: '1', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'rec count prorated advance' }, + }, + ], + feesInAdvanceZero: [], + metadata: { + differentBoundariesForSubscriptionAndCharges: true, + subscriptionDisplayName: 'maxi plan sub arrears', + fromDatetime: '2024-03-01T00:00:00Z', + toDatetime: '2024-03-31T23:59:59Z', + chargesFromDatetime: '2024-02-01T00:00:00Z', + chargesToDatetime: '2024-02-29T23:59:59Z', + inAdvanceChargesFromDatetime: null, + inAdvanceChargesToDatetime: null, + invoiceId: '1234', + }, + }, + '5cf07951-4296-46d1-9ca1-d4e87d6e6928': { + feesInArrears: [ + { + id: 'c3b7bb85-cdde-4511-8e91-76491fcb51b8', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'Count BM', + itemName: 'Count BM', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '4318e992-6cd8-4030-8209-ecaa131a50e9', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '34fd251e-7210-410d-ab87-91b77a6a075b', + payInAdvance: false, + invoiceDisplayName: '', + billableMetric: { + id: 'efd12be5-f4fd-4f22-8c81-9fb0cd98b0a8', + name: 'Count BM', + aggregationType: 'count_agg', + }, + chargeModel: 'graduated', + minAmountCents: '0', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: [ + { + flatUnitAmount: '0.0', + fromValue: 0, + perUnitAmount: '0.0', + perUnitTotalAmount: '0.0', + toValue: 1, + totalWithFlatAmount: '0.0', + units: '0.0', + }, + ], + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'Count BM' }, + }, + { + id: 'f1d47378-4850-419c-a296-b31f727a2da5', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears graduated', + itemName: 'Sum BM', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '2ec49341-adb2-4815-9f5c-ab82947060e9', taxRate: 25 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '05df220f-85dd-41a2-a0c3-dc5cc0eef533', + payInAdvance: false, + invoiceDisplayName: 'metered arrears graduated', + billableMetric: { + id: '869d5637-5eb3-40db-8dbc-a87b8cd7a3f8', + name: 'Sum BM', + aggregationType: 'sum_agg', + }, + chargeModel: 'graduated', + minAmountCents: '0', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: [ + { + flatUnitAmount: '0.0', + fromValue: 0, + perUnitAmount: '0.0', + perUnitTotalAmount: '0.0', + toValue: 1, + totalWithFlatAmount: '0.0', + units: '0.0', + }, + ], + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'metered arrears graduated' }, + }, + { + id: 'cf0be687-7268-4466-ba0e-3fc147ad584a', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears graduated percentage', + itemName: 'Count BM', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: 'e5d5a002-578c-4bfb-85f8-3e8ea813fbb5', taxRate: 0 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '6e40b8bf-b9f3-447f-9bd3-14e6b3be3cd0', + payInAdvance: false, + invoiceDisplayName: 'metered arrears graduated percentage', + billableMetric: { + id: 'efd12be5-f4fd-4f22-8c81-9fb0cd98b0a8', + name: 'Count BM', + aggregationType: 'count_agg', + }, + chargeModel: 'graduated_percentage', + minAmountCents: '0', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: [ + { + flatUnitAmount: '0.0', + fromValue: 0, + perUnitTotalAmount: '0.0', + rate: '1.0', + toValue: 1, + totalWithFlatAmount: '0.0', + units: '0.0', + }, + ], + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'metered arrears graduated percentage' }, + }, + { + id: '0a531d59-12d6-4804-a656-08cdd280b5df', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears package 1 dim', + itemName: 'Count BM - One dimension', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '208270ae-38e5-4e41-a0f1-cd06a89271bd', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '9ed0da11-0c27-4c45-a5a2-ae1a64e00cea', + payInAdvance: false, + invoiceDisplayName: 'metered arrears package 1 dim', + billableMetric: { + id: 'e78c6d05-db1c-4485-b82c-fc5c056d19be', + name: 'Count BM - One dimension', + aggregationType: 'count_agg', + }, + chargeModel: 'package', + minAmountCents: '0', + prorated: false, + }, + chargeFilter: { values: { region: ['france'] } }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: '0.0', + paidUnits: '0.0', + perPackageSize: 0, + perPackageUnitAmount: '0.0', + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { + isFilterChildFee: true, + displayName: 'metered arrears package 1 dim • france', + }, + }, + { + id: 'a06ae8ab-d600-4745-ba0e-fa600496241f', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears package 1 dim', + itemName: 'Count BM - One dimension', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '76c3feef-b010-4215-8730-5ffaeba16568', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '9ed0da11-0c27-4c45-a5a2-ae1a64e00cea', + payInAdvance: false, + invoiceDisplayName: 'metered arrears package 1 dim', + billableMetric: { + id: 'e78c6d05-db1c-4485-b82c-fc5c056d19be', + name: 'Count BM - One dimension', + aggregationType: 'count_agg', + }, + chargeModel: 'package', + minAmountCents: '0', + prorated: false, + }, + chargeFilter: { values: { region: ['italy'] } }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: '0.0', + paidUnits: '0.0', + perPackageSize: 0, + perPackageUnitAmount: '0.0', + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { + isFilterChildFee: true, + displayName: 'metered arrears package 1 dim • italy', + }, + }, + { + id: '3b34a414-1c11-412a-848a-a4e6df9a9226', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears percentage 2 dim', + itemName: 'Count BM - Two dimensions', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: 'adcda98c-48ac-4a5a-b921-886a399b1935', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '25b455e4-1333-4c76-afc3-7398e5d58892', + payInAdvance: false, + invoiceDisplayName: 'metered arrears percentage 2 dim', + billableMetric: { + id: '1bcd941b-6ac4-4849-a4b8-7c793f6cebad', + name: 'Count BM - Two dimensions', + aggregationType: 'count_agg', + }, + chargeModel: 'percentage', + minAmountCents: '0', + prorated: false, + }, + chargeFilter: { values: { provider: ['AWS'], region: ['europe'] } }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: '0.0', + freeUnits: '0.0', + paidUnits: '0.0', + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: '0.0', + fixedFeeUnitAmount: '0.0', + freeEvents: 0, + minMaxAdjustmentTotalAmount: '0.0', + paidEvents: 0, + rate: '1.0', + units: '0.0', + }, + metadata: { + isFilterChildFee: true, + displayName: 'metered arrears percentage 2 dim • AWS • europe', + }, + }, + { + id: 'ff612e87-40f9-4a24-a533-21778d3ada20', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears percentage 2 dim', + itemName: 'Count BM - Two dimensions', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '1315f59e-0a8f-45ec-831c-dc528f0e0d0b', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '25b455e4-1333-4c76-afc3-7398e5d58892', + payInAdvance: false, + invoiceDisplayName: 'metered arrears percentage 2 dim', + billableMetric: { + id: '1bcd941b-6ac4-4849-a4b8-7c793f6cebad', + name: 'Count BM - Two dimensions', + aggregationType: 'count_agg', + }, + chargeModel: 'percentage', + minAmountCents: '0', + prorated: false, + }, + chargeFilter: { values: { provider: ['AWS'], region: ['usa'] } }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: '0.0', + freeUnits: '0.0', + paidUnits: '0.0', + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: '0.0', + fixedFeeUnitAmount: '0.0', + freeEvents: 0, + minMaxAdjustmentTotalAmount: '0.0', + paidEvents: 0, + rate: '2.0', + units: '0.0', + }, + metadata: { + isFilterChildFee: true, + displayName: 'metered arrears percentage 2 dim • AWS • usa', + }, + }, + { + id: '9b96d481-e2b8-4eff-aa1d-1fd2190aad88', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears percentage 2 dim', + itemName: 'Count BM - Two dimensions', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '6b2c58c1-87a7-405f-8402-59b163a41d10', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '25b455e4-1333-4c76-afc3-7398e5d58892', + payInAdvance: false, + invoiceDisplayName: 'metered arrears percentage 2 dim', + billableMetric: { + id: '1bcd941b-6ac4-4849-a4b8-7c793f6cebad', + name: 'Count BM - Two dimensions', + aggregationType: 'count_agg', + }, + chargeModel: 'percentage', + minAmountCents: '0', + prorated: false, + }, + chargeFilter: { + invoiceDisplayName: 'GOOOOOOOO USA!', + values: { provider: ['Google'], region: ['usa'] }, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: '0.0', + freeUnits: '0.0', + paidUnits: '0.0', + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: '0.0', + fixedFeeUnitAmount: '0.0', + freeEvents: 0, + minMaxAdjustmentTotalAmount: '0.0', + paidEvents: 0, + rate: '3.0', + units: '0.0', + }, + metadata: { + isFilterChildFee: true, + displayName: 'metered arrears percentage 2 dim • GOOOOOOOO USA!', + }, + }, + { + id: '1acab4b6-1f30-450f-b87a-02dbf2ce31ec', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears percentage minimum spending', + itemName: 'Count BM', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: '21cc7b6a-84e1-47a8-8450-507bfc403611', taxRate: 20 }], + trueUpFee: { id: '599299c4-7519-44f6-9a48-26814677e2e0' }, + trueUpParentFee: null, + charge: { + id: '34e6b422-b03e-4512-9778-93c1ad465c21', + payInAdvance: false, + invoiceDisplayName: 'metered arrears percentage minimum spending', + billableMetric: { + id: 'efd12be5-f4fd-4f22-8c81-9fb0cd98b0a8', + name: 'Count BM', + aggregationType: 'count_agg', + }, + chargeModel: 'standard', + minAmountCents: '1100000', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { + isNormalFee: true, + displayName: 'metered arrears percentage minimum spending', + }, + }, + { + id: '599299c4-7519-44f6-9a48-26814677e2e0', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '1100000', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears percentage minimum spending', + itemName: 'Count BM', + units: 1, + preciseUnitAmount: 11000, + appliedTaxes: [{ id: 'ee18bd57-db30-4ea9-9640-24b1ca7ffd9a', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: { id: '1acab4b6-1f30-450f-b87a-02dbf2ce31ec' }, + charge: { + id: '34e6b422-b03e-4512-9778-93c1ad465c21', + payInAdvance: false, + invoiceDisplayName: 'metered arrears percentage minimum spending', + billableMetric: { + id: 'efd12be5-f4fd-4f22-8c81-9fb0cd98b0a8', + name: 'Count BM', + aggregationType: 'count_agg', + }, + chargeModel: 'standard', + minAmountCents: '1100000', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { + isTrueUpFee: true, + displayName: 'metered arrears percentage minimum spending - True-up', + }, + }, + { + id: '9208414b-4ec3-46c8-9930-bb10a7086d8e', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears standard', + itemName: 'Sum BM', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: 'e3fe0ef6-9ce1-4fbe-9e29-62bccd244b16', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '8c17937b-d5b5-42ab-bb6e-6b89651564db', + payInAdvance: false, + invoiceDisplayName: 'metered arrears standard', + billableMetric: { + id: '869d5637-5eb3-40db-8dbc-a87b8cd7a3f8', + name: 'Sum BM', + aggregationType: 'sum_agg', + }, + chargeModel: 'standard', + minAmountCents: '0', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'metered arrears standard' }, + }, + { + id: '9cd55b8d-380d-425c-a35d-8afd0f971b7b', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'metered arrears volume', + itemName: 'Count BM', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: 'afd99c92-ae12-44af-97bb-07fae721af40', taxRate: 0 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '06b2b65b-b1a7-4e43-82fc-dc5ed9738b3c', + payInAdvance: false, + invoiceDisplayName: 'metered arrears volume', + billableMetric: { + id: 'efd12be5-f4fd-4f22-8c81-9fb0cd98b0a8', + name: 'Count BM', + aggregationType: 'count_agg', + }, + chargeModel: 'volume', + minAmountCents: '0', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: '0.0', + perUnitAmount: '0.0', + perUnitTotalAmount: '0.0', + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'metered arrears volume' }, + }, + { + id: 'cc82649b-37b5-4be2-9068-43665288a1d4', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '1000', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'rec count', + itemName: 'rec count', + units: 1, + preciseUnitAmount: 10, + appliedTaxes: [{ id: 'ee77a4ee-4013-4d74-8830-8cb2fb68fabb', taxRate: 20 }], + trueUpFee: { id: '161c7a55-a56e-4f38-8009-ae6a3bd29edc' }, + trueUpParentFee: null, + charge: { + id: '8b6a6273-6f61-4616-946d-8604edf49f4e', + payInAdvance: false, + invoiceDisplayName: '', + billableMetric: { + id: 'aecf4a46-c08c-48a0-88c1-dc1c894f9bf2', + name: 'rec count', + aggregationType: 'unique_count_agg', + }, + chargeModel: 'standard', + minAmountCents: '9999900', + prorated: false, + }, + eventsCount: '1', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'rec count' }, + }, + { + id: '161c7a55-a56e-4f38-8009-ae6a3bd29edc', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '9998900', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'rec count', + itemName: 'rec count', + units: 1, + preciseUnitAmount: 99989, + appliedTaxes: [{ id: '8d47e1e3-8f75-446d-8c14-f8ba3b58c095', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: { id: 'cc82649b-37b5-4be2-9068-43665288a1d4' }, + charge: { + id: '8b6a6273-6f61-4616-946d-8604edf49f4e', + payInAdvance: false, + invoiceDisplayName: '', + billableMetric: { + id: 'aecf4a46-c08c-48a0-88c1-dc1c894f9bf2', + name: 'rec count', + aggregationType: 'unique_count_agg', + }, + chargeModel: 'standard', + minAmountCents: '9999900', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isTrueUpFee: true, displayName: 'rec count - True-up' }, + }, + { + id: 'c94363c5-6f45-490e-8b9f-7c4c41cd725e', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '200', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'rec count prorated graduated', + itemName: 'rec count', + units: 1, + preciseUnitAmount: 2, + appliedTaxes: [{ id: 'a0c2fc7c-c091-465a-8133-83c292557770', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: 'bc29cfb6-998f-422d-858f-6107dd905530', + payInAdvance: false, + invoiceDisplayName: 'rec count prorated graduated', + billableMetric: { + id: 'aecf4a46-c08c-48a0-88c1-dc1c894f9bf2', + name: 'rec count', + aggregationType: 'unique_count_agg', + }, + chargeModel: 'graduated', + minAmountCents: '0', + prorated: true, + }, + eventsCount: '1', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'rec count prorated graduated' }, + }, + { + id: '609a8c7a-756d-4468-a70b-a270183b22b7', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '200', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'rec count prorated volume', + itemName: 'rec count', + units: 1, + preciseUnitAmount: 2, + appliedTaxes: [{ id: '52a03e29-7a8c-445d-a143-579f38a84bf3', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '5575dc4f-f78c-4491-8ef0-9c778f1b4435', + payInAdvance: false, + invoiceDisplayName: 'rec count prorated volume', + billableMetric: { + id: 'aecf4a46-c08c-48a0-88c1-dc1c894f9bf2', + name: 'rec count', + aggregationType: 'unique_count_agg', + }, + chargeModel: 'volume', + minAmountCents: '0', + prorated: true, + }, + eventsCount: '1', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: '1.0', + perUnitAmount: '1.0', + perUnitTotalAmount: '1.0', + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'rec count prorated volume' }, + }, + { + id: '5e6acf8d-c7af-4c52-94ae-ad2784a25ad0', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '0', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'Sum BM', + itemName: 'Sum BM', + units: 0, + preciseUnitAmount: 0, + appliedTaxes: [{ id: 'de7d66ad-b9ca-464f-92da-ba2d4dba0609', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '422e93d6-1c10-4339-b327-2a3ca61581f5', + payInAdvance: false, + invoiceDisplayName: '', + billableMetric: { + id: '869d5637-5eb3-40db-8dbc-a87b8cd7a3f8', + name: 'Sum BM', + aggregationType: 'sum_agg', + }, + chargeModel: 'percentage', + minAmountCents: '0', + prorated: false, + }, + eventsCount: '0', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: '0.0', + freeUnits: '0.0', + paidUnits: '0.0', + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: '0.0', + fixedFeeUnitAmount: '0.0', + freeEvents: 0, + minMaxAdjustmentTotalAmount: '0.0', + paidEvents: 0, + rate: '11.0', + units: '0.0', + }, + metadata: { isNormalFee: true, displayName: 'Sum BM' }, + }, + ], + feesInArrearsZero: [], + feesInAdvance: [ + { + id: '626e9246-f986-4aa1-b586-3501f5b50dbc', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '10000', + description: null, + feeType: 'subscription', + invoiceDisplayName: null, + invoiceName: 'sub fee', + itemName: 'maxi plan sub arrears', + units: 1, + preciseUnitAmount: 100, + appliedTaxes: [{ id: 'de9197a3-4919-40ca-85cf-4db578fd1961', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: null, + eventsCount: null, + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { + isSubscriptionFee: true, + displayName: 'Monthly subscription fee - maxi plan sub arrears', + }, + }, + { + id: 'c67735cf-65df-451c-a956-20009200155d', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '9999900', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'Advance recurring', + itemName: 'rec count', + units: 1, + preciseUnitAmount: 99999, + appliedTaxes: [{ id: '3d930b1c-e237-46e5-8c14-0b9d178a9f79', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '0fc08fb5-7cc1-43bd-a7d2-d3fac8835d0c', + payInAdvance: true, + invoiceDisplayName: 'Advance recurring', + billableMetric: { + id: 'aecf4a46-c08c-48a0-88c1-dc1c894f9bf2', + name: 'rec count', + aggregationType: 'unique_count_agg', + }, + chargeModel: 'standard', + minAmountCents: '0', + prorated: false, + }, + eventsCount: '1', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'Advance recurring' }, + }, + { + id: '86ee400c-a0c5-4e7b-a6c4-0915a7296fcd', + subscription: { + id: '5cf07951-4296-46d1-9ca1-d4e87d6e6928', + name: '', + plan: { + id: 'ee3f1bf6-1be1-4def-b5b9-2b0bffba15ce', + name: 'maxi plan sub arrears', + invoiceDisplayName: 'sub fee', + interval: 'monthly', + }, + }, + amountCents: '66700', + description: null, + feeType: 'charge', + invoiceDisplayName: null, + invoiceName: 'rec count prorated advance', + itemName: 'rec count', + units: 1, + preciseUnitAmount: 667, + appliedTaxes: [{ id: 'ec8d1e3c-6cee-40f4-8e4a-70850ceecded', taxRate: 20 }], + trueUpFee: null, + trueUpParentFee: null, + charge: { + id: '054ca896-1e1c-4190-ad42-eed7c24b9270', + payInAdvance: true, + invoiceDisplayName: 'rec count prorated advance', + billableMetric: { + id: 'aecf4a46-c08c-48a0-88c1-dc1c894f9bf2', + name: 'rec count', + aggregationType: 'unique_count_agg', + }, + chargeModel: 'standard', + minAmountCents: '0', + prorated: true, + }, + eventsCount: '1', + amountDetails: { + graduatedRanges: null, + graduatedPercentageRanges: null, + flatUnitAmount: null, + perUnitAmount: null, + perUnitTotalAmount: null, + freeUnits: null, + paidUnits: null, + perPackageSize: null, + perPackageUnitAmount: null, + fixedFeeTotalAmount: null, + fixedFeeUnitAmount: null, + freeEvents: null, + minMaxAdjustmentTotalAmount: null, + paidEvents: null, + rate: null, + units: null, + }, + metadata: { isNormalFee: true, displayName: 'rec count prorated advance' }, + }, + ], + feesInAdvanceZero: [], + metadata: { + differentBoundariesForSubscriptionAndCharges: true, + subscriptionDisplayName: 'maxi plan sub arrears', + fromDatetime: '2024-03-11T00:00:00Z', + toDatetime: '2024-04-10T23:59:59Z', + chargesFromDatetime: '2024-02-11T00:00:00Z', + chargesToDatetime: '2024-03-10T23:59:59Z', + inAdvanceChargesFromDatetime: null, + inAdvanceChargesToDatetime: null, + invoiceId: '1234', + }, + }, + }, +} export const orderedSubscriptionWithFees = { metadata: { @@ -6120,6 +8784,7 @@ export const orderedSubscriptionWithFees = { fromDatetime: '2024-03-01T00:00:00Z', inAdvanceChargesFromDatetime: null, inAdvanceChargesToDatetime: null, + invoiceId: '1234', subscriptionDisplayName: 'maxi plan sub arrears', toDatetime: '2024-03-31T23:59:59Z', }, @@ -6652,6 +9317,7 @@ export const orderedSubscriptionWithFees = { fromDatetime: '2024-03-11T00:00:00Z', inAdvanceChargesFromDatetime: null, inAdvanceChargesToDatetime: null, + invoiceId: '1234', subscriptionDisplayName: 'maxi plan sub arrears', toDatetime: '2024-04-10T23:59:59Z', }, diff --git a/src/core/formats/__tests__/formatInvoiceItemsMap.test.ts b/src/core/formats/__tests__/formatInvoiceItemsMap.test.ts index 7f6b771d1..040da0dfd 100644 --- a/src/core/formats/__tests__/formatInvoiceItemsMap.test.ts +++ b/src/core/formats/__tests__/formatInvoiceItemsMap.test.ts @@ -5,6 +5,10 @@ import { chargeZeroAmount, chargeZeroAmountDraftInvoice, chargeZeroAmountDraftInvoiceResult, + chargeZeroAmountResult, + newChargeZeroAmountDraftInvoiceResult, + newNoFeesResult, + newOrderedSubscriptionWithFees, noFees, noFeesResult, oneSubscription, @@ -61,52 +65,144 @@ describe('formatInvoiceItemsMap', () => { }) describe('groupAndFormatFees', () => { - it('should return default values if there are no data', () => { - const result = groupAndFormatFees([]) + describe('if hasOldZeroFeeManagement: true', () => { + it('should return default values if there are no data', () => { + const result = groupAndFormatFees({ + invoiceSubscriptions: [], + hasOldZeroFeeManagement: true, + }) + + expect(result).toEqual({ + subscriptions: {}, + metadata: { hasAnyFeeParsed: false, hasAnyPositiveFeeParsed: false }, + }) + }) + it('should return default values if there are no fees', () => { + const result = groupAndFormatFees({ + invoiceSubscriptions: noFees as unknown as InvoiceSubscription[], + hasOldZeroFeeManagement: true, + }) - expect(result).toEqual({ - subscriptions: {}, - metadata: { hasAnyFeeParsed: false, hasAnyPositiveFeeParsed: false }, + expect(result).toEqual(noFeesResult) }) - }) - it('should return default values if there are no fees', () => { - const result = groupAndFormatFees(noFees as unknown as InvoiceSubscription[]) + it('should return default values if there are only sub fee with 0 amountCents', () => { + const result = groupAndFormatFees({ + invoiceSubscriptions: subZeroAmount as unknown as InvoiceSubscription[], + hasOldZeroFeeManagement: true, + }) - expect(result).toEqual(noFeesResult) - }) - it('should return default values if there are only sub fee with 0 amountCents', () => { - const result = groupAndFormatFees(subZeroAmount as unknown as InvoiceSubscription[]) + expect(result).toEqual(subZeroAmountResult) + }) + 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 InvoiceSubscription[], + hasOldZeroFeeManagement: true, + }) - expect(result).toEqual(subZeroAmountResult) - }) - it('should return default values if there are only sub fee with 0 amountCents and 0 units', () => { - const result = groupAndFormatFees(chargeZeroAmount as unknown as InvoiceSubscription[]) + expect(result).toEqual(noFeesResult) + }) + it('should return all values if invoice has draft status', () => { + const result = groupAndFormatFees({ + invoiceSubscriptions: chargeZeroAmountDraftInvoice as unknown as InvoiceSubscription[], + hasOldZeroFeeManagement: true, + }) - expect(result).toEqual(noFeesResult) - }) - it('should return all values if invoice has draft status', () => { - const result = groupAndFormatFees( - chargeZeroAmountDraftInvoice as unknown as InvoiceSubscription[], - ) + expect(result).toEqual(chargeZeroAmountDraftInvoiceResult) + }) + it('should return the correct values if there are 1 subscription', () => { + const result = groupAndFormatFees({ + invoiceSubscriptions: oneSubscription as unknown as InvoiceSubscription[], + hasOldZeroFeeManagement: true, + }) - expect(result).toEqual(chargeZeroAmountDraftInvoiceResult) - }) - it('should return the correct values if there are 1 subscription', () => { - const result = groupAndFormatFees(oneSubscription as unknown as InvoiceSubscription[]) + expect(result).toEqual(oneSubscriptionResult) + }) + it('should return the correct values if there are 2 subscription', () => { + const result = groupAndFormatFees({ + invoiceSubscriptions: twoSubscriptions as unknown as InvoiceSubscription[], + hasOldZeroFeeManagement: true, + }) - expect(result).toEqual(oneSubscriptionResult) - }) - it('should return the correct values if there are 2 subscription', () => { - const result = groupAndFormatFees(twoSubscriptions as unknown as InvoiceSubscription[]) + expect(result).toEqual(twoSubscriptionsResult) + }) + it('should return the correct order for a given subscription', () => { + const result = groupAndFormatFees({ + invoiceSubscriptions: unorderedSubscriptionWithFees as unknown as InvoiceSubscription[], + hasOldZeroFeeManagement: true, + }) - expect(result).toEqual(twoSubscriptionsResult) + expect(result).toEqual(orderedSubscriptionWithFees) + }) }) - it('should return the correct order for a given subscription', () => { - const result = groupAndFormatFees( - unorderedSubscriptionWithFees as unknown as InvoiceSubscription[], - ) - expect(result).toEqual(orderedSubscriptionWithFees) + describe('if hasOldZeroFeeManagement: false', () => { + it('should return default values if there are no data', () => { + const result = groupAndFormatFees({ + invoiceSubscriptions: [], + hasOldZeroFeeManagement: false, + }) + + expect(result).toEqual({ + subscriptions: {}, + metadata: { hasAnyFeeParsed: false, hasAnyPositiveFeeParsed: false }, + }) + }) + it('should return default values if there are no fees', () => { + const result = groupAndFormatFees({ + invoiceSubscriptions: noFees as unknown as InvoiceSubscription[], + hasOldZeroFeeManagement: false, + }) + + expect(result).toEqual(newNoFeesResult) + }) + it('should return default values if there are only sub fee with 0 amountCents', () => { + const result = groupAndFormatFees({ + invoiceSubscriptions: subZeroAmount as unknown as InvoiceSubscription[], + hasOldZeroFeeManagement: false, + }) + + expect(result).toEqual(subZeroAmountResult) + }) + 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 InvoiceSubscription[], + hasOldZeroFeeManagement: false, + }) + + expect(result).toEqual(chargeZeroAmountResult) + }) + it('should return all values if invoice has draft status', () => { + const result = groupAndFormatFees({ + invoiceSubscriptions: chargeZeroAmountDraftInvoice as unknown as InvoiceSubscription[], + hasOldZeroFeeManagement: false, + }) + + expect(result).toEqual(newChargeZeroAmountDraftInvoiceResult) + }) + it('should return the correct values if there are 1 subscription', () => { + const result = groupAndFormatFees({ + invoiceSubscriptions: oneSubscription as unknown as InvoiceSubscription[], + hasOldZeroFeeManagement: false, + }) + + expect(result).toEqual(oneSubscriptionResult) + }) + it('should return the correct values if there are 2 subscription', () => { + const result = groupAndFormatFees({ + invoiceSubscriptions: twoSubscriptions as unknown as InvoiceSubscription[], + hasOldZeroFeeManagement: false, + }) + + expect(result).toEqual(twoSubscriptionsResult) + }) + it('should return the correct order for a given subscription', () => { + const result = groupAndFormatFees({ + invoiceSubscriptions: unorderedSubscriptionWithFees as unknown as InvoiceSubscription[], + hasOldZeroFeeManagement: false, + }) + + expect(result).toEqual(newOrderedSubscriptionWithFees) + }) }) }) diff --git a/src/core/formats/formatInvoiceItemsMap.ts b/src/core/formats/formatInvoiceItemsMap.ts index f0b5bf0b6..f38823fb0 100644 --- a/src/core/formats/formatInvoiceItemsMap.ts +++ b/src/core/formats/formatInvoiceItemsMap.ts @@ -87,6 +87,7 @@ export type TSubscriptionDataForDisplay = { chargesToDatetime: string inAdvanceChargesFromDatetime: string inAdvanceChargesToDatetime: string + invoiceId: string } } } @@ -149,16 +150,20 @@ export const getSubscriptionFeeDisplayName = (fee: TExtendedRemainingFee) => { return `${capitalizedPlanInterval} subscription fee - ${plan?.name}` } -export const groupAndFormatFees = ( - invoiceSubscription: InvoiceSubscription[] | null | undefined, -): TFormatedInvoiceSubscriptionDataForDisplay => { +export const groupAndFormatFees = ({ + invoiceSubscriptions, + hasOldZeroFeeManagement, +}: { + invoiceSubscriptions: InvoiceSubscription[] | null | undefined + hasOldZeroFeeManagement: boolean +}): TFormatedInvoiceSubscriptionDataForDisplay => { let hasAnyFeeParsed = false let hasAnyPositiveFeeParsed = false - if (!invoiceSubscription?.length) + if (!invoiceSubscriptions?.length) return { subscriptions: {}, metadata: { hasAnyFeeParsed, hasAnyPositiveFeeParsed } } - const feesGroupedBySubscription = invoiceSubscription?.reduce( + const feesGroupedBySubscription = invoiceSubscriptions?.reduce( (acc, invoiceSub) => { const subscriptionId = invoiceSub?.subscription?.id @@ -184,6 +189,7 @@ export const groupAndFormatFees = ( chargesToDatetime: invoiceSub?.chargesToDatetime, inAdvanceChargesFromDatetime: invoiceSub?.inAdvanceChargesFromDatetime, inAdvanceChargesToDatetime: invoiceSub?.inAdvanceChargesToDatetime, + invoiceId: invoiceSub?.invoice?.id, }, } } @@ -194,7 +200,7 @@ export const groupAndFormatFees = ( for (let i = 0; i < invoiceSub?.fees?.length; i++) { const currentFee = invoiceSub?.fees[i] as TExtendedRemainingFee - const isZeroFee = currentFee.units === 0 + const isZeroFee = hasOldZeroFeeManagement && currentFee.units === 0 const isFeeInAdvance = currentFee.charge?.payInAdvance || diff --git a/src/generated/graphql.tsx b/src/generated/graphql.tsx index 2dca2ceda..e77d47860 100644 --- a/src/generated/graphql.tsx +++ b/src/generated/graphql.tsx @@ -1069,10 +1069,14 @@ export type CreateAddOnInput = { /** Create Adjusted Fee Input */ export type CreateAdjustedFeeInput = { + chargeFilterId?: InputMaybe; + chargeId?: InputMaybe; /** A unique identifier for the client performing the mutation. */ clientMutationId?: InputMaybe; - feeId: Scalars['ID']['input']; + feeId?: InputMaybe; invoiceDisplayName?: InputMaybe; + invoiceId: Scalars['ID']['input']; + subscriptionId?: InputMaybe; unitPreciseAmount?: InputMaybe; units?: InputMaybe; }; @@ -2933,6 +2937,7 @@ export enum InviteStatusTypeEnum { /** Invoice */ export type Invoice = { __typename?: 'Invoice'; + allChargesHaveFees: Scalars['Boolean']['output']; appliedTaxes?: Maybe>; associatedActiveWalletPresent: Scalars['Boolean']['output']; availableToCreditAmountCents: Scalars['BigInt']['output']; @@ -7108,7 +7113,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, issuingDate: any, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', name?: string | null, displayName: string, id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | 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, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | 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, 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: 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, issuingDate: any, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', name?: string | null, displayName: string, id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | 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, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | 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, 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; export type TaxForInvoiceEditTaxDialogFragment = { __typename?: 'Tax', id: string, name: string, rate: number, code: string }; @@ -7129,7 +7134,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, currency?: CurrencyEnum | null, voidable: boolean, paymentDisputeLostAt?: any | null, taxProviderVoidable: boolean, invoiceType: InvoiceTypeEnum, creditableAmountCents: any, refundableAmountCents: any, associatedActiveWalletPresent: boolean, integrationSyncable: boolean, externalIntegrationId?: string | null, integrationHubspotSyncable: boolean, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, versionNumber: number, paymentDueDate: any, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, customer: { __typename?: 'Customer', name?: string | null, displayName: string, id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | 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, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | null }, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: 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, 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: 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, currency?: CurrencyEnum | null, voidable: boolean, paymentDisputeLostAt?: any | null, taxProviderVoidable: boolean, invoiceType: InvoiceTypeEnum, creditableAmountCents: any, refundableAmountCents: any, associatedActiveWalletPresent: boolean, integrationSyncable: boolean, externalIntegrationId?: string | null, integrationHubspotSyncable: boolean, 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', name?: string | null, displayName: string, id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | 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, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | null }, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: 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, 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; export type InvoiceForFinalizeInvoiceFragment = { __typename?: 'Invoice', id: string, issuingDate: any, customer: { __typename?: 'Customer', id: string, applicableTimezone: TimezoneEnum } }; @@ -7138,7 +7143,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, issuingDate: any, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', name?: string | null, displayName: string, id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | 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, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | 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, 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: 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, issuingDate: any, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', name?: string | null, displayName: string, id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | 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, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | 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, 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; export type InvoiceForCreditNotesTableFragment = { __typename?: 'Invoice', id: string, customer: { __typename?: 'Customer', id: 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 }; @@ -7155,7 +7160,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, currency?: CurrencyEnum | null, voidable: boolean, paymentDisputeLostAt?: any | null, taxProviderVoidable: boolean, invoiceType: InvoiceTypeEnum, creditableAmountCents: any, refundableAmountCents: any, associatedActiveWalletPresent: boolean, integrationSyncable: boolean, externalIntegrationId?: string | null, integrationHubspotSyncable: boolean, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, versionNumber: number, paymentDueDate: any, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, customer: { __typename?: 'Customer', name?: string | null, displayName: string, id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | 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, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | null }, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: 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, 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: 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, currency?: CurrencyEnum | null, voidable: boolean, paymentDisputeLostAt?: any | null, taxProviderVoidable: boolean, invoiceType: InvoiceTypeEnum, creditableAmountCents: any, refundableAmountCents: any, associatedActiveWalletPresent: boolean, integrationSyncable: boolean, externalIntegrationId?: string | null, integrationHubspotSyncable: boolean, 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', name?: string | null, displayName: string, id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | 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, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | null }, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: 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, 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; export type FeeForDeleteAdjustmentFeeDialogFragment = { __typename?: 'Fee', id: string }; @@ -7166,7 +7171,16 @@ export type DestroyAdjustedFeeMutationVariables = Exact<{ export type DestroyAdjustedFeeMutation = { __typename?: 'Mutation', destroyAdjustedFee?: { __typename?: 'DestroyAdjustedFeePayload', id?: string | null } | null }; -export type FeeForEditfeeDrawerFragment = { __typename?: 'Fee', id: string, currency: CurrencyEnum }; +export type InvoiceSubscriptionForCreateFeeDrawerFragment = { __typename?: 'InvoiceSubscription', subscription: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, charges?: Array<{ __typename?: 'Charge', id: string, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, filters?: Array<{ __typename?: 'ChargeFilter', id: string, invoiceDisplayName?: string | null, values: any }> | null, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, code: string } }> | null } }, fees?: Array<{ __typename?: 'Fee', id: string, charge?: { __typename?: 'Charge', id: string, filters?: Array<{ __typename?: 'ChargeFilter', id: string, values: any }> | null } | null, chargeFilter?: { __typename?: 'ChargeFilter', id: string } | null }> | null }; + +export type FeeForEditfeeDrawerFragment = { __typename?: 'Fee', id: string, currency: CurrencyEnum, charge?: { __typename?: 'Charge', id: string, chargeModel: ChargeModelEnum, prorated: boolean } | null }; + +export type GetInvoiceDetailsForCreateFeeDrawerQueryVariables = Exact<{ + invoiceId: Scalars['ID']['input']; +}>; + + +export type GetInvoiceDetailsForCreateFeeDrawerQuery = { __typename?: 'Query', invoice?: { __typename?: 'Invoice', id: string, invoiceSubscriptions?: Array<{ __typename?: 'InvoiceSubscription', subscription: { __typename?: 'Subscription', id: string, plan: { __typename?: 'Plan', id: string, charges?: Array<{ __typename?: 'Charge', id: string, invoiceDisplayName?: string | null, chargeModel: ChargeModelEnum, prorated: boolean, filters?: Array<{ __typename?: 'ChargeFilter', id: string, invoiceDisplayName?: string | null, values: any }> | null, billableMetric: { __typename?: 'BillableMetric', id: string, name: string, code: string } }> | null } }, fees?: Array<{ __typename?: 'Fee', id: string, charge?: { __typename?: 'Charge', id: string, filters?: Array<{ __typename?: 'ChargeFilter', id: string, values: any }> | null } | null, chargeFilter?: { __typename?: 'ChargeFilter', id: string } | null }> | null }> | null } | null }; export type CreateAdjustedFeeMutationVariables = Exact<{ input: CreateAdjustedFeeInput; @@ -7177,7 +7191,7 @@ export type CreateAdjustedFeeMutation = { __typename?: 'Mutation', createAdjuste 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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', invoiceType: InvoiceTypeEnum, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, totalAmountCents: any, currency?: CurrencyEnum | null, issuingDate: any, versionNumber: number, couponsAmountCents: any, creditNotesAmountCents: 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, customer: { __typename?: 'Customer', id: string, currency?: CurrencyEnum | null, applicableTimezone: TimezoneEnum }, invoiceSubscriptions?: Array<{ __typename?: 'InvoiceSubscription', fromDatetime?: any | null, toDatetime?: any | null, chargesFromDatetime?: any | null, chargesToDatetime?: any | null, inAdvanceChargesFromDatetime?: any | null, inAdvanceChargesToDatetime?: any | null, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null }; +export type InvoiceForDetailsTableFragment = { __typename?: 'Invoice', invoiceType: InvoiceTypeEnum, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, totalAmountCents: any, currency?: CurrencyEnum | null, issuingDate: any, allChargesHaveFees: boolean, versionNumber: number, couponsAmountCents: any, creditNotesAmountCents: 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, customer: { __typename?: 'Customer', id: string, currency?: CurrencyEnum | null, applicableTimezone: TimezoneEnum }, invoiceSubscriptions?: Array<{ __typename?: 'InvoiceSubscription', fromDatetime?: any | null, toDatetime?: any | null, chargesFromDatetime?: any | null, chargesToDatetime?: any | null, inAdvanceChargesFromDatetime?: any | null, inAdvanceChargesToDatetime?: any | null, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: 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, 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 }; @@ -8643,14 +8657,14 @@ 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, issuingDate: any, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', name?: string | null, displayName: string, id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | 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, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | 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, 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: 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, issuingDate: any, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', name?: string | null, displayName: string, id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | 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, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | 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, 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null }; export type GetInvoiceDetailsQueryVariables = Exact<{ id: Scalars['ID']['input']; }>; -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, issuingDate: any, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', name?: string | null, displayName: string, id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | 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, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | 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, 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: 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, issuingDate: any, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', name?: string | null, displayName: string, id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | 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, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | 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, 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; export type IntegrationsListForCustomerInvoiceDetailsQueryVariables = Exact<{ limit?: InputMaybe; @@ -8671,7 +8685,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, issuingDate: any, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', name?: string | null, displayName: string, id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | 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, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | 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, 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: 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, issuingDate: any, externalHubspotIntegrationId?: string | null, integrationSalesforceSyncable: boolean, externalSalesforceIntegrationId?: string | null, subTotalExcludingTaxesAmountCents: any, subTotalIncludingTaxesAmountCents: any, allChargesHaveFees: boolean, versionNumber: number, paymentDueDate: any, paymentOverdue: boolean, couponsAmountCents: any, creditNotesAmountCents: any, prepaidCreditAmountCents: any, progressiveBillingCreditAmountCents: any, errorDetails?: Array<{ __typename?: 'ErrorDetail', errorCode: ErrorCodesEnum, errorDetails?: string | null }> | null, customer: { __typename?: 'Customer', name?: string | null, displayName: string, id: string, applicableTimezone: TimezoneEnum, currency?: CurrencyEnum | 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, netsuiteCustomer?: { __typename?: 'NetsuiteCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, xeroCustomer?: { __typename?: 'XeroCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, hubspotCustomer?: { __typename?: 'HubspotCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, salesforceCustomer?: { __typename?: 'SalesforceCustomer', id: string, integrationId?: string | null, externalCustomerId?: string | null } | null, anrokCustomer?: { __typename?: 'AnrokCustomer', id: string, externalAccountId?: string | null } | null, metadata?: Array<{ __typename?: 'CustomerMetadata', id: string, displayInInvoice: boolean, key: string, value: string }> | 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, 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, 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, subscription: { __typename?: 'Subscription', id: string, name?: string | null, plan: { __typename?: 'Plan', id: string, name: string, interval: PlanInterval, amountCents: any, amountCurrency: CurrencyEnum, invoiceDisplayName?: string | 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, appliedTaxes?: Array<{ __typename?: 'FeeAppliedTax', id: string, taxRate: number }> | null, trueUpFee?: { __typename?: 'Fee', id: string } | null, trueUpParentFee?: { __typename?: 'Fee', id: string } | 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, invoice: { __typename?: 'Invoice', id: string, status: InvoiceStatusTypeEnum } }> | null, metadata?: Array<{ __typename?: 'InvoiceMetadata', id: string, key: string, value: string }> | null, appliedTaxes?: Array<{ __typename?: 'InvoiceAppliedTax', id: string, amountCents: any, feesAmountCents: any, taxableAmountCents: any, taxRate: number, taxName: string, enumedTaxCode?: InvoiceAppliedTaxOnWholeInvoiceCodeEnum | null }> | null } | null }; export type SyncIntegrationInvoiceMutationVariables = Exact<{ input: SyncIntegrationInvoiceInput; @@ -9895,6 +9909,45 @@ export const InvoiceForVoidInvoiceDialogFragmentDoc = gql` number } `; +export const InvoiceSubscriptionForCreateFeeDrawerFragmentDoc = gql` + fragment InvoiceSubscriptionForCreateFeeDrawer on InvoiceSubscription { + subscription { + id + plan { + id + charges { + id + invoiceDisplayName + chargeModel + prorated + filters { + id + invoiceDisplayName + values + } + billableMetric { + id + name + code + } + } + } + } + fees { + id + charge { + id + filters { + id + values + } + } + chargeFilter { + id + } + } +} + `; export const BillableMetricForChargeSectionFragmentDoc = gql` fragment BillableMetricForChargeSection on BillableMetric { id @@ -11602,6 +11655,11 @@ export const FeeForEditfeeDrawerFragmentDoc = gql` fragment FeeForEditfeeDrawer on Fee { id currency + charge { + id + chargeModel + prorated + } } `; export const FeeForDeleteAdjustmentFeeDialogFragmentDoc = gql` @@ -11806,6 +11864,7 @@ export const InvoiceForDetailsTableFragmentDoc = gql` totalAmountCents currency issuingDate + allChargesHaveFees versionNumber errorDetails { errorCode @@ -15995,6 +16054,49 @@ export function useDestroyAdjustedFeeMutation(baseOptions?: Apollo.MutationHookO export type DestroyAdjustedFeeMutationHookResult = ReturnType; export type DestroyAdjustedFeeMutationResult = Apollo.MutationResult; export type DestroyAdjustedFeeMutationOptions = Apollo.BaseMutationOptions; +export const GetInvoiceDetailsForCreateFeeDrawerDocument = gql` + query getInvoiceDetailsForCreateFeeDrawer($invoiceId: ID!) { + invoice(id: $invoiceId) { + id + invoiceSubscriptions { + ...InvoiceSubscriptionForCreateFeeDrawer + } + } +} + ${InvoiceSubscriptionForCreateFeeDrawerFragmentDoc}`; + +/** + * __useGetInvoiceDetailsForCreateFeeDrawerQuery__ + * + * To run a query within a React component, call `useGetInvoiceDetailsForCreateFeeDrawerQuery` and pass it any options that fit your needs. + * When your component renders, `useGetInvoiceDetailsForCreateFeeDrawerQuery` 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 } = useGetInvoiceDetailsForCreateFeeDrawerQuery({ + * variables: { + * invoiceId: // value for 'invoiceId' + * }, + * }); + */ +export function useGetInvoiceDetailsForCreateFeeDrawerQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: GetInvoiceDetailsForCreateFeeDrawerQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetInvoiceDetailsForCreateFeeDrawerDocument, options); + } +export function useGetInvoiceDetailsForCreateFeeDrawerLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetInvoiceDetailsForCreateFeeDrawerDocument, options); + } +export function useGetInvoiceDetailsForCreateFeeDrawerSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { + const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return Apollo.useSuspenseQuery(GetInvoiceDetailsForCreateFeeDrawerDocument, options); + } +export type GetInvoiceDetailsForCreateFeeDrawerQueryHookResult = ReturnType; +export type GetInvoiceDetailsForCreateFeeDrawerLazyQueryHookResult = ReturnType; +export type GetInvoiceDetailsForCreateFeeDrawerSuspenseQueryHookResult = ReturnType; +export type GetInvoiceDetailsForCreateFeeDrawerQueryResult = Apollo.QueryResult; export const CreateAdjustedFeeDocument = gql` mutation createAdjustedFee($input: CreateAdjustedFeeInput!) { createAdjustedFee(input: $input) { diff --git a/translations/base.json b/translations/base.json index 1bb31597e..5c46f4fd7 100644 --- a/translations/base.json +++ b/translations/base.json @@ -1247,16 +1247,15 @@ "text_65a6b4e2cb38d9b70ec53c2d": "Modify the total unit or amount of the fee, and Lago will automatically replace the existing fee with the new one.", "text_65a6b4e2cb38d9b70ec53c35": "Current fee", "text_65a6b4e2cb38d9b70ec53d31": "New fee", - "text_65a6b4e2cb38d9b70ec53d39": "Invoice display name", + "text_65a6b4e2cb38d9b70ec53d39": "Invoice display name (optional)", "text_65a6b4e2cb38d9b70ec53d41": "Type an invoice display name", "text_65a6b4e2cb38d9b70ec53d49": "Adjustment", "text_65a6b4e2cb38d9b70ec53d83": "Total amount", "text_65a6b4e2cb38d9b70ec53d93": "Lago will calculate a new price based on specific inputs. The detailed breakdown associated with the charge model will no longer be available.", "text_65a6b4e2cb38d9b70ec53d9b": "Adjust fee", "text_65a6b4e2cb38d9b70ec53dec": "(edited fee)", - "text_65a6b4e2cb38d9b70ec54035": "Reset to initial fee", + "text_65a6b4e2cb38d9b70ec54035": "Reset fee", "text_65a6b4e2cb38d9b70ec53c55": "You are about to lose the edits made to the fee; it will reset to the value calculated by Lago. Please re-edit to make any desired changes.", - "text_65a6b4e2cb38d9b70ec53c67": "Reset fee", "text_65a94d976d7a9700716590d9": "Search or select an adjustment", "text_65b116a266d90732cac8b39b": "Display {{count}} fee at 0 units|Display {{count}} fees at 0 units", "text_65b116a266d90732cac8b3bc": "Hide {{count}} fee at 0 units|Hide {{count}} fees at 0 units", @@ -2794,5 +2793,12 @@ "text_17367626793434wkg1rk0114": "Cashfree", "text_1736764955395763x9k5gqkj": "These integrations are not officially developed by Lago, so please be aware that our team cannot provide support for any issues that may arise.", "text_1737556835239q7202lhbdhk": "To see the difference with the new fee, here’s the current one,", - "text_17375568352390mlfarq4p6t": "This fee will be added as an adjustment until the invoice is finalized." + "text_17375568352390mlfarq4p6t": "This fee will be added as an adjustment until the invoice is finalized.", + "text_1737709105343hobdiidr8r9": "Add a new fee", + "text_1737709105343hpvidjp0yz0": "Add a new fee to this invoice", + "text_1737731953885hprgxewyizj": "Select a fee from the charges not yet included in the invoice.", + "text_1737731953885tbem8s4xo8t": "Charge", + "text_1737733582553rmmlatfbk1r": "Search or select a specific charge", + "text_1737733582553dm4huzkoee6": "Search or select a specific filters", + "text_1738084927595tzdnuy6oxyu": "Fee successfully reset" }