Fix for aging report totals
This commit is contained in:
parent
502cdf1349
commit
f738814daf
|
|
@ -1,7 +1,6 @@
|
|||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:invoiceninja_flutter/utils/enums.dart';
|
||||
import 'package:invoiceninja_flutter/constants.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/tax_rate_model.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/company_model.dart';
|
||||
import 'package:invoiceninja_flutter/data/models/models.dart';
|
||||
import 'package:invoiceninja_flutter/redux/reports/reports_state.dart';
|
||||
|
|
@ -134,6 +133,7 @@ ReportResult agingReport(
|
|||
} else if (column == AgingReportFields.age) {
|
||||
row.add(invoice.getReportNumber(
|
||||
value: value,
|
||||
// TODO figure out why this line is needed
|
||||
currencyId: client.settings.currencyId,
|
||||
formatNumberType: FormatNumberType.int));
|
||||
} else if (value.runtimeType == double || value.runtimeType == int) {
|
||||
|
|
|
|||
|
|
@ -1126,8 +1126,14 @@ class ReportResult {
|
|||
..sort((String str1, String str2) => str1.compareTo(str2));
|
||||
fields.forEach((field) {
|
||||
final amount = values[field];
|
||||
final value = formatNumber(amount, context, currencyId: currencyId);
|
||||
if (field != 'count') {
|
||||
String value;
|
||||
if (field == 'age') {
|
||||
value = formatNumber(amount / values['count'], context,
|
||||
formatNumberType: FormatNumberType.double);
|
||||
} else {
|
||||
value = formatNumber(amount, context, currencyId: currencyId);
|
||||
}
|
||||
cells.add(DataCell(Text(value)));
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue