Report changes

This commit is contained in:
Hillel Coren 2021-07-26 16:05:17 +03:00
parent 0e9f4865c7
commit 5b0c524596
3 changed files with 7 additions and 11 deletions

View File

@ -131,7 +131,7 @@ Future<AppState> _initialState(bool isTesting) async {
String url = WebUtils.browserUrl ?? prefs.getString(kSharedPrefUrl) ?? '';
if (!kReleaseMode) {
url = kAppStagingUrl;
//url = kAppStagingUrl;
}
//url = kAppProductionUrl;
//url = kAppDemoUrl;

View File

@ -86,7 +86,8 @@ ReportResult lineItemReport(
for (var entry in invoiceMap.entries) {
final invoice = entry.value;
final client = clientMap[invoice.clientId];
final precision = staticState.currencyMap[client.currencyId].precision;
final precision =
staticState.currencyMap[client.currencyId]?.precision ?? 2;
if (invoice.isDeleted || client.isDeleted) {
continue;
@ -179,12 +180,9 @@ ReportResult lineItemReport(
if (value.runtimeType == bool) {
row.add(invoice.getReportBool(value: value));
} else if (value.runtimeType == double) {
} else if (value.runtimeType == double || value.runtimeType == int) {
row.add(invoice.getReportDouble(
value: value, currencyId: client.currencyId));
} else if (value.runtimeType == int) {
row.add(invoice.getReportInt(
value: value, currencyId: client.currencyId));
} else {
row.add(invoice.getReportString(value: value));
}

View File

@ -86,7 +86,8 @@ ReportResult lineItemReport(
for (var entry in invoiceMap.entries) {
final invoice = entry.value;
final client = clientMap[invoice.clientId];
final precision = staticState.currencyMap[client.currencyId].precision;
final precision =
staticState.currencyMap[client.currencyId]?.precision ?? 2;
if (invoice.isDeleted || client.isDeleted) {
continue;
@ -175,12 +176,9 @@ ReportResult lineItemReport(
if (value.runtimeType == bool) {
row.add(invoice.getReportBool(value: value));
} else if (value.runtimeType == double) {
} else if (value.runtimeType == double || value.runtimeType == int) {
row.add(invoice.getReportDouble(
value: value, currencyId: client.currencyId));
} else if (value.runtimeType == int) {
row.add(invoice.getReportInt(
value: value, currencyId: client.currencyId));
} else {
row.add(invoice.getReportString(value: value));
}