@zeniai/client-epic-state 5.2.3 → 5.2.4
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/lib/entity/invoicing/invoicingCommonPayload.d.ts +27 -0
- package/lib/entity/invoicing/invoicingCommonPayload.js +52 -1
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +50 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/view/invoicing/auditView/auditViewPayload.js +11 -0
- package/lib/esm/view/invoicing/createInvoice/createInvoiceSelector.js +2 -0
- package/lib/esm/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +2 -1
- package/lib/esm/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +2 -1
- package/lib/esm/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +2 -1
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +7 -4
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +3 -5
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js +0 -31
- package/lib/esm/view/invoicing/invoiceDetail/invoiceDetailSelector.js +2 -0
- package/lib/esm/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js +2 -1
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +5 -1
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +7 -0
- package/lib/esm/view/invoicing/invoicingCouponDetailView/invoicingCouponDetailViewSelector.js +2 -0
- package/lib/esm/view/invoicing/invoicingCreditNoteDetailView/invoicingCreditNoteDetailViewSelector.js +2 -0
- package/lib/esm/view/invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.js +2 -0
- package/lib/esm/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.js +2 -0
- package/lib/esm/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js +2 -0
- package/lib/esm/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +2 -1
- package/lib/esm/view/invoicing/recordPayment/recordPaymentSelector.js +2 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +6 -7
- package/lib/view/companyView/types/cockpitTabsID.d.ts +1 -1
- package/lib/view/companyView/types/cockpitTypes.d.ts +2 -2
- package/lib/view/invoicing/auditView/auditViewPayload.d.ts +2 -0
- package/lib/view/invoicing/auditView/auditViewPayload.js +11 -0
- package/lib/view/invoicing/couponView/couponViewState.d.ts +1 -1
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.d.ts +6 -1
- package/lib/view/invoicing/createInvoice/createInvoiceSelector.js +2 -0
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.d.ts +6 -1
- package/lib/view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector.js +1 -0
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.d.ts +6 -1
- package/lib/view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector.js +1 -0
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.d.ts +6 -1
- package/lib/view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector.js +1 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.d.ts +6 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +6 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.d.ts +6 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector.js +1 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState.d.ts +0 -1
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.d.ts +0 -13
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js +1 -34
- package/lib/view/invoicing/invoiceDetail/invoiceDetailSelector.d.ts +6 -0
- package/lib/view/invoicing/invoiceDetail/invoiceDetailSelector.js +2 -0
- package/lib/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.d.ts +6 -1
- package/lib/view/invoicing/invoicingCatalogItemDetailView/invoicingCatalogItemDetailViewSelector.js +1 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewPayload.d.ts +2 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.d.ts +1 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +4 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.d.ts +8 -0
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewSelector.js +9 -1
- package/lib/view/invoicing/invoicingConfigView/invoicingConfigViewState.d.ts +3 -1
- package/lib/view/invoicing/invoicingCouponDetailView/invoicingCouponDetailViewSelector.d.ts +6 -0
- package/lib/view/invoicing/invoicingCouponDetailView/invoicingCouponDetailViewSelector.js +2 -0
- package/lib/view/invoicing/invoicingCreditNoteDetailView/invoicingCreditNoteDetailViewSelector.d.ts +6 -0
- package/lib/view/invoicing/invoicingCreditNoteDetailView/invoicingCreditNoteDetailViewSelector.js +2 -0
- package/lib/view/invoicing/invoicingCreditNoteListView/invoicingCreditNoteListViewState.d.ts +1 -1
- package/lib/view/invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.d.ts +6 -0
- package/lib/view/invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.js +2 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.d.ts +6 -0
- package/lib/view/invoicing/invoicingDunningCaseDetailView/invoicingDunningCaseDetailViewSelector.js +2 -0
- package/lib/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.d.ts +6 -0
- package/lib/view/invoicing/invoicingSubscriptionDetailView/invoicingSubscriptionDetailViewSelector.js +2 -0
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.d.ts +6 -1
- package/lib/view/invoicing/issueCreditNote/issueCreditNoteSelector.js +1 -0
- package/lib/view/invoicing/recordPayment/recordPaymentSelector.d.ts +6 -1
- package/lib/view/invoicing/recordPayment/recordPaymentSelector.js +1 -0
- package/package.json +1 -1
|
@@ -228,6 +228,33 @@ export declare function invoicingOptionCodes(options: InvoicingNamedOption[]): s
|
|
|
228
228
|
* frontend release, so consumers must branch on what the map returns rather
|
|
229
229
|
* than on a hardcoded list.
|
|
230
230
|
*/
|
|
231
|
+
/**
|
|
232
|
+
* Field-help groups on `GET /1.0/config`'s `field_help`. Closed union because
|
|
233
|
+
* the client decides which group a screen belongs to — a screen names its group
|
|
234
|
+
* in code, so an unknown one is a client bug rather than backend data.
|
|
235
|
+
*/
|
|
236
|
+
export declare const ALL_INVOICING_FIELD_HELP_GROUPS: readonly ["catalog", "credit_note", "customer", "data_import", "discount", "dunning", "invoice", "payment", "settings", "subscription"];
|
|
237
|
+
export type InvoicingFieldHelpGroup = (typeof ALL_INVOICING_FIELD_HELP_GROUPS)[number];
|
|
238
|
+
export interface InvoicingFieldHelpEntryWire {
|
|
239
|
+
code?: string;
|
|
240
|
+
description?: string;
|
|
241
|
+
}
|
|
242
|
+
export type InvoicingFieldHelpWire = Partial<Record<string, InvoicingFieldHelpEntryWire[]>>;
|
|
243
|
+
/** Help copy for one group, keyed by field code for O(1) lookup per row. */
|
|
244
|
+
export type InvoicingFieldHelpByCode = Record<string, string>;
|
|
245
|
+
/**
|
|
246
|
+
* Help copy per group. `Partial` because a group the backend has not populated
|
|
247
|
+
* — or an environment whose backend predates `field_help` — must render no icon
|
|
248
|
+
* rather than an empty tooltip.
|
|
249
|
+
*/
|
|
250
|
+
export type InvoicingFieldHelp = Partial<Record<InvoicingFieldHelpGroup, InvoicingFieldHelpByCode>>;
|
|
251
|
+
/**
|
|
252
|
+
* Flattens each group's entry array into a `code -> description` map. Done once
|
|
253
|
+
* when config loads so a row render is a key lookup rather than an array scan.
|
|
254
|
+
* Entries without a code or with blank copy are dropped, so a lookup miss and
|
|
255
|
+
* "backend sent an empty string" are the same thing to the UI: no icon.
|
|
256
|
+
*/
|
|
257
|
+
export declare function toInvoicingFieldHelp(fieldHelp: InvoicingFieldHelpWire): InvoicingFieldHelp;
|
|
231
258
|
export type InvoicingNamedOptionsByKeyWire = Record<string, InvoicingNamedOptionWire[]>;
|
|
232
259
|
export type InvoicingNamedOptionsByKey = Record<string, InvoicingNamedOption[]>;
|
|
233
260
|
export declare function toInvoicingNamedOptionsByKey(optionsByKey: InvoicingNamedOptionsByKeyWire): InvoicingNamedOptionsByKey;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INVOICING_QBO_CUSTOMER_MATCHING_MODES = exports.INVOICING_DISCOUNT_LIFECYCLE_ACTIONS = exports.INVOICING_CATALOG_PRODUCT_LIFECYCLE_ACTIONS = exports.INVOICING_CATALOG_ITEM_LIFECYCLE_ACTIONS = exports.INVOICING_SUBSCRIPTION_LIFECYCLE_ACTIONS = exports.INVOICING_DUNNING_ACTIONS = void 0;
|
|
3
|
+
exports.ALL_INVOICING_FIELD_HELP_GROUPS = exports.INVOICING_QBO_CUSTOMER_MATCHING_MODES = exports.INVOICING_DISCOUNT_LIFECYCLE_ACTIONS = exports.INVOICING_CATALOG_PRODUCT_LIFECYCLE_ACTIONS = exports.INVOICING_CATALOG_ITEM_LIFECYCLE_ACTIONS = exports.INVOICING_SUBSCRIPTION_LIFECYCLE_ACTIONS = exports.INVOICING_DUNNING_ACTIONS = void 0;
|
|
4
4
|
exports.toInvoicingDunningAction = toInvoicingDunningAction;
|
|
5
5
|
exports.toInvoicingSubscriptionLifecycleAction = toInvoicingSubscriptionLifecycleAction;
|
|
6
6
|
exports.toInvoicingSubscriptionLifecycleActionOption = toInvoicingSubscriptionLifecycleActionOption;
|
|
@@ -17,6 +17,7 @@ exports.toInvoicingQboAccountMappingKindOption = toInvoicingQboAccountMappingKin
|
|
|
17
17
|
exports.toInvoicingNamedOption = toInvoicingNamedOption;
|
|
18
18
|
exports.toInvoicingFormOption = toInvoicingFormOption;
|
|
19
19
|
exports.invoicingOptionCodes = invoicingOptionCodes;
|
|
20
|
+
exports.toInvoicingFieldHelp = toInvoicingFieldHelp;
|
|
20
21
|
exports.toInvoicingNamedOptionsByKey = toInvoicingNamedOptionsByKey;
|
|
21
22
|
exports.toInvoicingSubscriptionEditFieldOption = toInvoicingSubscriptionEditFieldOption;
|
|
22
23
|
exports.toAuditLogEntityRouteOption = toAuditLogEntityRouteOption;
|
|
@@ -219,6 +220,56 @@ function toInvoicingFormOption(option) {
|
|
|
219
220
|
function invoicingOptionCodes(options) {
|
|
220
221
|
return options.map((option) => option.code);
|
|
221
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* A config-driven map from some key (a pricing model, a status, …) to the
|
|
225
|
+
* options allowed for it. Lets the backend widen an allowed set without a
|
|
226
|
+
* frontend release, so consumers must branch on what the map returns rather
|
|
227
|
+
* than on a hardcoded list.
|
|
228
|
+
*/
|
|
229
|
+
/**
|
|
230
|
+
* Field-help groups on `GET /1.0/config`'s `field_help`. Closed union because
|
|
231
|
+
* the client decides which group a screen belongs to — a screen names its group
|
|
232
|
+
* in code, so an unknown one is a client bug rather than backend data.
|
|
233
|
+
*/
|
|
234
|
+
exports.ALL_INVOICING_FIELD_HELP_GROUPS = [
|
|
235
|
+
'catalog',
|
|
236
|
+
'credit_note',
|
|
237
|
+
'customer',
|
|
238
|
+
'data_import',
|
|
239
|
+
'discount',
|
|
240
|
+
'dunning',
|
|
241
|
+
'invoice',
|
|
242
|
+
'payment',
|
|
243
|
+
'settings',
|
|
244
|
+
'subscription',
|
|
245
|
+
];
|
|
246
|
+
const isInvoicingFieldHelpGroup = (group) => exports.ALL_INVOICING_FIELD_HELP_GROUPS.includes(group);
|
|
247
|
+
/**
|
|
248
|
+
* Flattens each group's entry array into a `code -> description` map. Done once
|
|
249
|
+
* when config loads so a row render is a key lookup rather than an array scan.
|
|
250
|
+
* Entries without a code or with blank copy are dropped, so a lookup miss and
|
|
251
|
+
* "backend sent an empty string" are the same thing to the UI: no icon.
|
|
252
|
+
*/
|
|
253
|
+
function toInvoicingFieldHelp(fieldHelp) {
|
|
254
|
+
const byGroup = {};
|
|
255
|
+
Object.entries(fieldHelp).forEach(([group, entries]) => {
|
|
256
|
+
if (!isInvoicingFieldHelpGroup(group) || !Array.isArray(entries)) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
const byCode = {};
|
|
260
|
+
entries.forEach((entry) => {
|
|
261
|
+
const code = entry?.code?.trim() ?? '';
|
|
262
|
+
const description = entry?.description?.trim() ?? '';
|
|
263
|
+
if (code !== '' && description !== '') {
|
|
264
|
+
byCode[code] = description;
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
if (Object.keys(byCode).length > 0) {
|
|
268
|
+
byGroup[group] = byCode;
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
return byGroup;
|
|
272
|
+
}
|
|
222
273
|
function toInvoicingNamedOptionsByKey(optionsByKey) {
|
|
223
274
|
return Object.fromEntries(Object.entries(optionsByKey).map(([key, options]) => [
|
|
224
275
|
key,
|
|
@@ -195,6 +195,56 @@ export function toInvoicingFormOption(option) {
|
|
|
195
195
|
export function invoicingOptionCodes(options) {
|
|
196
196
|
return options.map((option) => option.code);
|
|
197
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* A config-driven map from some key (a pricing model, a status, …) to the
|
|
200
|
+
* options allowed for it. Lets the backend widen an allowed set without a
|
|
201
|
+
* frontend release, so consumers must branch on what the map returns rather
|
|
202
|
+
* than on a hardcoded list.
|
|
203
|
+
*/
|
|
204
|
+
/**
|
|
205
|
+
* Field-help groups on `GET /1.0/config`'s `field_help`. Closed union because
|
|
206
|
+
* the client decides which group a screen belongs to — a screen names its group
|
|
207
|
+
* in code, so an unknown one is a client bug rather than backend data.
|
|
208
|
+
*/
|
|
209
|
+
export const ALL_INVOICING_FIELD_HELP_GROUPS = [
|
|
210
|
+
'catalog',
|
|
211
|
+
'credit_note',
|
|
212
|
+
'customer',
|
|
213
|
+
'data_import',
|
|
214
|
+
'discount',
|
|
215
|
+
'dunning',
|
|
216
|
+
'invoice',
|
|
217
|
+
'payment',
|
|
218
|
+
'settings',
|
|
219
|
+
'subscription',
|
|
220
|
+
];
|
|
221
|
+
const isInvoicingFieldHelpGroup = (group) => ALL_INVOICING_FIELD_HELP_GROUPS.includes(group);
|
|
222
|
+
/**
|
|
223
|
+
* Flattens each group's entry array into a `code -> description` map. Done once
|
|
224
|
+
* when config loads so a row render is a key lookup rather than an array scan.
|
|
225
|
+
* Entries without a code or with blank copy are dropped, so a lookup miss and
|
|
226
|
+
* "backend sent an empty string" are the same thing to the UI: no icon.
|
|
227
|
+
*/
|
|
228
|
+
export function toInvoicingFieldHelp(fieldHelp) {
|
|
229
|
+
const byGroup = {};
|
|
230
|
+
Object.entries(fieldHelp).forEach(([group, entries]) => {
|
|
231
|
+
if (!isInvoicingFieldHelpGroup(group) || !Array.isArray(entries)) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const byCode = {};
|
|
235
|
+
entries.forEach((entry) => {
|
|
236
|
+
const code = entry?.code?.trim() ?? '';
|
|
237
|
+
const description = entry?.description?.trim() ?? '';
|
|
238
|
+
if (code !== '' && description !== '') {
|
|
239
|
+
byCode[code] = description;
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
if (Object.keys(byCode).length > 0) {
|
|
243
|
+
byGroup[group] = byCode;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
return byGroup;
|
|
247
|
+
}
|
|
198
248
|
export function toInvoicingNamedOptionsByKey(optionsByKey) {
|
|
199
249
|
return Object.fromEntries(Object.entries(optionsByKey).map(([key, options]) => [
|
|
200
250
|
key,
|
package/lib/esm/index.js
CHANGED
|
@@ -763,7 +763,7 @@ export { initializeInvoicingCustomerAddress, resetEditInvoicingCustomerDetailVie
|
|
|
763
763
|
export { INVOICING_CUSTOMER_BILLING_ADDRESS_TYPE, entityToInvoicingCustomerFormLocalData, initialInvoicingCustomerFormLocalData, } from './view/invoicing/editInvoicingCustomerDetailView/invoicingCustomerFormConfig';
|
|
764
764
|
export { getInvoicingCustomerFormView } from './view/invoicing/editInvoicingCustomerDetailView/editInvoicingCustomerDetailViewSelector';
|
|
765
765
|
export { fetchInvoicingSubscriptionFormPage, initializeInvoicingSubscriptionAddress, resetEditInvoicingSubscriptionDetailView, submitInvoicingSubscriptionForm, updateInvoicingSubscriptionFormDraft, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer';
|
|
766
|
-
export {
|
|
766
|
+
export { INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE, entityToInvoicingSubscriptionFormLocalData, initialInvoicingSubscriptionFormLocalData, invoicingSubscriptionTodayIso, toInvoicingSubscriptionQuantity, } from './view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig';
|
|
767
767
|
export { getEditInvoicingSubscriptionDetailViewState, getInvoicingSubscriptionFormView, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector';
|
|
768
768
|
export { archiveInvoicingCatalogSubFamily, createInvoicingCatalogSubFamily, resetEditInvoicingCatalogItemDetailView, saveInvoicingCatalogItem, submitInvoicingCatalogItemForm, updateInvoicingCatalogItemFormDraft, } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer';
|
|
769
769
|
export { catalogDetailEditValuesToSavePayload, createSubFamilyFormToPayload, planToCatalogDetailEditValues, productToCreateSubFamilyFormValues, } from './view/invoicing/editInvoicingCatalogItemDetailView/catalogDetailEditPayload';
|
|
@@ -39,6 +39,16 @@ function formatActor(actor, sourceLabel) {
|
|
|
39
39
|
}
|
|
40
40
|
return name;
|
|
41
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* The backend's human-readable action text, or `undefined` when it carries none.
|
|
44
|
+
* Blank copy collapses to `undefined` so the UI's `humanizeToken` fallback runs
|
|
45
|
+
* instead of rendering an empty Action cell, and surrounding whitespace is
|
|
46
|
+
* trimmed so the stored value is what should be displayed verbatim.
|
|
47
|
+
*/
|
|
48
|
+
function invoicingAuditActionLabel(actionLabel) {
|
|
49
|
+
const trimmed = actionLabel?.trim() ?? '';
|
|
50
|
+
return trimmed !== '' ? trimmed : undefined;
|
|
51
|
+
}
|
|
42
52
|
export function mapAuditLogEntry(entry) {
|
|
43
53
|
const sourceLabel = entry.source_label ?? '';
|
|
44
54
|
return {
|
|
@@ -49,6 +59,7 @@ export function mapAuditLogEntry(entry) {
|
|
|
49
59
|
source: entry.source,
|
|
50
60
|
sourceLabel: sourceLabel || undefined,
|
|
51
61
|
action: entry.action,
|
|
62
|
+
actionLabel: invoicingAuditActionLabel(entry.action_label),
|
|
52
63
|
entityId: entry.entity_id,
|
|
53
64
|
entityType: entry.entity_type,
|
|
54
65
|
customerId: entry.customer_id ?? undefined,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getAddressByAddressId } from '../../../entity/address/addressSelector';
|
|
2
2
|
import { getInvoicingCatalogListView, getInvoicingCatalogPrices, } from '../invoicingCatalogListView/invoicingCatalogListViewSelector';
|
|
3
|
+
import { invoicingFieldHelpForGroup } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
3
4
|
import { getInvoicingCustomerListView } from '../invoicingCustomerListView/invoicingCustomerListViewSelector';
|
|
4
5
|
import { getInvoicingSettings } from '../settingsView/settingsViewSelector';
|
|
5
6
|
/**
|
|
@@ -32,6 +33,7 @@ export const getCreateInvoiceFormView = (state) => {
|
|
|
32
33
|
const createInvoiceState = state.invoicingCreateInvoiceState;
|
|
33
34
|
const catalogListView = getInvoicingCatalogListView(state);
|
|
34
35
|
return {
|
|
36
|
+
fieldHelp: invoicingFieldHelpForGroup(state, 'invoice'),
|
|
35
37
|
customers: getInvoicingCustomerListView(state).customers.map((customer) => ({
|
|
36
38
|
billingAddress: customer.billingAddressId != null
|
|
37
39
|
? getAddressByAddressId(state.addressState, customer.billingAddressId)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createSelector } from '@reduxjs/toolkit';
|
|
2
2
|
import { getInvoicingPlanById, getInvoicingPlansByIds, } from '../../../entity/invoicing/plan/planSelector';
|
|
3
|
-
import { getInvoicingConfigView } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
3
|
+
import { getInvoicingConfigView, invoicingFieldHelpForGroup, } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
4
4
|
import { INVOICING_CATALOG_APPLICABILITY_VALUES, INVOICING_CATALOG_PRICING_MODEL_VALUES, INVOICING_CATALOG_PRORATION_VALUES, INVOICING_CATALOG_TIER_TYPE_VALUES, entityToInvoicingCatalogItemFormLocalData, } from './invoicingCatalogItemFormConfig';
|
|
5
5
|
export const getEditInvoicingCatalogItemDetailViewState = (state) => ({
|
|
6
6
|
fetchState: state.editInvoicingCatalogItemDetailViewState.fetchState,
|
|
@@ -50,6 +50,7 @@ export const getInvoicingCatalogItemFormView = (state, id) => {
|
|
|
50
50
|
: allApplicableItemOptions;
|
|
51
51
|
const { billingPeriodUnitOptions, catalogItemTypeOptions, catalogTierTypeOptionsByPricingModel, catalogTrialEndActionOptions, catalogTrialUnitOptions, } = getInvoicingConfigView(state);
|
|
52
52
|
return {
|
|
53
|
+
fieldHelp: invoicingFieldHelpForGroup(state, 'catalog'),
|
|
53
54
|
applicabilityValues: INVOICING_CATALOG_APPLICABILITY_VALUES,
|
|
54
55
|
applicableItemOptions,
|
|
55
56
|
localData,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getInvoicingCouponById } from '../../../entity/invoicing/coupon/couponSelector';
|
|
2
2
|
import { toInvoicingFormOption, } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
3
|
-
import { getInvoicingConfigView } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
3
|
+
import { getInvoicingConfigView, invoicingFieldHelpForGroup, } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
4
4
|
import { entityToInvoicingCouponFormLocalData, } from './editInvoicingCouponDetailViewState';
|
|
5
5
|
/**
|
|
6
6
|
* Bundled view for the discount create/edit form: the save fetch state/error,
|
|
@@ -37,6 +37,7 @@ export const getInvoicingCouponFormView = (state, couponId) => {
|
|
|
37
37
|
: newCouponDraft;
|
|
38
38
|
const { billingPeriodUnitOptions, discountApplyOnOptions, discountDurationTypeOptions, discountTypeOptions, } = getInvoicingConfigView(state);
|
|
39
39
|
return {
|
|
40
|
+
fieldHelp: invoicingFieldHelpForGroup(state, 'discount'),
|
|
40
41
|
...base,
|
|
41
42
|
applyOnOptions: discountApplyOnOptions.map(toInvoicingFormOption),
|
|
42
43
|
discountTypeOptions: discountTypeOptions.map(toInvoicingFormOption),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getInvoicingCustomerById } from '../../../entity/invoicing/invoicingCustomer/invoicingCustomerSelector';
|
|
2
2
|
import { getFormattedAddress } from '../../addressView/addressViewSelector';
|
|
3
|
-
import { getInvoicingConfigView } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
3
|
+
import { getInvoicingConfigView, invoicingFieldHelpForGroup, } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
4
4
|
import { INVOICING_CUSTOMER_BILLING_ADDRESS_TYPE, entityToInvoicingCustomerFormLocalData, } from './invoicingCustomerFormConfig';
|
|
5
5
|
/**
|
|
6
6
|
* Bundled view for the customer create/edit form. Exposes the draft `localData`
|
|
@@ -29,6 +29,7 @@ export const getInvoicingCustomerFormView = (state, invoicingCustomerID) => {
|
|
|
29
29
|
: undefined;
|
|
30
30
|
const { customerTypeOptions, netTermDayOptions, taxabilityOptions } = getInvoicingConfigView(state);
|
|
31
31
|
return {
|
|
32
|
+
fieldHelp: invoicingFieldHelpForGroup(state, 'customer'),
|
|
32
33
|
customerTypeOptions,
|
|
33
34
|
localData,
|
|
34
35
|
mode,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toAddressUpdatableInfoPayload } from '../../addressView/addressViewPayload';
|
|
2
|
-
import {
|
|
2
|
+
import { invoicingSubscriptionTodayIso, toInvoicingSubscriptionBillingCycles, toInvoicingSubscriptionQuantity, } from './invoicingSubscriptionFormConfig';
|
|
3
3
|
/**
|
|
4
4
|
* Build the create/update subscription request body from the form draft. The
|
|
5
5
|
* shipping address is sent as an object (captured via the shared Address
|
|
@@ -8,9 +8,14 @@ import { billingFrequencyToPeriod, invoicingSubscriptionTodayIso, toInvoicingSub
|
|
|
8
8
|
* `remaining_billing_cycles` is omitted when the user left the field empty, so
|
|
9
9
|
* the backend applies the plan's own `billing_cycles` (or renews forever when
|
|
10
10
|
* the plan sets no limit) rather than being pinned to a value the form invented.
|
|
11
|
+
*
|
|
12
|
+
* `billing_period` / `billing_period_unit` are deliberately absent. Billing
|
|
13
|
+
* cadence is a property of the selected price point, not of the subscription,
|
|
14
|
+
* and the backend derives it from that price point when the fields are omitted.
|
|
15
|
+
* Sending them made every price point whose cadence the form could not express
|
|
16
|
+
* — a daily plan, for instance — fail with a 422.
|
|
11
17
|
*/
|
|
12
18
|
export const localDataToSaveInvoicingSubscriptionPayload = (localData, shippingAddress) => {
|
|
13
|
-
const frequency = billingFrequencyToPeriod(localData.billingFrequency);
|
|
14
19
|
const items = [
|
|
15
20
|
{
|
|
16
21
|
item_price_code: localData.planPriceCode,
|
|
@@ -35,8 +40,6 @@ export const localDataToSaveInvoicingSubscriptionPayload = (localData, shippingA
|
|
|
35
40
|
const remainingBillingCycles = toInvoicingSubscriptionBillingCycles(localData.remainingBillingCycles);
|
|
36
41
|
return {
|
|
37
42
|
auto_collection: localData.autoCollection ? 'on' : 'off',
|
|
38
|
-
billing_period: frequency.period,
|
|
39
|
-
billing_period_unit: frequency.unit,
|
|
40
43
|
currency_code: localData.preferredCurrencyCode,
|
|
41
44
|
customer_id: localData.customerId,
|
|
42
45
|
started_at: startedAt !== '' ? startedAt : invoicingSubscriptionTodayIso(),
|
|
@@ -2,9 +2,9 @@ import { getInvoicingSubscriptionById } from '../../../entity/invoicing/invoicin
|
|
|
2
2
|
import { getFormattedAddress } from '../../addressView/addressViewSelector';
|
|
3
3
|
import { getInvoicingCouponListItems } from '../couponView/couponViewSelector';
|
|
4
4
|
import { getInvoicingCatalogListView, getInvoicingCatalogPrices, } from '../invoicingCatalogListView/invoicingCatalogListViewSelector';
|
|
5
|
-
import { getInvoicingConfigView } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
5
|
+
import { getInvoicingConfigView, invoicingFieldHelpForGroup, } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
6
6
|
import { getInvoicingCustomerListView } from '../invoicingCustomerListView/invoicingCustomerListViewSelector';
|
|
7
|
-
import {
|
|
7
|
+
import { INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE, entityToInvoicingSubscriptionFormLocalData, } from './invoicingSubscriptionFormConfig';
|
|
8
8
|
export const getEditInvoicingSubscriptionDetailViewState = (state, invoicingSubscriptionID) => {
|
|
9
9
|
const { error, fetchState, savedSubscriptionId } = state.editInvoicingSubscriptionDetailViewState;
|
|
10
10
|
const { subscriptionCommercialEditAllowedFromStatuses, subscriptionLifecycleActionOptions, subscriptionMetadataEditAllowedFromStatuses, } = getInvoicingConfigView(state);
|
|
@@ -42,9 +42,7 @@ export const getInvoicingSubscriptionFormView = (state, invoicingSubscriptionID)
|
|
|
42
42
|
const planPrices = getInvoicingCatalogPrices(catalogListView.plans);
|
|
43
43
|
const addonAndChargePrices = getInvoicingCatalogPrices(catalogListView.products);
|
|
44
44
|
return {
|
|
45
|
-
|
|
46
|
-
...INVOICING_SUBSCRIPTION_BILLING_FREQUENCY_VALUES,
|
|
47
|
-
],
|
|
45
|
+
fieldHelp: invoicingFieldHelpForGroup(state, 'subscription'),
|
|
48
46
|
coupons: getInvoicingCouponListItems(state),
|
|
49
47
|
customers: getInvoicingCustomerListView(state).customers,
|
|
50
48
|
localData,
|
|
@@ -1,35 +1,6 @@
|
|
|
1
1
|
import { dateNow } from '../../../zeniDayJS';
|
|
2
2
|
/** `AddressType` key used when the subscription form opens the shared Address screen. */
|
|
3
3
|
export const INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE = 'invoicing_subscription_shipping_address';
|
|
4
|
-
/**
|
|
5
|
-
* Canonical billing-frequency value set for the subscription form. CES owns the
|
|
6
|
-
* values (and their period/unit mapping); web-components maps each value to a
|
|
7
|
-
* localized label (same split as the customer form's value sets).
|
|
8
|
-
*/
|
|
9
|
-
export const INVOICING_SUBSCRIPTION_BILLING_FREQUENCY_VALUES = [
|
|
10
|
-
'weekly',
|
|
11
|
-
'monthly',
|
|
12
|
-
'quarterly',
|
|
13
|
-
'half_yearly',
|
|
14
|
-
'yearly',
|
|
15
|
-
];
|
|
16
|
-
const BILLING_FREQUENCY_TO_PERIOD = {
|
|
17
|
-
weekly: { period: 1, unit: 'week' },
|
|
18
|
-
monthly: { period: 1, unit: 'month' },
|
|
19
|
-
quarterly: { period: 3, unit: 'month' },
|
|
20
|
-
half_yearly: { period: 6, unit: 'month' },
|
|
21
|
-
yearly: { period: 1, unit: 'year' },
|
|
22
|
-
};
|
|
23
|
-
/** Map a billing-frequency value to its API `billing_period` / `billing_period_unit`. */
|
|
24
|
-
export const billingFrequencyToPeriod = (value) => BILLING_FREQUENCY_TO_PERIOD[value] ?? BILLING_FREQUENCY_TO_PERIOD.monthly;
|
|
25
|
-
/** Map an existing subscription's period/unit back to a billing-frequency value. */
|
|
26
|
-
export const periodToBillingFrequency = (period, unit) => {
|
|
27
|
-
const match = INVOICING_SUBSCRIPTION_BILLING_FREQUENCY_VALUES.find((value) => {
|
|
28
|
-
const mapped = BILLING_FREQUENCY_TO_PERIOD[value];
|
|
29
|
-
return mapped.period === period && mapped.unit === unit;
|
|
30
|
-
});
|
|
31
|
-
return match ?? 'monthly';
|
|
32
|
-
};
|
|
33
4
|
const subscriptionItemPriceCodes = (subscription, itemType) => subscription?.subscriptionItems
|
|
34
5
|
?.filter((item) => item.itemType === itemType)
|
|
35
6
|
.map((item) => item.itemPriceCode)
|
|
@@ -80,7 +51,6 @@ export const initialInvoicingSubscriptionFormLocalData = {
|
|
|
80
51
|
addonPriceCodes: [],
|
|
81
52
|
addonQuantities: {},
|
|
82
53
|
autoCollection: true,
|
|
83
|
-
billingFrequency: 'monthly',
|
|
84
54
|
chargePriceCodes: [],
|
|
85
55
|
chargeQuantities: {},
|
|
86
56
|
couponId: '',
|
|
@@ -103,7 +73,6 @@ export const entityToInvoicingSubscriptionFormLocalData = (subscription) => {
|
|
|
103
73
|
addonPriceCodes: subscriptionItemPriceCodes(subscription, 'addon'),
|
|
104
74
|
addonQuantities: subscriptionItemQuantities(subscription, 'addon'),
|
|
105
75
|
autoCollection: (subscription.autoCollection ?? 'on') === 'on',
|
|
106
|
-
billingFrequency: periodToBillingFrequency(subscription.billingPeriod, subscription.billingPeriodUnit),
|
|
107
76
|
chargePriceCodes: subscriptionItemPriceCodes(subscription, 'charge'),
|
|
108
77
|
chargeQuantities: subscriptionItemQuantities(subscription, 'charge'),
|
|
109
78
|
couponId: subscription.coupons?.[0]?.couponCode ??
|
|
@@ -2,10 +2,12 @@ import recordGet from 'lodash/get';
|
|
|
2
2
|
import { getAddressByAddressId } from '../../../entity/address/addressSelector';
|
|
3
3
|
import { getInvoiceById } from '../../../entity/invoicing/invoice/invoiceSelector';
|
|
4
4
|
import { getInvoicingInvoiceActionState } from '../invoiceAction/invoiceActionSelector';
|
|
5
|
+
import { invoicingFieldHelpForGroup } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
5
6
|
export const getInvoiceDetail = (state, invoiceId) => {
|
|
6
7
|
const detail = recordGet(state.invoicingInvoiceDetailState.detailById, invoiceId, undefined);
|
|
7
8
|
const invoice = getInvoiceById(state.invoicingInvoiceState, invoiceId);
|
|
8
9
|
return {
|
|
10
|
+
fieldHelp: invoicingFieldHelpForGroup(state, 'invoice'),
|
|
9
11
|
invoice,
|
|
10
12
|
billingAddress: invoice?.billingAddressId != null
|
|
11
13
|
? getAddressByAddressId(state.addressState, invoice.billingAddressId)
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { getInvoicingPlanById } from '../../../entity/invoicing/plan/planSelector';
|
|
2
|
-
import { getInvoicingConfigView } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
2
|
+
import { getInvoicingConfigView, invoicingFieldHelpForGroup, } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
3
3
|
export const getInvoicingCatalogItemDetail = (state, _kind, id) => {
|
|
4
4
|
const { error, fetchState } = state.invoicingCatalogItemDetailViewState;
|
|
5
5
|
const { billingPeriodUnitOptions, catalogItemLifecycleActionOptions, catalogItemTypeOptions, catalogProductLifecycleActionOptions, catalogTierTypeOptionsByPricingModel, catalogTrialEndActionOptions, catalogTrialUnitOptions, fetchState: configFetchState, } = getInvoicingConfigView(state);
|
|
6
6
|
return {
|
|
7
|
+
fieldHelp: invoicingFieldHelpForGroup(state, 'catalog'),
|
|
7
8
|
catalogItemLifecycleActionOptions,
|
|
8
9
|
catalogProductLifecycleActionOptions,
|
|
9
10
|
catalogTierTypeOptionsByPricingModel,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
-
import { toAuditLogEntityRouteOption, toInvoicingCatalogItemLifecycleActionOption, toInvoicingCatalogProductLifecycleActionOption, toInvoicingDiscountLifecycleActionOption, toInvoicingDunningAction, toInvoicingNamedOption, toInvoicingNamedOptionsByKey, toInvoicingQboAccountMappingKindOption, toInvoicingSubscriptionEditFieldOption, toInvoicingSubscriptionLifecycleActionOption, } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
2
|
+
import { toAuditLogEntityRouteOption, toInvoicingCatalogItemLifecycleActionOption, toInvoicingCatalogProductLifecycleActionOption, toInvoicingDiscountLifecycleActionOption, toInvoicingDunningAction, toInvoicingFieldHelp, toInvoicingNamedOption, toInvoicingNamedOptionsByKey, toInvoicingQboAccountMappingKindOption, toInvoicingSubscriptionEditFieldOption, toInvoicingSubscriptionLifecycleActionOption, } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
3
3
|
import { clearAll } from '../../../rootActions';
|
|
4
4
|
export const initialState = {
|
|
5
5
|
fetchState: 'Not-Started',
|
|
@@ -15,6 +15,7 @@ export const initialState = {
|
|
|
15
15
|
catalogTrialUnitOptions: [],
|
|
16
16
|
customerTypeOptions: [],
|
|
17
17
|
dateFormatOptions: [],
|
|
18
|
+
fieldHelp: {},
|
|
18
19
|
discountApplyOnOptions: [],
|
|
19
20
|
discountDurationTypeOptions: [],
|
|
20
21
|
discountTypeOptions: [],
|
|
@@ -75,6 +76,9 @@ export function mapInvoicingConfigPayloadToState(payload) {
|
|
|
75
76
|
})),
|
|
76
77
|
autoCollectionOptions: (payload.auto_collection_options ?? []).map(toInvoicingNamedOption),
|
|
77
78
|
billingPeriodUnitOptions: (payload.billing_period_unit_options ?? []).map(toInvoicingNamedOption),
|
|
79
|
+
fieldHelp: payload.field_help != null
|
|
80
|
+
? toInvoicingFieldHelp(payload.field_help)
|
|
81
|
+
: {},
|
|
78
82
|
catalogTierTypeOptionsByPricingModel: payload.catalog_tier_type_options_by_pricing_model != null
|
|
79
83
|
? toInvoicingNamedOptionsByKey(payload.catalog_tier_type_options_by_pricing_model)
|
|
80
84
|
: undefined,
|
|
@@ -17,3 +17,10 @@ export const getInvoicingOnboardingGateView = (state) => {
|
|
|
17
17
|
status: deriveInvoicingOnboardingStatus(state.invoicingConfigViewState.isInvoicingTosAccepted, state.invoicingConfigViewState.isInvoicingEnabled),
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* One group's help copy, keyed by field code. Composed by the page-level view
|
|
22
|
+
* selectors rather than exported to the UI: a screen receives the slice for its
|
|
23
|
+
* own group, so no screen needs the config shape. Empty when the backend has
|
|
24
|
+
* not populated the group, which the UI reads as "render no icon".
|
|
25
|
+
*/
|
|
26
|
+
export const invoicingFieldHelpForGroup = (state, group) => state.invoicingConfigViewState.fieldHelp[group] ?? {};
|
package/lib/esm/view/invoicing/invoicingCouponDetailView/invoicingCouponDetailViewSelector.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import recordGet from 'lodash/get';
|
|
2
2
|
import { getInvoicingCouponById } from '../../../entity/invoicing/coupon/couponSelector';
|
|
3
|
+
import { invoicingFieldHelpForGroup } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
3
4
|
export const getInvoicingCouponDetail = (state, id) => {
|
|
4
5
|
const detail = recordGet(state.invoicingCouponDetailViewState.detailById, id, undefined);
|
|
5
6
|
return {
|
|
7
|
+
fieldHelp: invoicingFieldHelpForGroup(state, 'discount'),
|
|
6
8
|
coupon: getInvoicingCouponById(state.invoicingCouponState, id),
|
|
7
9
|
fetchState: detail?.fetchState ?? 'Not-Started',
|
|
8
10
|
error: detail?.error,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { getInvoicingCreditNoteById as getInvoicingCreditNoteByIdFromState } from '../../../entity/invoicing/creditNote/creditNoteSelector';
|
|
2
|
+
import { invoicingFieldHelpForGroup } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
2
3
|
export const getInvoicingCreditNoteById = (state, id) => getInvoicingCreditNoteByIdFromState(state.invoicingCreditNoteState, id);
|
|
3
4
|
export const getInvoicingCreditNoteDetail = (state, invoicingCreditNoteID) => {
|
|
4
5
|
const { error, fetchState } = state.invoicingCreditNoteDetailViewState;
|
|
5
6
|
return {
|
|
7
|
+
fieldHelp: invoicingFieldHelpForGroup(state, 'credit_note'),
|
|
6
8
|
creditNote: getInvoicingCreditNoteById(state, invoicingCreditNoteID),
|
|
7
9
|
fetchState,
|
|
8
10
|
error,
|
package/lib/esm/view/invoicing/invoicingCustomerDetailView/invoicingCustomerDetailViewSelector.js
CHANGED
|
@@ -2,6 +2,7 @@ import recordGet from 'lodash/get';
|
|
|
2
2
|
import { getInvoicesByIds } from '../../../entity/invoicing/invoice/invoiceSelector';
|
|
3
3
|
import { getInvoicingCustomerById, invoicingCustomerPaymentMethods, } from '../../../entity/invoicing/invoicingCustomer/invoicingCustomerSelector';
|
|
4
4
|
import { getInvoicingPaymentLinkSendState, getInvoicingPaymentMethodSaveState, getInvoicingPlaidLinkToken, getInvoicingSentPaymentLinkEmail, getInvoicingSentPaymentLinkMagicUrl, getInvoicingSetupIntent, getInvoicingSetupIntentFetchState, } from '../customerPaymentMethod/customerPaymentMethodSelector';
|
|
5
|
+
import { invoicingFieldHelpForGroup } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
5
6
|
import { isStripeConnectedFromSettings } from '../settingsView/invoicingSettingsHelpers';
|
|
6
7
|
import { getInvoicingSettings } from '../settingsView/settingsViewSelector';
|
|
7
8
|
export const getInvoicingCustomerDetail = (state, invoicingCustomerID) => {
|
|
@@ -10,6 +11,7 @@ export const getInvoicingCustomerDetail = (state, invoicingCustomerID) => {
|
|
|
10
11
|
const settings = getInvoicingSettings(state);
|
|
11
12
|
const invoicingCustomer = getInvoicingCustomerById(invoicingCustomerState, invoicingCustomerID);
|
|
12
13
|
return {
|
|
14
|
+
fieldHelp: invoicingFieldHelpForGroup(state, 'customer'),
|
|
13
15
|
invoicingCustomer,
|
|
14
16
|
invoices: getInvoicesByIds(state.invoicingInvoiceState, state.invoicingInvoiceListState.invoiceByTab[state.invoicingInvoiceListState.activeTab]?.invoiceIds ?? []),
|
|
15
17
|
paymentMethods: invoicingCustomerPaymentMethods(invoicingCustomer),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getInvoicingDunningCaseById as getInvoicingDunningCaseByIdFromState } from '../../../entity/invoicing/dunningCase/dunningCaseSelector';
|
|
2
2
|
import { getInvoicingDunningActionState } from '../dunningAction/dunningActionSelector';
|
|
3
|
+
import { invoicingFieldHelpForGroup } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
3
4
|
const EMAIL_PREVIEW_NOT_STARTED = {
|
|
4
5
|
error: undefined,
|
|
5
6
|
fetchState: 'Not-Started',
|
|
@@ -9,6 +10,7 @@ export const getInvoicingDunningCaseById = (state, id) => getInvoicingDunningCas
|
|
|
9
10
|
export const getInvoicingDunningCaseDetail = (state, invoicingDunningCaseID) => {
|
|
10
11
|
const { emailPreview, error, fetchState, id } = state.invoicingDunningCaseDetailViewState;
|
|
11
12
|
return {
|
|
13
|
+
fieldHelp: invoicingFieldHelpForGroup(state, 'dunning'),
|
|
12
14
|
actionState: getInvoicingDunningActionState(invoicingDunningCaseID)(state),
|
|
13
15
|
dunningCase: getInvoicingDunningCaseById(state, invoicingDunningCaseID),
|
|
14
16
|
emailPreview: id === invoicingDunningCaseID ? emailPreview : EMAIL_PREVIEW_NOT_STARTED,
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { getInvoicingSubscriptionById as getInvoicingSubscriptionByIdFromState } from '../../../entity/invoicing/invoicingSubscription/invoicingSubscriptionSelector';
|
|
2
|
+
import { invoicingFieldHelpForGroup } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
2
3
|
import { getInvoicingSubscriptionActionState } from '../subscriptionAction/subscriptionActionSelector';
|
|
3
4
|
export const getInvoicingSubscriptionById = (state, id) => getInvoicingSubscriptionByIdFromState(state.invoicingSubscriptionState, id);
|
|
4
5
|
export const getInvoicingSubscriptionDetail = (state, invoicingSubscriptionID) => {
|
|
5
6
|
const { error, fetchState } = state.invoicingSubscriptionDetailViewState;
|
|
6
7
|
return {
|
|
8
|
+
fieldHelp: invoicingFieldHelpForGroup(state, 'subscription'),
|
|
7
9
|
actionState: getInvoicingSubscriptionActionState(invoicingSubscriptionID)(state),
|
|
8
10
|
subscription: getInvoicingSubscriptionById(state, invoicingSubscriptionID),
|
|
9
11
|
fetchState,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getInvoiceDetail } from '../invoiceDetail/invoiceDetailSelector';
|
|
2
|
-
import { getInvoicingConfigView } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
2
|
+
import { getInvoicingConfigView, invoicingFieldHelpForGroup, } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
3
3
|
import { initialIssueCreditNoteFormLocalData } from './issueCreditNoteFormConfig';
|
|
4
4
|
/**
|
|
5
5
|
* The draft is a single global slice, so a draft seeded for a previously opened
|
|
@@ -13,6 +13,7 @@ export const getIssueCreditNoteView = (state, invoiceId) => {
|
|
|
13
13
|
const isDraftForInvoice = draft.invoiceId === invoiceId;
|
|
14
14
|
const { creditNoteReasonCodeOptions, creditNoteTypeOptions } = getInvoicingConfigView(state);
|
|
15
15
|
return {
|
|
16
|
+
fieldHelp: invoicingFieldHelpForGroup(state, 'credit_note'),
|
|
16
17
|
invoice: invoiceView.invoice,
|
|
17
18
|
isPageReady: invoiceView.fetchState === 'Completed' &&
|
|
18
19
|
isDraftForInvoice &&
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { invoicingOptionCodes, } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
2
2
|
import { getInvoiceListView } from '../invoiceList/invoiceListSelector';
|
|
3
|
-
import { getInvoicingConfigView } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
3
|
+
import { getInvoicingConfigView, invoicingFieldHelpForGroup, } from '../invoicingConfigView/invoicingConfigViewSelector';
|
|
4
4
|
/**
|
|
5
5
|
* Single bundled view for the record-payment submit lifecycle — carries the
|
|
6
6
|
* submit fetch state/error and the ids produced on success.
|
|
@@ -19,6 +19,7 @@ export const getRecordPaymentFormView = (state) => {
|
|
|
19
19
|
const { contextInvoiceId, error, fetchState, newPaymentDraft } = state.invoicingRecordPaymentState;
|
|
20
20
|
const { manualPaymentMethodOptions, paymentGatewayOptions } = getInvoicingConfigView(state);
|
|
21
21
|
return {
|
|
22
|
+
fieldHelp: invoicingFieldHelpForGroup(state, 'payment'),
|
|
22
23
|
contextInvoiceId,
|
|
23
24
|
gatewayOptions: paymentGatewayOptions,
|
|
24
25
|
localData: newPaymentDraft,
|
package/lib/index.d.ts
CHANGED
|
@@ -1110,7 +1110,7 @@ export type { InvoicingCustomerFormView } from './view/invoicing/editInvoicingCu
|
|
|
1110
1110
|
export { fetchInvoicingSubscriptionFormPage, initializeInvoicingSubscriptionAddress, resetEditInvoicingSubscriptionDetailView, submitInvoicingSubscriptionForm, updateInvoicingSubscriptionFormDraft, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer';
|
|
1111
1111
|
export type { SubmitInvoicingSubscriptionFormPayload, UpdateInvoicingSubscriptionFormDraftPayload, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer';
|
|
1112
1112
|
export type { InvoicingSubscriptionFormLocalData } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState';
|
|
1113
|
-
export {
|
|
1113
|
+
export { INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE, entityToInvoicingSubscriptionFormLocalData, initialInvoicingSubscriptionFormLocalData, invoicingSubscriptionTodayIso, toInvoicingSubscriptionQuantity, } from './view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig';
|
|
1114
1114
|
export { getEditInvoicingSubscriptionDetailViewState, getInvoicingSubscriptionFormView, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector';
|
|
1115
1115
|
export type { EditInvoicingSubscriptionDetailView, InvoicingSubscriptionFormView, } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewSelector';
|
|
1116
1116
|
export { archiveInvoicingCatalogSubFamily, createInvoicingCatalogSubFamily, resetEditInvoicingCatalogItemDetailView, saveInvoicingCatalogItem, submitInvoicingCatalogItemForm, updateInvoicingCatalogItemFormDraft, } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer';
|
|
@@ -1245,7 +1245,7 @@ export { getInvoicingQboView } from './view/invoicing/invoicingQboView/invoicing
|
|
|
1245
1245
|
export type { InvoicingQboView } from './view/invoicing/invoicingQboView/invoicingQboViewSelector';
|
|
1246
1246
|
export type { InvoicingQboAccountOption, InvoicingQboConnection, InvoicingQboFailedTask, InvoicingQboSyncHealth, } from './view/invoicing/invoicingQboView/invoicingQboViewPayload';
|
|
1247
1247
|
export { INVOICING_QBO_CUSTOMER_MATCHING_MODES, getInvoicingQboAccountMappingId, toInvoicingNamedOptionsByKey, toInvoicingQboCustomerMatchingMode, withInvoicingQboAccountMappingId, } from './entity/invoicing/invoicingCommonPayload';
|
|
1248
|
-
export type { InvoicingNamedOption, InvoicingNamedOptionsByKey, InvoicingQboAccountMappingKindOption, InvoicingQboAccountMappingsPayload, InvoicingQboCustomerMatchingMode, InvoicingQboSettingsPayload, } from './entity/invoicing/invoicingCommonPayload';
|
|
1248
|
+
export type { InvoicingNamedOption, InvoicingFieldHelp, InvoicingFieldHelpByCode, InvoicingFieldHelpGroup, InvoicingNamedOptionsByKey, InvoicingQboAccountMappingKindOption, InvoicingQboAccountMappingsPayload, InvoicingQboCustomerMatchingMode, InvoicingQboSettingsPayload, } from './entity/invoicing/invoicingCommonPayload';
|
|
1249
1249
|
export { acceptInvoicingTerms, enableInvoicing, fetchInvoicingConfig, resetInvoicingConfigActionStates, updateInvoicingConfig, } from './view/invoicing/invoicingConfigView/invoicingConfigViewReducer';
|
|
1250
1250
|
export { getInvoicingConfigView } from './view/invoicing/invoicingConfigView/invoicingConfigViewSelector';
|
|
1251
1251
|
export { getInvoicingOnboardingGateView } from './view/invoicing/invoicingConfigView/invoicingConfigViewSelector';
|