Skip to content

[HOLD for payment 2024-07-24] [#Wave-Control - Add Sage Intacct] Settings Configuration in NewDot: Export #43534

@yuwenmemon

Description

@yuwenmemon

Tracking GH: https://github.com/Expensify/Expensify/issues/388780

Design doc section: https://docs.google.com/document/d/1k3ZFw8KB55yPUSCG6KYZlwpwEtmRt3eUshwxs7bZq5I/edit#heading=h.vn04szhrriv7


You will find in the following issue the pseudocode for the different flows. Use them as a guide in your implementation.

Export flow

Main page

function SageIntacctExportPage({policy}: WithPolicyProps) {
    const {export: exportConfig, pendingFields, errorFields} = policy?.connections?.intacct?.config ?? {};

    const currentSageIntacctOrganizationName = useMemo(() => getCurrentSageIntacctOrganizationName(policy ?? undefined), [policy]);

    const sections = useMemo(
        () => [
            {
                description: translate('workspace.sageIntacct.preferredExporter'),
                action: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_PREFERRED_EXPORTER.getRoute(policyID)),
                title: exportConfig.exporter || translate('workspace.sageIntacct.notConfigured'),
                hasError: !!errorFields?.export.exporter,
                pendingAction: pendingFields?.export.exporter,
            },
            {
                description: translate('workspace.sageIntacct.exportDate'),
                action: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_EXPORT_DATE.getRoute(policyID)),
                title: translate('workspace.sageIntacct.exportDate'),
                hasError: !!errorFields?.export.exportDate,
                pendingAction: pendingFields?.export.exportDate,
            },
            {
                description: translate('workspace.sageIntacct.exportReimbursableExpensesAs'),
                action: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_REIMBURSABLE_EXPENSES.getRoute(policyID)),
                title: exportConfig.reimbursable ? translate(`workspace.accounting.reimbursable.${exportConfig.reimbursable}`) : translate('workspace.sageIntacct.notConfigured'),
                hasError: !!errorFields?.export.reimbursable,
                pendingAction: pendingFields?.export.reimbursable,
            },
            {
                description: translate('workspace.sageIntacct.exportNonReimbursableExpensesAs'),
                action: () => Navigation.navigate(ROUTES.POLICY_ACCOUNTING_SAGE_INTACCT_NON_REIMBURSABLE_EXPENSES.getRoute(policyID)),
                title: exportConfig.nonReimbursable ? translate(`workspace.accounting.nonReimbursable.${exportConfig.nonReimbursable}`) : translate('workspace.sageIntacct.notConfigured'),
                hasError: !!errorFields?.export.nonReimbursable,
                pendingAction: pendingFields?.export.nonReimbursable,
            },
        ],
        [
		//... useMemo() dependencies
        ],
    );

    return (
        <ConnectionLayout
            displayName={SageIntacctExportPage.displayName}
            headerTitle="workspace.accounting.export"
            headerSubtitle={currentSageIntacctOrganizationName}
            accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.PAID]}
            policyID={policyID}
            featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED}
            contentContainerStyle={styles.pb2}
            titleStyle={styles.ph5}
            connectionName={CONST.POLICY.CONNECTIONS.NAME.SAGE_INTACCT}
        >
	                <Text style={[styles.ph5, styles.pb5]}>{translate('workspace.sageIntacct.exportDescription')}</Text>
            {sections.map((section) => (
                <OfflineWithFeedback key={section.description} pendingAction={section.pendingAction}>
                    <MenuItemWithTopDescription
                        title={section.title}
                        description={section.description}
                        shouldShowRightIcon
                        onPress={section.action}
                        brickRoadIndicator={section.hasError ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined}
                    />
                </OfflineWithFeedback>
            ))}
        </ConnectionLayout>
    );
}

SageIntacctExportPage.displayName = 'PolicySageIntacctExportPage';

export default withPolicy(SageIntacctExportPage);
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017260ab59e4fe16a6
  • Upwork Job ID: 1800760782833912827
  • Last Price Increase: 2024-06-12
  • Automatic offers:
    • hungvu193 | Contributor | 102699116
Issue OwnerCurrent Issue Owner: @puneetlath

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionExternalAdded to denote the issue can be worked on by a contributorNewFeatureSomething to build that is a new item.WeeklyKSv2

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions