Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6960,6 +6960,14 @@ const CONST = {
description: 'workspace.upgrade.travel.description' as const,
icon: 'Luggage',
},
reports: {
id: 'reports' as const,
alias: 'reports',
name: 'Reports',
title: 'workspace.upgrade.reports.title' as const,
description: 'workspace.upgrade.reports.description' as const,
icon: 'ReportReceipt',
},
distanceRates: {
id: 'distanceRates' as const,
alias: 'distance-rates',
Expand Down
19 changes: 17 additions & 2 deletions src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,16 @@ function MoneyRequestView({
// Flags for showing categories and tags
// transactionCategory can be an empty string
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const shouldShowCategory = (isPolicyExpenseChat && (categoryForDisplay || hasEnabledOptions(policyCategories ?? {}))) || isExpenseUnreported;
const areCategoriesEnabledAndHasCategory = categoryForDisplay || hasEnabledOptions(policyCategories ?? {});
const shouldShowCategory = (isPolicyExpenseChat && areCategoriesEnabledAndHasCategory) || (isExpenseUnreported && (!activePolicy || areCategoriesEnabledAndHasCategory));
// transactionTag can be an empty string
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const shouldShowTag = shouldShowPolicySpecificFields && (transactionTag || hasEnabledTags(policyTagLists));
const shouldShowBillable = shouldShowPolicySpecificFields && (!!transactionBillable || !(policy?.disabledFields?.defaultBillable ?? true) || !!updatedTransaction?.billable);
const isCurrentTransactionReimbursableDifferentFromPolicyDefault =
policy?.defaultReimbursable !== undefined && !!(updatedTransaction?.reimbursable ?? transactionReimbursable) !== policy.defaultReimbursable;
const shouldShowReimbursable =
isPolicyExpenseChat && (!policy?.disabledFields?.reimbursable || isCurrentTransactionReimbursableDifferentFromPolicyDefault) && !isCardTransaction && !isInvoice;
shouldShowPolicySpecificFields && (!policy?.disabledFields?.reimbursable || isCurrentTransactionReimbursableDifferentFromPolicyDefault) && !isCardTransaction && !isInvoice;
const canEditReimbursable = isEditable && canEditFieldOfMoneyRequest(parentReportAction, CONST.EDIT_REQUEST_FIELD.REIMBURSABLE, undefined, isChatReportArchived);
const shouldShowAttendees = useMemo(() => shouldShowAttendeesTransactionUtils(iouType, policy), [iouType, policy]);

Expand Down Expand Up @@ -827,6 +828,20 @@ function MoneyRequestView({
if (!canEditReport) {
return;
}

if (!policy) {
Navigation.navigate(
ROUTES.MONEY_REQUEST_UPGRADE.getRoute({
iouType,
action: CONST.IOU.ACTION.EDIT,
transactionID: transaction?.transactionID,
reportID: report.reportID,
upgradePath: CONST.UPGRADE_PATHS.REPORTS,
}),
);
return;
}

Navigation.navigate(
ROUTES.MONEY_REQUEST_STEP_REPORT.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction?.transactionID, report.reportID, getReportRHPActiveRoute()),
);
Expand Down
6 changes: 6 additions & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5559,6 +5559,12 @@ const translations = {
'Expensify Travel ist eine neue Plattform für die Buchung und Verwaltung von Geschäftsreisen, die es Mitgliedern ermöglicht, Unterkünfte, Flüge, Transportmittel und mehr zu buchen.',
onlyAvailableOnPlan: 'Reisen ist im Collect-Plan verfügbar, beginnend bei',
},
reports: {
title: 'Berichte',
description:
'Erstellen Sie organisierte Spesenabrechnungen, um Ihre Geschäftsausgaben zu verfolgen, zur Genehmigung einzureichen und Ihren Erstattungsprozess zu optimieren.',
onlyAvailableOnPlan: 'Berichte sind im Collect-Plan verfügbar, beginnend bei ',
},
multiLevelTags: {
title: 'Mehrstufige Tags',
description:
Expand Down
5 changes: 5 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5529,6 +5529,11 @@ const translations = {
description: 'Expensify Travel is a new corporate travel booking and management platform that allows members to book accommodations, flights, transportation, and more.',
onlyAvailableOnPlan: 'Travel is available on the Collect plan, starting at ',
},
reports: {
title: 'Reports',
description: 'Create organized expense reports to track your business spending, submit for approvals, and streamline your reimbursement process.',
onlyAvailableOnPlan: 'Reports are available on the Collect plan, starting at ',
},
multiLevelTags: {
title: 'Multi-level tags',
description:
Expand Down
5 changes: 5 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5562,6 +5562,11 @@ const translations = {
'Expensify Travel es una nueva plataforma corporativa de reserva y gestión de viajes que permite a los miembros reservar alojamientos, vuelos, transporte y mucho más.',
onlyAvailableOnPlan: 'Los viajes están disponibles en el plan Recopilar, a partir de ',
},
reports: {
title: 'Informes',
description: 'Crea informes de gastos organizados para hacer seguimiento de tus gastos comerciales, enviarlos para aprobación y optimizar tu proceso de reembolso.',
onlyAvailableOnPlan: 'Los informes están disponibles en el plan Recopilar, a partir de ',
},
multiLevelTags: {
title: 'Etiquetas multinivel',
description:
Expand Down
6 changes: 6 additions & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5569,6 +5569,12 @@ const translations = {
"Expensify Travel est une nouvelle plateforme de réservation et de gestion de voyages d'affaires qui permet aux membres de réserver des hébergements, des vols, des transports, et plus encore.",
onlyAvailableOnPlan: 'Le voyage est disponible sur le plan Collect, à partir de',
},
reports: {
title: 'Rapports',
description:
'Créez des rapports de dépenses organisés pour suivre vos dépenses professionnelles, les soumettre pour approbation et rationaliser votre processus de remboursement.',
onlyAvailableOnPlan: 'Les rapports sont disponibles sur le plan Collect, à partir de ',
},
multiLevelTags: {
title: 'Tags multi-niveaux',
description:
Expand Down
5 changes: 5 additions & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5568,6 +5568,11 @@ const translations = {
'Expensify Travel è una nuova piattaforma aziendale per la prenotazione e la gestione dei viaggi che consente ai membri di prenotare alloggi, voli, trasporti e altro.',
onlyAvailableOnPlan: 'Il viaggio è disponibile nel piano Collect, a partire da',
},
reports: {
title: 'Report',
description: 'Crea report spese organizzati per tenere traccia delle tue spese aziendali, inviarli per approvazione e semplificare il processo di rimborso.',
onlyAvailableOnPlan: 'I report sono disponibili nel piano Collect, a partire da ',
},
multiLevelTags: {
title: 'Tag multi-livello',
description:
Expand Down
5 changes: 5 additions & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5522,6 +5522,11 @@ const translations = {
description: 'Expensify Travelは、メンバーが宿泊施設、フライト、交通機関などを予約できる新しい法人向け旅行予約および管理プラットフォームです。',
onlyAvailableOnPlan: '旅行は、Collectプランで利用可能です。料金は',
},
reports: {
title: 'レポート',
description: '組織化された経費レポートを作成して、ビジネス支出を追跡し、承認のために提出し、払い戻しプロセスを合理化します。',
onlyAvailableOnPlan: 'レポートは、Collectプランで利用可能です。料金は ',
},
multiLevelTags: {
title: 'マルチレベルタグ',
description:
Expand Down
5 changes: 5 additions & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5559,6 +5559,11 @@ const translations = {
description: 'Expensify Travel is een nieuw platform voor het boeken en beheren van zakelijke reizen waarmee leden accommodaties, vluchten, vervoer en meer kunnen boeken.',
onlyAvailableOnPlan: 'Reizen is beschikbaar op het Collect-plan, beginnend bij',
},
reports: {
title: 'Rapporten',
description: 'Maak georganiseerde onkostenrapporten om uw zakelijke uitgaven bij te houden, in te dienen voor goedkeuring en uw vergoedingsproces te stroomlijnen.',
onlyAvailableOnPlan: 'Rapporten zijn beschikbaar op het Collect-plan, beginnend bij ',
},
multiLevelTags: {
title: 'Meerniveautags',
description:
Expand Down
5 changes: 5 additions & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5548,6 +5548,11 @@ const translations = {
'Expensify Travel to nowa platforma do rezerwacji i zarządzania podróżami służbowymi, która umożliwia członkom rezerwację zakwaterowania, lotów, transportu i nie tylko.',
onlyAvailableOnPlan: 'Podróże są dostępne w planie Collect, zaczynając od',
},
reports: {
title: 'Raporty',
description: 'Twórz uporządkowane raporty wydatków, aby śledzić swoje wydatki biznesowe, przesyłać je do zatwierdzenia i usprawniać proces zwrotu kosztów.',
onlyAvailableOnPlan: 'Raporty są dostępne w planie Collect, zaczynając od ',
},
multiLevelTags: {
title: 'Wielopoziomowe tagi',
description:
Expand Down
5 changes: 5 additions & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5558,6 +5558,11 @@ const translations = {
description: 'Expensify Travel é uma nova plataforma de reserva e gestão de viagens corporativas que permite aos membros reservar acomodações, voos, transporte e mais.',
onlyAvailableOnPlan: 'Viagens estão disponíveis no plano Collect, a partir de',
},
reports: {
title: 'Relatórios',
description: 'Crie relatórios de despesas organizados para acompanhar seus gastos empresariais, enviá-los para aprovação e otimizar seu processo de reembolso.',
onlyAvailableOnPlan: 'Os relatórios estão disponíveis no plano Collect, a partir de ',
},
multiLevelTags: {
title: 'Tags multiníveis',
description:
Expand Down
5 changes: 5 additions & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5459,6 +5459,11 @@ const translations = {
description: 'Expensify Travel 是一个新的企业差旅预订和管理平台,允许会员预订住宿、航班、交通等。',
onlyAvailableOnPlan: '旅行功能在 Collect 计划中提供,起价为',
},
reports: {
title: '报告',
description: '创建有序的费用报告来跟踪您的商业开支,提交审批,并简化您的报销流程。',
onlyAvailableOnPlan: '报告功能在 Collect 计划中提供,起价为 ',
},
multiLevelTags: {
title: '多级标签',
description: '多级标签帮助您更精确地跟踪费用。为每个项目分配多个标签,例如部门、客户或成本中心,以捕获每笔费用的完整上下文。这使得更详细的报告、审批流程和会计导出成为可能。',
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ModifiedExpenseMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import {getFormattedAttendees, getTagArrayFromName} from './TransactionUtils';

let allPolicyTags: OnyxCollection<PolicyTagLists> = {};
Onyx.connect({

Check warning on line 20 in src/libs/ModifiedExpenseMessage.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function

Check warning on line 20 in src/libs/ModifiedExpenseMessage.ts

View workflow job for this annotation

GitHub Actions / ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY_TAGS,
waitForCollectionCallback: true,
callback: (value) => {
Expand Down Expand Up @@ -308,7 +308,7 @@
buildMessageFragmentForValue(taxAmount, oldTaxAmount, translateLocal('iou.taxAmount'), false, setFragments, removalFragments, changeFragments);
}

const hasModifiedTaxRate = isReportActionOriginalMessageAnObject && 'oldTaxRate' in reportActionOriginalMessage && 'taxRate' in reportActionOriginalMessage;
const hasModifiedTaxRate = isReportActionOriginalMessageAnObject && ('oldTaxRate' in reportActionOriginalMessage || 'taxRate' in reportActionOriginalMessage);
if (hasModifiedTaxRate) {
buildMessageFragmentForValue(
reportActionOriginalMessage?.taxRate ?? '',
Expand Down
8 changes: 0 additions & 8 deletions src/libs/Permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ function canUseLinkPreviews(): boolean {
return false;
}

/**
* Temporary check for Unreported Expense Project - change to true for testing
*/
function canUseUnreportedExpense(): boolean {
return false;
}

function isBetaEnabled(beta: Beta, betas: OnyxEntry<Beta[]>, betaConfiguration?: OnyxEntry<BetaConfiguration>): boolean {
const hasAllBetasEnabled = canUseAllBetas(betas);
const isFeatureEnabled = !!betas?.includes(beta);
Expand All @@ -38,5 +31,4 @@ function isBetaEnabled(beta: Beta, betas: OnyxEntry<Beta[]>, betaConfiguration?:
export default {
canUseLinkPreviews,
isBetaEnabled,
canUseUnreportedExpense,
};
28 changes: 16 additions & 12 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@
const parsedReportActionMessageCache: Record<string, string> = {};

let conciergeReportID: OnyxEntry<string>;
Onyx.connect({

Check warning on line 923 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.CONCIERGE_REPORT_ID,
callback: (value) => {
conciergeReportID = value;
Expand All @@ -928,7 +928,7 @@
});

const defaultAvatarBuildingIconTestID = 'SvgDefaultAvatarBuilding Icon';
Onyx.connect({

Check warning on line 931 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.SESSION,
callback: (value) => {
// When signed out, val is undefined
Expand All @@ -946,7 +946,7 @@
let allPersonalDetails: OnyxEntry<PersonalDetailsList>;
let allPersonalDetailLogins: string[];
let currentUserPersonalDetails: OnyxEntry<PersonalDetails>;
Onyx.connect({

Check warning on line 949 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
if (currentUserAccountID) {
Expand All @@ -958,14 +958,14 @@
});

let allReportsDraft: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 961 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_DRAFT,
waitForCollectionCallback: true,
callback: (value) => (allReportsDraft = value),
});

let allPolicies: OnyxCollection<Policy>;
Onyx.connect({

Check warning on line 968 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
waitForCollectionCallback: true,
callback: (value) => (allPolicies = value),
Expand All @@ -973,7 +973,7 @@

let allReports: OnyxCollection<Report>;
let reportsByPolicyID: ReportByPolicyMap;
Onyx.connect({

Check warning on line 976 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand Down Expand Up @@ -1014,14 +1014,14 @@
});

let allBetas: OnyxEntry<Beta[]>;
Onyx.connect({

Check warning on line 1017 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.BETAS,
callback: (value) => (allBetas = value),
});

let allTransactions: OnyxCollection<Transaction> = {};
let reportsTransactions: Record<string, Transaction[]> = {};
Onyx.connect({

Check warning on line 1024 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -1047,7 +1047,7 @@
});

let allReportActions: OnyxCollection<ReportActions>;
Onyx.connect({

Check warning on line 1050 in src/libs/ReportUtils.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
waitForCollectionCallback: true,
callback: (actions) => {
Expand Down Expand Up @@ -4382,15 +4382,21 @@
}

if (fieldToEdit === CONST.EDIT_REQUEST_FIELD.DISTANCE_RATE) {
// Unreported transaction from OldDot can have the reportID as an empty string
const isUnreportedExpense = !transaction?.reportID || transaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;
// The distance rate can be modified only on the distance expense reports
return isExpenseReport(moneyRequestReport) && isDistanceRequest(transaction);
return (isUnreportedExpense || isExpenseReport(moneyRequestReport)) && isDistanceRequest(transaction);
}

if (fieldToEdit === CONST.EDIT_REQUEST_FIELD.REPORT) {
// Unreported transaction from OldDot can have the reportID as an empty string
const isUnreportedExpense = !transaction?.reportID || transaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;

if (!isReportOutstanding(moneyRequestReport, moneyRequestReport.policyID) && !isUnreportedExpense) {
if (isUnreportedExpense) {
return true;
}

if (!isReportOutstanding(moneyRequestReport, moneyRequestReport.policyID)) {
return false;
}

Expand All @@ -4400,7 +4406,7 @@
}
const isOwner = moneyRequestReport?.ownerAccountID === currentUserAccountID;

if (isInvoiceReport(moneyRequestReport) && !isUnreportedExpense) {
if (isInvoiceReport(moneyRequestReport)) {
return (
getOutstandingReportsForUser(
moneyRequestReport?.policyID,
Expand All @@ -4413,18 +4419,16 @@

// If the report is Open, then only submitters, admins can move expenses
const isOpen = isOpenExpenseReport(moneyRequestReport);
if (!isUnreportedExpense && isOpen && !isSubmitter && !isAdmin) {
if (isOpen && !isSubmitter && !isAdmin) {
return false;
}

return isUnreportedExpense
? Object.values(allPolicies ?? {}).flatMap((currentPolicy) =>
getOutstandingReportsForUser(currentPolicy?.id, currentUserAccountID, outstandingReportsByPolicyID?.[currentPolicy?.id ?? CONST.DEFAULT_NUMBER_ID] ?? {}),
).length > 0
: Object.values(allPolicies ?? {}).flatMap((currentPolicy) =>
getOutstandingReportsForUser(currentPolicy?.id, moneyRequestReport?.ownerAccountID, outstandingReportsByPolicyID?.[currentPolicy?.id ?? CONST.DEFAULT_NUMBER_ID] ?? {}),
).length > 1 ||
(isOwner && isReportOutstanding(moneyRequestReport, moneyRequestReport.policyID));
return (
Object.values(allPolicies ?? {}).flatMap((currentPolicy) =>
getOutstandingReportsForUser(currentPolicy?.id, moneyRequestReport?.ownerAccountID, outstandingReportsByPolicyID?.[currentPolicy?.id ?? CONST.DEFAULT_NUMBER_ID] ?? {}),
).length > 1 ||
(isOwner && isReportOutstanding(moneyRequestReport, moneyRequestReport.policyID))
);
}

const isUnreportedExpense = !transaction?.reportID || transaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;
Expand Down
10 changes: 1 addition & 9 deletions src/libs/TransactionPreviewUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import {
isPending,
isPerDiemRequest,
isScanning,
isUnreportedAndHasInvalidDistanceRateTransaction,
} from './TransactionUtils';

const emptyPersonalDetails: OnyxTypes.PersonalDetails = {
Expand Down Expand Up @@ -236,10 +235,6 @@ function getTransactionPreviewTextAndTranslationPaths({

if (isDistanceRequest(transaction)) {
previewHeaderText = [{translationPath: 'common.distance'}];

if (RBRMessage === undefined && isUnreportedAndHasInvalidDistanceRateTransaction(transaction)) {
RBRMessage = {translationPath: 'violations.customUnitOutOfPolicy'};
}
} else if (isPerDiemRequest(transaction)) {
previewHeaderText = [{translationPath: 'common.perDiem'}];
} else if (isTransactionScanning) {
Expand Down Expand Up @@ -345,11 +340,8 @@ function createTransactionPreviewConditionals({
const shouldShowCategory = !!categoryForDisplay && isReportAPolicyExpenseChat;

const hasAnyViolations =
isUnreportedAndHasInvalidDistanceRateTransaction(transaction) ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
hasViolationsOfTypeNotice ||
hasWarningTypeViolation(transaction, violations, true) ||
hasViolation(transaction, violations, true);
hasViolationsOfTypeNotice || hasWarningTypeViolation(transaction, violations, true) || hasViolation(transaction, violations, true);
const hasErrorOrOnHold = hasFieldErrors || (!isFullySettled && !isFullyApproved && isTransactionOnHold);
const hasReportViolationsOrActionErrors = (isReportOwner(iouReport) && hasReportViolations(iouReport?.reportID)) || hasActionWithErrorsForTransaction(iouReport?.reportID, transaction);
const shouldShowRBR = hasAnyViolations || hasErrorOrOnHold || hasReportViolationsOrActionErrors || hasReceiptError(transaction);
Expand Down
6 changes: 0 additions & 6 deletions src/libs/TransactionUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {toLocaleDigit} from '@libs/LocaleDigitUtils';
import {translateLocal} from '@libs/Localize';
import Log from '@libs/Log';
import {rand64, roundToTwoDecimalPlaces} from '@libs/NumberUtils';
import Permissions from '@libs/Permissions';
import {getPersonalDetailsByIDs} from '@libs/PersonalDetailsUtils';
import {
getCommaSeparatedTagNameWithSanitizedColons,
Expand Down Expand Up @@ -1952,12 +1951,7 @@ function createUnreportedExpenseSections(transactions: Array<Transaction | undef
];
}

// Temporarily only for use in the Unreported Expense project
function isExpenseUnreported(transaction?: Transaction): transaction is UnreportedTransaction {
// TODO: added for development purposes, should be removed once the feature are fully implemented
if (!Permissions.canUseUnreportedExpense()) {
return false;
}
return transaction?.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;
}

Expand Down
2 changes: 2 additions & 0 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4429,6 +4429,7 @@ function getUpdateMoneyRequestParams(
if (
policy &&
isPaidGroupPolicy(policy) &&
!isSelfDM(iouReport) &&
!isInvoice &&
updatedTransaction &&
(hasModifiedTag ||
Expand Down Expand Up @@ -10596,6 +10597,7 @@ function completePaymentOnboarding(paymentSelected: ValueOf<typeof CONST.PAYMENT
shouldSkipTestDriveModal: true,
});
}

function payMoneyRequest(paymentType: PaymentMethodType, chatReport: OnyxTypes.Report, iouReport: OnyxEntry<OnyxTypes.Report>, paymentPolicyID?: string, full = true) {
if (chatReport.policyID && shouldRestrictUserBillableActions(chatReport.policyID)) {
Navigation.navigate(ROUTES.RESTRICTED_ACTION.getRoute(chatReport.policyID));
Expand Down
Loading
Loading