diff --git a/packages/desktop-client/src/components/accounts/Header.jsx b/packages/desktop-client/src/components/accounts/Header.jsx index da5608da11a..3c4f79a78a6 100644 --- a/packages/desktop-client/src/components/accounts/Header.jsx +++ b/packages/desktop-client/src/components/accounts/Header.jsx @@ -83,11 +83,14 @@ export function AccountHeader({ const [menuOpen, setMenuOpen] = useState(false); const searchInput = useRef(null); const splitsExpanded = useSplitsExpanded(); + const syncServerStatus = useSyncServerStatus(); + const isUsingServer = syncServerStatus !== 'no-server'; + const isServerOffline = syncServerStatus === 'offline'; - let canSync = account && account.account_id; + let canSync = account && account.account_id && isUsingServer; if (!account) { // All accounts - check for any syncable account - canSync = !!accounts.find(account => !!account.account_id); + canSync = !!accounts.find(account => !!account.account_id) && isUsingServer; } function onToggleSplits() { @@ -210,7 +213,11 @@ export function AccountHeader({ style={{ marginTop: 12 }} > {((account && !account.closed) || canSync) && ( - - + {expenseGroups + .filter(group => !group.hidden || showHiddenCategories) + .map(group => { + return ( + + ); + })} - {incomeGroup && ( - - )} - + + + + + {incomeGroup && ( + + )} + + ); } @@ -1143,10 +1136,6 @@ export function BudgetTable({ pushModal, onEditGroup, onEditCategory, - editingBudgetCategoryId, - onEditCategoryBudget, - openBalanceActionMenuId, - onOpenBalanceActionMenu, }) { const { width } = useResponsive(); const show3Cols = width >= 360; @@ -1385,10 +1374,6 @@ export function BudgetTable({ editMode={editMode} onEditGroup={onEditGroup} onEditCategory={onEditCategory} - editingBudgetCategoryId={editingBudgetCategoryId} - onEditCategoryBudget={onEditCategoryBudget} - openBalanceActionMenuId={openBalanceActionMenuId} - onOpenBalanceActionMenu={onOpenBalanceActionMenu} onSaveCategory={onSaveCategory} onDeleteCategory={onDeleteCategory} onAddCategory={onAddCategory} @@ -1423,10 +1408,6 @@ export function BudgetTable({ editMode={editMode} onEditGroup={onEditGroup} onEditCategory={onEditCategory} - editingBudgetCategoryId={editingBudgetCategoryId} - onEditCategoryBudget={onEditCategoryBudget} - openBalanceActionMenuId={openBalanceActionMenuId} - onOpenBalanceActionMenu={onOpenBalanceActionMenu} onSaveCategory={onSaveCategory} onDeleteCategory={onDeleteCategory} onAddCategory={onAddCategory} diff --git a/packages/loot-core/migrations/1704572023730_add_account_sync_source.sql b/packages/loot-core/migrations/1704572023730_add_account_sync_source.sql index 3aae8da909e..7af2400895a 100644 --- a/packages/loot-core/migrations/1704572023730_add_account_sync_source.sql +++ b/packages/loot-core/migrations/1704572023730_add_account_sync_source.sql @@ -2,10 +2,4 @@ BEGIN TRANSACTION; ALTER TABLE accounts ADD COLUMN account_sync_source TEXT; -UPDATE accounts SET - account_sync_source = CASE - WHEN account_id THEN 'goCardless' - ELSE NULL - END; - COMMIT; diff --git a/packages/loot-core/migrations/1704572023731_add_missing_goCardless_sync_source.sql b/packages/loot-core/migrations/1704572023731_add_missing_goCardless_sync_source.sql new file mode 100644 index 00000000000..49aa4cb85ca --- /dev/null +++ b/packages/loot-core/migrations/1704572023731_add_missing_goCardless_sync_source.sql @@ -0,0 +1,9 @@ +BEGIN TRANSACTION; + +UPDATE accounts +SET + account_sync_source = 'goCardless' +WHERE account_id IS NOT NULL + AND account_sync_source IS NULL; + +COMMIT; diff --git a/packages/loot-core/src/server/budget/cleanup-template.ts b/packages/loot-core/src/server/budget/cleanup-template.ts index 43ab6ee2e2c..889a155122c 100644 --- a/packages/loot-core/src/server/budget/cleanup-template.ts +++ b/packages/loot-core/src/server/budget/cleanup-template.ts @@ -3,7 +3,7 @@ import { Notification } from '../../client/state-types/notifications'; import * as monthUtils from '../../shared/months'; import * as db from '../db'; -import { setBudget, getSheetValue } from './actions'; +import { setBudget, getSheetValue, setGoal } from './actions'; import { parse } from './cleanup-template.pegjs'; export function cleanupTemplate({ month }: { month: string }) { @@ -35,11 +35,20 @@ async function processCleanup(month: string): Promise { sheetName, `budget-${category.id}`, ); + const spent = await getSheetValue( + sheetName, + `sum-amount-${category.id}`, + ); await setBudget({ category: category.id, month, amount: budgeted - balance, }); + await setGoal({ + category: category.id, + month, + goal: -spent, + }); num_sources += 1; } if (template.filter(t => t.type === 'sink').length > 0) { diff --git a/upcoming-release-notes/2263.md b/upcoming-release-notes/2263.md new file mode 100644 index 00000000000..0241b5010eb --- /dev/null +++ b/upcoming-release-notes/2263.md @@ -0,0 +1,6 @@ +--- +category: Maintenance +authors: [joel-jeremy] +--- + +Use useSingleActiveEditForm hook in mobile budget table diff --git a/upcoming-release-notes/2282.md b/upcoming-release-notes/2282.md new file mode 100644 index 00000000000..e7283528a11 --- /dev/null +++ b/upcoming-release-notes/2282.md @@ -0,0 +1,6 @@ +--- +category: Enhancements +authors: [shall0pass] +--- + +Cleanup utility: Update goal target after end of month cleanup tool is activated for 'source' categories diff --git a/upcoming-release-notes/2308.md b/upcoming-release-notes/2308.md new file mode 100644 index 00000000000..bba8f394711 --- /dev/null +++ b/upcoming-release-notes/2308.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [MatissJanis] +--- + +Fix GoCardless bank sync breaking after a flaky SimpleFin db migration.