@mj-biz-apps/orders-ng 5.42.0 → 5.44.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 (100) hide show
  1. package/dist/lib/custom/EventOrderLine/event-order-line-form.component.js +6 -5
  2. package/dist/lib/custom/EventOrderLine/event-order-line-form.component.js.map +1 -1
  3. package/dist/lib/custom/OrderHeader/order-header-form.component.d.ts +4 -0
  4. package/dist/lib/custom/OrderHeader/order-header-form.component.d.ts.map +1 -1
  5. package/dist/lib/custom/OrderHeader/order-header-form.component.js +330 -297
  6. package/dist/lib/custom/OrderHeader/order-header-form.component.js.map +1 -1
  7. package/dist/lib/custom/OrderHeader/order-lines-editor.component.d.ts +6 -0
  8. package/dist/lib/custom/OrderHeader/order-lines-editor.component.d.ts.map +1 -1
  9. package/dist/lib/custom/OrderHeader/order-lines-editor.component.js +130 -46
  10. package/dist/lib/custom/OrderHeader/order-lines-editor.component.js.map +1 -1
  11. package/dist/lib/custom/PaymentHeader/change-payment-date.component.d.ts +30 -0
  12. package/dist/lib/custom/PaymentHeader/change-payment-date.component.d.ts.map +1 -0
  13. package/dist/lib/custom/PaymentHeader/change-payment-date.component.js +156 -0
  14. package/dist/lib/custom/PaymentHeader/change-payment-date.component.js.map +1 -0
  15. package/dist/lib/custom/PaymentHeader/order-payment-dates.component.d.ts +26 -0
  16. package/dist/lib/custom/PaymentHeader/order-payment-dates.component.d.ts.map +1 -0
  17. package/dist/lib/custom/PaymentHeader/order-payment-dates.component.js +149 -0
  18. package/dist/lib/custom/PaymentHeader/order-payment-dates.component.js.map +1 -0
  19. package/dist/lib/custom/PaymentHeader/payment-header-form.component.d.ts +2 -0
  20. package/dist/lib/custom/PaymentHeader/payment-header-form.component.d.ts.map +1 -1
  21. package/dist/lib/custom/PaymentHeader/payment-header-form.component.js +398 -378
  22. package/dist/lib/custom/PaymentHeader/payment-header-form.component.js.map +1 -1
  23. package/dist/lib/custom/Product/product-save-guard-form.component.js +74 -72
  24. package/dist/lib/custom/Product/product-save-guard-form.component.js.map +1 -1
  25. package/dist/lib/custom/Product/widgets/product-accounting-widget.component.js +16 -9
  26. package/dist/lib/custom/Product/widgets/product-accounting-widget.component.js.map +1 -1
  27. package/dist/lib/custom/Product/widgets/product-effective-gl-accounts.component.d.ts +54 -0
  28. package/dist/lib/custom/Product/widgets/product-effective-gl-accounts.component.d.ts.map +1 -0
  29. package/dist/lib/custom/Product/widgets/product-effective-gl-accounts.component.js +254 -0
  30. package/dist/lib/custom/Product/widgets/product-effective-gl-accounts.component.js.map +1 -0
  31. package/dist/lib/custom/Product/widgets/product-gl-links.component.d.ts +7 -4
  32. package/dist/lib/custom/Product/widgets/product-gl-links.component.d.ts.map +1 -1
  33. package/dist/lib/custom/Product/widgets/product-gl-links.component.js +14 -5
  34. package/dist/lib/custom/Product/widgets/product-gl-links.component.js.map +1 -1
  35. package/dist/lib/custom/Product/widgets/product-pricing-widget.component.d.ts +7 -0
  36. package/dist/lib/custom/Product/widgets/product-pricing-widget.component.d.ts.map +1 -1
  37. package/dist/lib/custom/Product/widgets/product-pricing-widget.component.js +54 -32
  38. package/dist/lib/custom/Product/widgets/product-pricing-widget.component.js.map +1 -1
  39. package/dist/lib/custom/custom-forms.module.d.ts +23 -20
  40. package/dist/lib/custom/custom-forms.module.d.ts.map +1 -1
  41. package/dist/lib/custom/custom-forms.module.js +17 -1
  42. package/dist/lib/custom/custom-forms.module.js.map +1 -1
  43. package/dist/lib/data/orders-queries.d.ts +35 -3
  44. package/dist/lib/data/orders-queries.d.ts.map +1 -1
  45. package/dist/lib/data/orders-queries.js +56 -5
  46. package/dist/lib/data/orders-queries.js.map +1 -1
  47. package/dist/lib/form-panels/catalog-overviews.panels.js +8 -8
  48. package/dist/lib/form-panels/catalog-overviews.panels.js.map +1 -1
  49. package/dist/lib/form-panels/commercial-overviews.panels.js +5 -5
  50. package/dist/lib/form-panels/document-forms.module.d.ts +20 -19
  51. package/dist/lib/form-panels/document-forms.module.d.ts.map +1 -1
  52. package/dist/lib/form-panels/document-forms.module.js +8 -1
  53. package/dist/lib/form-panels/document-forms.module.js.map +1 -1
  54. package/dist/lib/form-panels/document-hero.component.js +2 -2
  55. package/dist/lib/form-panels/document-overviews.panels.js +7 -7
  56. package/dist/lib/form-panels/lookup-headers.panels.js +10 -10
  57. package/dist/lib/form-panels/order-access-overrides.panel.js +2 -2
  58. package/dist/lib/form-panels/overview-cards.component.js +2 -2
  59. package/dist/lib/form-panels/payment-header.panel.js +2 -2
  60. package/dist/lib/form-panels/price-list-header.panel.js +2 -2
  61. package/dist/lib/form-panels/product-header.panel.d.ts +37 -10
  62. package/dist/lib/form-panels/product-header.panel.d.ts.map +1 -1
  63. package/dist/lib/form-panels/product-header.panel.js +253 -59
  64. package/dist/lib/form-panels/product-header.panel.js.map +1 -1
  65. package/dist/lib/form-panels/product-readiness.d.ts +34 -0
  66. package/dist/lib/form-panels/product-readiness.d.ts.map +1 -0
  67. package/dist/lib/form-panels/product-readiness.js +34 -0
  68. package/dist/lib/form-panels/product-readiness.js.map +1 -0
  69. package/dist/lib/form-panels/product-rev-rec-field.component.d.ts +29 -0
  70. package/dist/lib/form-panels/product-rev-rec-field.component.d.ts.map +1 -0
  71. package/dist/lib/form-panels/product-rev-rec-field.component.js +115 -0
  72. package/dist/lib/form-panels/product-rev-rec-field.component.js.map +1 -0
  73. package/dist/lib/form-panels/product-widget.panels.d.ts +12 -0
  74. package/dist/lib/form-panels/product-widget.panels.d.ts.map +1 -1
  75. package/dist/lib/form-panels/product-widget.panels.js +165 -75
  76. package/dist/lib/form-panels/product-widget.panels.js.map +1 -1
  77. package/dist/lib/form-panels/promotion-header.panel.js +2 -2
  78. package/dist/lib/form-panels/subscription-header.panel.js +2 -2
  79. package/dist/lib/form-panels/subscription-revrec.panel.js +2 -2
  80. package/dist/lib/form-panels/subscription-term-header.panel.js +2 -2
  81. package/dist/lib/form-panels/subscription-term-revrec.panel.js +2 -2
  82. package/dist/lib/form-panels/subscription-terms.panel.js +2 -2
  83. package/dist/lib/generated/Entities/mjBizAppsOrdersEventProduct/mjbizappsorderseventproduct.form.component.js +8 -6
  84. package/dist/lib/generated/Entities/mjBizAppsOrdersEventProduct/mjbizappsorderseventproduct.form.component.js.map +1 -1
  85. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderHeader/mjbizappsordersorderheader.form.component.js +107 -105
  86. package/dist/lib/generated/Entities/mjBizAppsOrdersOrderHeader/mjbizappsordersorderheader.form.component.js.map +1 -1
  87. package/dist/lib/generated/Entities/mjBizAppsOrdersProduct/mjbizappsordersproduct.form.component.js +74 -72
  88. package/dist/lib/generated/Entities/mjBizAppsOrdersProduct/mjbizappsordersproduct.form.component.js.map +1 -1
  89. package/dist/lib/pages/receivables/external-invoicing-queue.page.d.ts.map +1 -1
  90. package/dist/lib/pages/receivables/external-invoicing-queue.page.js +2 -1
  91. package/dist/lib/pages/receivables/external-invoicing-queue.page.js.map +1 -1
  92. package/dist/lib/pages/receivables/progress.page.d.ts +10 -7
  93. package/dist/lib/pages/receivables/progress.page.d.ts.map +1 -1
  94. package/dist/lib/pages/receivables/progress.page.js +20 -25
  95. package/dist/lib/pages/receivables/progress.page.js.map +1 -1
  96. package/dist/lib/panels/product-lookup-names.d.ts +29 -0
  97. package/dist/lib/panels/product-lookup-names.d.ts.map +1 -1
  98. package/dist/lib/panels/product-lookup-names.js +58 -2
  99. package/dist/lib/panels/product-lookup-names.js.map +1 -1
  100. package/package.json +7 -7
@@ -7,56 +7,153 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { ChangeDetectorRef, Component, inject } from '@angular/core';
8
8
  import { RegisterClassEx } from '@memberjunction/global';
9
9
  import { BaseFormPanel } from '@memberjunction/ng-base-forms';
10
+ import { OrdersExplainProductGLAccountsOperation, OrdersPreviewPriceOperation, } from '@mj-biz-apps/orders-entities';
10
11
  import { LoadProductListPriceLabel } from '../panels/catalog-list-price.js';
11
- import { LoadProductLookupNames } from '../panels/product-lookup-names.js';
12
+ import { ProductLookupNamesTracker, REV_REC_FROM_TYPE_LABEL } from '../panels/product-lookup-names.js';
12
13
  import { ProductAvatarIcon, ProductStatusChipClass } from './document-form.helpers.js';
14
+ import { ACTIVATION_GL_ROLES, EvaluateProductReadiness } from './product-readiness.js';
13
15
  import * as i0 from "@angular/core";
14
16
  import * as i1 from "@memberjunction/ng-base-forms";
