@mj-biz-apps/orders-ng 5.47.1 → 5.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/lib/form-panels/document-forms.module.d.ts +1 -1
  2. package/dist/lib/form-panels/document-forms.module.d.ts.map +1 -1
  3. package/dist/lib/form-panels/document-forms.module.js +1 -4
  4. package/dist/lib/form-panels/document-forms.module.js.map +1 -1
  5. package/dist/lib/form-panels/external-invoices.panel.d.ts +2 -1
  6. package/dist/lib/form-panels/external-invoices.panel.d.ts.map +1 -1
  7. package/dist/lib/form-panels/external-invoices.panel.js +5 -4
  8. package/dist/lib/form-panels/external-invoices.panel.js.map +1 -1
  9. package/dist/lib/form-panels/price-list-simulator.panel.d.ts.map +1 -1
  10. package/dist/lib/form-panels/price-list-simulator.panel.js +3 -2
  11. package/dist/lib/form-panels/price-list-simulator.panel.js.map +1 -1
  12. package/dist/lib/form-panels/product-header.panel.d.ts.map +1 -1
  13. package/dist/lib/form-panels/product-header.panel.js +13 -2
  14. package/dist/lib/form-panels/product-header.panel.js.map +1 -1
  15. package/dist/lib/form-panels/product-widget.panels.d.ts +14 -17
  16. package/dist/lib/form-panels/product-widget.panels.d.ts.map +1 -1
  17. package/dist/lib/form-panels/product-widget.panels.js +30 -58
  18. package/dist/lib/form-panels/product-widget.panels.js.map +1 -1
  19. package/dist/lib/form-panels/subscription-cancel.component.d.ts +2 -1
  20. package/dist/lib/form-panels/subscription-cancel.component.d.ts.map +1 -1
  21. package/dist/lib/form-panels/subscription-cancel.component.js +5 -4
  22. package/dist/lib/form-panels/subscription-cancel.component.js.map +1 -1
  23. package/dist/lib/form-panels/subscription-revrec.panel.d.ts.map +1 -1
  24. package/dist/lib/form-panels/subscription-revrec.panel.js +3 -2
  25. package/dist/lib/form-panels/subscription-revrec.panel.js.map +1 -1
  26. package/dist/lib/form-panels/subscription-term-revrec.panel.d.ts.map +1 -1
  27. package/dist/lib/form-panels/subscription-term-revrec.panel.js +3 -2
  28. package/dist/lib/form-panels/subscription-term-revrec.panel.js.map +1 -1
  29. package/dist/lib/pages/payments/account-credit.page.d.ts +6 -0
  30. package/dist/lib/pages/payments/account-credit.page.d.ts.map +1 -1
  31. package/dist/lib/pages/payments/account-credit.page.js +29 -7
  32. package/dist/lib/pages/payments/account-credit.page.js.map +1 -1
  33. package/dist/lib/pages/payments/refund.page.d.ts +7 -0
  34. package/dist/lib/pages/payments/refund.page.d.ts.map +1 -1
  35. package/dist/lib/pages/payments/refund.page.js +35 -12
  36. package/dist/lib/pages/payments/refund.page.js.map +1 -1
  37. package/dist/lib/pages/receivables/external-invoicing-queue.page.js +5 -5
  38. package/dist/lib/pages/receivables/external-invoicing-queue.page.js.map +1 -1
  39. package/dist/lib/pages/subscriptions/renewals-page.model.d.ts +214 -0
  40. package/dist/lib/pages/subscriptions/renewals-page.model.d.ts.map +1 -0
  41. package/dist/lib/pages/subscriptions/renewals-page.model.js +663 -0
  42. package/dist/lib/pages/subscriptions/renewals-page.model.js.map +1 -0
  43. package/dist/lib/pages/subscriptions/renewals.page.d.ts +236 -0
  44. package/dist/lib/pages/subscriptions/renewals.page.d.ts.map +1 -0
  45. package/dist/lib/pages/subscriptions/renewals.page.js +2249 -0
  46. package/dist/lib/pages/subscriptions/renewals.page.js.map +1 -0
  47. package/dist/lib/pages/subscriptions/subscriptions.page.d.ts.map +1 -0
  48. package/dist/lib/pages/{receivables → subscriptions}/subscriptions.page.js +1 -1
  49. package/dist/lib/pages/subscriptions/subscriptions.page.js.map +1 -0
  50. package/dist/lib/panels/external-invoice-view.d.ts +13 -3
  51. package/dist/lib/panels/external-invoice-view.d.ts.map +1 -1
  52. package/dist/lib/panels/external-invoice-view.js +20 -4
  53. package/dist/lib/panels/external-invoice-view.js.map +1 -1
  54. package/dist/lib/panels/money-format.d.ts +16 -6
  55. package/dist/lib/panels/money-format.d.ts.map +1 -1
  56. package/dist/lib/panels/money-format.js +6 -5
  57. package/dist/lib/panels/money-format.js.map +1 -1
  58. package/dist/lib/panels/multi-select.component.d.ts +60 -0
  59. package/dist/lib/panels/multi-select.component.d.ts.map +1 -0
  60. package/dist/lib/panels/multi-select.component.js +293 -0
  61. package/dist/lib/panels/multi-select.component.js.map +1 -0
  62. package/dist/lib/panels/stat-tile.component.d.ts +3 -1
  63. package/dist/lib/panels/stat-tile.component.d.ts.map +1 -1
  64. package/dist/lib/panels/stat-tile.component.js +64 -17
  65. package/dist/lib/panels/stat-tile.component.js.map +1 -1
  66. package/dist/lib/panels/worklist-table.component.d.ts +35 -12
  67. package/dist/lib/panels/worklist-table.component.d.ts.map +1 -1
  68. package/dist/lib/panels/worklist-table.component.js +126 -67
  69. package/dist/lib/panels/worklist-table.component.js.map +1 -1
  70. package/dist/lib/sections/orders-sections.component.d.ts +23 -6
  71. package/dist/lib/sections/orders-sections.component.d.ts.map +1 -1
  72. package/dist/lib/sections/orders-sections.component.js +146 -16
  73. package/dist/lib/sections/orders-sections.component.js.map +1 -1
  74. package/dist/lib/sections/section-nav.model.d.ts +14 -5
  75. package/dist/lib/sections/section-nav.model.d.ts.map +1 -1
  76. package/dist/lib/sections/section-nav.model.js +18 -7
  77. package/dist/lib/sections/section-nav.model.js.map +1 -1
  78. package/dist/public-api.d.ts +7 -4
  79. package/dist/public-api.d.ts.map +1 -1
  80. package/dist/public-api.js +10 -7
  81. package/dist/public-api.js.map +1 -1
  82. package/package.json +2 -2
  83. package/dist/lib/pages/receivables/subscriptions.page.d.ts.map +0 -1
  84. package/dist/lib/pages/receivables/subscriptions.page.js.map +0 -1
  85. /package/dist/lib/pages/{receivables → subscriptions}/subscriptions.page.d.ts +0 -0
