diff --git a/src/CONST/index.ts b/src/CONST/index.ts index 4840da1ed82f..fe7bfc01d225 100755 --- a/src/CONST/index.ts +++ b/src/CONST/index.ts @@ -1267,6 +1267,9 @@ const CONST = { ADD_INTEGRATION: 'POLICYCHANGELOG_ADD_INTEGRATION', ADD_REPORT_FIELD: 'POLICYCHANGELOG_ADD_REPORT_FIELD', ADD_TAG: 'POLICYCHANGELOG_ADD_TAG', + ADD_TAX: 'POLICYCHANGELOG_ADD_TAX', + DELETE_TAX: 'POLICYCHANGELOG_DELETE_TAX', + UPDATE_TAX: 'POLICYCHANGELOG_UPDATE_TAX', DELETE_ALL_TAGS: 'POLICYCHANGELOG_DELETE_ALL_TAGS', DELETE_APPROVER_RULE: 'POLICYCHANGELOG_DELETE_APPROVER_RULE', DELETE_BUDGET: 'POLICYCHANGELOG_DELETE_BUDGET', diff --git a/src/languages/de.ts b/src/languages/de.ts index 7404a5192a6c..65246f39cb94 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -271,6 +271,7 @@ import type { UpdatedPolicyTagFieldParams, UpdatedPolicyTagNameParams, UpdatedPolicyTagParams, + UpdatedPolicyTaxParams, UpdatedTheDistanceMerchantParams, UpdatedTheRequestParams, UpdatePolicyCustomUnitParams, @@ -6147,6 +6148,30 @@ ${amount} für ${merchant} - ${date}`, `änderte die Rate der Berichte, die zufällig zur manuellen Genehmigung weitergeleitet werden, auf ${Math.round(newAuditRate * 100)}% (zuvor ${Math.round(oldAuditRate * 100)}%)`, updatedManualApprovalThreshold: ({oldLimit, newLimit}: UpdatedPolicyManualApprovalThresholdParams) => `hat das manuelle Genehmigungslimit für alle Ausgaben auf ${newLimit} geändert (vorher ${oldLimit})`, + addTax: ({taxName}: UpdatedPolicyTaxParams) => `hat die Steuer "${taxName}" hinzugefügt`, + deleteTax: ({taxName}: UpdatedPolicyTaxParams) => `hat die Steuer "${taxName}" entfernt`, + updateTax: ({oldValue, taxName, updatedField, newValue}: UpdatedPolicyTaxParams) => { + if (!updatedField) { + return ''; + } + switch (updatedField) { + case 'name': { + return `hat die Steuer "${oldValue}" in "${newValue}" umbenannt`; + } + case 'code': { + return `hat den Steuercode für "${taxName}" von "${oldValue}" auf "${newValue}" geändert`; + } + case 'rate': { + return `hat den Steuersatz für "${taxName}" von "${oldValue}" auf "${newValue}" geändert`; + } + case 'enabled': { + return `${oldValue ? `hat die Steuer "${taxName}" deaktiviert` : `hat die Steuer "${taxName}" aktiviert`}`; + } + default: { + return ''; + } + } + }, }, roomMembersPage: { memberNotFound: 'Mitglied nicht gefunden.', diff --git a/src/languages/en.ts b/src/languages/en.ts index e36d60e042d2..4c7c605385a6 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -260,6 +260,7 @@ import type { UpdatedPolicyTagFieldParams, UpdatedPolicyTagNameParams, UpdatedPolicyTagParams, + UpdatedPolicyTaxParams, UpdatedTheDistanceMerchantParams, UpdatedTheRequestParams, UpdatePolicyCustomUnitParams, @@ -6117,6 +6118,30 @@ const translations = { `changed the rate of reports randomly routed for manual approval to ${Math.round(newAuditRate * 100)}% (previously ${Math.round(oldAuditRate * 100)}%)`, updatedManualApprovalThreshold: ({oldLimit, newLimit}: UpdatedPolicyManualApprovalThresholdParams) => `changed the manual approval limit for all expenses to ${newLimit} (previously ${oldLimit})`, + addTax: ({taxName}: UpdatedPolicyTaxParams) => `added the tax "${taxName}"`, + deleteTax: ({taxName}: UpdatedPolicyTaxParams) => `removed the tax "${taxName}"`, + updateTax: ({oldValue, taxName, updatedField, newValue}: UpdatedPolicyTaxParams) => { + if (!updatedField) { + return ''; + } + switch (updatedField) { + case 'name': { + return `renamed the tax "${oldValue}" to "${newValue}"`; + } + case 'code': { + return `changed the tax code for "${taxName}" from "${oldValue}" to "${newValue}"`; + } + case 'rate': { + return `changed the tax rate for "${taxName}" from "${oldValue}" to "${newValue}"`; + } + case 'enabled': { + return `${oldValue ? 'disabled' : 'enabled'} the tax "${taxName}"`; + } + default: { + return ''; + } + } + }, }, roomMembersPage: { memberNotFound: 'Member not found.', diff --git a/src/languages/es.ts b/src/languages/es.ts index 5cfea8155bb0..879338317e41 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -5784,6 +5784,30 @@ ${amount} para ${merchant} - ${date}`, updatedAuditRate: ({oldAuditRate, newAuditRate}) => `cambió la tasa de informes enviados aleatoriamente para aprobación manual a ${Math.round(newAuditRate * 100)}% (previamente ${Math.round(oldAuditRate * 100)}%)`, updatedManualApprovalThreshold: ({oldLimit, newLimit}) => `cambió el límite de aprobación manual para todos los gastos a ${newLimit} (previamente ${oldLimit})`, + addTax: ({taxName}) => `añadió el impuesto "${taxName}"`, + deleteTax: ({taxName}) => `eliminó el impuesto "${taxName}"`, + updateTax: ({oldValue, taxName, updatedField, newValue}) => { + if (!updatedField) { + return ''; + } + switch (updatedField) { + case 'name': { + return `cambió el nombre del impuesto de "${oldValue}" a "${newValue}"`; + } + case 'code': { + return `cambió el código del impuesto "${taxName}" de "${oldValue}" a "${newValue}"`; + } + case 'rate': { + return `cambió la tasa del impuesto "${taxName}" de "${oldValue}" a "${newValue}"`; + } + case 'enabled': { + return `${oldValue ? 'deshabilitó' : 'habilitó'} el impuesto "${taxName}"`; + } + default: { + return ''; + } + } + }, }, roomMembersPage: { memberNotFound: 'Miembro no encontrado.', diff --git a/src/languages/fr.ts b/src/languages/fr.ts index d210f95c4d07..f1822906b06f 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -271,6 +271,7 @@ import type { UpdatedPolicyTagFieldParams, UpdatedPolicyTagNameParams, UpdatedPolicyTagParams, + UpdatedPolicyTaxParams, UpdatedTheDistanceMerchantParams, UpdatedTheRequestParams, UpdatePolicyCustomUnitParams, @@ -6154,6 +6155,30 @@ ${amount} pour ${merchant} - ${date}`, `a changé le taux de rapports acheminés aléatoirement pour approbation manuelle à ${Math.round(newAuditRate * 100)}% (précédemment ${Math.round(oldAuditRate * 100)}%)`, updatedManualApprovalThreshold: ({oldLimit, newLimit}: UpdatedPolicyManualApprovalThresholdParams) => `a modifié la limite d'approbation manuelle pour toutes les dépenses à ${newLimit} (précédemment ${oldLimit})`, + addTax: ({taxName}: UpdatedPolicyTaxParams) => `a ajouté la taxe "${taxName}"`, + deleteTax: ({taxName}: UpdatedPolicyTaxParams) => `a supprimé la taxe "${taxName}"`, + updateTax: ({oldValue, taxName, updatedField, newValue}: UpdatedPolicyTaxParams) => { + if (!updatedField) { + return ''; + } + switch (updatedField) { + case 'name': { + return `a renommé la taxe "${oldValue}" en "${newValue}"`; + } + case 'code': { + return `a modifié le code de la taxe "${taxName}" de "${oldValue}" à "${newValue}"`; + } + case 'rate': { + return `a modifié le taux de la taxe "${taxName}" de "${oldValue}" à "${newValue}"`; + } + case 'enabled': { + return `${oldValue ? 'a désactivé' : 'a activé'} la taxe "${taxName}"`; + } + default: { + return ''; + } + } + }, }, roomMembersPage: { memberNotFound: 'Membre non trouvé.', diff --git a/src/languages/it.ts b/src/languages/it.ts index 30d094b3fbdd..f8e1c1e3205c 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -271,6 +271,7 @@ import type { UpdatedPolicyTagFieldParams, UpdatedPolicyTagNameParams, UpdatedPolicyTagParams, + UpdatedPolicyTaxParams, UpdatedTheDistanceMerchantParams, UpdatedTheRequestParams, UpdatePolicyCustomUnitParams, @@ -6162,6 +6163,30 @@ ${amount} per ${merchant} - ${date}`, `ha cambiato la percentuale di rapporti instradati casualmente per l'approvazione manuale a ${Math.round(newAuditRate * 100)}% (precedentemente ${Math.round(oldAuditRate * 100)}%)`, updatedManualApprovalThreshold: ({oldLimit, newLimit}: UpdatedPolicyManualApprovalThresholdParams) => `ha cambiato il limite di approvazione manuale per tutte le spese a ${newLimit} (precedentemente ${oldLimit})`, + addTax: ({taxName}: UpdatedPolicyTaxParams) => `ha aggiunto l'imposta "${taxName}"`, + deleteTax: ({taxName}: UpdatedPolicyTaxParams) => `ha rimosso l'imposta "${taxName}"`, + updateTax: ({oldValue, taxName, updatedField, newValue}: UpdatedPolicyTaxParams) => { + if (!updatedField) { + return ''; + } + switch (updatedField) { + case 'name': { + return `ha rinominato l'imposta da "${oldValue}" a "${newValue}"`; + } + case 'code': { + return `ha modificato il codice dell'imposta "${taxName}" da "${oldValue}" a "${newValue}"`; + } + case 'rate': { + return `ha modificato l'aliquota dell'imposta "${taxName}" da "${oldValue}" a "${newValue}"`; + } + case 'enabled': { + return `${oldValue ? 'ha disattivato' : 'ha attivato'} l'imposta "${taxName}"`; + } + default: { + return ''; + } + } + }, }, roomMembersPage: { memberNotFound: 'Membro non trovato.', diff --git a/src/languages/ja.ts b/src/languages/ja.ts index 3760ef0ee3fb..5270c2f5e82d 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -271,6 +271,7 @@ import type { UpdatedPolicyTagFieldParams, UpdatedPolicyTagNameParams, UpdatedPolicyTagParams, + UpdatedPolicyTaxParams, UpdatedTheDistanceMerchantParams, UpdatedTheRequestParams, UpdatePolicyCustomUnitParams, @@ -6097,6 +6098,30 @@ ${date} - ${merchant}に${amount}`, updatedAuditRate: ({oldAuditRate, newAuditRate}: UpdatedPolicyAuditRateParams) => `レポートが手動承認のためにランダムにルーティングされる割合を${Math.round(newAuditRate * 100)}%(以前は${Math.round(oldAuditRate * 100)}%)に変更しました。`, updatedManualApprovalThreshold: ({oldLimit, newLimit}: UpdatedPolicyManualApprovalThresholdParams) => `すべての経費の手動承認限度額を${newLimit}に変更しました(以前は${oldLimit})`, + addTax: ({taxName}: UpdatedPolicyTaxParams) => `税 "${taxName}" を追加しました`, + deleteTax: ({taxName}: UpdatedPolicyTaxParams) => `税 "${taxName}" を削除しました`, + updateTax: ({oldValue, taxName, updatedField, newValue}: UpdatedPolicyTaxParams) => { + if (!updatedField) { + return ''; + } + switch (updatedField) { + case 'name': { + return `税 "${oldValue}" の名前を "${newValue}" に変更しました`; + } + case 'code': { + return `税 "${taxName}" のコードを "${oldValue}" から "${newValue}" に変更しました`; + } + case 'rate': { + return `税 "${taxName}" の税率を "${oldValue}" から "${newValue}" に変更しました`; + } + case 'enabled': { + return `${oldValue ? `税 "${taxName}" を無効にしました` : `税 "${taxName}" を有効にしました`}`; + } + default: { + return ''; + } + } + }, }, roomMembersPage: { memberNotFound: 'メンバーが見つかりません。', diff --git a/src/languages/nl.ts b/src/languages/nl.ts index be0a042fbcfc..743d7bb5e449 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -271,6 +271,7 @@ import type { UpdatedPolicyTagFieldParams, UpdatedPolicyTagNameParams, UpdatedPolicyTagParams, + UpdatedPolicyTaxParams, UpdatedTheDistanceMerchantParams, UpdatedTheRequestParams, UpdatePolicyCustomUnitParams, @@ -6144,6 +6145,30 @@ ${amount} voor ${merchant} - ${date}`, `heeft het percentage van rapporten dat willekeurig wordt doorgestuurd voor handmatige goedkeuring gewijzigd naar ${Math.round(newAuditRate * 100)}% (voorheen ${Math.round(oldAuditRate * 100)}%)`, updatedManualApprovalThreshold: ({oldLimit, newLimit}: UpdatedPolicyManualApprovalThresholdParams) => `heeft de handmatige goedkeuringslimiet voor alle uitgaven gewijzigd naar ${newLimit} (voorheen ${oldLimit})`, + addTax: ({taxName}: UpdatedPolicyTaxParams) => `heeft de belasting "${taxName}" toegevoegd`, + deleteTax: ({taxName}: UpdatedPolicyTaxParams) => `heeft de belasting "${taxName}" verwijderd`, + updateTax: ({oldValue, taxName, updatedField, newValue}: UpdatedPolicyTaxParams) => { + if (!updatedField) { + return ''; + } + switch (updatedField) { + case 'name': { + return `heeft de belasting "${oldValue}" hernoemd naar "${newValue}"`; + } + case 'code': { + return `heeft de belastingcode voor "${taxName}" gewijzigd van "${oldValue}" naar "${newValue}"`; + } + case 'rate': { + return `heeft het belastingtarief voor "${taxName}" gewijzigd van "${oldValue}" naar "${newValue}"`; + } + case 'enabled': { + return `${oldValue ? `heeft de belasting "${taxName}" uitgeschakeld` : `heeft de belasting "${taxName}" ingeschakeld`}`; + } + default: { + return ''; + } + } + }, }, roomMembersPage: { memberNotFound: 'Lid niet gevonden.', diff --git a/src/languages/params.ts b/src/languages/params.ts index 6ee4cffa34ff..7ede30a25fe3 100644 --- a/src/languages/params.ts +++ b/src/languages/params.ts @@ -374,6 +374,8 @@ type UpdatedPolicyCategoryExpenseLimitTypeParams = {categoryName: string; oldVal type UpdatedPolicyCategoryMaxAmountNoReceiptParams = {categoryName: string; oldValue?: string; newValue: string}; +type UpdatedPolicyTaxParams = {taxName: string; oldValue?: string | boolean | number; newValue?: string | boolean | number; updatedField?: string}; + type UpdatedPolicyTagParams = {tagListName: string; tagName?: string; enabled?: boolean; count?: string}; type UpdatedPolicyTagNameParams = {oldName: string; newName: string; tagListName: string}; @@ -1199,6 +1201,7 @@ export type { UpdatedPolicyCustomUnitTaxRateExternalIDParams, UpdatedPolicyCustomUnitTaxClaimablePercentageParams, UpdatedPolicyTagParams, + UpdatedPolicyTaxParams, UpdatedPolicyTagNameParams, UpdatedPolicyTagFieldParams, UpdatedPolicyReportFieldDefaultValueParams, diff --git a/src/languages/pl.ts b/src/languages/pl.ts index 0ba0a7a2a9cf..4c6e4122e9bb 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -271,6 +271,7 @@ import type { UpdatedPolicyTagFieldParams, UpdatedPolicyTagNameParams, UpdatedPolicyTagParams, + UpdatedPolicyTaxParams, UpdatedTheDistanceMerchantParams, UpdatedTheRequestParams, UpdatePolicyCustomUnitParams, @@ -6131,6 +6132,30 @@ ${amount} dla ${merchant} - ${date}`, `zmieniono wskaźnik raportów losowo kierowanych do ręcznej akceptacji na ${Math.round(newAuditRate * 100)}% (wcześniej ${Math.round(oldAuditRate * 100)}%)`, updatedManualApprovalThreshold: ({oldLimit, newLimit}: UpdatedPolicyManualApprovalThresholdParams) => `zmieniono limit ręcznego zatwierdzania dla wszystkich wydatków na ${newLimit} (wcześniej ${oldLimit})`, + addTax: ({taxName}: UpdatedPolicyTaxParams) => `dodał podatek "${taxName}"`, + deleteTax: ({taxName}: UpdatedPolicyTaxParams) => `usunął podatek "${taxName}"`, + updateTax: ({oldValue, taxName, updatedField, newValue}: UpdatedPolicyTaxParams) => { + if (!updatedField) { + return ''; + } + switch (updatedField) { + case 'name': { + return `zmienił nazwę podatku z "${oldValue}" na "${newValue}"`; + } + case 'code': { + return `zmienił kod podatku "${taxName}" z "${oldValue}" na "${newValue}"`; + } + case 'rate': { + return `zmienił stawkę podatku "${taxName}" z "${oldValue}" na "${newValue}"`; + } + case 'enabled': { + return `${oldValue ? `wyłączył podatek "${taxName}"` : `włączył podatek "${taxName}"`}`; + } + default: { + return ''; + } + } + }, }, roomMembersPage: { memberNotFound: 'Nie znaleziono członka.', diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index 0aefae6e26d8..bf635249a16b 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -271,6 +271,7 @@ import type { UpdatedPolicyTagFieldParams, UpdatedPolicyTagNameParams, UpdatedPolicyTagParams, + UpdatedPolicyTaxParams, UpdatedTheDistanceMerchantParams, UpdatedTheRequestParams, UpdatePolicyCustomUnitParams, @@ -6144,6 +6145,30 @@ ${amount} para ${merchant} - ${date}`, `alterou a taxa de relatórios encaminhados aleatoriamente para aprovação manual para ${Math.round(newAuditRate * 100)}% (anteriormente ${Math.round(oldAuditRate * 100)}%)`, updatedManualApprovalThreshold: ({oldLimit, newLimit}: UpdatedPolicyManualApprovalThresholdParams) => `alterou o limite de aprovação manual para todas as despesas para ${newLimit} (anteriormente ${oldLimit})`, + addTax: ({taxName}: UpdatedPolicyTaxParams) => `adicionou o imposto "${taxName}"`, + deleteTax: ({taxName}: UpdatedPolicyTaxParams) => `removeu o imposto "${taxName}"`, + updateTax: ({oldValue, taxName, updatedField, newValue}: UpdatedPolicyTaxParams) => { + if (!updatedField) { + return ''; + } + switch (updatedField) { + case 'name': { + return `renomeou o imposto de "${oldValue}" para "${newValue}"`; + } + case 'code': { + return `alterou o código do imposto "${taxName}" de "${oldValue}" para "${newValue}"`; + } + case 'rate': { + return `alterou a taxa do imposto "${taxName}" de "${oldValue}" para "${newValue}"`; + } + case 'enabled': { + return `${oldValue ? 'desativou' : 'ativou'} o imposto "${taxName}"`; + } + default: { + return ''; + } + } + }, }, roomMembersPage: { memberNotFound: 'Membro não encontrado.', diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index c59c3511e9d8..b3dc8a119939 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -271,6 +271,7 @@ import type { UpdatedPolicyTagFieldParams, UpdatedPolicyTagNameParams, UpdatedPolicyTagParams, + UpdatedPolicyTaxParams, UpdatedTheDistanceMerchantParams, UpdatedTheRequestParams, UpdatePolicyCustomUnitParams, @@ -6007,6 +6008,30 @@ ${merchant}的${amount} - ${date}`, updatedAuditRate: ({oldAuditRate, newAuditRate}: UpdatedPolicyAuditRateParams) => `将随机分配进行人工审批的报告比例更改为${Math.round(newAuditRate * 100)}%(之前为${Math.round(oldAuditRate * 100)}%)`, updatedManualApprovalThreshold: ({oldLimit, newLimit}: UpdatedPolicyManualApprovalThresholdParams) => `将所有费用的人工审批限额更改为${newLimit}(之前为${oldLimit})`, + addTax: ({taxName}: UpdatedPolicyTaxParams) => `已添加税项 "${taxName}"`, + deleteTax: ({taxName}: UpdatedPolicyTaxParams) => `已删除税项 "${taxName}"`, + updateTax: ({oldValue, taxName, updatedField, newValue}: UpdatedPolicyTaxParams) => { + if (!updatedField) { + return ''; + } + switch (updatedField) { + case 'name': { + return `将税项 "${oldValue}" 重命名为 "${newValue}"`; + } + case 'code': { + return `将税项 "${taxName}" 的代码从 "${oldValue}" 更改为 "${newValue}"`; + } + case 'rate': { + return `将税项 "${taxName}" 的税率从 "${oldValue}" 更改为 "${newValue}"`; + } + case 'enabled': { + return `${oldValue ? `已禁用税项 "${taxName}"` : `已启用税项 "${taxName}"`}`; + } + default: { + return ''; + } + } + }, }, roomMembersPage: { memberNotFound: '未找到成员。', diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index ffb8297edc50..9995d669cd54 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -2522,6 +2522,27 @@ function getWorkspaceCategoryUpdateMessage(action: ReportAction, policy?: OnyxEn return getReportActionText(action); } +function getWorkspaceTaxUpdateMessage(action: ReportAction): string { + const {taxName, oldValue, newValue, updatedField} = getOriginalMessage(action as ReportAction) ?? {}; + + if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_TAX && taxName) { + // eslint-disable-next-line @typescript-eslint/no-deprecated + return translateLocal('workspaceActions.addTax', {taxName}); + } + + if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.DELETE_TAX && taxName) { + // eslint-disable-next-line @typescript-eslint/no-deprecated + return translateLocal('workspaceActions.deleteTax', {taxName}); + } + + if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAX && taxName) { + // eslint-disable-next-line @typescript-eslint/no-deprecated + return translateLocal('workspaceActions.updateTax', {taxName, oldValue, newValue, updatedField}); + } + + return getReportActionText(action); +} + function getWorkspaceTagUpdateMessage(action: ReportAction | undefined): string { const {tagListName, tagName, enabled, newName, newValue, oldName, oldValue, updatedField, count} = getOriginalMessage(action as ReportAction) ?? {}; @@ -3438,6 +3459,7 @@ export { getWorkspaceCategoryUpdateMessage, getWorkspaceUpdateFieldMessage, getWorkspaceCurrencyUpdateMessage, + getWorkspaceTaxUpdateMessage, getWorkspaceFrequencyUpdateMessage, getPolicyChangeLogMaxExpenseAmountNoReceiptMessage, getPolicyChangeLogMaxExpenseAmountMessage, diff --git a/src/libs/SidebarUtils.ts b/src/libs/SidebarUtils.ts index 6f62407f8ace..c9e91a555acf 100644 --- a/src/libs/SidebarUtils.ts +++ b/src/libs/SidebarUtils.ts @@ -71,6 +71,7 @@ import { getWorkspaceReportFieldDeleteMessage, getWorkspaceReportFieldUpdateMessage, getWorkspaceTagUpdateMessage, + getWorkspaceTaxUpdateMessage, getWorkspaceUpdateFieldMessage, isActionOfType, isCardIssuedAction, @@ -853,6 +854,12 @@ function getOptionData({ isActionOfType(lastAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.SET_CATEGORY_NAME) ) { result.alternateText = getWorkspaceCategoryUpdateMessage(lastAction); + } else if ( + isActionOfType(lastAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_TAX) || + isActionOfType(lastAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.DELETE_TAX) || + isActionOfType(lastAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAX) + ) { + result.alternateText = getWorkspaceTaxUpdateMessage(lastAction); } else if (isActionOfType(lastAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAG_LIST_NAME)) { result.alternateText = getCleanedTagName(getTagListNameUpdatedMessage(lastAction) ?? ''); } else if (isTagModificationAction(lastAction?.actionName ?? '')) { diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index 8aa4afa99d5e..e237bd86bd7a 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx @@ -67,6 +67,7 @@ import { getWorkspaceReportFieldDeleteMessage, getWorkspaceReportFieldUpdateMessage, getWorkspaceTagUpdateMessage, + getWorkspaceTaxUpdateMessage, getWorkspaceUpdateFieldMessage, isActionableJoinRequest, isActionableMentionWhisper, @@ -579,6 +580,12 @@ const ContextMenuActions: ContextMenuAction[] = [ reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.SET_CATEGORY_NAME ) { Clipboard.setString(getWorkspaceCategoryUpdateMessage(reportAction)); + } else if ( + reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_TAX || + reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.DELETE_TAX || + reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAX + ) { + Clipboard.setString(getWorkspaceTaxUpdateMessage(reportAction)); } else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAG_LIST_NAME) { Clipboard.setString(getCleanedTagName(getTagListNameUpdatedMessage(reportAction))); } else if (isTagModificationAction(reportAction.actionName)) { diff --git a/src/pages/home/report/PureReportActionItem.tsx b/src/pages/home/report/PureReportActionItem.tsx index f48064cc2b1d..277af9630920 100644 --- a/src/pages/home/report/PureReportActionItem.tsx +++ b/src/pages/home/report/PureReportActionItem.tsx @@ -104,6 +104,7 @@ import { getWorkspaceReportFieldDeleteMessage, getWorkspaceReportFieldUpdateMessage, getWorkspaceTagUpdateMessage, + getWorkspaceTaxUpdateMessage, getWorkspaceUpdateFieldMessage, isActionableAddPaymentCard, isActionableCardFraudAlert, @@ -1294,6 +1295,12 @@ function PureReportActionItem({ action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.SET_CATEGORY_NAME ) { children = ; + } else if ( + action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.ADD_TAX || + action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.DELETE_TAX || + action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAX + ) { + children = ; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAG_LIST_NAME) { children = ; } else if (isTagModificationAction(action.actionName)) { diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index b5c3391cee68..7485e78b3e9a 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -419,6 +419,9 @@ type OriginalMessagePolicyChangeLog = { /** Name of the added category */ categoryName?: string; + /** Name of the added tax */ + taxName?: string; + /** Name of the updated field */ updatedField?: string;