Skip to content

Commit e000d80

Browse files
authored
Merge pull request #51232 from shubham1206agra/per-diem-1
Enable/disable per diem rates
2 parents e453cfd + 42a19ae commit e000d80

25 files changed

+850
-17
lines changed
Loading

src/CONST.ts

+11
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,7 @@ const CONST = {
844844
UPWORK_URL: 'https://github.com/Expensify/App/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22',
845845
DEEP_DIVE_EXPENSIFY_CARD: 'https://community.expensify.com/discussion/4848/deep-dive-expensify-card-and-quickbooks-online-auto-reconciliation-how-it-works',
846846
DEEP_DIVE_ERECEIPTS: 'https://community.expensify.com/discussion/5542/deep-dive-what-are-ereceipts/',
847+
DEEP_DIVE_PER_DIEM: 'https://community.expensify.com/discussion/4772/how-to-add-a-single-rate-per-diem',
847848
GITHUB_URL: 'https://github.com/Expensify/App',
848849
TERMS_URL: `${USE_EXPENSIFY_URL}/terms`,
849850
PRIVACY_URL: `${USE_EXPENSIFY_URL}/privacy`,
@@ -2466,6 +2467,7 @@ const CONST = {
24662467
ARE_INVOICES_ENABLED: 'areInvoicesEnabled',
24672468
ARE_TAXES_ENABLED: 'tax',
24682469
ARE_RULES_ENABLED: 'areRulesEnabled',
2470+
ARE_PER_DIEM_RATES_ENABLED: 'arePerDiemRatesEnabled',
24692471
},
24702472
DEFAULT_CATEGORIES: [
24712473
'Advertising',
@@ -2632,6 +2634,7 @@ const CONST = {
26322634

26332635
CUSTOM_UNITS: {
26342636
NAME_DISTANCE: 'Distance',
2637+
NAME_PER_DIEM_INTERNATIONAL: 'Per Diem International',
26352638
DISTANCE_UNIT_MILES: 'mi',
26362639
DISTANCE_UNIT_KILOMETERS: 'km',
26372640
MILEAGE_IRS_RATE: 0.67,
@@ -6093,6 +6096,14 @@ const CONST = {
60936096
description: 'workspace.upgrade.rules.description' as const,
60946097
icon: 'Rules',
60956098
},
6099+
perDiem: {
6100+
id: 'perDiem' as const,
6101+
alias: 'per-diem',
6102+
name: 'Per diem',
6103+
title: 'workspace.upgrade.perDiem.title' as const,
6104+
description: 'workspace.upgrade.perDiem.description' as const,
6105+
icon: 'PerDiem',
6106+
},
60966107
};
60976108
},
60986109
REPORT_FIELD_TYPES: {

src/ROUTES.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1273,6 +1273,10 @@ const ROUTES = {
12731273
route: 'settings/workspaces/:policyID/distance-rates/:rateID/tax-rate/edit',
12741274
getRoute: (policyID: string, rateID: string) => `settings/workspaces/${policyID}/distance-rates/${rateID}/tax-rate/edit` as const,
12751275
},
1276+
WORKSPACE_PER_DIEM: {
1277+
route: 'settings/workspaces/:policyID/per-diem',
1278+
getRoute: (policyID: string) => `settings/workspaces/${policyID}/per-diem` as const,
1279+
},
12761280
RULES_CUSTOM_NAME: {
12771281
route: 'settings/workspaces/:policyID/rules/name',
12781282
getRoute: (policyID: string) => `settings/workspaces/${policyID}/rules/name` as const,

src/SCREENS.ts

+1
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ const SCREENS = {
542542
RULES_MAX_EXPENSE_AMOUNT: 'Rules_Max_Expense_Amount',
543543
RULES_MAX_EXPENSE_AGE: 'Rules_Max_Expense_Age',
544544
RULES_BILLABLE_DEFAULT: 'Rules_Billable_Default',
545+
PER_DIEM: 'Per_Diem',
545546
},
546547

547548
EDIT_REQUEST: {

src/components/FocusTrap/WIDE_LAYOUT_INACTIVE_SCREENS.ts

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const WIDE_LAYOUT_INACTIVE_SCREENS: string[] = [
3535
SCREENS.SETTINGS.TROUBLESHOOT,
3636
SCREENS.SETTINGS.SAVE_THE_WORLD,
3737
SCREENS.WORKSPACE.RULES,
38+
SCREENS.WORKSPACE.PER_DIEM,
3839
];
3940

4041
export default WIDE_LAYOUT_INACTIVE_SCREENS;

src/components/Icon/Illustrations.ts

+2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ import MoneyWings from '@assets/images/simple-illustrations/simple-illustration_
101101
import OpenSafe from '@assets/images/simple-illustrations/simple-illustration__opensafe.svg';
102102
import PalmTree from '@assets/images/simple-illustrations/simple-illustration__palmtree.svg';
103103
import Pencil from '@assets/images/simple-illustrations/simple-illustration__pencil.svg';
104+
import PerDiem from '@assets/images/simple-illustrations/simple-illustration__perdiem.svg';
104105
import PiggyBank from '@assets/images/simple-illustrations/simple-illustration__piggybank.svg';
105106
import Profile from '@assets/images/simple-illustrations/simple-illustration__profile.svg';
106107
import QRCode from '@assets/images/simple-illustrations/simple-illustration__qr-code.svg';
@@ -264,4 +265,5 @@ export {
264265
OtherCompanyCardDetail,
265266
StripeCompanyCardDetail,
266267
WellsFargoCompanyCardDetail,
268+
PerDiem,
267269
};

src/languages/en.ts

+30
Original file line numberDiff line numberDiff line change
@@ -2337,6 +2337,7 @@ const translations = {
23372337
displayedAs: 'Displayed as',
23382338
plan: 'Plan',
23392339
profile: 'Profile',
2340+
perDiem: 'Per diem',
23402341
bankAccount: 'Bank account',
23412342
connectBankAccount: 'Connect bank account',
23422343
testTransactions: 'Test transactions',
@@ -2401,6 +2402,25 @@ const translations = {
24012402
}
24022403
},
24032404
},
2405+
perDiem: {
2406+
subtitle: 'Set per diem rates to control daily employee spend. ',
2407+
destination: 'Destination',
2408+
subrate: 'Subrate',
2409+
amount: 'Amount',
2410+
deleteRates: () => ({
2411+
one: 'Delete rate',
2412+
other: 'Delete rates',
2413+
}),
2414+
deletePerDiemRate: 'Delete per diem rate',
2415+
areYouSureDelete: () => ({
2416+
one: 'Are you sure you want to delete this rate?',
2417+
other: 'Are you sure you want to delete these rates?',
2418+
}),
2419+
emptyList: {
2420+
title: 'Per diem',
2421+
subtitle: 'Set per diem rates to control daily employee spend. Import rates from a spreadsheet to get started.',
2422+
},
2423+
},
24042424
qbd: {
24052425
exportOutOfPocketExpensesDescription: 'Set how out-of-pocket expenses export to QuickBooks Desktop.',
24062426
exportOutOfPocketExpensesCheckToogle: 'Mark checks as “print later”',
@@ -3291,6 +3311,10 @@ const translations = {
32913311
title: 'Distance rates',
32923312
subtitle: 'Add, update, and enforce rates.',
32933313
},
3314+
perDiem: {
3315+
title: 'Per diem',
3316+
subtitle: 'Set Per diem rates to control daily employee spend.',
3317+
},
32943318
expensifyCard: {
32953319
title: 'Expensify Card',
32963320
subtitle: 'Gain insights and control over spend.',
@@ -4067,6 +4091,12 @@ const translations = {
40674091
description: `Rules run in the background and keep your spend under control so you don't have to sweat the small stuff.\n\nRequire expense details like receipts and descriptions, set limits and defaults, and automate approvals and payments – all in one place.`,
40684092
onlyAvailableOnPlan: 'Rules are only available on the Control plan, starting at ',
40694093
},
4094+
perDiem: {
4095+
title: 'Per diem',
4096+
description:
4097+
'Per diem is a great way to keep your daily costs compliant and predictable whenever your employees travel. Enjoy features like custom rates, default categories, and more granular details like destinations and subrates.',
4098+
onlyAvailableOnPlan: 'Per diem are only available on the Control plan, starting at ',
4099+
},
40704100
pricing: {
40714101
amount: '$9 ',
40724102
perActiveMember: 'per active member per month.',

src/languages/es.ts

+30
Original file line numberDiff line numberDiff line change
@@ -2358,6 +2358,7 @@ const translations = {
23582358
rules: 'Reglas',
23592359
plan: 'Plan',
23602360
profile: 'Perfil',
2361+
perDiem: 'Per diem',
23612362
bankAccount: 'Cuenta bancaria',
23622363
displayedAs: 'Mostrado como',
23632364
connectBankAccount: 'Conectar cuenta bancaria',
@@ -2424,6 +2425,25 @@ const translations = {
24242425
}
24252426
},
24262427
},
2428+
perDiem: {
2429+
subtitle: 'Establece las tasas per diem para controlar los gastos diarios de los empleados. ',
2430+
destination: 'Destino',
2431+
subrate: 'Subtasa',
2432+
amount: 'Cantidad',
2433+
deleteRates: () => ({
2434+
one: 'Eliminar tasa',
2435+
other: 'Eliminar tasas',
2436+
}),
2437+
deletePerDiemRate: 'Eliminar tasa per diem',
2438+
areYouSureDelete: () => ({
2439+
one: '¿Estás seguro de que quieres eliminar esta tasa?',
2440+
other: '¿Estás seguro de que quieres eliminar estas tasas?',
2441+
}),
2442+
emptyList: {
2443+
title: 'Per diem',
2444+
subtitle: 'Establece dietas per diem para controlar el gasto diario de los empleados. Importa las tarifas desde una hoja de cálculo para comenzar.',
2445+
},
2446+
},
24272447
qbd: {
24282448
exportOutOfPocketExpensesDescription: 'Establezca cómo se exportan los gastos de bolsillo a QuickBooks Desktop.',
24292449
exportOutOfPocketExpensesCheckToogle: 'Marcar los cheques como “imprimir más tarde”',
@@ -3332,6 +3352,10 @@ const translations = {
33323352
title: 'Tasas de distancia',
33333353
subtitle: 'Añade, actualiza y haz cumplir las tasas.',
33343354
},
3355+
perDiem: {
3356+
title: 'Per diem',
3357+
subtitle: 'Establece las tasas per diem para controlar los gastos diarios de los empleados.',
3358+
},
33353359
expensifyCard: {
33363360
title: 'Tarjeta Expensify',
33373361
subtitle: 'Obtén información y control sobre tus gastos.',
@@ -4113,6 +4137,12 @@ const translations = {
41134137
description: `Las reglas se ejecutan en segundo plano y mantienen tus gastos bajo control para que no tengas que preocuparte por los detalles pequeños.\n\nExige detalles de los gastos, como recibos y descripciones, establece límites y valores predeterminados, y automatiza las aprobaciones y los pagos, todo en un mismo lugar.`,
41144138
onlyAvailableOnPlan: 'Las reglas están disponibles solo en el plan Controlar, que comienza en ',
41154139
},
4140+
perDiem: {
4141+
title: 'Per diem',
4142+
description:
4143+
'Las dietas per diem (ej.: $100 por día para comidas) son una excelente forma de mantener los gastos diarios predecibles y ajustados a las políticas de la empresa, especialmente si tus empleados viajan por negocios. Disfruta de funciones como tasas personalizadas, categorías por defecto y detalles más específicos como destinos y subtasas.',
4144+
onlyAvailableOnPlan: 'Las dietas per diem solo están disponibles en el plan Control, a partir de ',
4145+
},
41164146
note: {
41174147
upgradeWorkspace: 'Mejore su espacio de trabajo para acceder a esta función, o',
41184148
learnMore: 'más información',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
type OpenPolicyPerDiemRatesPageParams = {
2+
policyID: string;
3+
};
4+
5+
export default OpenPolicyPerDiemRatesPageParams;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
type TogglePolicyPerDiemParams = {
2+
policyID: string;
3+
enabled: boolean;
4+
customUnitID: string;
5+
};
6+
7+
export default TogglePolicyPerDiemParams;

src/libs/API/parameters/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -346,4 +346,6 @@ export type {default as UpdateInvoiceCompanyNameParams} from './UpdateInvoiceCom
346346
export type {default as UpdateInvoiceCompanyWebsiteParams} from './UpdateInvoiceCompanyWebsiteParams';
347347
export type {default as UpdateQuickbooksDesktopExpensesExportDestinationTypeParams} from './UpdateQuickbooksDesktopExpensesExportDestinationTypeParams';
348348
export type {default as UpdateQuickbooksDesktopCompanyCardExpenseAccountTypeParams} from './UpdateQuickbooksDesktopCompanyCardExpenseAccountTypeParams';
349+
export type {default as TogglePolicyPerDiemParams} from './TogglePolicyPerDiemParams';
350+
export type {default as OpenPolicyPerDiemRatesPageParams} from './OpenPolicyPerDiemRatesPageParams';
349351
export type {default as TogglePlatformMuteParams} from './TogglePlatformMuteParams';

0 commit comments

Comments
 (0)