17
+ import * as i2 from "@memberjunction/ng-ui-components";
18
+ function ProductHeaderPanel_Conditional_14_Conditional_5_Template(rf, ctx) { if (rf & 1) {
19
+ i0.ɵɵtext(0, " Save first, then activate it here, or set Status under Lifecycle. ");
20
+ } }
21
+ function ProductHeaderPanel_Conditional_14_Conditional_6_Template(rf, ctx) { if (rf & 1) {
22
+ i0.ɵɵtext(0, " Save the product before activating it. ");
23
+ } }
24
+ function ProductHeaderPanel_Conditional_14_Conditional_7_Template(rf, ctx) { if (rf & 1) {
25
+ const _r1 = i0.ɵɵgetCurrentView();
26
+ i0.ɵɵelementStart(0, "button", 21);
27
+ i0.ɵɵlistener("click", function ProductHeaderPanel_Conditional_14_Conditional_7_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.Activate()); });
28
+ i0.ɵɵelement(1, "i", 22);
29
+ i0.ɵɵtext(2);
30
+ i0.ɵɵelementEnd();
31
+ } if (rf & 2) {
32
+ const ctx_r1 = i0.ɵɵnextContext(2);
33
+ i0.ɵɵproperty("disabled", !ctx_r1.CanActivate);
34
+ i0.ɵɵadvance(2);
35
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.Activating ? "Checking\u2026" : "Activate", " ");
36
+ } }
37
+ function ProductHeaderPanel_Conditional_14_Conditional_8_For_5_Template(rf, ctx) { if (rf & 1) {
38
+ i0.ɵɵelementStart(0, "li");
39
+ i0.ɵɵtext(1);
40
+ i0.ɵɵelementEnd();
41
+ } if (rf & 2) {
42
+ const gap_r4 = ctx.$implicit;
43
+ i0.ɵɵadvance();
44
+ i0.ɵɵtextInterpolate(gap_r4);
45
+ } }
46
+ function ProductHeaderPanel_Conditional_14_Conditional_8_Template(rf, ctx) { if (rf & 1) {
47
+ const _r3 = i0.ɵɵgetCurrentView();
48
+ i0.ɵɵelementStart(0, "div", 19)(1, "p");
49
+ i0.ɵɵtext(2, "This product is not ready to sell:");
50
+ i0.ɵɵelementEnd();
51
+ i0.ɵɵelementStart(3, "ul");
52
+ i0.ɵɵrepeaterCreate(4, ProductHeaderPanel_Conditional_14_Conditional_8_For_5_Template, 2, 1, "li", null, i0.ɵɵrepeaterTrackByIdentity);
53
+ i0.ɵɵelementEnd();
54
+ i0.ɵɵelementStart(6, "p");
55
+ i0.ɵɵtext(7, "Activate it anyway? It will appear in the pickers, and lines for it may fail to price or to confirm until these are fixed.");
56
+ i0.ɵɵelementEnd();
57
+ i0.ɵɵelementStart(8, "div", 23)(9, "button", 24);
58
+ i0.ɵɵlistener("click", function ProductHeaderPanel_Conditional_14_Conditional_8_Template_button_click_9_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.CancelActivate()); });
59
+ i0.ɵɵtext(10, "Cancel");
60
+ i0.ɵɵelementEnd();
61
+ i0.ɵɵelementStart(11, "button", 25);
62
+ i0.ɵɵlistener("click", function ProductHeaderPanel_Conditional_14_Conditional_8_Template_button_click_11_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.ActivateAnyway()); });
63
+ i0.ɵɵtext(12, "Activate anyway");
64
+ i0.ɵɵelementEnd()()();
65
+ } if (rf & 2) {
66
+ const ctx_r1 = i0.ɵɵnextContext(2);
67
+ i0.ɵɵadvance(4);
68
+ i0.ɵɵrepeater(ctx_r1.Readiness.Missing);
69
+ i0.ɵɵadvance(7);
70
+ i0.ɵɵproperty("disabled", ctx_r1.Activating);
71
+ } }
72
+ function ProductHeaderPanel_Conditional_14_Conditional_9_Template(rf, ctx) { if (rf & 1) {
73
+ i0.ɵɵelementStart(0, "mj-alert", 20);
74
+ i0.ɵɵtext(1);
75
+ i0.ɵɵelementEnd();
76
+ } if (rf & 2) {
77
+ const ctx_r1 = i0.ɵɵnextContext(2);
78
+ i0.ɵɵadvance();
79
+ i0.ɵɵtextInterpolate(ctx_r1.ActivateError);
80
+ } }
15
81
  function ProductHeaderPanel_Conditional_14_Template(rf, ctx) { if (rf & 1) {
16
- i0.ɵɵelementStart(0, "p", 8);
82
+ i0.ɵɵelementStart(0, "div", 8)(1, "mj-alert", 16)(2, "span", 17)(3, "b");
83
+ i0.ɵɵtext(4, "Draft \u2014 not sellable on deals or orders.");
84
+ i0.ɵɵelementEnd();
85
+ i0.ɵɵconditionalCreate(5, ProductHeaderPanel_Conditional_14_Conditional_5_Template, 1, 0)(6, ProductHeaderPanel_Conditional_14_Conditional_6_Template, 1, 0);
86
+ i0.ɵɵelementEnd();
87
+ i0.ɵɵconditionalCreate(7, ProductHeaderPanel_Conditional_14_Conditional_7_Template, 3, 2, "button", 18);
88
+ i0.ɵɵelementEnd();
89
+ i0.ɵɵconditionalCreate(8, ProductHeaderPanel_Conditional_14_Conditional_8_Template, 13, 1, "div", 19);
90
+ i0.ɵɵconditionalCreate(9, ProductHeaderPanel_Conditional_14_Conditional_9_Template, 2, 1, "mj-alert", 20);
91
+ i0.ɵɵelementEnd();
92
+ } if (rf & 2) {
93
+ const ctx_r1 = i0.ɵɵnextContext();
94
+ i0.ɵɵadvance(5);
95
+ i0.ɵɵconditional(ctx_r1.EditMode ? 5 : !ctx_r1.Record.IsSaved ? 6 : -1);
96
+ i0.ɵɵadvance(2);
97
+ i0.ɵɵconditional(!ctx_r1.EditMode && ctx_r1.Record.IsSaved && !ctx_r1.Readiness ? 7 : -1);
98
+ i0.ɵɵadvance();
99
+ i0.ɵɵconditional(ctx_r1.Readiness ? 8 : -1);
100
+ i0.ɵɵadvance();
101
+ i0.ɵɵconditional(ctx_r1.ActivateError ? 9 : -1);
102
+ } }
103
+ function ProductHeaderPanel_Conditional_15_Template(rf, ctx) { if (rf & 1) {
104
+ i0.ɵɵelementStart(0, "p", 9);
105
+ i0.ɵɵtext(1);
106
+ i0.ɵɵelementEnd();
107
+ } if (rf & 2) {
108
+ const ctx_r1 = i0.ɵɵnextContext();
109
+ i0.ɵɵadvance();
110
+ i0.ɵɵtextInterpolate(ctx_r1.Record.Description);
111
+ } }
112
+ function ProductHeaderPanel_Conditional_27_Template(rf, ctx) { if (rf & 1) {
113
+ i0.ɵɵelementStart(0, "span", 14);
17
114
  i0.ɵɵtext(1);
18
115
  i0.ɵɵelementEnd();
19
116
  } if (rf & 2) {
20
- const ctx_r0 = i0.ɵɵnextContext();
117
+ const ctx_r1 = i0.ɵɵnextContext();
21
118
  i0.ɵɵadvance();
22
- i0.ɵɵtextInterpolate(ctx_r0.Record.Description);
119
+ i0.ɵɵtextInterpolate(ctx_r1.RevRecSource);
23
120
  } }
24
- function ProductHeaderPanel_Conditional_31_Template(rf, ctx) { if (rf & 1) {
25
- const _r2 = i0.ɵɵgetCurrentView();
26
- i0.ɵɵelementStart(0, "div", 13)(1, "div", 14)(2, "mj-form-field", 15);
27
- i0.ɵɵlistener("Navigate", function ProductHeaderPanel_Conditional_31_Template_mj_form_field_Navigate_2_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.FormComponent.OnFormNavigate($event)); });
121
+ function ProductHeaderPanel_Conditional_33_Template(rf, ctx) { if (rf & 1) {
122
+ const _r5 = i0.ɵɵgetCurrentView();
123
+ i0.ɵɵelementStart(0, "div", 15)(1, "div", 26)(2, "mj-form-field", 27);
124
+ i0.ɵɵlistener("Navigate", function ProductHeaderPanel_Conditional_33_Template_mj_form_field_Navigate_2_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.FormComponent.OnFormNavigate($event)); });
28
125
  i0.ɵɵelementEnd()();
29
- i0.ɵɵelementStart(3, "div", 14)(4, "mj-form-field", 16);
30
- i0.ɵɵlistener("Navigate", function ProductHeaderPanel_Conditional_31_Template_mj_form_field_Navigate_4_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.FormComponent.OnFormNavigate($event)); });
126
+ i0.ɵɵelementStart(3, "div", 26)(4, "mj-form-field", 28);
127
+ i0.ɵɵlistener("Navigate", function ProductHeaderPanel_Conditional_33_Template_mj_form_field_Navigate_4_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.FormComponent.OnFormNavigate($event)); });
31
128
  i0.ɵɵelementEnd()();
32
- i0.ɵɵelementStart(5, "div", 17)(6, "mj-form-field", 18);
33
- i0.ɵɵlistener("Navigate", function ProductHeaderPanel_Conditional_31_Template_mj_form_field_Navigate_6_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.FormComponent.OnFormNavigate($event)); });
129
+ i0.ɵɵelementStart(5, "div", 29)(6, "mj-form-field", 30);
130
+ i0.ɵɵlistener("Navigate", function ProductHeaderPanel_Conditional_33_Template_mj_form_field_Navigate_6_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.FormComponent.OnFormNavigate($event)); });
34
131
  i0.ɵɵelementEnd()()();
35
132
  } if (rf & 2) {
36
- const ctx_r0 = i0.ɵɵnextContext();
133
+ const ctx_r1 = i0.ɵɵnextContext();
37
134
  i0.ɵɵadvance(2);
38
- i0.ɵɵproperty("Record", ctx_r0.Record)("ShowLabel", true)("EditMode", ctx_r0.EditMode)("FormContext", ctx_r0.FormContext);
135
+ i0.ɵɵproperty("Record", ctx_r1.Record)("ShowLabel", true)("EditMode", ctx_r1.EditMode)("FormContext", ctx_r1.FormContext);
39
136
  i0.ɵɵadvance(2);
40
- i0.ɵɵproperty("Record", ctx_r0.Record)("ShowLabel", true)("EditMode", ctx_r0.EditMode)("FormContext", ctx_r0.FormContext);
137
+ i0.ɵɵproperty("Record", ctx_r1.Record)("ShowLabel", true)("EditMode", ctx_r1.EditMode)("FormContext", ctx_r1.FormContext);
41
138
  i0.ɵɵadvance(2);
42
- i0.ɵɵproperty("Record", ctx_r0.Record)("ShowLabel", true)("EditMode", ctx_r0.EditMode)("FormContext", ctx_r0.FormContext);
139
+ i0.ɵɵproperty("Record", ctx_r1.Record)("ShowLabel", true)("EditMode", ctx_r1.EditMode)("FormContext", ctx_r1.FormContext);
43
140
  } }
