Add base amount column for invoices in reports #5622

This commit is contained in:
Hillel Coren 2021-01-17 16:01:54 +02:00
parent e4fc802b7b
commit 4b2d0ff02c
4 changed files with 6 additions and 10 deletions

View File

@ -114,10 +114,10 @@ ReportResult creditReport(
value = credit.balance;
break;
case CreditReportFields.converted_amount:
value = credit.amount * credit.exchangeRate;
value = credit.amount * 1 / credit.exchangeRate;
break;
case CreditReportFields.converted_balance:
value = credit.balance * credit.exchangeRate;
value = credit.balance * 1 / credit.exchangeRate;
break;
case CreditReportFields.client:
value = client?.listDisplayName ?? '';

View File

@ -122,10 +122,10 @@ ReportResult invoiceReport(
value = invoice.balance;
break;
case InvoiceReportFields.converted_amount:
value = invoice.amount * invoice.exchangeRate;
value = invoice.amount * 1 / invoice.exchangeRate;
break;
case InvoiceReportFields.converted_balance:
value = invoice.balance * invoice.exchangeRate;
value = invoice.balance * 1 / invoice.exchangeRate;
break;
case InvoiceReportFields.client:
value = client?.displayName ?? '';

View File

@ -112,7 +112,7 @@ ReportResult quoteReport(
value = quote.amount;
break;
case QuoteReportFields.converted_amount:
value = quote.amount * quote.exchangeRate;
value = quote.amount * 1 / quote.exchangeRate;
break;
case QuoteReportFields.number:
value = quote.number;

View File

@ -1202,9 +1202,6 @@ class ReportResult {
});
}
print('## TOTALS: $totals');
print('## Keys: $keys');
List<String> allFields = [];
keys.forEach((currencyId) {
final values = totals[currencyId];
@ -1222,7 +1219,6 @@ class ReportResult {
DataCell(Text(values['count'].toInt().toString())),
];
print('## FIELDs: $allFields');
allFields.forEach((field) {
final amount = values[field];
if (field != 'count') {
@ -1243,7 +1239,7 @@ class ReportResult {
}
});
print('## Add row with cells: ${cells.length}');
print('## Total Rows: ${cells.length}');
rows.add(DataRow(cells: cells));
});