diff --git a/packages/desktop-client/src/components/reports/ReportTable.tsx b/packages/desktop-client/src/components/reports/ReportTable.tsx index 9c92ee6a69c..d112fb390ff 100644 --- a/packages/desktop-client/src/components/reports/ReportTable.tsx +++ b/packages/desktop-client/src/components/reports/ReportTable.tsx @@ -191,7 +191,14 @@ export function TableTotals({ ); } -export function TotalTableList({ data, empty, monthsCount, typeItem, mode, split }) { +export function TotalTableList({ + data, + empty, + monthsCount, + typeItem, + mode, + split, +}) { const splitItem = ['Month', 'Year'].includes(split) ? 'date' : 'name'; const splitData = split === 'Category' diff --git a/packages/desktop-client/src/components/reports/spreadsheets/default-spreadsheet.tsx b/packages/desktop-client/src/components/reports/spreadsheets/default-spreadsheet.tsx index 7ae6ea9166c..03a0677091a 100644 --- a/packages/desktop-client/src/components/reports/spreadsheets/default-spreadsheet.tsx +++ b/packages/desktop-client/src/components/reports/spreadsheets/default-spreadsheet.tsx @@ -209,35 +209,33 @@ export default function createSpreadsheet( }), ); - const gData = - [1].includes(split) && - (await Promise.all( - categories.grouped.map(async group => { - const catData = await Promise.all( - group.categories.map(async graph => { - let catMatch = null; - graphData.map(async cat => { - if (cat.id === graph.id) { - catMatch = cat; - } - }); - const calcCat = recalculate(catMatch, start, end); - return { ...calcCat }; - }), - ); - let groupMatch = null; - groupData.map(async split => { - if (split.id === group.id) { - groupMatch = split; - } - }); - const calcGroup = recalculate(groupMatch, start, end); - return { - ...calcGroup, - categories: catData, - }; - }), - )); + const gData = await Promise.all( + categories.grouped.map(async group => { + const catData = await Promise.all( + group.categories.map(async graph => { + let catMatch = null; + graphData.map(async cat => { + if (cat.id === graph.id) { + catMatch = cat; + } + }); + const calcCat = catMatch && recalculate(catMatch, start, end); + return { ...calcCat }; + }), + ); + let groupMatch = null; + groupData.map(async split => { + if (split.id === group.id) { + groupMatch = split; + } + }); + const calcGroup = groupMatch && recalculate(groupMatch, start, end); + return { + ...calcGroup, + categories: catData, + }; + }), + ); let totalAssets = 0; let totalDebts = 0;