Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions assets/images/integrationicons/campfire-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.
104 changes: 103 additions & 1 deletion src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ const CONST = {
BILLCOM: 'Bill.com',
ZENEFITS: 'Zenefits',
DUALENTRY: 'DualEntry',
CAMPFIRE: 'Campfire',
},

REVERSED_TRANSACTION_ATTRIBUTE: 'is-reversed-transaction',
Expand Down Expand Up @@ -1058,6 +1059,7 @@ const CONST = {
BULK_SUBMIT_APPROVE_PAY: 'bulkSubmitApprovePay',
VENDOR_MATCHING: 'vendorMatching',
DUALENTRY: 'dualEntry',
CAMPFIRE: 'campfire',
BUSINESS_CENTRAL: 'businessCentral',
RULES_REVAMP: 'rulesRevamp',
COMMUTER_EXCLUSIONS: 'commuterExclusions',
Expand Down Expand Up @@ -3755,6 +3757,68 @@ const CONST = {
OTHER_CURRENT_LIABILITY: 'other_current_liability',
},

CAMPFIRE_CONFIG: {
SUBSIDIARY_ID: 'subsidiaryID',
ENABLE_NEW_CATEGORIES: 'enableNewCategories',
SYNC_TAX_RATES: 'syncTaxRates',
EXPORTER: 'exporter',
EXPORT_DATE: 'exportDate',
REIMBURSABLE: 'reimbursable',
NON_REIMBURSABLE: 'nonReimbursable',
CREDIT_CARD_ACCOUNT_ID: 'creditCardAccountID',
EXPORT_TO_MULTIPLE_ACCOUNTS: 'exportToMultipleAccounts',
DEFAULT_VENDORID: 'defaultVendorID',
TRAVEL_BILLING_PAYABLE_ACCOUNT_ID: 'travelInvoicingPayableAccountID',
ACCOUNTING_METHOD: 'accountingMethod',
AUTO_SYNC: 'autoSync',
SYNC_REIMBURSED_REPORTS: 'syncReimbursedReports',
BILL_PAYMENT_ACCOUNT_ID: 'billPaymentAccountID',
SYNC_EXPENSIFY_CARD_SETTLEMENTS: 'syncExpensifyCardSettlements',
SETTLEMENTS_BANK_ACCOUNT_ID: 'settlementsBankAccountID',
SYNC_TRAVEL_BILLING_SETTLEMENTS: 'syncTravelInvoicingSettlements',
TRAVEL_BILLING_SETTLEMENTS_BANK_ACCOUNT_ID: 'travelInvoicingSettlementsBankAccountID',
FIELD_MAPPING_PREFIX: 'fieldMapping_',
CARD_PROGRAM_ACCOUNT_PREFIX: 'cardProgramAccount_',
},

CAMPFIRE_MAPPING_VALUE: {
NONE: 'NONE',
TAG: 'TAG',
},

CAMPFIRE_EXPORT_REIMBURSABLE: {
VENDOR_BILL: 'VENDOR_BILL',
},

CAMPFIRE_EXPORT_NON_REIMBURSABLE: {
JOURNAL_ENTRY: 'JOURNAL_ENTRY',
},

CAMPFIRE_EXPORT_DATE: {
LAST_EXPENSE: 'LAST_EXPENSE',
REPORT_EXPORTED: 'REPORT_EXPORTED',
REPORT_SUBMITTED: 'REPORT_SUBMITTED',
},

CAMPFIRE_ACCOUNT_TYPE: {
OPERATING_EXPENSES: 'OPERATING_EXPENSES',
LIABILITY: 'LIABILITY',
ASSET: 'ASSET',
},

CAMPFIRE_ACCOUNT_SUBTYPE: {
EXPENSE: 'EXPENSE',
LONG_TERM_LIABILITY: 'LONG_TERM_LIABILITY',
CREDIT_CARD: 'CREDIT_CARD',
BANK: 'BANK',
},

CAMPFIRE_VENDOR_TYPE: {
VENDOR: 'vendor',
CUSTOMER: 'customer',
EMPLOYEE: 'employee',
},

UPDATE_PERSONAL_BANK_ACCOUNT: {
PAGE_NAME: {
LEGAL_NAME: 'legal-name',
Expand Down Expand Up @@ -4514,6 +4578,7 @@ const CONST = {
CERTINIA: 'financialforce',
RILLET: 'rillet',
DUALENTRY: 'dualEntry',
CAMPFIRE: 'campfire',
GUSTO: 'gusto',
ZENEFITS: 'zenefits',
MERGE_HR: 'merge_hris',
Expand All @@ -4532,6 +4597,7 @@ const CONST = {
CERTINIA: 'certinia',
RILLET: 'rillet',
DUALENTRY: 'dualentry',
CAMPFIRE: 'campfire',
GUSTO: 'gusto',
ZENEFITS: 'zenefits',
MERGE_HR: 'merge-hr',
Expand All @@ -4546,6 +4612,7 @@ const CONST = {
financialforce: 'Certinia',
rillet: 'Rillet',
dualEntry: 'DualEntry',
campfire: 'Campfire',
gusto: 'Gusto',
billCom: 'Bill.com',
zenefits: 'TriNet',
Expand All @@ -4557,7 +4624,17 @@ const CONST = {
other: 'Other',
},
get ACCOUNTING_CONNECTION_NAMES() {
return [this.NAME.QBO, this.NAME.QBD, this.NAME.XERO, this.NAME.NETSUITE, this.NAME.SAGE_INTACCT, this.NAME.CERTINIA, this.NAME.RILLET, this.NAME.DUALENTRY] as const;
return [
this.NAME.QBO,
this.NAME.QBD,
this.NAME.XERO,
this.NAME.NETSUITE,
this.NAME.SAGE_INTACCT,
this.NAME.CERTINIA,
this.NAME.RILLET,
this.NAME.DUALENTRY,
this.NAME.CAMPFIRE,
] as const;
},
// The `origin` the backend stamps on a report field imported by an accounting integration. These values
// differ from the connection names above (e.g. `quickbooksOnline` is stamped as `qbo`), so map them here.
Expand All @@ -4571,6 +4648,7 @@ const CONST = {
[this.NAME.CERTINIA]: 'financialforce',
[this.NAME.RILLET]: 'rillet',
[this.NAME.DUALENTRY]: 'dualentry',
[this.NAME.CAMPFIRE]: 'campfire',
} as const;
},
get HR_CONNECTION_NAMES() {
Expand Down Expand Up @@ -4683,6 +4761,12 @@ const CONST = {
DUALENTRY_SYNC_PAYMENTS: 'dualEntrySyncPayments',
DUALENTRY_SYNC_CARD_SETTLEMENTS: 'dualEntrySyncCardSettlements',
DUALENTRY_SYNC_TRAVEL_SETTLEMENTS: 'dualEntrySyncTravelSettlements',
CAMPFIRE_SYNC_TITLE: 'campfireSyncTitle',
CAMPFIRE_SYNC_CONNECTION: 'campfireSyncConnection',
CAMPFIRE_SYNC_IMPORT_DATA: 'campfireSyncImportData',
CAMPFIRE_SYNC_PAYMENTS: 'campfireSyncPayments',
CAMPFIRE_SYNC_CARD_SETTLEMENTS: 'campfireSyncCardSettlements',
CAMPFIRE_SYNC_TRAVEL_SETTLEMENTS: 'campfireSyncTravelSettlements',
},
SYNC_STAGE_TIMEOUT_MINUTES: 20,
},
Expand Down Expand Up @@ -5165,6 +5249,11 @@ const CONST = {
* Name of Card NVP for DualEntry custom export accounts
*/
NVP_DUALENTRY_EXPORT_ACCOUNT: 'dualentry_export_account',

/**
* Name of Card NVP for Campfire custom export accounts
*/
NVP_CAMPFIRE_EXPORT_ACCOUNT: 'campfire_export_account',
},
EXPORT_CARD_POLICY_TYPES: {
/**
Expand Down Expand Up @@ -5217,6 +5306,11 @@ const CONST = {
* Name of Card NVP for DualEntry custom export accounts
*/
NVP_DUALENTRY_EXPORT_ACCOUNT_POLICY_ID: 'dualentry_export_account_policy_id',

/**
* Name of Card NVP for Campfire custom export accounts
*/
NVP_CAMPFIRE_EXPORT_ACCOUNT_POLICY_ID: 'campfire_export_account_policy_id',
},
},
AVATAR_ROW_SIZE: {
Expand Down Expand Up @@ -8078,6 +8172,14 @@ const CONST = {
description: `workspace.upgrade.${this.POLICY.CONNECTIONS.NAME.DUALENTRY}.description` as const,
icon: 'DualEntrySquare',
},
[this.POLICY.CONNECTIONS.NAME.CAMPFIRE]: {
id: this.POLICY.CONNECTIONS.NAME.CAMPFIRE,
alias: 'campfire',
name: this.POLICY.CONNECTIONS.NAME_USER_FRIENDLY.campfire,
title: `workspace.upgrade.${this.POLICY.CONNECTIONS.NAME.CAMPFIRE}.title` as const,
description: `workspace.upgrade.${this.POLICY.CONNECTIONS.NAME.CAMPFIRE}.description` as const,
icon: 'CampfireSquare',
},
approvals: {
id: 'approvals' as const,
alias: 'approvals' as const,
Expand Down
3 changes: 3 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,8 @@ const ONYXKEYS = {
RILLET_CREDENTIALS_FORM_DRAFT: 'rilletCredentialsFormDraft',
DUALENTRY_CREDENTIALS_FORM: 'dualEntryCredentialsForm',
DUALENTRY_CREDENTIALS_FORM_DRAFT: 'dualEntryCredentialsFormDraft',
CAMPFIRE_CREDENTIALS_FORM: 'campfireCredentialsForm',
CAMPFIRE_CREDENTIALS_FORM_DRAFT: 'campfireCredentialsFormDraft',
},
DERIVED: {
REPORT_ATTRIBUTES: 'reportAttributes',
Expand Down Expand Up @@ -1475,6 +1477,7 @@ type OnyxFormValuesMapping = {
[ONYXKEYS.FORMS.EDIT_AGENT_RULE_FORM]: FormTypes.EditAgentRuleForm;
[ONYXKEYS.FORMS.RILLET_CREDENTIALS_FORM]: FormTypes.RilletCredentialsForm;
[ONYXKEYS.FORMS.DUALENTRY_CREDENTIALS_FORM]: FormTypes.DualEntryCredentialsForm;
[ONYXKEYS.FORMS.CAMPFIRE_CREDENTIALS_FORM]: FormTypes.CampfireCredentialsForm;
};

type OnyxFormDraftValuesMapping = {
Expand Down
12 changes: 12 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4775,6 +4775,18 @@ const ROUTES = {
route: 'workspaces/:policyID/accounting/dualentry/advanced/travel-invoicing-payable-account',
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/dualentry/advanced/travel-invoicing-payable-account` as const,
},
POLICY_ACCOUNTING_CAMPFIRE_SETUP: {
route: 'workspaces/:policyID/accounting/campfire/setup',
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/campfire/setup` as const,
},
POLICY_ACCOUNTING_CAMPFIRE_EXISTING_CONNECTIONS: {
route: 'workspaces/:policyID/accounting/campfire/existing-connections',
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/campfire/existing-connections` as const,
},
POLICY_ACCOUNTING_CAMPFIRE_SUBSIDIARY_SELECTOR: {
route: 'workspaces/:policyID/accounting/campfire/subsidiary-selector',
getRoute: (policyID: string) => `workspaces/${policyID}/accounting/campfire/subsidiary-selector` as const,
},
ADD_EXISTING_EXPENSE: {
route: 'search/r/:reportID/add-existing-expense/:backToReport?',
getRoute: (reportID: string | undefined, backToReport?: string) => `search/r/${reportID}/add-existing-expense/${backToReport ?? ''}` as const,
Expand Down
3 changes: 3 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,9 @@ const SCREENS = {
DUALENTRY_EXPENSIFY_CARD_SETTLEMENT_ACCOUNT: 'Policy_Accounting_DualEntry_Expensify_Card_Settlement_Account',
DUALENTRY_TRAVEL_BILLING_SETTLEMENT_ACCOUNT: 'Policy_Accounting_DualEntry_Travel_Invoicing_Settlement_Account',
DUALENTRY_TRAVEL_BILLING_PAYABLE_ACCOUNT: 'Policy_Accounting_DualEntry_Travel_Invoicing_Payable_Account',
CAMPFIRE_SETUP: 'Policy_Accounting_Campfire_Setup',
CAMPFIRE_EXISTING_CONNECTIONS: 'Policy_Accounting_Campfire_Existing_Connections',
CAMPFIRE_SUBSIDIARY_SELECTOR: 'Policy_Accounting_Campfire_Subsidiary_Selector',
CARD_RECONCILIATION: 'Policy_Accounting_Card_Reconciliation',
CARD_RECONCILIATION_SAGE_INTACCT_AUTO_SYNC: 'Policy_Accounting_Card_Reconciliation_Sage_Intacct_Auto_Sync',
DYNAMIC_RECONCILIATION_ACCOUNT_SETTINGS: 'Dynamic_Policy_Accounting_Reconciliation_Account_Settings',
Expand Down
30 changes: 30 additions & 0 deletions src/components/ConnectToCampfireFlow/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import useHasReusablePoliciesConnectedTo from '@hooks/useHasReusablePoliciesConnectedTo';

import Navigation from '@libs/Navigation/Navigation';

import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';

import {useEffect} from 'react';

type ConnectToCampfireFlowProps = {
policyID: string;
};

function ConnectToCampfireFlow({policyID}: ConnectToCampfireFlowProps) {
const hasReusablePoliciesConnectedToCampfire = useHasReusablePoliciesConnectedTo(CONST.POLICY.CONNECTIONS.NAME.CAMPFIRE, policyID);

useEffect(() => {
if (hasReusablePoliciesConnectedToCampfire) {
Navigation.navigate(ROUTES.POLICY_ACCOUNTING_CAMPFIRE_EXISTING_CONNECTIONS.getRoute(policyID));
return;
}
Navigation.navigate(ROUTES.POLICY_ACCOUNTING_CAMPFIRE_SETUP.getRoute(policyID));
// This needs to run once as we will navigate away
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

return null;
}

export default ConnectToCampfireFlow;
2 changes: 2 additions & 0 deletions src/components/Icon/chunks/expensify-icons.chunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ import ImageCropSquareMask from '@assets/images/image-crop-square-mask.svg';
import Inbox from '@assets/images/inbox.svg';
import Info from '@assets/images/info.svg';
import BillComSquare from '@assets/images/integrationicons/bill-com-icon-square.svg';
import CampfireSquare from '@assets/images/integrationicons/campfire-icon-square.svg';
import CertiniaSquare from '@assets/images/integrationicons/certinia-icon-square.svg';
import CircleSlash from '@assets/images/integrationicons/circle-slash.svg';
import DualEntrySquare from '@assets/images/integrationicons/dualentry-icon-square.svg';
Expand Down Expand Up @@ -589,6 +590,7 @@ const Expensicons = {
TreasureChestGreenWithSparkle,
UserShield,
Compass,
CampfireSquare,
};

// Create the ExpensifyIcons object from the imported Expensicons
Expand Down
1 change: 1 addition & 0 deletions src/components/ImportedFromAccountingSoftware.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function ImportedFromAccountingSoftware({policyID, currentConnectionName, transl
'CertiniaSquare',
'RilletSquare',
'DualEntrySquare',
'CampfireSquare',
'GustoSquare',
]);
const icon = getIntegrationIcon(connectedIntegration, expensifyIcons, policy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function ExportWithDropdownMenu({
'CertiniaSquare',
'RilletSquare',
'DualEntrySquare',
'CampfireSquare',
'GustoSquare',
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function ExportedToSelector({value = [], policyID, selectionListTextInputStyle,
'CertiniaSquare',
'RilletSquare',
'DualEntrySquare',
'CampfireSquare',
'GustoSquare',
'Table',
'TablePencil',
Expand Down
10 changes: 10 additions & 0 deletions src/components/Search/SearchList/ListItem/ExportedIconCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function ExportedIconCell({reportActions}: ExportedIconCellProps) {
'CertiniaSquare',
'RilletSquare',
'DualEntrySquare',
'CampfireSquare',
]);

let isExportedToStandardTemplate = false;
Expand All @@ -50,6 +51,7 @@ function ExportedIconCell({reportActions}: ExportedIconCellProps) {
let isExportedToCertinia = false;
let isExportedToRillet = false;
let isExportedToDualEntry = false;
let isExportedToCampfire = false;
let isExportedToBillCom = false;
let isExportedToZenefits = false;

Expand Down Expand Up @@ -81,6 +83,7 @@ function ExportedIconCell({reportActions}: ExportedIconCellProps) {
isExportedToCertinia = isExportedToCertinia || label === CONST.EXPORT_LABELS.CERTINIA;
isExportedToRillet = isExportedToRillet || label === CONST.EXPORT_LABELS.RILLET;
isExportedToDualEntry = isExportedToDualEntry || label === CONST.EXPORT_LABELS.DUALENTRY;
isExportedToCampfire = isExportedToCampfire || label === CONST.EXPORT_LABELS.CAMPFIRE;
isExportedToIntacct = isExportedToIntacct || label === CONST.EXPORT_LABELS.INTACCT || label === CONST.EXPORT_LABELS.SAGE_INTACCT;
}
}
Expand Down Expand Up @@ -159,6 +162,13 @@ function ExportedIconCell({reportActions}: ExportedIconCellProps) {
additionalStyles={[integrationIconStyle]}
/>
)}
{isExportedToCampfire && (
<Icon
src={icons.CampfireSquare}
size={CONST.ICON_SIZE.SMALL}
additionalStyles={[integrationIconStyle]}
/>
)}
{isExportedToBillCom && (
<Icon
src={icons.BillComSquare}
Expand Down
1 change: 1 addition & 0 deletions src/hooks/useExportActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function useExportActions({reportID, policy, onPDFModalOpen}: UseExportActionsPa
'CertiniaSquare',
'RilletSquare',
'DualEntrySquare',
'CampfireSquare',
'GustoSquare',
'ArrowRight',
]);
Expand Down
1 change: 1 addition & 0 deletions src/hooks/useSearchBulkActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ function useSearchBulkActions({queryJSON}: UseSearchBulkActionsParams) {
'CertiniaSquare',
'RilletSquare',
'DualEntrySquare',
'CampfireSquare',
'GustoSquare',
'Pencil',
'Workflows',
Expand Down
Loading
Loading