Skip to content

Commit 1ce07c3

Browse files
authored
Merge pull request Expensify#93243 from Expensify/revert-73887-invoiceFields
[CP Staging] Revert "Merge pull request Expensify#73887 from ShridharGoel/invoiceFields"
2 parents 687c32b + 26a319d commit 1ce07c3

66 files changed

Lines changed: 1523 additions & 3035 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config/eslint/eslint.seatbelt.tsv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,6 +1860,7 @@
18601860
"../../tests/unit/ViolationUtilsTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 20
18611861
"../../tests/unit/WhisperContentMentionContextTest.tsx" "@typescript-eslint/no-unsafe-type-assertion" 3
18621862
"../../tests/unit/WorkflowUtilsTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 8
1863+
"../../tests/unit/WorkspaceReportFieldUtilsTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 2
18631864
"../../tests/unit/WorkspacesSettingsUtilsTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 15
18641865
"../../tests/unit/awaitStagingDeploysTest.ts" "@typescript-eslint/no-unsafe-type-assertion" 3
18651866
"../../tests/unit/canEditFieldOfMoneyRequestTest.ts" "@typescript-eslint/no-deprecated/randomReportAction.originalMessage" 3

src/CONST/index.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3981,7 +3981,6 @@ const CONST = {
39813981
ARE_DISTANCE_RATES_ENABLED: 'areDistanceRatesEnabled',
39823982
ARE_WORKFLOWS_ENABLED: 'areWorkflowsEnabled',
39833983
ARE_REPORT_FIELDS_ENABLED: 'areReportFieldsEnabled',
3984-
ARE_INVOICE_FIELDS_ENABLED: 'areInvoiceFieldsEnabled',
39853984
ARE_CONNECTIONS_ENABLED: 'areConnectionsEnabled',
39863985
ARE_RECEIPT_PARTNERS_ENABLED: 'receiptPartners',
39873986
ARE_COMPANY_CARDS_ENABLED: 'areCompanyCardsEnabled',
@@ -7248,14 +7247,6 @@ const CONST = {
72487247
description: 'workspace.upgrade.reportFields.description' as const,
72497248
icon: 'Pencil',
72507249
},
7251-
invoiceFields: {
7252-
id: 'invoiceFields' as const,
7253-
alias: 'invoice-fields',
7254-
name: 'Invoice Fields',
7255-
title: 'workspace.upgrade.invoiceFields.title' as const,
7256-
description: 'workspace.upgrade.invoiceFields.description' as const,
7257-
icon: 'Pencil',
7258-
},
72597250
policyPreventMemberChangingTitle: {
72607251
id: 'policyPreventMemberChangingTitle' as const,
72617252
alias: 'policy-prevent-member-changing-title',
@@ -7517,10 +7508,6 @@ const CONST = {
75177508
LIST: 'dropdown',
75187509
FORMULA: 'formula',
75197510
},
7520-
REPORT_FIELD_TARGETS: {
7521-
EXPENSE: 'expense',
7522-
INVOICE: 'invoice',
7523-
},
75247511

75257512
NAVIGATION_ACTIONS: {
75267513
RESET: 'RESET',

src/ROUTES.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2428,35 +2428,6 @@ const ROUTES = {
24282428
route: 'workspaces/:policyID/invoices/company-website',
24292429
getRoute: (policyID: string) => `workspaces/${policyID}/invoices/company-website` as const,
24302430
},
2431-
WORKSPACE_INVOICE_FIELDS_CREATE: {
2432-
route: 'workspaces/:policyID/invoices/newInvoiceField',
2433-
getRoute: (policyID: string) => `workspaces/${policyID}/invoices/newInvoiceField` as const,
2434-
},
2435-
WORKSPACE_INVOICE_FIELDS_SETTINGS: {
2436-
route: 'workspaces/:policyID/invoices/:reportFieldID/edit',
2437-
getRoute: (policyID: string, reportFieldID: string) => `workspaces/${policyID}/invoices/${encodeURIComponent(reportFieldID)}/edit` as const,
2438-
},
2439-
WORKSPACE_INVOICE_FIELDS_LIST_VALUES: {
2440-
route: 'workspaces/:policyID/invoices/listValues/:reportFieldID?',
2441-
getRoute: (policyID: string, reportFieldID?: string) => `workspaces/${policyID}/invoices/listValues/${reportFieldID ? encodeURIComponent(reportFieldID) : ''}` as const,
2442-
},
2443-
WORKSPACE_INVOICE_FIELDS_ADD_VALUE: {
2444-
route: 'workspaces/:policyID/invoices/addValue/:reportFieldID?',
2445-
getRoute: (policyID: string, reportFieldID?: string) => `workspaces/${policyID}/invoices/addValue/${reportFieldID ? encodeURIComponent(reportFieldID) : ''}` as const,
2446-
},
2447-
WORKSPACE_INVOICE_FIELDS_VALUE_SETTINGS: {
2448-
route: 'workspaces/:policyID/invoices/:valueIndex/:reportFieldID?',
2449-
getRoute: (policyID: string, valueIndex: number, reportFieldID?: string) =>
2450-
`workspaces/${policyID}/invoices/${valueIndex}/${reportFieldID ? encodeURIComponent(reportFieldID) : ''}` as const,
2451-
},
2452-
WORKSPACE_INVOICE_FIELDS_EDIT_VALUE: {
2453-
route: 'workspaces/:policyID/invoices/newInvoiceField/:valueIndex/edit',
2454-
getRoute: (policyID: string, valueIndex: number) => `workspaces/${policyID}/invoices/newInvoiceField/${valueIndex}/edit` as const,
2455-
},
2456-
WORKSPACE_INVOICE_FIELDS_EDIT_INITIAL_VALUE: {
2457-
route: 'workspaces/:policyID/invoices/:reportFieldID/edit/initialValue',
2458-
getRoute: (policyID: string, reportFieldID: string) => `workspaces/${policyID}/invoices/${encodeURIComponent(reportFieldID)}/edit/initialValue` as const,
2459-
},
24602431
WORKSPACE_MEMBERS: {
24612432
route: 'workspaces/:policyID/members',
24622433
getRoute: (policyID: string | undefined) => {

src/SCREENS.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -766,13 +766,6 @@ const SCREENS = {
766766
INVOICES_VERIFY_ACCOUNT: 'Workspace_Invoices_Verify_Account',
767767
INVOICES_COMPANY_NAME: 'Workspace_Invoices_Company_Name',
768768
INVOICES_COMPANY_WEBSITE: 'Workspace_Invoices_Company_Website',
769-
INVOICE_FIELDS_CREATE: 'Workspace_InvoiceFields_Create',
770-
INVOICE_FIELDS_SETTINGS: 'Workspace_InvoiceFields_Settings',
771-
INVOICE_FIELDS_LIST_VALUES: 'Workspace_InvoiceFields_ListValues',
772-
INVOICE_FIELDS_ADD_VALUE: 'Workspace_InvoiceFields_AddValue',
773-
INVOICE_FIELDS_VALUE_SETTINGS: 'Workspace_InvoiceFields_ValueSettings',
774-
INVOICE_FIELDS_EDIT_VALUE: 'Workspace_InvoiceFields_EditValue',
775-
INVOICE_FIELDS_EDIT_INITIAL_VALUE: 'Workspace_InvoiceFields_EditInitialValue',
776769
MEMBERS: 'Workspace_Members',
777770
ROOMS: 'Workspace_Rooms',
778771
ROOM_CREATE: 'Workspace_Room_Create',

src/components/MoneyRequestReportView/MoneyRequestViewReportFields.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,8 @@ function MoneyRequestViewReportFields({report, policy, isCombinedReport = false,
121121
const isOnlyTitleFieldEnabled = enabledReportFields.length === 1 && isReportFieldOfTypeTitle(enabledReportFields.at(0));
122122
const isPaidGroupPolicyExpenseReport = isPaidGroupPolicyExpenseReportUtils(report);
123123
const isInvoiceReport = isInvoiceReportUtils(report);
124-
const areFieldsEnabledForReport = isInvoiceReport ? policy?.areInvoiceFieldsEnabled : policy?.areReportFieldsEnabled;
125124

126-
const shouldDisplayReportFields = (isPaidGroupPolicyExpenseReport || isInvoiceReport) && !!areFieldsEnabledForReport && (!isOnlyTitleFieldEnabled || !isCombinedReport);
125+
const shouldDisplayReportFields = (isPaidGroupPolicyExpenseReport || isInvoiceReport) && !!policy?.areReportFieldsEnabled && (!isOnlyTitleFieldEnabled || !isCombinedReport);
127126

128127
if (!shouldDisplayReportFields || !sortedPolicyReportFields.length) {
129128
return null;

src/components/ReportActionItem/MoneyReportView.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ function MoneyReportView({
152152
const isPaidGroupPolicyExpenseReport = isPaidGroupPolicyExpenseReportUtils(report);
153153
const isInvoiceReport = isInvoiceReportUtils(report);
154154

155-
const areFieldsEnabledForReport = isInvoiceReport ? policy?.areInvoiceFieldsEnabled : policy?.areReportFieldsEnabled;
156155
const shouldShowReportField =
157156
!isClosedExpenseReportWithNoExpenses &&
158157
(isPaidGroupPolicyExpenseReport || isInvoiceReport) &&
@@ -185,7 +184,7 @@ function MoneyReportView({
185184
{!isClosedExpenseReportWithNoExpenses && (
186185
<>
187186
{(isPaidGroupPolicyExpenseReport || isInvoiceReport) &&
188-
areFieldsEnabledForReport &&
187+
!!policy?.areReportFieldsEnabled &&
189188
(!isCombinedReport || !isOnlyTitleFieldEnabled) &&
190189
sortedPolicyReportFields.map((reportField) => {
191190
if (shouldHideSingleReportField(reportField)) {

src/languages/de.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4340,7 +4340,6 @@ ${amount} für ${merchant} – ${date}`,
43404340
customFieldHint: 'Füge benutzerdefinierte Codierung hinzu, die für alle Ausgaben dieses Mitglieds gilt.',
43414341
reports: 'Berichte',
43424342
reportFields: 'Berichtsfelder',
4343-
invoiceFields: 'Rechnungsfelder',
43444343
reportTitle: 'Berichtstitel',
43454344
reportField: 'Berichts­feld',
43464345
taxes: 'Steuern',
@@ -6025,29 +6024,6 @@ _Für ausführlichere Anweisungen [besuchen Sie unsere Hilfeseite](${CONST.NETSU
60256024
reportFieldInitialValueRequiredError: 'Bitte wähle einen Anfangswert für ein Berichtsfeld aus',
60266025
genericFailureMessage: 'Beim Aktualisieren des Berichtfelds ist ein Fehler aufgetreten. Bitte versuche es erneut.',
60276026
},
6028-
invoiceFields: {
6029-
subtitle: 'Rechnungsfelder können hilfreich sein, wenn du zusätzliche Informationen einfügen möchtest.',
6030-
importedFromAccountingSoftware: 'Die folgenden Rechnungsfelder werden importiert aus Ihrem',
6031-
disableInvoiceFields: 'Rechnungsfelder deaktivieren',
6032-
disableInvoiceFieldsConfirmation: 'Sind Sie sicher? Rechnungsfelder werden auf Rechnungen deaktiviert.',
6033-
delete: 'Rechnungsfeld löschen',
6034-
deleteConfirmation: 'Sind Sie sicher, dass Sie dieses Rechnungsfeld löschen möchten?',
6035-
findInvoiceField: 'Rechnungsfeld suchen',
6036-
nameInputSubtitle: 'Wähle einen Namen für das Rechnungsfeld.',
6037-
typeInputSubtitle: 'Wähle aus, welcher Rechnungsfeldtyp verwendet werden soll.',
6038-
initialValueInputSubtitle: 'Gib einen Startwert ein, der im Rechnungsfeld angezeigt werden soll.',
6039-
listValuesInputSubtitle: 'Diese Werte werden im Dropdown-Menü des Rechnungsfelds angezeigt. Aktivierte Werte können von Mitgliedern ausgewählt werden.',
6040-
listInputSubtitle: 'Diese Werte werden in der Rechnungsfeldliste angezeigt. Aktivierte Werte können von Mitgliedern ausgewählt werden.',
6041-
emptyInvoiceFieldsValues: {
6042-
title: 'Noch keine Listenwerte',
6043-
subtitle: 'Füge benutzerdefinierte Werte hinzu, die auf Rechnungen angezeigt werden.',
6044-
},
6045-
existingInvoiceFieldNameError: 'Ein Rechnungsfeld mit diesem Namen existiert bereits',
6046-
invoiceFieldNameRequiredError: 'Bitte gib einen Namen für das Rechnungsfeld ein',
6047-
invoiceFieldTypeRequiredError: 'Bitte wähle einen Rechnungsfeldtyp aus',
6048-
invoiceFieldInitialValueRequiredError: 'Bitte wähle einen Anfangswert für ein Rechnungsfeld aus',
6049-
addField: 'Feld hinzufügen',
6050-
},
60516027
tags: {
60526028
tagName: 'Tag-Name',
60536029
requiresTag: 'Mitglieder müssen alle Ausgaben taggen',
@@ -6852,12 +6828,6 @@ Möchten Sie sie wirklich noch einmal exportieren?`,
68526828
onlyAvailableOnPlan: ({formattedPrice, hasTeam2025Pricing}: {formattedPrice: string; hasTeam2025Pricing: boolean}) =>
68536829
`<muted-text>Berichtsfelder sind nur im Control-Tarif verfügbar, ab <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `pro Mitglied und Monat.` : `pro aktivem Mitglied und Monat.`}</muted-text>`,
68546830
},
6855-
invoiceFields: {
6856-
title: 'Rechnungsfelder',
6857-
description: `Mit Rechnungsfeldern kannst du zusätzliche Details auf Rechnungsebene in Rechnungen aufnehmen.`,
6858-
onlyAvailableOnPlan: ({formattedPrice, hasTeam2025Pricing}: {formattedPrice: string; hasTeam2025Pricing: boolean}) =>
6859-
`<muted-text>Rechnungsfelder sind nur im Control-Tarif verfügbar, ab <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `pro Mitglied und Monat.` : `pro aktivem Mitglied und Monat.`}</muted-text>`,
6860-
},
68616831
[CONST.POLICY.CONNECTIONS.NAME.NETSUITE]: {
68626832
title: 'NetSuite',
68636833
description: `Profitiere von automatischer Synchronisierung und reduziere manuelle Eingaben mit der Expensify + NetSuite-Integration. Gewinne detaillierte Finanzanalysen in Echtzeit mit nativer und benutzerdefinierter Segmentunterstützung, einschließlich Projekt- und Kundenzuordnung.`,

src/languages/en.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4429,7 +4429,6 @@ const translations = {
44294429
customFieldHint: 'Add custom coding that applies to all spend from this member.',
44304430
reports: 'Reports',
44314431
reportFields: 'Report fields',
4432-
invoiceFields: 'Invoice fields',
44334432
reportTitle: 'Report title',
44344433
reportField: 'Report field',
44354434
taxes: 'Taxes',
@@ -6072,29 +6071,6 @@ const translations = {
60726071
reportFieldInitialValueRequiredError: 'Please choose a report field initial value',
60736072
genericFailureMessage: 'An error occurred while updating the report field. Please try again.',
60746073
},
6075-
invoiceFields: {
6076-
subtitle: "Invoice fields can be helpful when you'd like to include extra information.",
6077-
importedFromAccountingSoftware: 'The invoice fields below are imported from your',
6078-
disableInvoiceFields: 'Disable invoice fields',
6079-
disableInvoiceFieldsConfirmation: 'Are you sure? Invoice fields will be disabled on invoices.',
6080-
delete: 'Delete invoice field',
6081-
deleteConfirmation: 'Are you sure you want to delete this invoice field?',
6082-
findInvoiceField: 'Find invoice field',
6083-
nameInputSubtitle: 'Choose a name for the invoice field.',
6084-
typeInputSubtitle: 'Choose what type of invoice field to use.',
6085-
initialValueInputSubtitle: 'Enter a starting value to show in the invoice field.',
6086-
listValuesInputSubtitle: 'These values will appear in your invoice field dropdown. Enabled values can be selected by members.',
6087-
listInputSubtitle: 'These values will appear in your invoice field list. Enabled values can be selected by members.',
6088-
emptyInvoiceFieldsValues: {
6089-
title: 'No list values yet',
6090-
subtitle: 'Add custom values to appear on invoices.',
6091-
},
6092-
existingInvoiceFieldNameError: 'An invoice field with this name already exists',
6093-
invoiceFieldNameRequiredError: 'Please enter an invoice field name',
6094-
invoiceFieldTypeRequiredError: 'Please choose an invoice field type',
6095-
invoiceFieldInitialValueRequiredError: 'Please choose an invoice field initial value',
6096-
addField: 'Add field',
6097-
},
60986074
tags: {
60996075
tagName: 'Tag name',
61006076
requiresTag: 'Members must tag all expenses',
@@ -6975,12 +6951,6 @@ const translations = {
69756951
onlyAvailableOnPlan: ({formattedPrice, hasTeam2025Pricing}: {formattedPrice: string; hasTeam2025Pricing: boolean}) =>
69766952
`<muted-text>Report fields are only available on the Control plan, starting at <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `per member per month.` : `per active member per month.`}</muted-text>`,
69776953
},
6978-
invoiceFields: {
6979-
title: 'Invoice fields',
6980-
description: `Invoice fields let you include extra invoice-level details on invoices.`,
6981-
onlyAvailableOnPlan: ({formattedPrice, hasTeam2025Pricing}: {formattedPrice: string; hasTeam2025Pricing: boolean}) =>
6982-
`<muted-text>Invoice fields are only available on the Control plan, starting at <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `per member per month.` : `per active member per month.`}</muted-text>`,
6983-
},
69846954
[CONST.POLICY.CONNECTIONS.NAME.NETSUITE]: {
69856955
title: 'NetSuite',
69866956
description: `Enjoy automated syncing and reduce manual entries with the Expensify + NetSuite integration. Gain in-depth, realtime financial insights with native and custom segment support, including project and customer mapping.`,

src/languages/es.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4222,7 +4222,6 @@ ${amount} para ${merchant} - ${date}`,
42224222
customFieldHint: 'Añade una codificación personalizada que se aplique a todos los gastos de este miembro.',
42234223
reports: 'Informes',
42244224
reportFields: 'Campos de informe',
4225-
invoiceFields: 'Campos de factura',
42264225
reportTitle: 'El título del informe.',
42274226
taxes: 'Impuestos',
42284227
bills: 'Pagar facturas',
@@ -5865,29 +5864,6 @@ ${amount} para ${merchant} - ${date}`,
58655864
reportFieldInitialValueRequiredError: 'Elige un valor inicial de campo de informe',
58665865
genericFailureMessage: 'Se ha producido un error al actualizar el campo de informe. Por favor, inténtalo de nuevo.',
58675866
},
5868-
invoiceFields: {
5869-
subtitle: 'Los campos de factura pueden ayudarte cuando quieras incluir información adicional.',
5870-
importedFromAccountingSoftware: 'Campos de factura importados desde',
5871-
disableInvoiceFields: 'Desactivar campos de factura',
5872-
disableInvoiceFieldsConfirmation: '¿Estás seguro? Los campos de factura se desactivarán en las facturas.',
5873-
delete: 'Eliminar campo de factura',
5874-
deleteConfirmation: '¿Seguro que deseas eliminar este campo de factura?',
5875-
findInvoiceField: 'Buscar campo de factura',
5876-
nameInputSubtitle: 'Elige un nombre para el campo de factura.',
5877-
typeInputSubtitle: 'Elige qué tipo de campo de factura usar.',
5878-
initialValueInputSubtitle: 'Ingresa un valor inicial para mostrar en el campo de factura.',
5879-
listValuesInputSubtitle: 'Estos valores aparecerán en el menú desplegable del campo de factura. Los miembros pueden seleccionar los valores activados.',
5880-
listInputSubtitle: 'Estos valores aparecerán en la lista del campo de factura. Los miembros pueden seleccionar los valores activados.',
5881-
emptyInvoiceFieldsValues: {
5882-
title: 'Aún no hay valores de lista',
5883-
subtitle: 'Agrega valores personalizados para que aparezcan en las facturas.',
5884-
},
5885-
existingInvoiceFieldNameError: 'Ya existe un campo de factura con este nombre',
5886-
invoiceFieldNameRequiredError: 'Ingresa un nombre para el campo de factura',
5887-
invoiceFieldTypeRequiredError: 'Elige un tipo de campo de factura',
5888-
invoiceFieldInitialValueRequiredError: 'Elige un valor inicial para el campo de factura',
5889-
addField: 'Añadir campo',
5890-
},
58915867
tags: {
58925868
tagName: 'Nombre de etiqueta',
58935869
requiresTag: 'Los miembros deben etiquetar todos los gastos',
@@ -6784,12 +6760,6 @@ ${amount} para ${merchant} - ${date}`,
67846760
onlyAvailableOnPlan: ({formattedPrice, hasTeam2025Pricing}) =>
67856761
`<muted-text>Los campos de informe sólo están disponibles en el plan Controlar, a partir de <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `por miembro al mes.` : `por miembro activo al mes.`}</muted-text>`,
67866762
},
6787-
invoiceFields: {
6788-
title: 'Campos de factura',
6789-
description: `Los campos de factura te permiten incluir detalles adicionales a nivel de factura.`,
6790-
onlyAvailableOnPlan: ({formattedPrice, hasTeam2025Pricing}) =>
6791-
`<muted-text>Los campos de factura sólo están disponibles en el plan Controlar, a partir de <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `por miembro al mes.` : `por miembro activo al mes.`}</muted-text>`,
6792-
},
67936763
[CONST.POLICY.CONNECTIONS.NAME.NETSUITE]: {
67946764
title: 'NetSuite',
67956765
description: `Disfruta de la sincronización automática y reduce las entradas manuales con la integración Expensify + NetSuite. Obtén información financiera en profundidad y en tiempo real con la compatibilidad nativa y personalizada con segmentos, incluida la asignación de proyectos y clientes.`,

0 commit comments

Comments
 (0)