Skip to content

Commit 54476da

Browse files
authored
Merge pull request Expensify#68061 from Expensify/francois-revert-63054
2 parents 80ffb61 + acdbffb commit 54476da

47 files changed

Lines changed: 31 additions & 623 deletions

Some content is hidden

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

src/CONST/index.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,12 +2877,6 @@ const CONST = {
28772877
REIMBURSEMENT_NO: 'reimburseNo', // None
28782878
REIMBURSEMENT_MANUAL: 'reimburseManual', // Indirect
28792879
},
2880-
CASH_EXPENSE_REIMBURSEMENT_CHOICES: {
2881-
REIMBURSABLE_DEFAULT: 'reimbursableDefault', // Reimbursable by default
2882-
NON_REIMBURSABLE_DEFAULT: 'nonReimbursableDefault', // Non-reimbursable by default
2883-
ALWAYS_REIMBURSABLE: 'alwaysReimbursable', // Always Reimbursable
2884-
ALWAYS_NON_REIMBURSABLE: 'alwaysNonReimbursable', // Always Non Reimbursable
2885-
},
28862880
ID_FAKE: '_FAKE_',
28872881
EMPTY: 'EMPTY',
28882882
SECONDARY_ACTIONS: {
@@ -3742,7 +3736,6 @@ const CONST = {
37423736
TAG: 'tag',
37433737
TAX_RATE: 'taxRate',
37443738
TAX_AMOUNT: 'taxAmount',
3745-
REIMBURSABLE: 'reimbursable',
37463739
REPORT: 'report',
37473740
},
37483741
FOOTER: {

src/ROUTES.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,10 +1916,6 @@ const ROUTES = {
19161916
route: 'workspaces/:policyID/rules/billable',
19171917
getRoute: (policyID: string) => `workspaces/${policyID}/rules/billable` as const,
19181918
},
1919-
RULES_REIMBURSABLE_DEFAULT: {
1920-
route: 'workspaces/:policyID/rules/reimbursable',
1921-
getRoute: (policyID: string) => `workspaces/${policyID}/rules/reimbursable` as const,
1922-
},
19231919
RULES_PROHIBITED_DEFAULT: {
19241920
route: 'workspaces/:policyID/rules/prohibited',
19251921
getRoute: (policyID: string) => `workspaces/${policyID}/rules/prohibited` as const,

src/SCREENS.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,6 @@ const SCREENS = {
632632
RULES_MAX_EXPENSE_AMOUNT: 'Rules_Max_Expense_Amount',
633633
RULES_MAX_EXPENSE_AGE: 'Rules_Max_Expense_Age',
634634
RULES_BILLABLE_DEFAULT: 'Rules_Billable_Default',
635-
RULES_REIMBURSABLE_DEFAULT: 'Rules_Reimbursable_Default',
636635
RULES_CUSTOM: 'Rules_Custom',
637636
RULES_PROHIBITED_DEFAULT: 'Rules_Prohibited_Default',
638637
PER_DIEM: 'Per_Diem',

src/components/MoneyRequestConfirmationList.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,6 @@ type MoneyRequestConfirmationListProps = {
183183
/** The PDF password callback */
184184
onPDFPassword?: () => void;
185185

186-
/** Function to toggle reimbursable */
187-
onToggleReimbursable?: (isOn: boolean) => void;
188-
189-
/** Flag indicating if the IOU is reimbursable */
190-
iouIsReimbursable?: boolean;
191-
192186
/** Show remove expense confirmation modal */
193187
showRemoveExpenseConfirmModal?: () => void;
194188
};
@@ -231,8 +225,6 @@ function MoneyRequestConfirmationList({
231225
isConfirming,
232226
onPDFLoadError,
233227
onPDFPassword,
234-
iouIsReimbursable = true,
235-
onToggleReimbursable,
236228
showRemoveExpenseConfirmModal,
237229
}: MoneyRequestConfirmationListProps) {
238230
const [policyCategoriesReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`, {canBeMissing: true});
@@ -1162,8 +1154,6 @@ function MoneyRequestConfirmationList({
11621154
unit={unit}
11631155
onPDFLoadError={onPDFLoadError}
11641156
onPDFPassword={onPDFPassword}
1165-
iouIsReimbursable={iouIsReimbursable}
1166-
onToggleReimbursable={onToggleReimbursable}
11671157
isReceiptEditable={isReceiptEditable}
11681158
/>
11691159
);

src/components/MoneyRequestConfirmationListFooter.tsx

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import {
3131
getTaxAmount,
3232
getTaxName,
3333
isAmountMissing,
34-
isCardTransaction,
3534
isCreatedMissing,
3635
isFetchingWaypointsFromServer,
3736
shouldShowAttendees as shouldShowAttendeesTransactionUtils,
@@ -199,12 +198,6 @@ type MoneyRequestConfirmationListFooterProps = {
199198

200199
/** The PDF password callback */
201200
onPDFPassword?: () => void;
202-
203-
/** Function to toggle reimbursable */
204-
onToggleReimbursable?: (isOn: boolean) => void;
205-
206-
/** Flag indicating if the IOU is reimbursable */
207-
iouIsReimbursable: boolean;
208201
};
209202

210203
function MoneyRequestConfirmationListFooter({
@@ -254,8 +247,6 @@ function MoneyRequestConfirmationListFooter({
254247
unit,
255248
onPDFLoadError,
256249
onPDFPassword,
257-
iouIsReimbursable,
258-
onToggleReimbursable,
259250
isReceiptEditable = false,
260251
}: MoneyRequestConfirmationListFooterProps) {
261252
const styles = useThemeStyles();
@@ -322,7 +313,6 @@ function MoneyRequestConfirmationListFooter({
322313
const canModifyTaxFields = !isReadOnly && !isDistanceRequest && !isPerDiemRequest;
323314
// A flag for showing the billable field
324315
const shouldShowBillable = policy?.disabledFields?.defaultBillable === false;
325-
const shouldShowReimbursable = isPaidGroupPolicy(policy) && policy?.disabledFields?.reimbursable === false && !isCardTransaction(transaction) && !isTypeInvoice;
326316
// Calculate the formatted tax amount based on the transaction's tax amount and the IOU currency code
327317
const taxAmount = getTaxAmount(transaction, false);
328318
const formattedTaxAmount = convertToDisplayString(taxAmount, iouCurrencyCode);
@@ -651,25 +641,6 @@ function MoneyRequestConfirmationListFooter({
651641
),
652642
shouldShow: shouldShowAttendees,
653643
},
654-
{
655-
item: (
656-
<View
657-
key={Str.UCFirst(translate('iou.reimbursable'))}
658-
style={[styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.ml5, styles.mr8, styles.optionRow]}
659-
>
660-
<ToggleSettingOptionRow
661-
switchAccessibilityLabel={Str.UCFirst(translate('iou.reimbursable'))}
662-
title={Str.UCFirst(translate('iou.reimbursable'))}
663-
onToggle={(isOn) => onToggleReimbursable?.(isOn)}
664-
isActive={iouIsReimbursable}
665-
disabled={isReadOnly}
666-
wrapperStyle={styles.flex1}
667-
/>
668-
</View>
669-
),
670-
shouldShow: shouldShowReimbursable,
671-
isSupplementary: true,
672-
},
673644
{
674645
item: (
675646
<View

src/components/ReportActionItem/MoneyRequestView.tsx

Lines changed: 5 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import {Str} from 'expensify-common';
21
import mapValues from 'lodash/mapValues';
32
import React, {useCallback, useEffect, useMemo, useState} from 'react';
43
import {View} from 'react-native';
@@ -58,7 +57,6 @@ import {
5857
getDescription,
5958
getDistanceInMeters,
6059
getOriginalTransactionWithSplitInfo,
61-
getReimbursable,
6260
getTagForDisplay,
6361
getTaxName,
6462
hasMissingSmartscanFields,
@@ -74,7 +72,7 @@ import {
7472
import ViolationsUtils from '@libs/Violations/ViolationsUtils';
7573
import Navigation from '@navigation/Navigation';
7674
import AnimatedEmptyStateBackground from '@pages/home/report/AnimatedEmptyStateBackground';
77-
import {cleanUpMoneyRequest, updateMoneyRequestBillable, updateMoneyRequestReimbursable} from '@userActions/IOU';
75+
import {cleanUpMoneyRequest, updateMoneyRequestBillable} from '@userActions/IOU';
7876
import {navigateToConciergeChatAndDeleteReport} from '@userActions/Report';
7977
import {clearAllRelatedReportActionErrors} from '@userActions/ReportActions';
8078
import {clearError, getLastModifiedExpense, revert} from '@userActions/Transaction';
@@ -166,7 +164,6 @@ function MoneyRequestView({allReports, report, policy, shouldShowAnimatedBackgro
166164
currency: transactionCurrency,
167165
comment: transactionDescription,
168166
merchant: transactionMerchant,
169-
reimbursable: transactionReimbursable,
170167
billable: transactionBillable,
171168
category: transactionCategory,
172169
tag: transactionTag,
@@ -202,7 +199,6 @@ function MoneyRequestView({allReports, report, policy, shouldShowAnimatedBackgro
202199
const isSettled = isSettledReportUtils(moneyRequestReport?.reportID);
203200
const isCancelled = moneyRequestReport && moneyRequestReport?.isCancelledIOU;
204201
const isChatReportArchived = useReportIsArchived(moneyRequestReport?.chatReportID);
205-
const shouldShowPaid = isSettled && transactionReimbursable;
206202

207203
// Flags for allowing or disallowing editing an expense
208204
// Used for non-restricted fields such as: description, category, tag, billable, etc...
@@ -246,8 +242,6 @@ function MoneyRequestView({allReports, report, policy, shouldShowAnimatedBackgro
246242
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
247243
const shouldShowTag = isPolicyExpenseChat && (transactionTag || hasEnabledTags(policyTagLists));
248244
const shouldShowBillable = isPolicyExpenseChat && (!!transactionBillable || !(policy?.disabledFields?.defaultBillable ?? true) || !!updatedTransaction?.billable);
249-
const shouldShowReimbursable = isPolicyExpenseChat && !isCardTransaction && !isInvoice;
250-
const canEditReimbursable = canUserPerformWriteAction && canEditFieldOfMoneyRequest(parentReportAction, CONST.EDIT_REQUEST_FIELD.REIMBURSABLE);
251245
const shouldShowAttendees = useMemo(() => shouldShowAttendeesTransactionUtils(iouType, policy), [iouType, policy]);
252246

253247
const shouldShowTax = isTaxTrackingEnabled(isPolicyExpenseChat, policy, isDistanceRequest, isPerDiemRequest);
@@ -297,17 +291,6 @@ function MoneyRequestView({allReports, report, policy, shouldShowAnimatedBackgro
297291
[transaction, report, policy, policyTagList, policyCategories],
298292
);
299293

300-
const saveReimbursable = useCallback(
301-
(newReimbursable: boolean) => {
302-
// If the value hasn't changed, don't request to save changes on the server and just close the modal
303-
if (newReimbursable === getReimbursable(transaction) || !transaction?.transactionID || !report?.reportID) {
304-
return;
305-
}
306-
updateMoneyRequestReimbursable(transaction.transactionID, report?.reportID, newReimbursable, policy, policyTagList, policyCategories);
307-
},
308-
[transaction, report, policy, policyTagList, policyCategories],
309-
);
310-
311294
if (isCardTransaction) {
312295
if (transactionPostedDate) {
313296
dateDescription += ` ${CONST.DOT_SEPARATOR} ${translate('iou.posted')} ${transactionPostedDate}`;
@@ -329,7 +312,7 @@ function MoneyRequestView({allReports, report, policy, shouldShowAnimatedBackgro
329312
amountDescription += ` ${CONST.DOT_SEPARATOR} ${translate('iou.canceled')}`;
330313
} else if (isApproved) {
331314
amountDescription += ` ${CONST.DOT_SEPARATOR} ${translate('iou.approved')}`;
332-
} else if (shouldShowPaid) {
315+
} else if (isSettled) {
333316
amountDescription += ` ${CONST.DOT_SEPARATOR} ${translate('iou.settledExpensify')}`;
334317
}
335318
}
@@ -671,7 +654,7 @@ function MoneyRequestView({allReports, report, policy, shouldShowAnimatedBackgro
671654
<OfflineWithFeedback pendingAction={getPendingFieldAction('amount') ?? (amountTitle ? getPendingFieldAction('customUnitRateID') : undefined)}>
672655
<MenuItemWithTopDescription
673656
title={amountTitle}
674-
shouldShowTitleIcon={shouldShowPaid}
657+
shouldShowTitleIcon={isSettled}
675658
titleIcon={Expensicons.Checkmark}
676659
description={amountDescription}
677660
titleStyle={styles.textHeadlineH2}
@@ -854,27 +837,8 @@ function MoneyRequestView({allReports, report, policy, shouldShowAnimatedBackgro
854837
/>
855838
</OfflineWithFeedback>
856839
)}
857-
{shouldShowReimbursable && (
858-
<OfflineWithFeedback
859-
pendingAction={getPendingFieldAction('reimbursable')}
860-
contentContainerStyle={[styles.flexRow, styles.optionRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.ml5, styles.mr8]}
861-
>
862-
<View>
863-
<Text>{Str.UCFirst(translate('iou.reimbursable'))}</Text>
864-
</View>
865-
<Switch
866-
accessibilityLabel={Str.UCFirst(translate('iou.reimbursable'))}
867-
isOn={updatedTransaction?.reimbursable ?? !!transactionReimbursable}
868-
onToggle={saveReimbursable}
869-
disabled={!canEditReimbursable}
870-
/>
871-
</OfflineWithFeedback>
872-
)}
873840
{shouldShowBillable && (
874-
<OfflineWithFeedback
875-
pendingAction={getPendingFieldAction('billable')}
876-
contentContainerStyle={[styles.flexRow, styles.optionRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.ml5, styles.mr8]}
877-
>
841+
<View style={[styles.flexRow, styles.optionRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.ml5, styles.mr8]}>
878842
<View>
879843
<Text>{translate('common.billable')}</Text>
880844
{!!getErrorForField('billable') && (
@@ -893,7 +857,7 @@ function MoneyRequestView({allReports, report, policy, shouldShowAnimatedBackgro
893857
onToggle={saveBillable}
894858
disabled={!canEdit}
895859
/>
896-
</OfflineWithFeedback>
860+
</View>
897861
)}
898862
{!!parentReportID && (
899863
<OfflineWithFeedback pendingAction={getPendingFieldAction('reportID')}>

src/languages/de.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5482,17 +5482,6 @@ const translations = {
54825482
one: '1 Tag',
54835483
other: (count: number) => `${count} Tage`,
54845484
}),
5485-
cashExpenseDefault: 'Bargeldausgabe standard',
5486-
cashExpenseDefaultDescription:
5487-
'Wählen Sie, wie Bargeldausgaben erstellt werden sollen. Eine Ausgabe gilt als Bargeldausgabe, wenn sie keine importierte Firmenkartentransaktion ist. Dazu gehören manuell erstellte Ausgaben, Belege, Pauschalen, Kilometer- und Zeitaufwand.',
5488-
reimbursableDefault: 'Erstattungsfähig',
5489-
reimbursableDefaultDescription: 'Ausgaben werden meistens an Mitarbeiter zurückgezahlt',
5490-
nonReimbursableDefault: 'Nicht erstattungsfähig',
5491-
nonReimbursableDefaultDescription: 'Ausgaben werden gelegentlich an Mitarbeiter zurückgezahlt',
5492-
alwaysReimbursable: 'Immer erstattungsfähig',
5493-
alwaysReimbursableDescription: 'Ausgaben werden immer an Mitarbeiter zurückgezahlt',
5494-
alwaysNonReimbursable: 'Nie erstattungsfähig',
5495-
alwaysNonReimbursableDescription: 'Ausgaben werden nie an Mitarbeiter zurückgezahlt',
54965485
billableDefault: 'Abrechnungsstandard',
54975486
billableDefaultDescription: 'Wählen Sie, ob Bar- und Kreditkartenausgaben standardmäßig abrechenbar sein sollen. Abrechenbare Ausgaben werden aktiviert oder deaktiviert in',
54985487
billable: 'Abrechenbar',
@@ -5794,7 +5783,6 @@ const translations = {
57945783
},
57955784
updateDefaultBillable: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) =>
57965785
`aktualisiert "Kosten an Kunden weiterberechnen" auf "${newValue}" (vorher "${oldValue}")`,
5797-
updateDefaultReimbursable: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) => `aktualisiert "Bargeldausgabe Standard" auf "${newValue}" (vorher "${oldValue}")`,
57985786
updateDefaultTitleEnforced: ({value}: UpdatedPolicyFieldWithValueParam) => `"Standardberichtstitel erzwingen" ${value ? 'on' : 'aus'}`,
57995787
renamedWorkspaceNameAction: ({oldName, newName}: RenamedWorkspaceNameActionParams) => `hat den Namen dieses Arbeitsbereichs in "${newName}" geändert (vorher "${oldName}")`,
58005788
updateWorkspaceDescription: ({newDescription, oldDescription}: UpdatedPolicyDescriptionParams) =>

src/languages/en.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5454,17 +5454,6 @@ const translations = {
54545454
one: '1 day',
54555455
other: (count: number) => `${count} days`,
54565456
}),
5457-
cashExpenseDefault: 'Cash expense default',
5458-
cashExpenseDefaultDescription:
5459-
'Choose how cash expenses should be created. An expense is considered a cash expense if it is not an imported company card transaction. This includes manually created expenses, receipts, per diem, distance, and time expenses.',
5460-
reimbursableDefault: 'Reimbursable',
5461-
reimbursableDefaultDescription: 'Expenses are most often paid back to employees',
5462-
nonReimbursableDefault: 'Non-reimbursable',
5463-
nonReimbursableDefaultDescription: 'Expenses are occasionally paid back to employees',
5464-
alwaysReimbursable: 'Always reimbursable',
5465-
alwaysReimbursableDescription: 'Expenses are always paid back to employees',
5466-
alwaysNonReimbursable: 'Always non-reimbursable',
5467-
alwaysNonReimbursableDescription: 'Expenses are never paid back to employees',
54685457
billableDefault: 'Billable default',
54695458
billableDefaultDescription: 'Choose whether cash and credit card expenses should be billable by default. Billable expenses are enabled or disabled in',
54705459
billable: 'Billable',
@@ -5766,7 +5755,6 @@ const translations = {
57665755
return `updated the monthly report submission date to "${newValue}" (previously "${oldValue}")`;
57675756
},
57685757
updateDefaultBillable: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) => `updated "Re-bill expenses to clients" to "${newValue}" (previously "${oldValue}")`,
5769-
updateDefaultReimbursable: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) => `updated "Cash expense default" to "${newValue}" (previously "${oldValue}")`,
57705758
updateDefaultTitleEnforced: ({value}: UpdatedPolicyFieldWithValueParam) => `turned "Enforce default report titles" ${value ? 'on' : 'off'}`,
57715759
renamedWorkspaceNameAction: ({oldName, newName}: RenamedWorkspaceNameActionParams) => `updated the name of this workspace to "${newName}" (previously "${oldName}")`,
57725760
updateWorkspaceDescription: ({newDescription, oldDescription}: UpdatedPolicyDescriptionParams) =>

src/languages/es.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5492,17 +5492,6 @@ const translations = {
54925492
one: '1 día',
54935493
other: (count: number) => `${count} días`,
54945494
}),
5495-
cashExpenseDefault: 'Valor predeterminado para gastos en efectivo',
5496-
cashExpenseDefaultDescription:
5497-
'Elige cómo deben crearse los gastos en efectivo. Un gasto se considera en efectivo si no es una transacción importada desde una tarjeta de empresa. Esto incluye gastos creados manualmente, recibos, viáticos y gastos de distancia y tiempo.',
5498-
reimbursableDefault: 'Reembolsable',
5499-
reimbursableDefaultDescription: 'Los gastos suelen ser reembolsados a los empleados',
5500-
nonReimbursableDefault: 'No reembolsable',
5501-
nonReimbursableDefaultDescription: 'Los gastos ocasionalmente son reembolsados a los empleados',
5502-
alwaysReimbursable: 'Siempre reembolsable',
5503-
alwaysReimbursableDescription: 'Los gastos siempre se reembolsados a los empleados',
5504-
alwaysNonReimbursable: 'Siempre no reembolsable',
5505-
alwaysNonReimbursableDescription: 'Los gastos nunca son reembolsados a los empleados',
55065495
billableDefault: 'Valor predeterminado facturable',
55075496
billableDefaultDescription: 'Elige si los gastos en efectivo y con tarjeta de crédito deben ser facturables por defecto. Los gastos facturables se activan o desactivan en',
55085497
billable: 'Facturable',
@@ -5782,8 +5771,6 @@ const translations = {
57825771
`actualizó "Antigüedad máxima de gastos (días)" a "${newValue}" (previamente "${oldValue === 'false' ? CONST.POLICY.DEFAULT_MAX_EXPENSE_AGE : oldValue}")`,
57835772
updateDefaultBillable: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) =>
57845773
`actualizó "Volver a facturar gastos a clientes" a "${newValue}" (previamente "${oldValue}")`,
5785-
updateDefaultReimbursable: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) =>
5786-
`actualizó "Valor predeterminado para gastos en efectivo" a "${newValue}" (previamente "${oldValue}")`,
57875774
updateMonthlyOffset: ({oldValue, newValue}: UpdatedPolicyFieldWithNewAndOldValueParams) => {
57885775
if (!oldValue) {
57895776
return `establecer la fecha de envío del informe mensual a "${newValue}"`;

0 commit comments

Comments
 (0)