Skip to content

Commit

Permalink
Merge pull request #51232 from shubham1206agra/per-diem-1
Browse files Browse the repository at this point in the history
Enable/disable per diem rates
  • Loading branch information
Gonals authored Nov 7, 2024
2 parents e453cfd + 42a19ae commit e000d80
Show file tree
Hide file tree
Showing 25 changed files with 850 additions and 17 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,7 @@ const CONST = {
UPWORK_URL: 'https://github.com/Expensify/App/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22',
DEEP_DIVE_EXPENSIFY_CARD: 'https://community.expensify.com/discussion/4848/deep-dive-expensify-card-and-quickbooks-online-auto-reconciliation-how-it-works',
DEEP_DIVE_ERECEIPTS: 'https://community.expensify.com/discussion/5542/deep-dive-what-are-ereceipts/',
DEEP_DIVE_PER_DIEM: 'https://community.expensify.com/discussion/4772/how-to-add-a-single-rate-per-diem',
GITHUB_URL: 'https://github.com/Expensify/App',
TERMS_URL: `${USE_EXPENSIFY_URL}/terms`,
PRIVACY_URL: `${USE_EXPENSIFY_URL}/privacy`,
Expand Down Expand Up @@ -2466,6 +2467,7 @@ const CONST = {
ARE_INVOICES_ENABLED: 'areInvoicesEnabled',
ARE_TAXES_ENABLED: 'tax',
ARE_RULES_ENABLED: 'areRulesEnabled',
ARE_PER_DIEM_RATES_ENABLED: 'arePerDiemRatesEnabled',
},
DEFAULT_CATEGORIES: [
'Advertising',
Expand Down Expand Up @@ -2632,6 +2634,7 @@ const CONST = {

CUSTOM_UNITS: {
NAME_DISTANCE: 'Distance',
NAME_PER_DIEM_INTERNATIONAL: 'Per Diem International',
DISTANCE_UNIT_MILES: 'mi',
DISTANCE_UNIT_KILOMETERS: 'km',
MILEAGE_IRS_RATE: 0.67,
Expand Down Expand Up @@ -6093,6 +6096,14 @@ const CONST = {
description: 'workspace.upgrade.rules.description' as const,
icon: 'Rules',
},
perDiem: {
id: 'perDiem' as const,
alias: 'per-diem',
name: 'Per diem',
title: 'workspace.upgrade.perDiem.title' as const,
description: 'workspace.upgrade.perDiem.description' as const,
icon: 'PerDiem',
},
};
},
REPORT_FIELD_TYPES: {
Expand Down
4 changes: 4 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,10 @@ const ROUTES = {
route: 'settings/workspaces/:policyID/distance-rates/:rateID/tax-rate/edit',
getRoute: (policyID: string, rateID: string) => `settings/workspaces/${policyID}/distance-rates/${rateID}/tax-rate/edit` as const,
},
WORKSPACE_PER_DIEM: {
route: 'settings/workspaces/:policyID/per-diem',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/per-diem` as const,
},
RULES_CUSTOM_NAME: {
route: 'settings/workspaces/:policyID/rules/name',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/rules/name` as const,
Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ const SCREENS = {
RULES_MAX_EXPENSE_AMOUNT: 'Rules_Max_Expense_Amount',
RULES_MAX_EXPENSE_AGE: 'Rules_Max_Expense_Age',
RULES_BILLABLE_DEFAULT: 'Rules_Billable_Default',
PER_DIEM: 'Per_Diem',
},

EDIT_REQUEST: {
Expand Down
1 change: 1 addition & 0 deletions src/components/FocusTrap/WIDE_LAYOUT_INACTIVE_SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const WIDE_LAYOUT_INACTIVE_SCREENS: string[] = [
SCREENS.SETTINGS.TROUBLESHOOT,
SCREENS.SETTINGS.SAVE_THE_WORLD,
SCREENS.WORKSPACE.RULES,
SCREENS.WORKSPACE.PER_DIEM,
];

export default WIDE_LAYOUT_INACTIVE_SCREENS;
2 changes: 2 additions & 0 deletions src/components/Icon/Illustrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ import MoneyWings from '@assets/images/simple-illustrations/simple-illustration_
import OpenSafe from '@assets/images/simple-illustrations/simple-illustration__opensafe.svg';
import PalmTree from '@assets/images/simple-illustrations/simple-illustration__palmtree.svg';
import Pencil from '@assets/images/simple-illustrations/simple-illustration__pencil.svg';
import PerDiem from '@assets/images/simple-illustrations/simple-illustration__perdiem.svg';
import PiggyBank from '@assets/images/simple-illustrations/simple-illustration__piggybank.svg';
import Profile from '@assets/images/simple-illustrations/simple-illustration__profile.svg';
import QRCode from '@assets/images/simple-illustrations/simple-illustration__qr-code.svg';
Expand Down Expand Up @@ -264,4 +265,5 @@ export {
OtherCompanyCardDetail,
StripeCompanyCardDetail,
WellsFargoCompanyCardDetail,
PerDiem,
};
30 changes: 30 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2337,6 +2337,7 @@ const translations = {
displayedAs: 'Displayed as',
plan: 'Plan',
profile: 'Profile',
perDiem: 'Per diem',
bankAccount: 'Bank account',
connectBankAccount: 'Connect bank account',
testTransactions: 'Test transactions',
Expand Down Expand Up @@ -2401,6 +2402,25 @@ const translations = {
}
},
},
perDiem: {
subtitle: 'Set per diem rates to control daily employee spend. ',
destination: 'Destination',
subrate: 'Subrate',
amount: 'Amount',
deleteRates: () => ({
one: 'Delete rate',
other: 'Delete rates',
}),
deletePerDiemRate: 'Delete per diem rate',
areYouSureDelete: () => ({
one: 'Are you sure you want to delete this rate?',
other: 'Are you sure you want to delete these rates?',
}),
emptyList: {
title: 'Per diem',
subtitle: 'Set per diem rates to control daily employee spend. Import rates from a spreadsheet to get started.',
},
},
qbd: {
exportOutOfPocketExpensesDescription: 'Set how out-of-pocket expenses export to QuickBooks Desktop.',
exportOutOfPocketExpensesCheckToogle: 'Mark checks as “print later”',
Expand Down Expand Up @@ -3291,6 +3311,10 @@ const translations = {
title: 'Distance rates',
subtitle: 'Add, update, and enforce rates.',
},
perDiem: {
title: 'Per diem',
subtitle: 'Set Per diem rates to control daily employee spend.',
},
expensifyCard: {
title: 'Expensify Card',
subtitle: 'Gain insights and control over spend.',
Expand Down Expand Up @@ -4067,6 +4091,12 @@ const translations = {
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.`,
onlyAvailableOnPlan: 'Rules are only available on the Control plan, starting at ',
},
perDiem: {
title: 'Per diem',
description:
'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.',
onlyAvailableOnPlan: 'Per diem are only available on the Control plan, starting at ',
},
pricing: {
amount: '$9 ',
perActiveMember: 'per active member per month.',
Expand Down
30 changes: 30 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2358,6 +2358,7 @@ const translations = {
rules: 'Reglas',
plan: 'Plan',
profile: 'Perfil',
perDiem: 'Per diem',
bankAccount: 'Cuenta bancaria',
displayedAs: 'Mostrado como',
connectBankAccount: 'Conectar cuenta bancaria',
Expand Down Expand Up @@ -2424,6 +2425,25 @@ const translations = {
}
},
},
perDiem: {
subtitle: 'Establece las tasas per diem para controlar los gastos diarios de los empleados. ',
destination: 'Destino',
subrate: 'Subtasa',
amount: 'Cantidad',
deleteRates: () => ({
one: 'Eliminar tasa',
other: 'Eliminar tasas',
}),
deletePerDiemRate: 'Eliminar tasa per diem',
areYouSureDelete: () => ({
one: '¿Estás seguro de que quieres eliminar esta tasa?',
other: '¿Estás seguro de que quieres eliminar estas tasas?',
}),
emptyList: {
title: 'Per diem',
subtitle: 'Establece dietas per diem para controlar el gasto diario de los empleados. Importa las tarifas desde una hoja de cálculo para comenzar.',
},
},
qbd: {
exportOutOfPocketExpensesDescription: 'Establezca cómo se exportan los gastos de bolsillo a QuickBooks Desktop.',
exportOutOfPocketExpensesCheckToogle: 'Marcar los cheques como “imprimir más tarde”',
Expand Down Expand Up @@ -3332,6 +3352,10 @@ const translations = {
title: 'Tasas de distancia',
subtitle: 'Añade, actualiza y haz cumplir las tasas.',
},
perDiem: {
title: 'Per diem',
subtitle: 'Establece las tasas per diem para controlar los gastos diarios de los empleados.',
},
expensifyCard: {
title: 'Tarjeta Expensify',
subtitle: 'Obtén información y control sobre tus gastos.',
Expand Down Expand Up @@ -4113,6 +4137,12 @@ const translations = {
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.`,
onlyAvailableOnPlan: 'Las reglas están disponibles solo en el plan Controlar, que comienza en ',
},
perDiem: {
title: 'Per diem',
description:
'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.',
onlyAvailableOnPlan: 'Las dietas per diem solo están disponibles en el plan Control, a partir de ',
},
note: {
upgradeWorkspace: 'Mejore su espacio de trabajo para acceder a esta función, o',
learnMore: 'más información',
Expand Down
5 changes: 5 additions & 0 deletions src/libs/API/parameters/OpenPolicyPerDiemRatesPageParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type OpenPolicyPerDiemRatesPageParams = {
policyID: string;
};

export default OpenPolicyPerDiemRatesPageParams;
7 changes: 7 additions & 0 deletions src/libs/API/parameters/TogglePolicyPerDiemParams.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type TogglePolicyPerDiemParams = {
policyID: string;
enabled: boolean;
customUnitID: string;
};

export default TogglePolicyPerDiemParams;
2 changes: 2 additions & 0 deletions src/libs/API/parameters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,6 @@ export type {default as UpdateInvoiceCompanyNameParams} from './UpdateInvoiceCom
export type {default as UpdateInvoiceCompanyWebsiteParams} from './UpdateInvoiceCompanyWebsiteParams';
export type {default as UpdateQuickbooksDesktopExpensesExportDestinationTypeParams} from './UpdateQuickbooksDesktopExpensesExportDestinationTypeParams';
export type {default as UpdateQuickbooksDesktopCompanyCardExpenseAccountTypeParams} from './UpdateQuickbooksDesktopCompanyCardExpenseAccountTypeParams';
export type {default as TogglePolicyPerDiemParams} from './TogglePolicyPerDiemParams';
export type {default as OpenPolicyPerDiemRatesPageParams} from './OpenPolicyPerDiemRatesPageParams';
export type {default as TogglePlatformMuteParams} from './TogglePlatformMuteParams';
Loading

0 comments on commit e000d80

Please sign in to comment.