Skip to content

Commit

Permalink
remove some TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhenjaHorbach committed Oct 7, 2024
1 parent bfc726e commit 29dbcc8
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function QuickbooksDesktopExportPage({policy}: WithPolicyConnectionsProps) {
const styles = useThemeStyles();
const policyID = policy?.id ?? '-1';
const policyOwner = policy?.owner ?? '';
const qbdConfig = policy?.connections?.quickbooksOnline?.config; // TODO: should be updated to use the new connections object
const qbdConfig = policy?.connections?.quickbooksDesktop?.config;
const errorFields = qbdConfig?.errorFields;
const {canUseNewDotQBD} = usePermissions();

Expand Down Expand Up @@ -84,7 +84,7 @@ function QuickbooksDesktopExportPage({policy}: WithPolicyConnectionsProps) {
contentContainerStyle={styles.pb2}
titleStyle={styles.ph5}
shouldBeBlocked={!canUseNewDotQBD} // TODO: remove it once the QBD beta is done
connectionName={CONST.POLICY.CONNECTIONS.NAME.QBO} // TODO: should be updated to use the new connection
connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD}
onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING.getRoute(policyID))}
>
{menuItems.map((menuItem) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ type CardListItem = ListItem & {
function QuickbooksDesktopOutOfPocketExpenseAccountSelectPage({policy}: WithPolicyConnectionsProps) {
const {translate} = useLocalize();
const styles = useThemeStyles();
const {bankAccounts, journalEntryAccounts, accountPayable} = policy?.connections?.quickbooksOnline?.data ?? {}; // TODO: should be updated to use the new connections object;
const qbdConfig = policy?.connections?.quickbooksOnline?.config; // TODO: should be updated to use the new connections object;
const {bankAccounts, journalEntryAccounts, accountPayable} = policy?.connections?.quickbooksDesktop?.data ?? {};
const qbdConfig = policy?.connections?.quickbooksDesktop?.config;

const {canUseNewDotQBD} = usePermissions();

Expand Down Expand Up @@ -119,7 +119,7 @@ function QuickbooksDesktopOutOfPocketExpenseAccountSelectPage({policy}: WithPoli
initiallyFocusedOptionKey={data.find((mode) => mode.isSelected)?.keyForList}
title={title}
shouldBeBlocked={!canUseNewDotQBD} // TODO: remove it once the QBD beta is done
connectionName={CONST.POLICY.CONNECTIONS.NAME.QBO} // TODO: should be updated to use the new connection
connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD}
pendingAction={PolicyUtils.settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.REIMBURSABLE_EXPENSES_ACCOUNT], qbdConfig?.pendingFields)}
errors={ErrorUtils.getLatestErrorField(qbdConfig, CONST.QUICKBOOKS_DESKTOP_CONFIG.REIMBURSABLE_EXPENSES_ACCOUNT)}
errorRowStyles={[styles.ph5, styles.pv3]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function QuickbooksDesktopOutOfPocketExpenseConfigurationPage({policy}: WithPoli
const {translate} = useLocalize();
const styles = useThemeStyles();
const policyID = policy?.id ?? '-1';
const qbdConfig = policy?.connections?.quickbooksOnline?.config; // TODO: should be updated to use the new connections object
const qbdConfig = policy?.connections?.quickbooksDesktop?.config;
const isLocationEnabled = !!(qbdConfig?.syncLocations && qbdConfig?.syncLocations !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE);
const isTaxesEnabled = !!qbdConfig?.syncTax;
const {canUseNewDotQBD} = usePermissions();
Expand Down Expand Up @@ -110,7 +110,7 @@ function QuickbooksDesktopOutOfPocketExpenseConfigurationPage({policy}: WithPoli
contentContainerStyle={styles.pb2}
titleStyle={styles.ph5}
shouldBeBlocked={!canUseNewDotQBD} // TODO: remove it once the QBD beta is done
connectionName={CONST.POLICY.CONNECTIONS.NAME.QBO} // TODO: should be updated to use the new connection
connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD}
onBackButtonPress={() => Navigation.goBack(ROUTES.POLICY_ACCOUNTING_QUICKBOOKS_DESKTOP_EXPORT.getRoute(policyID))}
>
{sections.map((section, index) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ type MenuItem = ListItem & {
function QuickbooksDesktopOutOfPocketExpenseEntitySelectPage({policy}: WithPolicyConnectionsProps) {
const {translate} = useLocalize();
const styles = useThemeStyles();
const qbdConfig = policy?.connections?.quickbooksOnline?.config; // TODO: should be updated to use the new connections object
const {bankAccounts, accountPayable, journalEntryAccounts} = policy?.connections?.quickbooksOnline?.data ?? {}; // TODO: should be updated to use the new connections object
const qbdConfig = policy?.connections?.quickbooksDesktop?.config;
const {bankAccounts, accountPayable, journalEntryAccounts} = policy?.connections?.quickbooksDesktop?.data ?? {};
const isLocationsEnabled = !!(qbdConfig?.syncLocations && qbdConfig?.syncLocations !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE);
const isTaxesEnabled = !!qbdConfig?.syncTax;
const shouldShowTaxError = isTaxesEnabled && qbdConfig?.reimbursableExpensesExportDestination === CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.JOURNAL_ENTRY;
Expand Down Expand Up @@ -119,7 +119,7 @@ function QuickbooksDesktopOutOfPocketExpenseEntitySelectPage({policy}: WithPolic
initiallyFocusedOptionKey={data.find((mode) => mode.isSelected)?.keyForList}
title="workspace.accounting.exportAs"
shouldBeBlocked={!canUseNewDotQBD} // TODO: remove it once the QBD beta is done
connectionName={CONST.POLICY.CONNECTIONS.NAME.QBO} // TODO: should be updated to use the new connection
connectionName={CONST.POLICY.CONNECTIONS.NAME.QBD}
pendingAction={PolicyUtils.settingsPendingAction(
[CONST.QUICKBOOKS_DESKTOP_CONFIG.REIMBURSABLE_EXPENSES_EXPORT_DESTINATION, CONST.QUICKBOOKS_DESKTOP_CONFIG.REIMBURSABLE_EXPENSES_ACCOUNT],
qbdConfig?.pendingFields,
Expand Down
21 changes: 21 additions & 0 deletions src/types/onyx/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1263,12 +1263,33 @@ type QBDConnectionConfig = OnyxCommon.OnyxValueWithOfflineFeedback<{
/** Defines how reimbursable expenses are exported */
reimbursableExpensesExportDestination: QBDReimbursableExportAccountType;

/** Defines how non reimbursable expenses are exported */
nonReimbursableExpensesExportDestination: QBONonReimbursableExportAccountType;

/** Whether the taxes should be synchronized */
syncTax: boolean;

/** Account that receives the reimbursable expenses */
reimbursableExpensesAccount?: Account;

/** Account that receives the exported invoices */
receivableAccount?: Account;

/**
* Whether a default vendor will be created and applied to all credit card
* transactions upon import
*/
autoCreateVendor: boolean;

/** TODO: Will be handled in another issue */
exportDate: ValueOf<typeof CONST.QUICKBOOKS_EXPORT_DATE>;

/** Configuration of the export */
export: {
/** E-mail of the exporter */
exporter: string;
};

/** Collections of form field errors */
errorFields?: OnyxCommon.ErrorFields;
}>;
Expand Down

0 comments on commit 29dbcc8

Please sign in to comment.