Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Send Invoice flow from Global Create #40015

Merged
merged 64 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
820276d
Partly update start, participants and confirmation steps to support i…
VickyStash Apr 10, 2024
b6689d3
Implement send from (select sender) screen
VickyStash Apr 11, 2024
dd8d87b
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 11, 2024
059f946
Implement send invoice functionality
VickyStash Apr 11, 2024
3456531
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 12, 2024
56e3b9a
Fix ts issues after merging main
VickyStash Apr 12, 2024
23be9e4
Code improvements
VickyStash Apr 12, 2024
36b645e
IOU file updates and lint fixes
VickyStash Apr 12, 2024
f611c60
Implement buildOptimisticInviteReportAction function
VickyStash Apr 12, 2024
c4b0fdb
Fix navigation
VickyStash Apr 12, 2024
ad6829b
Fix invoice creation from global in invoice chat room already exists
VickyStash Apr 12, 2024
a361e7e
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 15, 2024
8895b17
Minor lint fix
VickyStash Apr 15, 2024
7526db1
Enable add receipt file feature, lint fixes
VickyStash Apr 15, 2024
e8f56c4
Minor UI fixes
VickyStash Apr 15, 2024
66e6a31
Fix translation
VickyStash Apr 15, 2024
0c2b802
Fix report preview message
VickyStash Apr 15, 2024
290eeb4
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 16, 2024
d831b0d
Minor code improvements
VickyStash Apr 16, 2024
531b3c5
Fix canSendInvoice check
VickyStash Apr 16, 2024
dafdc75
Minor code improvements
VickyStash Apr 16, 2024
96aa755
Put iouCreatedAction to optimistic data
VickyStash Apr 16, 2024
111c1fa
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 17, 2024
4d872eb
Minor improvements
VickyStash Apr 17, 2024
75f8b23
Update optimistic invoice room creation to include current user as a …
VickyStash Apr 17, 2024
6db22e2
Add INVOICE_RECEIVER_TYPE to consts
VickyStash Apr 17, 2024
173432f
Code improvements
VickyStash Apr 17, 2024
ae06c5b
Add optimistic personal details for the receiver; update params
VickyStash Apr 18, 2024
42612fe
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 18, 2024
f19a19c
Add SendInvoiceInformation type
VickyStash Apr 18, 2024
982ec59
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 18, 2024
0c4209d
Fix to follow typing rules in ROUTES
VickyStash Apr 18, 2024
aefb407
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 18, 2024
0738a3e
Update param invoiceRoomID -> invoiceRoomReportID
VickyStash Apr 19, 2024
37ba264
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 19, 2024
a3c0e38
Updates to follow main branch changes
VickyStash Apr 19, 2024
6687828
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 19, 2024
4dd7699
Lint fix
VickyStash Apr 19, 2024
209ed51
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 22, 2024
8618241
Update sender logic to work with updates in main
VickyStash Apr 22, 2024
41aa191
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 22, 2024
5ca73f1
Lint fix
VickyStash Apr 22, 2024
2ab9717
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 23, 2024
5579af2
TS fixes
VickyStash Apr 23, 2024
5801e4f
Lint fixes
VickyStash Apr 23, 2024
68afedd
Hide tabs on the amount step for invoices
VickyStash Apr 25, 2024
5c8d058
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 25, 2024
31b47a7
Fixes after merging main
VickyStash Apr 25, 2024
b30e98f
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 26, 2024
e22c3eb
Update invoice-generic.svg icon
VickyStash Apr 26, 2024
f3d0233
Use default SectionList checkmark on the SendFrom screen
VickyStash Apr 26, 2024
cc36c78
Remove unused style
VickyStash Apr 26, 2024
43c0ad7
Don't show three dots on the confirmation screen
VickyStash Apr 26, 2024
e448d96
Update Send From list display
VickyStash Apr 26, 2024
df9feae
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 26, 2024
9e6a446
Lint fix
VickyStash Apr 26, 2024
976967d
Merge branch 'main' into feature/global-send-invoice
VickyStash Apr 28, 2024
ff25547
Remove duplicates
VickyStash Apr 28, 2024
b2f9320
Fix invoice report name display
VickyStash Apr 28, 2024
c36bd3b
Hide payment button for invoices
VickyStash Apr 29, 2024
88db153
Disable invoice editing for the invoice receiver
VickyStash Apr 29, 2024
00f490a
Disable invoice receipt update
VickyStash Apr 29, 2024
ef766ad
Fix LHN option display
VickyStash Apr 29, 2024
4371082
Remove quick action update during invoice creation
VickyStash Apr 29, 2024
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
4 changes: 4 additions & 0 deletions assets/images/invoice-generic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@ const CONST = {
EXPENSE: 'expense',
IOU: 'iou',
TASK: 'task',
INVOICE: 'invoice',
},
CHAT_TYPE: chatTypes,
WORKSPACE_CHAT_ROOMS: {
Expand Down Expand Up @@ -1412,6 +1413,7 @@ const CONST = {
SPLIT: 'split',
REQUEST: 'request',
TRACK_EXPENSE: 'track-expense',
INVOICE: 'invoice',
},
REQUEST_TYPE: {
DISTANCE: 'distance',
Expand Down
5 changes: 5 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ const ROUTES = {
getRoute: (action: ValueOf<typeof CONST.IOU.ACTION>, iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) =>
`${action}/${iouType}/start/${transactionID}/${reportID}` as const,
},
MONEY_REQUEST_STEP_SEND_FROM: {
route: 'create/:iouType/from/:transactionID/:reportID',
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string, backTo = '') =>
getUrlWithBackToParam(`create/${iouType}/from/${transactionID}/${reportID}`, backTo),
},
MONEY_REQUEST_STEP_CONFIRMATION: {
route: ':action/:iouType/confirmation/:transactionID/:reportID',
getRoute: (action: ValueOf<typeof CONST.IOU.ACTION>, iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) =>
Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ const SCREENS = {
STEP_WAYPOINT: 'Money_Request_Step_Waypoint',
STEP_TAX_AMOUNT: 'Money_Request_Step_Tax_Amount',
STEP_TAX_RATE: 'Money_Request_Step_Tax_Rate',
STEP_SEND_FROM: 'Money_Request_Step_Send_From',
PARTICIPANTS: 'Money_Request_Participants',
CURRENCY: 'Money_Request_Currency',
WAYPOINT: 'Money_Request_Waypoint',
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/Expensicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ import ImageCropSquareMask from '@assets/images/image-crop-square-mask.svg';
import Info from '@assets/images/info.svg';
import QBOSquare from '@assets/images/integrationicons/qbo-icon-square.svg';
import XeroSquare from '@assets/images/integrationicons/xero-icon-square.svg';
import InvoiceGeneric from '@assets/images/invoice-generic.svg';
import Invoice from '@assets/images/invoice.svg';
import Key from '@assets/images/key.svg';
import Keyboard from '@assets/images/keyboard.svg';
Expand Down Expand Up @@ -247,6 +248,7 @@ export {
ImageCropSquareMask,
Info,
Invoice,
InvoiceGeneric,
Key,
Keyboard,
Link,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import {View} from 'react-native';
import type {StyleProp, ViewStyle} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import type {OnyxEntry} from 'react-native-onyx';
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
import useLocalize from '@hooks/useLocalize';
Expand All @@ -25,6 +25,7 @@
import {isTaxTrackingEnabled} from '@libs/PolicyUtils';
import * as ReceiptUtils from '@libs/ReceiptUtils';
import * as ReportUtils from '@libs/ReportUtils';
import {getDefaultWorkspaceAvatar} from '@libs/ReportUtils';
import playSound, {SOUNDS} from '@libs/Sound';
import * as TransactionUtils from '@libs/TransactionUtils';
import * as IOU from '@userActions/IOU';
Expand All @@ -42,6 +43,7 @@
import ConfirmModal from './ConfirmModal';
import FormHelpMessage from './FormHelpMessage';
import * as Expensicons from './Icon/Expensicons';
import MenuItem from './MenuItem';
import MenuItemWithTopDescription from './MenuItemWithTopDescription';
import OptionsSelector from './OptionsSelector';
import PDFThumbnail from './PDFThumbnail';
Expand All @@ -66,6 +68,9 @@

/** Unit and rate used for if the money request is a distance request */
mileageRate: OnyxEntry<DefaultMileageRate>;

/** The list of all policies */
allPolicies: OnyxCollection<OnyxTypes.Policy>;
};

type MoneyRequestConfirmationListProps = MoneyRequestConfirmationListOnyxProps & {
Expand Down Expand Up @@ -205,6 +210,7 @@
onToggleBillable,
hasSmartScanFailed,
reportActionID,
allPolicies,
}: MoneyRequestConfirmationListProps) {
const theme = useTheme();
const styles = useThemeStyles();
Expand All @@ -215,6 +221,7 @@
const isTypeRequest = iouType === CONST.IOU.TYPE.REQUEST;
const isTypeSplit = iouType === CONST.IOU.TYPE.SPLIT;
const isTypeSend = iouType === CONST.IOU.TYPE.SEND;
const isTypeInvoice = iouType === CONST.IOU.TYPE.INVOICE;
const isTypeTrackExpense = iouType === CONST.IOU.TYPE.TRACK_EXPENSE;

const {unit, rate, currency} = mileageRate ?? {
Expand All @@ -240,6 +247,13 @@

const policyTagLists = useMemo(() => PolicyUtils.getTagLists(policyTags), [policyTags]);

const senderWorkspace = useMemo(() => {
const senderWorkspaceParticipant = pickedParticipants.find((pickedParticipant) => pickedParticipant.policyID);
return allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${senderWorkspaceParticipant?.policyID}`];
}, [allPolicies, pickedParticipants]);

const canUpdateSenderWorkspace = useMemo(() => PolicyUtils.getActiveAdminWorkspaces(allPolicies).length > 0 && !!transaction?.isFromGlobalCreate, [allPolicies]);

Check warning on line 255 in src/components/MoneyTemporaryForRefactorRequestConfirmationList.tsx

View workflow job for this annotation

GitHub Actions / Run ESLint

React Hook useMemo has a missing dependency: 'transaction?.isFromGlobalCreate'. Either include it or remove the dependency array

// A flag for showing the tags field
const shouldShowTags = useMemo(() => isPolicyExpenseChat && OptionsListUtils.hasEnabledTags(policyTagLists), [isPolicyExpenseChat, policyTagLists]);

Expand Down Expand Up @@ -357,7 +371,9 @@

const splitOrRequestOptions: Array<DropdownOption<string>> = useMemo(() => {
let text;
if (isTypeTrackExpense) {
if (isTypeInvoice) {
text = translate('iou.sendInvoice', {amount: formattedAmount});
} else if (isTypeTrackExpense) {
text = translate('iou.trackExpense');
} else if (isTypeSplit && iouAmount === 0) {
text = translate('iou.split');
Expand All @@ -376,7 +392,7 @@
value: iouType,
},
];
}, [isTypeTrackExpense, isTypeSplit, iouAmount, receiptPath, isTypeRequest, isDistanceRequestWithPendingRoute, iouType, translate, formattedAmount]);

Check warning on line 395 in src/components/MoneyTemporaryForRefactorRequestConfirmationList.tsx

View workflow job for this annotation

GitHub Actions / Run ESLint

React Hook useMemo has a missing dependency: 'isTypeInvoice'. Either include it or remove the dependency array

const selectedParticipants = useMemo(() => pickedParticipants.filter((participant) => participant.selected), [pickedParticipants]);
const personalDetailsOfPayee = useMemo(() => payeePersonalDetails ?? currentUserPersonalDetails, [payeePersonalDetails, currentUserPersonalDetails]);
Expand Down Expand Up @@ -640,6 +656,29 @@
// An intermediate structure that helps us classify the fields as "primary" and "supplementary".
// The primary fields are always shown to the user, while an extra action is needed to reveal the supplementary ones.
const classifiedFields = [
{
item: (
<MenuItem
key={translate('workspace.invoices.sendFrom')}
shouldShowRightIcon={!isReadOnly && canUpdateSenderWorkspace}
title={senderWorkspace?.name}
icon={senderWorkspace?.avatar ?? getDefaultWorkspaceAvatar(senderWorkspace?.name)}
iconType={CONST.ICON_TYPE_WORKSPACE}
description={translate('workspace.common.workspace')}
label={translate('workspace.invoices.sendFrom')}
isLabelHoverable={false}
interactive={!isReadOnly && canUpdateSenderWorkspace}
onPress={() => {
Navigation.navigate(ROUTES.MONEY_REQUEST_STEP_SEND_FROM.getRoute(iouType, transaction?.transactionID ?? '', reportID, Navigation.getActiveRouteWithoutParams()));
}}
style={[styles.moneyRequestMenuItem]}
titleStyle={styles.flex1}
disabled={didConfirm || !canUpdateSenderWorkspace}
/>
),
shouldShow: isTypeInvoice,
isSupplementary: false,
},
{
item: (
<MenuItemWithTopDescription
Expand Down Expand Up @@ -1050,4 +1089,7 @@
policy: {
key: ({policyID}) => `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
},
allPolicies: {
key: ONYXKEYS.COLLECTION.POLICY,
},
})(MoneyTemporaryForRefactorRequestConfirmationList);
6 changes: 5 additions & 1 deletion src/components/ReportWelcomeText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, {useMemo} from 'react';
import {View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import {withOnyx} from 'react-native-onyx';
import type {ValueOf} from 'type-fest';
import useLocalize from '@hooks/useLocalize';
import usePermissions from '@hooks/usePermissions';
import useThemeStyles from '@hooks/useThemeStyles';
Expand Down Expand Up @@ -45,7 +46,10 @@ function ReportWelcomeText({report, policy, personalDetails}: ReportWelcomeTextP
const isUserPolicyAdmin = PolicyUtils.isPolicyAdmin(policy);
const roomWelcomeMessage = ReportUtils.getRoomWelcomeMessage(report, isUserPolicyAdmin);
const moneyRequestOptions = ReportUtils.getMoneyRequestOptions(report, policy, participantAccountIDs, canUseTrackExpense);
const additionalText = moneyRequestOptions.map((item) => translate(`reportActionsView.iouTypes.${item}`)).join(', ');
const additionalText = moneyRequestOptions
.filter((item): item is ValueOf<typeof CONST.IOU.TYPE, 'SEND' | 'SPLIT' | 'REQUEST' | 'TRACK_EXPENSE'> => item !== CONST.IOU.TYPE.INVOICE)
.map((item) => translate(`reportActionsView.iouTypes.${item}`))
.join(', ');
const canEditPolicyDescription = ReportUtils.canEditPolicyDescription(policy);
const reportName = ReportUtils.getReportName(report);

Expand Down
4 changes: 4 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ export default {
beginningOfChatHistoryAnnounceRoomPartTwo: ({workspaceName}: BeginningOfChatHistoryAnnounceRoomPartTwo) => ` to chat about anything ${workspaceName} related.`,
beginningOfChatHistoryUserRoomPartOne: 'Collaboration starts here! 🎉\nUse this space to chat about anything ',
beginningOfChatHistoryUserRoomPartTwo: ' related.',
beginningOfChatHistoryInvoiceRoom: 'Collaboration starts here! 🎉 Use this room to view, discuss, and pay invoices.',
beginningOfChatHistory: 'This is the beginning of your chat with ',
beginningOfChatHistoryPolicyExpenseChatPartOne: 'Collaboration between ',
beginningOfChatHistoryPolicyExpenseChatPartTwo: ' and ',
Expand Down Expand Up @@ -653,6 +654,7 @@ export default {
payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pay ${formattedAmount} elsewhere` : `Pay elsewhere`),
nextStep: 'Next Steps',
finished: 'Finished',
sendInvoice: ({amount}: RequestAmountParams) => `Send ${amount} invoice`,
requestAmount: ({amount}: RequestAmountParams) => `request ${amount}`,
requestedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `requested ${formattedAmount}${comment ? ` for ${comment}` : ''}`,
trackedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `tracking ${formattedAmount}${comment ? ` for ${comment}` : ''}`,
Expand Down Expand Up @@ -698,6 +700,7 @@ export default {
invalidSplit: 'Split amounts do not equal total amount',
other: 'Unexpected error, please try again later',
genericCreateFailureMessage: 'Unexpected error requesting money, please try again later',
genericCreateInvoiceFailureMessage: 'Unexpected error sending invoice, please try again later',
receiptFailureMessage: "The receipt didn't upload. ",
saveFileMessage: 'Download the file ',
loseFileMessage: 'or dismiss this error and lose it',
Expand Down Expand Up @@ -2127,6 +2130,7 @@ export default {
unlockVBACopy: "You're all set to accept payments by ACH or credit card!",
viewUnpaidInvoices: 'View unpaid invoices',
sendInvoice: 'Send invoice',
sendFrom: 'Send from',
},
travel: {
unlockConciergeBookingTravel: 'Unlock Concierge travel booking',
Expand Down
4 changes: 4 additions & 0 deletions src/languages/es.ts
VickyStash marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ export default {
beginningOfChatHistoryAnnounceRoomPartTwo: ({workspaceName}: BeginningOfChatHistoryAnnounceRoomPartTwo) => ` para chatear sobre cualquier cosa relacionada con ${workspaceName}.`,
beginningOfChatHistoryUserRoomPartOne: '¡Este es el lugar para colaborar! 🎉\nUsa este espacio para chatear sobre cualquier cosa relacionada con ',
beginningOfChatHistoryUserRoomPartTwo: '.',
beginningOfChatHistoryInvoiceRoom: '¡Este es el lugar para colaborar! 🎉 Utilice esta sala para ver, discutir y pagar facturas.',
beginningOfChatHistory: 'Aquí comienzan tus conversaciones con ',
beginningOfChatHistoryPolicyExpenseChatPartOne: '¡La colaboración entre ',
beginningOfChatHistoryPolicyExpenseChatPartTwo: ' y ',
Expand Down Expand Up @@ -649,6 +650,7 @@ export default {
payElsewhere: ({formattedAmount}: SettleExpensifyCardParams) => (formattedAmount ? `Pagar ${formattedAmount} de otra forma` : `Pagar de otra forma`),
nextStep: 'Pasos Siguientes',
finished: 'Finalizado',
sendInvoice: ({amount}: RequestAmountParams) => `Enviar factura de ${amount}`,
requestAmount: ({amount}: RequestAmountParams) => `solicitar ${amount}`,
requestedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `solicité ${formattedAmount}${comment ? ` para ${comment}` : ''}`,
trackedAmount: ({formattedAmount, comment}: RequestedAmountMessageParams) => `seguimiento ${formattedAmount}${comment ? ` para ${comment}` : ''}`,
Expand Down Expand Up @@ -696,6 +698,7 @@ export default {
invalidSplit: 'La suma de las partes no equivale al importe total',
other: 'Error inesperado, por favor inténtalo más tarde',
genericCreateFailureMessage: 'Error inesperado solicitando dinero. Por favor, inténtalo más tarde',
genericCreateInvoiceFailureMessage: 'Error inesperado al enviar la factura, inténtalo de nuevo más tarde',
receiptFailureMessage: 'El recibo no se subió. ',
saveFileMessage: 'Guarda el archivo ',
loseFileMessage: 'o descarta este error y piérdelo',
Expand Down Expand Up @@ -2155,6 +2158,7 @@ export default {
unlockVBACopy: '¡Todo listo para recibir pagos por transferencia o con tarjeta!',
viewUnpaidInvoices: 'Ver facturas emitidas pendientes',
sendInvoice: 'Enviar factura',
sendFrom: 'Enviado desde',
},
travel: {
unlockConciergeBookingTravel: 'Desbloquea la reserva de viajes con Concierge',
Expand Down
19 changes: 19 additions & 0 deletions src/libs/API/parameters/SendInvoiceParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
type SendInvoiceParams = {
Copy link
Contributor

@rayane-djouah rayane-djouah Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, This PR missed createdIOUReportActionID, createdReportActionIDForThread, reportActionID Send Invoice params and caused these issues: #43797, #43571, #43577, #44992. More info in this proposal: #43797 (comment)

senderWorkspaceID: string;
accountID: number;
receiverEmail?: string; // used when there is no existing room
receiverInvoiceRoomID?: string; // optional param used only when the user sends an invoice to an existing room
amount: number;
currency: string;
merchant: string;
date: string;
category?: string;
optimisticInvoiceRoomID?: string;
optimisticCreatedChatReportActionID: string;
optimisticInvoiceReportID: string;
optimisticReportPreviewReportActionID: string;
optimisticTransactionID: string;
optimisticTransactionThreadReportID: string;
};

export default SendInvoiceParams;
1 change: 1 addition & 0 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,4 @@ export type {default as SetPolicyForeignCurrencyDefaultParams} from './SetPolicy
export type {default as SetPolicyCurrencyDefaultParams} from './SetPolicyCurrencyDefaultParams';
export type {default as UpdatePolicyConnectionConfigParams} from './UpdatePolicyConnectionConfigParams';
export type {default as RenamePolicyTaxParams} from './RenamePolicyTaxParams';
export type {default as SendInvoiceParams} from './SendInvoiceParams';
2 changes: 2 additions & 0 deletions src/libs/API/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ const WRITE_COMMANDS = {
UPDATE_POLICY_DISTANCE_RATE_VALUE: 'UpdatePolicyDistanceRateValue',
SET_POLICY_DISTANCE_RATES_ENABLED: 'SetPolicyDistanceRatesEnabled',
DELETE_POLICY_DISTANCE_RATES: 'DeletePolicyDistanceRates',
SEND_INVOICE: 'SendInvoice',
} as const;

type WriteCommand = ValueOf<typeof WRITE_COMMANDS>;
Expand Down Expand Up @@ -396,6 +397,7 @@ type WriteCommandParameters = {
[WRITE_COMMANDS.UPDATE_POLICY_DISTANCE_RATE_VALUE]: Parameters.UpdatePolicyDistanceRateValueParams;
[WRITE_COMMANDS.SET_POLICY_DISTANCE_RATES_ENABLED]: Parameters.SetPolicyDistanceRatesEnabledParams;
[WRITE_COMMANDS.DELETE_POLICY_DISTANCE_RATES]: Parameters.DeletePolicyDistanceRatesParams;
[WRITE_COMMANDS.SEND_INVOICE]: Parameters.SendInvoiceParams;
};

const READ_COMMANDS = {
Expand Down
4 changes: 2 additions & 2 deletions src/libs/IOUUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ function isIOUReportPendingCurrencyConversion(iouReport: Report): boolean {
}

/**
* Checks if the iou type is one of request, send, or split.
* Checks if the iou type is one of request, send, invoice or split.
*/
function isValidMoneyRequestType(iouType: string): boolean {
const moneyRequestType: string[] = [CONST.IOU.TYPE.REQUEST, CONST.IOU.TYPE.SPLIT, CONST.IOU.TYPE.SEND, CONST.IOU.TYPE.TRACK_EXPENSE];
const moneyRequestType: string[] = [CONST.IOU.TYPE.REQUEST, CONST.IOU.TYPE.SPLIT, CONST.IOU.TYPE.SEND, CONST.IOU.TYPE.TRACK_EXPENSE, CONST.IOU.TYPE.INVOICE];
return moneyRequestType.includes(iouType);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const MoneyRequestModalStackNavigator = createModalStackNavigator<MoneyRequestNa
[SCREENS.MONEY_REQUEST.STEP_SCAN]: () => require('../../../../pages/iou/request/step/IOURequestStepScan').default as React.ComponentType,
[SCREENS.MONEY_REQUEST.STEP_TAG]: () => require('../../../../pages/iou/request/step/IOURequestStepTag').default as React.ComponentType,
[SCREENS.MONEY_REQUEST.STEP_WAYPOINT]: () => require('../../../../pages/iou/request/step/IOURequestStepWaypoint').default as React.ComponentType,
[SCREENS.MONEY_REQUEST.STEP_SEND_FROM]: () => require('../../../../pages/iou/request/step/IOURequestStepSendFrom').default as React.ComponentType,
[SCREENS.MONEY_REQUEST.PARTICIPANTS]: () => require('../../../../pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsPage').default as React.ComponentType,
[SCREENS.MONEY_REQUEST.HOLD]: () => require('../../../../pages/iou/HoldReasonPage').default as React.ComponentType,
[SCREENS.IOU_SEND.ADD_BANK_ACCOUNT]: () => require('../../../../pages/AddPersonalBankAccountPage').default as React.ComponentType,
Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ const config: LinkingOptions<RootStackParamList>['config'] = {
},
},
},
[SCREENS.MONEY_REQUEST.STEP_SEND_FROM]: ROUTES.MONEY_REQUEST_STEP_SEND_FROM.route,
[SCREENS.MONEY_REQUEST.STEP_AMOUNT]: ROUTES.MONEY_REQUEST_STEP_AMOUNT.route,
[SCREENS.MONEY_REQUEST.STEP_CATEGORY]: ROUTES.MONEY_REQUEST_STEP_CATEGORY.route,
[SCREENS.MONEY_REQUEST.STEP_CONFIRMATION]: ROUTES.MONEY_REQUEST_STEP_CONFIRMATION.route,
Expand Down
6 changes: 6 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,12 @@ type MoneyRequestNavigatorParamList = {
reportID: string;
backTo: string;
};
[SCREENS.MONEY_REQUEST.STEP_SEND_FROM]: {
iouType: ValueOf<typeof CONST.IOU.TYPE>;
transactionID: string;
reportID: string;
backTo: Routes;
};
[SCREENS.MONEY_REQUEST.PARTICIPANTS]: {
iouType: string;
reportID: string;
Expand Down
Loading
Loading