This commit is contained in:
Hillel Coren 2020-02-15 21:53:42 +02:00
parent fc213ee101
commit 1fa2bd833e
1 changed files with 6 additions and 1 deletions

View File

@ -725,6 +725,7 @@ class ReportResult {
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
final row = data[i]; final row = data[i];
bool countedRow = false;
for (var j = 0; j < row.length; j++) { for (var j = 0; j < row.length; j++) {
final cell = row[j]; final cell = row[j];
final column = columns[j]; final column = columns[j];
@ -734,6 +735,10 @@ class ReportResult {
if (!totals.containsKey(currencyId)) { if (!totals.containsKey(currencyId)) {
totals[currencyId] = {'count': 0}; totals[currencyId] = {'count': 0};
} }
if (!countedRow) {
totals[currencyId]['count']++;
countedRow = true;
}
if (!totals[currencyId].containsKey(column)) { if (!totals[currencyId].containsKey(column)) {
totals[currencyId][column] = 0; totals[currencyId][column] = 0;
} }
@ -747,7 +752,7 @@ class ReportResult {
DataCell(Text( DataCell(Text(
store.state.staticState.currencyMap[currencyId]?.listDisplayName ?? store.state.staticState.currencyMap[currencyId]?.listDisplayName ??
'')), '')),
DataCell(Text(values.toString())), DataCell(Text(values['count'].toInt().toString())),
]; ];
final List<String> fields = values.keys.toList() final List<String> fields = values.keys.toList()