Skip to content

Commit

Permalink
Merge pull request #44166 from software-mansion-labs/@szymczak/sage-i…
Browse files Browse the repository at this point in the history
…ntacct-import-page

@szymczak/sage intacct import page
  • Loading branch information
yuwenmemon authored Jul 9, 2024
2 parents 04581f1 + acdcbf5 commit 932e657
Show file tree
Hide file tree
Showing 30 changed files with 1,473 additions and 57 deletions.
33 changes: 33 additions & 0 deletions assets/images/product-illustrations/folder-with-papers.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ const CONST = {
TRAVEL_TERMS_URL: `${USE_EXPENSIFY_URL}/travelterms`,
EXPENSIFY_PACKAGE_FOR_SAGE_INTACCT: 'https://www.expensify.com/tools/integrations/downloadPackage',
EXPENSIFY_PACKAGE_FOR_SAGE_INTACCT_FILE_NAME: 'ExpensifyPackageForSageIntacct',
SAGE_INTACCT_INSTRUCTIONS: 'https://help.expensify.com/articles/expensify-classic/integrations/accounting-integrations/Sage-Intacct',
HOW_TO_CONNECT_TO_SAGE_INTACCT: 'https://help.expensify.com/articles/expensify-classic/integrations/accounting-integrations/Sage-Intacct#how-to-connect-to-sage-intacct',
PRICING: `https://www.expensify.com/pricing`,

Expand Down Expand Up @@ -1345,7 +1346,23 @@ const CONST = {
},
},

SAGE_INTACCT_MAPPING_VALUE: {
NONE: 'NONE',
DEFAULT: 'DEFAULT',
TAG: 'TAG',
REPORT_FIELD: 'REPORT_FIELD',
},

SAGE_INTACCT_CONFIG: {
MAPPINGS: {
DEPARTMENTS: 'departments',
CLASSES: 'classes',
LOCATIONS: 'locations',
CUSTOMERS: 'customers',
PROJECTS: 'projects',
},
SYNC_ITEMS: 'syncItems',
TAX: 'tax',
EXPORT: 'export',
EXPORT_DATE: 'exportDate',
NON_REIMBURSABLE_CREDIT_CARD_VENDOR: 'nonReimbursableCreditCardChargeDefaultVendor',
Expand Down
3 changes: 3 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,8 @@ const ONYXKEYS = {
NETSUITE_TOKEN_INPUT_FORM_DRAFT: 'netsuiteTokenInputFormDraft',
NETSUITE_CUSTOM_FORM_ID_FORM: 'netsuiteCustomFormIDForm',
NETSUITE_CUSTOM_FORM_ID_FORM_DRAFT: 'netsuiteCustomFormIDFormDraft',
SAGE_INTACCT_DIMENSION_TYPE_FORM: 'sageIntacctDimensionTypeForm',
SAGE_INTACCT_DIMENSION_TYPE_FORM_DRAFT: 'sageIntacctDimensionTypeFormDraft',
},
} as const;

Expand Down Expand Up @@ -629,6 +631,7 @@ type OnyxFormValuesMapping = {
[ONYXKEYS.FORMS.SAGE_INTACCT_CREDENTIALS_FORM]: FormTypes.SageIntactCredentialsForm;
[ONYXKEYS.FORMS.NETSUITE_TOKEN_INPUT_FORM]: FormTypes.NetSuiteTokenInputForm;
[ONYXKEYS.FORMS.NETSUITE_CUSTOM_FORM_ID_FORM]: FormTypes.NetSuiteCustomFormIDForm;
[ONYXKEYS.FORMS.SAGE_INTACCT_DIMENSION_TYPE_FORM]: FormTypes.SageIntacctDimensionForm;
};