44
141
  let ProductHeaderPanel = class ProductHeaderPanel extends BaseFormPanel {
45
142
  ListPriceLabel = '—';
46
- /** Resolved by id — the record's virtual name fields are unreliable (Pin 28). */
47
- Lookups = { Type: '—', Category: '—', RevRec: '—', Successor: '—' };
48
143
  listPriceFor = null;
49
- /** The ids `Lookups` was resolved for; a change re-resolves, so the header follows edits. */
50
- lookupsFor = null;
51
144
  cdr = inject(ChangeDetectorRef, { optional: true });
145
+ /** Resolved by id — the record's virtual name fields are unreliable (Pin 28). Follows edits. */
146
+ lookups = new ProductLookupNamesTracker(() => this.cdr?.markForCheck());
52
147
  get Title() {
53
148
  return this.Record.Name || 'New product';
54
149
  }
55
150
  async ngOnInit() {
56
- await this.refreshLookups();
151
+ await this.lookups.Refresh(this.Record);
152
+ }
153
+ get Lookups() {
154
+ return this.lookups.For(this.Record);
57
155
  }
58
156
  get TypeName() {
59
- this.refreshLookupsIfChanged();
60
157
  return this.Lookups.Type;
61
158
  }
62
159
  get AvatarIcon() {
@@ -77,29 +174,119 @@ let ProductHeaderPanel = class ProductHeaderPanel extends BaseFormPanel {
77
174
  this.ListPriceLabel = await LoadProductListPriceLabel(productId);
78
175
  this.cdr?.markForCheck();
79
176
  }
177
+ /** The same name the Accounting section shows: the product's own type, else its type's default. */
80
178
  get RevRec() {
81
- this.refreshLookupsIfChanged();
82
179
  return this.Lookups.RevRec;
83
180
  }
84
- lookupsKey() {
85
- const r = this.Record;
86
- return [r?.ProductTypeID, r?.ProductCategoryID, r?.RevenueRecognitionTypeID, r?.SuccessorProductID].join('|');
87
- }
88
- refreshLookupsIfChanged() {
89
- if (this.lookupsFor !== null && this.lookupsFor !== this.lookupsKey())
90
- void this.refreshLookups();
91
- }
92
- async refreshLookups() {
93
- const key = this.lookupsKey();
94
- this.lookupsFor = key;
95
- const lookups = await LoadProductLookupNames(this.Record);
96
- if (this.lookupsFor !== key)
97
- return; // a newer edit started its own resolve
98
- this.Lookups = lookups;
181
+ /** Says where `RevRec` comes from when the product does not set it itself. */
182
+ get RevRecSource() {
183
+ return this.Lookups.RevRecFromType ? REV_REC_FROM_TYPE_LABEL : null;
184
+ }
185
+ // ── Draft → Active (golive#433) ───────────────────────────────────────────────────────────
186
+ //
187
+ // A Draft product is hidden from the deal and order pickers, and nothing on the form said so.
188
+ // The banner says it and offers Activate. Activate checks readiness first and warns rather than
189
+ // blocks (g433.1 A): finance may activate a product it will finish later.
190
+ /** Set while the readiness check or the save runs. */
191
+ Activating = false;
192
+ /** The gaps found, shown with Activate anyway / Cancel; null when no warning is open. */
193
+ Readiness = null;
194
+ /** The save's refusal, verbatim. */
195
+ ActivateError = null;
196
+ /** Draft is the database default, so an empty status reads as Draft too. */
197
+ get IsDraft() {
198
+ return (this.Record?.Status ?? 'Draft') === 'Draft';
199
+ }
200
+ /**
201
+ * Activate saves the record, so it is offered only outside edit mode: a save from here would
202
+ * also write whatever else the user had changed and not yet saved.
203
+ */
204
+ get CanActivate() {
205
+ return this.mayActivate && !this.Activating;
206
+ }
207
+ /** `CanActivate` without the in-flight guard, for the save that runs while `Activating` is set. */
208
+ get mayActivate() {
209
+ return this.IsDraft && !this.EditMode && !!this.Record?.IsSaved;
210
+ }
211
+ /**
212
+ * Entering edit mode closes an open readiness warning: "Activate anyway" saves the record, which
213
+ * would write the edits too. The form has no edit-mode event, so this checks on each pass.
214
+ */
215
+ ngDoCheck() {
216
+ if (this.Readiness && this.EditMode)
217
+ this.Readiness = null;
218
+ }
219
+ async Activate() {
220
+ if (!this.CanActivate)
221
+ return;
222
+ this.Activating = true;
223
+ this.ActivateError = null;
224
+ this.Readiness = null;
99
225
  this.cdr?.markForCheck();
226
+ try {
227
+ const readiness = await this.checkReadiness();
228
+ if (!readiness.Ready) {
229
+ this.Readiness = readiness;
230
+ return;
231
+ }
232
+ await this.saveActive();
233
+ }
234
+ finally {
235
+ this.Activating = false;
236
+ this.cdr?.markForCheck();
237
+ }
238
+ }
239
+ /** The user read the gaps and activates anyway. */
240
+ async ActivateAnyway() {
241
+ this.Readiness = null;
242
+ if (!this.CanActivate)
243
+ return;
244
+ this.Activating = true;
245
+ this.cdr?.markForCheck();
246
+ try {
247
+ await this.saveActive();
248
+ }
249
+ finally {
250
+ this.Activating = false;
251
+ this.cdr?.markForCheck();
252
+ }
253
+ }
254
+ CancelActivate() {
255
+ this.Readiness = null;
256
+ this.cdr?.markForCheck();
257
+ }
258
+ async checkReadiness() {
259
+ const productID = this.Record.ID;
260
+ const [price, gl] = await Promise.all([
261
+ new OrdersPreviewPriceOperation()
262
+ // A Draft product may not be sold, so pricing refuses it unless told to ignore that.
263
+ .Execute({ ProductID: productID, IgnoreSellability: true })
264
+ .then((r) => r.Success && r.Output
265
+ ? { PriceInForce: r.Output.Success, PriceMessage: r.Output.Success ? null : r.Output.Message }
266
+ : { PriceInForce: null, PriceMessage: r.ErrorMessage })
267
+ .catch((e) => ({ PriceInForce: null, PriceMessage: e instanceof Error ? e.message : String(e) })),
268
+ new OrdersExplainProductGLAccountsOperation()
269
+ .Execute({ ProductID: productID, Roles: [...ACTIVATION_GL_ROLES] })
270
+ .then((r) => r.Success && r.Output?.Success
271
+ ? { Roles: r.Output.Roles, GLError: null }
272
+ : { Roles: null, GLError: r.Output?.Message ?? r.ErrorMessage })
273
+ .catch((e) => ({ Roles: null, GLError: e instanceof Error ? e.message : String(e) })),
274
+ ]);
275
+ return EvaluateProductReadiness({ ...price, ...gl });
276
+ }
277
+ /** Refuses once the user has entered edit mode, including while the readiness check ran. */
278
+ async saveActive() {
279
+ if (!this.mayActivate)
280
+ return;
281
+ const previous = this.Record.Status;
282
+ this.Record.Status = 'Active';
283
+ if (!(await this.Record.Save())) {
284
+ this.Record.Status = previous;
285
+ this.ActivateError = this.Record.LatestResult?.CompleteMessage || 'The product could not be activated.';
286
+ }
100
287
  }
101
288
  static ɵfac = /*@__PURE__*/ (() => { let ɵProductHeaderPanel_BaseFactory; return function ProductHeaderPanel_Factory(__ngFactoryType__) { return (ɵProductHeaderPanel_BaseFactory || (ɵProductHeaderPanel_BaseFactory = i0.ɵɵgetInheritedFactory(ProductHeaderPanel)))(__ngFactoryType__ || ProductHeaderPanel); }; })();
102
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ProductHeaderPanel, selectors: [["mjo-product-header-panel"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 32, vars: 13, consts: [[1, "mjo-doc-hero"], [1, "mjo-doc-hero__identity"], [1, "mjo-doc-hero__avatar"], ["aria-hidden", "true"], [1, "mjo-doc-hero__copy"], [1, "mjo-doc-hero__title-row"], [1, "mjo-doc-hero__title"], [1, "mjo-doc-chip"], [1, "mjo-doc-hero__description"], [1, "mjo-doc-hero__stats"], [1, "mjo-doc-stat"], [1, "mjo-doc-stat__label"], [1, "mjo-doc-stat__value"], [1, "mjo-doc-hero__edit"], [1, "mjo-doc-hero__field"], ["FieldName", "Name", "Type", "textbox", 3, "Navigate", "Record", "ShowLabel", "EditMode", "FormContext"], ["FieldName", "SKU", "Type", "textbox", 3, "Navigate", "Record", "ShowLabel", "EditMode", "FormContext"], [1, "mjo-doc-hero__field", "mjo-doc-hero__field--span"], ["FieldName", "Description", "Type", "textarea", 3, "Navigate", "Record", "ShowLabel", "EditMode", "FormContext"]], template: function ProductHeaderPanel_Template(rf, ctx) { if (rf & 1) {
289
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ProductHeaderPanel, selectors: [["mjo-product-header-panel"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 34, vars: 15, consts: [[1, "mjo-doc-hero"], [1, "mjo-doc-hero__identity"], [1, "mjo-doc-hero__avatar"], ["aria-hidden", "true"], [1, "mjo-doc-hero__copy"], [1, "mjo-doc-hero__title-row"], [1, "mjo-doc-hero__title"], [1, "mjo-doc-chip"], [1, "mjo-doc-hero__draft"], [1, "mjo-doc-hero__description"], [1, "mjo-doc-hero__stats"], [1, "mjo-doc-stat"], [1, "mjo-doc-stat__label"], [1, "mjo-doc-stat__value"], [1, "mjo-doc-stat__sub"], [1, "mjo-doc-hero__edit"], ["Variant", "warning", "Size", "sm", "Icon", "fa-solid fa-circle-pause"], [1, "mjo-doc-hero__draft-text"], ["type", "button", "mjButton", "", "variant", "primary", "size", "sm", "actions", "", 3, "disabled"], [1, "mjo-doc-hero__readiness"], ["Variant", "error", "Icon", "fa-solid fa-triangle-exclamation"], ["type", "button", "mjButton", "", "variant", "primary", "size", "sm", "actions", "", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-circle-check"], [1, "mjo-doc-hero__readiness-actions"], ["type", "button", "mjButton", "", "variant", "flat", "size", "sm", 3, "click"], ["type", "button", "mjButton", "", "variant", "primary", "size", "sm", 3, "click", "disabled"], [1, "mjo-doc-hero__field"], ["FieldName", "Name", "Type", "textbox", 3, "Navigate", "Record", "ShowLabel", "EditMode", "FormContext"], ["FieldName", "SKU", "Type", "textbox", 3, "Navigate", "Record", "ShowLabel", "EditMode", "FormContext"], [1, "mjo-doc-hero__field", "mjo-doc-hero__field--span"], ["FieldName", "Description", "Type", "textarea", 3, "Navigate", "Record", "ShowLabel", "EditMode", "FormContext"]], template: function ProductHeaderPanel_Template(rf, ctx) { if (rf & 1) {
103
290
  i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2);
104
291
  i0.ɵɵelement(3, "i", 3);
105
292
  i0.ɵɵelementEnd();
@@ -115,26 +302,29 @@ let ProductHeaderPanel = class ProductHeaderPanel extends BaseFormPanel {
115
302
  i0.ɵɵelementStart(12, "span");
116
303
  i0.ɵɵtext(13);
117
304
  i0.ɵɵelementEnd()()()();
118
- i0.ɵɵconditionalCreate(14, ProductHeaderPanel_Conditional_14_Template, 2, 1, "p", 8);
119
- i0.ɵɵelementStart(15, "div", 9)(16, "div", 10)(17, "span", 11);
120
- i0.ɵɵtext(18, "List price");
305
+ i0.ɵɵconditionalCreate(14, ProductHeaderPanel_Conditional_14_Template, 10, 4, "div", 8);
306
+ i0.ɵɵconditionalCreate(15, ProductHeaderPanel_Conditional_15_Template, 2, 1, "p", 9);
307
+ i0.ɵɵelementStart(16, "div", 10)(17, "div", 11)(18, "span", 12);
308
+ i0.ɵɵtext(19, "List price");
121
309
  i0.ɵɵelementEnd();
122
- i0.ɵɵelementStart(19, "span", 12);
123
- i0.ɵɵtext(20);
310
+ i0.ɵɵelementStart(20, "span", 13);
311
+ i0.ɵɵtext(21);
124
312
  i0.ɵɵelementEnd()();
125
- i0.ɵɵelementStart(21, "div", 10)(22, "span", 11);
126
- i0.ɵɵtext(23, "Rev-rec");
313
+ i0.ɵɵelementStart(22, "div", 11)(23, "span", 12);
314
+ i0.ɵɵtext(24, "Rev-rec");
127
315
  i0.ɵɵelementEnd();
128
- i0.ɵɵelementStart(24, "span", 12);
129
- i0.ɵɵtext(25);
130
- i0.ɵɵelementEnd()();
131
- i0.ɵɵelementStart(26, "div", 10)(27, "span", 11);
132
- i0.ɵɵtext(28, "Tax");
316
+ i0.ɵɵelementStart(25, "span", 13);
317
+ i0.ɵɵtext(26);
318
+ i0.ɵɵelementEnd();
319
+ i0.ɵɵconditionalCreate(27, ProductHeaderPanel_Conditional_27_Template, 2, 1, "span", 14);
133
320
  i0.ɵɵelementEnd();
134
- i0.ɵɵelementStart(29, "span", 12);
135
- i0.ɵɵtext(30);
321
+ i0.ɵɵelementStart(28, "div", 11)(29, "span", 12);
322
+ i0.ɵɵtext(30, "Tax");
323
+ i0.ɵɵelementEnd();
324
+ i0.ɵɵelementStart(31, "span", 13);
325
+ i0.ɵɵtext(32);
136
326
  i0.ɵɵelementEnd()()();
137
- i0.ɵɵconditionalCreate(31, ProductHeaderPanel_Conditional_31_Template, 7, 12, "div", 13);
327
+ i0.ɵɵconditionalCreate(33, ProductHeaderPanel_Conditional_33_Template, 7, 12, "div", 15);
138
328
  i0.ɵɵelementEnd();
139
329
  } if (rf & 2) {
140
330
  i0.ɵɵadvance(3);
@@ -150,16 +340,20 @@ let ProductHeaderPanel = class ProductHeaderPanel extends BaseFormPanel {
150
340
  i0.ɵɵadvance();
151
341
  i0.ɵɵtextInterpolate(ctx.Record.Status || "Draft");
152
342
  i0.ɵɵadvance();
153
- i0.ɵɵconditional(!ctx.EditMode && ctx.Record.Description ? 14 : -1);
343
+ i0.ɵɵconditional(ctx.IsDraft ? 14 : -1);
344
+ i0.ɵɵadvance();
345
+ i0.ɵɵconditional(!ctx.EditMode && ctx.Record.Description ? 15 : -1);
154
346
  i0.ɵɵadvance(6);
155
347
  i0.ɵɵtextInterpolate(ctx.Price);
156
348
  i0.ɵɵadvance(5);
157
349
  i0.ɵɵtextInterpolate(ctx.RevRec);
350
+ i0.ɵɵadvance();
351
+ i0.ɵɵconditional(ctx.RevRecSource ? 27 : -1);
158
352
  i0.ɵɵadvance(5);
159
353
  i0.ɵɵtextInterpolate(ctx.Record.IsTaxable ? "Taxable" : "Exempt");
160
354
  i0.ɵɵadvance();
161
- i0.ɵɵconditional(ctx.EditMode ? 31 : -1);
162
- } }, dependencies: [i1.MjFormFieldComponent], styles: [".mjo-doc-hero[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--mj-space-4);\n padding: var(--mj-space-4) var(--mj-space-5);\n margin-bottom: var(--mj-space-4);\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-lg);\n box-shadow: var(--mj-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));\n}\n\n.mjo-doc-hero__identity[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--mj-space-4);\n min-width: 0;\n}\n\n.mjo-doc-hero__avatar[_ngcontent-%COMP%] {\n flex: none;\n width: 52px;\n height: 52px;\n border-radius: var(--mj-radius-md);\n display: flex;\n align-items: center;\n justify-content: center;\n background: color-mix(in srgb, var(--mj-brand-primary) 18%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-size: 1.25rem;\n}\n\n.mjo-doc-hero__avatar--reverse[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--mj-status-warning) 22%, var(--mj-bg-surface));\n color: var(--mj-status-warning-text);\n}\n\n.mjo-doc-hero__copy[_ngcontent-%COMP%] {\n min-width: 0;\n flex: 1;\n}\n\n.mjo-doc-hero__title-row[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--mj-space-2) var(--mj-space-3);\n}\n\n.mjo-doc-hero__title[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--mj-text-lg);\n font-weight: 700;\n color: var(--mj-text-primary);\n line-height: 1.25;\n}\n\n.mjo-doc-hero__meta[_ngcontent-%COMP%] {\n display: flex;\n flex-wrap: wrap;\n gap: var(--mj-space-3);\n color: var(--mj-text-secondary);\n font-size: var(--mj-text-sm);\n}\n\n.mjo-doc-hero__stats[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));\n gap: var(--mj-space-3);\n}\n\n.mjo-doc-stat[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n\n.mjo-doc-stat__label[_ngcontent-%COMP%] {\n font-size: var(--mj-text-xs);\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-stat__value[_ngcontent-%COMP%] {\n font-size: var(--mj-text-base);\n font-weight: 650;\n color: var(--mj-text-primary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mjo-doc-chip[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n border-radius: var(--mj-radius-sm);\n font-size: var(--mj-text-xs);\n font-weight: 600;\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-secondary);\n}\n\n.mjo-doc-chip--ok[_ngcontent-%COMP%] {\n background: var(--mj-status-success-bg);\n color: var(--mj-status-success-text);\n}\n\n.mjo-doc-chip--draft[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-secondary);\n}\n\n.mjo-doc-chip--error[_ngcontent-%COMP%] {\n background: var(--mj-status-error-bg);\n color: var(--mj-status-error-text);\n}\n\n.mjo-doc-chip--warn[_ngcontent-%COMP%] {\n background: var(--mj-status-warning-bg);\n color: var(--mj-status-warning-text);\n}\n\n.mjo-doc-chip--info[_ngcontent-%COMP%] {\n background: var(--mj-status-info-bg);\n color: var(--mj-status-info-text);\n}\n\n.mjo-doc-chip--muted[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-chip--on[_ngcontent-%COMP%] {\n background: var(--mj-status-success-bg);\n color: var(--mj-status-success-text);\n}\n\n.mjo-doc-chip--off[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-muted);\n}\n\n.mjo-terms-toolbar[_ngcontent-%COMP%] {\n display: flex;\n justify-content: flex-end;\n margin-bottom: var(--mj-space-3);\n}\n\n.mjo-term-empty[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--mj-space-2);\n padding: var(--mj-space-4);\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-stat__sub[_ngcontent-%COMP%] {\n font-size: var(--mj-text-xs);\n color: var(--mj-text-muted);\n}\n\n.mjo-ov[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--mj-space-4);\n}\n\n.mjo-ov-card[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-lg);\n box-shadow: var(--mj-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));\n min-width: 0;\n}\n\n.mjo-ov-card--wide[_ngcontent-%COMP%] {\n grid-column: 1 / -1;\n}\n\n.mjo-ov-card__h[_ngcontent-%COMP%] {\n padding: var(--mj-space-3) var(--mj-space-4) var(--mj-space-2);\n}\n\n.mjo-ov-card__h[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--mj-text-sm);\n font-weight: 700;\n display: flex;\n align-items: center;\n gap: var(--mj-space-2);\n}\n\n.mjo-ov-card__h[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n font-size: 12px;\n}\n\n.mjo-ov-card__b[_ngcontent-%COMP%] {\n padding: 4px var(--mj-space-4) var(--mj-space-4);\n}\n\n.mjo-ov-note[_ngcontent-%COMP%] {\n margin: 0 0 var(--mj-space-3);\n font-size: var(--mj-text-sm);\n color: var(--mj-text-secondary);\n line-height: 1.5;\n}\n\n.mjo-ov-facts[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--mj-space-3) var(--mj-space-4);\n}\n\n.mjo-ov-fact__l[_ngcontent-%COMP%] {\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n}\n\n.mjo-ov-fact__v[_ngcontent-%COMP%] {\n font-size: var(--mj-text-sm);\n font-weight: 650;\n color: var(--mj-text-primary);\n}\n\n.mjo-ov-table[_ngcontent-%COMP%] {\n width: 100%;\n border-collapse: collapse;\n font-size: var(--mj-text-sm);\n}\n\n.mjo-ov-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\n text-align: left;\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n padding: 6px 8px;\n border-bottom: 1px solid var(--mj-border-default);\n}\n\n.mjo-ov-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\n padding: 8px;\n border-bottom: 1px solid var(--mj-border-subtle);\n color: var(--mj-text-secondary);\n}\n\n.mjo-ov-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%] {\n border-bottom: 0;\n}\n\n.mjo-ov-row[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--mj-space-3);\n padding: 8px 0;\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.mjo-ov-row[_ngcontent-%COMP%]:last-child {\n border-bottom: 0;\n}\n\n.mjo-ov-row[_ngcontent-%COMP%] h4[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--mj-text-sm);\n font-weight: 650;\n}\n\n.mjo-ov-row[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 2px 0 0;\n font-size: 12px;\n color: var(--mj-text-secondary);\n}\n\n@media (max-width: 800px) {\n .mjo-ov[_ngcontent-%COMP%], \n .mjo-ov-facts[_ngcontent-%COMP%] {\n grid-template-columns: 1fr;\n }\n\n .mjo-ov-card--wide[_ngcontent-%COMP%] {\n grid-column: auto;\n }\n}\n\n.mjo-doc-hero__description[_ngcontent-%COMP%] {\n margin: 0;\n color: var(--mj-text-secondary);\n font-size: var(--mj-text-sm);\n line-height: 1.5;\n white-space: pre-wrap;\n}\n\n\n\n\n.mjo-doc-hero__edit[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));\n gap: var(--mj-space-3) var(--mj-space-4);\n padding-top: var(--mj-space-4);\n border-top: 1px solid var(--mj-border-subtle);\n}\n\n.mjo-doc-hero__field[_ngcontent-%COMP%] {\n min-width: 0;\n}\n\n.mjo-doc-hero__field--span[_ngcontent-%COMP%] {\n grid-column: 1 / -1;\n}\n\n\n\n\n.mjo-doc-hero__field[_ngcontent-%COMP%] .mj-forms-field {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: 4px;\n padding: 0;\n}\n\n.mjo-doc-hero__field[_ngcontent-%COMP%] .mj-forms-field-label {\n font-size: var(--mj-text-xs);\n font-weight: var(--mj-font-bold);\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-hero__field[_ngcontent-%COMP%] .mj-forms-field--editing:hover {\n margin: 0;\n padding: 0;\n}\n\n.mjo-doc-hero__field[_ngcontent-%COMP%] .mj-forms-field-control {\n width: 100%;\n}"] });
355
+ i0.ɵɵconditional(ctx.EditMode ? 33 : -1);
356
+ } }, dependencies: [i1.MjFormFieldComponent, i2.MJAlertComponent, i2.MJButtonDirective], styles: [".mjo-doc-hero[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--mj-space-4);\n padding: var(--mj-space-4) var(--mj-space-5);\n margin-bottom: var(--mj-space-4);\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-lg);\n box-shadow: var(--mj-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));\n}\n\n.mjo-doc-hero__identity[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--mj-space-4);\n min-width: 0;\n}\n\n.mjo-doc-hero__avatar[_ngcontent-%COMP%] {\n flex: none;\n width: 52px;\n height: 52px;\n border-radius: var(--mj-radius-md);\n display: flex;\n align-items: center;\n justify-content: center;\n background: color-mix(in srgb, var(--mj-brand-primary) 18%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-size: 1.25rem;\n}\n\n.mjo-doc-hero__avatar--reverse[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--mj-status-warning) 22%, var(--mj-bg-surface));\n color: var(--mj-status-warning-text);\n}\n\n.mjo-doc-hero__copy[_ngcontent-%COMP%] {\n min-width: 0;\n flex: 1;\n}\n\n.mjo-doc-hero__title-row[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--mj-space-2) var(--mj-space-3);\n}\n\n.mjo-doc-hero__title[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--mj-text-lg);\n font-weight: 700;\n color: var(--mj-text-primary);\n line-height: 1.25;\n}\n\n.mjo-doc-hero__meta[_ngcontent-%COMP%] {\n display: flex;\n flex-wrap: wrap;\n gap: var(--mj-space-3);\n color: var(--mj-text-secondary);\n font-size: var(--mj-text-sm);\n}\n\n.mjo-doc-hero__stats[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));\n gap: var(--mj-space-3);\n}\n\n.mjo-doc-stat[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n\n.mjo-doc-stat__label[_ngcontent-%COMP%] {\n font-size: var(--mj-text-xs);\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-stat__value[_ngcontent-%COMP%] {\n font-size: var(--mj-text-base);\n font-weight: 650;\n color: var(--mj-text-primary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mjo-doc-chip[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n border-radius: var(--mj-radius-sm);\n font-size: var(--mj-text-xs);\n font-weight: 600;\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-secondary);\n}\n\n.mjo-doc-chip--ok[_ngcontent-%COMP%] {\n background: var(--mj-status-success-bg);\n color: var(--mj-status-success-text);\n}\n\n.mjo-doc-chip--draft[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-secondary);\n}\n\n.mjo-doc-chip--error[_ngcontent-%COMP%] {\n background: var(--mj-status-error-bg);\n color: var(--mj-status-error-text);\n}\n\n.mjo-doc-chip--warn[_ngcontent-%COMP%] {\n background: var(--mj-status-warning-bg);\n color: var(--mj-status-warning-text);\n}\n\n.mjo-doc-chip--info[_ngcontent-%COMP%] {\n background: var(--mj-status-info-bg);\n color: var(--mj-status-info-text);\n}\n\n.mjo-doc-chip--muted[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-chip--on[_ngcontent-%COMP%] {\n background: var(--mj-status-success-bg);\n color: var(--mj-status-success-text);\n}\n\n.mjo-doc-chip--off[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-muted);\n}\n\n.mjo-terms-toolbar[_ngcontent-%COMP%] {\n display: flex;\n justify-content: flex-end;\n margin-bottom: var(--mj-space-3);\n}\n\n.mjo-term-empty[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--mj-space-2);\n padding: var(--mj-space-4);\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-stat__sub[_ngcontent-%COMP%] {\n font-size: var(--mj-text-xs);\n color: var(--mj-text-muted);\n}\n\n.mjo-ov[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--mj-space-4);\n}\n\n.mjo-ov-card[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-lg);\n box-shadow: var(--mj-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));\n min-width: 0;\n}\n\n.mjo-ov-card--wide[_ngcontent-%COMP%] {\n grid-column: 1 / -1;\n}\n\n.mjo-ov-card__h[_ngcontent-%COMP%] {\n padding: var(--mj-space-3) var(--mj-space-4) var(--mj-space-2);\n}\n\n.mjo-ov-card__h[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--mj-text-sm);\n font-weight: 700;\n display: flex;\n align-items: center;\n gap: var(--mj-space-2);\n}\n\n.mjo-ov-card__h[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n font-size: 12px;\n}\n\n.mjo-ov-card__b[_ngcontent-%COMP%] {\n padding: 4px var(--mj-space-4) var(--mj-space-4);\n}\n\n.mjo-ov-note[_ngcontent-%COMP%] {\n margin: 0 0 var(--mj-space-3);\n font-size: var(--mj-text-sm);\n color: var(--mj-text-secondary);\n line-height: 1.5;\n}\n\n.mjo-ov-facts[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--mj-space-3) var(--mj-space-4);\n}\n\n.mjo-ov-fact__l[_ngcontent-%COMP%] {\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n}\n\n.mjo-ov-fact__v[_ngcontent-%COMP%] {\n font-size: var(--mj-text-sm);\n font-weight: 650;\n color: var(--mj-text-primary);\n}\n\n.mjo-ov-table[_ngcontent-%COMP%] {\n width: 100%;\n border-collapse: collapse;\n font-size: var(--mj-text-sm);\n}\n\n.mjo-ov-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%] {\n text-align: left;\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n padding: 6px 8px;\n border-bottom: 1px solid var(--mj-border-default);\n}\n\n.mjo-ov-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%] {\n padding: 8px;\n border-bottom: 1px solid var(--mj-border-subtle);\n color: var(--mj-text-secondary);\n}\n\n.mjo-ov-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%] {\n border-bottom: 0;\n}\n\n.mjo-ov-row[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--mj-space-3);\n padding: 8px 0;\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.mjo-ov-row[_ngcontent-%COMP%]:last-child {\n border-bottom: 0;\n}\n\n.mjo-ov-row[_ngcontent-%COMP%] h4[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--mj-text-sm);\n font-weight: 650;\n}\n\n.mjo-ov-row[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 2px 0 0;\n font-size: 12px;\n color: var(--mj-text-secondary);\n}\n\n@media (max-width: 800px) {\n .mjo-ov[_ngcontent-%COMP%], \n .mjo-ov-facts[_ngcontent-%COMP%] {\n grid-template-columns: 1fr;\n }\n\n .mjo-ov-card--wide[_ngcontent-%COMP%] {\n grid-column: auto;\n }\n}\n\n.mjo-doc-hero__description[_ngcontent-%COMP%] {\n margin: 0;\n color: var(--mj-text-secondary);\n font-size: var(--mj-text-sm);\n line-height: 1.5;\n white-space: pre-wrap;\n}\n\n\n\n\n.mjo-doc-hero__edit[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));\n gap: var(--mj-space-3) var(--mj-space-4);\n padding-top: var(--mj-space-4);\n border-top: 1px solid var(--mj-border-subtle);\n}\n\n.mjo-doc-hero__field[_ngcontent-%COMP%] {\n min-width: 0;\n}\n\n.mjo-doc-hero__field--span[_ngcontent-%COMP%] {\n grid-column: 1 / -1;\n}\n\n\n\n\n.mjo-doc-hero__field[_ngcontent-%COMP%] .mj-forms-field {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: 4px;\n padding: 0;\n}\n\n.mjo-doc-hero__field[_ngcontent-%COMP%] .mj-forms-field-label {\n font-size: var(--mj-text-xs);\n font-weight: var(--mj-font-bold);\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-hero__field[_ngcontent-%COMP%] .mj-forms-field--editing:hover {\n margin: 0;\n padding: 0;\n}\n\n.mjo-doc-hero__field[_ngcontent-%COMP%] .mj-forms-field-control {\n width: 100%;\n}\n\n\n\n.mjo-doc-hero__draft[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin-top: 12px;\n}\n\n.mjo-doc-hero__readiness[_ngcontent-%COMP%] {\n border: 1px solid var(--mj-status-warning-border, #e8c27a);\n border-radius: 6px;\n padding: 10px 12px;\n font-size: 13px;\n}\n\n.mjo-doc-hero__readiness[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 0 0 6px;\n}\n\n.mjo-doc-hero__readiness[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] {\n margin: 0 0 8px;\n padding-left: 18px;\n}\n\n.mjo-doc-hero__readiness-actions[_ngcontent-%COMP%] {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}"] });
163
357
  };
164
358
  ProductHeaderPanel = __decorate([
165
359
  RegisterClassEx(BaseFormPanel, {
@@ -176,7 +370,7 @@ ProductHeaderPanel = __decorate([
176
370
  export { ProductHeaderPanel };
177
371
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ProductHeaderPanel, [{
178
372
  type: Component,
179
- args: [{ standalone: false, selector: 'mjo-product-header-panel', template: "<div class=\"mjo-doc-hero\">\n <div class=\"mjo-doc-hero__identity\">\n <div class=\"mjo-doc-hero__avatar\">\n <i [class]=\"AvatarIcon\" aria-hidden=\"true\"></i>\n </div>\n <div class=\"mjo-doc-hero__copy\">\n <div class=\"mjo-doc-hero__title-row\">\n <h1 class=\"mjo-doc-hero__title\">{{ Title }}</h1>\n <span class=\"mjo-doc-chip\">{{ Record.SKU || 'SKU TBD' }}</span>\n <span class=\"mjo-doc-chip\">{{ TypeName }}</span>\n <span [class]=\"StatusClass\">{{ Record.Status || 'Draft' }}</span>\n </div>\n </div>\n </div>\n @if (!EditMode && Record.Description) {\n <p class=\"mjo-doc-hero__description\">{{ Record.Description }}</p>\n }\n <div class=\"mjo-doc-hero__stats\">\n <div class=\"mjo-doc-stat\">\n <span class=\"mjo-doc-stat__label\">List price</span>\n <span class=\"mjo-doc-stat__value\">{{ Price }}</span>\n </div>\n <div class=\"mjo-doc-stat\">\n <span class=\"mjo-doc-stat__label\">Rev-rec</span>\n <span class=\"mjo-doc-stat__value\">{{ RevRec }}</span>\n </div>\n <div class=\"mjo-doc-stat\">\n <span class=\"mjo-doc-stat__label\">Tax</span>\n <span class=\"mjo-doc-stat__value\">{{ Record.IsTaxable ? 'Taxable' : 'Exempt' }}</span>\n </div>\n </div>\n <!-- This panel claims the generated `productIdentification` section, so it OWNS\n Name, SKU and Description: they render nowhere else on the form. Editing them\n has to live here, or the section's only fields are unreachable and a product\n can never be named. Same contract the Common identity headers honor. -->\n @if (EditMode) {\n <div class=\"mjo-doc-hero__edit\">\n <div class=\"mjo-doc-hero__field\">\n <mj-form-field [Record]=\"Record\" [ShowLabel]=\"true\" FieldName=\"Name\"\n Type=\"textbox\" [EditMode]=\"EditMode\" [FormContext]=\"FormContext\"\n (Navigate)=\"FormComponent.OnFormNavigate($event)\"></mj-form-field>\n </div>\n <div class=\"mjo-doc-hero__field\">\n <mj-form-field [Record]=\"Record\" [ShowLabel]=\"true\" FieldName=\"SKU\"\n Type=\"textbox\" [EditMode]=\"EditMode\" [FormContext]=\"FormContext\"\n (Navigate)=\"FormComponent.OnFormNavigate($event)\"></mj-form-field>\n </div>\n <div class=\"mjo-doc-hero__field mjo-doc-hero__field--span\">\n <mj-form-field [Record]=\"Record\" [ShowLabel]=\"true\" FieldName=\"Description\"\n Type=\"textarea\" [EditMode]=\"EditMode\" [FormContext]=\"FormContext\"\n (Navigate)=\"FormComponent.OnFormNavigate($event)\"></mj-form-field>\n </div>\n </div>\n }\n</div>\n", styles: [".mjo-doc-hero {\n display: flex;\n flex-direction: column;\n gap: var(--mj-space-4);\n padding: var(--mj-space-4) var(--mj-space-5);\n margin-bottom: var(--mj-space-4);\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-lg);\n box-shadow: var(--mj-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));\n}\n\n.mjo-doc-hero__identity {\n display: flex;\n align-items: center;\n gap: var(--mj-space-4);\n min-width: 0;\n}\n\n.mjo-doc-hero__avatar {\n flex: none;\n width: 52px;\n height: 52px;\n border-radius: var(--mj-radius-md);\n display: flex;\n align-items: center;\n justify-content: center;\n background: color-mix(in srgb, var(--mj-brand-primary) 18%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-size: 1.25rem;\n}\n\n.mjo-doc-hero__avatar--reverse {\n background: color-mix(in srgb, var(--mj-status-warning) 22%, var(--mj-bg-surface));\n color: var(--mj-status-warning-text);\n}\n\n.mjo-doc-hero__copy {\n min-width: 0;\n flex: 1;\n}\n\n.mjo-doc-hero__title-row {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--mj-space-2) var(--mj-space-3);\n}\n\n.mjo-doc-hero__title {\n margin: 0;\n font-size: var(--mj-text-lg);\n font-weight: 700;\n color: var(--mj-text-primary);\n line-height: 1.25;\n}\n\n.mjo-doc-hero__meta {\n display: flex;\n flex-wrap: wrap;\n gap: var(--mj-space-3);\n color: var(--mj-text-secondary);\n font-size: var(--mj-text-sm);\n}\n\n.mjo-doc-hero__stats {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));\n gap: var(--mj-space-3);\n}\n\n.mjo-doc-stat {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n\n.mjo-doc-stat__label {\n font-size: var(--mj-text-xs);\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-stat__value {\n font-size: var(--mj-text-base);\n font-weight: 650;\n color: var(--mj-text-primary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mjo-doc-chip {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n border-radius: var(--mj-radius-sm);\n font-size: var(--mj-text-xs);\n font-weight: 600;\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-secondary);\n}\n\n.mjo-doc-chip--ok {\n background: var(--mj-status-success-bg);\n color: var(--mj-status-success-text);\n}\n\n.mjo-doc-chip--draft {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-secondary);\n}\n\n.mjo-doc-chip--error {\n background: var(--mj-status-error-bg);\n color: var(--mj-status-error-text);\n}\n\n.mjo-doc-chip--warn {\n background: var(--mj-status-warning-bg);\n color: var(--mj-status-warning-text);\n}\n\n.mjo-doc-chip--info {\n background: var(--mj-status-info-bg);\n color: var(--mj-status-info-text);\n}\n\n.mjo-doc-chip--muted {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-chip--on {\n background: var(--mj-status-success-bg);\n color: var(--mj-status-success-text);\n}\n\n.mjo-doc-chip--off {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-muted);\n}\n\n.mjo-terms-toolbar {\n display: flex;\n justify-content: flex-end;\n margin-bottom: var(--mj-space-3);\n}\n\n.mjo-term-empty {\n display: flex;\n align-items: center;\n gap: var(--mj-space-2);\n padding: var(--mj-space-4);\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-stat__sub {\n font-size: var(--mj-text-xs);\n color: var(--mj-text-muted);\n}\n\n.mjo-ov {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--mj-space-4);\n}\n\n.mjo-ov-card {\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-lg);\n box-shadow: var(--mj-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));\n min-width: 0;\n}\n\n.mjo-ov-card--wide {\n grid-column: 1 / -1;\n}\n\n.mjo-ov-card__h {\n padding: var(--mj-space-3) var(--mj-space-4) var(--mj-space-2);\n}\n\n.mjo-ov-card__h h3 {\n margin: 0;\n font-size: var(--mj-text-sm);\n font-weight: 700;\n display: flex;\n align-items: center;\n gap: var(--mj-space-2);\n}\n\n.mjo-ov-card__h i {\n color: var(--mj-brand-primary);\n font-size: 12px;\n}\n\n.mjo-ov-card__b {\n padding: 4px var(--mj-space-4) var(--mj-space-4);\n}\n\n.mjo-ov-note {\n margin: 0 0 var(--mj-space-3);\n font-size: var(--mj-text-sm);\n color: var(--mj-text-secondary);\n line-height: 1.5;\n}\n\n.mjo-ov-facts {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--mj-space-3) var(--mj-space-4);\n}\n\n.mjo-ov-fact__l {\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n}\n\n.mjo-ov-fact__v {\n font-size: var(--mj-text-sm);\n font-weight: 650;\n color: var(--mj-text-primary);\n}\n\n.mjo-ov-table {\n width: 100%;\n border-collapse: collapse;\n font-size: var(--mj-text-sm);\n}\n\n.mjo-ov-table th {\n text-align: left;\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n padding: 6px 8px;\n border-bottom: 1px solid var(--mj-border-default);\n}\n\n.mjo-ov-table td {\n padding: 8px;\n border-bottom: 1px solid var(--mj-border-subtle);\n color: var(--mj-text-secondary);\n}\n\n.mjo-ov-table tr:last-child td {\n border-bottom: 0;\n}\n\n.mjo-ov-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--mj-space-3);\n padding: 8px 0;\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.mjo-ov-row:last-child {\n border-bottom: 0;\n}\n\n.mjo-ov-row h4 {\n margin: 0;\n font-size: var(--mj-text-sm);\n font-weight: 650;\n}\n\n.mjo-ov-row p {\n margin: 2px 0 0;\n font-size: 12px;\n color: var(--mj-text-secondary);\n}\n\n@media (max-width: 800px) {\n .mjo-ov,\n .mjo-ov-facts {\n grid-template-columns: 1fr;\n }\n\n .mjo-ov-card--wide {\n grid-column: auto;\n }\n}\n\n.mjo-doc-hero__description {\n margin: 0;\n color: var(--mj-text-secondary);\n font-size: var(--mj-text-sm);\n line-height: 1.5;\n white-space: pre-wrap;\n}\n\n/* mj-form-field is display: contents \u2014 its label and control would otherwise\n become direct children of this grid. Each field sits in a wrapping cell. */\n.mjo-doc-hero__edit {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));\n gap: var(--mj-space-3) var(--mj-space-4);\n padding-top: var(--mj-space-4);\n border-top: 1px solid var(--mj-border-subtle);\n}\n\n.mjo-doc-hero__field {\n min-width: 0;\n}\n\n.mjo-doc-hero__field--span {\n grid-column: 1 / -1;\n}\n\n/* Label above the control. The shared field is a 200px | 1fr row, which needs\n ~28rem per field \u2014 far more than a hero column gets. */\n.mjo-doc-hero__field ::ng-deep .mj-forms-field {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: 4px;\n padding: 0;\n}\n\n.mjo-doc-hero__field ::ng-deep .mj-forms-field-label {\n font-size: var(--mj-text-xs);\n font-weight: var(--mj-font-bold);\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-hero__field ::ng-deep .mj-forms-field--editing:hover {\n margin: 0;\n padding: 0;\n}\n\n.mjo-doc-hero__field ::ng-deep .mj-forms-field-control {\n width: 100%;\n}\n"] }]
373
+ args: [{ standalone: false, selector: 'mjo-product-header-panel', template: "<div class=\"mjo-doc-hero\">\n <div class=\"mjo-doc-hero__identity\">\n <div class=\"mjo-doc-hero__avatar\">\n <i [class]=\"AvatarIcon\" aria-hidden=\"true\"></i>\n </div>\n <div class=\"mjo-doc-hero__copy\">\n <div class=\"mjo-doc-hero__title-row\">\n <h1 class=\"mjo-doc-hero__title\">{{ Title }}</h1>\n <span class=\"mjo-doc-chip\">{{ Record.SKU || 'SKU TBD' }}</span>\n <span class=\"mjo-doc-chip\">{{ TypeName }}</span>\n <span [class]=\"StatusClass\">{{ Record.Status || 'Draft' }}</span>\n </div>\n </div>\n </div>\n <!--\n golive#433 \u2014 a Draft product is hidden from the deal and order pickers without a word, so the\n header says so and offers Activate. Activate checks for a price in force today and for Sales\n and Deferred Revenue accounts, and warns rather than blocks (g433.1 A).\n -->\n @if (IsDraft) {\n <div class=\"mjo-doc-hero__draft\">\n <mj-alert Variant=\"warning\" Size=\"sm\" Icon=\"fa-solid fa-circle-pause\">\n <span class=\"mjo-doc-hero__draft-text\">\n <b>Draft \u2014 not sellable on deals or orders.</b>\n @if (EditMode) {\n Save first, then activate it here, or set Status under Lifecycle.\n } @else if (!Record.IsSaved) {\n Save the product before activating it.\n }\n </span>\n @if (!EditMode && Record.IsSaved && !Readiness) {\n <button type=\"button\" mjButton variant=\"primary\" size=\"sm\" actions\n [disabled]=\"!CanActivate\" (click)=\"Activate()\">\n <i class=\"fa-solid fa-circle-check\" aria-hidden=\"true\"></i>\n {{ Activating ? 'Checking\u2026' : 'Activate' }}\n </button>\n }\n </mj-alert>\n @if (Readiness) {\n <div class=\"mjo-doc-hero__readiness\">\n <p>This product is not ready to sell:</p>\n <ul>\n @for (gap of Readiness.Missing; track gap) {\n <li>{{ gap }}</li>\n }\n </ul>\n <p>Activate it anyway? It will appear in the pickers, and lines for it may fail to price or to confirm until these are fixed.</p>\n <div class=\"mjo-doc-hero__readiness-actions\">\n <button type=\"button\" mjButton variant=\"flat\" size=\"sm\" (click)=\"CancelActivate()\">Cancel</button>\n <button type=\"button\" mjButton variant=\"primary\" size=\"sm\" [disabled]=\"Activating\" (click)=\"ActivateAnyway()\">Activate anyway</button>\n </div>\n </div>\n }\n @if (ActivateError) {\n <mj-alert Variant=\"error\" Icon=\"fa-solid fa-triangle-exclamation\">{{ ActivateError }}</mj-alert>\n }\n </div>\n }\n @if (!EditMode && Record.Description) {\n <p class=\"mjo-doc-hero__description\">{{ Record.Description }}</p>\n }\n <div class=\"mjo-doc-hero__stats\">\n <div class=\"mjo-doc-stat\">\n <span class=\"mjo-doc-stat__label\">List price</span>\n <span class=\"mjo-doc-stat__value\">{{ Price }}</span>\n </div>\n <div class=\"mjo-doc-stat\">\n <span class=\"mjo-doc-stat__label\">Rev-rec</span>\n <span class=\"mjo-doc-stat__value\">{{ RevRec }}</span>\n @if (RevRecSource) {\n <span class=\"mjo-doc-stat__sub\">{{ RevRecSource }}</span>\n }\n </div>\n <div class=\"mjo-doc-stat\">\n <span class=\"mjo-doc-stat__label\">Tax</span>\n <span class=\"mjo-doc-stat__value\">{{ Record.IsTaxable ? 'Taxable' : 'Exempt' }}</span>\n </div>\n </div>\n <!-- This panel claims the generated `productIdentification` section, so it OWNS\n Name, SKU and Description: they render nowhere else on the form. Editing them\n has to live here, or the section's only fields are unreachable and a product\n can never be named. Same contract the Common identity headers honor. -->\n @if (EditMode) {\n <div class=\"mjo-doc-hero__edit\">\n <div class=\"mjo-doc-hero__field\">\n <mj-form-field [Record]=\"Record\" [ShowLabel]=\"true\" FieldName=\"Name\"\n Type=\"textbox\" [EditMode]=\"EditMode\" [FormContext]=\"FormContext\"\n (Navigate)=\"FormComponent.OnFormNavigate($event)\"></mj-form-field>\n </div>\n <div class=\"mjo-doc-hero__field\">\n <mj-form-field [Record]=\"Record\" [ShowLabel]=\"true\" FieldName=\"SKU\"\n Type=\"textbox\" [EditMode]=\"EditMode\" [FormContext]=\"FormContext\"\n (Navigate)=\"FormComponent.OnFormNavigate($event)\"></mj-form-field>\n </div>\n <div class=\"mjo-doc-hero__field mjo-doc-hero__field--span\">\n <mj-form-field [Record]=\"Record\" [ShowLabel]=\"true\" FieldName=\"Description\"\n Type=\"textarea\" [EditMode]=\"EditMode\" [FormContext]=\"FormContext\"\n (Navigate)=\"FormComponent.OnFormNavigate($event)\"></mj-form-field>\n </div>\n </div>\n }\n</div>\n", styles: [".mjo-doc-hero {\n display: flex;\n flex-direction: column;\n gap: var(--mj-space-4);\n padding: var(--mj-space-4) var(--mj-space-5);\n margin-bottom: var(--mj-space-4);\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-lg);\n box-shadow: var(--mj-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));\n}\n\n.mjo-doc-hero__identity {\n display: flex;\n align-items: center;\n gap: var(--mj-space-4);\n min-width: 0;\n}\n\n.mjo-doc-hero__avatar {\n flex: none;\n width: 52px;\n height: 52px;\n border-radius: var(--mj-radius-md);\n display: flex;\n align-items: center;\n justify-content: center;\n background: color-mix(in srgb, var(--mj-brand-primary) 18%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-size: 1.25rem;\n}\n\n.mjo-doc-hero__avatar--reverse {\n background: color-mix(in srgb, var(--mj-status-warning) 22%, var(--mj-bg-surface));\n color: var(--mj-status-warning-text);\n}\n\n.mjo-doc-hero__copy {\n min-width: 0;\n flex: 1;\n}\n\n.mjo-doc-hero__title-row {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: var(--mj-space-2) var(--mj-space-3);\n}\n\n.mjo-doc-hero__title {\n margin: 0;\n font-size: var(--mj-text-lg);\n font-weight: 700;\n color: var(--mj-text-primary);\n line-height: 1.25;\n}\n\n.mjo-doc-hero__meta {\n display: flex;\n flex-wrap: wrap;\n gap: var(--mj-space-3);\n color: var(--mj-text-secondary);\n font-size: var(--mj-text-sm);\n}\n\n.mjo-doc-hero__stats {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));\n gap: var(--mj-space-3);\n}\n\n.mjo-doc-stat {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n\n.mjo-doc-stat__label {\n font-size: var(--mj-text-xs);\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-stat__value {\n font-size: var(--mj-text-base);\n font-weight: 650;\n color: var(--mj-text-primary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mjo-doc-chip {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 2px 8px;\n border-radius: var(--mj-radius-sm);\n font-size: var(--mj-text-xs);\n font-weight: 600;\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-secondary);\n}\n\n.mjo-doc-chip--ok {\n background: var(--mj-status-success-bg);\n color: var(--mj-status-success-text);\n}\n\n.mjo-doc-chip--draft {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-secondary);\n}\n\n.mjo-doc-chip--error {\n background: var(--mj-status-error-bg);\n color: var(--mj-status-error-text);\n}\n\n.mjo-doc-chip--warn {\n background: var(--mj-status-warning-bg);\n color: var(--mj-status-warning-text);\n}\n\n.mjo-doc-chip--info {\n background: var(--mj-status-info-bg);\n color: var(--mj-status-info-text);\n}\n\n.mjo-doc-chip--muted {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-chip--on {\n background: var(--mj-status-success-bg);\n color: var(--mj-status-success-text);\n}\n\n.mjo-doc-chip--off {\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-muted);\n}\n\n.mjo-terms-toolbar {\n display: flex;\n justify-content: flex-end;\n margin-bottom: var(--mj-space-3);\n}\n\n.mjo-term-empty {\n display: flex;\n align-items: center;\n gap: var(--mj-space-2);\n padding: var(--mj-space-4);\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-stat__sub {\n font-size: var(--mj-text-xs);\n color: var(--mj-text-muted);\n}\n\n.mjo-ov {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--mj-space-4);\n}\n\n.mjo-ov-card {\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-lg);\n box-shadow: var(--mj-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));\n min-width: 0;\n}\n\n.mjo-ov-card--wide {\n grid-column: 1 / -1;\n}\n\n.mjo-ov-card__h {\n padding: var(--mj-space-3) var(--mj-space-4) var(--mj-space-2);\n}\n\n.mjo-ov-card__h h3 {\n margin: 0;\n font-size: var(--mj-text-sm);\n font-weight: 700;\n display: flex;\n align-items: center;\n gap: var(--mj-space-2);\n}\n\n.mjo-ov-card__h i {\n color: var(--mj-brand-primary);\n font-size: 12px;\n}\n\n.mjo-ov-card__b {\n padding: 4px var(--mj-space-4) var(--mj-space-4);\n}\n\n.mjo-ov-note {\n margin: 0 0 var(--mj-space-3);\n font-size: var(--mj-text-sm);\n color: var(--mj-text-secondary);\n line-height: 1.5;\n}\n\n.mjo-ov-facts {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--mj-space-3) var(--mj-space-4);\n}\n\n.mjo-ov-fact__l {\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n}\n\n.mjo-ov-fact__v {\n font-size: var(--mj-text-sm);\n font-weight: 650;\n color: var(--mj-text-primary);\n}\n\n.mjo-ov-table {\n width: 100%;\n border-collapse: collapse;\n font-size: var(--mj-text-sm);\n}\n\n.mjo-ov-table th {\n text-align: left;\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n padding: 6px 8px;\n border-bottom: 1px solid var(--mj-border-default);\n}\n\n.mjo-ov-table td {\n padding: 8px;\n border-bottom: 1px solid var(--mj-border-subtle);\n color: var(--mj-text-secondary);\n}\n\n.mjo-ov-table tr:last-child td {\n border-bottom: 0;\n}\n\n.mjo-ov-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--mj-space-3);\n padding: 8px 0;\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.mjo-ov-row:last-child {\n border-bottom: 0;\n}\n\n.mjo-ov-row h4 {\n margin: 0;\n font-size: var(--mj-text-sm);\n font-weight: 650;\n}\n\n.mjo-ov-row p {\n margin: 2px 0 0;\n font-size: 12px;\n color: var(--mj-text-secondary);\n}\n\n@media (max-width: 800px) {\n .mjo-ov,\n .mjo-ov-facts {\n grid-template-columns: 1fr;\n }\n\n .mjo-ov-card--wide {\n grid-column: auto;\n }\n}\n\n.mjo-doc-hero__description {\n margin: 0;\n color: var(--mj-text-secondary);\n font-size: var(--mj-text-sm);\n line-height: 1.5;\n white-space: pre-wrap;\n}\n\n/* mj-form-field is display: contents \u2014 its label and control would otherwise\n become direct children of this grid. Each field sits in a wrapping cell. */\n.mjo-doc-hero__edit {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));\n gap: var(--mj-space-3) var(--mj-space-4);\n padding-top: var(--mj-space-4);\n border-top: 1px solid var(--mj-border-subtle);\n}\n\n.mjo-doc-hero__field {\n min-width: 0;\n}\n\n.mjo-doc-hero__field--span {\n grid-column: 1 / -1;\n}\n\n/* Label above the control. The shared field is a 200px | 1fr row, which needs\n ~28rem per field \u2014 far more than a hero column gets. */\n.mjo-doc-hero__field ::ng-deep .mj-forms-field {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: 4px;\n padding: 0;\n}\n\n.mjo-doc-hero__field ::ng-deep .mj-forms-field-label {\n font-size: var(--mj-text-xs);\n font-weight: var(--mj-font-bold);\n letter-spacing: 0.06em;\n text-transform: uppercase;\n color: var(--mj-text-muted);\n}\n\n.mjo-doc-hero__field ::ng-deep .mj-forms-field--editing:hover {\n margin: 0;\n padding: 0;\n}\n\n.mjo-doc-hero__field ::ng-deep .mj-forms-field-control {\n width: 100%;\n}\n\n/* golive#433 \u2014 the Draft banner and the readiness warning under it. */\n.mjo-doc-hero__draft {\n display: flex;\n flex-direction: column;\n gap: 8px;\n margin-top: 12px;\n}\n\n.mjo-doc-hero__readiness {\n border: 1px solid var(--mj-status-warning-border, #e8c27a);\n border-radius: 6px;\n padding: 10px 12px;\n font-size: 13px;\n}\n\n.mjo-doc-hero__readiness p {\n margin: 0 0 6px;\n}\n\n.mjo-doc-hero__readiness ul {\n margin: 0 0 8px;\n padding-left: 18px;\n}\n\n.mjo-doc-hero__readiness-actions {\n display: flex;\n justify-content: flex-end;\n gap: 8px;\n}\n"] }]
180
374
  }], null, null); })();
181
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ProductHeaderPanel, { className: "ProductHeaderPanel", filePath: "lib/form-panels/product-header.panel.ts", lineNumber: 25 }); })();
375
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ProductHeaderPanel, { className: "ProductHeaderPanel", filePath: "lib/form-panels/product-header.panel.ts", lineNumber: 30 }); })();
182
376
  //# sourceMappingURL=product-header.panel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"product-header.panel.js","sourceRoot":"","sources":["../../../src/lib/form-panels/product-header.panel.ts","../../../src/lib/form-panels/product-header.panel.html"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAE9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAA2B,MAAM,gCAAgC,CAAC;AACjG,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;;;;ICS5E,4BAAqC;IAAA,YAAwB;IAAA,iBAAI;;;IAA5B,cAAwB;IAAxB,+CAAwB;;;;IAuBrD,AADJ,AADJ,+BAAgC,cACK,wBAGyB;IAAlD,0MAAY,2CAAoC,KAAC;IACzD,AAD0D,iBAAgB,EACpE;IAEF,AADJ,+BAAiC,wBAGyB;IAAlD,0MAAY,2CAAoC,KAAC;IACzD,AAD0D,iBAAgB,EACpE;IAEF,AADJ,+BAA2D,wBAGD;IAAlD,0MAAY,2CAAoC,KAAC;IAE7D,AADI,AAD0D,iBAAgB,EACpE,EACJ;;;IAdiB,eAAiB;IACS,AAAtB,AADc,AAAlB,sCAAiB,mBAAmB,6BACX,mCAA4B;IAIrD,eAAiB;IACS,AAAtB,AADc,AAAlB,sCAAiB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AI3B,kBAAkB"}
1
+ {"version":3,"file":"product-header.panel.js","sourceRoot":"","sources":["../../../src/lib/form-panels/product-header.panel.ts","../../../src/lib/form-panels/product-header.panel.html"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAmB,MAAM,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EACH,uCAAuC,EACvC,2BAA2B,GAE9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAA2B,MAAM,gCAAgC,CAAC;AAC7H,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,wBAAwB,EAAyB,MAAM,qBAAqB,CAAC;;;;;ICcnF,mFACJ;;;IACI,wDACJ;;;;IAGA,kCACmD;IAArB,sMAAS,iBAAU,KAAC;IAC9C,wBAA2D;IAC3D,YACJ;IAAA,iBAAS;;;IAHL,8CAAyB;IAEzB,eACJ;IADI,kFACJ;;;IAQQ,0BAAI;IAAA,YAAS;IAAA,iBAAK;;;IAAd,cAAS;IAAT,4BAAS;;;;IAHrB,AADJ,+BAAqC,QAC9B;IAAA,kDAAkC;IAAA,iBAAI;IACzC,0BAAI;IACA,sIAEC;IACL,iBAAK;IACL,yBAAG;IAAA,0IAA0H;IAAA,iBAAI;IAE7H,AADJ,+BAA6C,iBAC0C;IAA3B,sMAAS,uBAAgB,KAAC;IAAC,uBAAM;IAAA,iBAAS;IAClG,mCAA8G;IAA3B,uMAAS,uBAAgB,KAAC;IAAC,gCAAe;IAErI,AADI,AADiI,iBAAS,EACpI,EACJ;;;IATE,eAEC;IAFD,uCAEC;IAK0D,eAAuB;IAAvB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O,EACpF,EACJ;YAKN,wFAAgB;YAmBpB,iBAAM;;YAlGS,eAAoB;YAApB,6BAAoB;YAIa,eAAW;YAAX,+BAAW;YAChB,eAA6B;YAA7B,iDAA6B;YAC7B,eAAc;YAAd,kCAAc;YACnC,cAAqB;YAArB,8BAAqB;YAAC,cAA8B;YAA9B,kDAA8B;YAStE,cAsCC;YAtCD,uCAsCC;YACD,cAEC;YAFD,mEAEC;YAIyC,eAAW;YAAX,+BAAW;YAIX,eAAY;YAAZ,gCAAY;YAC9C,cAEC;YAFD,4CAEC;YAIiC,eAA6C;YAA7C,iEAA6C;YAOvF,cAkBC;YAlBD,wCAkBC;;;ADvEQ,kBAAkB;IAhB9B,eAAe,CAAC,aAAa,EAAE;QAC5B,GAAG,EAAE,4BAA4B;QACjC,QAAQ,EAAE;YACN,MAAM,EAAE,6BAA6B;YACrC,IAAI,EAAE,eAAe;YACrB,OAAO,EAAE,GAAG;YACZ,eAAe,EAAE,QAAQ;YACzB,kBAAkB,EAAE,uBAAuB;SAC9C;KACJ,CAAC;GAOW,kBAAkB,CAsK9B;;iFAtKY,kBAAkB;cAN9B,SAAS;6BACM,KAAK,YACP,0BAA0B;;kFAI3B,kBAAkB"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Is a Draft product ready to sell? (golive#433, g433.1 A: warn but allow.)
3
+ *
4
+ * Activating a product puts it in the deal and order pickers. Two gaps then fail at a bad moment: a
5
+ * product with no price in force cannot be priced on a line, and a product whose Sales or Deferred
6
+ * Revenue role resolves to no GL account is refused at confirm. The header checks both before it
7
+ * activates, lists what is missing, and lets the user activate anyway.
8
+ *
9
+ * Both answers come from the server: the price from `Orders.PreviewPrice` (the pricing walk a line
10
+ * uses) and the accounts from `Orders.ExplainProductGLAccounts` (the walk confirm books through).
11
+ * This file only reads their results.
12
+ */
13
+ import type { ExplainedGLRole } from '@mj-biz-apps/orders-entities';
14
+ /** The roles activation checks: what every product's revenue books to. */
15
+ export declare const ACTIVATION_GL_ROLES: readonly ["Sales", "Deferred Revenue"];
16
+ /** What the two checks returned. A check that could not run carries its error instead. */
17
+ export interface ProductReadinessInputs {
18
+ /** True when a price resolved for today, false when pricing refused; null when the check failed. */
19
+ PriceInForce: boolean | null;
20
+ /** Pricing's refusal, or the error that stopped the check. */
21
+ PriceMessage?: string | null;
22
+ /** The explained roles; null when the check failed. */
23
+ Roles: readonly ExplainedGLRole[] | null;
24
+ /** The error that stopped the account check. */
25
+ GLError?: string | null;
26
+ }
27
+ export interface ProductReadiness {
28
+ Ready: boolean;
29
+ /** One sentence per gap, in the order the header lists them. */
30
+ Missing: string[];
31
+ }
32
+ /** Turns the two checks into the list the header shows before activating. */
33
+ export declare function EvaluateProductReadiness(inputs: ProductReadinessInputs): ProductReadiness;
34
+ //# sourceMappingURL=product-readiness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-readiness.d.ts","sourceRoot":"","sources":["../../../src/lib/form-panels/product-readiness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,wCAAyC,CAAC;AAE1E,0FAA0F;AAC1F,MAAM,WAAW,sBAAsB;IACnC,oGAAoG;IACpG,YAAY,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7B,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,uDAAuD;IACvD,KAAK,EAAE,SAAS,eAAe,EAAE,GAAG,IAAI,CAAC;IACzC,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,gEAAgE;IAChE,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,6EAA6E;AAC7E,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,sBAAsB,GAAG,gBAAgB,CA2BzF"}
@@ -0,0 +1,34 @@
1
+ /** The roles activation checks: what every product's revenue books to. */
2
+ export const ACTIVATION_GL_ROLES = ['Sales', 'Deferred Revenue'];
3
+ /** Turns the two checks into the list the header shows before activating. */
4
+ export function EvaluateProductReadiness(inputs) {
5
+ const missing = [];
6
+ if (inputs.PriceInForce === null) {
7
+ missing.push(`Whether a price is in force today could not be checked${detail(inputs.PriceMessage)}.`);
8
+ }
9
+ else if (!inputs.PriceInForce) {
10
+ missing.push(`No price is in force today${detail(inputs.PriceMessage)}.`);
11
+ }
12
+ if (inputs.Roles === null) {
13
+ missing.push(`Whether Sales and Deferred Revenue resolve to GL accounts could not be checked${detail(inputs.GLError)}.`);
14
+ }
15
+ else {
16
+ for (const name of ACTIVATION_GL_ROLES) {
17
+ const role = inputs.Roles.find((r) => r.Role.toLowerCase() === name.toLowerCase());
18
+ if (!role) {
19
+ missing.push(`${name} was not checked.`);
20
+ }
21
+ else if (!role.ResolvedGLAccountID) {
22
+ missing.push(role.Failure === 'CrossCompany'
23
+ ? `${name} resolves to a GL account that belongs to another company, so confirm would refuse it.`
24
+ : `${name} resolves to no GL account: link one on the product, its category, its product type or the company.`);
25
+ }
26
+ }
27
+ }
28
+ return { Ready: missing.length === 0, Missing: missing };
29
+ }
30
+ function detail(message) {
31
+ const text = (message ?? '').trim().replace(/[.\s]+$/, '');
32
+ return text ? ` (${text})` : '';
33
+ }
34
+ //# sourceMappingURL=product-readiness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-readiness.js","sourceRoot":"","sources":["../../../src/lib/form-panels/product-readiness.ts"],"names":[],"mappings":"AAcA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,kBAAkB,CAAU,CAAC;AAoB1E,6EAA6E;AAC7E,MAAM,UAAU,wBAAwB,CAAC,MAA8B;IACnE,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,IAAI,MAAM,CAAC,YAAY,KAAK,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