This commit is contained in:
Hillel Coren 2021-02-03 21:59:43 +02:00
parent 7ef0d432ab
commit d3e0e7c531
2 changed files with 9 additions and 5 deletions

View File

@ -88,7 +88,7 @@ ReportResult profitAndLossReport(
switch (column) {
case ProfitAndLossReportFields.type:
value = EntityType.payment.toString();
value = EntityType.payment;
break;
case ProfitAndLossReportFields.client:
value = client?.displayName;
@ -143,7 +143,9 @@ ReportResult profitAndLossReport(
skip = true;
}
if (value.runtimeType == bool) {
if (value.runtimeType == EntityType) {
row.add(payment.getReportEntityType());
} else if (value.runtimeType == bool) {
row.add(payment.getReportBool(value: value));
} else if (value.runtimeType == double || value.runtimeType == int) {
row.add(payment.getReportDouble(
@ -171,7 +173,7 @@ ReportResult profitAndLossReport(
switch (column) {
case ProfitAndLossReportFields.type:
value = EntityType.expense.toString();
value = EntityType.expense;
break;
case ProfitAndLossReportFields.client:
value = client?.displayName;
@ -226,7 +228,9 @@ ReportResult profitAndLossReport(
skip = true;
}
if (value.runtimeType == bool) {
if (value.runtimeType == EntityType) {
row.add(expense.getReportEntityType());
} else if (value.runtimeType == bool) {
row.add(expense.getReportBool(value: value));
} else if (value.runtimeType == double || value.runtimeType == int) {
row.add(expense.getReportDouble(

View File

@ -646,7 +646,7 @@ class ReportResult {
return false;
}
} else if (value.runtimeType == EntityType) {
return filter == localization.lookup('$value');
return filter.toLowerCase() == '$value'.toLowerCase();
} else if (isValidDate(value)) {
if (!ReportResult.matchDateTime(
filter: filter,