-
Notifications
You must be signed in to change notification settings - Fork 3.5k
QBD Accounting Method #71667
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
QBD Accounting Method #71667
Conversation
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAccountingMethodPage.tsx
Show resolved
Hide resolved
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAccountingMethodPage.tsx
Show resolved
Hide resolved
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAdvancedPage.tsx
Show resolved
Hide resolved
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAdvancedPage.tsx
Show resolved
Hide resolved
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAdvancedPage.tsx
Show resolved
Hide resolved
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAutoSyncPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAutoSyncPage.tsx
Show resolved
Hide resolved
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAutoSyncPage.tsx
Show resolved
Hide resolved
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAccountingMethodPage.tsx
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #71667 +/- ##
==========================================
- Coverage 35.20% 35.16% -0.04%
==========================================
Files 3297 3299 +2
Lines 108149 108205 +56
Branches 34545 34562 +17
==========================================
- Hits 38070 38048 -22
- Misses 69893 69971 +78
Partials 186 186
📢 Thoughts on this report? Let us know! 🚀 New features to boost your workflow:
|
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAccountingMethodPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAccountingMethodPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAdvancedPage.tsx
Show resolved
Hide resolved
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAdvancedPage.tsx
Show resolved
Hide resolved
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAutoSyncPage.tsx
Show resolved
Hide resolved
src/pages/workspace/accounting/qbd/advanced/QuickbooksDesktopAccountingMethodPage.tsx
Outdated
Show resolved
Hide resolved
|
@dominictb Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@dominictb Could you take a review? Thanks! |
| label: 'Quand exporter', | ||
| description: 'Choisissez quand exporter les dépenses :', | ||
| values: { | ||
| [COMMON_CONST.INTEGRATIONS.ACCOUNTING_METHOD.ACCRUAL]: 'Accrual', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to have been translated in fr.ts, it.ts, and nl.ts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it hasn't been translated. We also didn't translate the copy for xero, qbo, or intacct.
|
|
||
| type UpdateQuickbooksDesktopAccountingMethodParams = { | ||
| policyID: string; | ||
| accountingMethod: ValueOf<typeof COMMON_CONST.INTEGRATIONS.ACCOUNTING_METHOD>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that all of the endpoints for QuickbooksDesktop has this idempotencyKey param but am not sure what it's for. Do we need it here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is the idempotency key is a unique identifier used to ensure that the same operation can be safely retried multiple times without causing duplicate or unintended side effects.
For QBD API, we actually haven't use it in the BE. So probably it's okay to not pass it here. @francoisl Could you confirm it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know either. The only API commands I see where we use the value in the backend are AddAttachment and AddTextAndAttachment, so... yes I think it's safe to remove? I don't understand why so many other API commands' parameter definitions have it though.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeScreen.Recording.2025-10-08.at.01.59.18.moviOS: HybridAppScreen.Recording.2025-10-08.at.01.52.52-compressed.moviOS: mWeb SafariScreen.Recording.2025-10-08.at.01.55.57-compressed.movMacOS: Chrome / SafariScreen.Recording.2025-10-08.at.01.49.05-compressed.movMacOS: Desktop |
| const config = policy?.connections?.quickbooksDesktop?.config; | ||
| const accountingMethod = config?.export?.accountingMethod ?? COMMON_CONST.INTEGRATIONS.ACCOUNTING_METHOD.CASH; | ||
|
|
||
| const data: MenuListItem[] = Object.values(COMMON_CONST.INTEGRATIONS.ACCOUNTING_METHOD).map((accountingMethodType) => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ PERF-4 (docs)
Objects passed as props should be properly memoized to prevent unnecessary re-renders. Creating a new array with Object.values().map() on every render triggers re-renders of child components.
const data: MenuListItem[] = useMemo(() =>
Object.values(COMMON_CONST.INTEGRATIONS.ACCOUNTING_METHOD).map((accountingMethodType) => ({
value: accountingMethodType,
text: translate(`workspace.qbd.accountingMethods.values.${accountingMethodType}` as TranslationPaths),
alternateText: translate(`workspace.qbd.accountingMethods.alternateText.${accountingMethodType}` as TranslationPaths),
keyForList: accountingMethodType,
isSelected: accountingMethod === accountingMethodType,
})), [translate, accountingMethod]);| {!!autoSync?.enabled && ( | ||
| <OfflineWithFeedback pendingAction={pendingAction}> | ||
| <MenuItemWithTopDescription | ||
| title={ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ PERF-4 (docs)
The ternary conditional creates a new translated string object on every render. This should be memoized to prevent unnecessary re-renders of the MenuItemWithTopDescription component.
const accountingMethodTitle = useMemo(() => {
return accountingMethod === COMMON_CONST.INTEGRATIONS.ACCOUNTING_METHOD.ACCRUAL
? translate(`workspace.qbd.accountingMethods.values.${COMMON_CONST.INTEGRATIONS.ACCOUNTING_METHOD.ACCRUAL}` as TranslationPaths)
: translate(`workspace.qbd.accountingMethods.values.${COMMON_CONST.INTEGRATIONS.ACCOUNTING_METHOD.CASH}` as TranslationPaths);
}, [translate, accountingMethod]);
// Then use:| const route = useRoute<PlatformStackRouteProp<SettingsNavigatorParamList, typeof SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_ADVANCED>>(); | ||
| const accountingMethod = qbdConfig?.export?.accountingMethod ?? COMMON_CONST.INTEGRATIONS.ACCOUNTING_METHOD.CASH; | ||
|
|
||
| const qbdToggleSettingItems = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ PERF-4 (docs)
The qbdToggleSettingItems array contains objects with function references that are created on every render. This should be memoized to prevent unnecessary re-renders of child components.
const qbdToggleSettingItems = useMemo(() => [
{
title: translate('workspace.qbd.advancedConfig.createEntities'),
subtitle: translate('workspace.qbd.advancedConfig.createEntitiesDescription'),
switchAccessibilityLabel: translate('workspace.qbd.advancedConfig.createEntitiesDescription'),
isActive: !!qbdConfig?.shouldAutoCreateVendor,
onToggle: (isOn: boolean) => {
updateQuickbooksDesktopShouldAutoCreateVendor(policyID, isOn);
},
subscribedSetting: CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR,
errors: getLatestErrorField(qbdConfig, CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR),
pendingAction: settingsPendingAction([CONST.QUICKBOOKS_DESKTOP_CONFIG.SHOULD_AUTO_CREATE_VENDOR], qbdConfig?.pendingFields),
},
], [translate, qbdConfig?.shouldAutoCreateVendor, qbdConfig, policyID]);| headerTitle="common.settings" | ||
| accessVariants={[CONST.POLICY.ACCESS_VARIANTS.ADMIN, CONST.POLICY.ACCESS_VARIANTS.PAID]} | ||
| policyID={policyID} | ||
| featureName={CONST.POLICY.MORE_FEATURES.ARE_CATEGORIES_ENABLED} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ PERF-6 (docs)
Using CONST.POLICY.MORE_FEATURES.ARE_CATEGORIES_ENABLED seems incorrect for a QuickBooks Desktop connection feature. This should likely be CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED to match the feature being used.
Fix: Change the featureName prop to use the appropriate constant:
featureName={CONST.POLICY.MORE_FEATURES.ARE_CONNECTIONS_ENABLED}
dominictb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
|
@chuckdries Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
🎯 @dominictb, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #72196. |
chuckdries
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I don't understand why melvinbot requested a review from me when we already had a review from @francoisl - I'll leave the final approval to him
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/francoisl in version: 9.2.29-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.2.29-5 🚀
|
Explanation of Change
We have implemented the accounting method config for QBD in OldDot, and also have the API command to update the QBD accounting method. Similar to #51512 and #57522 but for QBD.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/422402
$ https://github.com/Expensify/Expensify/issues/474825
PROPOSAL:
Tests
Preresuite:
Offline tests
Preresuite:
QA Steps
Preresuite:
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps./** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.Oct.1.2025.mp4
MacOS: Desktop