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

Feat: implement accounting page #38283

Closed
wants to merge 91 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
7d89088
add initial english strings
teneeto Mar 14, 2024
3492e28
add initial spanish strings
teneeto Mar 14, 2024
6edddee
add accounting navigation param type
teneeto Mar 14, 2024
917451c
add accounting to workspace screens
teneeto Mar 14, 2024
7f529e5
add workspace acoounting route
teneeto Mar 14, 2024
e4ba2b0
add workspace accounting to workspace setting navigator
teneeto Mar 14, 2024
4bfc371
add workspace accounting to link to screens
teneeto Mar 14, 2024
e05a0b0
add workspace accounting Page
teneeto Mar 14, 2024
24c6143
add workspace accounting Page LHN navigation button
teneeto Mar 14, 2024
6490bdc
fix lint
teneeto Mar 14, 2024
03a3c76
add qbo round icon
teneeto Mar 14, 2024
8b24bb5
export qbo round icon
teneeto Mar 14, 2024
683af46
use qbo round icon
teneeto Mar 14, 2024
1b377df
connection list item should not be interactive
teneeto Mar 14, 2024
3576204
add default Avatar size for menu item icons
teneeto Mar 14, 2024
4bb0dab
add xero round icon
teneeto Mar 14, 2024
cdb0a00
export xero round icon
teneeto Mar 14, 2024
89759ea
add xero english strings
teneeto Mar 14, 2024
1e3be49
add xero spanish strings
teneeto Mar 14, 2024
0b0be1b
use xero round icon
teneeto Mar 14, 2024
a070d1d
fix lint
teneeto Mar 14, 2024
919fb8d
add more english and spanish strings
teneeto Mar 14, 2024
ff4c890
add menu options to setup QBO
teneeto Mar 14, 2024
dd57fd6
add more english and spanish strings
teneeto Mar 14, 2024
3937f69
break up qboConnectionMenuItems
teneeto Mar 14, 2024
e9cc581
add threeDotsMenu
teneeto Mar 14, 2024
6f368ac
cleanup and add more menu options
teneeto Mar 14, 2024
6b51aa0
add more english and spanish strings
teneeto Mar 14, 2024
bdd33e3
add disconnect integration confirm modal
teneeto Mar 14, 2024
1ef2bb1
add more english and spanish strings
teneeto Mar 14, 2024
21e9323
add activity indiccator while importing
teneeto Mar 14, 2024
f6d656a
update accounting navigation
teneeto Mar 14, 2024
b908d1d
update integration icons structure
teneeto Mar 14, 2024
98530c3
add more english and spanish strings
teneeto Mar 15, 2024
9d29a4e
add iconRight props to PopoverMenu
teneeto Mar 15, 2024
b139d28
add three-line bar to Header
teneeto Mar 15, 2024
17faa54
merge conflict
teneeto Mar 15, 2024
f213517
add temp. fake qbo connection sync
teneeto Mar 15, 2024
85b168d
revert accounting navigation
teneeto Mar 15, 2024
aeb72c6
fix lint
teneeto Mar 15, 2024
c275788
fix dep warning
teneeto Mar 15, 2024
9fe235d
Merge branch 'main' into feat/37706/implement-accounting-page
narefyev91 Mar 20, 2024
961221e
resolve comments
narefyev91 Mar 20, 2024
c0ab3eb
fix lint
narefyev91 Mar 20, 2024
916e7a2
Merge branch 'main' of github.com:teneeto/Expensify into feat/37706/i…
teneeto Mar 21, 2024
9ae94cb
Merge branch 'feat/37706/implement-accounting-page' of github.com:ten…
teneeto Mar 21, 2024
ee6f957
fix review comments
teneeto Mar 21, 2024
a2167a6
resolve more comments
teneeto Mar 21, 2024
a6385a0
add key to other integrations
teneeto Mar 22, 2024
b6ecfe6
remove shouldOverlay prop
teneeto Mar 22, 2024
2ee9b3a
fix menuItem blank title on mobile
teneeto Mar 22, 2024
0e0cfc4
fix blank avatar icon on mobile
teneeto Mar 22, 2024
f4a79b1
fix lint
teneeto Mar 22, 2024
1e2f9f4
fix menuItem large screens wwrapping
teneeto Mar 22, 2024
cb98220
add threeDotsMenu to qboMenuItems
teneeto Mar 22, 2024
63e4053
fix lint
teneeto Mar 22, 2024
5fff74a
add onPress to pressable items
teneeto Mar 22, 2024
7a3d215
Merge branch 'main' of github.com:teneeto/Expensify into feat/37706/i…
teneeto Mar 25, 2024
8a99577
Merge branch 'main' of github.com:teneeto/Expensify into feat/37706/i…
teneeto Apr 2, 2024
ddceefa
add accounting to workspace settings stack navigator
teneeto Apr 2, 2024
82fcadf
remove disabled connection for Xero
teneeto Apr 2, 2024
4214307
add square icons for xero and qbo
teneeto Apr 2, 2024
9330471
export square icons for xero and qbo
teneeto Apr 2, 2024
7a7907a
use square icon for qbo options
teneeto Apr 2, 2024
9efcee5
threeDotsMenuItems should br renamed to overflowMenu
teneeto Apr 2, 2024
f18d9d0
remove styles.pl2
teneeto Apr 2, 2024
53e625e
add top margin to other integrations menu item
teneeto Apr 2, 2024
57b636d
fix lint
teneeto Apr 2, 2024
2eb02a7
Merge branch 'main' of github.com:teneeto/Expensify into feat/37706/i…
teneeto Apr 3, 2024
32fe9aa
remove xero and qbo round icons
teneeto Apr 3, 2024
ada272e
remove xero and qbo exports
teneeto Apr 3, 2024
0045693
use permissions for accounting routes
teneeto Apr 3, 2024
cdc533b
remove permissions for accounting routes
teneeto Apr 3, 2024
847e61c
add hasAccessToAccountingFeatures
teneeto Apr 3, 2024
57bc34d
use hasAccessToAccountingFeatures and FullPageNotFoundView
teneeto Apr 3, 2024
55cc8ab
add sync progress data
teneeto Apr 3, 2024
f85f652
add policy connection sync data types
teneeto Apr 3, 2024
b31bc36
export PolicyConnectionSyncProgress
teneeto Apr 3, 2024
69ed02c
map PolicyConnectionSyncProgress in onyx collections
teneeto Apr 3, 2024
125ff9d
add QuickBooksOnline connection lib
teneeto Apr 4, 2024
ce7fd8a
add QuickBooksOnline connection button
teneeto Apr 4, 2024
c4bd689
use qbo connection button
teneeto Apr 4, 2024
91fa03c
fix lint
teneeto Apr 4, 2024
bfbc944
remove hasAccessToAccountingFeatures
teneeto Apr 4, 2024
501485d
fix review comments
teneeto Apr 4, 2024
51fb585
remove fake url
teneeto Apr 4, 2024
7c41337
pass in environmentURL
teneeto Apr 4, 2024
5c063f7
update accounting spanish translations
teneeto Apr 4, 2024
5d2bf13
update accounting translations
teneeto Apr 4, 2024
8b439a3
add PolicyConnectionSyncStage types
teneeto Apr 4, 2024
12077e9
use new PolicyConnectionSyncStage translation
teneeto Apr 4, 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
14 changes: 14 additions & 0 deletions assets/images/integrationicons/qbo-icon-square.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions assets/images/integrationicons/xero-icon-square.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,28 @@ const CONST = {
AUTOREPORTING_OFFSET: 'autoReportingOffset',
GENERAL_SETTINGS: 'generalSettings',
},
CONNECTIONS: {
SYNC_STATUS: {
STARTING: 'starting',
FINISHED: 'finished',
PROGRESS: 'progress',
},
NAME: {
// Here we will add other connections names when we add support for them
QBO: 'quickbooksOnline',
},
SYNC_STAGE_NAME: {
STARTING_IMPORT: 'startingImport',
QBO_CUSTOMERS: 'quickbooksOnlineImportCustomers',
QBO_EMPLOYEES: 'quickbooksOnlineImportEmployees',
QBO_ACCOUNTS: 'quickbooksOnlineImportAccounts',
QBO_CLASSES: 'quickbooksOnlineImportClasses',
QBO_LOCATIONS: 'quickbooksOnlineImportLocations',
QBO_PROCESSING: 'quickbooksOnlineImportProcessing',
QBO_PAYMENTS: 'quickbooksOnlineSyncBillPayments',
QBO_TAX_CODES: 'quickbooksOnlineSyncTaxCodes',
},
},
},

CUSTOM_UNITS: {
Expand Down
3 changes: 3 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ const ONYXKEYS = {

/** This is deprecated, but needed for a migration, so we still need to include it here so that it will be initialized in Onyx.init */
DEPRECATED_POLICY_MEMBER_LIST: 'policyMemberList_',

POLICY_CONNECTION_SYNC_PROGRESS: 'policyConnectionSyncProgress_',
},

/** List of Form ids */
Expand Down Expand Up @@ -539,6 +541,7 @@ type OnyxCollectionValuesMapping = {
[ONYXKEYS.COLLECTION.PRIVATE_NOTES_DRAFT]: string;
[ONYXKEYS.COLLECTION.NEXT_STEP]: OnyxTypes.ReportNextStep;
[ONYXKEYS.COLLECTION.POLICY_JOIN_MEMBER]: OnyxTypes.PolicyJoinMember;
[ONYXKEYS.COLLECTION.POLICY_CONNECTION_SYNC_PROGRESS]: OnyxTypes.PolicyConnectionSyncProgress;
};

type OnyxValuesMapping = {
Expand Down
4 changes: 4 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@ const ROUTES = {
route: 'settings/workspaces/:policyID/members',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/members` as const,
},
WORKSPACE_ACCOUNTING: {
route: 'settings/workspaces/:policyID/accounting',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting` as const,
},
WORKSPACE_CATEGORIES: {
route: 'settings/workspaces/:policyID/categories',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/categories` 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 @@ -208,6 +208,7 @@ const SCREENS = {
INVOICES: 'Workspace_Invoices',
TRAVEL: 'Workspace_Travel',
MEMBERS: 'Workspace_Members',
ACCOUNTING: 'Workspace_Accounting',
INVITE: 'Workspace_Invite',
INVITE_MESSAGE: 'Workspace_Invite_Message',
CATEGORIES: 'Workspace_Categories',
Expand Down
3 changes: 2 additions & 1 deletion src/components/HeaderWithBackButton/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {ReactNode} from 'react';
import type {StyleProp, ViewStyle} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import type {PopoverMenuItem} from '@components/PopoverMenu';
import type {Action} from '@hooks/useSingleExecution';
import type {StepCounterParams} from '@src/languages/types';
import type {AnchorPosition} from '@src/styles';
Expand Down Expand Up @@ -74,7 +75,7 @@ type HeaderWithBackButtonProps = Partial<ChildrenProps> & {
shouldSetModalVisibility?: boolean;

/** List of menu items for more(three dots) menu */
threeDotsMenuItems?: ThreeDotsMenuItem[];
teneeto marked this conversation as resolved.
Show resolved Hide resolved
threeDotsMenuItems?: PopoverMenuItem[];

/** The anchor position of the menu */
threeDotsAnchorPosition?: AnchorPosition;
Expand Down
4 changes: 4 additions & 0 deletions src/components/Icon/Expensicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ import Hourglass from '@assets/images/hourglass.svg';
import ImageCropCircleMask from '@assets/images/image-crop-circle-mask.svg';
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 Invoice from '@assets/images/invoice.svg';
import Key from '@assets/images/key.svg';
import Keyboard from '@assets/images/keyboard.svg';
Expand Down Expand Up @@ -280,6 +282,7 @@ export {
Plus,
Printer,
Profile,
QBOSquare,
QrCode,
QuestionMark,
Receipt,
Expand Down Expand Up @@ -308,6 +311,7 @@ export {
Wallet,
Workflows,
Workspace,
XeroSquare,
Zoom,
Twitter,
Youtube,
Expand Down
1 change: 1 addition & 0 deletions src/components/PopoverMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ function PopoverMenu({
focused={focusedIndex === menuIndex}
displayInDefaultIconColor={item.displayInDefaultIconColor}
shouldShowRightIcon={item.shouldShowRightIcon}
iconRight={item.iconRight}
shouldPutLeftPaddingWhenNoIcon={item.shouldPutLeftPaddingWhenNoIcon}
label={item.label}
isLabelHoverable={item.isLabelHoverable}
Expand Down
42 changes: 1 addition & 41 deletions src/components/ThreeDotsMenu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React, {useEffect, useRef, useState} from 'react';
import type {StyleProp, ViewStyle} from 'react-native';
import {View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import {withOnyx} from 'react-native-onyx';
import Icon from '@components/Icon';
import * as Expensicons from '@components/Icon/Expensicons';
import type {PopoverMenuItem} from '@components/PopoverMenu';
import PopoverMenu from '@components/PopoverMenu';
import PressableWithoutFeedback from '@components/Pressable/PressableWithoutFeedback';
import Tooltip from '@components/Tooltip/PopoverAnchorTooltip';
Expand All @@ -14,53 +12,15 @@ import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import * as Browser from '@libs/Browser';
import CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import ONYXKEYS from '@src/ONYXKEYS';
import type {AnchorPosition} from '@src/styles';
import type {Modal} from '@src/types/onyx';
import type AnchorAlignment from '@src/types/utils/AnchorAlignment';
import type IconAsset from '@src/types/utils/IconAsset';
import type ThreeDotsMenuProps from './types';

type ThreeDotsMenuOnyxProps = {
/** Details about any modals being used */
modal: OnyxEntry<Modal>;
};

type ThreeDotsMenuProps = ThreeDotsMenuOnyxProps & {
/** Tooltip for the popup icon */
iconTooltip?: TranslationPaths;

/** icon for the popup trigger */
icon?: IconAsset;

/** Any additional styles to pass to the icon container. */
iconStyles?: StyleProp<ViewStyle>;

/** The fill color to pass into the icon. */
iconFill?: string;

/** Function to call on icon press */
onIconPress?: () => void;

/** menuItems that'll show up on toggle of the popup menu */
menuItems: PopoverMenuItem[];

/** The anchor position of the menu */
anchorPosition: AnchorPosition;

/** The anchor alignment of the menu */
anchorAlignment?: AnchorAlignment;

/** Whether the popover menu should overlay the current view */
shouldOverlay?: boolean;

/** Whether the menu is disabled */
disabled?: boolean;

/** Should we announce the Modal visibility changes? */
shouldSetModalVisibility?: boolean;
};

function ThreeDotsMenu({
iconTooltip = 'common.more',
icon = Expensicons.ThreeDots,
Expand Down
50 changes: 50 additions & 0 deletions src/components/ThreeDotsMenu/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import type {StyleProp, ViewStyle} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import type {PopoverMenuItem} from '@components/PopoverMenu';
import type {TranslationPaths} from '@src/languages/types';
import type {AnchorPosition} from '@src/styles';
import type {Modal} from '@src/types/onyx';
import type AnchorAlignment from '@src/types/utils/AnchorAlignment';
import type IconAsset from '@src/types/utils/IconAsset';

type ThreeDotsMenuOnyxProps = {
/** Details about any modals being used */
modal: OnyxEntry<Modal>;
};

type ThreeDotsMenuProps = ThreeDotsMenuOnyxProps & {
/** Tooltip for the popup icon */
iconTooltip?: TranslationPaths;

/** icon for the popup trigger */
icon?: IconAsset;

/** Any additional styles to pass to the icon container. */
iconStyles?: StyleProp<ViewStyle>;

/** The fill color to pass into the icon. */
iconFill?: string;

/** Function to call on icon press */
onIconPress?: () => void;

/** menuItems that'll show up on toggle of the popup menu */
menuItems: PopoverMenuItem[];

/** The anchor position of the menu */
anchorPosition: AnchorPosition;

/** The anchor alignment of the menu */
anchorAlignment?: AnchorAlignment;

/** Whether the popover menu should overlay the current view */
shouldOverlay?: boolean;

/** Whether the menu is disabled */
disabled?: boolean;

/** Should we announce the Modal visibility changes? */
shouldSetModalVisibility?: boolean;
};

export default ThreeDotsMenuProps;
37 changes: 37 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import type {
PayerPaidAmountParams,
PayerPaidParams,
PayerSettledParams,
PolicyConnectionSyncStageParams,
RemovedTheRequestParams,
RenamedRoomActionParams,
ReportArchiveReasonsClosedParams,
Expand Down Expand Up @@ -1794,6 +1795,7 @@ export default {
invoices: 'Invoices',
travel: 'Travel',
members: 'Members',
accounting: 'Accounting',
plan: 'Plan',
profile: 'Profile',
bankAccount: 'Bank account',
Expand Down Expand Up @@ -2014,6 +2016,41 @@ export default {
invalidRateError: 'Please enter a valid rate',
lowRateError: 'Rate must be greater than 0',
},
accounting: {
title: 'Connections',
subtitle: 'Connect to your accounting system to code transactions with your chart of accounts, auto-match payments and keep your finances in sync.',
qbo: 'Quickbooks Online',
xero: 'Xero',
setup: 'Set up',
lastSync: 'Last synced just now',
import: 'Import',
export: 'Export',
advanced: 'Advanced',
other: 'Other integrations',
syncNow: 'Sync now',
disconnect: 'Disconnect',
disconnectTitle: 'Disconnect integration',
disconnectPrompt: 'Are you sure you want to disconnect this integration?',
enterCredentials: 'Enter your credentials',
connections: {
syncStageName: ({stage}: PolicyConnectionSyncStageParams) => {
switch (stage) {
case 'quickbooksOnlineImportCustomers':
return 'Importing customers';
case 'quickbooksOnlineImportEmployees':
return 'Importing employees';
case 'quickbooksOnlineImportAccounts':
return 'Importing accounts';
case 'quickbooksOnlineImportClasses':
return 'Importing classes';

default: {
return `Translation missing for stage: ${stage}`;
}
}
},
},
},
bills: {
manageYourBills: 'Manage your bills',
askYourVendorsBeforeEmail: 'Ask your vendors to forward their invoices to ',
Expand Down
37 changes: 37 additions & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import type {
PayerPaidAmountParams,
PayerPaidParams,
PayerSettledParams,
PolicyConnectionSyncStageParams,
RemovedTheRequestParams,
RenamedRoomActionParams,
ReportArchiveReasonsClosedParams,
Expand Down Expand Up @@ -1821,6 +1822,7 @@ export default {
invoices: 'Enviar facturas',
travel: 'Viajes',
members: 'Miembros',
accounting: 'Contabilidad',
plan: 'Plan',
profile: 'Perfil',
bankAccount: 'Cuenta bancaria',
Expand Down Expand Up @@ -2009,6 +2011,41 @@ export default {
invitedBySecondaryLogin: ({secondaryLogin}) => `Agregado por nombre de usuario secundario ${secondaryLogin}.`,
membersListTitle: 'Directorio de todos los miembros del espacio de trabajo.',
},
accounting: {
teneeto marked this conversation as resolved.
Show resolved Hide resolved
title: 'Conexiones',
subtitle: 'Conecta a tu sistema de contabilidad para codificar transacciones con tu plan de cuentas, auto-cotejar pagos y mantener tus finanzas sincronizadas.',
qbo: 'Quickbooks Online',
xero: 'Xero',
setup: 'Configurar',
lastSync: 'Recién sincronizado',
import: 'Importar',
export: 'Exportar',
advanced: 'Avanzado',
other: 'Otras integraciones',
syncNow: 'Sincronizar ahora',
disconnect: 'Desconectar',
disconnectTitle: 'Desconectar integración',
disconnectPrompt: '¿Estás seguro de que deseas desconectar esta intregración?',
enterCredentials: 'Ingresa tus credenciales',
connections: {
syncStageName: ({stage}: PolicyConnectionSyncStageParams) => {
switch (stage) {
case 'quickbooksOnlineImportCustomers':
return 'Importando clientes';
case 'quickbooksOnlineImportEmployees':
return 'Importing employees';
case 'quickbooksOnlineImportAccounts':
return 'Importing accounts';
case 'quickbooksOnlineImportClasses':
return 'Importing classes';

default: {
return `Translation missing for stage: ${stage}`;
}
}
},
},
},
card: {
header: 'Desbloquea Tarjetas Expensify gratis',
headerWithEcard: '¡Tus tarjetas están listas!',
Expand Down
Loading
Loading