diff --git a/public/main.profile.dart.js b/public/main.profile.dart.js index ef318a3c7616..207842580af3 100644 --- a/public/main.profile.dart.js +++ b/public/main.profile.dart.js @@ -112951,7 +112951,7 @@ currencyId1 = t12 ? "1" : currencyId0; else currencyId1 = currencyId; - row.push(new A.ReportNumberValue(value26, _null, currencyId1, exchangeRate, client.get$entityType(), value)); + row.push(new A.ReportNumberValue(value26, _null, currencyId1, client.get$entityType(), value)); } else row.push(new A.ReportStringValue(A.S(value26), client.get$entityType(), value)); } @@ -113231,7 +113231,7 @@ currencyId1 = t27 ? "1" : currencyId0; else currencyId1 = currencyId; - row.push(new A.ReportNumberValue(value22, _null, currencyId1, exchangeRate, client.get$entityType(), t11)); + row.push(new A.ReportNumberValue(value22, _null, currencyId1, client.get$entityType(), t11)); } else row.push(new A.ReportStringValue(A.S(value22), client.get$entityType(), t11)); } @@ -113402,7 +113402,7 @@ if (t16.get$runtimeType(value5) === B.Type_bool_lhE) row.push(new A.ReportBoolValue(value5, t12, t11)); else if (t16.get$runtimeType(value5) === B.Type_double_K1J || t16.get$runtimeType(value5) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value5, _null, t15 === B.CreditItemReportFields_4 ? _null : t9, _null, t12, t11)); + row.push(new A.ReportNumberValue(value5, _null, t15 === B.CreditItemReportFields_4 ? _null : t9, t12, t11)); else row.push(new A.ReportStringValue(value5, t12, t11)); } @@ -113722,7 +113722,7 @@ if (currencyId == null) currencyId = "1"; } - row.push(new A.ReportNumberValue(value40, _null, currencyId, value18, t10, value0)); + row.push(new A.ReportNumberValue(value40, _null, currencyId, t10, value0)); } else row.push(new A.ReportStringValue(value40, t10, value0)); } @@ -114068,9 +114068,9 @@ if (t28.get$runtimeType(value11) === B.Type_bool_lhE) row.push(new A.ReportBoolValue(value11, t9, value)); else if (t27 === B.ExpenseReportFields_38) - row.push(new A.ReportNumberValue(value11, _null, t25, _null, t9, value)); + row.push(new A.ReportNumberValue(value11, _null, t25, t9, value)); else if (t28.get$runtimeType(value11) === B.Type_double_K1J || t28.get$runtimeType(value11) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value11, _null, t24, _null, t9, value)); + row.push(new A.ReportNumberValue(value11, _null, t24, t9, value)); else row.push(new A.ReportStringValue(value11, t9, value)); } @@ -114242,7 +114242,7 @@ if (t16.get$runtimeType(value5) === B.Type_bool_lhE) row.push(new A.ReportBoolValue(value5, t12, t11)); else if (t16.get$runtimeType(value5) === B.Type_double_K1J || t16.get$runtimeType(value5) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value5, _null, t15 === B.InvoiceItemReportFields_4 ? _null : t9, _null, t12, t11)); + row.push(new A.ReportNumberValue(value5, _null, t15 === B.InvoiceItemReportFields_4 ? _null : t9, t12, t11)); else row.push(new A.ReportStringValue(value5, t12, t11)); } @@ -114635,7 +114635,7 @@ if (currencyId == null) currencyId = "1"; } - row.push(new A.ReportNumberValue(value46, _null, currencyId, value20, t10, value0)); + row.push(new A.ReportNumberValue(value46, _null, currencyId, t10, value0)); } else row.push(new A.ReportStringValue(value46, t10, value0)); } @@ -114760,7 +114760,7 @@ if (t15.get$runtimeType(value5) === B.Type_bool_lhE) row.push(new A.ReportBoolValue(value5, t12, t11)); else if (t15.get$runtimeType(value5) === B.Type_double_K1J || t15.get$runtimeType(value5) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value5, _null, t9, _null, t12, t11)); + row.push(new A.ReportNumberValue(value5, _null, t9, t12, t11)); else row.push(new A.ReportStringValue(value5, t12, t11)); } @@ -114839,7 +114839,7 @@ if (t14.get$runtimeType(value5) === B.Type_bool_lhE) row.push(new A.ReportBoolValue(value5, t11, t10)); else if (t14.get$runtimeType(value5) === B.Type_double_K1J || t14.get$runtimeType(value5) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value5, _null, t8, _null, t11, t10)); + row.push(new A.ReportNumberValue(value5, _null, t8, t11, t10)); else row.push(new A.ReportStringValue(value5, t11, t10)); } @@ -115062,9 +115062,9 @@ if (t20.get$runtimeType(value18) === B.Type_bool_lhE) row.push(new A.ReportBoolValue(value18, payment.get$entityType(), value)); else if (t19 === B.PaymentReportFields_28) - row.push(new A.ReportNumberValue(value18, _null, t18, _null, payment.get$entityType(), value)); + row.push(new A.ReportNumberValue(value18, _null, t18, payment.get$entityType(), value)); else if (t20.get$runtimeType(value18) === B.Type_double_K1J || t20.get$runtimeType(value18) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value18, _null, t17.currencyId, _null, payment.get$entityType(), value)); + row.push(new A.ReportNumberValue(value18, _null, t17.currencyId, payment.get$entityType(), value)); else row.push(new A.ReportStringValue(value18, payment.get$entityType(), value)); } @@ -115205,7 +115205,7 @@ if (t17.get$runtimeType(value6) === B.Type_bool_lhE) row.push(new A.ReportBoolValue(value6, t13, t12)); else if (t17.get$runtimeType(value6) === B.Type_double_K1J || t17.get$runtimeType(value6) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value6, _null, t8, _null, t13, t12)); + row.push(new A.ReportNumberValue(value6, _null, t8, t13, t12)); else row.push(new A.ReportStringValue(value6, t13, t12)); } @@ -115337,14 +115337,14 @@ t16 = t6.settings.currencyId; if (t16 == null) t16 = "1"; - row.push(new A.ReportNumberValue(value9, B.FormatNumberType_3, t16, _null, product.get$entityType(), value)); + row.push(new A.ReportNumberValue(value9, B.FormatNumberType_3, t16, product.get$entityType(), value)); } else if (t16 === B.ProductReportFields_14) row.push(new A.ReportIntValue(value9, product.get$entityType(), value)); else if (t17.get$runtimeType(value9) === B.Type_double_K1J || t17.get$runtimeType(value9) === B.Type_int_tHn) { t16 = t6.settings.currencyId; if (t16 == null) t16 = "1"; - row.push(new A.ReportNumberValue(value9, _null, t16, _null, product.get$entityType(), value)); + row.push(new A.ReportNumberValue(value9, _null, t16, product.get$entityType(), value)); } else row.push(new A.ReportStringValue(value9, product.get$entityType(), value)); } @@ -115503,7 +115503,7 @@ } else if (t12.get$runtimeType(value0) === B.Type_bool_lhE) row.push(new A.ReportBoolValue(value0, payment.get$entityType(), t10)); else if (t12.get$runtimeType(value0) === B.Type_double_K1J || t12.get$runtimeType(value0) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value0, _null, t11.currencyId, _null, payment.get$entityType(), t10)); + row.push(new A.ReportNumberValue(value0, _null, t11.currencyId, payment.get$entityType(), t10)); else row.push(new A.ReportStringValue(value0, payment.get$entityType(), t10)); } @@ -115618,7 +115618,7 @@ else if (t15.get$runtimeType(value2) === B.Type_bool_lhE) row.push(new A.ReportBoolValue(value2, t11, t10)); else if (t15.get$runtimeType(value2) === B.Type_double_K1J || t15.get$runtimeType(value2) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value2, _null, t12, _null, t11, t10)); + row.push(new A.ReportNumberValue(value2, _null, t12, t11, t10)); else row.push(new A.ReportStringValue(value2, t11, t10)); } @@ -115804,7 +115804,7 @@ if (t17.get$runtimeType(value4) === B.Type_bool_lhE) row.push(new A.ReportBoolValue(value4, t12, t11)); else if (t17.get$runtimeType(value4) === B.Type_double_K1J || t17.get$runtimeType(value4) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value4, _null, t16 === B.PurchaseOrderItemReportFields_4 ? _null : t13, _null, t12, t11)); + row.push(new A.ReportNumberValue(value4, _null, t16 === B.PurchaseOrderItemReportFields_4 ? _null : t13, t12, t11)); else row.push(new A.ReportStringValue(value4, t12, t11)); } @@ -116088,7 +116088,7 @@ currencyId0 = "1"; } else currencyId0 = currencyId; - row.push(new A.ReportNumberValue(value34, _null, currencyId0, value13, t11, t10)); + row.push(new A.ReportNumberValue(value34, _null, currencyId0, t11, t10)); } else row.push(new A.ReportStringValue(value34, t11, t10)); } @@ -116258,7 +116258,7 @@ if (t16.get$runtimeType(value5) === B.Type_bool_lhE) row.push(new A.ReportBoolValue(value5, t12, t11)); else if (t16.get$runtimeType(value5) === B.Type_double_K1J || t16.get$runtimeType(value5) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value5, _null, t15 === B.QuoteItemReportFields_4 ? _null : t9, _null, t12, t11)); + row.push(new A.ReportNumberValue(value5, _null, t15 === B.QuoteItemReportFields_4 ? _null : t9, t12, t11)); else row.push(new A.ReportStringValue(value5, t12, t11)); } @@ -116566,7 +116566,7 @@ if (currencyId == null) currencyId = "1"; } - row.push(new A.ReportNumberValue(value41, _null, currencyId, value17, t11, t10)); + row.push(new A.ReportNumberValue(value41, _null, currencyId, t11, t10)); } else row.push(new A.ReportStringValue(value41, t11, t10)); } @@ -116775,7 +116775,7 @@ if (t19.get$runtimeType(value15) === B.Type_bool_lhE) row.push(new A.ReportBoolValue(value15, t10, value)); else if (t19.get$runtimeType(value15) === B.Type_double_K1J || t19.get$runtimeType(value15) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value15, _null, t17, _null, t10, value)); + row.push(new A.ReportNumberValue(value15, _null, t17, t10, value)); else row.push(new A.ReportStringValue(value15, t10, value)); } @@ -117144,7 +117144,7 @@ if (currencyId == null) currencyId = "1"; } - row.push(new A.ReportNumberValue(value47, _null, currencyId, value21, t11, value0)); + row.push(new A.ReportNumberValue(value47, _null, currencyId, t11, value0)); } else row.push(new A.ReportStringValue(value47, t11, value0)); } @@ -117779,14 +117779,13 @@ this.entityType = t1; this.entityId = t2; }, - ReportNumberValue: function ReportNumberValue(t0, t1, t2, t3, t4, t5) { + ReportNumberValue: function ReportNumberValue(t0, t1, t2, t3, t4) { var _ = this; _.value = t0; _.formatNumberType = t1; _.currencyId = t2; - _.exchangeRate = t3; - _.entityType = t4; - _.entityId = t5; + _.entityType = t3; + _.entityId = t4; }, ReportBoolValue: function ReportBoolValue(t0, t1, t2) { this.value = t0; @@ -117946,7 +117945,7 @@ return new A.ReportsScreenVM(t1, t5, t3, groupTotals, new A.ReportsScreenVM_fromStore_closure(t1, reportSettings, store), new A.ReportsScreenVM_fromStore_closure0(_box_1, t1, groupTotals), new A.ReportsScreenVM_fromStore_closure1(store, report), new A.ReportsScreenVM_fromStore_closure2(store, t1), new A.ReportsScreenVM_fromStore_closure3(store, t1), new A.ReportsScreenVM_fromStore_closure4(t1, store)); }, calculateReportTotals(company, currencyMap, reportResult, reportSettings, reportState) { - var groupCurrencies, line, shouldConverCurrencies, i, row, columnIndex, toZone, groupCell, group, j, cell, column, currencyId, t3, t4, t5, t6, t7, t8, age, date, t9, cellValue, rate, rows, sortedColumns, + var groupCurrencies, line, shouldConverCurrencies, i, row, columnIndex, toZone, groupCell, group, j, cell, column, currencyId, t3, t4, t5, t6, t7, t8, age, date, t9, cellValue, toCurrency, rows, sortedColumns, t1 = type$.legacy_String, totals = A.LinkedHashMap_LinkedHashMap$_empty(t1, type$.legacy_Map_of_legacy_String_and_legacy_double), data = reportResult.data, @@ -118067,16 +118066,12 @@ t7 = false; if (t7) { cellValue = cell.value; - rate = cell.exchangeRate; - if (rate == null || rate === 0 || rate === 1) { - t7 = cell.currencyId; - t8 = company.settings.currencyId; - rate = A.getExchangeRate(currencyMap, t7, t8 == null ? "1" : t8); - } t7 = company.settings.currencyId; - if (t7 == null) - t7 = "1"; - cellValue = A.round(cellValue / rate, currencyMap._map$_map.$index(0, t7).precision); + t8 = t7 == null; + t9 = t8 ? "1" : t7; + toCurrency = currencyMap._map$_map.$index(0, t9); + t9 = cell.currencyId; + cellValue = A.round(cellValue * A.getExchangeRate(currencyMap, t9, t8 ? "1" : t7), toCurrency.precision); t7 = totals.$index(0, group); t7.$indexSet(0, column, t7.$index(0, column) + cellValue); } else { @@ -118396,7 +118391,7 @@ if (t23.get$runtimeType(value10) === B.Type_bool_lhE) row.push(new A.ReportBoolValue(value10, task.get$entityType(), value)); else if (t23.get$runtimeType(value10) === B.Type_double_K1J || t23.get$runtimeType(value10) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value10, _null, t21.currencyId, _null, task.get$entityType(), value)); + row.push(new A.ReportNumberValue(value10, _null, t21.currencyId, task.get$entityType(), value)); else row.push(new A.ReportStringValue(value10, task.get$entityType(), value)); } @@ -118535,7 +118530,7 @@ if (t23.get$runtimeType(value4) === B.Type_bool_lhE) row.push(new A.ReportBoolValue(value4, transaction.get$entityType(), value)); else if (t23.get$runtimeType(value4) === B.Type_double_K1J || t23.get$runtimeType(value4) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value4, _null, t22, _null, transaction.get$entityType(), value)); + row.push(new A.ReportNumberValue(value4, _null, t22, transaction.get$entityType(), value)); else row.push(new A.ReportStringValue(value4, transaction.get$entityType(), value)); } @@ -118580,7 +118575,7 @@ transactionReport_closure7: function transactionReport_closure7() { }, vendorReport(userCompany, reportsUIState, vendorMap, userMap, groupMap, staticState) { - var t2, columns, t3, t4, t5, t6, t7, vendor, contact, t8, row, t9, t10, t11, exchangeRate, value, t12, t13, t14, t15, value0, t16, value1, value2, value3, value4, t17, t18, value5, value6, value7, value8, value9, t19, t20, t21, t22, value10, value11, value12, value13, skip, t23, value14, t24, t25, selectedColumns, _null = null, + var t2, columns, t3, t4, t5, t6, t7, vendor, contact, t8, row, t9, t10, t11, value, t12, t13, t14, t15, value0, t16, value1, value2, value3, value4, t17, t18, value5, value6, value7, value8, value9, t19, t20, t21, t22, value10, value11, value12, value13, skip, t23, value14, t24, t25, selectedColumns, _null = null, data = A._setArrayType([], type$.JSArray_legacy_List_legacy_ReportElement), entities = A._setArrayType([], type$.JSArray_legacy_BaseEntity), t1 = userCompany.settings, @@ -118604,7 +118599,7 @@ t9 = staticState.currencyMap; t10 = vendor.currencyId; t11 = t5.settings.currencyId; - exchangeRate = A.getExchangeRate(t9, t10, t11 == null ? "1" : t11); + A.getExchangeRate(t9, t10, t11 == null ? "1" : t11); for (t11 = new J.ArrayIterator(t2, t2.length, t4), value = vendor.id, t12 = vendor.documents, t13 = vendor.createdAt, t14 = vendor.updatedAt, t15 = vendor.archivedAt > 0, value0 = !t8, t8 = vendor.createdUserId, t16 = vendor.assignedUserId, value1 = vendor.vatNumber, value2 = vendor.idNumber, value3 = vendor.number, value4 = vendor.phone, t17 = staticState.countryMap, t18 = vendor.countryId, value5 = vendor.postalCode, value6 = vendor.state, value7 = vendor.city, value8 = vendor.address2, value9 = vendor.address1, t19 = vendor.customValue4, t20 = vendor.customValue3, t21 = vendor.customValue2, t22 = vendor.customValue1, value10 = vendor.publicNotes, value11 = vendor.privateNotes, value12 = vendor.website, value13 = vendor.name, t13 *= 1000, t14 *= 1000, skip = false; t11.moveNext$0();) { t23 = t11.__interceptors$_current; switch (t23) { @@ -118752,7 +118747,7 @@ else if (t23 === B.VendorReportFields_34) row.push(new A.ReportIntValue(value14, vendor.get$entityType(), value)); else if (t24.get$runtimeType(value14) === B.Type_double_K1J || t24.get$runtimeType(value14) === B.Type_int_tHn) - row.push(new A.ReportNumberValue(value14, _null, t10, exchangeRate, vendor.get$entityType(), value)); + row.push(new A.ReportNumberValue(value14, _null, t10, vendor.get$entityType(), value)); else row.push(new A.ReportStringValue(A.S(value14), vendor.get$entityType(), value)); } @@ -502156,7 +502151,7 @@ row.push(new A.ReportIntValue(value, entity.get$entityType(), t6)); } else if (t6.get$runtimeType(value) === B.Type_double_K1J) { t6 = entity.get$id(entity); - row.push(new A.ReportNumberValue(value, _null, _null, _null, entity.get$entityType(), t6)); + row.push(new A.ReportNumberValue(value, _null, _null, entity.get$entityType(), t6)); } else if (t6.get$runtimeType(value) === B.Type_EntityType_6qb) { t6 = entity.get$id(entity); t7 = entity.get$entityType();