@zeniai/client-epic-state 5.2.32-betaAK3 → 5.2.32-betaAK5
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/esm/index.js +2 -1
- package/lib/esm/view/invoicing/invoiceDetail/voidInvoiceHelper.js +32 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +10 -5
- package/lib/view/invoicing/invoiceDetail/voidInvoiceHelper.d.ts +11 -0
- package/lib/view/invoicing/invoiceDetail/voidInvoiceHelper.js +38 -0
- package/package.json +1 -1
package/lib/esm/index.js
CHANGED
|
@@ -776,10 +776,11 @@ export { getEditInvoicingSubscriptionDetailViewState, getInvoicingSubscriptionFo
|
|
|
776
776
|
export { resetEditInvoicingCatalogItemDetailView, submitInvoicingCatalogItemForm, updateInvoicingCatalogItemFormDraft, } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer';
|
|
777
777
|
export { INVOICING_CATALOG_APPLICABILITY_VALUES, INVOICING_CATALOG_PRICING_MODEL_VALUES, INVOICING_CATALOG_PRORATION_VALUES, INVOICING_CATALOG_TIER_TYPE_VALUES, blankInvoicingCatalogSubFamily, blankInvoicingCatalogTier, entityToInvoicingCatalogItemFormLocalData, invoicingProductToCatalogItemFormSubFamily, initialInvoicingCatalogItemFormLocalData, isTieredCatalogPricingModel, } from './view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper';
|
|
778
778
|
export { getInvoicingApplicableCatalogItemOptions, getInvoicingCatalogItemFormView, getSavedInvoicingCatalogItemId, getSavedInvoicingCatalogItemKind, } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector';
|
|
779
|
-
export { resetEditInvoicingCouponDetailView, saveInvoicingCoupon, submitInvoicingCouponForm, updateInvoicingCouponFormDraft, } from './view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer';
|
|
779
|
+
export { fetchInvoicingCouponDetailPage, resetEditInvoicingCouponDetailView, saveInvoicingCoupon, submitInvoicingCouponForm, updateInvoicingCouponFormDraft, } from './view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer';
|
|
780
780
|
export { entityToInvoicingCouponFormLocalData, initialInvoicingCouponFormLocalData, } from './view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState';
|
|
781
781
|
export { getEditInvoicingCouponDetailViewState, getInvoicingCouponFormView, } from './view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewSelector';
|
|
782
782
|
export { runInvoicingInvoiceAction, updateInvoicingInvoice, } from './view/invoicing/invoiceDetail/invoiceDetailReducer';
|
|
783
|
+
export { buildVoidInvoiceSubmitBody, isBackdatedInvoiceDate, shouldDefaultAdjustmentCreditNote, } from './view/invoicing/invoiceDetail/voidInvoiceHelper';
|
|
783
784
|
export { fetchInvoicingCatalogItemDetailPage, runInvoicingCatalogPlanAction, runInvoicingCatalogProductAction, } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer';
|
|
784
785
|
export { runInvoicingDiscountAction } from './view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer';
|
|
785
786
|
export { runInvoicingSubscriptionAction } from './view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewReducer';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const pad2 = (value) => String(value).padStart(2, '0');
|
|
2
|
+
/** `YYYY-MM-DD` from a date's local calendar components. */
|
|
3
|
+
const toLocalIsoDate = (value) => `${value.getFullYear()}-${pad2(value.getMonth() + 1)}-${pad2(value.getDate())}`;
|
|
4
|
+
/**
|
|
5
|
+
* Whether an invoice falls before the current month. Voiding one of those
|
|
6
|
+
* leaves a hole in a closed period, which is why the adjustment credit note is
|
|
7
|
+
* offered — and defaulted on — for them.
|
|
8
|
+
*/
|
|
9
|
+
export const isBackdatedInvoiceDate = (invoiceDate, referenceDate = new Date()) => {
|
|
10
|
+
if (invoiceDate.trim() === '') {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
const parsed = new Date(invoiceDate);
|
|
14
|
+
if (Number.isNaN(parsed.getTime())) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
const monthStart = new Date(referenceDate.getFullYear(), referenceDate.getMonth(), 1);
|
|
18
|
+
return parsed < monthStart;
|
|
19
|
+
};
|
|
20
|
+
/** Whether the void dialog should pre-tick "create adjustment credit note". */
|
|
21
|
+
export const shouldDefaultAdjustmentCreditNote = (invoiceDate, referenceDate = new Date()) => isBackdatedInvoiceDate(invoiceDate, referenceDate);
|
|
22
|
+
/** The request body for the void action, given the user's credit-note choice. */
|
|
23
|
+
export const buildVoidInvoiceSubmitBody = (createAdjustmentCreditNote, referenceDate = new Date()) => {
|
|
24
|
+
if (!createAdjustmentCreditNote) {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
create_adjustment_credit_note: true,
|
|
29
|
+
credit_note_date: toLocalIsoDate(referenceDate),
|
|
30
|
+
reason_code: 'invoice_voided',
|
|
31
|
+
};
|
|
32
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1135,7 +1135,7 @@ export type { InvoicingCatalogItemFormLocalData, InvoicingCatalogItemFormSubFami
|
|
|
1135
1135
|
export { INVOICING_CATALOG_APPLICABILITY_VALUES, INVOICING_CATALOG_PRICING_MODEL_VALUES, INVOICING_CATALOG_PRORATION_VALUES, INVOICING_CATALOG_TIER_TYPE_VALUES, blankInvoicingCatalogSubFamily, blankInvoicingCatalogTier, entityToInvoicingCatalogItemFormLocalData, invoicingProductToCatalogItemFormSubFamily, initialInvoicingCatalogItemFormLocalData, isTieredCatalogPricingModel, } from './view/invoicing/editInvoicingCatalogItemDetailView/invoicingCatalogItemFormHelper';
|
|
1136
1136
|
export { getInvoicingApplicableCatalogItemOptions, getInvoicingCatalogItemFormView, getSavedInvoicingCatalogItemId, getSavedInvoicingCatalogItemKind, } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector';
|
|
1137
1137
|
export type { ApplicableCatalogItemOption, InvoicingCatalogItemFormView, } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewSelector';
|
|
1138
|
-
export { resetEditInvoicingCouponDetailView, saveInvoicingCoupon, submitInvoicingCouponForm, updateInvoicingCouponFormDraft, } from './view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer';
|
|
1138
|
+
export { fetchInvoicingCouponDetailPage, resetEditInvoicingCouponDetailView, saveInvoicingCoupon, submitInvoicingCouponForm, updateInvoicingCouponFormDraft, } from './view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer';
|
|
1139
1139
|
export type { SaveInvoicingCouponPayload, SubmitInvoicingCouponFormPayload, UpdateInvoicingCouponFormDraftPayload, } from './view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer';
|
|
1140
1140
|
export type { InvoicingCouponFormLocalData } from './view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState';
|
|
1141
1141
|
export { entityToInvoicingCouponFormLocalData, initialInvoicingCouponFormLocalData, } from './view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewState';
|
|
@@ -1144,6 +1144,7 @@ export type { EditInvoicingCouponDetailView, InvoicingCouponFormView, } from './
|
|
|
1144
1144
|
export { runInvoicingInvoiceAction, updateInvoicingInvoice, } from './view/invoicing/invoiceDetail/invoiceDetailReducer';
|
|
1145
1145
|
export type { InvoicingInvoiceActionKind, RunInvoicingInvoiceActionPayload, UpdateInvoicingInvoicePayload, } from './view/invoicing/invoiceDetail/invoiceDetailReducer';
|
|
1146
1146
|
export type { VoidInvoiceBody } from './view/invoicing/invoiceDetail/invoicingInvoiceActionRequestPayload';
|
|
1147
|
+
export { buildVoidInvoiceSubmitBody, isBackdatedInvoiceDate, shouldDefaultAdjustmentCreditNote, } from './view/invoicing/invoiceDetail/voidInvoiceHelper';
|
|
1147
1148
|
export { fetchInvoicingCatalogItemDetailPage, runInvoicingCatalogPlanAction, runInvoicingCatalogProductAction, } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer';
|
|
1148
1149
|
export type { FetchInvoicingCatalogItemDetailPagePayload, RunInvoicingCatalogPlanActionPayload, RunInvoicingCatalogProductActionPayload, } from './view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer';
|
|
1149
1150
|
export { runInvoicingDiscountAction } from './view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer';
|
package/lib/index.js
CHANGED
|
@@ -80,11 +80,11 @@ exports.getLastCreatedCardPolicyTemplateIds = exports.getLastCreatedCardPolicyTe
|
|
|
80
80
|
exports.fetchAutoTransferRules = exports.getTreasuryTaxLetters = exports.fetchTreasuryTaxLetterList = exports.getTreasuryStatements = exports.fetchTreasuryStatementList = exports.getTreasuryTransferMoney = exports.clearTreasuryTransferMoney = exports.updateTreasuryTransferMoneyLocalData = exports.executeTreasuryTransferMoney = exports.getTreasuryDetail = exports.updateTreasuryTransactionListUIState = exports.fetchTreasuryTransactionList = exports.fetchTreasuryOverviewDetail = exports.getUpdateCardPolicyFetchState = exports.getCardPolicyFormDraft = exports.getCardPolicyDetailView = exports.getCardPolicyDetailFetchState = exports.updateCardPolicyFormDraft = exports.updateCardPolicyFetchStatus = exports.updateCardPolicyDetailFetchStatus = exports.updateCardPolicy = exports.fetchCardPolicyDetail = exports.getCardPolicyTemplateIds = exports.getCardPolicyListView = exports.getCardPolicyListFetchState = exports.getArchiveCardPolicyFetchState = exports.updateCardPolicyListFetchStatus = exports.updateArchiveCardPolicyFetchStatus = exports.prependCardPolicyTemplateIds = exports.fetchCardPolicyList = exports.archiveCardPolicy = exports.toManualCardPolicyTemplateRequestFromDraft = exports.toBulkCardPolicyTemplateRequestsFromDraft = exports.toCardPolicyTemplateRequestFromDraft = exports.applyAiCardPolicyFormDraftUpdate = exports.deriveAiPolicyReviewRowsFromInputs = exports.buildManualCardPolicyFormDraftSeed = exports.buildUploadReviewRows = exports.buildEmptyLimitRows = exports.buildAiCardPolicyFormDraftSeed = exports.toVendorChipFieldValue = exports.toMccCategoryChipFieldValue = exports.buildVendorChipId = exports.buildMccCategoryChipId = exports.VENDOR_CHIP_ID_PREFIX = exports.MCC_CHIP_ID_PREFIX = exports.toMccCategoryLike = exports.CARD_POLICY_LIMIT_ROW_ID_TRANSACTION = exports.CARD_POLICY_LIMIT_ROW_ID_REQUIRE_RECEIPT = exports.getManualCardPolicyFormDraft = void 0;
|
|
81
81
|
exports.fetchInvoiceDetailPage = exports.fetchInvoiceDetail = exports.getInvoiceListView = exports.ALL_INVOICING_INVOICE_TAB_IDS = exports.updateInvoiceListFilters = exports.setInvoiceActiveTab = exports.fetchInvoiceListPage = exports.fetchInvoiceList = exports.fetchInvoiceKPIs = exports.fetchInvoiceCounts = exports.getInvoicesByIds = exports.getInvoiceById = exports.updateInvoices = exports.removeInvoice = exports.mapAuditLogEntry = exports.toAuditLogEntityRouteOption = exports.isInvoicingEntityLinkable = exports.buildInvoicingEntityPath = exports.toInvoicingDiscountLifecycleActionOption = exports.toInvoicingDiscountLifecycleAction = exports.toInvoicingCatalogProductLifecycleActionOption = exports.toInvoicingCatalogItemLifecycleActionOption = exports.toInvoicingCatalogProductLifecycleAction = exports.toInvoicingCatalogItemLifecycleAction = exports.toInvoicingSubscriptionLifecycleActionOption = exports.toInvoicingSubscriptionLifecycleAction = exports.toInvoicingDunningAction = 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 = exports.toKycProvidedDocumentTypeFromAllowed = exports.toKycProvidedDocumentType = exports.DEFAULT_SESSION_CONFIG = exports.SessionManager = exports.getTransactionActivityLogView = exports.fetchTransactionActivityLog = exports.BULK_UPLOAD_BAR_COMPLETE_HOLD_MS = exports.BULK_UPLOAD_AUTOMATCHING_TIMEOUT_MS = exports.getAutoTransferRuleHistory = exports.getAutoTransferRuleById = exports.getAutoTransferRules = exports.clearRuleUpdateLocalData = exports.updateRuleLocalData = exports.fetchAutoTransferReviewDetail = exports.fetchAutoTransferRuleHistory = exports.deleteAutoTransferRule = exports.updateAutoTransferRule = exports.createAutoTransferRule = void 0;
|
|
82
82
|
exports.submitInvoicingCustomerFormFailure = exports.submitInvoicingCustomerForm = exports.resetEditInvoicingCustomerDetailView = exports.initializeInvoicingCustomerAddress = exports.getRecordPaymentView = exports.getRecordPaymentInvoiceOptions = exports.getRecordPaymentFormView = exports.getCreateInvoiceFormView = exports.getInvoicingAuditView = exports.fetchInvoicingAuditLog = exports.getInvoicingOverview = exports.buildPeriodOptions = exports.fetchInvoicingOverview = exports.clearInvoicingOverview = exports.initialRecordPaymentFormLocalData = exports.localDataToRecordPaymentPayload = exports.localDataToInvoiceRecordPaymentBody = exports.initializeRecordPaymentDraftFromInvoice = exports.getCreateCreditNoteView = exports.getCreateCreditNoteFormView = exports.initialCreateCreditNoteFormLocalData = exports.localDataToCreateCreditNotePayload = exports.updateCreateCreditNoteFormDraft = exports.submitCreateCreditNote = exports.resetCreateCreditNote = exports.createCreditNoteSuccess = exports.createCreditNoteFailure = exports.getIssueCreditNoteView = exports.initialIssueCreditNoteFormLocalData = exports.localDataToIssueCreditNotePayload = exports.initializeIssueCreditNoteDraftFromInvoice = exports.computeIssueCreditNoteTotal = exports.updateIssueCreditNoteFormDraft = exports.submitIssueCreditNote = exports.resetIssueCreditNote = exports.issueCreditNoteSuccess = exports.issueCreditNoteFailure = exports.initializeIssueCreditNoteDraft = exports.updateRecordPaymentFormDraft = exports.submitRecordPayment = exports.initializeRecordPaymentDraft = exports.resetRecordPayment = exports.initialInvoicingCreateInvoiceFormLocalData = exports.createInvoiceFormLocalDataToRequest = exports.blankInvoicingCreateInvoiceLineItem = exports.updateInvoicingCreateInvoiceFormDraft = exports.resetCreateInvoice = exports.fetchCreateInvoiceFormPage = exports.createInvoice = exports.getInvoiceDetail = void 0;
|
|
83
|
-
exports.
|
|
84
|
-
exports.
|
|
85
|
-
exports.
|
|
86
|
-
exports.
|
|
87
|
-
exports.isPendingReviewRow = exports.isRenderableOneTimeAccrual = exports.isOneTimeAccrualRow = exports.isExistingTabRow = exports.isAiAccountantSchedule = exports.isAccruedScheduleRow = exports.getJEScheduleRowType = exports.getExpenseAutomationJEOneTimeAccrualDetailView = exports.getInvoicingOnboardingGateView = exports.getInvoicingConfigView = exports.updateInvoicingConfig = exports.resetInvoicingConfigActionStates = exports.fetchInvoicingConfig = exports.enableInvoicing = exports.acceptInvoicingTerms = exports.toInvoicingQboCustomerMatchingMode = exports.toInvoicingNamedOptionsByKey = exports.getInvoicingQboAccountMappingId = exports.INVOICING_QBO_CUSTOMER_MATCHING_MODES = exports.getInvoicingQboView = exports.invoicingAccountsForQboAccountTypes = exports.startInvoicingQboBackfill = exports.retryInvoicingQboSyncTask = exports.fetchInvoicingQboSyncHealth = exports.fetchInvoicingQboConnection = exports.fetchInvoicingAccountingPickers = exports.isStripeConnectedFromSettings = exports.initialInvoicingBrandingFormLocalData = exports.entityToInvoicingBrandingFormLocalData = exports.INVOICING_BUSINESS_ADDRESS_TYPE = exports.invoicingQboSettingsLocalDataToPayload = exports.initialInvoicingQboSettingsLocalData = exports.entityToInvoicingQboSettingsLocalData = exports.getInvoicingSettingsView = exports.getInvoicingSettingsHubView = exports.getInvoicingSettingsFetchState = exports.getInvoicingSettings = void 0;
|
|
83
|
+
exports.fetchInvoicingCatalogItemDetailPage = exports.shouldDefaultAdjustmentCreditNote = exports.isBackdatedInvoiceDate = exports.buildVoidInvoiceSubmitBody = exports.updateInvoicingInvoice = exports.runInvoicingInvoiceAction = exports.getInvoicingCouponFormView = exports.getEditInvoicingCouponDetailViewState = exports.initialInvoicingCouponFormLocalData = exports.entityToInvoicingCouponFormLocalData = exports.updateInvoicingCouponFormDraft = exports.submitInvoicingCouponForm = exports.saveInvoicingCoupon = exports.resetEditInvoicingCouponDetailView = exports.fetchInvoicingCouponDetailPage = exports.getSavedInvoicingCatalogItemKind = exports.getSavedInvoicingCatalogItemId = exports.getInvoicingCatalogItemFormView = exports.getInvoicingApplicableCatalogItemOptions = exports.isTieredCatalogPricingModel = exports.initialInvoicingCatalogItemFormLocalData = exports.invoicingProductToCatalogItemFormSubFamily = exports.entityToInvoicingCatalogItemFormLocalData = exports.blankInvoicingCatalogTier = exports.blankInvoicingCatalogSubFamily = exports.INVOICING_CATALOG_TIER_TYPE_VALUES = exports.INVOICING_CATALOG_PRORATION_VALUES = exports.INVOICING_CATALOG_PRICING_MODEL_VALUES = exports.INVOICING_CATALOG_APPLICABILITY_VALUES = exports.updateInvoicingCatalogItemFormDraft = exports.submitInvoicingCatalogItemForm = exports.resetEditInvoicingCatalogItemDetailView = exports.getInvoicingSubscriptionFormView = exports.getEditInvoicingSubscriptionDetailViewState = exports.toInvoicingSubscriptionQuantity = exports.invoicingSubscriptionTodayIso = exports.initialInvoicingSubscriptionFormLocalData = exports.entityToInvoicingSubscriptionFormLocalData = exports.INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE = exports.updateInvoicingSubscriptionFormDraft = exports.submitInvoicingSubscriptionForm = exports.resetEditInvoicingSubscriptionDetailView = exports.initializeInvoicingSubscriptionAddress = exports.fetchInvoicingSubscriptionFormPage = exports.getInvoicingCustomerFormView = exports.initialInvoicingCustomerFormLocalData = exports.entityToInvoicingCustomerFormLocalData = exports.INVOICING_CUSTOMER_BILLING_ADDRESS_TYPE = exports.updateInvoicingCustomerFormDraft = exports.submitInvoicingCustomerFormSuccess = void 0;
|
|
84
|
+
exports.fetchInvoicingSubscriptionListPage = exports.fetchInvoicingSubscriptionList = exports.fetchInvoicingSubscriptionCounts = exports.updateInvoicingSubscriptions = exports.removeInvoicingSubscription = exports.resetPromotionalCreditAction = exports.submitAddPromotionalCredits = exports.getInvoicingSetupIntentFetchState = exports.getInvoicingSetupIntent = exports.getInvoicingSentPaymentLinkMagicUrl = exports.getInvoicingSentPaymentLinkEmail = exports.getInvoicingPlaidLinkToken = exports.getInvoicingPaymentMethodSaveState = exports.getInvoicingPaymentLinkSendState = exports.sendInvoicingPaymentLink = exports.saveInvoicingPaymentMethod = exports.resetInvoicingCustomerPaymentMethod = exports.fetchInvoicingPlaidLinkToken = exports.createInvoicingSetupIntent = exports.fetchInvoicingCustomerDetailPage = exports.fetchInvoicingCustomerDetail = exports.getInvoicingCustomerListView = exports.INVOICING_CUSTOMER_COLUMNS = exports.ALL_INVOICING_CUSTOMER_TAB_IDS = exports.ALL_INVOICING_CUSTOMER_SORT_KEYS = exports.updateInvoicingCustomerFilters = exports.setInvoicingCustomerActiveTab = exports.fetchInvoicingCustomerListPage = exports.fetchInvoicingCustomerList = exports.fetchInvoicingCustomerCounts = exports.updateInvoicingCustomers = exports.removeInvoicingCustomer = exports.INVOICING_LIST_PAGE_SIZE = exports.uploadInvoicingMigrationFiles = exports.startInvoicingMigration = exports.rollbackInvoicingMigration = exports.retryInvoicingMigration = exports.connectInvoicingChargebee = exports.getInvoicingDataImportView = exports.setInvoicingActiveMigrationSessionId = exports.fetchInvoicingMigrationSessions = exports.fetchInvoicingMigrationSession = exports.fetchInvoicingMigrationDiagnostics = exports.fetchInvoicingDataImportStatus = exports.runInvoicingPaymentAction = exports.runInvoicingDunningAction = exports.runInvoicingSubscriptionAction = exports.runInvoicingDiscountAction = exports.runInvoicingCatalogProductAction = exports.runInvoicingCatalogPlanAction = void 0;
|
|
85
|
+
exports.getInvoicingCouponListHasMore = exports.getInvoicingCouponListFilters = exports.getInvoicingCouponListFetchState = exports.getInvoicingCouponCounts = exports.INVOICING_COUPON_COLUMNS = exports.ALL_INVOICING_COUPON_TAB_IDS = exports.ALL_INVOICING_COUPON_SORT_KEYS = exports.updateInvoicingCouponFilters = exports.setInvoicingCouponActiveTab = exports.fetchInvoicingCouponListPage = exports.fetchInvoicingCouponList = exports.fetchInvoicingCouponCounts = exports.updateInvoicingCoupons = exports.removeInvoicingCoupon = exports.getInvoicingCreditNoteDetail = exports.getInvoicingCreditNoteById = exports.fetchInvoicingCreditNoteDetail = exports.getInvoicingCreditNoteListView = exports.INVOICING_CREDIT_NOTE_COLUMNS = exports.ALL_INVOICING_CREDIT_NOTE_TAB_IDS = exports.ALL_INVOICING_CREDIT_NOTE_SORT_KEYS = exports.updateInvoicingCreditNoteFilters = exports.setInvoicingCreditNoteActiveTab = exports.fetchInvoicingCreditNoteListPage = exports.fetchInvoicingCreditNoteList = exports.fetchInvoicingCreditNoteCounts = exports.updateInvoicingCreditNotes = exports.removeInvoicingCreditNote = exports.getInvoicingTransactionDetail = exports.getInvoicingTransactionById = exports.fetchInvoicingTransactionDetail = exports.getInvoicingTransactionListView = exports.INVOICING_TRANSACTION_COLUMNS = exports.ALL_INVOICING_TRANSACTION_TAB_IDS = exports.ALL_INVOICING_TRANSACTION_SORT_KEYS = exports.updateInvoicingTransactionFilters = exports.setInvoicingTransactionActiveTab = exports.fetchInvoicingTransactionListPage = exports.fetchInvoicingTransactionList = exports.updateInvoicingTransactions = exports.removeInvoicingTransaction = exports.getInvoicingSubscriptionById = exports.fetchInvoicingSubscriptionDetailPage = exports.fetchInvoicingSubscriptionDetail = exports.getInvoicingSubscriptionListView = exports.INVOICING_SUBSCRIPTION_COLUMNS = exports.ALL_INVOICING_SUBSCRIPTION_TAB_IDS = exports.ALL_INVOICING_SUBSCRIPTION_SORT_KEYS = exports.updateInvoicingSubscriptionFilters = exports.setInvoicingSubscriptionActiveTab = void 0;
|
|
86
|
+
exports.updateInvoicingBrandingFormDraft = exports.submitInvoicingQboSettings = exports.submitInvoicingBrandingForm = exports.saveInvoicingSettings = exports.resetSaveInvoicingSettings = exports.resetInvoicingQboSettingsDraft = exports.resetInvoicingBrandingFormDraft = exports.fetchInvoicingSettings = exports.disconnectInvoicingStripe = exports.connectInvoicingStripe = exports.getInvoicingProductById = exports.getInvoicingPlanById = exports.fetchInvoicingCatalogItemDetail = exports.getInvoicingCatalogListView = exports.INVOICING_PRODUCT_COLUMNS = exports.ALL_INVOICING_PRODUCT_SORT_KEYS = exports.updateInvoicingCatalogProductFilters = exports.updateInvoicingCatalogPlanFilters = exports.fetchInvoicingCatalogProductList = exports.fetchInvoicingCatalogPlanList = exports.fetchInvoicingCatalogListPage = exports.fetchInvoicingCatalogCounts = exports.updateInvoicingProducts = exports.removeInvoicingProduct = exports.updateInvoicingPlans = exports.removeInvoicingPlan = exports.mergeInvoicingPlanSubFamily = exports.getInvoicingDunningEmailPreview = exports.getInvoicingDunningCaseDetail = exports.getInvoicingDunningCaseById = exports.invalidateInvoicingDunningEmailPreview = exports.fetchInvoicingDunningEmailPreviewPage = exports.fetchInvoicingDunningCaseDetail = exports.clearInvoicingDunningCaseDetailView = exports.getInvoicingDunningCaseListView = exports.INVOICING_DUNNING_CASE_COLUMNS = exports.ALL_INVOICING_DUNNING_CASE_TAB_IDS = exports.ALL_INVOICING_DUNNING_CASE_SORT_KEYS = exports.updateInvoicingDunningCaseFilters = exports.setInvoicingDunningCaseActiveTab = exports.fetchInvoicingDunningCaseListPage = exports.fetchInvoicingDunningCaseList = exports.fetchInvoicingDunningCaseCounts = exports.updateInvoicingDunningCases = exports.removeInvoicingDunningCase = exports.fetchInvoicingCouponDetail = exports.getInvoicingCouponById = exports.getInvoicingCouponListView = exports.getInvoicingCouponListNextCursor = exports.getInvoicingCouponListItems = void 0;
|
|
87
|
+
exports.isPendingReviewRow = exports.isRenderableOneTimeAccrual = exports.isOneTimeAccrualRow = exports.isExistingTabRow = exports.isAiAccountantSchedule = exports.isAccruedScheduleRow = exports.getJEScheduleRowType = exports.getExpenseAutomationJEOneTimeAccrualDetailView = exports.getInvoicingOnboardingGateView = exports.getInvoicingConfigView = exports.updateInvoicingConfig = exports.resetInvoicingConfigActionStates = exports.fetchInvoicingConfig = exports.enableInvoicing = exports.acceptInvoicingTerms = exports.toInvoicingQboCustomerMatchingMode = exports.toInvoicingNamedOptionsByKey = exports.getInvoicingQboAccountMappingId = exports.INVOICING_QBO_CUSTOMER_MATCHING_MODES = exports.getInvoicingQboView = exports.invoicingAccountsForQboAccountTypes = exports.startInvoicingQboBackfill = exports.retryInvoicingQboSyncTask = exports.fetchInvoicingQboSyncHealth = exports.fetchInvoicingQboConnection = exports.fetchInvoicingAccountingPickers = exports.isStripeConnectedFromSettings = exports.initialInvoicingBrandingFormLocalData = exports.entityToInvoicingBrandingFormLocalData = exports.INVOICING_BUSINESS_ADDRESS_TYPE = exports.invoicingQboSettingsLocalDataToPayload = exports.initialInvoicingQboSettingsLocalData = exports.entityToInvoicingQboSettingsLocalData = exports.getInvoicingSettingsView = exports.getInvoicingSettingsHubView = exports.getInvoicingSettingsFetchState = exports.getInvoicingSettings = exports.getInvoicingQboSettingsFormView = exports.getInvoicingBrandingFormView = exports.updateInvoicingSettings = exports.updateInvoicingQboSettingsDraft = void 0;
|
|
88
88
|
const allowedValue_1 = require("./commonStateTypes/allowedValue");
|
|
89
89
|
Object.defineProperty(exports, "isAllowedValueWithCode", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithCode; } });
|
|
90
90
|
Object.defineProperty(exports, "isAllowedValueWithID", { enumerable: true, get: function () { return allowedValue_1.isAllowedValueWithID; } });
|
|
@@ -2900,6 +2900,7 @@ Object.defineProperty(exports, "getInvoicingCatalogItemFormView", { enumerable:
|
|
|
2900
2900
|
Object.defineProperty(exports, "getSavedInvoicingCatalogItemId", { enumerable: true, get: function () { return editInvoicingCatalogItemDetailViewSelector_1.getSavedInvoicingCatalogItemId; } });
|
|
2901
2901
|
Object.defineProperty(exports, "getSavedInvoicingCatalogItemKind", { enumerable: true, get: function () { return editInvoicingCatalogItemDetailViewSelector_1.getSavedInvoicingCatalogItemKind; } });
|
|
2902
2902
|
var editInvoicingCouponDetailViewReducer_1 = require("./view/invoicing/editInvoicingCouponDetailView/editInvoicingCouponDetailViewReducer");
|
|
2903
|
+
Object.defineProperty(exports, "fetchInvoicingCouponDetailPage", { enumerable: true, get: function () { return editInvoicingCouponDetailViewReducer_1.fetchInvoicingCouponDetailPage; } });
|
|
2903
2904
|
Object.defineProperty(exports, "resetEditInvoicingCouponDetailView", { enumerable: true, get: function () { return editInvoicingCouponDetailViewReducer_1.resetEditInvoicingCouponDetailView; } });
|
|
2904
2905
|
Object.defineProperty(exports, "saveInvoicingCoupon", { enumerable: true, get: function () { return editInvoicingCouponDetailViewReducer_1.saveInvoicingCoupon; } });
|
|
2905
2906
|
Object.defineProperty(exports, "submitInvoicingCouponForm", { enumerable: true, get: function () { return editInvoicingCouponDetailViewReducer_1.submitInvoicingCouponForm; } });
|
|
@@ -2913,6 +2914,10 @@ Object.defineProperty(exports, "getInvoicingCouponFormView", { enumerable: true,
|
|
|
2913
2914
|
var invoiceDetailReducer_2 = require("./view/invoicing/invoiceDetail/invoiceDetailReducer");
|
|
2914
2915
|
Object.defineProperty(exports, "runInvoicingInvoiceAction", { enumerable: true, get: function () { return invoiceDetailReducer_2.runInvoicingInvoiceAction; } });
|
|
2915
2916
|
Object.defineProperty(exports, "updateInvoicingInvoice", { enumerable: true, get: function () { return invoiceDetailReducer_2.updateInvoicingInvoice; } });
|
|
2917
|
+
var voidInvoiceHelper_1 = require("./view/invoicing/invoiceDetail/voidInvoiceHelper");
|
|
2918
|
+
Object.defineProperty(exports, "buildVoidInvoiceSubmitBody", { enumerable: true, get: function () { return voidInvoiceHelper_1.buildVoidInvoiceSubmitBody; } });
|
|
2919
|
+
Object.defineProperty(exports, "isBackdatedInvoiceDate", { enumerable: true, get: function () { return voidInvoiceHelper_1.isBackdatedInvoiceDate; } });
|
|
2920
|
+
Object.defineProperty(exports, "shouldDefaultAdjustmentCreditNote", { enumerable: true, get: function () { return voidInvoiceHelper_1.shouldDefaultAdjustmentCreditNote; } });
|
|
2916
2921
|
var editInvoicingCatalogItemDetailViewReducer_2 = require("./view/invoicing/editInvoicingCatalogItemDetailView/editInvoicingCatalogItemDetailViewReducer");
|
|
2917
2922
|
Object.defineProperty(exports, "fetchInvoicingCatalogItemDetailPage", { enumerable: true, get: function () { return editInvoicingCatalogItemDetailViewReducer_2.fetchInvoicingCatalogItemDetailPage; } });
|
|
2918
2923
|
Object.defineProperty(exports, "runInvoicingCatalogPlanAction", { enumerable: true, get: function () { return editInvoicingCatalogItemDetailViewReducer_2.runInvoicingCatalogPlanAction; } });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VoidInvoiceBody } from './invoicingInvoiceActionRequestPayload';
|
|
2
|
+
/**
|
|
3
|
+
* Whether an invoice falls before the current month. Voiding one of those
|
|
4
|
+
* leaves a hole in a closed period, which is why the adjustment credit note is
|
|
5
|
+
* offered — and defaulted on — for them.
|
|
6
|
+
*/
|
|
7
|
+
export declare const isBackdatedInvoiceDate: (invoiceDate: string, referenceDate?: Date) => boolean;
|
|
8
|
+
/** Whether the void dialog should pre-tick "create adjustment credit note". */
|
|
9
|
+
export declare const shouldDefaultAdjustmentCreditNote: (invoiceDate: string, referenceDate?: Date) => boolean;
|
|
10
|
+
/** The request body for the void action, given the user's credit-note choice. */
|
|
11
|
+
export declare const buildVoidInvoiceSubmitBody: (createAdjustmentCreditNote: boolean, referenceDate?: Date) => VoidInvoiceBody;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildVoidInvoiceSubmitBody = exports.shouldDefaultAdjustmentCreditNote = exports.isBackdatedInvoiceDate = void 0;
|
|
4
|
+
const pad2 = (value) => String(value).padStart(2, '0');
|
|
5
|
+
/** `YYYY-MM-DD` from a date's local calendar components. */
|
|
6
|
+
const toLocalIsoDate = (value) => `${value.getFullYear()}-${pad2(value.getMonth() + 1)}-${pad2(value.getDate())}`;
|
|
7
|
+
/**
|
|
8
|
+
* Whether an invoice falls before the current month. Voiding one of those
|
|
9
|
+
* leaves a hole in a closed period, which is why the adjustment credit note is
|
|
10
|
+
* offered — and defaulted on — for them.
|
|
11
|
+
*/
|
|
12
|
+
const isBackdatedInvoiceDate = (invoiceDate, referenceDate = new Date()) => {
|
|
13
|
+
if (invoiceDate.trim() === '') {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
const parsed = new Date(invoiceDate);
|
|
17
|
+
if (Number.isNaN(parsed.getTime())) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
const monthStart = new Date(referenceDate.getFullYear(), referenceDate.getMonth(), 1);
|
|
21
|
+
return parsed < monthStart;
|
|
22
|
+
};
|
|
23
|
+
exports.isBackdatedInvoiceDate = isBackdatedInvoiceDate;
|
|
24
|
+
/** Whether the void dialog should pre-tick "create adjustment credit note". */
|
|
25
|
+
const shouldDefaultAdjustmentCreditNote = (invoiceDate, referenceDate = new Date()) => (0, exports.isBackdatedInvoiceDate)(invoiceDate, referenceDate);
|
|
26
|
+
exports.shouldDefaultAdjustmentCreditNote = shouldDefaultAdjustmentCreditNote;
|
|
27
|
+
/** The request body for the void action, given the user's credit-note choice. */
|
|
28
|
+
const buildVoidInvoiceSubmitBody = (createAdjustmentCreditNote, referenceDate = new Date()) => {
|
|
29
|
+
if (!createAdjustmentCreditNote) {
|
|
30
|
+
return {};
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
create_adjustment_credit_note: true,
|
|
34
|
+
credit_note_date: toLocalIsoDate(referenceDate),
|
|
35
|
+
reason_code: 'invoice_voided',
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
exports.buildVoidInvoiceSubmitBody = buildVoidInvoiceSubmitBody;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.2.32-
|
|
3
|
+
"version": "5.2.32-betaAK5",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|