From 909e928ab8e372ce1d9f2d4fb6313d63a5518976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Loipf=C3=BChrer?= Date: Wed, 4 Sep 2024 22:07:25 +0200 Subject: [PATCH] fix(web): correct position sum order #226 --- .../TransactionDetail/purchase/TransactionPositions.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/apps/web/src/pages/transactions/TransactionDetail/purchase/TransactionPositions.tsx b/frontend/apps/web/src/pages/transactions/TransactionDetail/purchase/TransactionPositions.tsx index d3ab6fd..f9b4095 100644 --- a/frontend/apps/web/src/pages/transactions/TransactionDetail/purchase/TransactionPositions.tsx +++ b/frontend/apps/web/src/pages/transactions/TransactionDetail/purchase/TransactionPositions.tsx @@ -92,10 +92,11 @@ export const TransactionPositions: React.FC = ({ ) ); } + const accs = accountIDsToShow.map((id) => accountIDMap[id]).sort(getAccountSortFunc("name")); return { - shownAccounts: accountIDsToShow.map((id) => accountIDMap[id]).sort(getAccountSortFunc("name")), - shownAccountIDs: accountIDsToShow, + shownAccounts: accs, + shownAccountIDs: accs.map((a) => a.id), }; }, [transaction, positions, additionalPurchaseItemAccounts, accountIDMap]);