diff --git a/public/main.profile.dart.js b/public/main.profile.dart.js index 727650beff63..71502ed0c52f 100644 --- a/public/main.profile.dart.js +++ b/public/main.profile.dart.js @@ -284171,11 +284171,19 @@ return true; }, compareTo$6$clientMap$invoice$recurringPrefix$sortAscending$sortField$userMap(_, clientMap, invoice, recurringPrefix, sortAscending, sortField, userMap) { - var invoiceANumber, invoiceBNumber, t1, response, stateA, stateB, t2, userA, userB, clientA, clientB, _null = null, + var clientB, invoiceANumber, invoiceBNumber, response, stateA, stateB, userA, userB, _null = null, _s10_ = "ZZZZZZZZZZ", _s8_ = "archived", invoiceA = sortAscending ? this : invoice, - invoiceB = sortAscending ? invoice : this; + invoiceB = sortAscending ? invoice : this, + t1 = invoiceA.clientId, + t2 = clientMap._map$_map, + clientA = t2.$index(0, t1); + if (clientA == null) + clientA = A.ClientEntity_ClientEntity(_null, _null, _null, _null); + clientB = t2.$index(0, invoiceB.clientId); + if (clientB == null) + clientB = A.ClientEntity_ClientEntity(_null, _null, _null, _null); switch (sortField) { case "number": invoiceANumber = invoiceA.number; @@ -284302,14 +284310,6 @@ response = B.JSString_methods.compareTo$1(invoiceA.customValue4.toLowerCase(), invoiceB.customValue4.toLowerCase()); break; case "client": - t1 = invoiceA.clientId; - t2 = clientMap._map$_map; - clientA = t2.$index(0, t1); - if (clientA == null) - clientA = A.ClientEntity_ClientEntity(_null, _null, _null, _null); - clientB = t2.$index(0, invoiceB.clientId); - if (clientB == null) - clientB = A.ClientEntity_ClientEntity(_null, _null, _null, _null); response = B.JSString_methods.compareTo$1(A.String_String$fromCharCodes(A.replaceCodeUnits(new A.CodeUnits(clientA.displayName)), 0, _null).toLowerCase(), A.String_String$fromCharCodes(A.replaceCodeUnits(new A.CodeUnits(clientB.displayName)), 0, _null).toLowerCase()); break; case "is_viewed": @@ -284324,6 +284324,18 @@ case "auto_bill": response = J.compareTo$1$ns(invoiceA.autoBill, invoiceB.autoBill); break; + case "client_city": + response = B.JSString_methods.compareTo$1(clientA.city, clientB.city); + break; + case "client_state": + response = B.JSString_methods.compareTo$1(clientA.state, clientB.state); + break; + case "client_postal_code": + response = B.JSString_methods.compareTo$1(clientA.postalCode, clientB.postalCode); + break; + case "client_country": + response = B.JSString_methods.compareTo$1(clientA.countryId, clientB.countryId); + break; default: A.print("## ERROR: sort by invoice." + sortField + " is not implemented"); response = 0; @@ -365658,24 +365670,36 @@ return new A.EmailPreview(_this._invoice_email_view$_subjectPreview, _this._invoice_email_view$_bodyPreview, t1, _null); }, _buildEdit$1(context) { - var enableCustomEmail, t4, t5, _this = this, _null = null, + var t4, enableCustomEmail, t5, _this = this, _null = null, t1 = A.Localizations_of(context, B.Type_AppLocalization_KyD, type$.legacy_AppLocalization), state = _this._widget.viewModel.state, t2 = state.authState, t3 = t2.get$isHosted(); if (t3) { if (A.cleanApiUrl(t2.url) === "https://invoicing.co") { - t2 = state.userCompanyStates; - t3 = state.uiState.selectedCompanyIndex; - t3 = t2._list[t3].userCompany.account.plan === "enterprise"; - t2 = t3; + t3 = state.userCompanyStates; + t4 = state.uiState.selectedCompanyIndex; + t4 = t3._list[t4].userCompany.account.plan === "enterprise"; + t3 = t4; } else - t2 = true; - if (!t2) { - t2 = state.userCompanyStates; - t3 = state.uiState.selectedCompanyIndex; - t3 = t2._list[t3].userCompany.account.plan === "pro"; - enableCustomEmail = t3; + t3 = true; + if (!t3) { + t3 = state.userCompanyStates; + t4 = state.uiState.selectedCompanyIndex; + t4 = t3._list[t4].userCompany.account.plan === "pro"; + t3 = t4; + } else + t3 = true; + if (!t3) { + t2 = t2.get$isHosted(); + if (t2) { + t2 = state.userCompanyStates; + t3 = state.uiState.selectedCompanyIndex; + t3 = t2._list[t3].userCompany.account.trialPlan.length !== 0; + t2 = t3; + } else + t2 = false; + enableCustomEmail = t2; } else enableCustomEmail = true; } else @@ -371480,7 +371504,7 @@ }; A._LoginState_build_closure16.prototype = { call$0() { - A.launch("https://status.invoiceninja.com", null, false); + A.launch("https://status.invoiceninja.com/", null, false); }, $signature: 1 }; @@ -377328,10 +377352,16 @@ A.CreditPdfVM.prototype = {}; A.CreditPresenter.prototype = { getField$2$context$field(context, field) { - var t2, contact, _this = this, _null = null, + var t4, t5, client, contact, _this = this, _null = null, t1 = A.Localizations_of(context, B.Type_AppLocalization_KyD, type$.legacy_AppLocalization), state = A._lateReadCheck(A.StoreProvider_of(context, type$.legacy_AppState).__Store__state, "_state"), - credit = type$.legacy_InvoiceEntity._as(_this.entity); + credit = type$.legacy_InvoiceEntity._as(_this.entity), + t2 = state.userCompanyStates, + t3 = state.uiState.selectedCompanyIndex; + t2 = t2._list; + t4 = t2[t3].clientState; + t5 = credit.clientId; + client = t4.$get$1(0, t5); switch (field) { case "status": return new A.EntityStatusChip(credit, 105, _null); @@ -377339,12 +377369,8 @@ t2 = credit.number; return A.Text$(t2.length === 0 ? t1.get$pending(t1) : t2, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "client": - t1 = state.userCompanyStates; - t2 = state.uiState.selectedCompanyIndex; - t2 = t1._list[t2].clientState.map; - t1 = credit.clientId; - t2 = t2._map$_map.$index(0, t1); - return A.Text$((t2 == null ? A.ClientEntity_ClientEntity(_null, t1, _null, _null) : t2).displayName, _null, _null, _null, _null, _null, _null, _null, _null, _null); + t1 = t2[t3].clientState.map._map$_map.$index(0, t5); + return A.Text$((t1 == null ? A.ClientEntity_ClientEntity(_null, t5, _null, _null) : t1).displayName, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "date": return A.Text$(A.formatDate(credit.date, context, true, true, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "last_sent_date": @@ -377352,11 +377378,10 @@ case "valid_until": return A.Text$(A.formatDate(credit.dueDate, context, true, true, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "amount": - return new A.Align(B.Alignment_1_0, _null, _null, A.Text$(A.formatNumber(credit.amount, context, credit.clientId, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null), _null); + return new A.Align(B.Alignment_1_0, _null, _null, A.Text$(A.formatNumber(credit.amount, context, t5, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null), _null); case "remaining": case "balance": - t1 = credit.statusId !== "1" ? credit.balance : credit.amount; - return new A.Align(B.Alignment_1_0, _null, _null, A.Text$(A.formatNumber(t1, context, credit.clientId, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null), _null); + return new A.Align(B.Alignment_1_0, _null, _null, A.Text$(A.formatNumber(credit.statusId !== "1" ? credit.balance : credit.amount, context, t5, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null), _null); case "custom1": return A.Text$(_this.presentCustomField$2(context, credit.customValue1), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "custom2": @@ -377372,30 +377397,36 @@ case "discount": t1 = credit.isAmountDiscount; t2 = credit.discount; - return A.Text$(t1 ? A.formatNumber(t2, context, credit.clientId, _null, B.FormatNumberType_0, true, _null, false) : A.formatNumber(t2, context, _null, _null, B.FormatNumberType_1, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); + return A.Text$(t1 ? A.formatNumber(t2, context, t5, _null, B.FormatNumberType_0, true, _null, false) : A.formatNumber(t2, context, _null, _null, B.FormatNumberType_1, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "po_number": return A.Text$(credit.poNumber, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "documents": return A.Text$("" + credit.documents._list.length, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "tax_amount": - return A.Text$(A.formatNumber(credit.taxAmount, context, credit.clientId, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); + return A.Text$(A.formatNumber(credit.taxAmount, context, t5, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "exchange_rate": return A.Text$(A.formatNumber(credit.exchangeRate, context, _null, _null, B.FormatNumberType_3, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "is_viewed": return A.Text$(credit.get$isViewed() ? t1.get$yes() : t1.get$no(), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "project": - t1 = state.userCompanyStates; - t2 = state.uiState.selectedCompanyIndex; - return A.Text$(t1._list[t2].projectState.$get$1(0, credit.projectId).name, _null, _null, _null, _null, _null, _null, _null, _null, _null); + return A.Text$(t2[t3].projectState.$get$1(0, credit.projectId).name, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "vendor": - t1 = state.userCompanyStates; - t2 = state.uiState.selectedCompanyIndex; - return A.Text$(t1._list[t2].vendorState.$get$1(0, credit.vendorId).name, _null, _null, _null, _null, _null, _null, _null, _null, _null); + return A.Text$(t2[t3].vendorState.$get$1(0, credit.vendorId).name, _null, _null, _null, _null, _null, _null, _null, _null, _null); + case "client_state": + return A.Text$(client.state, _null, _null, _null, _null, _null, _null, _null, _null, _null); + case "client_city": + return A.Text$(client.city, _null, _null, _null, _null, _null, _null, _null, _null, _null); + case "client_postal_code": + return A.Text$(client.postalCode, _null, _null, _null, _null, _null, _null, _null, _null, _null); + case "client_country": + t1 = state.staticState.countryMap; + t2 = client.countryId; + t2 = t1._map$_map.$index(0, t2); + t1 = t2 == null ? _null : t2.name; + return A.Text$(t1 == null ? "" : t1, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "contact_name": case "contact_email": - t1 = state.userCompanyStates; - t2 = state.uiState.selectedCompanyIndex; - contact = A.creditContactSelector(credit, t1._list[t2].clientState.$get$1(0, credit.clientId)); + contact = A.creditContactSelector(credit, t2[t3].clientState.$get$1(0, t5)); if (field === "contact_name") { t1 = contact == null ? _null : contact.get$fullName(); return A.Text$(t1 == null ? "" : t1, _null, _null, _null, _null, _null, _null, _null, _null, _null); @@ -377443,6 +377474,10 @@ t7.push("vendor"); t7.push("contact_name"); t7.push("contact_email"); + t7.push("client_state"); + t7.push("client_city"); + t7.push("client_postal_code"); + t7.push("client_country"); t8 = A._setArrayType(["status", "number", "client", "amount", "date", "remaining"], t6); t6 = A._setArrayType(["number", "amount", "updated_at"], t6); t7 = A.AppBottomBar$(company.getCustomFieldValues$2$excludeBlank("invoice1", true), company.getCustomFieldValues$2$excludeBlank("invoice2", true), company.getCustomFieldValues$2$excludeBlank("invoice3", true), company.getCustomFieldValues$2$excludeBlank("invoice4", true), t8, B.EntityType_credit, false, B.List_empty16, new A.CreditScreen_build_closure(store), new A.CreditScreen_build_closure0(store), new A.CreditScreen_build_closure1(store), new A.CreditScreen_build_closure2(store), new A.CreditScreen_build_closure3(store), new A.CreditScreen_build_closure4(store), new A.CreditScreen_build_closure5(store), _null, t6, B.List_empty17, t7); @@ -389858,10 +389893,16 @@ A.InvoicePdfVM.prototype = {}; A.InvoicePresenter.prototype = { getField$2$context$field(context, field) { - var t2, contact, _this = this, _null = null, + var t4, t5, client, contact, _this = this, _null = null, t1 = A.Localizations_of(context, B.Type_AppLocalization_KyD, type$.legacy_AppLocalization), state = A._lateReadCheck(A.StoreProvider_of(context, type$.legacy_AppState).__Store__state, "_state"), - invoice = type$.legacy_InvoiceEntity._as(_this.entity); + invoice = type$.legacy_InvoiceEntity._as(_this.entity), + t2 = state.userCompanyStates, + t3 = state.uiState.selectedCompanyIndex; + t2 = t2._list; + t4 = t2[t3].clientState; + t5 = invoice.clientId; + client = t4.$get$1(0, t5); switch (field) { case "status": return new A.EntityStatusChip(invoice, 105, _null); @@ -389869,20 +389910,12 @@ t2 = invoice.number; return A.Text$(t2.length === 0 ? t1.get$pending(t1) : t2, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "client": - t1 = state.userCompanyStates; - t2 = state.uiState.selectedCompanyIndex; - t2 = t1._list[t2].clientState.map; - t1 = invoice.clientId; - t2 = t2._map$_map.$index(0, t1); - return A.Text$((t2 == null ? A.ClientEntity_ClientEntity(_null, t1, _null, _null) : t2).displayName, _null, _null, _null, _null, _null, _null, _null, _null, _null); + t1 = t2[t3].clientState.map._map$_map.$index(0, t5); + return A.Text$((t1 == null ? A.ClientEntity_ClientEntity(_null, t5, _null, _null) : t1).displayName, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "project": - t1 = state.userCompanyStates; - t2 = state.uiState.selectedCompanyIndex; - return A.Text$(t1._list[t2].projectState.$get$1(0, invoice.projectId).name, _null, _null, _null, _null, _null, _null, _null, _null, _null); + return A.Text$(t2[t3].projectState.$get$1(0, invoice.projectId).name, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "vendor": - t1 = state.userCompanyStates; - t2 = state.uiState.selectedCompanyIndex; - return A.Text$(t1._list[t2].vendorState.$get$1(0, invoice.vendorId).name, _null, _null, _null, _null, _null, _null, _null, _null, _null); + return A.Text$(t2[t3].vendorState.$get$1(0, invoice.vendorId).name, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "date": return A.Text$(A.formatDate(invoice.date, context, true, true, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "last_sent_date": @@ -389898,10 +389931,9 @@ case "reminder_last_sent": return A.Text$(A.formatDate(invoice.reminderLastSent, context, true, true, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "amount": - return new A.Align(B.Alignment_1_0, _null, _null, A.Text$(A.formatNumber(invoice.amount, context, invoice.clientId, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null), _null); + return new A.Align(B.Alignment_1_0, _null, _null, A.Text$(A.formatNumber(invoice.amount, context, t5, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null), _null); case "balance": - t1 = invoice.statusId !== "1" ? invoice.balance : invoice.amount; - return new A.Align(B.Alignment_1_0, _null, _null, A.Text$(A.formatNumber(t1, context, invoice.clientId, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null), _null); + return new A.Align(B.Alignment_1_0, _null, _null, A.Text$(A.formatNumber(invoice.statusId !== "1" ? invoice.balance : invoice.amount, context, t5, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null), _null); case "due_date": return A.Text$(A.formatDate(invoice.dueDate, context, true, true, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "custom1": @@ -389919,24 +389951,34 @@ case "discount": t1 = invoice.isAmountDiscount; t2 = invoice.discount; - return A.Text$(t1 ? A.formatNumber(t2, context, invoice.clientId, _null, B.FormatNumberType_0, true, _null, false) : A.formatNumber(t2, context, _null, _null, B.FormatNumberType_1, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); + return A.Text$(t1 ? A.formatNumber(t2, context, t5, _null, B.FormatNumberType_0, true, _null, false) : A.formatNumber(t2, context, _null, _null, B.FormatNumberType_1, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "po_number": return A.Text$(invoice.poNumber, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "documents": return A.Text$("" + invoice.documents._list.length, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "tax_amount": - return A.Text$(A.formatNumber(invoice.taxAmount, context, invoice.clientId, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); + return A.Text$(A.formatNumber(invoice.taxAmount, context, t5, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "exchange_rate": return A.Text$(A.formatNumber(invoice.exchangeRate, context, _null, _null, B.FormatNumberType_3, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "is_viewed": return A.Text$(invoice.get$isViewed() ? t1.get$yes() : t1.get$no(), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "auto_bill_enabled": return A.Text$(t1.lookup$1(invoice.autoBillEnabled ? t1.get$yes() : t1.get$no()), _null, _null, _null, _null, _null, _null, _null, _null, _null); + case "client_state": + return A.Text$(client.state, _null, _null, _null, _null, _null, _null, _null, _null, _null); + case "client_city": + return A.Text$(client.city, _null, _null, _null, _null, _null, _null, _null, _null, _null); + case "client_postal_code": + return A.Text$(client.postalCode, _null, _null, _null, _null, _null, _null, _null, _null, _null); + case "client_country": + t1 = state.staticState.countryMap; + t2 = client.countryId; + t2 = t1._map$_map.$index(0, t2); + t1 = t2 == null ? _null : t2.name; + return A.Text$(t1 == null ? "" : t1, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "contact_name": case "contact_email": - t1 = state.userCompanyStates; - t2 = state.uiState.selectedCompanyIndex; - contact = A.invoiceContactSelector(invoice, t1._list[t2].clientState.$get$1(0, invoice.clientId)); + contact = A.invoiceContactSelector(invoice, t2[t3].clientState.$get$1(0, t5)); if (field === "contact_name") { t1 = contact == null ? _null : contact.get$fullName(); return A.Text$(t1 == null ? "" : t1, _null, _null, _null, _null, _null, _null, _null, _null, _null); @@ -389993,6 +390035,10 @@ t6.push("vendor"); t6.push("contact_name"); t6.push("contact_email"); + t6.push("client_state"); + t6.push("client_city"); + t6.push("client_postal_code"); + t6.push("client_country"); t7 = A._setArrayType(["status", "number", "client", "amount", "balance", "date", "due_date"], t5); t5 = A._setArrayType(["number", "date", "due_date", "updated_at"], t5); t6 = A.AppBottomBar$(company.getCustomFieldValues$2$excludeBlank("invoice1", true), company.getCustomFieldValues$2$excludeBlank("invoice2", true), company.getCustomFieldValues$2$excludeBlank("invoice3", true), company.getCustomFieldValues$2$excludeBlank("invoice4", true), t7, B.EntityType_invoice, false, B.List_empty16, new A.InvoiceScreen_build_closure6(store), new A.InvoiceScreen_build_closure7(store), new A.InvoiceScreen_build_closure8(store), new A.InvoiceScreen_build_closure9(store), new A.InvoiceScreen_build_closure10(store), new A.InvoiceScreen_build_closure11(store), new A.InvoiceScreen_build_closure12(store), new A.InvoiceScreen_build_closure13(store), t5, statuses, t6); @@ -396442,10 +396488,16 @@ A.QuotePdfVM.prototype = {}; A.QuotePresenter.prototype = { getField$2$context$field(context, field) { - var t2, contact, _this = this, _null = null, + var t4, t5, client, contact, _this = this, _null = null, t1 = A.Localizations_of(context, B.Type_AppLocalization_KyD, type$.legacy_AppLocalization), state = A._lateReadCheck(A.StoreProvider_of(context, type$.legacy_AppState).__Store__state, "_state"), - quote = type$.legacy_InvoiceEntity._as(_this.entity); + quote = type$.legacy_InvoiceEntity._as(_this.entity), + t2 = state.userCompanyStates, + t3 = state.uiState.selectedCompanyIndex; + t2 = t2._list; + t4 = t2[t3].clientState; + t5 = quote.clientId; + client = t4.$get$1(0, t5); switch (field) { case "status": return new A.EntityStatusChip(quote, 105, _null); @@ -396453,18 +396505,14 @@ t2 = quote.number; return A.Text$(t2.length === 0 ? t1.get$pending(t1) : t2, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "client": - t1 = state.userCompanyStates; - t2 = state.uiState.selectedCompanyIndex; - t2 = t1._list[t2].clientState.map; - t1 = quote.clientId; - t2 = t2._map$_map.$index(0, t1); - return A.Text$((t2 == null ? A.ClientEntity_ClientEntity(_null, t1, _null, _null) : t2).displayName, _null, _null, _null, _null, _null, _null, _null, _null, _null); + t1 = t2[t3].clientState.map._map$_map.$index(0, t5); + return A.Text$((t1 == null ? A.ClientEntity_ClientEntity(_null, t5, _null, _null) : t1).displayName, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "date": return A.Text$(A.formatDate(quote.date, context, true, true, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "last_sent_date": return A.Text$(A.formatDate(quote.lastSentDate, context, true, true, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "amount": - return new A.Align(B.Alignment_1_0, _null, _null, A.Text$(A.formatNumber(quote.amount, context, quote.clientId, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null), _null); + return new A.Align(B.Alignment_1_0, _null, _null, A.Text$(A.formatNumber(quote.amount, context, t5, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null), _null); case "valid_until": return A.Text$(A.formatDate(quote.dueDate, context, true, true, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "custom1": @@ -396482,30 +396530,36 @@ case "discount": t1 = quote.isAmountDiscount; t2 = quote.discount; - return A.Text$(t1 ? A.formatNumber(t2, context, quote.clientId, _null, B.FormatNumberType_0, true, _null, false) : A.formatNumber(t2, context, _null, _null, B.FormatNumberType_1, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); + return A.Text$(t1 ? A.formatNumber(t2, context, t5, _null, B.FormatNumberType_0, true, _null, false) : A.formatNumber(t2, context, _null, _null, B.FormatNumberType_1, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "po_number": return A.Text$(quote.poNumber, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "documents": return A.Text$("" + quote.documents._list.length, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "tax_amount": - return A.Text$(A.formatNumber(quote.taxAmount, context, quote.clientId, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); + return A.Text$(A.formatNumber(quote.taxAmount, context, t5, _null, B.FormatNumberType_0, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "exchange_rate": return A.Text$(A.formatNumber(quote.exchangeRate, context, _null, _null, B.FormatNumberType_3, true, _null, false), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "is_viewed": return A.Text$(quote.get$isViewed() ? t1.get$yes() : t1.get$no(), _null, _null, _null, _null, _null, _null, _null, _null, _null); case "project": - t1 = state.userCompanyStates; - t2 = state.uiState.selectedCompanyIndex; - return A.Text$(t1._list[t2].projectState.$get$1(0, quote.projectId).name, _null, _null, _null, _null, _null, _null, _null, _null, _null); + return A.Text$(t2[t3].projectState.$get$1(0, quote.projectId).name, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "vendor": - t1 = state.userCompanyStates; - t2 = state.uiState.selectedCompanyIndex; - return A.Text$(t1._list[t2].vendorState.$get$1(0, quote.vendorId).name, _null, _null, _null, _null, _null, _null, _null, _null, _null); + return A.Text$(t2[t3].vendorState.$get$1(0, quote.vendorId).name, _null, _null, _null, _null, _null, _null, _null, _null, _null); + case "client_state": + return A.Text$(client.state, _null, _null, _null, _null, _null, _null, _null, _null, _null); + case "client_city": + return A.Text$(client.city, _null, _null, _null, _null, _null, _null, _null, _null, _null); + case "client_postal_code": + return A.Text$(client.postalCode, _null, _null, _null, _null, _null, _null, _null, _null, _null); + case "client_country": + t1 = state.staticState.countryMap; + t2 = client.countryId; + t2 = t1._map$_map.$index(0, t2); + t1 = t2 == null ? _null : t2.name; + return A.Text$(t1 == null ? "" : t1, _null, _null, _null, _null, _null, _null, _null, _null, _null); case "contact_name": case "contact_email": - t1 = state.userCompanyStates; - t2 = state.uiState.selectedCompanyIndex; - contact = A.quoteContactSelector(quote, t1._list[t2].clientState.$get$1(0, quote.clientId)); + contact = A.quoteContactSelector(quote, t2[t3].clientState.$get$1(0, t5)); if (field === "contact_name") { t1 = contact == null ? _null : contact.get$fullName(); return A.Text$(t1 == null ? "" : t1, _null, _null, _null, _null, _null, _null, _null, _null, _null); @@ -396556,6 +396610,10 @@ t6.push("vendor"); t6.push("contact_name"); t6.push("contact_email"); + t6.push("client_state"); + t6.push("client_city"); + t6.push("client_postal_code"); + t6.push("client_country"); t7 = A._setArrayType(["status", "number", "client", "amount", "date", "valid_until"], t5); t6 = A.AppBottomBar$(company.getCustomFieldValues$2$excludeBlank("invoice1", true), company.getCustomFieldValues$2$excludeBlank("invoice2", true), company.getCustomFieldValues$2$excludeBlank("invoice3", true), company.getCustomFieldValues$2$excludeBlank("invoice4", true), t7, B.EntityType_quote, false, B.List_empty16, new A.QuoteScreen_build_closure4(store), new A.QuoteScreen_build_closure5(store), new A.QuoteScreen_build_closure6(store), new A.QuoteScreen_build_closure7(store), new A.QuoteScreen_build_closure8(store), new A.QuoteScreen_build_closure9(store), new A.QuoteScreen_build_closure10(store), new A.QuoteScreen_build_closure11(store), A._setArrayType(["number", "date", "valid_until", "updated_at"], t5), statuses, t6); t5 = state.prefState; @@ -401536,26 +401594,28 @@ t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), "plan"); if (t7 == null) t7 = ""; - t8 = account.plan; - if (t8.length === 0) { - t9 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), "free"); - if (t9 == null) - t9 = ""; - } else if (account.trialPlan.length !== 0) { - t9 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), "pro"); - t9 = A.S(t9 == null ? J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, _s2_), "pro") : t9) + " \u2022 "; - t10 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), _s10_); - t9 += A.S(t10 == null ? J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, _s2_), _s10_) : t10); - } else - t9 = t1.lookup$1(t8); - t10 = type$.JSArray_legacy_Widget; - t9 = A._setArrayType([new A.AppHeader(t7, t9, secondLabel, secondValue, _null)], t10); + if (account.trialPlan.length !== 0) { + t8 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), "pro"); + t8 = A.S(t8 == null ? J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, _s2_), "pro") : t8) + " \u2022 "; + t9 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), _s10_); + t8 += A.S(t9 == null ? J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, _s2_), _s10_) : t9); + } else { + t8 = account.plan; + if (t8.length === 0) { + t8 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), "free"); + if (t8 == null) + t8 = ""; + } else + t8 = t1.lookup$1(t8); + } + t9 = type$.JSArray_legacy_Widget; + t8 = A._setArrayType([new A.AppHeader(t7, t8, secondLabel, secondValue, _null)], t9); t7 = t3[t4].userCompany; if (t7.company.id !== t7.account.defaultCompanyId) { t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), _s19_); if (t7 == null) t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, _s2_), _s19_); - t9.push(new A.Padding(B.EdgeInsets_16_0_16_8, new A.AppButton(_null, B.IconData_57627_MaterialIcons_null_false, t7.toUpperCase(), new A._AccountOverview_build_closure(_this, context), _null, _null), _null)); + t8.push(new A.Padding(B.EdgeInsets_16_0_16_8, new A.AppButton(_null, B.IconData_57627_MaterialIcons_null_false, t7.toUpperCase(), new A._AccountOverview_build_closure(_this, context), _null, _null), _null)); } if (t3[t4].userCompany.ninjaPortalUrl.length !== 0) if (!A.isApple()) @@ -401565,7 +401625,7 @@ else t7 = false; if (t7) { - if (account.trialStarted.length === 0 && t8 === "") { + if (account.trialStarted.length === 0 && account.plan === "") { t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), _s16_); if (t7 == null) t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, _s2_), _s16_); @@ -401574,36 +401634,36 @@ if (t7 == null) t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, _s2_), _s11_); } - t9.push(new A.Padding(B.EdgeInsets_16_16_16_0, A.OutlinedButton$(new A.Padding(B.EdgeInsets_8_8_8_8, new A.IconText(t7.toUpperCase(), B._MdiIconData_ujl, _null, _null, _null), _null), new A._AccountOverview_build_closure0(state), _null), _null)); + t8.push(new A.Padding(B.EdgeInsets_16_16_16_0, A.OutlinedButton$(new A.Padding(B.EdgeInsets_8_8_8_8, new A.IconText(t7.toUpperCase(), B._MdiIconData_ujl, _null, _null, _null), _null), new A._AccountOverview_build_closure0(state), _null), _null)); } t7 = company.isDisabled; - t8 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), "activate_company"); - t8 = A.Text$(t8 == null ? "" : t8, _null, _null, _null, _null, _null, _null, _null, _null, _null); + t10 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), "activate_company"); + t10 = A.Text$(t10 == null ? "" : t10, _null, _null, _null, _null, _null, _null, _null, _null, _null); t11 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), "activate_company_help"); t11 = A.Text$(t11 == null ? "" : t11, _null, _null, _null, _null, _null, _null, _null, _null, _null); - t7 = A.SwitchListTile$(A.Theme_of(context).colorScheme.secondary, _null, new A._AccountOverview_build_closure1(_this, company), _null, t11, t8, !t7); - t8 = company.markdownEnabled; + t7 = A.SwitchListTile$(A.Theme_of(context).colorScheme.secondary, _null, new A._AccountOverview_build_closure1(_this, company), _null, t11, t10, !t7); + t10 = company.markdownEnabled; t11 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), _s15_); t11 = A.Text$(t11 == null ? J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, _s2_), _s15_) : t11, _null, _null, _null, _null, _null, _null, _null, _null, _null); t12 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), _s20_); t12 = A.Text$(t12 == null ? J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, _s2_), _s20_) : t12, _null, _null, _null, _null, _null, _null, _null, _null, _null); - t8 = A.SwitchListTile$(A.Theme_of(context).colorScheme.secondary, _null, new A._AccountOverview_build_closure2(_this, company), _null, t12, t11, t8); + t10 = A.SwitchListTile$(A.Theme_of(context).colorScheme.secondary, _null, new A._AccountOverview_build_closure2(_this, company), _null, t12, t11, t10); t11 = company.reportIncludeDrafts; t12 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), _s14_); t12 = A.Text$(t12 == null ? J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, _s2_), _s14_) : t12, _null, _null, _null, _null, _null, _null, _null, _null, _null); t13 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), _s19_0); t13 = A.Text$(t13 == null ? J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, _s2_), _s19_0) : t13, _null, _null, _null, _null, _null, _null, _null, _null, _null); - t9.push(A.FormCard$(_null, A._setArrayType([t7, t8, A.SwitchListTile$(A.Theme_of(context).colorScheme.secondary, _null, new A._AccountOverview_build_closure3(_this, company), _null, t13, t12, t11)], t10), _null, 4, false, _null, false, _null)); + t8.push(A.FormCard$(_null, A._setArrayType([t7, t10, A.SwitchListTile$(A.Theme_of(context).colorScheme.secondary, _null, new A._AccountOverview_build_closure3(_this, company), _null, t13, t12, t11)], t9), _null, 4, false, _null, false, _null)); t7 = t5.get$isHosted(); if (!t7) { t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), "purchase_license"); if (t7 == null) t7 = ""; - t8 = A.getLayout(context) === B.AppLayout_mobile ? _null : B.IconData_57714_MaterialIcons_null_false; - t7 = A.Expanded$(new A.AppButton(_null, t8, t7.toUpperCase(), new A._AccountOverview_build_closure4(), _null, _null), 1); - t8 = t1.get$applyLicense(); + t10 = A.getLayout(context) === B.AppLayout_mobile ? _null : B.IconData_57714_MaterialIcons_null_false; + t7 = A.Expanded$(new A.AppButton(_null, t10, t7.toUpperCase(), new A._AccountOverview_build_closure4(), _null, _null), 1); + t10 = t1.get$applyLicense(); t11 = A.getLayout(context) === B.AppLayout_mobile ? _null : B.IconData_57713_MaterialIcons_null_false; - B.JSArray_methods.addAll$1(t9, A._setArrayType([new A.Padding(B.EdgeInsets_16_16_16_16, A.Row$(A._setArrayType([t7, new A.SizedBox(16, _null, _null, _null), A.Expanded$(new A.AppButton(_null, t11, t8.toUpperCase(), new A._AccountOverview_build_closure5(_this, context, t1), _null, _null), 1)], t10), B.CrossAxisAlignment_2, B.MainAxisAlignment_0, B.MainAxisSize_1, _null), _null), new A.Padding(B.EdgeInsets_16_16_16_0, new A.ListDivider(_null), _null)], t10)); + B.JSArray_methods.addAll$1(t8, A._setArrayType([new A.Padding(B.EdgeInsets_16_16_16_16, A.Row$(A._setArrayType([t7, new A.SizedBox(16, _null, _null, _null), A.Expanded$(new A.AppButton(_null, t11, t10.toUpperCase(), new A._AccountOverview_build_closure5(_this, context, t1), _null, _null), 1)], t9), B.CrossAxisAlignment_2, B.MainAxisAlignment_0, B.MainAxisSize_1, _null), _null), new A.Padding(B.EdgeInsets_16_16_16_0, new A.ListDivider(_null), _null)], t9)); } if (!(A.cleanApiUrl(t5.url) !== "https://invoicing.co" || t3[t4].userCompany.account.plan === "enterprise" || t3[t4].userCompany.account.plan === "pro")) { t5 = t5.get$isHosted(); @@ -401620,7 +401680,7 @@ if (t4 == null) t4 = ""; t5 = A.getLayout(context) === B.AppLayout_mobile ? _null : A.getEntityIcon(B.EntityType_webhook); - t9.push(new A.Padding(B.EdgeInsets_16_16_16_16, A.Row$(A._setArrayType([t3, new A.SizedBox(16, _null, _null, _null), A.Expanded$(new A.AppButton(_null, t5, t4.toUpperCase(), new A._AccountOverview_build_closure7(store), _null, _null), 1)], t10), B.CrossAxisAlignment_2, B.MainAxisAlignment_0, B.MainAxisSize_1, _null), _null)); + t8.push(new A.Padding(B.EdgeInsets_16_16_16_16, A.Row$(A._setArrayType([t3, new A.SizedBox(16, _null, _null, _null), A.Expanded$(new A.AppButton(_null, t5, t4.toUpperCase(), new A._AccountOverview_build_closure7(store), _null, _null), 1)], t9), B.CrossAxisAlignment_2, B.MainAxisAlignment_0, B.MainAxisSize_1, _null), _null)); } t3 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), "api_docs"); if (t3 == null) @@ -401628,8 +401688,8 @@ t4 = A.getLayout(context) === B.AppLayout_mobile ? _null : B._MdiIconData_uXI; t3 = A.Expanded$(new A.AppButton(_null, t4, t3.toUpperCase(), new A._AccountOverview_build_closure8(), _null, _null), 1); t4 = A.getLayout(context) === B.AppLayout_mobile ? _null : B._MdiIconData_Qa6; - t9.push(new A.Padding(B.EdgeInsets_16_16_16_16, A.Row$(A._setArrayType([t3, new A.SizedBox(16, _null, _null, _null), A.Expanded$(new A.AppButton(_null, t4, "Zapier", new A._AccountOverview_build_closure9(), _null, _null), 1)], t10), B.CrossAxisAlignment_2, B.MainAxisAlignment_0, B.MainAxisSize_1, _null), _null)); - t9.push(new A.Padding(B.EdgeInsets_16_16_16_0, new A.ListDivider(_null), _null)); + t8.push(new A.Padding(B.EdgeInsets_16_16_16_16, A.Row$(A._setArrayType([t3, new A.SizedBox(16, _null, _null, _null), A.Expanded$(new A.AppButton(_null, t4, "Zapier", new A._AccountOverview_build_closure9(), _null, _null), 1)], t9), B.CrossAxisAlignment_2, B.MainAxisAlignment_0, B.MainAxisSize_1, _null), _null)); + t8.push(new A.Padding(B.EdgeInsets_16_16_16_0, new A.ListDivider(_null), _null)); t4 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), "purge_data"); t3 = t4 == null ? "" : t4; t4 = A.getLayout(context) === B.AppLayout_mobile ? _null : B.IconData_57785_MaterialIcons_null_false; @@ -401646,8 +401706,8 @@ t4 = t4.toUpperCase(); } t5 = A.getLayout(context) === B.AppLayout_mobile ? _null : B.IconData_57785_MaterialIcons_null_false; - t9.push(new A.Padding(B.EdgeInsets_16_16_16_16, A.Row$(A._setArrayType([t3, new A.SizedBox(16, _null, _null, _null), A.Expanded$(new A.AppButton(B.MaterialColor_Map_JNc9P_4294198070, t5, t4, new A._AccountOverview_build_closure11(_this, companies, t1, company, t2, context), _null, _null), 1)], t10), B.CrossAxisAlignment_2, B.MainAxisAlignment_0, B.MainAxisSize_1, _null), _null)); - return new A.ScrollableListView(t9, _null, _null, _null); + t8.push(new A.Padding(B.EdgeInsets_16_16_16_16, A.Row$(A._setArrayType([t3, new A.SizedBox(16, _null, _null, _null), A.Expanded$(new A.AppButton(B.MaterialColor_Map_JNc9P_4294198070, t5, t4, new A._AccountOverview_build_closure11(_this, companies, t1, company, t2, context), _null, _null), 1)], t9), B.CrossAxisAlignment_2, B.MainAxisAlignment_0, B.MainAxisSize_1, _null), _null)); + return new A.ScrollableListView(t8, _null, _null, _null); } }; A._AccountOverview_build__getDataStats.prototype = { @@ -410200,6 +410260,7 @@ }, build$1(_, context) { var company, t5, t6, enableCustomEmail, t7, t8, t9, t10, t11, editor, _this = this, _null = null, + _s20_ = "https://invoicing.co", t1 = A.Localizations_of(context, B.Type_AppLocalization_KyD, type$.legacy_AppLocalization), viewModel = _this._widget.viewModel, state = viewModel.state, @@ -410212,9 +410273,14 @@ company = t2[t4].userCompany.company; t5 = state.authState; t6 = t5.get$isHosted(); - if (t6) - enableCustomEmail = A.cleanApiUrl(t5.url) !== "https://invoicing.co" || t2[t4].userCompany.account.plan === "enterprise" || t2[t4].userCompany.account.plan === "pro"; - else + if (t6) { + t6 = t5.url; + if (!(A.cleanApiUrl(t6) !== _s20_ || t2[t4].userCompany.account.plan === "enterprise" || t2[t4].userCompany.account.plan === "pro")) { + t6 = A.cleanApiUrl(t6) !== _s20_ || t2[t4].userCompany.account.plan === "enterprise" || t2[t4].userCompany.account.plan === "pro"; + enableCustomEmail = t6; + } else + enableCustomEmail = true; + } else enableCustomEmail = true; t6 = t1.localeCode; t7 = J.$index$asx($.LocalizationsProvider__localizedValues.$index(0, t6), "template");