From 813663a87bba52c356d842f8c12ac8254e9a88f2 Mon Sep 17 00:00:00 2001 From: hillelcoren Date: Sat, 23 Apr 2022 21:29:21 +0000 Subject: [PATCH] Admin Portal - Profile --- public/main.profile.dart.js | 63 ++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/public/main.profile.dart.js b/public/main.profile.dart.js index 4332c007a6bd..88c4e8224687 100644 --- a/public/main.profile.dart.js +++ b/public/main.profile.dart.js @@ -298756,6 +298756,30 @@ } else return _this.taxRate1; }, + get$calculatetaxRate2() { + var t1, t2, _this = this; + if (_this.calculateTaxByAmount === true) { + t1 = _this.taxAmount2; + t2 = _this.amount; + if (_this.usesInclusiveTaxes) + return t1 / (t2 - t1) * 100; + else + return t1 / t2 * 100; + } else + return _this.taxRate2; + }, + get$calculatetaxRate3() { + var t1, t2, _this = this; + if (_this.calculateTaxByAmount === true) { + t1 = _this.taxAmount3; + t2 = _this.amount; + if (_this.usesInclusiveTaxes) + return t1 / (t2 - t1) * 100; + else + return t1 / t2 * 100; + } else + return _this.taxRate3; + }, get$taxAmount() { return this.get$calculateTaxAmount1() + this.get$calculateTaxAmount2() + this.get$calculateTaxAmount3(); }, @@ -298767,12 +298791,12 @@ t1 = _this.taxRate1; if (t1 !== 0) { t2 = _this.amount; - return t2 - t2 / (1 + t1 / 100); + return A.round(t2 - t2 / (1 + t1 / 100), 2); } } else { t1 = _this.taxRate1; if (t1 !== 0) - return _this.amount * t1 / 100; + return A.round(_this.amount * t1 / 100, 2); } return 0; }, @@ -298784,12 +298808,12 @@ t1 = _this.taxRate2; if (t1 !== 0) { t2 = _this.amount; - return t2 - t2 / (1 + t1 / 100); + return A.round(t2 - t2 / (1 + t1 / 100), 2); } } else { t1 = _this.taxRate2; if (t1 !== 0) - return _this.amount * t1 / 100; + return A.round(_this.amount * t1 / 100, 2); } return 0; }, @@ -298801,12 +298825,12 @@ t1 = _this.taxRate3; if (t1 !== 0) { t2 = _this.amount; - return t2 - t2 / (1 + t1 / 100); + return A.round(t2 - t2 / (1 + t1 / 100), 2); } } else { t1 = _this.taxRate3; if (t1 !== 0) - return _this.amount * t1 / 100; + return A.round(_this.amount * t1 / 100, 2); } return 0; }, @@ -345306,27 +345330,12 @@ t3 = t2 >= 2; t4 = t3 ? t1.taxName2 : ""; b.get$_invoice_model$_$this()._taxName2 = t4; - if (t3) - if (t1.calculateTaxByAmount === true) { - t3 = t1.taxAmount2; - t3 = t3 / (t1.amount - t3) * 100; - } else - t3 = t1.taxRate2; - else - t3 = 0; + t3 = t3 ? t1.get$calculatetaxRate2() : 0; b.get$_invoice_model$_$this()._taxRate2 = t3; t2 = t2 >= 3; t3 = t2 ? t1.taxName3 : ""; b.get$_invoice_model$_$this()._taxName3 = t3; - if (t2) - if (t1.calculateTaxByAmount === true) { - t2 = t1.taxAmount3; - t2 = t2 / (t1.amount - t2) * 100; - t1 = t2; - } else - t1 = t1.taxRate3; - else - t1 = 0; + t1 = t2 ? t1.get$calculatetaxRate3() : 0; b.get$_invoice_model$_$this()._taxRate3 = t1; return b; }, @@ -429098,14 +429107,18 @@ _this._widget.viewModel.onSettingsChanged.call$1(settings); }, _templates_and_reminders$_onTabChanged$0() { - var store, _this = this, + var store, t2, previewIndex, _this = this, t1 = _this._framework$_element; t1.toString; store = A.StoreProvider_of(t1, type$.legacy_AppState); t1 = _this._templates_and_reminders$_controller._tab_controller$_index; store.get$_dispatchers()[0].call$1(new A.UpdateSettingsTab(t1)); _this.setState$1(new A._TemplatesAndRemindersState__onTabChanged_closure(_this)); - if (_this._templates_and_reminders$_controller._tab_controller$_index !== 2) + t1 = A._lateReadCheck(store.__Store__state, "_state"); + t2 = t1.userCompanyStates; + t1 = t1.uiState.selectedCompanyIndex; + previewIndex = t2._list[t1].userCompany.company.markdownEmailEnabled ? 2 : 1; + if (_this._templates_and_reminders$_controller._tab_controller$_index !== previewIndex) return; _this._renderTemplate$0(); },