type OnyxFormDraftValuesMapping = {
Expand Down
25 changes: 25 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type CONST from './CONST';
import type {IOUAction, IOUType} from './CONST';
import type {IOURequestType} from './libs/actions/IOU';
import type {AuthScreensParamList} from './libs/Navigation/types';
import type {SageIntacctMappingName} from './types/onyx/Policy';
import type {SearchQuery} from './types/onyx/SearchResults';
import type AssertTypesNotEqual from './types/utils/AssertTypesNotEqual';

Expand Down Expand Up @@ -1121,6 +1122,30 @@ const ROUTES = {
route: 'settings/workspaces/:policyID/accounting/sage-intacct/existing-connections',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/sage-intacct/existing-connections` as const,
},
POLICY_ACCOUNTING_SAGE_INTACCT_IMPORT: {
route: 'settings/workspaces/:policyID/accounting/sage-intacct/import',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/sage-intacct/import` as const,
},
POLICY_ACCOUNTING_SAGE_INTACCT_TOGGLE_MAPPINGS: {
route: 'settings/workspaces/:policyID/accounting/sage-intacct/import/toggle-mapping/:mapping',
getRoute: (policyID: string, mapping: SageIntacctMappingName) => `settings/workspaces/${policyID}/accounting/sage-intacct/import/toggle-mapping/${mapping}` as const,
},
POLICY_ACCOUNTING_SAGE_INTACCT_MAPPINGS_TYPE: {
route: 'settings/workspaces/:policyID/accounting/sage-intacct/import/mapping-type/:mapping',
getRoute: (policyID: string, mapping: string) => `settings/workspaces/${policyID}/accounting/sage-intacct/import/mapping-type/${mapping}` as const,
},
POLICY_ACCOUNTING_SAGE_INTACCT_USER_DIMENSIONS: {
route: 'settings/workspaces/:policyID/accounting/sage-intacct/import/user-dimensions',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/sage-intacct/import/user-dimensions` as const,
},
POLICY_ACCOUNTING_SAGE_INTACCT_ADD_USER_DIMENSION: {
route: 'settings/workspaces/:policyID/accounting/sage-intacct/import/add-user-dimension',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/sage-intacct/import/add-user-dimension` as const,
},
POLICY_ACCOUNTING_SAGE_INTACCT_EDIT_USER_DIMENSION: {
route: 'settings/workspaces/:policyID/accounting/sage-intacct/import/edit-user-dimension/:dimensionName',
getRoute: (policyID: string, dimensionName: string) => `settings/workspaces/${policyID}/accounting/sage-intacct/import/edit-user-dimension/${dimensionName}` as const,
},
POLICY_ACCOUNTING_SAGE_INTACCT_EXPORT: {
route: 'settings/workspaces/:policyID/accounting/sage-intacct/export',
getRoute: (policyID: string) => `settings/workspaces/${policyID}/accounting/sage-intacct/export` as const,
Expand Down
6 changes: 6 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ const SCREENS = {
SAGE_INTACCT_PREREQUISITES: 'Policy_Accounting_Sage_Intacct_Prerequisites',
ENTER_SAGE_INTACCT_CREDENTIALS: 'Policy_Enter_Sage_Intacct_Credentials',
EXISTING_SAGE_INTACCT_CONNECTIONS: 'Policy_Existing_Sage_Intacct_Connections',
SAGE_INTACCT_IMPORT: 'Policy_Accounting_Sage_Intacct_Import',
SAGE_INTACCT_TOGGLE_MAPPING: 'Policy_Accounting_Sage_Intacct_Toggle_Mapping',
SAGE_INTACCT_MAPPING_TYPE: 'Policy_Accounting_Sage_Intacct_Mapping_Type',
SAGE_INTACCT_USER_DIMENSIONS: 'Policy_Accounting_Sage_Intacct_User_Dimensions',
SAGE_INTACCT_ADD_USER_DIMENSION: 'Policy_Accounting_Sage_Intacct_Add_User_Dimension',
SAGE_INTACCT_EDIT_USER_DIMENSION: 'Policy_Accounting_Sage_Intacct_Edit_User_Dimension',
SAGE_INTACCT_EXPORT: 'Policy_Accounting_Sage_Intacct_Export',
SAGE_INTACCT_PREFERRED_EXPORTER: 'Policy_Accounting_Sage_Intacct_Preferred_Exporter',
SAGE_INTACCT_EXPORT_DATE: 'Policy_Accounting_Sage_Intacct_Export_Date',
Expand Down
2 changes: 2 additions & 0 deletions src/components/Form/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import type TextInput from '@components/TextInput';
import type TextPicker from '@components/TextPicker';
import type ValuePicker from '@components/ValuePicker';
import type BusinessTypePicker from '@pages/ReimbursementAccount/BusinessInfo/substeps/TypeBusiness/BusinessTypePicker';
import type DimensionTypeSelector from '@pages/workspace/accounting/intacct/import/DimensionTypeSelector';
import type {Country} from '@src/CONST';
import type {OnyxFormKey, OnyxValues} from '@src/ONYXKEYS';
import type {BaseForm} from '@src/types/form/Form';
Expand All @@ -39,6 +40,7 @@ type ValidInputs =
| typeof CurrencySelector
| typeof AmountForm
| typeof BusinessTypePicker
| typeof DimensionTypeSelector
| typeof StateSelector
| typeof RoomNameInput
| typeof ValuePicker
Expand Down
2 changes: 2 additions & 0 deletions src/components/Icon/Illustrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ConciergeExclamation from '@assets/images/product-illustrations/concierge
import CreditCardsBlue from '@assets/images/product-illustrations/credit-cards--blue.svg';
import EmptyStateExpenses from '@assets/images/product-illustrations/emptystate__expenses.svg';
import EmptyStateTravel from '@assets/images/product-illustrations/emptystate__travel.svg';
import FolderWithPapers from '@assets/images/product-illustrations/folder-with-papers.svg';
import GpsTrackOrange from '@assets/images/product-illustrations/gps-track--orange.svg';
import Hands from '@assets/images/product-illustrations/home-illustration-hands.svg';
import InvoiceOrange from '@assets/images/product-illustrations/invoice--orange.svg';
Expand Down Expand Up @@ -197,5 +198,6 @@ export {
CheckmarkCircle,
CreditCardEyes,
LockClosedOrange,
FolderWithPapers,
VirtualCard,
};
42 changes: 41 additions & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {CONST as COMMON_CONST, Str} from 'expensify-common';
import {startCase} from 'lodash';
import CONST from '@src/CONST';
import type {Country} from '@src/CONST';
import type {ConnectionName, PolicyConnectionSyncStage} from '@src/types/onyx/Policy';
import type {ConnectionName, PolicyConnectionSyncStage, SageIntacctMappingName} from '@src/types/onyx/Policy';
import type {
AddressLineParams,
AdminCanceledRequestParams,
Expand Down Expand Up @@ -2005,6 +2005,7 @@ export default {
categories: 'Categories',
tags: 'Tags',
reportFields: 'Report fields',
reportField: 'Report field',
taxes: 'Taxes',
bills: 'Bills',
invoices: 'Invoices',
Expand Down Expand Up @@ -2037,6 +2038,9 @@ export default {
welcomeNote: ({workspaceName}: WelcomeNoteParams) =>
`You have been invited to ${workspaceName || 'a workspace'}! Download the Expensify mobile app at use.expensify.com/download to start tracking your expenses.`,
subscription: 'Subscription',
lineItemLevel: 'Line-item level',
reportLevel: 'Report level',
appliedOnExport: 'Not imported into Expensify, applied on export',
},
qbo: {
importDescription: 'Choose which coding configurations to import from QuickBooks Online to Expensify.',
Expand Down Expand Up @@ -2506,6 +2510,42 @@ export default {
reuseExistingConnection: 'Reuse existing connection',
existingConnections: 'Existing connections',
sageIntacctLastSync: (formattedDate: string) => `Sage Intacct - Last synced ${formattedDate}`,
employeeDefault: 'Sage Intacct employee default',
employeeDefaultDescription: "The employee's default department will be applied to their expenses in Sage Intacct if one exists.",
displayedAsTagDescription: "Department will be selectable for each individual expense on an employee's report.",
displayedAsReportFieldDescription: "Department selection will apply to all expenses on an employee's report.",
toggleImportTitleFirstPart: 'Choose how to handle Sage Intacct ',
toggleImportTitleSecondPart: ' in Expensify.',
expenseTypes: 'Expense types',
expenseTypesDescription: 'Sage Intacct expense types import into Expensify as categories.',
importTaxDescription: 'Import purchase tax rate from Sage Intacct.',
userDefinedDimensions: 'User-defined dimensions',
addUserDefinedDimension: 'Add user-defined dimension',
integrationName: 'Integration name',
dimensionExists: 'A dimension with this name already exists.',
removeDimension: 'Remove user-defined dimension',
removeDimensionPrompt: 'Are you sure you want to remove this user-defined dimension?',
userDefinedDimension: 'User-defined dimension',
addAUserDefinedDimension: 'Add a user-defined dimension',
detailedInstructionsLink: 'View detailed instructions',
detailedInstructionsRestOfSentence: ' on adding user-defined dimensions.',
userDimensionsAdded: (dimensionsCount: number) => `${dimensionsCount} ${Str.pluralize('UDD', `UDDs`, dimensionsCount)} added`,
mappingTitle: (mappingName: SageIntacctMappingName): string => {
switch (mappingName) {
case CONST.SAGE_INTACCT_CONFIG.MAPPINGS.DEPARTMENTS:
return 'departments';
case CONST.SAGE_INTACCT_CONFIG.MAPPINGS.CLASSES:
return 'classes';
case CONST.SAGE_INTACCT_CONFIG.MAPPINGS.LOCATIONS:
return 'locations';
case CONST.SAGE_INTACCT_CONFIG.MAPPINGS.CUSTOMERS:
return 'customers';
case CONST.SAGE_INTACCT_CONFIG.MAPPINGS.PROJECTS:
return 'projects (jobs)';
default:
return 'mappings';
}
},
},
type: {
free: 'Free',
Expand Down
Loading

0 comments on commit 932e657

Please sign in to comment.