@@ -0,0 +1,2249 @@
1
+ import { ChangeDetectorRef, Component, EventEmitter, Output, inject } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { MJAlertComponent, MJButtonDirective, MJDialogActionsComponent, MJDialogComponent, MJDropdownComponent, } from '@memberjunction/ng-ui-components';
4
+ import { RunView } from '@memberjunction/core';
5
+ import { OverlayModule } from '@angular/cdk/overlay';
6
+ import { ExportService } from '@memberjunction/ng-export-service';
7
+ import { OrdersChangeSubscriptionProductOperation, OrdersGetRenewalWorklistOperation, OrdersSetRenewalSettingsOperation, OrdersSpawnRenewalsOperation, } from '@mj-biz-apps/orders-entities';
8
+ import { MJOStatTileComponent } from '../../panels/stat-tile.component.js';
9
+ import { MJOStatedValueComponent } from '../../panels/chips.component.js';
10
+ import { MJOMultiSelectComponent } from '../../panels/multi-select.component.js';
11
+ import { MJOWorklistTableComponent } from '../../panels/worklist-table.component.js';
12
+ import { FormatDate, FormatMoney } from '../../panels/money-format.js';
13
+ import { AppliedFacets, BuildRenewalsExport, CanPlaceRenewal, CompareRows, CurrentProductsNote, EndsNote, ExclusionNote, FacetOptions, MatchesFacets, MatchesPreset, MatchesSearch, NO_FACETS, NeedsAttention, PendingRenewalWarning, PlacedText, ProductChangeText, PruneCompanies, PruneProducts, ReadPageState, WritePageState, ProjectionLines, RENEWALS_DATE, RENEWAL_WINDOWS, RemoveFacet, RenewalPriceDisplay, RenewalPriceNote, RenewalStateChipClass, RenewalStateLabel, RenewalStateNote, SettingsUpdateText, SharedIncrease, SharedOrderWarnings, SubscriptionIncreaseNote, SummarizePlacement, TermWarning, } from './renewals-page.model.js';
14
+ import * as i0 from "@angular/core";
15
+ import * as i1 from "@angular/cdk/overlay";
16
+ const _forTrack0 = ($index, $item) => $item.Days;
17
+ const _forTrack1 = ($index, $item) => $item.key;
18
+ const _forTrack2 = ($index, $item) => $item.Label;
19
+ function MJORenewalsPageComponent_For_6_Template(rf, ctx) { if (rf & 1) {
20
+ i0.ɵɵelementStart(0, "option", 5);
21
+ i0.ɵɵtext(1);
22
+ i0.ɵɵelementEnd();
23
+ } if (rf & 2) {
24
+ const window_r2 = ctx.$implicit;
25
+ i0.ɵɵproperty("value", window_r2.Days);
26
+ i0.ɵɵadvance();
27
+ i0.ɵɵtextInterpolate(window_r2.Label);
28
+ } }
29
+ function MJORenewalsPageComponent_Conditional_9_Template(rf, ctx) { if (rf & 1) {
30
+ i0.ɵɵelementStart(0, "span", 8);
31
+ i0.ɵɵtext(1);
32
+ i0.ɵɵelementEnd();
33
+ } if (rf & 2) {
34
+ const ctx_r2 = i0.ɵɵnextContext();
35
+ i0.ɵɵadvance();
36
+ i0.ɵɵtextInterpolate2("", ctx_r2.WindowDisplay, " \u00B7 terms that ended in the last ", ctx_r2.Lookback, " days without renewing are included");
37
+ } }
38
+ function MJORenewalsPageComponent_ng_template_15_Template(rf, ctx) { if (rf & 1) {
39
+ const _r4 = i0.ɵɵgetCurrentView();
40
+ i0.ɵɵelementStart(0, "div", 58)(1, "button", 59);
41
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_ng_template_15_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r4); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.Export("excel")); });
42
+ i0.ɵɵelement(2, "i", 60);
43
+ i0.ɵɵtext(3, " Excel (.xlsx) ");
44
+ i0.ɵɵelementEnd();
45
+ i0.ɵɵelementStart(4, "button", 59);
46
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_ng_template_15_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r4); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.Export("csv")); });
47
+ i0.ɵɵelement(5, "i", 61);
48
+ i0.ɵɵtext(6, " CSV ");
49
+ i0.ɵɵelementEnd()();
50
+ } }
51
+ function MJORenewalsPageComponent_Conditional_16_For_4_Template(rf, ctx) { if (rf & 1) {
52
+ const _r6 = i0.ɵɵgetCurrentView();
53
+ i0.ɵɵelementStart(0, "span", 62)(1, "span", 42);
54
+ i0.ɵɵtext(2);
55
+ i0.ɵɵelementEnd();
56
+ i0.ɵɵtext(3);
57
+ i0.ɵɵelementStart(4, "button", 64);
58
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Conditional_16_For_4_Template_button_click_4_listener() { const chip_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.OnRemoveFacet(chip_r7)); });
59
+ i0.ɵɵelement(5, "i", 65);
60
+ i0.ɵɵelementEnd()();
61
+ } if (rf & 2) {
62
+ const chip_r7 = ctx.$implicit;
63
+ i0.ɵɵadvance(2);
64
+ i0.ɵɵtextInterpolate1("", chip_r7.label, ":");
65
+ i0.ɵɵadvance();
66
+ i0.ɵɵtextInterpolate1(" ", chip_r7.value, " ");
67
+ i0.ɵɵadvance();
68
+ i0.ɵɵattribute("aria-label", "Remove " + chip_r7.label + " " + chip_r7.value);
69
+ } }
70
+ function MJORenewalsPageComponent_Conditional_16_Template(rf, ctx) { if (rf & 1) {
71
+ const _r5 = i0.ɵɵgetCurrentView();
72
+ i0.ɵɵelementStart(0, "div", 13)(1, "span", 3);
73
+ i0.ɵɵtext(2, "Filtered by");
74
+ i0.ɵɵelementEnd();
75
+ i0.ɵɵrepeaterCreate(3, MJORenewalsPageComponent_Conditional_16_For_4_Template, 6, 3, "span", 62, _forTrack1);
76
+ i0.ɵɵelementStart(5, "button", 63);
77
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Conditional_16_Template_button_click_5_listener() { i0.ɵɵrestoreView(_r5); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.OnClearFacets()); });
78
+ i0.ɵɵtext(6, "Clear all");
79
+ i0.ɵɵelementEnd()();
80
+ } if (rf & 2) {
81
+ const ctx_r2 = i0.ɵɵnextContext();
82
+ i0.ɵɵadvance(3);
83
+ i0.ɵɵrepeater(ctx_r2.Applied);
84
+ } }
85
+ function MJORenewalsPageComponent_Conditional_22_Template(rf, ctx) { if (rf & 1) {
86
+ i0.ɵɵelementStart(0, "mj-alert", 19)(1, "strong");
87
+ i0.ɵɵtext(2, "The renewals list did not load.");
88
+ i0.ɵɵelementEnd();
89
+ i0.ɵɵtext(3);
90
+ i0.ɵɵelementEnd();
91
+ } if (rf & 2) {
92
+ const ctx_r2 = i0.ɵɵnextContext();
93
+ i0.ɵɵadvance(3);
94
+ i0.ɵɵtextInterpolate1(" ", ctx_r2.LoadError, " ");
95
+ } }
96
+ function MJORenewalsPageComponent_Conditional_23_Template(rf, ctx) { if (rf & 1) {
97
+ i0.ɵɵelementStart(0, "mj-alert", 20);
98
+ i0.ɵɵtext(1);
99
+ i0.ɵɵelementEnd();
100
+ } if (rf & 2) {
101
+ const ctx_r2 = i0.ɵɵnextContext();
102
+ i0.ɵɵproperty("Variant", ctx_r2.Notice.Tone);
103
+ i0.ɵɵadvance();
104
+ i0.ɵɵtextInterpolate1(" ", ctx_r2.Notice.Text, " ");
105
+ } }
106
+ function MJORenewalsPageComponent_Conditional_24_Template(rf, ctx) { if (rf & 1) {
107
+ i0.ɵɵelementStart(0, "mj-alert", 21)(1, "strong");
108
+ i0.ɵɵtext(2);
109
+ i0.ɵɵelementEnd();
110
+ i0.ɵɵtext(3);
111
+ i0.ɵɵelementEnd();
112
+ } if (rf & 2) {
113
+ const pass_r8 = ctx;
114
+ i0.ɵɵproperty("Variant", pass_r8.Tone);
115
+ i0.ɵɵadvance(2);
116
+ i0.ɵɵtextInterpolate(pass_r8.Title);
117
+ i0.ɵɵadvance();
118
+ i0.ɵɵtextInterpolate1(" ", pass_r8.Text, " ");
119
+ } }
120
+ function MJORenewalsPageComponent_Conditional_25_Template(rf, ctx) { if (rf & 1) {
121
+ i0.ɵɵelementStart(0, "mj-alert", 22)(1, "strong");
122
+ i0.ɵɵtext(2);
123
+ i0.ɵɵelementEnd();
124
+ i0.ɵɵtext(3, " Narrow the window to see the rest. ");
125
+ i0.ɵɵelementEnd();
126
+ } if (rf & 2) {
127
+ const ctx_r2 = i0.ɵɵnextContext();
128
+ i0.ɵɵadvance(2);
129
+ i0.ɵɵtextInterpolate1("Showing the first ", ctx_r2.MaxRows.toLocaleString(), " subscriptions by end date.");
130
+ } }
131
+ function MJORenewalsPageComponent_Conditional_41_Template(rf, ctx) { if (rf & 1) {
132
+ const _r9 = i0.ɵɵgetCurrentView();
133
+ i0.ɵɵelementStart(0, "button", 66);
134
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Conditional_41_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r9); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.SelectedKeys = []); });
135
+ i0.ɵɵtext(1, "Clear");
136
+ i0.ɵɵelementEnd();
137
+ i0.ɵɵelementStart(2, "span", 3);
138
+ i0.ɵɵtext(3);
139
+ i0.ɵɵelementEnd();
140
+ } if (rf & 2) {
141
+ const ctx_r2 = i0.ɵɵnextContext();
142
+ i0.ɵɵadvance(3);
143
+ i0.ɵɵtextInterpolate(ctx_r2.SelectionNote);
144
+ } }
145
+ function MJORenewalsPageComponent_Conditional_42_Template(rf, ctx) { if (rf & 1) {
146
+ i0.ɵɵelementStart(0, "span", 3);
147
+ i0.ɵɵtext(1, "Select rows to create renewal orders, set the renewal increase, change the product, or set auto-renew.");
148
+ i0.ɵɵelementEnd();
149
+ } }
150
+ function MJORenewalsPageComponent_Conditional_44_Conditional_23_Template(rf, ctx) { if (rf & 1) {
151
+ const _r12 = i0.ɵɵgetCurrentView();
152
+ i0.ɵɵelementStart(0, "button", 90);
153
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Conditional_44_Conditional_23_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r12); const row_r11 = i0.ɵɵnextContext(); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.OpenProduct([row_r11.SubscriptionID])); });
154
+ i0.ɵɵelement(1, "i", 86);
155
+ i0.ɵɵtext(2, " Edit ");
156
+ i0.ɵɵelementEnd();
157
+ } if (rf & 2) {
158
+ const ctx_r2 = i0.ɵɵnextContext(2);
159
+ i0.ɵɵproperty("disabled", ctx_r2.Busy);
160
+ } }
161
+ function MJORenewalsPageComponent_Conditional_44_Conditional_28_Template(rf, ctx) { if (rf & 1) {
162
+ i0.ɵɵelementStart(0, "span", 80);
163
+ i0.ɵɵtext(1);
164
+ i0.ɵɵelementEnd();
165
+ } if (rf & 2) {
166
+ i0.ɵɵadvance();
167
+ i0.ɵɵtextInterpolate(ctx);
168
+ } }
169
+ function MJORenewalsPageComponent_Conditional_44_Conditional_33_Template(rf, ctx) { if (rf & 1) {
170
+ i0.ɵɵelementStart(0, "span", 3);
171
+ i0.ɵɵtext(1);
172
+ i0.ɵɵelementEnd();
173
+ } if (rf & 2) {
174
+ const row_r11 = i0.ɵɵnextContext();
175
+ const ctx_r2 = i0.ɵɵnextContext();
176
+ i0.ɵɵadvance();
177
+ i0.ɵɵtextInterpolate2("\u00B7 renews on ", ctx_r2.date(row_r11.AutoRenewOn), " (", row_r11.LeadDays, "-day lead)");
178
+ } }
179
+ function MJORenewalsPageComponent_Conditional_44_Conditional_34_Template(rf, ctx) { if (rf & 1) {
180
+ i0.ɵɵelementStart(0, "span", 3);
181
+ i0.ɵɵtext(1, "\u00B7 ends unless renewed by hand");
182
+ i0.ɵɵelementEnd();
183
+ } }
184
+ function MJORenewalsPageComponent_Conditional_44_Conditional_35_Template(rf, ctx) { if (rf & 1) {
185
+ const _r13 = i0.ɵɵgetCurrentView();
186
+ i0.ɵɵelementStart(0, "button", 91);
187
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Conditional_44_Conditional_35_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r13); const row_r11 = i0.ɵɵnextContext(); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.OpenAutoRenew([row_r11.SubscriptionID])); });
188
+ i0.ɵɵelement(1, "i", 86);
189
+ i0.ɵɵtext(2, " Edit ");
190
+ i0.ɵɵelementEnd();
191
+ } if (rf & 2) {
192
+ const ctx_r2 = i0.ɵɵnextContext(2);
193
+ i0.ɵɵproperty("disabled", ctx_r2.Busy);
194
+ } }
195
+ function MJORenewalsPageComponent_Conditional_44_Conditional_46_Template(rf, ctx) { if (rf & 1) {
196
+ const _r14 = i0.ɵɵgetCurrentView();
197
+ i0.ɵɵelementStart(0, "button", 92);
198
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Conditional_44_Conditional_46_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r14); const row_r11 = i0.ɵɵnextContext(); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.OpenOrder(row_r11.CurrentOrderID)); });
199
+ i0.ɵɵelement(1, "i", 72);
200
+ i0.ɵɵtext(2);
201
+ i0.ɵɵelementEnd();
202
+ } if (rf & 2) {
203
+ const row_r11 = i0.ɵɵnextContext();
204
+ i0.ɵɵadvance(2);
205
+ i0.ɵɵtextInterpolate1(" ", row_r11.CurrentOrderNumber, " ");
206
+ } }
207
+ function MJORenewalsPageComponent_Conditional_44_Conditional_48_Conditional_6_Template(rf, ctx) { if (rf & 1) {
208
+ i0.ɵɵelementStart(0, "span", 3);
209
+ i0.ɵɵtext(1);
210
+ i0.ɵɵelementEnd();
211
+ } if (rf & 2) {
212
+ const row_r11 = i0.ɵɵnextContext(2);
213
+ const ctx_r2 = i0.ɵɵnextContext();
214
+ i0.ɵɵadvance();
215
+ i0.ɵɵtextInterpolate2("\u00D7 ", row_r11.CurrentQuantity, " = ", ctx_r2.money(row_r11.CurrentLineTotal));
216
+ } }
217
+ function MJORenewalsPageComponent_Conditional_44_Conditional_48_Conditional_7_Template(rf, ctx) { if (rf & 1) {
218
+ i0.ɵɵelementStart(0, "mjo-stated-value", 96);
219
+ i0.ɵɵtext(1);
220
+ i0.ɵɵelementEnd();
221
+ } if (rf & 2) {
222
+ const row_r11 = i0.ɵɵnextContext(2);
223
+ const ctx_r2 = i0.ɵɵnextContext();
224
+ i0.ɵɵadvance();
225
+ i0.ɵɵtextInterpolate(ctx_r2.money(row_r11.CurrentOrderBalance));
226
+ } }
227
+ function MJORenewalsPageComponent_Conditional_44_Conditional_48_Template(rf, ctx) { if (rf & 1) {
228
+ i0.ɵɵelementStart(0, "mjo-stated-value", 93);
229
+ i0.ɵɵtext(1);
230
+ i0.ɵɵelementStart(2, "span", 94);
231
+ i0.ɵɵtext(3);
232
+ i0.ɵɵelementEnd()();
233
+ i0.ɵɵelementStart(4, "mjo-stated-value", 95);
234
+ i0.ɵɵtext(5);
235
+ i0.ɵɵconditionalCreate(6, MJORenewalsPageComponent_Conditional_44_Conditional_48_Conditional_6_Template, 2, 2, "span", 3);
236
+ i0.ɵɵelementEnd();
237
+ i0.ɵɵconditionalCreate(7, MJORenewalsPageComponent_Conditional_44_Conditional_48_Conditional_7_Template, 2, 1, "mjo-stated-value", 96);
238
+ } if (rf & 2) {
239
+ const row_r11 = i0.ɵɵnextContext();
240
+ const ctx_r2 = i0.ɵɵnextContext();
241
+ i0.ɵɵadvance();
242
+ i0.ɵɵtextInterpolate1("", ctx_r2.date(row_r11.CurrentOrderDate), " ");
243
+ i0.ɵɵadvance(2);
244
+ i0.ɵɵtextInterpolate(row_r11.CurrentOrderStatus);
245
+ i0.ɵɵadvance(2);
246
+ i0.ɵɵtextInterpolate1(" ", ctx_r2.money(row_r11.CurrentUnitPrice), " ");
247
+ i0.ɵɵadvance();
248
+ i0.ɵɵconditional(row_r11.CurrentQuantity && row_r11.CurrentQuantity !== 1 ? 6 : -1);
249
+ i0.ɵɵadvance();
250
+ i0.ɵɵconditional(row_r11.CurrentOrderBalance ? 7 : -1);
251
+ } }
252
+ function MJORenewalsPageComponent_Conditional_44_Conditional_49_Template(rf, ctx) { if (rf & 1) {
253
+ i0.ɵɵelementStart(0, "div", 3);
254
+ i0.ɵɵtext(1, "The order line that bought this term no longer exists.");
255
+ i0.ɵɵelementEnd();
256
+ } }
257
+ function MJORenewalsPageComponent_Conditional_44_Conditional_55_Template(rf, ctx) { if (rf & 1) {
258
+ const _r15 = i0.ɵɵgetCurrentView();
259
+ i0.ɵɵelementStart(0, "button", 92);
260
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Conditional_44_Conditional_55_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r15); const row_r11 = i0.ɵɵnextContext(); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.OpenOrder(row_r11.RenewalOrderID)); });
261
+ i0.ɵɵelement(1, "i", 72);
262
+ i0.ɵɵtext(2);
263
+ i0.ɵɵelementEnd();
264
+ } if (rf & 2) {
265
+ const row_r11 = i0.ɵɵnextContext();
266
+ i0.ɵɵadvance(2);
267
+ i0.ɵɵtextInterpolate1(" ", row_r11.RenewalOrderNumber, " ");
268
+ } }
269
+ function MJORenewalsPageComponent_Conditional_44_Conditional_57_Conditional_6_Template(rf, ctx) { if (rf & 1) {
270
+ i0.ɵɵelementStart(0, "span", 3);
271
+ i0.ɵɵtext(1);
272
+ i0.ɵɵelementEnd();
273
+ } if (rf & 2) {
274
+ const row_r11 = i0.ɵɵnextContext(2);
275
+ const ctx_r2 = i0.ɵɵnextContext();
276
+ i0.ɵɵadvance();
277
+ i0.ɵɵtextInterpolate2("\u00D7 ", row_r11.RenewalQuantity, " = ", ctx_r2.money(row_r11.RenewalLineTotal));
278
+ } }
279
+ function MJORenewalsPageComponent_Conditional_44_Conditional_57_Conditional_7_Template(rf, ctx) { if (rf & 1) {
280
+ i0.ɵɵelementStart(0, "mjo-stated-value", 97);
281
+ i0.ɵɵtext(1);
282
+ i0.ɵɵelementEnd();
283
+ } if (rf & 2) {
284
+ const row_r11 = i0.ɵɵnextContext(2);
285
+ const ctx_r2 = i0.ɵɵnextContext();
286
+ i0.ɵɵadvance();
287
+ i0.ɵɵtextInterpolate2("", ctx_r2.date(row_r11.RenewalTermStart), " \u2192 ", ctx_r2.date(row_r11.RenewalTermEnd));
288
+ } }
289
+ function MJORenewalsPageComponent_Conditional_44_Conditional_57_Conditional_8_Template(rf, ctx) { if (rf & 1) {
290
+ i0.ɵɵelementStart(0, "p", 98);
291
+ i0.ɵɵelement(1, "i", 99);
292
+ i0.ɵɵtext(2, " A draft. Confirming it books the new term; until then the nightly pass leaves this subscription alone. ");
293
+ i0.ɵɵelementEnd();
294
+ } }
295
+ function MJORenewalsPageComponent_Conditional_44_Conditional_57_Template(rf, ctx) { if (rf & 1) {
296
+ i0.ɵɵelementStart(0, "mjo-stated-value", 93);
297
+ i0.ɵɵtext(1);
298
+ i0.ɵɵelementStart(2, "span", 94);
299
+ i0.ɵɵtext(3);
300
+ i0.ɵɵelementEnd()();
301
+ i0.ɵɵelementStart(4, "mjo-stated-value", 95);
302
+ i0.ɵɵtext(5);
303
+ i0.ɵɵconditionalCreate(6, MJORenewalsPageComponent_Conditional_44_Conditional_57_Conditional_6_Template, 2, 2, "span", 3);
304
+ i0.ɵɵelementEnd();
305
+ i0.ɵɵconditionalCreate(7, MJORenewalsPageComponent_Conditional_44_Conditional_57_Conditional_7_Template, 2, 2, "mjo-stated-value", 97)(8, MJORenewalsPageComponent_Conditional_44_Conditional_57_Conditional_8_Template, 3, 0, "p", 98);
306
+ } if (rf & 2) {
307
+ const row_r11 = i0.ɵɵnextContext();
308
+ const ctx_r2 = i0.ɵɵnextContext();
309
+ i0.ɵɵadvance();
310
+ i0.ɵɵtextInterpolate1("", ctx_r2.date(row_r11.RenewalOrderDate), " ");
311
+ i0.ɵɵadvance(2);
312
+ i0.ɵɵtextInterpolate(row_r11.RenewalOrderStatus);
313
+ i0.ɵɵadvance(2);
314
+ i0.ɵɵtextInterpolate1(" ", ctx_r2.money(row_r11.RenewalUnitPrice), " ");
315
+ i0.ɵɵadvance();
316
+ i0.ɵɵconditional(row_r11.RenewalQuantity && row_r11.RenewalQuantity !== 1 ? 6 : -1);
317
+ i0.ɵɵadvance();
318
+ i0.ɵɵconditional(row_r11.RenewalBooked ? 7 : 8);
319
+ } }
320
+ function MJORenewalsPageComponent_Conditional_44_Conditional_58_Template(rf, ctx) { if (rf & 1) {
321
+ i0.ɵɵelementStart(0, "div", 3);
322
+ i0.ɵɵtext(1, "A payment gateway bills this subscription and renews it itself. Orders places no renewal order.");
323
+ i0.ɵɵelementEnd();
324
+ } }
325
+ function MJORenewalsPageComponent_Conditional_44_Conditional_59_Conditional_0_Conditional_2_Template(rf, ctx) { if (rf & 1) {
326
+ i0.ɵɵelementStart(0, "span", 3);
327
+ i0.ɵɵtext(1);
328
+ i0.ɵɵelementEnd();
329
+ } if (rf & 2) {
330
+ const row_r11 = i0.ɵɵnextContext(3);
331
+ const ctx_r2 = i0.ɵɵnextContext();
332
+ i0.ɵɵadvance();
333
+ i0.ɵɵtextInterpolate2("\u00D7 ", row_r11.ProjectedQuantity, " = ", ctx_r2.money(row_r11.ProjectedLineTotal));
334
+ } }
335
+ function MJORenewalsPageComponent_Conditional_44_Conditional_59_Conditional_0_Template(rf, ctx) { if (rf & 1) {
336
+ i0.ɵɵelementStart(0, "mjo-stated-value", 100);
337
+ i0.ɵɵtext(1);
338
+ i0.ɵɵconditionalCreate(2, MJORenewalsPageComponent_Conditional_44_Conditional_59_Conditional_0_Conditional_2_Template, 2, 2, "span", 3);
339
+ i0.ɵɵelementEnd();
340
+ } if (rf & 2) {
341
+ const row_r11 = i0.ɵɵnextContext(2);
342
+ const ctx_r2 = i0.ɵɵnextContext();
343
+ i0.ɵɵadvance();
344
+ i0.ɵɵtextInterpolate1(" ", ctx_r2.money(row_r11.ProjectedUnitPrice), " ");
345
+ i0.ɵɵadvance();
346
+ i0.ɵɵconditional(row_r11.ProjectedQuantity && row_r11.ProjectedQuantity !== 1 ? 2 : -1);
347
+ } }
348
+ function MJORenewalsPageComponent_Conditional_44_Conditional_59_For_2_Template(rf, ctx) { if (rf & 1) {
349
+ i0.ɵɵelementStart(0, "mjo-stated-value", 101);
350
+ i0.ɵɵtext(1);
351
+ i0.ɵɵelementEnd();
352
+ } if (rf & 2) {
353
+ const line_r16 = ctx.$implicit;
354
+ i0.ɵɵproperty("Label", line_r16.Label);
355
+ i0.ɵɵadvance();
356
+ i0.ɵɵtextInterpolate(line_r16.Text);
357
+ } }
358
+ function MJORenewalsPageComponent_Conditional_44_Conditional_59_Conditional_3_Template(rf, ctx) { if (rf & 1) {
359
+ const _r17 = i0.ɵɵgetCurrentView();
360
+ i0.ɵɵelementStart(0, "button", 103);
361
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Conditional_44_Conditional_59_Conditional_3_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r17); const row_r11 = i0.ɵɵnextContext(2); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.OpenPlace([row_r11.SubscriptionID])); });
362
+ i0.ɵɵelement(1, "i", 27);
363
+ i0.ɵɵtext(2, " Create renewal order ");
364
+ i0.ɵɵelementEnd();
365
+ } if (rf & 2) {
366
+ const ctx_r2 = i0.ɵɵnextContext(3);
367
+ i0.ɵɵproperty("disabled", ctx_r2.Busy);
368
+ } }
369
+ function MJORenewalsPageComponent_Conditional_44_Conditional_59_Template(rf, ctx) { if (rf & 1) {
370
+ i0.ɵɵconditionalCreate(0, MJORenewalsPageComponent_Conditional_44_Conditional_59_Conditional_0_Template, 3, 2, "mjo-stated-value", 100);
371
+ i0.ɵɵrepeaterCreate(1, MJORenewalsPageComponent_Conditional_44_Conditional_59_For_2_Template, 2, 2, "mjo-stated-value", 101, _forTrack2);
372
+ i0.ɵɵconditionalCreate(3, MJORenewalsPageComponent_Conditional_44_Conditional_59_Conditional_3_Template, 3, 1, "button", 102);
373
+ } if (rf & 2) {
374
+ const row_r11 = i0.ɵɵnextContext();
375
+ const ctx_r2 = i0.ɵɵnextContext();
376
+ i0.ɵɵconditional(row_r11.ProjectedUnitPrice != null ? 0 : -1);
377
+ i0.ɵɵadvance();
378
+ i0.ɵɵrepeater(ctx);
379
+ i0.ɵɵadvance(2);
380
+ i0.ɵɵconditional(ctx_r2.CanPlace(row_r11) ? 3 : -1);
381
+ } }
382
+ function MJORenewalsPageComponent_Conditional_44_Conditional_60_Template(rf, ctx) { if (rf & 1) {
383
+ i0.ɵɵelementStart(0, "div", 3);
384
+ i0.ɵɵtext(1);
385
+ i0.ɵɵelementEnd();
386
+ } if (rf & 2) {
387
+ const row_r11 = i0.ɵɵnextContext();
388
+ const ctx_r2 = i0.ɵɵnextContext();
389
+ i0.ɵɵadvance();
390
+ i0.ɵɵtextInterpolate(ctx_r2.stateNote(row_r11) ?? "Nothing will renew this subscription.");
391
+ } }
392
+ function MJORenewalsPageComponent_Conditional_44_Template(rf, ctx) { if (rf & 1) {
393
+ const _r10 = i0.ɵɵgetCurrentView();
394
+ i0.ɵɵelementStart(0, "aside", 35)(1, "div", 67)(2, "div", 68);
395
+ i0.ɵɵelement(3, "i", 33);
396
+ i0.ɵɵelementStart(4, "h3");
397
+ i0.ɵɵtext(5);
398
+ i0.ɵɵelementEnd();
399
+ i0.ɵɵelementStart(6, "span", 69)(7, "span", 70);
400
+ i0.ɵɵtext(8);
401
+ i0.ɵɵelementEnd();
402
+ i0.ɵɵelementStart(9, "button", 71);
403
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Conditional_44_Template_button_click_9_listener() { const row_r11 = i0.ɵɵrestoreView(_r10); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.OpenSubscription(row_r11)); });
404
+ i0.ɵɵelement(10, "i", 72);
405
+ i0.ɵɵtext(11, " Open ");
406
+ i0.ɵɵelementEnd()()();
407
+ i0.ɵɵelementStart(12, "div", 73)(13, "mjo-stated-value", 74);
408
+ i0.ɵɵtext(14);
409
+ i0.ɵɵelementEnd();
410
+ i0.ɵɵelementStart(15, "mjo-stated-value", 75);
411
+ i0.ɵɵtext(16);
412
+ i0.ɵɵelementEnd();
413
+ i0.ɵɵelementStart(17, "mjo-stated-value", 76);
414
+ i0.ɵɵtext(18);
415
+ i0.ɵɵelementEnd();
416
+ i0.ɵɵelementStart(19, "mjo-stated-value", 77);
417
+ i0.ɵɵtext(20);
418
+ i0.ɵɵelementStart(21, "span", 3);
419
+ i0.ɵɵtext(22);
420
+ i0.ɵɵelementEnd();
421
+ i0.ɵɵconditionalCreate(23, MJORenewalsPageComponent_Conditional_44_Conditional_23_Template, 3, 1, "button", 78);
422
+ i0.ɵɵelementEnd();
423
+ i0.ɵɵelementStart(24, "mjo-stated-value", 79);
424
+ i0.ɵɵtext(25);
425
+ i0.ɵɵelementStart(26, "span", 3);
426
+ i0.ɵɵtext(27);
427
+ i0.ɵɵelementEnd();
428
+ i0.ɵɵconditionalCreate(28, MJORenewalsPageComponent_Conditional_44_Conditional_28_Template, 2, 1, "span", 80);
429
+ i0.ɵɵelementEnd();
430
+ i0.ɵɵelementStart(29, "mjo-stated-value", 81);
431
+ i0.ɵɵtext(30);
432
+ i0.ɵɵelementEnd();
433
+ i0.ɵɵelementStart(31, "mjo-stated-value", 82);
434
+ i0.ɵɵtext(32);
435
+ i0.ɵɵconditionalCreate(33, MJORenewalsPageComponent_Conditional_44_Conditional_33_Template, 2, 2, "span", 3)(34, MJORenewalsPageComponent_Conditional_44_Conditional_34_Template, 2, 0, "span", 3);
436
+ i0.ɵɵconditionalCreate(35, MJORenewalsPageComponent_Conditional_44_Conditional_35_Template, 3, 1, "button", 83);
437
+ i0.ɵɵelementEnd();
438
+ i0.ɵɵelementStart(36, "mjo-stated-value", 84);
439
+ i0.ɵɵtext(37);
440
+ i0.ɵɵelementStart(38, "button", 85);
441
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Conditional_44_Template_button_click_38_listener() { const row_r11 = i0.ɵɵrestoreView(_r10); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.OpenIncrease([row_r11.SubscriptionID])); });
442
+ i0.ɵɵelement(39, "i", 86);
443
+ i0.ɵɵtext(40, " Edit ");
444
+ i0.ɵɵelementEnd()()()();
445
+ i0.ɵɵelementStart(41, "div", 87)(42, "div", 68);
446
+ i0.ɵɵelement(43, "i", 88);
447
+ i0.ɵɵelementStart(44, "h3");
448
+ i0.ɵɵtext(45, "Current order");
449
+ i0.ɵɵelementEnd();
450
+ i0.ɵɵconditionalCreate(46, MJORenewalsPageComponent_Conditional_44_Conditional_46_Template, 3, 1, "button", 89);
451
+ i0.ɵɵelementEnd();
452
+ i0.ɵɵelementStart(47, "div", 73);
453
+ i0.ɵɵconditionalCreate(48, MJORenewalsPageComponent_Conditional_44_Conditional_48_Template, 8, 5)(49, MJORenewalsPageComponent_Conditional_44_Conditional_49_Template, 2, 0, "div", 3);
454
+ i0.ɵɵelementEnd()();
455
+ i0.ɵɵelementStart(50, "div", 87)(51, "div", 68);
456
+ i0.ɵɵelement(52, "i", 33);
457
+ i0.ɵɵelementStart(53, "h3");
458
+ i0.ɵɵtext(54, "Renewal");
459
+ i0.ɵɵelementEnd();
460
+ i0.ɵɵconditionalCreate(55, MJORenewalsPageComponent_Conditional_44_Conditional_55_Template, 3, 1, "button", 89);
461
+ i0.ɵɵelementEnd();
462
+ i0.ɵɵelementStart(56, "div", 73);
463
+ i0.ɵɵconditionalCreate(57, MJORenewalsPageComponent_Conditional_44_Conditional_57_Template, 9, 5)(58, MJORenewalsPageComponent_Conditional_44_Conditional_58_Template, 2, 0, "div", 3)(59, MJORenewalsPageComponent_Conditional_44_Conditional_59_Template, 4, 2)(60, MJORenewalsPageComponent_Conditional_44_Conditional_60_Template, 2, 1, "div", 3);
464
+ i0.ɵɵelementEnd()()();
465
+ } if (rf & 2) {
466
+ let tmp_14_0;
467
+ let tmp_24_0;
468
+ const row_r11 = ctx;
469
+ const ctx_r2 = i0.ɵɵnextContext();
470
+ i0.ɵɵadvance(5);
471
+ i0.ɵɵtextInterpolate(row_r11.SubscriptionNumber);
472
+ i0.ɵɵadvance(2);
473
+ i0.ɵɵclassMap(ctx_r2.stateClass(row_r11));
474
+ i0.ɵɵadvance();
475
+ i0.ɵɵtextInterpolate(ctx_r2.stateLabel(row_r11));
476
+ i0.ɵɵadvance(6);
477
+ i0.ɵɵtextInterpolate(row_r11.ContactName ?? "\u2014");
478
+ i0.ɵɵadvance(2);
479
+ i0.ɵɵtextInterpolate(row_r11.AccountName ?? "\u2014");
480
+ i0.ɵɵadvance(2);
481
+ i0.ɵɵtextInterpolate(row_r11.CompanyName || "\u2014");
482
+ i0.ɵɵadvance(2);
483
+ i0.ɵɵtextInterpolate1(" ", row_r11.ProductName, " ");
484
+ i0.ɵɵadvance(2);
485
+ i0.ɵɵtextInterpolate1("\u00B7 ", row_r11.SubscriptionTypeName);
486
+ i0.ɵɵadvance();
487
+ i0.ɵɵconditional(!row_r11.ProviderBilled ? 23 : -1);
488
+ i0.ɵɵadvance(2);
489
+ i0.ɵɵtextInterpolate3(" Term ", row_r11.TermNumber, " \u00B7 ", ctx_r2.date(row_r11.TermStartDate), " \u2192 ", ctx_r2.date(row_r11.TermEndDate), " ");
490
+ i0.ɵɵadvance(2);
491
+ i0.ɵɵtextInterpolate1("\u00B7 ", ctx_r2.endsNote(row_r11));
492
+ i0.ɵɵadvance();
493
+ i0.ɵɵconditional((tmp_14_0 = ctx_r2.termWarning(row_r11)) ? 28 : -1, tmp_14_0);
494
+ i0.ɵɵadvance(2);
495
+ i0.ɵɵtextInterpolate(ctx_r2.date(row_r11.StartDate));
496
+ i0.ɵɵadvance(2);
497
+ i0.ɵɵtextInterpolate1(" ", row_r11.AutoRenew ? "On" : "Off", " ");
498
+ i0.ɵɵadvance();
499
+ i0.ɵɵconditional(row_r11.AutoRenewOn ? 33 : !row_r11.AutoRenew && !row_r11.RenewalOrderID && !row_r11.ProviderBilled ? 34 : -1);
500
+ i0.ɵɵadvance(2);
501
+ i0.ɵɵconditional(!row_r11.ProviderBilled ? 35 : -1);
502
+ i0.ɵɵadvance(2);
503
+ i0.ɵɵtextInterpolate1(" ", ctx_r2.increaseNote(row_r11), " ");
504
+ i0.ɵɵadvance();
505
+ i0.ɵɵproperty("disabled", ctx_r2.Busy);
506
+ i0.ɵɵadvance(8);
507
+ i0.ɵɵconditional(row_r11.CurrentOrderID ? 46 : -1);
508
+ i0.ɵɵadvance(2);
509
+ i0.ɵɵconditional(row_r11.CurrentOrderID ? 48 : 49);
510
+ i0.ɵɵadvance(7);
511
+ i0.ɵɵconditional(row_r11.RenewalOrderID ? 55 : -1);
512
+ i0.ɵɵadvance(2);
513
+ i0.ɵɵconditional(row_r11.RenewalOrderID ? 57 : row_r11.ProviderBilled ? 58 : (tmp_24_0 = ctx_r2.projectionLines(row_r11)) ? 59 : 60, tmp_24_0);
514
+ } }
515
+ function MJORenewalsPageComponent_Conditional_48_Template(rf, ctx) { if (rf & 1) {
516
+ i0.ɵɵelementStart(0, "p", 38);
517
+ i0.ɵɵelement(1, "i", 104);
518
+ i0.ɵɵtext(2);
519
+ i0.ɵɵelementEnd();
520
+ } if (rf & 2) {
521
+ const ctx_r2 = i0.ɵɵnextContext();
522
+ i0.ɵɵadvance(2);
523
+ i0.ɵɵtextInterpolate1(" ", ctx_r2.IncreasePendingNote, " ");
524
+ } }
525
+ function MJORenewalsPageComponent_Conditional_59_Template(rf, ctx) { if (rf & 1) {
526
+ i0.ɵɵelementStart(0, "p", 45);
527
+ i0.ɵɵtext(1);
528
+ i0.ɵɵelementEnd();
529
+ } if (rf & 2) {
530
+ const ctx_r2 = i0.ɵɵnextContext();
531
+ i0.ɵɵadvance();
532
+ i0.ɵɵtextInterpolate(ctx_r2.IncreaseError);
533
+ } }
534
+ function MJORenewalsPageComponent_Conditional_66_Conditional_8_Conditional_1_Template(rf, ctx) { if (rf & 1) {
535
+ i0.ɵɵelementStart(0, "span", 3);
536
+ i0.ɵɵtext(1, "\u00B7 same customer, same end date, one order");
537
+ i0.ɵɵelementEnd();
538
+ } }
539
+ function MJORenewalsPageComponent_Conditional_66_Conditional_8_Template(rf, ctx) { if (rf & 1) {
540
+ i0.ɵɵtext(0);
541
+ i0.ɵɵconditionalCreate(1, MJORenewalsPageComponent_Conditional_66_Conditional_8_Conditional_1_Template, 2, 0, "span", 3);
542
+ } if (rf & 2) {
543
+ const summary_r18 = i0.ɵɵnextContext();
544
+ i0.ɵɵtextInterpolate4(" ", summary_r18.Placeable.length, " subscription", summary_r18.Placeable.length === 1 ? "" : "s", " on ", summary_r18.Orders, " renewal order", summary_r18.Orders === 1 ? "" : "s", " ");
545
+ i0.ɵɵadvance();
546
+ i0.ɵɵconditional(summary_r18.Orders < summary_r18.Placeable.length ? 1 : -1);
547
+ } }
548
+ function MJORenewalsPageComponent_Conditional_66_Conditional_9_Template(rf, ctx) { if (rf & 1) {
549
+ i0.ɵɵtext(0, " none ");
550
+ } }
551
+ function MJORenewalsPageComponent_Conditional_66_Conditional_10_Template(rf, ctx) { if (rf & 1) {
552
+ i0.ɵɵelementStart(0, "dt");
553
+ i0.ɵɵtext(1, "Total");
554
+ i0.ɵɵelementEnd();
555
+ i0.ɵɵelementStart(2, "dd");
556
+ i0.ɵɵtext(3);
557
+ i0.ɵɵelementStart(4, "span", 3);
558
+ i0.ɵɵtext(5, "before tax");
559
+ i0.ɵɵelementEnd()();
560
+ } if (rf & 2) {
561
+ const summary_r18 = i0.ɵɵnextContext();
562
+ const ctx_r2 = i0.ɵɵnextContext();
563
+ i0.ɵɵadvance(3);
564
+ i0.ɵɵtextInterpolate1("", ctx_r2.money(summary_r18.Total), " ");
565
+ } }
566
+ function MJORenewalsPageComponent_Conditional_66_Conditional_11_Template(rf, ctx) { if (rf & 1) {
567
+ i0.ɵɵelementStart(0, "dt");
568
+ i0.ɵɵtext(1, "Excluded");
569
+ i0.ɵɵelementEnd();
570
+ i0.ɵɵelementStart(2, "dd");
571
+ i0.ɵɵtext(3);
572
+ i0.ɵɵelementEnd();
573
+ } if (rf & 2) {
574
+ const ctx_r2 = i0.ɵɵnextContext(2);
575
+ i0.ɵɵadvance(3);
576
+ i0.ɵɵtextInterpolate(ctx_r2.PlaceExcluded);
577
+ } }
578
+ function MJORenewalsPageComponent_Conditional_66_Conditional_12_Template(rf, ctx) { if (rf & 1) {
579
+ i0.ɵɵelementStart(0, "dt");
580
+ i0.ɵɵtext(1, "Skipped");
581
+ i0.ɵɵelementEnd();
582
+ i0.ɵɵelementStart(2, "dd");
583
+ i0.ɵɵtext(3);
584
+ i0.ɵɵelementEnd();
585
+ } if (rf & 2) {
586
+ const summary_r18 = i0.ɵɵnextContext();
587
+ i0.ɵɵadvance(3);
588
+ i0.ɵɵtextInterpolate(summary_r18.Detail);
589
+ } }
590
+ function MJORenewalsPageComponent_Conditional_66_Conditional_13_Template(rf, ctx) { if (rf & 1) {
591
+ const _r19 = i0.ɵɵgetCurrentView();
592
+ i0.ɵɵelementStart(0, "div", 39)(1, "span", 105);
593
+ i0.ɵɵtext(2, "Create as");
594
+ i0.ɵɵelementEnd();
595
+ i0.ɵɵelementStart(3, "label", 54)(4, "input", 106);
596
+ i0.ɵɵlistener("change", function MJORenewalsPageComponent_Conditional_66_Conditional_13_Template_input_change_4_listener() { i0.ɵɵrestoreView(_r19); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.OnPlaceAs("Draft")); });
597
+ i0.ɵɵelementEnd();
598
+ i0.ɵɵelementStart(5, "span")(6, "strong");
599
+ i0.ɵɵtext(7, "Draft");
600
+ i0.ɵɵelementEnd();
601
+ i0.ɵɵelementStart(8, "span", 42);
602
+ i0.ɵɵtext(9, "\u00B7 review and confirm each order before it is invoiced");
603
+ i0.ɵɵelementEnd()()();
604
+ i0.ɵɵelementStart(10, "label", 54)(11, "input", 106);
605
+ i0.ɵɵlistener("change", function MJORenewalsPageComponent_Conditional_66_Conditional_13_Template_input_change_11_listener() { i0.ɵɵrestoreView(_r19); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.OnPlaceAs("Confirmed")); });
606
+ i0.ɵɵelementEnd();
607
+ i0.ɵɵelementStart(12, "span")(13, "strong");
608
+ i0.ɵɵtext(14, "Confirmed");
609
+ i0.ɵɵelementEnd();
610
+ i0.ɵɵelementStart(15, "span", 42);
611
+ i0.ɵɵtext(16, "\u00B7 booked now");
612
+ i0.ɵɵelementEnd()()()();
613
+ } if (rf & 2) {
614
+ const ctx_r2 = i0.ɵɵnextContext(2);
615
+ i0.ɵɵadvance(4);
616
+ i0.ɵɵproperty("checked", ctx_r2.PlaceAs === "Draft")("disabled", ctx_r2.Placing);
617
+ i0.ɵɵadvance(7);
618
+ i0.ɵɵproperty("checked", ctx_r2.PlaceAs === "Confirmed")("disabled", ctx_r2.Placing);
619
+ } }
620
+ function MJORenewalsPageComponent_Conditional_66_For_15_Template(rf, ctx) { if (rf & 1) {
621
+ i0.ɵɵelementStart(0, "p", 38);
622
+ i0.ɵɵelement(1, "i", 104);
623
+ i0.ɵɵtext(2);
624
+ i0.ɵɵelementEnd();
625
+ } if (rf & 2) {
626
+ const warning_r20 = ctx.$implicit;
627
+ i0.ɵɵadvance(2);
628
+ i0.ɵɵtextInterpolate1(" ", warning_r20, " ");
629
+ } }
630
+ function MJORenewalsPageComponent_Conditional_66_Template(rf, ctx) { if (rf & 1) {
631
+ i0.ɵɵelementStart(0, "dl", 52)(1, "dt");
632
+ i0.ɵɵtext(2, "Selected");
633
+ i0.ɵɵelementEnd();
634
+ i0.ɵɵelementStart(3, "dd");
635
+ i0.ɵɵtext(4);
636
+ i0.ɵɵelementEnd();
637
+ i0.ɵɵelementStart(5, "dt");
638
+ i0.ɵɵtext(6, "To renew");
639
+ i0.ɵɵelementEnd();
640
+ i0.ɵɵelementStart(7, "dd");
641
+ i0.ɵɵconditionalCreate(8, MJORenewalsPageComponent_Conditional_66_Conditional_8_Template, 2, 5)(9, MJORenewalsPageComponent_Conditional_66_Conditional_9_Template, 1, 0);
642
+ i0.ɵɵelementEnd();
643
+ i0.ɵɵconditionalCreate(10, MJORenewalsPageComponent_Conditional_66_Conditional_10_Template, 6, 1);
644
+ i0.ɵɵconditionalCreate(11, MJORenewalsPageComponent_Conditional_66_Conditional_11_Template, 4, 1);
645
+ i0.ɵɵconditionalCreate(12, MJORenewalsPageComponent_Conditional_66_Conditional_12_Template, 4, 1);
646
+ i0.ɵɵelementEnd();
647
+ i0.ɵɵconditionalCreate(13, MJORenewalsPageComponent_Conditional_66_Conditional_13_Template, 17, 4, "div", 39);
648
+ i0.ɵɵrepeaterCreate(14, MJORenewalsPageComponent_Conditional_66_For_15_Template, 3, 1, "p", 38, i0.ɵɵrepeaterTrackByIdentity);
649
+ } if (rf & 2) {
650
+ const summary_r18 = ctx;
651
+ const ctx_r2 = i0.ɵɵnextContext();
652
+ i0.ɵɵadvance(4);
653
+ i0.ɵɵtextInterpolate2("", ctx_r2.PlaceTargets.length + ctx_r2.PlaceExcludedCount, " subscription", ctx_r2.PlaceTargets.length + ctx_r2.PlaceExcludedCount === 1 ? "" : "s");
654
+ i0.ɵɵadvance(4);
655
+ i0.ɵɵconditional(summary_r18.Placeable.length ? 8 : 9);
656
+ i0.ɵɵadvance(2);
657
+ i0.ɵɵconditional(summary_r18.Placeable.length ? 10 : -1);
658
+ i0.ɵɵadvance();
659
+ i0.ɵɵconditional(ctx_r2.PlaceExcluded ? 11 : -1);
660
+ i0.ɵɵadvance();
661
+ i0.ɵɵconditional(summary_r18.Detail ? 12 : -1);
662
+ i0.ɵɵadvance();
663
+ i0.ɵɵconditional(summary_r18.Placeable.length ? 13 : -1);
664
+ i0.ɵɵadvance();
665
+ i0.ɵɵrepeater(ctx_r2.PlaceWarnings);
666
+ } }
667
+ function MJORenewalsPageComponent_Conditional_67_Template(rf, ctx) { if (rf & 1) {
668
+ i0.ɵɵelementStart(0, "p", 49);
669
+ i0.ɵɵtext(1, "Checking what can be renewed\u2026");
670
+ i0.ɵɵelementEnd();
671
+ } }
672
+ function MJORenewalsPageComponent_Conditional_68_Template(rf, ctx) { if (rf & 1) {
673
+ i0.ɵɵelementStart(0, "p", 45);
674
+ i0.ɵɵtext(1);
675
+ i0.ɵɵelementEnd();
676
+ } if (rf & 2) {
677
+ const ctx_r2 = i0.ɵɵnextContext();
678
+ i0.ɵɵadvance();
679
+ i0.ɵɵtextInterpolate(ctx_r2.PlaceError);
680
+ } }
681
+ function MJORenewalsPageComponent_Conditional_75_Template(rf, ctx) { if (rf & 1) {
682
+ i0.ɵɵelementStart(0, "p", 51);
683
+ i0.ɵɵelement(1, "i", 104);
684
+ i0.ɵɵtext(2);
685
+ i0.ɵɵelementEnd();
686
+ } if (rf & 2) {
687
+ const ctx_r2 = i0.ɵɵnextContext();
688
+ i0.ɵɵadvance(2);
689
+ i0.ɵɵtextInterpolate1(" ", ctx_r2.ProductPendingNote, " ");
690
+ } }
691
+ function MJORenewalsPageComponent_Conditional_92_Template(rf, ctx) { if (rf & 1) {
692
+ i0.ɵɵelementStart(0, "span", 3);
693
+ i0.ɵɵtext(1, "Loading products\u2026");
694
+ i0.ɵɵelementEnd();
695
+ } }
696
+ function MJORenewalsPageComponent_Conditional_93_Template(rf, ctx) { if (rf & 1) {
697
+ i0.ɵɵelementStart(0, "span", 3);
698
+ i0.ɵɵtext(1, "No active subscription products for this company.");
699
+ i0.ɵɵelementEnd();
700
+ } }
701
+ function MJORenewalsPageComponent_Conditional_94_Template(rf, ctx) { if (rf & 1) {
702
+ const _r21 = i0.ɵɵgetCurrentView();
703
+ i0.ɵɵelementStart(0, "mj-dropdown", 107);
704
+ i0.ɵɵlistener("ValueChange", function MJORenewalsPageComponent_Conditional_94_Template_mj_dropdown_ValueChange_0_listener($event) { i0.ɵɵrestoreView(_r21); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.OnProductChoice($event)); });
705
+ i0.ɵɵelementEnd();
706
+ i0.ɵɵelementStart(1, "span", 108);
707
+ i0.ɵɵtext(2, "Active subscription products sold by the same company.");
708
+ i0.ɵɵelementEnd();
709
+ } if (rf & 2) {
710
+ const ctx_r2 = i0.ɵɵnextContext();
711
+ i0.ɵɵproperty("Data", ctx_r2.ProductChoices)("ValuePrimitive", true)("Filterable", true);
712
+ } }
713
+ function MJORenewalsPageComponent_Conditional_103_Template(rf, ctx) { if (rf & 1) {
714
+ i0.ɵɵelementStart(0, "p", 45);
715
+ i0.ɵɵtext(1);
716
+ i0.ɵɵelementEnd();
717
+ } if (rf & 2) {
718
+ const ctx_r2 = i0.ɵɵnextContext();
719
+ i0.ɵɵadvance();
720
+ i0.ɵɵtextInterpolate(ctx_r2.ProductError);
721
+ } }
722
+ function MJORenewalsPageComponent_Conditional_128_Template(rf, ctx) { if (rf & 1) {
723
+ i0.ɵɵelementStart(0, "p", 45);
724
+ i0.ɵɵtext(1);
725
+ i0.ɵɵelementEnd();
726
+ } if (rf & 2) {
727
+ const ctx_r2 = i0.ɵɵnextContext();
728
+ i0.ɵɵadvance();
729
+ i0.ɵɵtextInterpolate(ctx_r2.AutoRenewError);
730
+ } }
731
+ /** Terms that ended this recently and were not renewed are listed too, so a missed renewal is seen. */
732
+ const LOOKBACK_DAYS = 30;
733
+ /**
734
+ * `mjo-renewals-page` — what ends soon, what renews by itself, and what somebody has to place.
735
+ *
736
+ * ONE LIST FOR TWO TEAMS. Accounting reads it for the renewal revenue coming and the price each
737
+ * renewal will carry; the product teams read it for the customers whose coverage is about to end.
738
+ * Both questions start from the same rows — every subscription whose term ends inside the window,
739
+ * soonest first — so the page shows both answers on each row rather than splitting into two screens
740
+ * that drift.
741
+ *
742
+ * WHAT A ROW SAYS. The customer and account, the product, when the term started and ends, whether
743
+ * auto-renew is on, the order that bought the current term and its price, and then the renewal:
744
+ * the renewal order if one exists (number, date, status, price), otherwise the price a renewal
745
+ * would be placed at and the day the nightly pass will place it. The projection is the pass's own
746
+ * pricer, so the figure here is the figure the order will carry.
747
+ *
748
+ * NARROWING. Two dropdowns, Company and Product, each listing only what has a subscription ending
749
+ * in the window, with a count beside each choice. Status, auto-renew and renewal state are NOT
750
+ * dropdowns: the chips over the grid already split the list by what will happen to it, and a
751
+ * second control for the same question is a thing to keep in sync. The tiles and chip counts follow
752
+ * the dropdowns, so "Will end unless renewed: 4" is four for the company you picked.
753
+ *
754
+ * EXPORT. The rows as shown, to Excel or CSV in one click through MJ's export service (the same
755
+ * engine the order form's journal export uses). Every column the grid and the side panel show, in
756
+ * plain words, so a finance reviewer can total and sort without the app.
757
+ *
758
+ * CHANGE PRODUCT. The cutover load put many subscriptions on "(converted pricing)" stand-ins. A
759
+ * subscription is the record of what the customer has NOW, the order and deal of what was sold, so
760
+ * the correction goes on the subscription alone (`Orders.ChangeSubscriptionProduct`): booked lines,
761
+ * journal and deal keep their product, and the next renewal carries the corrected one at the current
762
+ * price plus increase. The product does not enter the renewal group key, so subscriptions bought
763
+ * together still renew on one order.
764
+ *
765
+ * TICK ROWS, SET THEIR SWITCHES. Every row can be ticked, renewable or not. A tick survives a filter
766
+ * change only while its row is still shown, so a bulk button never acts on a row nobody can see. "Auto-renew" turns the
767
+ * switch on or off for the ticked subscriptions and "Update increase %" sets their own rate, both
768
+ * through `Orders.SetRenewalSettings`. Neither touches an order: a renewal already placed keeps its
769
+ * price, and the next one follows the new settings. The side panel shows each subscription's switch
770
+ * and rate, with the same actions for one row. Every date on the page is MM/DD/YYYY (`RENEWALS_DATE`).
771
+ *
772
+ * TICK ROWS, PLACE THEIR RENEWALS. The other action. It previews first through the same operation
773
+ * the nightly job runs (`Orders.SpawnRenewals`, with the ticked subscriptions named), shows what
774
+ * would be placed and what would be skipped, and asks how to leave the orders: as drafts (the
775
+ * default, for a person to review and confirm) or confirmed at once (Bill.com invoicing is its own
776
+ * job). Either way the nightly pass sees the order and will not place a second one. The engine puts
777
+ * one customer's subscriptions ending the same day on ONE renewal order; the dialog says when it
778
+ * combines, and warns when a sibling from the same original order was left out.
779
+ *
780
+ * ## Example
781
+ *
782
+ * ```html
783
+ * <mjo-renewals-page (SubscriptionOpened)="open($event)" (OrderOpened)="openOrder($event)" />
784
+ * ```
785
+ */
786
+ export class MJORenewalsPageComponent {
787
+ /** Same NG0100 reasoning as every other imperatively-created page here: write the DOM after a load. */
788
+ cdr = inject(ChangeDetectorRef);
789
+ exporter = inject(ExportService);
790
+ SubscriptionOpened = new EventEmitter();
791
+ OrderOpened = new EventEmitter();
792
+ String = String;
793
+ Windows = RENEWAL_WINDOWS;
794
+ Lookback = LOOKBACK_DAYS;
795
+ /** Rows asked for per load. The whole book ends inside twelve months (811 in prod today), so this is a ceiling, not a page. */
796
+ MaxRows = 2000;
797
+ WindowDays = RENEWAL_WINDOWS[0].Days;
798
+ LoadError = null;
799
+ Notice = null;
800
+ Truncated = false;
801
+ Placing = false;
802
+ Updating = false;
803
+ /** The create-renewals dialog. */
804
+ PlaceOpen = false;
805
+ PlaceTargets = [];
806
+ PlaceSummary = null;
807
+ PlaceWarnings = [];
808
+ PlaceExcluded = null;
809
+ PlaceExcludedCount = 0;
810
+ PlaceAs = 'Draft';
811
+ PlaceError = null;
812
+ /** The increase dialog. `IncreaseValue` null with `IncreaseClear` off means nothing typed yet. */
813
+ IncreaseOpen = false;
814
+ IncreaseTargets = [];
815
+ IncreaseValue = null;
816
+ IncreaseClear = false;
817
+ IncreaseError = null;
818
+ /** A chosen subscription has a renewal draft pending: the rate does not reach it. */
819
+ IncreasePendingNote = null;
820
+ /** The change-product dialog. Options load once, on first open. */
821
+ ProductOpen = false;
822
+ ProductTargets = [];
823
+ ProductCurrentNote = '';
824
+ /** A chosen subscription has a renewal draft pending: the operation refuses it. */
825
+ ProductPendingNote = null;
826
+ ProductCompanyNote = '';
827
+ /** Every Active subscription product, with its company, loaded once; `ProductChoices` is the slice for the chosen rows' company. */
828
+ productCatalog = [];
829
+ ProductChoice = null;
830
+ ProductAdoptType = false;
831
+ ProductError = null;
832
+ ProductChoices = [];
833
+ ProductChoicesLoading = false;
834
+ /** The auto-renew dialog. */
835
+ AutoRenewOpen = false;
836
+ AutoRenewTargets = [];
837
+ AutoRenewValue = null;
838
+ AutoRenewError = null;
839
+ /** Every row in the window, as loaded. */
840
+ AllRows = [];
841
+ /** The rows the Company and Product facets leave. Tiles and chip counts read this. */
842
+ Scoped = [];
843
+ /** What the table shows: scoped, then preset and search, then sorted. */
844
+ Rows = [];
845
+ Facets = NO_FACETS;
846
+ CompanyOptions = [];
847
+ ProductOptions = [];
848
+ /** A FIELD, like Presets: the chip row would see a fresh array every pass from a getter. */
849
+ Applied = [];
850
+ Exporting = false;
851
+ ExportMenuOpen = false;
852
+ MenuPositions = [
853
+ { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },
854
+ { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -4 },
855
+ ];
856
+ Selected = null;
857
+ /** Ticked subscription IDs. Survives a preset or search change; cleared after a placement. */
858
+ SelectedKeys = [];
859
+ Preset = 'all';
860
+ Search = '';
861
+ SortKey = 'TermEndDate';
862
+ SortDescending = false;
863
+ AsOf = '';
864
+ WindowStart = '';
865
+ WindowEnd = '';
866
+ PassMode = 'Unknown';
867
+ PassNextRunAt = null;
868
+ /** An arrow so the template can call it without `this`. */
869
+ CanPlace = (row) => CanPlaceRenewal(row);
870
+ get Busy() {
871
+ return this.Placing || this.Updating;
872
+ }
873
+ /** The ticked rows a renewal order can be placed for. Any row can be ticked; only these renew. */
874
+ get PlaceableSelected() {
875
+ return this.AllRows.filter((r) => this.SelectedKeys.includes(r.SubscriptionID) && CanPlaceRenewal(r)).map((r) => r.SubscriptionID);
876
+ }
877
+ /** What a row's checkbox is called to a screen reader: the subscription and whose it is, not its id. */
878
+ RowLabel = (row) => `Select ${row.SubscriptionNumber}, ${row.ContactName || row.AccountName || row.ProductName}`;
879
+ Columns = [
880
+ { Key: 'ContactName', Label: 'Customer', Sortable: true, Format: (r) => r.ContactName ?? r.AccountName ?? '—', Secondary: (r) => (r.ContactName && r.AccountName ? r.AccountName : null) },
881
+ { Key: 'CompanyName', Label: 'Company', HideBelow: 1000, Sortable: true },
882
+ { Key: 'ProductName', Label: 'Product', Sortable: true, Secondary: (r) => `${r.SubscriptionNumber} · ${r.SubscriptionTypeName}` },
883
+ { Key: 'StartDate', Label: 'Start', Kind: 'date', Width: '112px', HideBelow: 1000, Sortable: true, Format: (r) => FormatDate(r.StartDate, RENEWALS_DATE), Secondary: (r) => `term ${r.TermNumber}` },
884
+ { Key: 'TermEndDate', Label: 'Ends', Kind: 'date', Width: '112px', Sortable: true, Format: (r) => FormatDate(r.TermEndDate, RENEWALS_DATE), Secondary: (r) => [EndsNote(r.DaysUntilEnd), TermWarning(r)].filter(Boolean).join(' · ') },
885
+ { Key: 'Status', Label: 'Status', Kind: 'chip', Width: '90px', HideBelow: 760, Sortable: true, ChipClass: (r) => (r.Status === 'Active' ? 'mjo-chip--success' : r.Status === 'Trialing' ? 'mjo-chip--info' : 'mjo-chip--outline') },
886
+ { Key: 'AutoRenew', Label: 'Auto-renew', Kind: 'chip', Width: '96px', Sortable: true, Format: (r) => (r.AutoRenew ? 'On' : 'Off'), ChipClass: (r) => (r.AutoRenew ? 'mjo-chip--success' : 'mjo-chip--outline') },
887
+ { Key: 'State', Label: 'Renewal', Kind: 'chip', Width: '140px', Sortable: true, Format: (r) => RenewalStateLabel(r.State), ChipClass: (r) => RenewalStateChipClass(r.State), Secondary: (r) => RenewalStateNote(r) },
888
+ { Key: 'CurrentOrderNumber', Label: 'Current order', Kind: 'mono', Width: '140px', HideBelow: 760, Sortable: true, Format: (r) => r.CurrentOrderNumber ?? '—', Secondary: (r) => (r.CurrentOrderDate ? `${FormatDate(r.CurrentOrderDate, RENEWALS_DATE)} · ${r.CurrentOrderStatus}` : null) },
889
+ { Key: 'CurrentUnitPrice', Label: 'Current price', Kind: 'money', Width: '110px', Sortable: true, Format: (r) => (r.CurrentUnitPrice == null ? '—' : FormatMoney(r.CurrentUnitPrice)), Secondary: (r) => (r.CurrentQuantity && r.CurrentQuantity !== 1 ? `× ${r.CurrentQuantity}` : null) },
890
+ { Key: 'RenewalOrderNumber', Label: 'Renewal order', Kind: 'mono', Width: '140px', HideBelow: 760, Sortable: true, Format: (r) => r.RenewalOrderNumber ?? '—', Secondary: (r) => (r.RenewalOrderDate ? `${FormatDate(r.RenewalOrderDate, RENEWALS_DATE)} · ${r.RenewalOrderStatus}` : null) },
891
+ { Key: 'RenewalPrice', Label: 'Renewal price', Kind: 'money', Width: '120px', Sortable: true, Format: (r) => RenewalPriceDisplay(r), Secondary: (r) => RenewalPriceNote(r) },
892
+ ];
893
+ /** A FIELD, rebuilt when the rows change — a getter would be a fresh array on every pass (NG0100). */
894
+ Presets = [];
895
+ async ngOnInit() {
896
+ // The Explorer's refresh re-creates the page, so what a person set comes back from storage:
897
+ // the window, the company and product picks, and the quick filter. Picks no longer in the
898
+ // window are dropped once the rows are in.
899
+ const saved = ReadPageState(globalThis.localStorage);
900
+ if (saved) {
901
+ this.WindowDays = saved.WindowDays;
902
+ this.Facets = { Companies: saved.Companies, Products: saved.Products };
903
+ this.Preset = saved.Preset;
904
+ }
905
+ await this.load();
906
+ this.cdr.detectChanges();
907
+ }
908
+ remember() {
909
+ WritePageState(globalThis.localStorage, { WindowDays: this.WindowDays, Companies: this.Facets.Companies, Products: this.Facets.Products, Preset: this.Preset });
910
+ }
911
+ /* ── Tiles ──────────────────────────────────────────────────────────── */
912
+ get AutoCount() {
913
+ return this.Scoped.filter((r) => MatchesPreset(r, 'auto')).length;
914
+ }
915
+ get ManualCount() {
916
+ return this.Scoped.filter((r) => MatchesPreset(r, 'manual')).length;
917
+ }
918
+ get PlacedCount() {
919
+ return this.Scoped.filter((r) => MatchesPreset(r, 'placed')).length;
920
+ }
921
+ get EndingAmount() {
922
+ return FormatMoney(this.Scoped.reduce((s, r) => s + (r.CurrentLineTotal ?? 0), 0), { Round: true });
923
+ }
924
+ get AutoAmount() {
925
+ return FormatMoney(this.Scoped.filter((r) => MatchesPreset(r, 'auto')).reduce((s, r) => s + (r.ProjectedLineTotal ?? 0), 0), { Round: true });
926
+ }
927
+ get AutoDetail() {
928
+ const unpriced = this.Scoped.filter((r) => MatchesPreset(r, 'auto') && r.ProjectedLineTotal == null).length;
929
+ return unpriced ? `projected · ${unpriced} unpriced` : 'projected';
930
+ }
931
+ get ManualAmount() {
932
+ return FormatMoney(this.Scoped.filter((r) => MatchesPreset(r, 'manual')).reduce((s, r) => s + (r.CurrentLineTotal ?? 0), 0), { Round: true });
933
+ }
934
+ get PlacedAmount() {
935
+ return FormatMoney(this.Scoped.filter((r) => MatchesPreset(r, 'placed')).reduce((s, r) => s + (r.RenewalLineTotal ?? 0), 0), { Round: true });
936
+ }
937
+ /** A banner when the nightly job will NOT place what the list calls due: preview mode, or off. */
938
+ get PassNotice() {
939
+ if (this.PassMode !== 'Preview' && this.PassMode !== 'Off')
940
+ return null;
941
+ const due = this.AllRows.filter((r) => r.State === 'DueNow').length;
942
+ const text = due
943
+ ? `${due} subscription${due === 1 ? ' is' : 's are'} due for renewal now and require${due === 1 ? 's' : ''} manual processing.`
944
+ : 'No subscriptions are due for renewal right now.';
945
+ return {
946
+ Tone: 'warning',
947
+ Title: this.PassMode === 'Preview' ? 'Automatic renewals are disabled (nightly job in preview mode).' : 'Automatic renewals are disabled.',
948
+ Text: text,
949
+ };
950
+ }
951
+ get WindowDisplay() {
952
+ return this.AsOf ? `${FormatDate(this.AsOf, RENEWALS_DATE)} – ${FormatDate(this.WindowEnd, RENEWALS_DATE)}` : '';
953
+ }
954
+ get SelectionNote() {
955
+ const rows = this.AllRows.filter((r) => this.SelectedKeys.includes(r.SubscriptionID));
956
+ const placeable = rows.filter(CanPlaceRenewal);
957
+ const auto = placeable.filter((r) => r.AutoRenew).length;
958
+ const manual = placeable.length - auto;
959
+ const parts = [`${rows.length} ticked`];
960
+ if (auto)
961
+ parts.push(`${auto} to confirm and invoice`);
962
+ if (manual)
963
+ parts.push(`${manual} to draft`);
964
+ if (rows.length - placeable.length)
965
+ parts.push(`${rows.length - placeable.length} cannot renew from here`);
966
+ return parts.join(' · ');
967
+ }
968
+ get FootNote() {
969
+ return this.AllRows.length
970
+ ? 'Projected prices come from the renewal pricer: the current term’s undiscounted price or a successor’s list price, plus the annual increase where the new term crosses an anniversary. Before tax and promotions.'
971
+ : null;
972
+ }
973
+ /* ── Filters ────────────────────────────────────────────────────────── */
974
+ OnPreset(preset) {
975
+ this.Preset = preset;
976
+ this.applyFilters();
977
+ this.remember();
978
+ }
979
+ OnSearch(text) {
980
+ this.Search = text;
981
+ this.applyFilters();
982
+ }
983
+ // A filter change keeps the ticks on rows still in scope and drops the rest: a row ticked and
984
+ // then hidden would be acted on by a bulk button with nobody able to see it to untick it.
985
+ // Widening a filter hides nothing, so it unticks nothing. (`applyFilters` does the pruning.)
986
+ OnFacet(key, ids) {
987
+ this.Facets = key === 'Company' ? { ...this.Facets, Companies: ids } : { ...this.Facets, Products: ids };
988
+ this.applyFilters();
989
+ this.remember();
990
+ }
991
+ OnRemoveFacet(chip) {
992
+ this.Facets = RemoveFacet(this.Facets, chip.key);
993
+ this.applyFilters();
994
+ this.remember();
995
+ }
996
+ OnClearFacets() {
997
+ this.Facets = NO_FACETS;
998
+ this.applyFilters();
999
+ this.remember();
1000
+ }
1001
+ /* ── Export ─────────────────────────────────────────────────────────── */
1002
+ /** The rows as shown, downloaded as Excel or CSV. One click; the file is named for the window and any single filter. */
1003
+ async Export(format) {
1004
+ this.ExportMenuOpen = false;
1005
+ if (!this.Rows.length || this.Exporting)
1006
+ return;
1007
+ const result = BuildRenewalsExport(this.Rows);
1008
+ const scope = [
1009
+ this.Facets.Companies.length === 1 ? this.CompanyOptions.find((o) => o.Value === this.Facets.Companies[0])?.Text : null,
1010
+ this.Facets.Products.length === 1 ? this.ProductOptions.find((o) => o.Value === this.Facets.Products[0])?.Text : null,
1011
+ ]
1012
+ .filter((v) => !!v)
1013
+ .map((v) => v.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, ''))
1014
+ .join('-');
1015
+ const fileName = `renewals-next-${this.WindowDays}d${this.AsOf ? `-as-of-${this.AsOf}` : ''}${scope ? `-${scope}` : ''}`;
1016
+ this.Exporting = true;
1017
+ this.cdr.detectChanges();
1018
+ try {
1019
+ // The lower-case name: it is the one every ng-export-service since 6.1 exposes (6.2 adds a capitalised alias).
1020
+ const outcome = await this.exporter.exportAndDownload(result.Rows, { format, fileName, columns: result.Columns, includeHeaders: true });
1021
+ if (!outcome.success) {
1022
+ this.Notice = { Tone: 'error', Text: `The export failed: ${outcome.error ?? 'unknown error'}` };
1023
+ }
1024
+ }
1025
+ catch (err) {
1026
+ this.Notice = { Tone: 'error', Text: `The export failed: ${err instanceof Error ? err.message : String(err)}` };
1027
+ }
1028
+ finally {
1029
+ this.Exporting = false;
1030
+ this.cdr.detectChanges();
1031
+ }
1032
+ }
1033
+ OnSort(key) {
1034
+ if (this.SortKey === key)
1035
+ this.SortDescending = !this.SortDescending;
1036
+ else {
1037
+ this.SortKey = key;
1038
+ this.SortDescending = false;
1039
+ }
1040
+ this.applyFilters();
1041
+ }
1042
+ async OnWindow(value) {
1043
+ const days = Number(value);
1044
+ if (!Number.isFinite(days) || days === this.WindowDays)
1045
+ return;
1046
+ this.WindowDays = days;
1047
+ this.remember();
1048
+ await this.load();
1049
+ this.cdr.detectChanges();
1050
+ }
1051
+ /* ── Actions ────────────────────────────────────────────────────────── */
1052
+ OpenSubscription(row) {
1053
+ this.SubscriptionOpened.emit({ ID: row.SubscriptionID });
1054
+ }
1055
+ OpenOrder(orderID) {
1056
+ if (orderID)
1057
+ this.OrderOpened.emit({ ID: orderID });
1058
+ }
1059
+ /* ── Create renewal orders ──────────────────────────────────────────── */
1060
+ /**
1061
+ * Open the dialog for these subscriptions: preview through the same operation the nightly job
1062
+ * runs, so what the dialog describes is what the live call will do, then let the person choose
1063
+ * drafts (the default) or confirmed orders.
1064
+ */
1065
+ async OpenPlace(subscriptionIDs, ticked = subscriptionIDs) {
1066
+ if (!subscriptionIDs.length || this.Busy)
1067
+ return;
1068
+ this.PlaceTargets = [...subscriptionIDs];
1069
+ // Ticked but not placeable: said up front, so the count in the dialog never surprises.
1070
+ const excluded = this.AllRows.filter((r) => ticked.includes(r.SubscriptionID) && !subscriptionIDs.includes(r.SubscriptionID));
1071
+ this.PlaceExcludedCount = excluded.length;
1072
+ this.PlaceExcluded = ExclusionNote(excluded);
1073
+ this.PlaceSummary = null;
1074
+ this.PlaceAs = 'Draft';
1075
+ this.PlaceError = null;
1076
+ const chosen = this.AllRows.filter((r) => subscriptionIDs.includes(r.SubscriptionID));
1077
+ this.PlaceWarnings = SharedOrderWarnings(chosen, this.AllRows);
1078
+ this.PlaceOpen = true;
1079
+ await this.previewPlacement();
1080
+ this.cdr.detectChanges();
1081
+ }
1082
+ /** The radio changes the placement, and the placement is part of the renewal group key, so the preview runs again. */
1083
+ async OnPlaceAs(placeAs) {
1084
+ if (this.PlaceAs === placeAs || this.Busy)
1085
+ return;
1086
+ this.PlaceAs = placeAs;
1087
+ await this.previewPlacement();
1088
+ this.cdr.detectChanges();
1089
+ }
1090
+ /**
1091
+ * Preview with the SAME input the live call will send, placement included: what the dialog says
1092
+ * (how many orders, the total, what is skipped) is then what Create will do.
1093
+ */
1094
+ async previewPlacement() {
1095
+ this.Placing = true;
1096
+ this.PlaceSummary = null;
1097
+ this.PlaceError = null;
1098
+ this.cdr.detectChanges();
1099
+ try {
1100
+ const preview = await new OrdersSpawnRenewalsOperation().Execute({ SubscriptionIDs: this.PlaceTargets, PlaceAs: this.PlaceAs, Preview: true });
1101
+ if (!preview.Success || !preview.Output?.Success) {
1102
+ this.PlaceError = preview.Output?.Message?.trim() || preview.ErrorMessage?.trim() || 'The renewals could not be previewed.';
1103
+ this.PlaceSummary = SummarizePlacement([], this.PlaceAs);
1104
+ return;
1105
+ }
1106
+ this.PlaceSummary = SummarizePlacement(preview.Output.Candidates, this.PlaceAs);
1107
+ }
1108
+ finally {
1109
+ this.Placing = false;
1110
+ this.cdr.detectChanges();
1111
+ }
1112
+ }
1113
+ /** Place, as the dialog says. */
1114
+ async ApplyPlace() {
1115
+ if (this.Busy || !this.PlaceTargets.length || !this.PlaceSummary?.Placeable.length)
1116
+ return;
1117
+ this.Placing = true;
1118
+ this.PlaceError = null;
1119
+ this.cdr.detectChanges();
1120
+ try {
1121
+ const result = await new OrdersSpawnRenewalsOperation().Execute({ SubscriptionIDs: this.PlaceTargets, PlaceAs: this.PlaceAs });
1122
+ const output = result.Output;
1123
+ if (!result.Success || !output?.Success) {
1124
+ this.PlaceError = output?.Message?.trim() || result.ErrorMessage?.trim() || 'The renewal orders could not be created.';
1125
+ return;
1126
+ }
1127
+ this.PlaceOpen = false;
1128
+ this.Notice = { Tone: output.Placed ? 'success' : 'warning', Text: PlacedText(output.Candidates, output.Placed) };
1129
+ this.SelectedKeys = [];
1130
+ await this.load();
1131
+ }
1132
+ finally {
1133
+ this.Placing = false;
1134
+ this.cdr.detectChanges();
1135
+ }
1136
+ }
1137
+ /* ── Increase ───────────────────────────────────────────────────────── */
1138
+ /** Open the dialog for these subscriptions, prefilled with the rate they all share, if they do. */
1139
+ OpenIncrease(subscriptionIDs) {
1140
+ if (!subscriptionIDs.length || this.Busy)
1141
+ return;
1142
+ this.IncreaseTargets = [...subscriptionIDs];
1143
+ const rows = this.AllRows.filter((r) => subscriptionIDs.includes(r.SubscriptionID));
1144
+ const shared = SharedIncrease(rows);
1145
+ this.IncreaseValue = shared === undefined ? null : shared;
1146
+ this.IncreaseClear = false;
1147
+ this.IncreaseError = null;
1148
+ this.IncreasePendingNote = PendingRenewalWarning(rows, 'A pending order keeps the price it was placed at; void it and create it again to renew at the new rate.');
1149
+ this.IncreaseOpen = true;
1150
+ }
1151
+ OnIncreaseInput(text) {
1152
+ const trimmed = String(text ?? '').trim();
1153
+ this.IncreaseValue = trimmed === '' ? null : Number(trimmed);
1154
+ this.IncreaseError = null;
1155
+ }
1156
+ /** Write the rate through `Orders.SetRenewalSettings`. Subscriptions only; no order is touched. */
1157
+ async ApplyIncrease() {
1158
+ if (this.Busy || !this.IncreaseTargets.length)
1159
+ return;
1160
+ const percent = this.IncreaseClear ? null : this.IncreaseValue;
1161
+ if (!this.IncreaseClear && (percent == null || !Number.isFinite(percent))) {
1162
+ this.IncreaseError = 'Enter a percentage, or choose no subscription-level rate.';
1163
+ return;
1164
+ }
1165
+ if (percent != null && (percent < 0 || percent > 100)) {
1166
+ this.IncreaseError = 'Enter a percentage from 0 to 100.';
1167
+ return;
1168
+ }
1169
+ this.Updating = true;
1170
+ this.IncreaseError = null;
1171
+ this.cdr.detectChanges();
1172
+ try {
1173
+ const result = await new OrdersSetRenewalSettingsOperation().Execute({ SubscriptionIDs: this.IncreaseTargets, IncreasePercent: percent });
1174
+ const output = result.Output;
1175
+ if (!result.Success || !output) {
1176
+ this.IncreaseError = result.ErrorMessage?.trim() || 'The increase could not be updated.';
1177
+ return;
1178
+ }
1179
+ if (!output.Success) {
1180
+ this.IncreaseError = output.Message ?? 'The increase could not be updated.';
1181
+ return;
1182
+ }
1183
+ this.IncreaseOpen = false;
1184
+ this.Notice = SettingsUpdateText(output);
1185
+ await this.load();
1186
+ }
1187
+ finally {
1188
+ this.Updating = false;
1189
+ this.cdr.detectChanges();
1190
+ }
1191
+ }
1192
+ /* ── Change product ─────────────────────────────────────────────────── */
1193
+ /** Open the dialog for these subscriptions. The product list is every Active subscription product, loaded once. */
1194
+ async OpenProduct(subscriptionIDs) {
1195
+ if (!subscriptionIDs.length || this.Busy)
1196
+ return;
1197
+ this.ProductTargets = [...subscriptionIDs];
1198
+ const chosen = this.AllRows.filter((r) => subscriptionIDs.includes(r.SubscriptionID));
1199
+ this.ProductCurrentNote = CurrentProductsNote(chosen);
1200
+ this.ProductPendingNote = PendingRenewalWarning(chosen, 'Confirming that order would put the subscription back on the order\'s product, so the change is refused for it until the order is voided or its line corrected.');
1201
+ const companies = [...new Map(chosen.map((r) => [r.CompanyID, r.CompanyName || '(none)'])).entries()];
1202
+ this.ProductCompanyNote = companies.map(([, name]) => name).join(', ');
1203
+ this.ProductChoice = null;
1204
+ this.ProductAdoptType = false;
1205
+ this.ProductError = null;
1206
+ this.ProductChoices = [];
1207
+ this.ProductOpen = true;
1208
+ if (!this.productCatalog.length) {
1209
+ this.ProductChoicesLoading = true;
1210
+ this.cdr.detectChanges();
1211
+ try {
1212
+ const result = await new RunView().RunView({
1213
+ EntityName: 'MJ_BizApps_Orders: Products',
1214
+ ExtraFilter: "Status = 'Active' AND SubscriptionTypeID IS NOT NULL",
1215
+ Fields: ['ID', 'Name', 'CompanyID', 'Company'],
1216
+ OrderBy: 'Name',
1217
+ ResultType: 'simple',
1218
+ });
1219
+ this.productCatalog = result.Results ?? [];
1220
+ if (!result.Success)
1221
+ this.ProductError = result.ErrorMessage || 'The product list could not be loaded.';
1222
+ }
1223
+ catch (err) {
1224
+ this.ProductError = `The product list could not be loaded: ${err instanceof Error ? err.message : String(err)}`;
1225
+ }
1226
+ finally {
1227
+ this.ProductChoicesLoading = false;
1228
+ }
1229
+ }
1230
+ // Only the chosen rows' company sells what they can be moved to. Rows from several companies
1231
+ // see all of those companies' products, each labelled, so a pick is never ambiguous.
1232
+ const ids = new Set(companies.map(([id]) => String(id).toLowerCase()));
1233
+ this.ProductChoices = this.productCatalog
1234
+ .filter((p) => ids.has(String(p.CompanyID).toLowerCase()))
1235
+ .map((p) => ({ ID: p.ID, Label: companies.length > 1 ? `${p.Name} · ${p.Company}` : p.Name }));
1236
+ this.cdr.detectChanges();
1237
+ }
1238
+ OnProductChoice(value) {
1239
+ this.ProductChoice = value ? String(value) : null;
1240
+ this.ProductError = null;
1241
+ }
1242
+ /** Write the product through `Orders.ChangeSubscriptionProduct`. Subscriptions only. */
1243
+ async ApplyProduct() {
1244
+ if (this.Busy || !this.ProductTargets.length || !this.ProductChoice)
1245
+ return;
1246
+ this.Updating = true;
1247
+ this.ProductError = null;
1248
+ this.cdr.detectChanges();
1249
+ try {
1250
+ const result = await new OrdersChangeSubscriptionProductOperation().Execute({
1251
+ SubscriptionIDs: this.ProductTargets,
1252
+ ProductID: this.ProductChoice,
1253
+ AdoptProductType: this.ProductAdoptType,
1254
+ });
1255
+ const output = result.Output;
1256
+ if (!result.Success || !output) {
1257
+ this.ProductError = result.ErrorMessage?.trim() || 'The product could not be changed.';
1258
+ return;
1259
+ }
1260
+ if (!output.Success) {
1261
+ this.ProductError = ProductChangeText(output).Text || 'The product could not be changed.';
1262
+ return;
1263
+ }
1264
+ this.ProductOpen = false;
1265
+ this.Notice = ProductChangeText(output);
1266
+ await this.load();
1267
+ }
1268
+ finally {
1269
+ this.Updating = false;
1270
+ this.cdr.detectChanges();
1271
+ }
1272
+ }
1273
+ /* ── Auto-renew ─────────────────────────────────────────────────────── */
1274
+ /** Open the dialog for these subscriptions, preselecting the switch they all share, if they do. */
1275
+ OpenAutoRenew(subscriptionIDs) {
1276
+ if (!subscriptionIDs.length || this.Busy)
1277
+ return;
1278
+ this.AutoRenewTargets = [...subscriptionIDs];
1279
+ const rows = this.AllRows.filter((r) => subscriptionIDs.includes(r.SubscriptionID));
1280
+ const allOn = rows.length > 0 && rows.every((r) => r.AutoRenew);
1281
+ const allOff = rows.length > 0 && rows.every((r) => !r.AutoRenew);
1282
+ // One row: offer the OTHER setting, since that is why the button was pressed.
1283
+ this.AutoRenewValue = rows.length === 1 ? !rows[0].AutoRenew : allOn ? true : allOff ? false : null;
1284
+ this.AutoRenewError = null;
1285
+ this.AutoRenewOpen = true;
1286
+ }
1287
+ /** Write the switch through `Orders.SetRenewalSettings`. Subscriptions only; no order is touched. */
1288
+ async ApplyAutoRenew() {
1289
+ if (this.Busy || !this.AutoRenewTargets.length || this.AutoRenewValue == null)
1290
+ return;
1291
+ this.Updating = true;
1292
+ this.AutoRenewError = null;
1293
+ this.cdr.detectChanges();
1294
+ try {
1295
+ const result = await new OrdersSetRenewalSettingsOperation().Execute({ SubscriptionIDs: this.AutoRenewTargets, AutoRenew: this.AutoRenewValue });
1296
+ const output = result.Output;
1297
+ if (!result.Success || !output) {
1298
+ this.AutoRenewError = result.ErrorMessage?.trim() || 'Auto-renew could not be updated.';
1299
+ return;
1300
+ }
1301
+ if (!output.Success) {
1302
+ this.AutoRenewError = output.Message ?? 'Auto-renew could not be updated.';
1303
+ return;
1304
+ }
1305
+ this.AutoRenewOpen = false;
1306
+ this.Notice = SettingsUpdateText(output);
1307
+ await this.load();
1308
+ }
1309
+ finally {
1310
+ this.Updating = false;
1311
+ this.cdr.detectChanges();
1312
+ }
1313
+ }
1314
+ /** "3 renewal orders placed: ORD-1001 (confirmed), ORD-1002 (draft) … 1 skipped: SUB-7 (reason)". */
1315
+ /* ── Loading ────────────────────────────────────────────────────────── */
1316
+ async load() {
1317
+ const result = await new OrdersGetRenewalWorklistOperation().Execute({ WindowDays: this.WindowDays, LookbackDays: LOOKBACK_DAYS, MaxCount: this.MaxRows });
1318
+ const output = result.Output;
1319
+ if (!result.Success || !output?.Success) {
1320
+ // SAY SO. An empty list and a failed one look identical, and "nothing ending" is the most
1321
+ // reassuring sentence on the screen.
1322
+ this.LoadError = output?.Message?.trim() || result.ErrorMessage?.trim() || 'The renewals list could not be loaded.';
1323
+ this.AllRows = [];
1324
+ this.Scoped = [];
1325
+ this.Rows = [];
1326
+ this.Presets = [];
1327
+ this.Applied = [];
1328
+ this.cdr.detectChanges();
1329
+ return;
1330
+ }
1331
+ this.LoadError = null;
1332
+ this.AllRows = output.Rows;
1333
+ this.Truncated = output.Truncated;
1334
+ this.AsOf = output.AsOfDate;
1335
+ this.WindowStart = output.WindowStart;
1336
+ this.WindowEnd = output.WindowEnd;
1337
+ this.PassMode = output.PassMode ?? 'Unknown';
1338
+ this.PassNextRunAt = output.PassNextRunAt ?? null;
1339
+ // Keep the side panel on the same subscription across a reload, with its fresh row.
1340
+ const selectedID = this.Selected?.SubscriptionID;
1341
+ this.Selected = selectedID ? (this.AllRows.find((r) => r.SubscriptionID === selectedID) ?? null) : null;
1342
+ // A tick on a row that has left the list (now out of the window) is dropped; a renewed row keeps
1343
+ // its tick, since its increase can still be set from here.
1344
+ this.SelectedKeys = this.SelectedKeys.filter((id) => this.AllRows.some((r) => r.SubscriptionID === id));
1345
+ this.applyFilters();
1346
+ this.cdr.detectChanges();
1347
+ }
1348
+ applyFilters() {
1349
+ // Company is the outer choice: its list is everything in the window, counted over the rows the
1350
+ // product picks leave. Product is inner: only the products the chosen companies have ending,
1351
+ // and a product tick that no longer appears is dropped rather than silently filtering to nothing.
1352
+ this.Facets = PruneCompanies(this.Facets, FacetOptions(this.AllRows, 'Company'));
1353
+ const byCompany = this.AllRows.filter((r) => MatchesFacets(r, { Companies: this.Facets.Companies, Products: [] }));
1354
+ this.ProductOptions = FacetOptions(byCompany, 'Product');
1355
+ this.Facets = PruneProducts(this.Facets, this.ProductOptions);
1356
+ const byProduct = this.AllRows.filter((r) => MatchesFacets(r, { Companies: [], Products: this.Facets.Products }));
1357
+ this.CompanyOptions = FacetOptions(this.AllRows, 'Company', byProduct);
1358
+ this.Applied = AppliedFacets(this.Facets, this.CompanyOptions, this.ProductOptions);
1359
+ this.Scoped = this.AllRows.filter((r) => MatchesFacets(r, this.Facets));
1360
+ // Ticks survive only on rows the company and product filters still show.
1361
+ if (this.SelectedKeys.length) {
1362
+ const visible = new Set(this.Scoped.map((r) => r.SubscriptionID));
1363
+ const kept = this.SelectedKeys.filter((id) => visible.has(id));
1364
+ if (kept.length !== this.SelectedKeys.length)
1365
+ this.SelectedKeys = kept;
1366
+ }
1367
+ this.Presets = [
1368
+ { Key: 'all', Label: 'All in window', Count: this.Scoped.length },
1369
+ { Key: 'auto', Label: 'Will auto-renew', Count: this.AutoCount, Icon: 'fa-solid fa-rotate' },
1370
+ { Key: 'manual', Label: 'Will end', Count: this.ManualCount, Icon: 'fa-solid fa-hand' },
1371
+ { Key: 'placed', Label: 'Renewal placed', Count: this.PlacedCount, Icon: 'fa-solid fa-file-circle-check' },
1372
+ { Key: 'attention', Label: 'Needs attention', Count: this.Scoped.filter(NeedsAttention).length, Icon: 'fa-solid fa-triangle-exclamation' },
1373
+ ];
1374
+ const rows = this.Scoped.filter((row) => MatchesPreset(row, this.Preset) && MatchesSearch(row, this.Search));
1375
+ rows.sort((a, b) => (this.SortDescending ? -1 : 1) * CompareRows(a, b, this.SortKey));
1376
+ this.Rows = rows;
1377
+ }
1378
+ /* ── Template helpers ───────────────────────────────────────────────── */
1379
+ stateLabel(row) {
1380
+ return RenewalStateLabel(row.State);
1381
+ }
1382
+ stateClass(row) {
1383
+ return RenewalStateChipClass(row.State);
1384
+ }
1385
+ stateNote(row) {
1386
+ return RenewalStateNote(row);
1387
+ }
1388
+ termWarning(row) {
1389
+ return TermWarning(row);
1390
+ }
1391
+ increaseNote(row) {
1392
+ return SubscriptionIncreaseNote(row);
1393
+ }
1394
+ endsNote(row) {
1395
+ return EndsNote(row.DaysUntilEnd);
1396
+ }
1397
+ projectionLines(row) {
1398
+ return ProjectionLines(row);
1399
+ }
1400
+ date(value) {
1401
+ return value ? FormatDate(value, RENEWALS_DATE) : '—';
1402
+ }
1403
+ money(value) {
1404
+ return value == null ? '—' : FormatMoney(value);
1405
+ }
1406
+ static ɵfac = function MJORenewalsPageComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MJORenewalsPageComponent)(); };
1407
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MJORenewalsPageComponent, selectors: [["mjo-renewals-page"]], outputs: { SubscriptionOpened: "SubscriptionOpened", OrderOpened: "OrderOpened" }, decls: 134, vars: 83, consts: [["exportOrigin", "cdkOverlayOrigin"], [1, "mjo-rn__head"], [1, "mjo-rn__window"], [1, "small", "muted"], ["aria-label", "How far ahead to look", 1, "mjo-rn__select", 3, "change", "value"], [3, "value"], ["Label", "Company", "Icon", "fa-solid fa-building", 3, "SelectedChange", "Options", "Selected"], ["Label", "Product", "Icon", "fa-solid fa-box-open", 3, "SelectedChange", "Options", "Selected"], [1, "small", "muted", "mjo-rn__range"], ["type", "button", "mjButton", "", "variant", "outline", "size", "sm", "cdkOverlayOrigin", "", "aria-haspopup", "menu", "title", "Export the rows shown", 1, "mjo-rn__export", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-file-export"], ["aria-hidden", "true", 1, "fa-solid", "fa-chevron-down", "mjo-rn__caret"], ["cdkConnectedOverlay", "", "cdkConnectedOverlayBackdropClass", "cdk-overlay-transparent-backdrop", 3, "backdropClick", "detach", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen", "cdkConnectedOverlayPositions", "cdkConnectedOverlayHasBackdrop"], ["role", "group", "aria-label", "Applied filters", 1, "mjo-rn__applied"], [1, "mj-stat-grid", "mjo-rn__tiles"], ["Label", "Ending in window", "Icon", "fa-solid fa-hourglass-half", "Detail", "current-term value", 3, "Clicked", "Value", "Amount"], ["Label", "Will auto-renew", "Icon", "fa-solid fa-rotate", 3, "Clicked", "Value", "Amount", "Detail"], ["Label", "Will end unless renewed", "Icon", "fa-solid fa-hand", "Tone", "alert", "Detail", "at risk", 3, "Clicked", "Value", "Amount"], ["Label", "Renewal placed", "Icon", "fa-solid fa-file-circle-check", "Detail", "on renewal orders", 3, "Clicked", "Value", "Amount"], ["Variant", "error", "Icon", "fa-solid fa-triangle-exclamation", 1, "mjo-rn__note"], ["Icon", "fa-solid fa-circle-info", 1, "mjo-rn__note", 3, "Variant"], ["Icon", "fa-solid fa-clock", 1, "mjo-rn__note", 3, "Variant"], ["Variant", "warning", "Icon", "fa-solid fa-triangle-exclamation", 1, "mjo-rn__note"], [1, "mjo-rn__split"], [1, "mjo-rn__main"], [1, "row", "mjo-rn__actions"], ["type", "button", "mjButton", "", "variant", "primary", "title", "Create a renewal order for each selected row that can renew", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-file-circle-plus"], ["type", "button", "mjButton", "", "variant", "outline", "title", "Set the annual renewal increase for the selected subscriptions", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-percent"], ["type", "button", "mjButton", "", "variant", "outline", "title", "Correct the product on the selected subscriptions; booked orders and deals are not changed", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-box-open"], ["type", "button", "mjButton", "", "variant", "outline", "title", "Turn auto-renew on or off for the selected subscriptions", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-rotate"], ["SearchPlaceholder", "Customer, account, product, subscription or order\u2026", "RowKey", "SubscriptionID", "EmptyIcon", "fa-solid fa-rotate", 3, "PresetChanged", "SearchChanged", "SortChanged", "SelectionChanged", "RowClicked", "Columns", "Rows", "Presets", "ActivePreset", "Searchable", "Search", "SortKey", "SortDescending", "RowLabel", "SelectedKey", "Selectable", "SelectedKeys", "EmptyTitle", "EmptyHint", "FootNote"], [1, "mjo-rn__side"], ["Title", "Renewal increase", "Size", "sm", 3, "Close", "Visible"], [1, "mjo-rn__dialog-lede"], [1, "mjo-note", "mjo-rn__dialog-warning"], [1, "mjo-rn__field"], [1, "mjo-rn__pct"], ["type", "number", "min", "0", "max", "100", "step", "0.01", "inputmode", "decimal", "placeholder", "e.g. 5", "aria-label", "Increase in percent", 1, "mjo-rn__select", 3, "input", "value", "disabled"], [1, "muted"], [1, "mjo-rn__check", "small"], ["type", "checkbox", 3, "change", "checked"], [1, "small", "mjo-rn__error"], ["type", "button", "mjButton", "", "variant", "outline", 3, "click"], ["type", "button", "mjButton", "", "variant", "primary", 3, "click", "disabled"], ["Title", "Create renewal orders", "Size", "sm", 3, "Close", "Visible"], [1, "mjo-rn__dialog-lede", "small", "muted"], ["Title", "Change product", "Size", "sm", 3, "Close", "Visible"], [1, "mjo-note", "mjo-rn__dialog-warning", "mjo-rn__dialog-lede"], [1, "mjo-rn__facts"], ["for", "mjo-rn-product", 1, "mjo-rn__field-label"], [1, "mjo-rn__check"], [1, "small", "muted", "mjo-rn__dialog-foot"], ["Title", "Auto-renew", "Size", "sm", 3, "Close", "Visible"], ["type", "radio", "name", "mjo-rn-autorenew", 3, "change", "checked"], ["role", "menu", "aria-label", "Export", 1, "mjo-rn__menu"], ["type", "button", "role", "menuitem", 1, "mjo-rn__menu-item", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-file-excel"], ["aria-hidden", "true", 1, "fa-solid", "fa-file-csv"], [1, "mjo-chip", "mjo-chip--info", "mjo-rn__facet"], ["type", "button", 1, "mjo-rn__link", 3, "click"], ["type", "button", 1, "mjo-rn__facet-x", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-xmark"], ["type", "button", "mjButton", "", "variant", "outline", "size", "sm", 3, "click"], [1, "mj-card"], [1, "mj-card-head"], [1, "right", "mjo-rn__head-actions"], [1, "mjo-chip"], ["type", "button", "mjButton", "", "variant", "outline", "size", "sm", "title", "Open the subscription's form", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-arrow-up-right-from-square"], [1, "mj-card-pad"], ["Label", "Customer"], ["Label", "Account"], ["Label", "Company"], ["Label", "Product"], ["type", "button", "mjButton", "", "variant", "outline", "size", "sm", "title", "Correct this subscription's product", 1, "mjo-rn__inline-edit", 3, "disabled"], ["Label", "Current term"], [1, "mjo-chip", "mjo-chip--warning"], ["Label", "Subscribed since"], ["Label", "Auto-renew"], ["type", "button", "mjButton", "", "variant", "outline", "size", "sm", "title", "Turn auto-renew on or off for this subscription", 1, "mjo-rn__inline-edit", 3, "disabled"], ["Label", "Renewal increase"], ["type", "button", "mjButton", "", "variant", "outline", "size", "sm", "title", "Set this subscription's annual increase", 1, "mjo-rn__inline-edit", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-pen"], [1, "mj-card", "mjo-rn__card"], ["aria-hidden", "true", 1, "fa-solid", "fa-file-invoice-dollar"], ["type", "button", "mjButton", "", "variant", "outline", "size", "sm", 1, "right"], ["type", "button", "mjButton", "", "variant", "outline", "size", "sm", "title", "Correct this subscription's product", 1, "mjo-rn__inline-edit", 3, "click", "disabled"], ["type", "button", "mjButton", "", "variant", "outline", "size", "sm", "title", "Turn auto-renew on or off for this subscription", 1, "mjo-rn__inline-edit", 3, "click", "disabled"], ["type", "button", "mjButton", "", "variant", "outline", "size", "sm", 1, "right", 3, "click"], ["Label", "Placed"], [1, "mjo-chip", "mjo-chip--outline"], ["Label", "Price"], ["Label", "Still owed"], ["Label", "New term"], [1, "mjo-note", "mjo-rn__note"], ["aria-hidden", "true", 1, "fa-solid", "fa-hourglass-half"], ["Label", "Projected price"], [3, "Label"], ["type", "button", "mjButton", "", "variant", "outline", "size", "sm", 3, "disabled"], ["type", "button", "mjButton", "", "variant", "outline", "size", "sm", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-triangle-exclamation"], [1, "mjo-rn__field-label"], ["type", "radio", "name", "mjo-rn-placeas", 3, "change", "checked", "disabled"], ["id", "mjo-rn-product", "TextField", "Label", "ValueField", "ID", "Placeholder", "Select a product", 3, "ValueChange", "Data", "ValuePrimitive", "Filterable"], [1, "small", "muted", "mjo-rn__field-help"]], template: function MJORenewalsPageComponent_Template(rf, ctx) { if (rf & 1) {
1408
+ const _r1 = i0.ɵɵgetCurrentView();
1409
+ i0.ɵɵelementStart(0, "div", 1)(1, "label", 2)(2, "span", 3);
1410
+ i0.ɵɵtext(3, "Ending");
1411
+ i0.ɵɵelementEnd();
1412
+ i0.ɵɵelementStart(4, "select", 4);
1413
+ i0.ɵɵlistener("change", function MJORenewalsPageComponent_Template_select_change_4_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OnWindow($event.target.value)); });
1414
+ i0.ɵɵrepeaterCreate(5, MJORenewalsPageComponent_For_6_Template, 2, 2, "option", 5, _forTrack0);
1415
+ i0.ɵɵelementEnd()();
1416
+ i0.ɵɵelementStart(7, "mjo-multi-select", 6);
1417
+ i0.ɵɵlistener("SelectedChange", function MJORenewalsPageComponent_Template_mjo_multi_select_SelectedChange_7_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OnFacet("Company", $event)); });
1418
+ i0.ɵɵelementEnd();
1419
+ i0.ɵɵelementStart(8, "mjo-multi-select", 7);
1420
+ i0.ɵɵlistener("SelectedChange", function MJORenewalsPageComponent_Template_mjo_multi_select_SelectedChange_8_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OnFacet("Product", $event)); });
1421
+ i0.ɵɵelementEnd();
1422
+ i0.ɵɵconditionalCreate(9, MJORenewalsPageComponent_Conditional_9_Template, 2, 2, "span", 8);
1423
+ i0.ɵɵelementStart(10, "button", 9, 0);
1424
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Template_button_click_10_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.ExportMenuOpen = !ctx.ExportMenuOpen); });
1425
+ i0.ɵɵelement(12, "i", 10);
1426
+ i0.ɵɵtext(13);
1427
+ i0.ɵɵelement(14, "i", 11);
1428
+ i0.ɵɵelementEnd();
1429
+ i0.ɵɵtemplate(15, MJORenewalsPageComponent_ng_template_15_Template, 7, 0, "ng-template", 12);
1430
+ i0.ɵɵlistener("backdropClick", function MJORenewalsPageComponent_Template_ng_template_backdropClick_15_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.ExportMenuOpen = false); })("detach", function MJORenewalsPageComponent_Template_ng_template_detach_15_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.ExportMenuOpen = false); });
1431
+ i0.ɵɵelementEnd();
1432
+ i0.ɵɵconditionalCreate(16, MJORenewalsPageComponent_Conditional_16_Template, 7, 0, "div", 13);
1433
+ i0.ɵɵelementStart(17, "div", 14)(18, "mjo-stat-tile", 15);
1434
+ i0.ɵɵlistener("Clicked", function MJORenewalsPageComponent_Template_mjo_stat_tile_Clicked_18_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OnPreset("all")); });
1435
+ i0.ɵɵelementEnd();
1436
+ i0.ɵɵelementStart(19, "mjo-stat-tile", 16);
1437
+ i0.ɵɵlistener("Clicked", function MJORenewalsPageComponent_Template_mjo_stat_tile_Clicked_19_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OnPreset("auto")); });
1438
+ i0.ɵɵelementEnd();
1439
+ i0.ɵɵelementStart(20, "mjo-stat-tile", 17);
1440
+ i0.ɵɵlistener("Clicked", function MJORenewalsPageComponent_Template_mjo_stat_tile_Clicked_20_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OnPreset("manual")); });
1441
+ i0.ɵɵelementEnd();
1442
+ i0.ɵɵelementStart(21, "mjo-stat-tile", 18);
1443
+ i0.ɵɵlistener("Clicked", function MJORenewalsPageComponent_Template_mjo_stat_tile_Clicked_21_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OnPreset("placed")); });
1444
+ i0.ɵɵelementEnd()();
1445
+ i0.ɵɵconditionalCreate(22, MJORenewalsPageComponent_Conditional_22_Template, 4, 1, "mj-alert", 19);
1446
+ i0.ɵɵconditionalCreate(23, MJORenewalsPageComponent_Conditional_23_Template, 2, 2, "mj-alert", 20);
1447
+ i0.ɵɵconditionalCreate(24, MJORenewalsPageComponent_Conditional_24_Template, 4, 3, "mj-alert", 21);
1448
+ i0.ɵɵconditionalCreate(25, MJORenewalsPageComponent_Conditional_25_Template, 4, 1, "mj-alert", 22);
1449
+ i0.ɵɵelementStart(26, "div", 23)(27, "div", 24)(28, "div", 25)(29, "button", 26);
1450
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Template_button_click_29_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OpenPlace(ctx.PlaceableSelected, ctx.SelectedKeys)); });
1451
+ i0.ɵɵelement(30, "i", 27);
1452
+ i0.ɵɵtext(31);
1453
+ i0.ɵɵelementEnd();
1454
+ i0.ɵɵelementStart(32, "button", 28);
1455
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Template_button_click_32_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OpenIncrease(ctx.SelectedKeys)); });
1456
+ i0.ɵɵelement(33, "i", 29);
1457
+ i0.ɵɵtext(34);
1458
+ i0.ɵɵelementEnd();
1459
+ i0.ɵɵelementStart(35, "button", 30);
1460
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Template_button_click_35_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OpenProduct(ctx.SelectedKeys)); });
1461
+ i0.ɵɵelement(36, "i", 31);
1462
+ i0.ɵɵtext(37);
1463
+ i0.ɵɵelementEnd();
1464
+ i0.ɵɵelementStart(38, "button", 32);
1465
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Template_button_click_38_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OpenAutoRenew(ctx.SelectedKeys)); });
1466
+ i0.ɵɵelement(39, "i", 33);
1467
+ i0.ɵɵtext(40);
1468
+ i0.ɵɵelementEnd();
1469
+ i0.ɵɵconditionalCreate(41, MJORenewalsPageComponent_Conditional_41_Template, 4, 1)(42, MJORenewalsPageComponent_Conditional_42_Template, 2, 0, "span", 3);
1470
+ i0.ɵɵelementEnd();
1471
+ i0.ɵɵelementStart(43, "mjo-worklist-table", 34);
1472
+ i0.ɵɵlistener("PresetChanged", function MJORenewalsPageComponent_Template_mjo_worklist_table_PresetChanged_43_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OnPreset($event)); })("SearchChanged", function MJORenewalsPageComponent_Template_mjo_worklist_table_SearchChanged_43_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OnSearch($event)); })("SortChanged", function MJORenewalsPageComponent_Template_mjo_worklist_table_SortChanged_43_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OnSort($event)); })("SelectionChanged", function MJORenewalsPageComponent_Template_mjo_worklist_table_SelectionChanged_43_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.SelectedKeys = $event); })("RowClicked", function MJORenewalsPageComponent_Template_mjo_worklist_table_RowClicked_43_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.Selected = $event); });
1473
+ i0.ɵɵelementEnd()();
1474
+ i0.ɵɵconditionalCreate(44, MJORenewalsPageComponent_Conditional_44_Template, 61, 25, "aside", 35);
1475
+ i0.ɵɵelementEnd();
1476
+ i0.ɵɵelementStart(45, "mj-dialog", 36);
1477
+ i0.ɵɵlistener("Close", function MJORenewalsPageComponent_Template_mj_dialog_Close_45_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.IncreaseOpen = false); });
1478
+ i0.ɵɵelementStart(46, "p", 37);
1479
+ i0.ɵɵtext(47);
1480
+ i0.ɵɵelementEnd();
1481
+ i0.ɵɵconditionalCreate(48, MJORenewalsPageComponent_Conditional_48_Template, 3, 1, "p", 38);
1482
+ i0.ɵɵelementStart(49, "label", 39)(50, "span", 3);
1483
+ i0.ɵɵtext(51, "Annual increase");
1484
+ i0.ɵɵelementEnd();
1485
+ i0.ɵɵelementStart(52, "span", 40)(53, "input", 41);
1486
+ i0.ɵɵlistener("input", function MJORenewalsPageComponent_Template_input_input_53_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.OnIncreaseInput($event.target.value)); });
1487
+ i0.ɵɵelementEnd();
1488
+ i0.ɵɵelementStart(54, "span", 42);
1489
+ i0.ɵɵtext(55, "%");
1490
+ i0.ɵɵelementEnd()()();
1491
+ i0.ɵɵelementStart(56, "label", 43)(57, "input", 44);
1492
+ i0.ɵɵlistener("change", function MJORenewalsPageComponent_Template_input_change_57_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.IncreaseClear = $event.target.checked); });
1493
+ i0.ɵɵelementEnd();
1494
+ i0.ɵɵtext(58, " No subscription-level rate (use the product, category or company default) ");
1495
+ i0.ɵɵelementEnd();
1496
+ i0.ɵɵconditionalCreate(59, MJORenewalsPageComponent_Conditional_59_Template, 2, 1, "p", 45);
1497
+ i0.ɵɵelementStart(60, "mj-dialog-actions")(61, "button", 46);
1498
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Template_button_click_61_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.IncreaseOpen = false); });
1499
+ i0.ɵɵtext(62, "Cancel");
1500
+ i0.ɵɵelementEnd();
1501
+ i0.ɵɵelementStart(63, "button", 47);
1502
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Template_button_click_63_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.ApplyIncrease()); });
1503
+ i0.ɵɵtext(64);
1504
+ i0.ɵɵelementEnd()()();
1505
+ i0.ɵɵelementStart(65, "mj-dialog", 48);
1506
+ i0.ɵɵlistener("Close", function MJORenewalsPageComponent_Template_mj_dialog_Close_65_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.PlaceOpen = false); });
1507
+ i0.ɵɵconditionalCreate(66, MJORenewalsPageComponent_Conditional_66_Template, 16, 7)(67, MJORenewalsPageComponent_Conditional_67_Template, 2, 0, "p", 49);
1508
+ i0.ɵɵconditionalCreate(68, MJORenewalsPageComponent_Conditional_68_Template, 2, 1, "p", 45);
1509
+ i0.ɵɵelementStart(69, "mj-dialog-actions")(70, "button", 46);
1510
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Template_button_click_70_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.PlaceOpen = false); });
1511
+ i0.ɵɵtext(71, "Cancel");
1512
+ i0.ɵɵelementEnd();
1513
+ i0.ɵɵelementStart(72, "button", 47);
1514
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Template_button_click_72_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.ApplyPlace()); });
1515
+ i0.ɵɵtext(73);
1516
+ i0.ɵɵelementEnd()()();
1517
+ i0.ɵɵelementStart(74, "mj-dialog", 50);
1518
+ i0.ɵɵlistener("Close", function MJORenewalsPageComponent_Template_mj_dialog_Close_74_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.ProductOpen = false); });
1519
+ i0.ɵɵconditionalCreate(75, MJORenewalsPageComponent_Conditional_75_Template, 3, 1, "p", 51);
1520
+ i0.ɵɵelementStart(76, "dl", 52)(77, "dt");
1521
+ i0.ɵɵtext(78, "Subscriptions");
1522
+ i0.ɵɵelementEnd();
1523
+ i0.ɵɵelementStart(79, "dd");
1524
+ i0.ɵɵtext(80);
1525
+ i0.ɵɵelementEnd();
1526
+ i0.ɵɵelementStart(81, "dt");
1527
+ i0.ɵɵtext(82, "Current product");
1528
+ i0.ɵɵelementEnd();
1529
+ i0.ɵɵelementStart(83, "dd");
1530
+ i0.ɵɵtext(84);
1531
+ i0.ɵɵelementEnd();
1532
+ i0.ɵɵelementStart(85, "dt");
1533
+ i0.ɵɵtext(86, "Company");
1534
+ i0.ɵɵelementEnd();
1535
+ i0.ɵɵelementStart(87, "dd");
1536
+ i0.ɵɵtext(88);
1537
+ i0.ɵɵelementEnd()();
1538
+ i0.ɵɵelementStart(89, "div", 39)(90, "label", 53);
1539
+ i0.ɵɵtext(91, "New product");
1540
+ i0.ɵɵelementEnd();
1541
+ i0.ɵɵconditionalCreate(92, MJORenewalsPageComponent_Conditional_92_Template, 2, 0, "span", 3)(93, MJORenewalsPageComponent_Conditional_93_Template, 2, 0, "span", 3)(94, MJORenewalsPageComponent_Conditional_94_Template, 3, 3);
1542
+ i0.ɵɵelementEnd();
1543
+ i0.ɵɵelementStart(95, "label", 54)(96, "input", 44);
1544
+ i0.ɵɵlistener("change", function MJORenewalsPageComponent_Template_input_change_96_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.ProductAdoptType = $event.target.checked); });
1545
+ i0.ɵɵelementEnd();
1546
+ i0.ɵɵelementStart(97, "span");
1547
+ i0.ɵɵtext(98, "Move to the new product's subscription type if it differs ");
1548
+ i0.ɵɵelementStart(99, "span", 42);
1549
+ i0.ɵɵtext(100, "(changes term length, billing cadence and lead time)");
1550
+ i0.ɵɵelementEnd()()();
1551
+ i0.ɵɵelementStart(101, "p", 55);
1552
+ i0.ɵɵtext(102, " Only the subscription changes. Existing orders and deals are not affected. Future renewals use the new product at the current price plus the annual increase. ");
1553
+ i0.ɵɵelementEnd();
1554
+ i0.ɵɵconditionalCreate(103, MJORenewalsPageComponent_Conditional_103_Template, 2, 1, "p", 45);
1555
+ i0.ɵɵelementStart(104, "mj-dialog-actions")(105, "button", 46);
1556
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Template_button_click_105_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.ProductOpen = false); });
1557
+ i0.ɵɵtext(106, "Cancel");
1558
+ i0.ɵɵelementEnd();
1559
+ i0.ɵɵelementStart(107, "button", 47);
1560
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Template_button_click_107_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.ApplyProduct()); });
1561
+ i0.ɵɵtext(108);
1562
+ i0.ɵɵelementEnd()()();
1563
+ i0.ɵɵelementStart(109, "mj-dialog", 56);
1564
+ i0.ɵɵlistener("Close", function MJORenewalsPageComponent_Template_mj_dialog_Close_109_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.AutoRenewOpen = false); });
1565
+ i0.ɵɵelementStart(110, "p", 37);
1566
+ i0.ɵɵtext(111);
1567
+ i0.ɵɵelementEnd();
1568
+ i0.ɵɵelementStart(112, "label", 54)(113, "input", 57);
1569
+ i0.ɵɵlistener("change", function MJORenewalsPageComponent_Template_input_change_113_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.AutoRenewValue = true); });
1570
+ i0.ɵɵelementEnd();
1571
+ i0.ɵɵelementStart(114, "span")(115, "strong");
1572
+ i0.ɵɵtext(116, "On");
1573
+ i0.ɵɵelementEnd();
1574
+ i0.ɵɵelementStart(117, "span", 42);
1575
+ i0.ɵɵtext(118, "\u00B7 renews automatically at the end of each term");
1576
+ i0.ɵɵelementEnd()()();
1577
+ i0.ɵɵelementStart(119, "label", 54)(120, "input", 57);
1578
+ i0.ɵɵlistener("change", function MJORenewalsPageComponent_Template_input_change_120_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.AutoRenewValue = false); });
1579
+ i0.ɵɵelementEnd();
1580
+ i0.ɵɵelementStart(121, "span")(122, "strong");
1581
+ i0.ɵɵtext(123, "Off");
1582
+ i0.ɵɵelementEnd();
1583
+ i0.ɵɵelementStart(124, "span", 42);
1584
+ i0.ɵɵtext(125, "\u00B7 expires at the end of the term unless renewed manually");
1585
+ i0.ɵɵelementEnd()()();
1586
+ i0.ɵɵelementStart(126, "p", 55);
1587
+ i0.ɵɵtext(127, "Subscriptions billed by a payment gateway are managed by the gateway and will be skipped.");
1588
+ i0.ɵɵelementEnd();
1589
+ i0.ɵɵconditionalCreate(128, MJORenewalsPageComponent_Conditional_128_Template, 2, 1, "p", 45);
1590
+ i0.ɵɵelementStart(129, "mj-dialog-actions")(130, "button", 46);
1591
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Template_button_click_130_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.AutoRenewOpen = false); });
1592
+ i0.ɵɵtext(131, "Cancel");
1593
+ i0.ɵɵelementEnd();
1594
+ i0.ɵɵelementStart(132, "button", 47);
1595
+ i0.ɵɵlistener("click", function MJORenewalsPageComponent_Template_button_click_132_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.ApplyAutoRenew()); });
1596
+ i0.ɵɵtext(133);
1597
+ i0.ɵɵelementEnd()()();
1598
+ } if (rf & 2) {
1599
+ let tmp_27_0;
1600
+ let tmp_53_0;
1601
+ let tmp_64_0;
1602
+ const exportOrigin_r22 = i0.ɵɵreference(11);
1603
+ i0.ɵɵadvance(4);
1604
+ i0.ɵɵproperty("value", ctx.WindowDays);
1605
+ i0.ɵɵadvance();
1606
+ i0.ɵɵrepeater(ctx.Windows);
1607
+ i0.ɵɵadvance(2);
1608
+ i0.ɵɵproperty("Options", ctx.CompanyOptions)("Selected", ctx.Facets.Companies);
1609
+ i0.ɵɵadvance();
1610
+ i0.ɵɵproperty("Options", ctx.ProductOptions)("Selected", ctx.Facets.Products);
1611
+ i0.ɵɵadvance();
1612
+ i0.ɵɵconditional(ctx.WindowDisplay ? 9 : -1);
1613
+ i0.ɵɵadvance();
1614
+ i0.ɵɵproperty("disabled", !ctx.Rows.length || ctx.Exporting);
1615
+ i0.ɵɵattribute("aria-expanded", ctx.ExportMenuOpen);
1616
+ i0.ɵɵadvance(3);
1617
+ i0.ɵɵtextInterpolate1(" ", ctx.Exporting ? "Exporting\u2026" : "Export", " ");
1618
+ i0.ɵɵadvance(2);
1619
+ i0.ɵɵproperty("cdkConnectedOverlayOrigin", exportOrigin_r22)("cdkConnectedOverlayOpen", ctx.ExportMenuOpen)("cdkConnectedOverlayPositions", ctx.MenuPositions)("cdkConnectedOverlayHasBackdrop", true);
1620
+ i0.ɵɵadvance();
1621
+ i0.ɵɵconditional(ctx.Applied.length ? 16 : -1);
1622
+ i0.ɵɵadvance(2);
1623
+ i0.ɵɵproperty("Value", ctx.String(ctx.Scoped.length))("Amount", ctx.EndingAmount);
1624
+ i0.ɵɵadvance();
1625
+ i0.ɵɵproperty("Value", ctx.String(ctx.AutoCount))("Amount", ctx.AutoAmount)("Detail", ctx.AutoDetail);
1626
+ i0.ɵɵadvance();
1627
+ i0.ɵɵproperty("Value", ctx.String(ctx.ManualCount))("Amount", ctx.ManualAmount);
1628
+ i0.ɵɵadvance();
1629
+ i0.ɵɵproperty("Value", ctx.String(ctx.PlacedCount))("Amount", ctx.PlacedAmount);
1630
+ i0.ɵɵadvance();
1631
+ i0.ɵɵconditional(ctx.LoadError ? 22 : -1);
1632
+ i0.ɵɵadvance();
1633
+ i0.ɵɵconditional(ctx.Notice ? 23 : -1);
1634
+ i0.ɵɵadvance();
1635
+ i0.ɵɵconditional((tmp_27_0 = ctx.PassNotice) ? 24 : -1, tmp_27_0);
1636
+ i0.ɵɵadvance();
1637
+ i0.ɵɵconditional(ctx.Truncated ? 25 : -1);
1638
+ i0.ɵɵadvance(4);
1639
+ i0.ɵɵproperty("disabled", !ctx.PlaceableSelected.length || ctx.Busy);
1640
+ i0.ɵɵadvance(2);
1641
+ i0.ɵɵtextInterpolate1(" ", ctx.Placing ? "Creating\u2026" : "Create renewal orders" + (ctx.PlaceableSelected.length ? " (" + ctx.PlaceableSelected.length + ")" : ""), " ");
1642
+ i0.ɵɵadvance();
1643
+ i0.ɵɵproperty("disabled", !ctx.SelectedKeys.length || ctx.Busy);
1644
+ i0.ɵɵadvance(2);
1645
+ i0.ɵɵtextInterpolate1(" ", ctx.Updating ? "Updating\u2026" : "Update increase %" + (ctx.SelectedKeys.length ? " (" + ctx.SelectedKeys.length + ")" : ""), " ");
1646
+ i0.ɵɵadvance();
1647
+ i0.ɵɵproperty("disabled", !ctx.SelectedKeys.length || ctx.Busy);
1648
+ i0.ɵɵadvance(2);
1649
+ i0.ɵɵtextInterpolate1(" ", "Change product" + (ctx.SelectedKeys.length ? " (" + ctx.SelectedKeys.length + ")" : ""), " ");
1650
+ i0.ɵɵadvance();
1651
+ i0.ɵɵproperty("disabled", !ctx.SelectedKeys.length || ctx.Busy);
1652
+ i0.ɵɵadvance(2);
1653
+ i0.ɵɵtextInterpolate1(" ", "Toggle auto-renew" + (ctx.SelectedKeys.length ? " (" + ctx.SelectedKeys.length + ")" : ""), " ");
1654
+ i0.ɵɵadvance();
1655
+ i0.ɵɵconditional(ctx.SelectedKeys.length ? 41 : 42);
1656
+ i0.ɵɵadvance(2);
1657
+ i0.ɵɵproperty("Columns", ctx.Columns)("Rows", ctx.Rows)("Presets", ctx.Presets)("ActivePreset", ctx.Preset)("Searchable", true)("Search", ctx.Search)("SortKey", ctx.SortKey)("SortDescending", ctx.SortDescending)("RowLabel", ctx.RowLabel)("SelectedKey", (ctx.Selected == null ? null : ctx.Selected.SubscriptionID) ?? null)("Selectable", true)("SelectedKeys", ctx.SelectedKeys)("EmptyTitle", ctx.Applied.length ? "Nothing matches these filters" : "Nothing ending in this window")("EmptyHint", ctx.Applied.length ? "Clear a company or product filter to widen the list." : "No subscription's term ends inside the window, and none ended recently without renewing.")("FootNote", ctx.FootNote);
1658
+ i0.ɵɵadvance();
1659
+ i0.ɵɵconditional((tmp_53_0 = ctx.Selected) ? 44 : -1, tmp_53_0);
1660
+ i0.ɵɵadvance();
1661
+ i0.ɵɵproperty("Visible", ctx.IncreaseOpen);
1662
+ i0.ɵɵadvance(2);
1663
+ i0.ɵɵtextInterpolate1(" ", ctx.IncreaseTargets.length === 1 ? "1 subscription" : ctx.IncreaseTargets.length + " subscriptions", " selected. Applies to future renewals; existing orders are not affected. ");
1664
+ i0.ɵɵadvance();
1665
+ i0.ɵɵconditional(ctx.IncreasePendingNote ? 48 : -1);
1666
+ i0.ɵɵadvance(5);
1667
+ i0.ɵɵproperty("value", ctx.IncreaseValue ?? "")("disabled", ctx.IncreaseClear);
1668
+ i0.ɵɵadvance(4);
1669
+ i0.ɵɵproperty("checked", ctx.IncreaseClear);
1670
+ i0.ɵɵadvance(2);
1671
+ i0.ɵɵconditional(ctx.IncreaseError ? 59 : -1);
1672
+ i0.ɵɵadvance(4);
1673
+ i0.ɵɵproperty("disabled", ctx.Busy || !ctx.IncreaseClear && ctx.IncreaseValue == null);
1674
+ i0.ɵɵadvance();
1675
+ i0.ɵɵtextInterpolate1(" ", ctx.Updating ? "Saving\u2026" : "Save", " ");
1676
+ i0.ɵɵadvance();
1677
+ i0.ɵɵproperty("Visible", ctx.PlaceOpen);
1678
+ i0.ɵɵadvance();
1679
+ i0.ɵɵconditional((tmp_64_0 = ctx.PlaceSummary) ? 66 : 67, tmp_64_0);
1680
+ i0.ɵɵadvance(2);
1681
+ i0.ɵɵconditional(ctx.PlaceError ? 68 : -1);
1682
+ i0.ɵɵadvance(4);
1683
+ i0.ɵɵproperty("disabled", ctx.Busy || !(ctx.PlaceSummary == null ? null : ctx.PlaceSummary.Placeable == null ? null : ctx.PlaceSummary.Placeable.length));
1684
+ i0.ɵɵadvance();
1685
+ i0.ɵɵtextInterpolate1(" ", ctx.Placing ? "Creating\u2026" : ctx.PlaceAs === "Confirmed" ? "Create and confirm" : "Create drafts", " ");
1686
+ i0.ɵɵadvance();
1687
+ i0.ɵɵproperty("Visible", ctx.ProductOpen);
1688
+ i0.ɵɵadvance();
1689
+ i0.ɵɵconditional(ctx.ProductPendingNote ? 75 : -1);
1690
+ i0.ɵɵadvance(5);
1691
+ i0.ɵɵtextInterpolate(ctx.ProductTargets.length);
1692
+ i0.ɵɵadvance(4);
1693
+ i0.ɵɵtextInterpolate(ctx.ProductCurrentNote);
1694
+ i0.ɵɵadvance(4);
1695
+ i0.ɵɵtextInterpolate(ctx.ProductCompanyNote);
1696
+ i0.ɵɵadvance(4);
1697
+ i0.ɵɵconditional(ctx.ProductChoicesLoading ? 92 : !ctx.ProductChoices.length ? 93 : 94);
1698
+ i0.ɵɵadvance(4);
1699
+ i0.ɵɵproperty("checked", ctx.ProductAdoptType);
1700
+ i0.ɵɵadvance(7);
1701
+ i0.ɵɵconditional(ctx.ProductError ? 103 : -1);
1702
+ i0.ɵɵadvance(4);
1703
+ i0.ɵɵproperty("disabled", ctx.Busy || !ctx.ProductChoice);
1704
+ i0.ɵɵadvance();
1705
+ i0.ɵɵtextInterpolate1(" ", ctx.Updating ? "Saving\u2026" : "Save", " ");
1706
+ i0.ɵɵadvance();
1707
+ i0.ɵɵproperty("Visible", ctx.AutoRenewOpen);
1708
+ i0.ɵɵadvance(2);
1709
+ i0.ɵɵtextInterpolate1(" ", ctx.AutoRenewTargets.length === 1 ? "1 subscription" : ctx.AutoRenewTargets.length + " subscriptions", " selected. Existing orders are not affected. ");
1710
+ i0.ɵɵadvance(2);
1711
+ i0.ɵɵproperty("checked", ctx.AutoRenewValue === true);
1712
+ i0.ɵɵadvance(7);
1713
+ i0.ɵɵproperty("checked", ctx.AutoRenewValue === false);
1714
+ i0.ɵɵadvance(8);
1715
+ i0.ɵɵconditional(ctx.AutoRenewError ? 128 : -1);
1716
+ i0.ɵɵadvance(4);
1717
+ i0.ɵɵproperty("disabled", ctx.Busy || ctx.AutoRenewValue == null);
1718
+ i0.ɵɵadvance();
1719
+ i0.ɵɵtextInterpolate1(" ", ctx.Updating ? "Saving\u2026" : "Save", " ");
1720
+ } }, dependencies: [CommonModule,
1721
+ MJButtonDirective,
1722
+ MJAlertComponent,
1723
+ MJDialogComponent,
1724
+ MJDialogActionsComponent,
1725
+ MJDropdownComponent,
1726
+ OverlayModule, i1.CdkConnectedOverlay, i1.CdkOverlayOrigin, MJOStatTileComponent,
1727
+ MJOStatedValueComponent,
1728
+ MJOMultiSelectComponent,
1729
+ MJOWorklistTableComponent], styles: ["[_nghost-%COMP%] {\n display: block;\n height: 100%;\n overflow: auto;\n padding: var(--mj-space-6);\n }\n .mjo-rn__head[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--mj-space-3);\n flex-wrap: wrap;\n margin-bottom: var(--mj-space-4);\n }\n .mjo-rn__window[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: var(--mj-space-2);\n }\n .mjo-rn__select[_ngcontent-%COMP%] {\n font: inherit;\n padding: 4px 8px;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md);\n background: var(--mj-bg-surface);\n color: inherit;\n }\n .mjo-rn__range[_ngcontent-%COMP%] { flex-basis: 100%; }\n .mjo-rn__export[_ngcontent-%COMP%] { margin-left: auto; }\n .mjo-rn__caret[_ngcontent-%COMP%] { font-size: 10px; margin-left: 2px; }\n .mjo-rn__menu[_ngcontent-%COMP%] {\n min-width: 180px;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md);\n box-shadow: var(--mj-shadow-md, 0 8px 24px rgba(0, 0, 0, 0.12));\n padding: var(--mj-space-1, 4px);\n }\n .mjo-rn__menu-item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--mj-space-2);\n width: 100%;\n font: inherit;\n font-size: 13px;\n text-align: left;\n padding: 8px 10px;\n border: none;\n border-radius: var(--mj-radius-sm, 4px);\n background: none;\n color: inherit;\n cursor: pointer;\n }\n .mjo-rn__menu-item[_ngcontent-%COMP%]:hover { background: var(--mj-bg-surface-sunken); }\n .mjo-rn__menu-item[_ngcontent-%COMP%] i[_ngcontent-%COMP%] { color: var(--mj-text-muted); width: 16px; }\n .mjo-rn__applied[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--mj-space-2);\n flex-wrap: wrap;\n margin-bottom: var(--mj-space-3);\n }\n .mjo-rn__facet[_ngcontent-%COMP%] { display: inline-flex; align-items: center; gap: 4px; }\n .mjo-rn__facet-x[_ngcontent-%COMP%] {\n font: inherit;\n border: none;\n background: none;\n color: inherit;\n cursor: pointer;\n padding: 0 0 0 2px;\n line-height: 1;\n opacity: 0.7;\n }\n .mjo-rn__facet-x[_ngcontent-%COMP%]:hover { opacity: 1; }\n .mjo-rn__link[_ngcontent-%COMP%] {\n font: inherit;\n font-size: 12px;\n border: none;\n background: none;\n color: var(--mj-brand-primary);\n cursor: pointer;\n padding: 0;\n }\n .mjo-rn__tiles[_ngcontent-%COMP%] { margin-bottom: var(--mj-space-4); }\n .mjo-rn__inline-edit[_ngcontent-%COMP%] { margin-left: var(--mj-space-2); }\n .mjo-rn__dialog-lede[_ngcontent-%COMP%] { margin: 0 0 var(--mj-space-4); }\n .mjo-rn__field[_ngcontent-%COMP%] { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--mj-space-3); }\n .mjo-rn__pct[_ngcontent-%COMP%] { display: inline-flex; align-items: center; gap: var(--mj-space-2); }\n .mjo-rn__pct[_ngcontent-%COMP%] input[_ngcontent-%COMP%] { width: 120px; }\n .mjo-rn__check[_ngcontent-%COMP%] { display: flex; align-items: flex-start; gap: var(--mj-space-2); margin-bottom: var(--mj-space-2); }\n .mjo-rn__dialog-foot[_ngcontent-%COMP%] { margin: var(--mj-space-3) 0 0; }\n .mjo-rn__facts[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: max-content 1fr;\n column-gap: var(--mj-space-4);\n row-gap: 6px;\n margin: 0 0 var(--mj-space-4);\n padding: var(--mj-space-3);\n background: var(--mj-bg-surface-sunken);\n border-radius: var(--mj-radius-md);\n font-size: 13px;\n }\n .mjo-rn__facts[_ngcontent-%COMP%] dt[_ngcontent-%COMP%] { color: var(--mj-text-muted); }\n .mjo-rn__facts[_ngcontent-%COMP%] dd[_ngcontent-%COMP%] { margin: 0; font-weight: var(--mj-font-medium); min-width: 0; }\n .mjo-rn__field[_ngcontent-%COMP%] .mjo-rn__check[_ngcontent-%COMP%] { margin-top: var(--mj-space-2); }\n .mjo-rn__field-label[_ngcontent-%COMP%] { font-size: 12px; font-weight: var(--mj-font-medium); color: var(--mj-text-secondary); }\n .mjo-rn__field-help[_ngcontent-%COMP%] { margin-top: 4px; }\n .mjo-rn__dialog-warning[_ngcontent-%COMP%] { margin: var(--mj-space-3) 0 0; }\n .mjo-rn__error[_ngcontent-%COMP%] { color: var(--mj-status-error-text, #b42318); margin: var(--mj-space-2) 0 0; }\n .mjo-rn__note[_ngcontent-%COMP%] { margin-bottom: var(--mj-space-4); }\n .mjo-rn__actions[_ngcontent-%COMP%] {\n flex-wrap: wrap;\n align-items: center;\n gap: var(--mj-space-3);\n margin-bottom: var(--mj-space-4);\n }\n .mjo-rn__split[_ngcontent-%COMP%] { display: flex; gap: var(--mj-space-4); align-items: flex-start; }\n .mjo-rn__main[_ngcontent-%COMP%] { flex: 1; min-width: 0; }\n .mjo-rn__side[_ngcontent-%COMP%] { flex: 0 0 360px; min-width: 0; }\n .mjo-rn__head-actions[_ngcontent-%COMP%] { display: inline-flex; align-items: center; gap: var(--mj-space-2); }\n .mjo-rn__card[_ngcontent-%COMP%] { margin-top: var(--mj-space-4); }\n .mjo-rn__card[_ngcontent-%COMP%] .mjo-note[_ngcontent-%COMP%] { margin-top: var(--mj-space-3); margin-bottom: 0; }\n\n @media (max-width: 1100px) {\n .mjo-rn__split[_ngcontent-%COMP%] { flex-direction: column; }\n .mjo-rn__main[_ngcontent-%COMP%], .mjo-rn__side[_ngcontent-%COMP%] { flex: 1 1 auto; width: 100%; }\n }\n @media (max-width: 760px) {\n [_nghost-%COMP%] { padding: var(--mj-space-4); }\n }"] });
1730
+ }
1731
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MJORenewalsPageComponent, [{
1732
+ type: Component,
1733
+ args: [{ selector: 'mjo-renewals-page', standalone: true, imports: [
1734
+ CommonModule,
1735
+ MJButtonDirective,
1736
+ MJAlertComponent,
1737
+ MJDialogComponent,
1738
+ MJDialogActionsComponent,
1739
+ MJDropdownComponent,
1740
+ OverlayModule,
1741
+ MJOStatTileComponent,
1742
+ MJOStatedValueComponent,
1743
+ MJOMultiSelectComponent,
1744
+ MJOWorklistTableComponent,
1745
+ ], template: `
1746
+ <div class="mjo-rn__head">
1747
+ <label class="mjo-rn__window">
1748
+ <span class="small muted">Ending</span>
1749
+ <select class="mjo-rn__select" [value]="WindowDays" (change)="OnWindow($any($event.target).value)" aria-label="How far ahead to look">
1750
+ @for (window of Windows; track window.Days) {
1751
+ <option [value]="window.Days">{{ window.Label }}</option>
1752
+ }
1753
+ </select>
1754
+ </label>
1755
+ <mjo-multi-select
1756
+ Label="Company"
1757
+ Icon="fa-solid fa-building"
1758
+ [Options]="CompanyOptions"
1759
+ [Selected]="Facets.Companies"
1760
+ (SelectedChange)="OnFacet('Company', $event)" />
1761
+ <mjo-multi-select
1762
+ Label="Product"
1763
+ Icon="fa-solid fa-box-open"
1764
+ [Options]="ProductOptions"
1765
+ [Selected]="Facets.Products"
1766
+ (SelectedChange)="OnFacet('Product', $event)" />
1767
+ @if (WindowDisplay) {
1768
+ <span class="small muted mjo-rn__range">{{ WindowDisplay }} · terms that ended in the last {{ Lookback }} days without renewing are included</span>
1769
+ }
1770
+ <button
1771
+ type="button"
1772
+ mjButton
1773
+ variant="outline"
1774
+ size="sm"
1775
+ class="mjo-rn__export"
1776
+ cdkOverlayOrigin
1777
+ #exportOrigin="cdkOverlayOrigin"
1778
+ [disabled]="!Rows.length || Exporting"
1779
+ (click)="ExportMenuOpen = !ExportMenuOpen"
1780
+ [attr.aria-expanded]="ExportMenuOpen"
1781
+ aria-haspopup="menu"
1782
+ title="Export the rows shown">
1783
+ <i class="fa-solid fa-file-export" aria-hidden="true"></i> {{ Exporting ? 'Exporting…' : 'Export' }}
1784
+ <i class="fa-solid fa-chevron-down mjo-rn__caret" aria-hidden="true"></i>
1785
+ </button>
1786
+ <ng-template
1787
+ cdkConnectedOverlay
1788
+ [cdkConnectedOverlayOrigin]="exportOrigin"
1789
+ [cdkConnectedOverlayOpen]="ExportMenuOpen"
1790
+ [cdkConnectedOverlayPositions]="MenuPositions"
1791
+ [cdkConnectedOverlayHasBackdrop]="true"
1792
+ cdkConnectedOverlayBackdropClass="cdk-overlay-transparent-backdrop"
1793
+ (backdropClick)="ExportMenuOpen = false"
1794
+ (detach)="ExportMenuOpen = false">
1795
+ <div class="mjo-rn__menu" role="menu" aria-label="Export">
1796
+ <button type="button" class="mjo-rn__menu-item" role="menuitem" (click)="Export('excel')">
1797
+ <i class="fa-solid fa-file-excel" aria-hidden="true"></i> Excel (.xlsx)
1798
+ </button>
1799
+ <button type="button" class="mjo-rn__menu-item" role="menuitem" (click)="Export('csv')">
1800
+ <i class="fa-solid fa-file-csv" aria-hidden="true"></i> CSV
1801
+ </button>
1802
+ </div>
1803
+ </ng-template>
1804
+ </div>
1805
+
1806
+ @if (Applied.length) {
1807
+ <div class="mjo-rn__applied" role="group" aria-label="Applied filters">
1808
+ <span class="small muted">Filtered by</span>
1809
+ @for (chip of Applied; track chip.key) {
1810
+ <span class="mjo-chip mjo-chip--info mjo-rn__facet">
1811
+ <span class="muted">{{ chip.label }}:</span> {{ chip.value }}
1812
+ <button type="button" class="mjo-rn__facet-x" (click)="OnRemoveFacet(chip)" [attr.aria-label]="'Remove ' + chip.label + ' ' + chip.value">
1813
+ <i class="fa-solid fa-xmark" aria-hidden="true"></i>
1814
+ </button>
1815
+ </span>
1816
+ }
1817
+ <button type="button" class="mjo-rn__link" (click)="OnClearFacets()">Clear all</button>
1818
+ </div>
1819
+ }
1820
+
1821
+ <div class="mj-stat-grid mjo-rn__tiles">
1822
+ <mjo-stat-tile
1823
+ Label="Ending in window"
1824
+ Icon="fa-solid fa-hourglass-half"
1825
+ [Value]="String(Scoped.length)"
1826
+ [Amount]="EndingAmount"
1827
+ Detail="current-term value"
1828
+ (Clicked)="OnPreset('all')" />
1829
+ <mjo-stat-tile
1830
+ Label="Will auto-renew"
1831
+ Icon="fa-solid fa-rotate"
1832
+ [Value]="String(AutoCount)"
1833
+ [Amount]="AutoAmount"
1834
+ [Detail]="AutoDetail"
1835
+ (Clicked)="OnPreset('auto')" />
1836
+ <mjo-stat-tile
1837
+ Label="Will end unless renewed"
1838
+ Icon="fa-solid fa-hand"
1839
+ Tone="alert"
1840
+ [Value]="String(ManualCount)"
1841
+ [Amount]="ManualAmount"
1842
+ Detail="at risk"
1843
+ (Clicked)="OnPreset('manual')" />
1844
+ <mjo-stat-tile
1845
+ Label="Renewal placed"
1846
+ Icon="fa-solid fa-file-circle-check"
1847
+ [Value]="String(PlacedCount)"
1848
+ [Amount]="PlacedAmount"
1849
+ Detail="on renewal orders"
1850
+ (Clicked)="OnPreset('placed')" />
1851
+ </div>
1852
+
1853
+ @if (LoadError) {
1854
+ <mj-alert Variant="error" Icon="fa-solid fa-triangle-exclamation" class="mjo-rn__note">
1855
+ <strong>The renewals list did not load.</strong>
1856
+ {{ LoadError }}
1857
+ </mj-alert>
1858
+ }
1859
+ @if (Notice) {
1860
+ <mj-alert [Variant]="Notice.Tone" Icon="fa-solid fa-circle-info" class="mjo-rn__note">
1861
+ {{ Notice.Text }}
1862
+ </mj-alert>
1863
+ }
1864
+ @if (PassNotice; as pass) {
1865
+ <mj-alert [Variant]="pass.Tone" Icon="fa-solid fa-clock" class="mjo-rn__note">
1866
+ <strong>{{ pass.Title }}</strong>
1867
+ {{ pass.Text }}
1868
+ </mj-alert>
1869
+ }
1870
+ @if (Truncated) {
1871
+ <mj-alert Variant="warning" Icon="fa-solid fa-triangle-exclamation" class="mjo-rn__note">
1872
+ <strong>Showing the first {{ MaxRows.toLocaleString() }} subscriptions by end date.</strong>
1873
+ Narrow the window to see the rest.
1874
+ </mj-alert>
1875
+ }
1876
+
1877
+ <div class="mjo-rn__split">
1878
+ <div class="mjo-rn__main">
1879
+ <div class="row mjo-rn__actions">
1880
+ <button type="button" mjButton variant="primary" [disabled]="!PlaceableSelected.length || Busy" (click)="OpenPlace(PlaceableSelected, SelectedKeys)" title="Create a renewal order for each selected row that can renew">
1881
+ <i class="fa-solid fa-file-circle-plus" aria-hidden="true"></i>
1882
+ {{ Placing ? 'Creating…' : 'Create renewal orders' + (PlaceableSelected.length ? ' (' + PlaceableSelected.length + ')' : '') }}
1883
+ </button>
1884
+ <button type="button" mjButton variant="outline" [disabled]="!SelectedKeys.length || Busy" (click)="OpenIncrease(SelectedKeys)" title="Set the annual renewal increase for the selected subscriptions">
1885
+ <i class="fa-solid fa-percent" aria-hidden="true"></i>
1886
+ {{ Updating ? 'Updating…' : 'Update increase %' + (SelectedKeys.length ? ' (' + SelectedKeys.length + ')' : '') }}
1887
+ </button>
1888
+ <button type="button" mjButton variant="outline" [disabled]="!SelectedKeys.length || Busy" (click)="OpenProduct(SelectedKeys)" title="Correct the product on the selected subscriptions; booked orders and deals are not changed">
1889
+ <i class="fa-solid fa-box-open" aria-hidden="true"></i>
1890
+ {{ 'Change product' + (SelectedKeys.length ? ' (' + SelectedKeys.length + ')' : '') }}
1891
+ </button>
1892
+ <button type="button" mjButton variant="outline" [disabled]="!SelectedKeys.length || Busy" (click)="OpenAutoRenew(SelectedKeys)" title="Turn auto-renew on or off for the selected subscriptions">
1893
+ <i class="fa-solid fa-rotate" aria-hidden="true"></i>
1894
+ {{ 'Toggle auto-renew' + (SelectedKeys.length ? ' (' + SelectedKeys.length + ')' : '') }}
1895
+ </button>
1896
+ @if (SelectedKeys.length) {
1897
+ <button type="button" mjButton variant="outline" size="sm" (click)="SelectedKeys = []">Clear</button>
1898
+ <span class="small muted">{{ SelectionNote }}</span>
1899
+ } @else {
1900
+ <span class="small muted">Select rows to create renewal orders, set the renewal increase, change the product, or set auto-renew.</span>
1901
+ }
1902
+ </div>
1903
+
1904
+ <mjo-worklist-table
1905
+ [Columns]="Columns"
1906
+ [Rows]="Rows"
1907
+ [Presets]="Presets"
1908
+ [ActivePreset]="Preset"
1909
+ [Searchable]="true"
1910
+ [Search]="Search"
1911
+ SearchPlaceholder="Customer, account, product, subscription or order…"
1912
+ [SortKey]="SortKey"
1913
+ [SortDescending]="SortDescending"
1914
+ RowKey="SubscriptionID"
1915
+ [RowLabel]="RowLabel"
1916
+ [SelectedKey]="Selected?.SubscriptionID ?? null"
1917
+ [Selectable]="true"
1918
+ [SelectedKeys]="SelectedKeys"
1919
+ [EmptyTitle]="Applied.length ? 'Nothing matches these filters' : 'Nothing ending in this window'"
1920
+ [EmptyHint]="Applied.length ? 'Clear a company or product filter to widen the list.' : 'No subscription\\'s term ends inside the window, and none ended recently without renewing.'"
1921
+ EmptyIcon="fa-solid fa-rotate"
1922
+ [FootNote]="FootNote"
1923
+ (PresetChanged)="OnPreset($event)"
1924
+ (SearchChanged)="OnSearch($event)"
1925
+ (SortChanged)="OnSort($event)"
1926
+ (SelectionChanged)="SelectedKeys = $event"
1927
+ (RowClicked)="Selected = $event" />
1928
+ </div>
1929
+
1930
+ @if (Selected; as row) {
1931
+ <aside class="mjo-rn__side">
1932
+ <div class="mj-card">
1933
+ <div class="mj-card-head">
1934
+ <i class="fa-solid fa-rotate" aria-hidden="true"></i>
1935
+ <h3>{{ row.SubscriptionNumber }}</h3>
1936
+ <span class="right mjo-rn__head-actions">
1937
+ <span class="mjo-chip" [class]="stateClass(row)">{{ stateLabel(row) }}</span>
1938
+ <button type="button" mjButton variant="outline" size="sm" (click)="OpenSubscription(row)" title="Open the subscription's form">
1939
+ <i class="fa-solid fa-arrow-up-right-from-square" aria-hidden="true"></i> Open
1940
+ </button>
1941
+ </span>
1942
+ </div>
1943
+ <div class="mj-card-pad">
1944
+ <mjo-stated-value Label="Customer">{{ row.ContactName ?? '—' }}</mjo-stated-value>
1945
+ <mjo-stated-value Label="Account">{{ row.AccountName ?? '—' }}</mjo-stated-value>
1946
+ <mjo-stated-value Label="Company">{{ row.CompanyName || '—' }}</mjo-stated-value>
1947
+ <mjo-stated-value Label="Product">
1948
+ {{ row.ProductName }} <span class="small muted">· {{ row.SubscriptionTypeName }}</span>
1949
+ @if (!row.ProviderBilled) {
1950
+ <button type="button" mjButton variant="outline" size="sm" class="mjo-rn__inline-edit" [disabled]="Busy" (click)="OpenProduct([row.SubscriptionID])" title="Correct this subscription's product">
1951
+ <i class="fa-solid fa-pen" aria-hidden="true"></i> Edit
1952
+ </button>
1953
+ }
1954
+ </mjo-stated-value>
1955
+ <mjo-stated-value Label="Current term">
1956
+ Term {{ row.TermNumber }} · {{ date(row.TermStartDate) }} → {{ date(row.TermEndDate) }}
1957
+ <span class="small muted">· {{ endsNote(row) }}</span>
1958
+ @if (termWarning(row); as warning) {
1959
+ <span class="mjo-chip mjo-chip--warning">{{ warning }}</span>
1960
+ }
1961
+ </mjo-stated-value>
1962
+ <mjo-stated-value Label="Subscribed since">{{ date(row.StartDate) }}</mjo-stated-value>
1963
+ <mjo-stated-value Label="Auto-renew">
1964
+ {{ row.AutoRenew ? 'On' : 'Off' }}
1965
+ @if (row.AutoRenewOn) {
1966
+ <span class="small muted">· renews on {{ date(row.AutoRenewOn) }} ({{ row.LeadDays }}-day lead)</span>
1967
+ } @else if (!row.AutoRenew && !row.RenewalOrderID && !row.ProviderBilled) {
1968
+ <span class="small muted">· ends unless renewed by hand</span>
1969
+ }
1970
+ @if (!row.ProviderBilled) {
1971
+ <button type="button" mjButton variant="outline" size="sm" class="mjo-rn__inline-edit" [disabled]="Busy" (click)="OpenAutoRenew([row.SubscriptionID])" title="Turn auto-renew on or off for this subscription">
1972
+ <i class="fa-solid fa-pen" aria-hidden="true"></i> Edit
1973
+ </button>
1974
+ }
1975
+ </mjo-stated-value>
1976
+ <mjo-stated-value Label="Renewal increase">
1977
+ {{ increaseNote(row) }}
1978
+ <button type="button" mjButton variant="outline" size="sm" class="mjo-rn__inline-edit" [disabled]="Busy" (click)="OpenIncrease([row.SubscriptionID])" title="Set this subscription's annual increase">
1979
+ <i class="fa-solid fa-pen" aria-hidden="true"></i> Edit
1980
+ </button>
1981
+ </mjo-stated-value>
1982
+ </div>
1983
+ </div>
1984
+
1985
+ <div class="mj-card mjo-rn__card">
1986
+ <div class="mj-card-head">
1987
+ <i class="fa-solid fa-file-invoice-dollar" aria-hidden="true"></i>
1988
+ <h3>Current order</h3>
1989
+ @if (row.CurrentOrderID) {
1990
+ <button class="right" type="button" mjButton variant="outline" size="sm" (click)="OpenOrder(row.CurrentOrderID)">
1991
+ <i class="fa-solid fa-arrow-up-right-from-square" aria-hidden="true"></i> {{ row.CurrentOrderNumber }}
1992
+ </button>
1993
+ }
1994
+ </div>
1995
+ <div class="mj-card-pad">
1996
+ @if (row.CurrentOrderID) {
1997
+ <mjo-stated-value Label="Placed">{{ date(row.CurrentOrderDate) }} <span class="mjo-chip mjo-chip--outline">{{ row.CurrentOrderStatus }}</span></mjo-stated-value>
1998
+ <mjo-stated-value Label="Price">
1999
+ {{ money(row.CurrentUnitPrice) }}
2000
+ @if (row.CurrentQuantity && row.CurrentQuantity !== 1) { <span class="small muted">× {{ row.CurrentQuantity }} = {{ money(row.CurrentLineTotal) }}</span> }
2001
+ </mjo-stated-value>
2002
+ @if (row.CurrentOrderBalance) {
2003
+ <mjo-stated-value Label="Still owed">{{ money(row.CurrentOrderBalance) }}</mjo-stated-value>
2004
+ }
2005
+ } @else {
2006
+ <div class="small muted">The order line that bought this term no longer exists.</div>
2007
+ }
2008
+ </div>
2009
+ </div>
2010
+
2011
+ <div class="mj-card mjo-rn__card">
2012
+ <div class="mj-card-head">
2013
+ <i class="fa-solid fa-rotate" aria-hidden="true"></i>
2014
+ <h3>Renewal</h3>
2015
+ @if (row.RenewalOrderID) {
2016
+ <button class="right" type="button" mjButton variant="outline" size="sm" (click)="OpenOrder(row.RenewalOrderID)">
2017
+ <i class="fa-solid fa-arrow-up-right-from-square" aria-hidden="true"></i> {{ row.RenewalOrderNumber }}
2018
+ </button>
2019
+ }
2020
+ </div>
2021
+ <div class="mj-card-pad">
2022
+ @if (row.RenewalOrderID) {
2023
+ <mjo-stated-value Label="Placed">{{ date(row.RenewalOrderDate) }} <span class="mjo-chip mjo-chip--outline">{{ row.RenewalOrderStatus }}</span></mjo-stated-value>
2024
+ <mjo-stated-value Label="Price">
2025
+ {{ money(row.RenewalUnitPrice) }}
2026
+ @if (row.RenewalQuantity && row.RenewalQuantity !== 1) { <span class="small muted">× {{ row.RenewalQuantity }} = {{ money(row.RenewalLineTotal) }}</span> }
2027
+ </mjo-stated-value>
2028
+ @if (row.RenewalBooked) {
2029
+ <mjo-stated-value Label="New term">{{ date(row.RenewalTermStart) }} → {{ date(row.RenewalTermEnd) }}</mjo-stated-value>
2030
+ } @else {
2031
+ <p class="mjo-note mjo-rn__note">
2032
+ <i class="fa-solid fa-hourglass-half" aria-hidden="true"></i>
2033
+ A draft. Confirming it books the new term; until then the nightly pass leaves this subscription alone.
2034
+ </p>
2035
+ }
2036
+ } @else if (row.ProviderBilled) {
2037
+ <div class="small muted">A payment gateway bills this subscription and renews it itself. Orders places no renewal order.</div>
2038
+ } @else if (projectionLines(row); as lines) {
2039
+ @if (row.ProjectedUnitPrice != null) {
2040
+ <mjo-stated-value Label="Projected price">
2041
+ {{ money(row.ProjectedUnitPrice) }}
2042
+ @if (row.ProjectedQuantity && row.ProjectedQuantity !== 1) { <span class="small muted">× {{ row.ProjectedQuantity }} = {{ money(row.ProjectedLineTotal) }}</span> }
2043
+ </mjo-stated-value>
2044
+ }
2045
+ @for (line of lines; track line.Label) {
2046
+ <mjo-stated-value [Label]="line.Label">{{ line.Text }}</mjo-stated-value>
2047
+ }
2048
+ @if (CanPlace(row)) {
2049
+ <button type="button" mjButton variant="outline" size="sm" [disabled]="Busy" (click)="OpenPlace([row.SubscriptionID])">
2050
+ <i class="fa-solid fa-file-circle-plus" aria-hidden="true"></i> Create renewal order
2051
+ </button>
2052
+ }
2053
+ } @else {
2054
+ <div class="small muted">{{ stateNote(row) ?? 'Nothing will renew this subscription.' }}</div>
2055
+ }
2056
+ </div>
2057
+ </div>
2058
+ </aside>
2059
+ }
2060
+ </div>
2061
+
2062
+ <mj-dialog [Visible]="IncreaseOpen" Title="Renewal increase" Size="sm" (Close)="IncreaseOpen = false">
2063
+ <p class="mjo-rn__dialog-lede">
2064
+ {{ IncreaseTargets.length === 1 ? '1 subscription' : IncreaseTargets.length + ' subscriptions' }} selected. Applies to future renewals; existing orders are not affected.
2065
+ </p>
2066
+ @if (IncreasePendingNote) {
2067
+ <p class="mjo-note mjo-rn__dialog-warning">
2068
+ <i class="fa-solid fa-triangle-exclamation" aria-hidden="true"></i>
2069
+ {{ IncreasePendingNote }}
2070
+ </p>
2071
+ }
2072
+ <label class="mjo-rn__field">
2073
+ <span class="small muted">Annual increase</span>
2074
+ <span class="mjo-rn__pct">
2075
+ <input
2076
+ type="number"
2077
+ class="mjo-rn__select"
2078
+ min="0"
2079
+ max="100"
2080
+ step="0.01"
2081
+ inputmode="decimal"
2082
+ [value]="IncreaseValue ?? ''"
2083
+ [disabled]="IncreaseClear"
2084
+ (input)="OnIncreaseInput($any($event.target).value)"
2085
+ placeholder="e.g. 5"
2086
+ aria-label="Increase in percent" />
2087
+ <span class="muted">%</span>
2088
+ </span>
2089
+ </label>
2090
+ <label class="mjo-rn__check small">
2091
+ <input type="checkbox" [checked]="IncreaseClear" (change)="IncreaseClear = $any($event.target).checked" />
2092
+ No subscription-level rate (use the product, category or company default)
2093
+ </label>
2094
+ @if (IncreaseError) {
2095
+ <p class="small mjo-rn__error">{{ IncreaseError }}</p>
2096
+ }
2097
+ <mj-dialog-actions>
2098
+ <button type="button" mjButton variant="outline" (click)="IncreaseOpen = false">Cancel</button>
2099
+ <button type="button" mjButton variant="primary" [disabled]="Busy || (!IncreaseClear && IncreaseValue == null)" (click)="ApplyIncrease()">
2100
+ {{ Updating ? 'Saving…' : 'Save' }}
2101
+ </button>
2102
+ </mj-dialog-actions>
2103
+ </mj-dialog>
2104
+
2105
+ <mj-dialog [Visible]="PlaceOpen" Title="Create renewal orders" Size="sm" (Close)="PlaceOpen = false">
2106
+ @if (PlaceSummary; as summary) {
2107
+ <dl class="mjo-rn__facts">
2108
+ <dt>Selected</dt>
2109
+ <dd>{{ PlaceTargets.length + PlaceExcludedCount }} subscription{{ PlaceTargets.length + PlaceExcludedCount === 1 ? '' : 's' }}</dd>
2110
+ <dt>To renew</dt>
2111
+ <dd>
2112
+ @if (summary.Placeable.length) {
2113
+ {{ summary.Placeable.length }} subscription{{ summary.Placeable.length === 1 ? '' : 's' }} on {{ summary.Orders }} renewal order{{ summary.Orders === 1 ? '' : 's' }}
2114
+ @if (summary.Orders < summary.Placeable.length) {
2115
+ <span class="small muted">· same customer, same end date, one order</span>
2116
+ }
2117
+ } @else {
2118
+ none
2119
+ }
2120
+ </dd>
2121
+ @if (summary.Placeable.length) {
2122
+ <dt>Total</dt>
2123
+ <dd>{{ money(summary.Total) }} <span class="small muted">before tax</span></dd>
2124
+ }
2125
+ @if (PlaceExcluded) {
2126
+ <dt>Excluded</dt>
2127
+ <dd>{{ PlaceExcluded }}</dd>
2128
+ }
2129
+ @if (summary.Detail) {
2130
+ <dt>Skipped</dt>
2131
+ <dd>{{ summary.Detail }}</dd>
2132
+ }
2133
+ </dl>
2134
+ @if (summary.Placeable.length) {
2135
+ <div class="mjo-rn__field">
2136
+ <span class="mjo-rn__field-label">Create as</span>
2137
+ <label class="mjo-rn__check">
2138
+ <input type="radio" name="mjo-rn-placeas" [checked]="PlaceAs === 'Draft'" [disabled]="Placing" (change)="OnPlaceAs('Draft')" />
2139
+ <span><strong>Draft</strong> <span class="muted">· review and confirm each order before it is invoiced</span></span>
2140
+ </label>
2141
+ <label class="mjo-rn__check">
2142
+ <input type="radio" name="mjo-rn-placeas" [checked]="PlaceAs === 'Confirmed'" [disabled]="Placing" (change)="OnPlaceAs('Confirmed')" />
2143
+ <span><strong>Confirmed</strong> <span class="muted">· booked now</span></span>
2144
+ </label>
2145
+ </div>
2146
+ }
2147
+ @for (warning of PlaceWarnings; track warning) {
2148
+ <p class="mjo-note mjo-rn__dialog-warning">
2149
+ <i class="fa-solid fa-triangle-exclamation" aria-hidden="true"></i>
2150
+ {{ warning }}
2151
+ </p>
2152
+ }
2153
+ } @else {
2154
+ <p class="mjo-rn__dialog-lede small muted">Checking what can be renewed…</p>
2155
+ }
2156
+ @if (PlaceError) {
2157
+ <p class="small mjo-rn__error">{{ PlaceError }}</p>
2158
+ }
2159
+ <mj-dialog-actions>
2160
+ <button type="button" mjButton variant="outline" (click)="PlaceOpen = false">Cancel</button>
2161
+ <button type="button" mjButton variant="primary" [disabled]="Busy || !PlaceSummary?.Placeable?.length" (click)="ApplyPlace()">
2162
+ {{ Placing ? 'Creating…' : PlaceAs === 'Confirmed' ? 'Create and confirm' : 'Create drafts' }}
2163
+ </button>
2164
+ </mj-dialog-actions>
2165
+ </mj-dialog>
2166
+
2167
+ <mj-dialog [Visible]="ProductOpen" Title="Change product" Size="sm" (Close)="ProductOpen = false">
2168
+ @if (ProductPendingNote) {
2169
+ <p class="mjo-note mjo-rn__dialog-warning mjo-rn__dialog-lede">
2170
+ <i class="fa-solid fa-triangle-exclamation" aria-hidden="true"></i>
2171
+ {{ ProductPendingNote }}
2172
+ </p>
2173
+ }
2174
+ <dl class="mjo-rn__facts">
2175
+ <dt>Subscriptions</dt>
2176
+ <dd>{{ ProductTargets.length }}</dd>
2177
+ <dt>Current product</dt>
2178
+ <dd>{{ ProductCurrentNote }}</dd>
2179
+ <dt>Company</dt>
2180
+ <dd>{{ ProductCompanyNote }}</dd>
2181
+ </dl>
2182
+ <div class="mjo-rn__field">
2183
+ <label class="mjo-rn__field-label" for="mjo-rn-product">New product</label>
2184
+ @if (ProductChoicesLoading) {
2185
+ <span class="small muted">Loading products…</span>
2186
+ } @else if (!ProductChoices.length) {
2187
+ <span class="small muted">No active subscription products for this company.</span>
2188
+ } @else {
2189
+ <mj-dropdown
2190
+ id="mjo-rn-product"
2191
+ [Data]="ProductChoices"
2192
+ TextField="Label"
2193
+ ValueField="ID"
2194
+ [ValuePrimitive]="true"
2195
+ [Filterable]="true"
2196
+ Placeholder="Select a product"
2197
+ (ValueChange)="OnProductChoice($event)" />
2198
+ <span class="small muted mjo-rn__field-help">Active subscription products sold by the same company.</span>
2199
+ }
2200
+ </div>
2201
+ <label class="mjo-rn__check">
2202
+ <input type="checkbox" [checked]="ProductAdoptType" (change)="ProductAdoptType = $any($event.target).checked" />
2203
+ <span>Move to the new product's subscription type if it differs <span class="muted">(changes term length, billing cadence and lead time)</span></span>
2204
+ </label>
2205
+ <p class="small muted mjo-rn__dialog-foot">
2206
+ Only the subscription changes. Existing orders and deals are not affected. Future renewals use the new product at the current price plus the annual increase.
2207
+ </p>
2208
+ @if (ProductError) {
2209
+ <p class="small mjo-rn__error">{{ ProductError }}</p>
2210
+ }
2211
+ <mj-dialog-actions>
2212
+ <button type="button" mjButton variant="outline" (click)="ProductOpen = false">Cancel</button>
2213
+ <button type="button" mjButton variant="primary" [disabled]="Busy || !ProductChoice" (click)="ApplyProduct()">
2214
+ {{ Updating ? 'Saving…' : 'Save' }}
2215
+ </button>
2216
+ </mj-dialog-actions>
2217
+ </mj-dialog>
2218
+
2219
+ <mj-dialog [Visible]="AutoRenewOpen" Title="Auto-renew" Size="sm" (Close)="AutoRenewOpen = false">
2220
+ <p class="mjo-rn__dialog-lede">
2221
+ {{ AutoRenewTargets.length === 1 ? '1 subscription' : AutoRenewTargets.length + ' subscriptions' }} selected. Existing orders are not affected.
2222
+ </p>
2223
+ <label class="mjo-rn__check">
2224
+ <input type="radio" name="mjo-rn-autorenew" [checked]="AutoRenewValue === true" (change)="AutoRenewValue = true" />
2225
+ <span><strong>On</strong> <span class="muted">· renews automatically at the end of each term</span></span>
2226
+ </label>
2227
+ <label class="mjo-rn__check">
2228
+ <input type="radio" name="mjo-rn-autorenew" [checked]="AutoRenewValue === false" (change)="AutoRenewValue = false" />
2229
+ <span><strong>Off</strong> <span class="muted">· expires at the end of the term unless renewed manually</span></span>
2230
+ </label>
2231
+ <p class="small muted mjo-rn__dialog-foot">Subscriptions billed by a payment gateway are managed by the gateway and will be skipped.</p>
2232
+ @if (AutoRenewError) {
2233
+ <p class="small mjo-rn__error">{{ AutoRenewError }}</p>
2234
+ }
2235
+ <mj-dialog-actions>
2236
+ <button type="button" mjButton variant="outline" (click)="AutoRenewOpen = false">Cancel</button>
2237
+ <button type="button" mjButton variant="primary" [disabled]="Busy || AutoRenewValue == null" (click)="ApplyAutoRenew()">
2238
+ {{ Updating ? 'Saving…' : 'Save' }}
2239
+ </button>
2240
+ </mj-dialog-actions>
2241
+ </mj-dialog>
2242
+ `, styles: ["\n :host {\n display: block;\n height: 100%;\n overflow: auto;\n padding: var(--mj-space-6);\n }\n .mjo-rn__head {\n display: flex;\n align-items: center;\n gap: var(--mj-space-3);\n flex-wrap: wrap;\n margin-bottom: var(--mj-space-4);\n }\n .mjo-rn__window {\n display: inline-flex;\n align-items: center;\n gap: var(--mj-space-2);\n }\n .mjo-rn__select {\n font: inherit;\n padding: 4px 8px;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md);\n background: var(--mj-bg-surface);\n color: inherit;\n }\n .mjo-rn__range { flex-basis: 100%; }\n .mjo-rn__export { margin-left: auto; }\n .mjo-rn__caret { font-size: 10px; margin-left: 2px; }\n .mjo-rn__menu {\n min-width: 180px;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md);\n box-shadow: var(--mj-shadow-md, 0 8px 24px rgba(0, 0, 0, 0.12));\n padding: var(--mj-space-1, 4px);\n }\n .mjo-rn__menu-item {\n display: flex;\n align-items: center;\n gap: var(--mj-space-2);\n width: 100%;\n font: inherit;\n font-size: 13px;\n text-align: left;\n padding: 8px 10px;\n border: none;\n border-radius: var(--mj-radius-sm, 4px);\n background: none;\n color: inherit;\n cursor: pointer;\n }\n .mjo-rn__menu-item:hover { background: var(--mj-bg-surface-sunken); }\n .mjo-rn__menu-item i { color: var(--mj-text-muted); width: 16px; }\n .mjo-rn__applied {\n display: flex;\n align-items: center;\n gap: var(--mj-space-2);\n flex-wrap: wrap;\n margin-bottom: var(--mj-space-3);\n }\n .mjo-rn__facet { display: inline-flex; align-items: center; gap: 4px; }\n .mjo-rn__facet-x {\n font: inherit;\n border: none;\n background: none;\n color: inherit;\n cursor: pointer;\n padding: 0 0 0 2px;\n line-height: 1;\n opacity: 0.7;\n }\n .mjo-rn__facet-x:hover { opacity: 1; }\n .mjo-rn__link {\n font: inherit;\n font-size: 12px;\n border: none;\n background: none;\n color: var(--mj-brand-primary);\n cursor: pointer;\n padding: 0;\n }\n .mjo-rn__tiles { margin-bottom: var(--mj-space-4); }\n .mjo-rn__inline-edit { margin-left: var(--mj-space-2); }\n .mjo-rn__dialog-lede { margin: 0 0 var(--mj-space-4); }\n .mjo-rn__field { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--mj-space-3); }\n .mjo-rn__pct { display: inline-flex; align-items: center; gap: var(--mj-space-2); }\n .mjo-rn__pct input { width: 120px; }\n .mjo-rn__check { display: flex; align-items: flex-start; gap: var(--mj-space-2); margin-bottom: var(--mj-space-2); }\n .mjo-rn__dialog-foot { margin: var(--mj-space-3) 0 0; }\n .mjo-rn__facts {\n display: grid;\n grid-template-columns: max-content 1fr;\n column-gap: var(--mj-space-4);\n row-gap: 6px;\n margin: 0 0 var(--mj-space-4);\n padding: var(--mj-space-3);\n background: var(--mj-bg-surface-sunken);\n border-radius: var(--mj-radius-md);\n font-size: 13px;\n }\n .mjo-rn__facts dt { color: var(--mj-text-muted); }\n .mjo-rn__facts dd { margin: 0; font-weight: var(--mj-font-medium); min-width: 0; }\n .mjo-rn__field .mjo-rn__check { margin-top: var(--mj-space-2); }\n .mjo-rn__field-label { font-size: 12px; font-weight: var(--mj-font-medium); color: var(--mj-text-secondary); }\n .mjo-rn__field-help { margin-top: 4px; }\n .mjo-rn__dialog-warning { margin: var(--mj-space-3) 0 0; }\n .mjo-rn__error { color: var(--mj-status-error-text, #b42318); margin: var(--mj-space-2) 0 0; }\n .mjo-rn__note { margin-bottom: var(--mj-space-4); }\n .mjo-rn__actions {\n flex-wrap: wrap;\n align-items: center;\n gap: var(--mj-space-3);\n margin-bottom: var(--mj-space-4);\n }\n .mjo-rn__split { display: flex; gap: var(--mj-space-4); align-items: flex-start; }\n .mjo-rn__main { flex: 1; min-width: 0; }\n .mjo-rn__side { flex: 0 0 360px; min-width: 0; }\n .mjo-rn__head-actions { display: inline-flex; align-items: center; gap: var(--mj-space-2); }\n .mjo-rn__card { margin-top: var(--mj-space-4); }\n .mjo-rn__card .mjo-note { margin-top: var(--mj-space-3); margin-bottom: 0; }\n\n @media (max-width: 1100px) {\n .mjo-rn__split { flex-direction: column; }\n .mjo-rn__main, .mjo-rn__side { flex: 1 1 auto; width: 100%; }\n }\n @media (max-width: 760px) {\n :host { padding: var(--mj-space-4); }\n }\n "] }]
2243
+ }], null, { SubscriptionOpened: [{
2244
+ type: Output
2245
+ }], OrderOpened: [{
2246
+ type: Output
2247
+ }] }); })();
2248
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MJORenewalsPageComponent, { className: "MJORenewalsPageComponent", filePath: "lib/pages/subscriptions/renewals.page.ts", lineNumber: 774 }); })();
2249
+ //# sourceMappingURL=renewals.page.js.map