diff --git a/lib/main.dart b/lib/main.dart index 1d649790c..af6efae4f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -131,7 +131,7 @@ Future _initialState(bool isTesting) async { String url = WebUtils.browserUrl ?? prefs.getString(kSharedPrefUrl) ?? ''; if (!kReleaseMode) { - url = kAppStagingUrl; + //url = kAppStagingUrl; } //url = kAppProductionUrl; //url = kAppDemoUrl; diff --git a/lib/ui/reports/invoice_item_report.dart b/lib/ui/reports/invoice_item_report.dart index 4ebc7718d..1f96dbedc 100644 --- a/lib/ui/reports/invoice_item_report.dart +++ b/lib/ui/reports/invoice_item_report.dart @@ -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)); } diff --git a/lib/ui/reports/quote_item_report.dart b/lib/ui/reports/quote_item_report.dart index db9950437..d2896ed85 100644 --- a/lib/ui/reports/quote_item_report.dart +++ b/lib/ui/reports/quote_item_report.dart @@ -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)); }