@mj-biz-apps/orders-ng 5.23.0 → 5.23.1
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.
- package/dist/lib/data/orders-queries.d.ts +37 -1
- package/dist/lib/data/orders-queries.d.ts.map +1 -1
- package/dist/lib/data/orders-queries.js +87 -0
- package/dist/lib/data/orders-queries.js.map +1 -1
- package/dist/lib/form-panels/product-header.panel.d.ts +5 -0
- package/dist/lib/form-panels/product-header.panel.d.ts.map +1 -1
- package/dist/lib/form-panels/product-header.panel.js +22 -2
- package/dist/lib/form-panels/product-header.panel.js.map +1 -1
- package/dist/lib/form-panels/subscription-revrec.panel.d.ts +2 -5
- package/dist/lib/form-panels/subscription-revrec.panel.d.ts.map +1 -1
- package/dist/lib/form-panels/subscription-revrec.panel.js +4 -61
- package/dist/lib/form-panels/subscription-revrec.panel.js.map +1 -1
- package/dist/lib/pages/receivables/subscriptions.page.d.ts +45 -16
- package/dist/lib/pages/receivables/subscriptions.page.d.ts.map +1 -1
- package/dist/lib/pages/receivables/subscriptions.page.js +122 -92
- package/dist/lib/pages/receivables/subscriptions.page.js.map +1 -1
- package/dist/lib/services/pricing-scheduler.service.d.ts.map +1 -1
- package/dist/lib/services/pricing-scheduler.service.js +17 -13
- package/dist/lib/services/pricing-scheduler.service.js.map +1 -1
- package/package.json +2 -2
|
@@ -5,10 +5,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { Component } from '@angular/core';
|
|
8
|
-
import { CompositeKey
|
|
8
|
+
import { CompositeKey } from '@memberjunction/core';
|
|
9
9
|
import { RegisterClassEx } from '@memberjunction/global';
|
|
10
10
|
import { BaseFormPanel } from '@memberjunction/ng-base-forms';
|
|
11
|
-
import { MJO_ACCOUNTING_ENTITIES
|
|
11
|
+
import { MJO_ACCOUNTING_ENTITIES } from '../data/entity-names.js';
|
|
12
|
+
import { LoadSubscriptionRevRec } from '../data/orders-queries.js';
|
|
12
13
|
import * as i0 from "@angular/core";
|
|
13
14
|
import * as i1 from "@memberjunction/ng-base-forms";
|
|
14
15
|
import * as i2 from "@memberjunction/ng-ui-components";
|
|
@@ -122,63 +123,5 @@ export { SubscriptionRevRecPanel };
|
|
|
122
123
|
type: Component,
|
|
123
124
|
args: [{ standalone: false, selector: 'mjo-subscription-revrec-panel', template: "<mj-collapsible-panel\n SectionKey=\"revRec\"\n SectionName=\"Deferred Revenue\"\n Icon=\"fa-solid fa-chart-line\"\n [Form]=\"FormComponent\"\n [FormContext]=\"FormContext\"\n [DefaultExpanded]=\"true\">\n <div class=\"mjo-terms-toolbar\">\n <button type=\"button\" mjButton variant=\"flat\" size=\"sm\" (click)=\"View = View === 'waterfall' ? 'grid' : 'waterfall'\">\n <i class=\"fa-solid\" [class.fa-table]=\"View === 'waterfall'\" [class.fa-chart-line]=\"View === 'grid'\" aria-hidden=\"true\"></i>\n {{ View === 'waterfall' ? 'Journals' : 'Waterfall' }}\n </button>\n </div>\n @if (Loading) {\n <p class=\"mjo-term-empty\">Loading recognition schedule\u2026</p>\n } @else if (View === 'waterfall') {\n <mj-deferred-revenue-waterfall\n [JournalEntries]=\"Entries\"\n [Title]=\"'Subscription deferred revenue'\"\n [TermLookup]=\"TermLookup\"\n (JournalEntrySelected)=\"OpenJournal($event)\">\n </mj-deferred-revenue-waterfall>\n } @else if (JournalParams) {\n <mj-explorer-entity-data-grid\n [Params]=\"JournalParams\"\n [AllowLoad]=\"FormComponent.IsSectionExpanded(SectionKey)\"\n [ShowToolbar]=\"true\"\n (Navigate)=\"FormComponent.OnFormNavigate($event)\">\n </mj-explorer-entity-data-grid>\n }\n</mj-collapsible-panel>\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-md);\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.mjo-ov-empty {\n padding: 12px 4px;\n color: var(--mj-text-muted);\n font-size: var(--mj-text-sm);\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"] }]
|
|
124
125
|
}], null, null); })();
|
|
125
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SubscriptionRevRecPanel, { className: "SubscriptionRevRecPanel", filePath: "lib/form-panels/subscription-revrec.panel.ts", lineNumber:
|
|
126
|
-
async function LoadSubscriptionRevRec(record, provider) {
|
|
127
|
-
const rv = RunView.FromMetadataProvider(provider);
|
|
128
|
-
const user = provider.CurrentUser;
|
|
129
|
-
const termsRes = await rv.RunView({
|
|
130
|
-
EntityName: MJO_ENTITIES.SubscriptionTerm,
|
|
131
|
-
ExtraFilter: `SubscriptionID = '${record.ID}'`,
|
|
132
|
-
OrderBy: 'TermNumber ASC',
|
|
133
|
-
Fields: ['ID', 'TermNumber'],
|
|
134
|
-
ResultType: 'simple',
|
|
135
|
-
MaxRows: 200,
|
|
136
|
-
}, user);
|
|
137
|
-
const terms = termsRes.Success && termsRes.Results ? termsRes.Results : [];
|
|
138
|
-
const termIds = terms.map((t) => t.ID);
|
|
139
|
-
const lookup = {};
|
|
140
|
-
terms.forEach((term, index) => {
|
|
141
|
-
const num = term.TermNumber ?? index + 1;
|
|
142
|
-
const label = `Term ${num}`;
|
|
143
|
-
lookup[term.ID.toLowerCase()] = { TermNumber: num, Label: label };
|
|
144
|
-
lookup[term.ID.toUpperCase()] = { TermNumber: num, Label: label };
|
|
145
|
-
});
|
|
146
|
-
const targets = [...termIds, record.ID];
|
|
147
|
-
if (record.OrderLineID)
|
|
148
|
-
targets.push(record.OrderLineID);
|
|
149
|
-
const quoted = targets.map((id) => `'${id}'`).join(',');
|
|
150
|
-
const jeRes = await rv.RunView({
|
|
151
|
-
EntityName: MJO_ACCOUNTING_ENTITIES.JournalEntry,
|
|
152
|
-
ExtraFilter: `LinkedRecordID IN (${quoted})`,
|
|
153
|
-
OrderBy: 'EffectiveDate ASC',
|
|
154
|
-
ResultType: 'entity_object',
|
|
155
|
-
MaxRows: 500,
|
|
156
|
-
}, user);
|
|
157
|
-
const all = jeRes.Success && jeRes.Results ? jeRes.Results : [];
|
|
158
|
-
await Promise.all(all.map((je) => LoadJournalLines(je)));
|
|
159
|
-
const recognized = FilterRecognitionEntries(all, termIds);
|
|
160
|
-
return {
|
|
161
|
-
Entries: recognized.length > 0 ? recognized : all,
|
|
162
|
-
TermLookup: lookup,
|
|
163
|
-
TermIDs: termIds,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
async function LoadJournalLines(entry) {
|
|
167
|
-
try {
|
|
168
|
-
if (entry.Lines && typeof entry.Lines.Load === 'function') {
|
|
169
|
-
await entry.Lines.Load();
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
catch {
|
|
173
|
-
// Waterfall still renders the header without lines.
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
function FilterRecognitionEntries(entries, termIds) {
|
|
177
|
-
return entries.filter((je) => {
|
|
178
|
-
const desc = (je.Description || '').toLowerCase();
|
|
179
|
-
const type = (je.EntryType || '').toLowerCase();
|
|
180
|
-
const isTerm = termIds.some((id) => id.toLowerCase() === String(je.LinkedRecordID).toLowerCase());
|
|
181
|
-
return isTerm || desc.includes('recognize') || type.includes('recognition');
|
|
182
|
-
});
|
|
183
|
-
}
|
|
126
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SubscriptionRevRecPanel, { className: "SubscriptionRevRecPanel", filePath: "lib/form-panels/subscription-revrec.panel.ts", lineNumber: 30 }); })();
|
|
184
127
|
//# sourceMappingURL=subscription-revrec.panel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-revrec.panel.js","sourceRoot":"","sources":["../../../src/lib/form-panels/subscription-revrec.panel.ts","../../../src/lib/form-panels/subscription-revrec.panel.html"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"subscription-revrec.panel.js","sourceRoot":"","sources":["../../../src/lib/form-panels/subscription-revrec.panel.ts","../../../src/lib/form-panels/subscription-revrec.panel.html"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B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UJ,AAPA,AAFF,uFAAe,6FAEoB,4FAOP;YAQhC,iBAAuB;;YAxBnB,AADA,AADA,wCAAsB,gCACK,yBACH;YAGI,eAAuC;YAAC,AAAxC,oDAAuC,sCAAwC;YACnG,cACJ;YADI,oFACJ;YAEJ,cAgBC;YAhBD,6FAgBC;;;ADAQ,uBAAuB;IAfnC,eAAe,CAAC,aAAa,EAAE;QAC5B,GAAG,EAAE,iCAAiC;QACtC,QAAQ,EAAE;YACN,MAAM,EAAE,kCAAkC;YAC1C,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,EAAE;YACX,eAAe,EAAE,WAAW;SAC/B;KACJ,CAAC;GAOW,uBAAuB,CA+CnC;;iFA/CY,uBAAuB;cANnC,SAAS;6BACM,KAAK,YACP,+BAA+B;;kFAIhC,uBAAuB"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { type RecordSelectedEvent, type RecordOpenedEvent } from '@memberjunction/ng-entity-viewer';
|
|
3
3
|
import { type EntityInfo } from '@memberjunction/core';
|
|
4
|
+
import type { mjBizAppsAccountingJournalEntryEntity } from '@mj-biz-apps/accounting-entities';
|
|
5
|
+
import { type SubscriptionTermLookup } from '../../data/orders-queries.js';
|
|
4
6
|
import { type DateCell, type mjBizAppsOrdersSubscriptionEventEntity, type mjBizAppsOrdersSubscriptionTermEntity } from '@mj-biz-apps/orders-entities';
|
|
5
7
|
import * as i0 from "@angular/core";
|
|
6
8
|
/** A subscription row. */
|
|
@@ -11,16 +13,13 @@ interface MJOSubscriptionRow extends Record<string, unknown> {
|
|
|
11
13
|
StartDate: DateCell;
|
|
12
14
|
EndDate: DateCell;
|
|
13
15
|
AutoRenew: boolean;
|
|
16
|
+
RenewalLeadDays?: number | null;
|
|
17
|
+
SubscriptionTypeID?: string | null;
|
|
18
|
+
OrderLineID?: string | null;
|
|
14
19
|
Product?: string | null;
|
|
15
20
|
HolderOrganization?: string | null;
|
|
16
21
|
BeneficiaryPerson?: string | null;
|
|
17
22
|
}
|
|
18
|
-
/** One period of the recognition waterfall. */
|
|
19
|
-
interface MJORecognitionPeriod {
|
|
20
|
-
Label: string;
|
|
21
|
-
Amount: number;
|
|
22
|
-
Released: boolean;
|
|
23
|
-
}
|
|
24
23
|
/**
|
|
25
24
|
* `mjo-subscriptions-page` — will it renew, and will it get paid?
|
|
26
25
|
*
|
|
@@ -57,12 +56,20 @@ export declare class MJOSubscriptionsPageComponent implements OnInit {
|
|
|
57
56
|
OnRecordOpened(event: RecordOpenedEvent): void;
|
|
58
57
|
Terms: mjBizAppsOrdersSubscriptionTermEntity[];
|
|
59
58
|
Events: mjBizAppsOrdersSubscriptionEventEntity[];
|
|
59
|
+
RecognitionEntries: mjBizAppsAccountingJournalEntryEntity[];
|
|
60
|
+
RecognitionTermLookup: SubscriptionTermLookup;
|
|
61
|
+
CanReadRecognition: boolean;
|
|
62
|
+
/** The subscription type's lead days, the engine's fallback when the subscription sets none. */
|
|
63
|
+
TypeRenewalLeadDays: number | null;
|
|
60
64
|
Select(row: MJOSubscriptionRow): Promise<void>;
|
|
61
65
|
/**
|
|
62
|
-
* Terms and
|
|
66
|
+
* Terms, history, recognition entries and renewal lead days for one subscription.
|
|
63
67
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
68
|
+
* Recognition waits for the terms so they are read once; the other reads run
|
|
69
|
+
* alongside. Every await settles before anything is assigned —
|
|
70
|
+
* assigning between awaits is what puts the view into the NG0100 freeze. A
|
|
71
|
+
* result that lands after the user has selected another subscription is
|
|
72
|
+
* dropped, so one subscription's schedule never renders under another's header.
|
|
66
73
|
*/
|
|
67
74
|
private loadDetail;
|
|
68
75
|
/**
|
|
@@ -76,12 +83,26 @@ export declare class MJOSubscriptionsPageComponent implements OnInit {
|
|
|
76
83
|
/**
|
|
77
84
|
* Dates and amounts arrive as `unknown` off a loosely-typed row.
|
|
78
85
|
*
|
|
86
|
+
* The value goes to `FormatDate` as it is. Terms and events are entity objects,
|
|
87
|
+
* so their dates are `Date`, and `String(date)` is 'Mon Aug 10 2026 …', which
|
|
88
|
+
* no ISO reader parses — every term window and history row rendered '—'.
|
|
89
|
+
*
|
|
79
90
|
* TERM WINDOWS SHOW THE YEAR. Consecutive terms differ only by it — a renewal
|
|
80
91
|
* of an annual subscription runs Jul 31 → Jul 30 exactly like the term before
|
|
81
92
|
* it — so the short format rendered two different years as the same window and
|
|
82
93
|
* made an appended renewal look like a duplicate.
|
|
83
94
|
*/
|
|
84
95
|
protected dateOf(value: unknown): string;
|
|
96
|
+
/**
|
|
97
|
+
* A term's start or end date.
|
|
98
|
+
*
|
|
99
|
+
* TERM DATES ARE CALENDAR DAYS, NOT INSTANTS. They arrive as midnight UTC, and
|
|
100
|
+
* `dateOf` reads local parts, so west of Greenwich Jan 1 rendered as Dec 31 and
|
|
101
|
+
* a renewal term appeared to overlap the one before it by a day. `ToISODate`
|
|
102
|
+
* reads the stored day, the same way `CoveredThrough` does. History timestamps
|
|
103
|
+
* are real instants and stay on `dateOf`.
|
|
104
|
+
*/
|
|
105
|
+
protected termDateOf(value: unknown): string;
|
|
85
106
|
/**
|
|
86
107
|
* The furthest date any term reaches.
|
|
87
108
|
*
|
|
@@ -91,20 +112,28 @@ export declare class MJOSubscriptionsPageComponent implements OnInit {
|
|
|
91
112
|
* covered for another year.
|
|
92
113
|
*/
|
|
93
114
|
get CoveredThrough(): string;
|
|
115
|
+
/** `YYYY-MM-DD` of the furthest term end, or null when no term has one. */
|
|
116
|
+
private get latestTermEnd();
|
|
94
117
|
protected moneyOf(value: unknown): string;
|
|
95
118
|
OnPreset(preset: string): void;
|
|
96
119
|
get Selected(): MJOSubscriptionRow | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Days until the latest term ends, which is when a renewal takes effect.
|
|
122
|
+
*
|
|
123
|
+
* Not `Subscription.EndDate`: that column is the final service date, set only
|
|
124
|
+
* after a cancellation or migration, so it is empty on every subscription that
|
|
125
|
+
* could still renew.
|
|
126
|
+
*/
|
|
97
127
|
get DaysToRenewal(): number;
|
|
98
|
-
/** Within the lead window, and consented to. */
|
|
99
|
-
get RenewalDue(): boolean;
|
|
100
128
|
/**
|
|
101
|
-
*
|
|
129
|
+
* Whether the renewal engine will renew this subscription soon.
|
|
102
130
|
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
131
|
+
* Mirrors the engine's due query: auto-renew on, subscription Active or
|
|
132
|
+
* Trialing (a paused one does not renew), latest term Scheduled or Active, and
|
|
133
|
+
* the term end inside the lead window — the subscription's own lead days,
|
|
134
|
+
* falling back to its type's, then 0.
|
|
106
135
|
*/
|
|
107
|
-
get
|
|
136
|
+
get RenewalDue(): boolean;
|
|
108
137
|
protected statusClass(row: MJOSubscriptionRow): string;
|
|
109
138
|
protected date(value: string): string;
|
|
110
139
|
private applyPreset;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions.page.d.ts","sourceRoot":"","sources":["../../../../src/lib/pages/receivables/subscriptions.page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,MAAM,EAAU,MAAM,eAAe,CAAC;AAE7E,OAAO,EAAsB,KAAK,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAIxH,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAG1E,OAAO,EAGH,KAAK,QAAQ,EACb,KAAK,sCAAsC,EAC3C,KAAK,qCAAqC,EAC7C,MAAM,8BAA8B,CAAC;;AAEtC,0BAA0B;AAC1B,UAAU,kBAAmB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACxD,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IAGf,SAAS,EAAE,QAAQ,CAAC;IACpB,OAAO,EAAE,QAAQ,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,
|
|
1
|
+
{"version":3,"file":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