Commit 05f6cead authored by Antoine's avatar Antoine
Browse files

Update balance chart to include only appropriate operations in it.

parent 439da5be
import React from 'react';
import Dygraph from 'dygraphs';
import { debug, round2, getChartsDefaultColors } from '../../helpers';
import { debug, round2, getChartsDefaultColors, maybeIncludeInBalance } from '../../helpers';
import ChartComponent from './chart-base';
......@@ -33,7 +33,8 @@ function createChartBalance(chartId, account, operations, theme) {
// Date (day) -> cumulated sum of amounts for this day (scalar).
for (let o of ops) {
let key = makeKey(;
if (opmap.has(key)) {
// Only include in balance chart if the operation would be included in balance.
if (opmap.has(key) && maybeIncludeInBalance(o,, account.type)) {
opmap.set(key, opmap.get(key) + o.amount);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment