From 04051785838855914da47edf6ca641ca7920a17a Mon Sep 17 00:00:00 2001 From: hillelcoren Date: Fri, 29 Apr 2022 07:47:21 +0000 Subject: [PATCH] Admin Portal - Profile --- public/main.profile.dart.js | 135 +++++++++++++++++++++++------------- 1 file changed, 86 insertions(+), 49 deletions(-) diff --git a/public/main.profile.dart.js b/public/main.profile.dart.js index c70dd95084df..cfa8159a334f 100644 --- a/public/main.profile.dart.js +++ b/public/main.profile.dart.js @@ -391393,7 +391393,7 @@ A.ClientPdfVM.prototype = {}; A.ClientPresenter.prototype = { getField$2$context$field(context, field) { - var t1, t2, _this = this, _null = null, + var t1, t2, contacts, _this = this, _null = null, client = type$.legacy_ClientEntity._as(_this.entity), state = A._lateReadCheck(A.StoreProvider_of(context, type$.legacy_AppState).__Store__state, "_state"); switch (field) { @@ -391476,7 +391476,8 @@ return new A.LinkTextRelatedEntity(t1._list[t2].groupState.$get$1(0, client.groupId), client, _null); case "contacts": t1 = client.contacts._list; - return A.Text$(new A.MappedListIterable(t1, new A.ClientPresenter_getField_closure0(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,String*>")).join$1(0, "\n"), _null, 3, B.TextOverflow_2, _null, _null, _null, _null, _null, _null); + contacts = new A.MappedListIterable(t1, new A.ClientPresenter_getField_closure0(), A._arrayInstanceType(t1)._eval$1("MappedListIterable<1,String*>")).join$1(0, "\n"); + return A.Tooltip$(A.Text$(contacts, _null, 2, B.TextOverflow_2, _null, _null, _null, _null, _null, _null), contacts); } return _this.super$EntityPresenter$getField(context, field); } @@ -406503,8 +406504,11 @@ $.WidgetsBinding__instance.SchedulerBinding__postFrameCallbacks.push(new A._InvoiceEditItemsDesktopState__onFocusChange_closure()); }, build$1(_, context) { - var t4, company, invoice, t5, client, t6, precision, lineItems, includedLineItems, productState, productIds, customField1, customField2, customField3, customField4, tableFontColor, tableHeaderColor, tableHeaderColumns, i, column, label, isNumeric, t7, t8, t9, t10, t11, index, t12, t13, t14, _this = this, _null = null, + var t4, company, invoice, t5, client, t6, precision, lineItems, includedLineItems, productState, productIds, customField1, customField2, customField3, customField4, tableFontColor, tableHeaderColor, tableHeaderColumns, translations, i, column, label, t7, isNumeric, t8, t9, t10, t11, index, t12, t13, t14, _this = this, _null = null, _s4_ = "item", _s11_ = "description", + _s8_ = "quantity", + _s9_ = "unit_cost", + _s8_0 = "discount", t1 = A.Localizations_of(context, B.Type_AppLocalization_KyD, type$.legacy_AppLocalization), theme = A.Theme_of(context), viewModel = _this._widget.viewModel, @@ -406546,15 +406550,23 @@ tableHeaderColor = ""; t2 = type$.JSArray_legacy_Widget; tableHeaderColumns = A._setArrayType([], t2); - for (t3 = _this._invoice_edit_items_desktop$_columns, t4 = type$.JSArray_legacy_String, i = 0; i < t3.length; ++i) { - column = t3[i]; + t3 = company.settings; + translations = t3.translations; + for (t4 = _this._invoice_edit_items_desktop$_columns, t6 = type$.JSArray_legacy_String, t3 = t3.enableInclusiveTaxes, i = 0; i < t4.length; ++i) { + column = t4[i]; if (column === "item") { - t6 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t1.localeCode), "item"); - label = t6 == null ? "" : t6; + label = translations._map$_map.$index(0, _s4_); + if (label == null) { + t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t1.localeCode), _s4_); + label = t7 == null ? "" : t7; + } isNumeric = false; } else if (column === "description") { - t6 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t1.localeCode), _s11_); - label = t6 == null ? "" : t6; + label = translations._map$_map.$index(0, _s11_); + if (label == null) { + t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t1.localeCode), _s11_); + label = t7 == null ? "" : t7; + } isNumeric = false; } else if (column === "custom1") { label = company.getCustomFieldLabel$1(customField1); @@ -406568,39 +406580,54 @@ } else if (column === "custom4") { label = company.getCustomFieldLabel$1(customField4); isNumeric = false; - } else if (B.JSArray_methods.contains$1(A._setArrayType(["tax1", "tax2", "tax3"], t4), column)) { - t6 = t1.localeCode; - t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), "tax"); - if (t7 == null) - t7 = ""; - if (company.settings.enableInclusiveTaxes) { - t6 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), "inclusive"); - t6 = " - " + (t6 == null ? "" : t6); + } else if (B.JSArray_methods.contains$1(A._setArrayType(["tax1", "tax2", "tax3"], t6), column)) { + t7 = t1.localeCode; + t8 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t7), "tax"); + if (t8 == null) + t8 = ""; + if (t3) { + t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t7), "inclusive"); + t7 = " - " + (t7 == null ? "" : t7); } else - t6 = ""; - label = t7 + t6; + t7 = ""; + label = t8 + t7; isNumeric = false; } else if (column === "quantity") { if (_this._widget.isTasks) { - t6 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t1.localeCode), "hours"); - label = t6 == null ? "" : t6; + label = translations._map$_map.$index(0, "hours"); + if (label == null) { + t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t1.localeCode), "hours"); + label = t7 == null ? "" : t7; + } } else { - t6 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t1.localeCode), "quantity"); - label = t6 == null ? "" : t6; + label = translations._map$_map.$index(0, _s8_); + if (label == null) { + t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t1.localeCode), _s8_); + label = t7 == null ? "" : t7; + } } isNumeric = true; } else if (column === "unit_cost") { if (_this._widget.isTasks) { - t6 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t1.localeCode), "rate"); - label = t6 == null ? "" : t6; + label = translations._map$_map.$index(0, "rate"); + if (label == null) { + t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t1.localeCode), "rate"); + label = t7 == null ? "" : t7; + } } else { - t6 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t1.localeCode), "unit_cost"); - label = t6 == null ? "" : t6; + label = translations._map$_map.$index(0, _s9_); + if (label == null) { + t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t1.localeCode), _s9_); + label = t7 == null ? "" : t7; + } } isNumeric = true; } else if (column === "discount") { - t6 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t1.localeCode), "discount"); - label = t6 == null ? "" : t6; + label = translations._map$_map.$index(0, _s8_0); + if (label == null) { + t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t1.localeCode), _s8_0); + label = t7 == null ? "" : t7; + } isNumeric = true; } else { label = ""; @@ -406618,36 +406645,36 @@ t4.push(A.IconButton$(B.Alignment_0_0, t1, _null, true, A.Icon$(B.IconData_57706_MaterialIcons_null_false, _null, _null), _null, new A._InvoiceEditItemsDesktopState_build_closure1(_this), B.EdgeInsets_8_8_8_8, _null, _null, _null)); return A.FormCard$(_null, A._setArrayType([A.DecoratedBox$(A.Row$(t4, B.CrossAxisAlignment_2, B.MainAxisAlignment_0, B.MainAxisSize_1, _null), t3, B.DecorationPosition_0), new A.ReorderableListView(new A._InvoiceEditItemsDesktopState_build_closure2(_this, lineItems, invoice, precision), J.get$length$asx(lineItems._copy_on_write_list$_list), new A._InvoiceEditItemsDesktopState_build_closure3(lineItems, viewModel), false, _null, false, true, _null)], t2), _null, 4, false, _null, false, B.EdgeInsets_12_0_12_0); } - t4 = J.where$1$ax(lineItems._copy_on_write_list$_list, new A._InvoiceEditItemsDesktopState_build_closure4()); - if (!t4.get$iterator(t4).moveNext$0()) { - t4 = A.InvoiceItemEntity_InvoiceItemEntity(_null, company.defaultQuantity ? 1 : 0); + t3 = J.where$1$ax(lineItems._copy_on_write_list$_list, new A._InvoiceEditItemsDesktopState_build_closure4()); + if (!t3.get$iterator(t3).moveNext$0()) { + t3 = A.InvoiceItemEntity_InvoiceItemEntity(_null, company.defaultQuantity ? 1 : 0); lineItems._maybeCopyBeforeWrite$0(); - J.add$1$ax(lineItems._copy_on_write_list$_list, t4); + J.add$1$ax(lineItems._copy_on_write_list$_list, t3); } - t4 = t1.get$lineTotal(); + t3 = t1.get$lineTotal(); t6 = A.Icon$(B.IconData_58919_MaterialIcons_null_false, _null, _null); t7 = tableFontColor.length !== 0 ? A.convertHexStringToColor(tableFontColor) : _null; t8 = new A.WhereIterable(includedLineItems, new A._InvoiceEditItemsDesktopState_build_closure5(), A._arrayInstanceType(includedLineItems)._eval$1("WhereIterable<1>")); - B.JSArray_methods.addAll$1(tableHeaderColumns, A._setArrayType([new A.TableHeader(t4, true, false, _null), A.IconButton$(B.Alignment_0_0, t7, _null, true, t6, _null, t8.get$length(t8) < 2 ? _null : new A._InvoiceEditItemsDesktopState_build_closure6(_this), B.EdgeInsets_8_8_8_8, _null, _null, _null)], t2)); - t2 = A.LinkedHashMap_LinkedHashMap$_literal([B.JSArray_methods.indexOf$1(t3, "item"), new A.FlexColumnWidth(1.3), B.JSArray_methods.indexOf$1(t3, _s11_), new A.FlexColumnWidth(2.2), t3.length + 1, new A.FixedColumnWidth(40)], type$.legacy_int, type$.legacy_TableColumnWidth); - t4 = "__datatable_" + A.S(_this._invoice_edit_items_desktop$_updatedAt) + "__"; + B.JSArray_methods.addAll$1(tableHeaderColumns, A._setArrayType([new A.TableHeader(t3, true, false, _null), A.IconButton$(B.Alignment_0_0, t7, _null, true, t6, _null, t8.get$length(t8) < 2 ? _null : new A._InvoiceEditItemsDesktopState_build_closure6(_this), B.EdgeInsets_8_8_8_8, _null, _null, _null)], t2)); + t2 = A.LinkedHashMap_LinkedHashMap$_literal([B.JSArray_methods.indexOf$1(t4, _s4_), new A.FlexColumnWidth(1.3), B.JSArray_methods.indexOf$1(t4, _s11_), new A.FlexColumnWidth(2.2), t4.length + 1, new A.FixedColumnWidth(40)], type$.legacy_int, type$.legacy_TableColumnWidth); + t3 = "__datatable_" + A.S(_this._invoice_edit_items_desktop$_updatedAt) + "__"; t6 = type$.ValueKey_legacy_String; t7 = A._setArrayType([new A.TableRow(_null, tableHeaderColor.length !== 0 ? new A.BoxDecoration(A.convertHexStringToColor(tableHeaderColor), _null, _null, _null, _null, _null, B.BoxShape_0) : new A.BoxDecoration(_null, _null, _null, _null, _null, _null, B.BoxShape_0), tableHeaderColumns)], type$.JSArray_legacy_TableRow); - for (t8 = A._arrayInstanceType(t3)._eval$1("MappedListIterable<1,Focus*>"), t9 = t8._eval$1("ListIterable.E"), t10 = type$.legacy_Widget, t11 = type$.PopupMenuButton_legacy_String, index = 0; index < J.get$length$asx(lineItems._copy_on_write_list$_list); ++index) { + for (t8 = A._arrayInstanceType(t4)._eval$1("MappedListIterable<1,Focus*>"), t9 = t8._eval$1("ListIterable.E"), t10 = type$.legacy_Widget, t11 = type$.PopupMenuButton_legacy_String, index = 0; index < J.get$length$asx(lineItems._copy_on_write_list$_list); ++index) { if (!(J.$index$asx(lineItems._copy_on_write_list$_list, index).typeId === "2" && _this._widget.isTasks)) t12 = J.$index$asx(lineItems._copy_on_write_list$_list, index).typeId !== "2" && !_this._widget.isTasks || J.get$isEmpty$asx(J.$index$asx(lineItems._copy_on_write_list$_list, index)); else t12 = true; if (t12) { t12 = "__line_item_" + index + "_" + A.S(J.$index$asx(lineItems._copy_on_write_list$_list, index).createdAt) + "__"; - t13 = A.List_List$of(A.List_List$of(new A.MappedListIterable(t3, new A._InvoiceEditItemsDesktopState_build_closure7(_this, index, lineItems, productIds, productState, state, invoice, company, viewModel, theme, customField1, customField2, customField3, customField4, context), t8), true, t9), true, t10); + t13 = A.List_List$of(A.List_List$of(new A.MappedListIterable(t4, new A._InvoiceEditItemsDesktopState_build_closure7(_this, index, lineItems, productIds, productState, state, invoice, company, viewModel, theme, customField1, customField2, customField3, customField4, context), t8), true, t9), true, t10); t14 = "__total_" + index + "_" + A.S(J.total$2$x(J.$index$asx(lineItems._copy_on_write_list$_list, index), invoice, precision)) + "_" + t5 + "__"; t13.push(new A.Padding(B.EdgeInsets_0_0_16_0, A.TextFormField$(true, _null, false, _null, _null, B.InputDecoration_C4W, false, false, _null, A.formatNumber(J.total$2$x(J.$index$asx(lineItems._copy_on_write_list$_list, index), invoice, precision), context, t5, _null, B.FormatNumberType_0, true, _null, false), _null, new A.ValueKey(t14, t6), _null, 1, _null, false, _null, _null, _null, _null, true, _null, _null, B.TextAlign_1, _null, _null), _null)); t13.push(new A.PopupMenuButton(new A._InvoiceEditItemsDesktopState_build_closure8(_this, includedLineItems, lineItems, index, t1), _null, new A._InvoiceEditItemsDesktopState_build_closure9(_this, t1, lineItems, index, viewModel), _null, B.EdgeInsets_8_8_8_8, _null, new A.Icon(B.IconData_58372_MaterialIcons_null_false, _null, _null, _null), !J.get$isEmpty$asx(J.$index$asx(lineItems._copy_on_write_list$_list, index)), _null, _null, t11)); t7.push(new A.TableRow(new A.ValueKey(t12, t6), _null, t13)); } } - return A.FormCard$(A.Table$(_null, t7, t2, B.FlexColumnWidth_1, B.TableCellVerticalAlignment_2, new A.ValueKey(t4, t6)), _null, _null, 4, false, _null, false, B.EdgeInsets_12_0_12_0); + return A.FormCard$(A.Table$(_null, t7, t2, B.FlexColumnWidth_1, B.TableCellVerticalAlignment_2, new A.ValueKey(t3, t6)), _null, _null, 4, false, _null, false, B.EdgeInsets_12_0_12_0); } }; A._InvoiceEditItemsDesktopState__updateColumns_closure.prototype = { @@ -420402,13 +420429,19 @@ }; A.ReportsScreenVM_fromStore__closure1.prototype = { call$1(row) { - var t2, t3, t4, i, column, value, + var t2, t3, t4, i, column, t5, value, t6, t1 = this._box_0; t1.csvData += "\n"; for (t2 = J.getInterceptor$asx(row), t3 = this._box_1, t4 = this.context, i = 0; i < t2.get$length(row); ++i) { column = t3.reportResult.columns[i]; - value = J.trim$0$s(t2.$index(row, i).renderText$2(t4, column)); - t1.csvData = t1.csvData + ('"' + value + '",'); + t5 = J.trim$0$s(t2.$index(row, i).renderText$2(t4, column)); + value = A.stringReplaceAllUnchecked(t5, '"', '\\"'); + t5 = t1.csvData; + if (!A.stringContainsUnchecked(value, " ", 0)) + t6 = A.stringContainsUnchecked(value, '"', 0); + else + t6 = true; + t1.csvData = t5 + (t6 ? '"' + value + '",' : value + ","); } t2 = t1.csvData; t1.csvData = B.JSString_methods.substring$2(t2, 0, t2.length - 1); @@ -420437,8 +420470,10 @@ A.ReportsScreenVM_fromStore__closure5.prototype = { call$1(group) { var row = this.groupTotals.totals.$index(0, group), - t1 = this._box_0; - t1.csvData = t1.csvData + (A.S(group) + "," + J.toInt$0$n(row.$index(0, "count"))); + t1 = this._box_0, + t2 = t1.csvData, + t3 = J.trim$0$s(group); + t1.csvData = t2 + ('"' + A.stringReplaceAllUnchecked(t3, '"', '\\"') + '",' + J.toInt$0$n(row.$index(0, "count"))); B.JSArray_methods.forEach$1(this.columns, new A.ReportsScreenVM_fromStore___closure(t1, row)); t1.csvData += "\n"; }, @@ -420446,10 +420481,12 @@ }; A.ReportsScreenVM_fromStore___closure.prototype = { call$1(column) { - var value = J.toString$0$(this.row.$index(0, column)), - t1 = this._box_0, - t2 = t1.csvData; - t1.csvData = t2 + (B.JSString_methods.contains$1(value, " ") ? ',"' + value + '"' : "," + value); + var t2, + t1 = B.JSString_methods.trim$0(J.toString$0$(this.row.$index(0, column))), + value = A.stringReplaceAllUnchecked(t1, '"', '\\"'); + t1 = this._box_0; + t2 = t1.csvData; + t1.csvData = t2 + (B.JSString_methods.contains$1(value, " ") || B.JSString_methods.contains$1(value, '"') ? ',"' + value + '"' : "," + value); }, $signature: 9 };