Skip to content
5 changes: 5 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3205,6 +3205,7 @@ const CONST = {
ARE_DISTANCE_RATES_ENABLED: 'areDistanceRatesEnabled',
ARE_WORKFLOWS_ENABLED: 'areWorkflowsEnabled',
ARE_REPORT_FIELDS_ENABLED: 'areReportFieldsEnabled',
ARE_INVOICE_FIELDS_ENABLED: 'areInvoiceFieldsEnabled',
ARE_CONNECTIONS_ENABLED: 'areConnectionsEnabled',
ARE_RECEIPT_PARTNERS_ENABLED: 'receiptPartners',
ARE_COMPANY_CARDS_ENABLED: 'areCompanyCardsEnabled',
Expand Down Expand Up @@ -7691,6 +7692,10 @@ const CONST = {
LIST: 'dropdown',
FORMULA: 'formula',
},
REPORT_FIELD_TARGETS: {
EXPENSE: 'expense',
INVOICE: 'invoice',
},

NAVIGATION_ACTIONS: {
RESET: 'RESET',
Expand Down
29 changes: 29 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1959,6 +1959,35 @@ const ROUTES = {
route: 'workspaces/:policyID/invoices/company-website',
getRoute: (policyID: string) => `workspaces/${policyID}/invoices/company-website` as const,
},
WORKSPACE_INVOICE_FIELDS_CREATE: {
route: 'workspaces/:policyID/invoices/newInvoiceField',
getRoute: (policyID: string) => `workspaces/${policyID}/invoices/newInvoiceField` as const,
},
WORKSPACE_INVOICE_FIELDS_SETTINGS: {
route: 'workspaces/:policyID/invoices/:reportFieldID/edit',
getRoute: (policyID: string, reportFieldID: string) => `workspaces/${policyID}/invoices/${encodeURIComponent(reportFieldID)}/edit` as const,
},
WORKSPACE_INVOICE_FIELDS_LIST_VALUES: {
route: 'workspaces/:policyID/invoices/listValues/:reportFieldID?',
getRoute: (policyID: string, reportFieldID?: string) => `workspaces/${policyID}/invoices/listValues/${reportFieldID ? encodeURIComponent(reportFieldID) : ''}` as const,
},
WORKSPACE_INVOICE_FIELDS_ADD_VALUE: {
route: 'workspaces/:policyID/invoices/addValue/:reportFieldID?',
getRoute: (policyID: string, reportFieldID?: string) => `workspaces/${policyID}/invoices/addValue/${reportFieldID ? encodeURIComponent(reportFieldID) : ''}` as const,
},
WORKSPACE_INVOICE_FIELDS_VALUE_SETTINGS: {
route: 'workspaces/:policyID/invoices/:valueIndex/:reportFieldID?',
getRoute: (policyID: string, valueIndex: number, reportFieldID?: string) =>
`workspaces/${policyID}/invoices/${valueIndex}/${reportFieldID ? encodeURIComponent(reportFieldID) : ''}` as const,
},
WORKSPACE_INVOICE_FIELDS_EDIT_VALUE: {
route: 'workspaces/:policyID/invoices/newInvoiceField/:valueIndex/edit',
getRoute: (policyID: string, valueIndex: number) => `workspaces/${policyID}/invoices/newInvoiceField/${valueIndex}/edit` as const,
},
WORKSPACE_INVOICE_FIELDS_EDIT_INITIAL_VALUE: {
route: 'workspaces/:policyID/invoices/:reportFieldID/edit/initialValue',
getRoute: (policyID: string, reportFieldID: string) => `workspaces/${policyID}/invoices/${encodeURIComponent(reportFieldID)}/edit/initialValue` as const,
},
WORKSPACE_MEMBERS: {
route: 'workspaces/:policyID/members',
getRoute: (policyID: string | undefined) => {
Expand Down
7 changes: 7 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,13 @@ const SCREENS = {
INVOICES_VERIFY_ACCOUNT: 'Workspace_Invoices_Verify_Account',
INVOICES_COMPANY_NAME: 'Workspace_Invoices_Company_Name',
INVOICES_COMPANY_WEBSITE: 'Workspace_Invoices_Company_Website',
INVOICE_FIELDS_CREATE: 'Workspace_InvoiceFields_Create',
INVOICE_FIELDS_SETTINGS: 'Workspace_InvoiceFields_Settings',
INVOICE_FIELDS_LIST_VALUES: 'Workspace_InvoiceFields_ListValues',
INVOICE_FIELDS_ADD_VALUE: 'Workspace_InvoiceFields_AddValue',
INVOICE_FIELDS_VALUE_SETTINGS: 'Workspace_InvoiceFields_ValueSettings',
INVOICE_FIELDS_EDIT_VALUE: 'Workspace_InvoiceFields_EditValue',
INVOICE_FIELDS_EDIT_INITIAL_VALUE: 'Workspace_InvoiceFields_EditInitialValue',
MEMBERS: 'Workspace_Members',
MEMBERS_IMPORT: 'Members_Import',
MEMBERS_IMPORTED: 'Members_Imported',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ function MoneyRequestViewReportFields({report, policy, isCombinedReport = false,
const isOnlyTitleFieldEnabled = enabledReportFields.length === 1 && isReportFieldOfTypeTitle(enabledReportFields.at(0));
const isPaidGroupPolicyExpenseReport = isPaidGroupPolicyExpenseReportUtils(report);
const isInvoiceReport = isInvoiceReportUtils(report);
const areFieldsEnabledForReport = isInvoiceReport ? policy?.areInvoiceFieldsEnabled : policy?.areReportFieldsEnabled;

const shouldDisplayReportFields = (isPaidGroupPolicyExpenseReport || isInvoiceReport) && !!policy?.areReportFieldsEnabled && (!isOnlyTitleFieldEnabled || !isCombinedReport);
const shouldDisplayReportFields = (isPaidGroupPolicyExpenseReport || isInvoiceReport) && !!areFieldsEnabledForReport && (!isOnlyTitleFieldEnabled || !isCombinedReport);

return (
shouldDisplayReportFields &&
Expand Down
3 changes: 2 additions & 1 deletion src/components/ReportActionItem/MoneyReportView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import type {OnyxEntry} from 'react-native-onyx';
import ActivityIndicator from '@components/ActivityIndicator';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';

Check warning on line 8 in src/components/ReportActionItem/MoneyReportView.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@components/Icon/Expensicons' import is restricted from being used by a pattern. Direct imports from Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details

Check warning on line 8 in src/components/ReportActionItem/MoneyReportView.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

'@components/Icon/Expensicons' import is restricted from being used. Direct imports from @components/Icon/Expensicons are deprecated. Please use lazy loading hooks instead. Use `useMemoizedLazyExpensifyIcons` from @hooks/useLazyAsset. See docs/LAZY_ICONS_AND_ILLUSTRATIONS.md for details
import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription';
import OfflineWithFeedback from '@components/OfflineWithFeedback';
import SpacerView from '@components/SpacerView';
Expand Down Expand Up @@ -114,6 +114,7 @@
const isPaidGroupPolicyExpenseReport = isPaidGroupPolicyExpenseReportUtils(report);
const isInvoiceReport = isInvoiceReportUtils(report);

const areFieldsEnabledForReport = isInvoiceReport ? policy?.areInvoiceFieldsEnabled : policy?.areReportFieldsEnabled;
const shouldShowReportField =
!isClosedExpenseReportWithNoExpenses &&
(isPaidGroupPolicyExpenseReport || isInvoiceReport) &&
Expand Down Expand Up @@ -145,7 +146,7 @@
{!isClosedExpenseReportWithNoExpenses && (
<>
{(isPaidGroupPolicyExpenseReport || isInvoiceReport) &&
policy?.areReportFieldsEnabled &&
areFieldsEnabledForReport &&
(!isCombinedReport || !isOnlyTitleFieldEnabled) &&
sortedPolicyReportFields.map((reportField) => {
if (shouldHideSingleReportField(reportField)) {
Expand Down
9 changes: 9 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3913,6 +3913,7 @@ ${
customFieldHint: 'Füge benutzerdefinierte Codierung hinzu, die für alle Ausgaben dieses Mitglieds gilt.',
reports: 'Berichte',
reportFields: 'Berichtsfelder',
invoiceFields: 'Rechnungsfelder',
reportTitle: 'Berichtstitel',
reportField: 'Berichts­feld',
taxes: 'Steuern',
Expand Down Expand Up @@ -5434,6 +5435,14 @@ _Für ausführlichere Anweisungen [besuchen Sie unsere Hilfeseite](${CONST.NETSU
reportFieldInitialValueRequiredError: 'Bitte wähle einen Anfangswert für ein Berichtsfeld aus',
genericFailureMessage: 'Beim Aktualisieren des Berichtfelds ist ein Fehler aufgetreten. Bitte versuche es erneut.',
},
invoiceFields: {
subtitle: "Invoice fields can be helpful when you'd like to include extra information.",
importedFromAccountingSoftware: 'The invoice fields below are imported from your',
disableInvoiceFields: 'Disable invoice fields',
disableInvoiceFieldsConfirmation: 'Are you sure? Invoice fields will be disabled on invoices.',
delete: 'Delete invoice field',
deleteConfirmation: 'Are you sure you want to delete this invoice field?',
},
tags: {
tagName: 'Tag-Name',
requiresTag: 'Mitglieder müssen alle Ausgaben taggen',
Expand Down
9 changes: 9 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3932,6 +3932,7 @@ const translations = {
customFieldHint: 'Add custom coding that applies to all spend from this member.',
reports: 'Reports',
reportFields: 'Report fields',
invoiceFields: 'Invoice fields',
reportTitle: 'Report title',
reportField: 'Report field',
taxes: 'Taxes',
Expand Down Expand Up @@ -5386,6 +5387,14 @@ const translations = {
reportFieldInitialValueRequiredError: 'Please choose a report field initial value',
genericFailureMessage: 'An error occurred while updating the report field. Please try again.',
},
invoiceFields: {
subtitle: "Invoice fields can be helpful when you'd like to include extra information.",
importedFromAccountingSoftware: 'The invoice fields below are imported from your',
disableInvoiceFields: 'Disable invoice fields',
disableInvoiceFieldsConfirmation: 'Are you sure? Invoice fields will be disabled on invoices.',
delete: 'Delete invoice field',
deleteConfirmation: 'Are you sure you want to delete this invoice field?',
},
tags: {
tagName: 'Tag name',
requiresTag: 'Members must tag all expenses',
Expand Down
9 changes: 9 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3669,6 +3669,7 @@ ${amount} para ${merchant} - ${date}`,
customFieldHint: 'Añade una codificación personalizada que se aplique a todos los gastos de este miembro.',
reports: 'Informes',
reportFields: 'Campos de informe',
invoiceFields: 'Campos de factura',
reportTitle: 'El título del informe.',
taxes: 'Impuestos',
bills: 'Pagar facturas',
Expand Down Expand Up @@ -5146,6 +5147,14 @@ ${amount} para ${merchant} - ${date}`,
reportFieldInitialValueRequiredError: 'Elige un valor inicial de campo de informe',
genericFailureMessage: 'Se ha producido un error al actualizar el campo de informe. Por favor, inténtalo de nuevo.',
},
invoiceFields: {
subtitle: 'Los campos de factura pueden ayudarte cuando quieras incluir información adicional.',
importedFromAccountingSoftware: 'Campos de factura importados desde',
disableInvoiceFields: 'Desactivar campos de factura',
disableInvoiceFieldsConfirmation: '¿Estás seguro? Los campos de factura se desactivarán en las facturas.',
delete: 'Eliminar campo de factura',
deleteConfirmation: '¿Seguro que deseas eliminar este campo de factura?',
},
tags: {
tagName: 'Nombre de etiqueta',
requiresTag: 'Los miembros deben etiquetar todos los gastos',
Expand Down
9 changes: 9 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3919,6 +3919,7 @@ ${
customFieldHint: 'Ajoutez un codage personnalisé qui s’applique à toutes les dépenses de ce membre.',
reports: 'Notes de frais',
reportFields: 'Champs de note de frais',
invoiceFields: 'Champs de facture',
reportTitle: 'Titre de la note de frais',
reportField: 'Champ de note de frais',
taxes: 'Taxes',
Expand Down Expand Up @@ -5445,6 +5446,14 @@ _Pour des instructions plus détaillées, [visitez notre site d’aide](${CONST.
reportFieldInitialValueRequiredError: 'Veuillez choisir une valeur initiale pour le champ de note de frais',
genericFailureMessage: 'Une erreur s’est produite lors de la mise à jour du champ de note de frais. Veuillez réessayer.',
},
invoiceFields: {
subtitle: "Invoice fields can be helpful when you'd like to include extra information.",
importedFromAccountingSoftware: 'The invoice fields below are imported from your',
disableInvoiceFields: 'Disable invoice fields',
disableInvoiceFieldsConfirmation: 'Are you sure? Invoice fields will be disabled on invoices.',
delete: 'Delete invoice field',
deleteConfirmation: 'Are you sure you want to delete this invoice field?',
},
tags: {
tagName: 'Nom du tag',
requiresTag: 'Les membres doivent taguer toutes les dépenses',
Expand Down
9 changes: 9 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3897,6 +3897,7 @@ ${
customFieldHint: 'Aggiungi una codifica personalizzata che si applichi a tutte le spese di questo membro.',
reports: 'Report',
reportFields: 'Campi del report',
invoiceFields: 'Campi fattura',
reportTitle: 'Titolo del report',
reportField: 'Campo report',
taxes: 'Tasse',
Expand Down Expand Up @@ -5416,6 +5417,14 @@ _Per istruzioni più dettagliate, [visita il nostro sito di assistenza](${CONST.
reportFieldInitialValueRequiredError: 'Scegli un valore iniziale per il campo del resoconto',
genericFailureMessage: 'Si è verificato un errore durante l’aggiornamento del campo del report. Riprova.',
},
invoiceFields: {
subtitle: "Invoice fields can be helpful when you'd like to include extra information.",
importedFromAccountingSoftware: 'The invoice fields below are imported from your',
disableInvoiceFields: 'Disable invoice fields',
disableInvoiceFieldsConfirmation: 'Are you sure? Invoice fields will be disabled on invoices.',
delete: 'Delete invoice field',
deleteConfirmation: 'Are you sure you want to delete this invoice field?',
},
tags: {
tagName: 'Nome tag',
requiresTag: 'I membri devono etichettare tutte le spese',
Expand Down
9 changes: 9 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3881,6 +3881,7 @@ ${
customFieldHint: 'このメンバーのすべての支出に適用されるカスタムコードを追加します。',
reports: 'レポート',
reportFields: 'レポート項目',
invoiceFields: '請求書項目',
reportTitle: 'レポートタイトル',
reportField: 'レポート項目',
taxes: '税金',
Expand Down Expand Up @@ -5379,6 +5380,14 @@ _詳しい手順については、[ヘルプサイトをご覧ください](${CO
reportFieldInitialValueRequiredError: 'レポート項目の初期値を選択してください',
genericFailureMessage: 'レポートフィールドの更新中にエラーが発生しました。もう一度お試しください。',
},
invoiceFields: {
subtitle: "Invoice fields can be helpful when you'd like to include extra information.",
importedFromAccountingSoftware: 'The invoice fields below are imported from your',
disableInvoiceFields: 'Disable invoice fields',
disableInvoiceFieldsConfirmation: 'Are you sure? Invoice fields will be disabled on invoices.',
delete: 'Delete invoice field',
deleteConfirmation: 'Are you sure you want to delete this invoice field?',
},
tags: {
tagName: 'タグ名',
requiresTag: 'メンバーはすべての経費にタグを付ける必要があります',
Expand Down
9 changes: 9 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3898,6 +3898,7 @@ ${
customFieldHint: 'Voeg aangepaste codering toe die van toepassing is op alle uitgaven van dit lid.',
reports: 'Rapporten',
reportFields: 'Rapportvelden',
invoiceFields: 'Factuurvelden',
reportTitle: 'Rapporttitel',
reportField: 'Rapportveld',
taxes: 'Belastingen',
Expand Down Expand Up @@ -5407,6 +5408,14 @@ _Voor meer gedetailleerde instructies, [bezoek onze help-site](${CONST.NETSUITE_
reportFieldInitialValueRequiredError: 'Kies een beginwaarde voor een rapportveld',
genericFailureMessage: 'Er is een fout opgetreden bij het bijwerken van het rapportveld. Probeer het opnieuw.',
},
invoiceFields: {
subtitle: "Invoice fields can be helpful when you'd like to include extra information.",
importedFromAccountingSoftware: 'The invoice fields below are imported from your',
disableInvoiceFields: 'Disable invoice fields',
disableInvoiceFieldsConfirmation: 'Are you sure? Invoice fields will be disabled on invoices.',
delete: 'Delete invoice field',
deleteConfirmation: 'Are you sure you want to delete this invoice field?',
},
tags: {
tagName: 'Tagnaam',
requiresTag: 'Leden moeten alle uitgaven taggen',
Expand Down
9 changes: 9 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3889,6 +3889,7 @@ ${
customFieldHint: 'Dodaj niestandardowe kodowanie, które będzie stosowane do wszystkich wydatków tego członka.',
reports: 'Raporty',
reportFields: 'Pola raportu',
invoiceFields: 'Pola faktury',
reportTitle: 'Tytuł raportu',
reportField: 'Pole raportu',
taxes: 'Podatki',
Expand Down Expand Up @@ -5396,6 +5397,14 @@ _Aby uzyskać bardziej szczegółowe instrukcje, [odwiedź naszą stronę pomocy
reportFieldInitialValueRequiredError: 'Wybierz początkową wartość pola raportu',
genericFailureMessage: 'Wystąpił błąd podczas aktualizowania pola raportu. Spróbuj ponownie.',
},
invoiceFields: {
subtitle: "Invoice fields can be helpful when you'd like to include extra information.",
importedFromAccountingSoftware: 'The invoice fields below are imported from your',
disableInvoiceFields: 'Disable invoice fields',
disableInvoiceFieldsConfirmation: 'Are you sure? Invoice fields will be disabled on invoices.',
delete: 'Delete invoice field',
deleteConfirmation: 'Are you sure you want to delete this invoice field?',
},
tags: {
tagName: 'Nazwa tagu',
requiresTag: 'Członkowie muszą otagować wszystkie wydatki',
Expand Down
10 changes: 10 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3890,7 +3890,9 @@
customField2: 'Campo personalizado 2',
customFieldHint: 'Adicione codificação personalizada que se aplique a todos os gastos deste membro.',
reports: 'Relatórios',
reportFields: 'Campos de relatório',
invoiceFields: 'Campos de fatura',
reportFields: 'Campos do relatório',

Check failure on line 3895 in src/languages/pt-BR.ts

View workflow job for this annotation

GitHub Actions / typecheck

An object literal cannot have multiple properties with the same name.
reportTitle: 'Título do relatório',
reportField: 'Campo de relatório',
taxes: 'Impostos',
Expand Down Expand Up @@ -5400,6 +5402,14 @@
reportFieldInitialValueRequiredError: 'Escolha um valor inicial para o campo de relatório',
genericFailureMessage: 'Ocorreu um erro ao atualizar o campo do relatório. Tente novamente.',
},
invoiceFields: {
subtitle: "Invoice fields can be helpful when you'd like to include extra information.",
importedFromAccountingSoftware: 'The invoice fields below are imported from your',
disableInvoiceFields: 'Disable invoice fields',
disableInvoiceFieldsConfirmation: 'Are you sure? Invoice fields will be disabled on invoices.',
delete: 'Delete invoice field',
deleteConfirmation: 'Are you sure you want to delete this invoice field?',
},
tags: {
tagName: 'Nome da tag',
requiresTag: 'Membros devem marcar todas as despesas',
Expand Down
9 changes: 9 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3831,6 +3831,7 @@ ${
customFieldHint: '为该成员的所有支出添加适用的自定义编码。',
reports: '报表',
reportFields: '报表字段',
invoiceFields: '发票字段',
reportTitle: '报表标题',
reportField: '报表字段',
taxes: '税费',
Expand Down Expand Up @@ -5305,6 +5306,14 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
reportFieldInitialValueRequiredError: '请选择报表字段的初始值',
genericFailureMessage: '更新报表字段时出错。请重试。',
},
invoiceFields: {
subtitle: "Invoice fields can be helpful when you'd like to include extra information.",
importedFromAccountingSoftware: 'The invoice fields below are imported from your',
disableInvoiceFields: 'Disable invoice fields',
disableInvoiceFieldsConfirmation: 'Are you sure? Invoice fields will be disabled on invoices.',
delete: 'Delete invoice field',
deleteConfirmation: 'Are you sure you want to delete this invoice field?',
},
tags: {
tagName: '标签名称',
requiresTag: '成员必须为所有报销添加标签',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type CreateWorkspaceInvoiceFieldListValueParams = {
policyID: string;
/**
* Stringified JSON object with type of following structure:
* Array<string>
*/
invoiceFields: string;
};

export default CreateWorkspaceInvoiceFieldListValueParams;
Loading
Loading