Skip to content

Commit 33af9bf

Browse files
authored
Fix Sankey income bug, when payee it not set (#7632)
* Ensure income categories are shown correct, even if payee is not set * Add release note
1 parent 46687da commit 33af9bf

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

packages/desktop-client/src/components/reports/spreadsheets/sankey-spreadsheet.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ function createTransactionsGraph(categoryData: CategoryEntry[]): Graph {
682682

683683
categoryData.forEach(entry => {
684684
if (entry.accountId && entry.accountName && entry.categoryId) {
685-
if (entry.isIncome && entry.payeeId) {
685+
if (entry.isIncome) {
686686
// Payee > Income category > Account
687687
addNode(
688688
graph,
@@ -691,9 +691,16 @@ function createTransactionsGraph(categoryData: CategoryEntry[]): Graph {
691691
entry.category,
692692
);
693693
addNode(graph, entry.accountId, GraphLayers.Account, entry.accountName);
694-
addNode(graph, entry.payeeId, GraphLayers.IncomePayee, entry.payeeName);
695694
addValueToLink(graph, entry.categoryId, entry.accountId, entry.value);
696-
addValueToLink(graph, entry.payeeId, entry.categoryId, entry.value);
695+
if (entry.payeeId) {
696+
addNode(
697+
graph,
698+
entry.payeeId,
699+
GraphLayers.IncomePayee,
700+
entry.payeeName,
701+
);
702+
addValueToLink(graph, entry.payeeId, entry.categoryId, entry.value);
703+
}
697704
} else {
698705
// Account > Category group > Category
699706
addNode(graph, entry.accountId, GraphLayers.Account, entry.accountName);

upcoming-release-notes/7632.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: Bugfixes
3+
authors: [emiltb]
4+
---
5+
6+
Fix Sankey income being shown as spent money, when payee was not set

0 commit comments

Comments
 (0)