@zeniai/client-epic-state 5.1.94 → 5.1.95-betaAK0
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/commonStateTypes/viewAndReport/reportIDHelper.d.ts +16 -0
- package/lib/commonStateTypes/viewAndReport/reportIDHelper.js +22 -1
- package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
- package/lib/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
- package/lib/entity/class/classReducer.d.ts +4 -4
- package/lib/entity/class/classSelectorV2.d.ts +2 -1
- package/lib/entity/class/classSelectorV2.js +7 -7
- package/lib/entity/class/classState.d.ts +1 -1
- package/lib/entity/forecast/forecastState.d.ts +1 -1
- package/lib/entity/invoicing/invoicingCommonPayload.d.ts +9 -0
- package/lib/entity/invoicing/invoicingCommonPayload.js +7 -0
- package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
- package/lib/entity/sectionClassesViewV2/sectionClassesViewSelector.d.ts +2 -1
- package/lib/entity/sectionClassesViewV2/sectionClassesViewSelector.js +3 -3
- package/lib/entity/sectionProjectView/sectionProjectView.d.ts +1 -1
- package/lib/entity/sectionProjectView/sectionProjectViewReducer.d.ts +2 -2
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.d.ts +2 -1
- package/lib/entity/sectionProjectView/sectionProjectViewSelector.js +4 -4
- package/lib/epic.d.ts +5 -1
- package/lib/epic.js +5 -1
- package/lib/esm/commonStateTypes/viewAndReport/reportIDHelper.js +17 -0
- package/lib/esm/commonStateTypes/viewAndReport/viewAndReport.js +2 -0
- package/lib/esm/entity/class/classSelectorV2.js +7 -7
- package/lib/esm/entity/invoicing/invoicingCommonPayload.js +6 -0
- package/lib/esm/entity/sectionClassesViewV2/sectionClassesViewSelector.js +3 -3
- package/lib/esm/entity/sectionProjectView/sectionProjectViewSelector.js +4 -4
- package/lib/esm/epic.js +5 -1
- package/lib/esm/index.js +10 -4
- package/lib/esm/reducer.js +6 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewEpic.js +30 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewPayload.js +1 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewReducer.js +132 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewSelector.js +90 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewSelectorTypes.js +1 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetClassesViewState.js +1 -0
- package/lib/esm/view/balanceSheetClassesView/balanceSheetForTimeframeClassesViewEpic.js +61 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetForTimeframeProjectViewEpic.js +63 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewEpic.js +30 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewPayload.js +1 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewReducer.js +128 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewSelector.js +90 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewSelectorTypes.js +1 -0
- package/lib/esm/view/balanceSheetProjectView/balanceSheetProjectViewState.js +1 -0
- package/lib/esm/view/financeStatement/financeStatementSelector.js +21 -1
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +16 -4
- package/lib/esm/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js +34 -1
- package/lib/esm/view/invoicing/invoicingConfigView/invoicingConfigViewReducer.js +5 -1
- package/lib/esm/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +7 -2
- package/lib/esm/view/spendManagement/spendManagementFilterHelpers.js +1 -1
- package/lib/index.d.ts +15 -5
- package/lib/index.js +76 -48
- package/lib/reducer.d.ts +6 -0
- package/lib/reducer.js +6 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewEpic.d.ts +6 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewEpic.js +34 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewPayload.d.ts +20 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewPayload.js +2 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewReducer.d.ts +34 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewReducer.js +136 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewSelector.d.ts +7 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewSelector.js +94 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewSelectorTypes.d.ts +7 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewSelectorTypes.js +2 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewState.d.ts +23 -0
- package/lib/view/balanceSheetClassesView/balanceSheetClassesViewState.js +2 -0
- package/lib/view/balanceSheetClassesView/balanceSheetForTimeframeClassesViewEpic.d.ts +9 -0
- package/lib/view/balanceSheetClassesView/balanceSheetForTimeframeClassesViewEpic.js +66 -0
- package/lib/view/balanceSheetProjectView/balanceSheetForTimeframeProjectViewEpic.d.ts +10 -0
- package/lib/view/balanceSheetProjectView/balanceSheetForTimeframeProjectViewEpic.js +68 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewEpic.d.ts +6 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewEpic.js +34 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewPayload.d.ts +20 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewPayload.js +2 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewReducer.d.ts +33 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewReducer.js +132 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewSelector.d.ts +7 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewSelector.js +94 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewSelectorTypes.d.ts +18 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewSelectorTypes.js +2 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewState.d.ts +22 -0
- package/lib/view/balanceSheetProjectView/balanceSheetProjectViewState.js +2 -0
- package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -1
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -1
- package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
- package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
- package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
- package/lib/view/financeStatement/financeStatementSelector.d.ts +4 -0
- package/lib/view/financeStatement/financeStatementSelector.js +21 -1
- package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.d.ts +4 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewPayload.js +15 -3
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/editInvoicingSubscriptionDetailViewState.d.ts +17 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.d.ts +7 -0
- package/lib/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js +37 -2
- 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/invoicingConfigViewState.d.ts +7 -1
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.d.ts +1 -0
- package/lib/view/profitAndLossProjectView/profitAndLossProjectViewReducer.js +7 -2
- package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
- package/lib/view/reportsResync/reportsResyncReducer.d.ts +2 -2
- package/lib/view/spendManagement/spendManagementFilterHelpers.js +1 -1
- package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/package.json +1 -1
|
@@ -11,6 +11,8 @@ const reduceFetchState_1 = require("../../commonStateTypes/reduceFetchState");
|
|
|
11
11
|
const timeframeTick_1 = require("../../commonStateTypes/timeframeTick");
|
|
12
12
|
const thisPeriodHelpers_1 = require("../../commonStateTypes/viewAndReport/thisPeriodHelpers");
|
|
13
13
|
const balanceSheetSelector_1 = require("../balanceSheet/balanceSheetSelector");
|
|
14
|
+
const balanceSheetClassesViewSelector_1 = require("../balanceSheetClassesView/balanceSheetClassesViewSelector");
|
|
15
|
+
const balanceSheetProjectViewSelector_1 = require("../balanceSheetProjectView/balanceSheetProjectViewSelector");
|
|
14
16
|
const cashFlowSelector_1 = require("../cashFlow/cashFlowSelector");
|
|
15
17
|
const profitAndLossSelector_1 = require("../profitAndLoss/profitAndLossSelector");
|
|
16
18
|
const profitAndLossClassesByClassHorizontalSelector_1 = require("../profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector");
|
|
@@ -40,7 +42,7 @@ function getFirstMonthOfFY(profitAndLossState, balanceSheetState, cashFlowState)
|
|
|
40
42
|
cashFlowState.firstMonthOfFY ??
|
|
41
43
|
1);
|
|
42
44
|
}
|
|
43
|
-
exports.getFinanceStatement = (0, toolkit_1.createSelector)((state) => state.accountState, (state) => state.accountGroupState, (state) => state.classState, (state) => state.sectionClassesViewStateV2, (state) => state.profitAndLossState, (state) => state.profitAndLossClassesViewState, (state) => state.projectState, (state) => state.sectionProjectViewState, (state) => state.profitAndLossProjectViewState, (state) => state.balanceSheetState, (state) => state.cashFlowState, (state) => state.financeStatementState, (state) => state.sectionAccountsViewState, (state) => state.forecastState, (accountState, accountGroupState, classState, sectionsState, profitAndLossState, profitAndLossClassesViewState, projectState, sectionProjectViewState, profitAndLossProjectViewState, balanceSheetState, cashFlowState, financeStatementState, sectionAccountsViewState, forecastState) => {
|
|
45
|
+
exports.getFinanceStatement = (0, toolkit_1.createSelector)((state) => state.accountState, (state) => state.accountGroupState, (state) => state.classState, (state) => state.sectionClassesViewStateV2, (state) => state.profitAndLossState, (state) => state.profitAndLossClassesViewState, (state) => state.projectState, (state) => state.sectionProjectViewState, (state) => state.profitAndLossProjectViewState, (state) => state.balanceSheetState, (state) => state.balanceSheetClassesViewState, (state) => state.balanceSheetProjectViewState, (state) => state.cashFlowState, (state) => state.financeStatementState, (state) => state.sectionAccountsViewState, (state) => state.forecastState, (accountState, accountGroupState, classState, sectionsState, profitAndLossState, profitAndLossClassesViewState, projectState, sectionProjectViewState, profitAndLossProjectViewState, balanceSheetState, balanceSheetClassesViewState, balanceSheetProjectViewState, cashFlowState, financeStatementState, sectionAccountsViewState, forecastState) => {
|
|
44
46
|
// to get min and max dates across three reports
|
|
45
47
|
let allTimeframeTicks = [];
|
|
46
48
|
let balancesInTimeframe = [];
|
|
@@ -80,6 +82,10 @@ exports.getFinanceStatement = (0, toolkit_1.createSelector)((state) => state.acc
|
|
|
80
82
|
? thisPeriod
|
|
81
83
|
: undefined);
|
|
82
84
|
const balanceSheetReport = (0, balanceSheetSelector_1.getBalanceSheet)(filter, accountState, accountGroupState, sectionAccountsViewState, balanceSheetState);
|
|
85
|
+
const balanceSheetClassFilter = (0, coaBalancesFilterClassesView_1.newBalancesFilterClassesView)(filter.firstMonthOfFY, filter.timeframe, filter.balancesRange.numberOfPeriods, filter.balancesRange.thisPeriod, filter.balancesRange.orderBy, filter.additionalBalances, balanceSheetClassesViewState.uiState.classesToFilterOut);
|
|
86
|
+
const balanceSheetByClassReport = (0, balanceSheetClassesViewSelector_1.getBalanceSheetClassesView)(balanceSheetClassFilter, accountState, classState, sectionsState, balanceSheetClassesViewState);
|
|
87
|
+
const balanceSheetProjectFilter = (0, coaBalancesFilterProjectView_1.newBalancesFilterProjectView)(filter.firstMonthOfFY, filter.timeframe, filter.balancesRange.numberOfPeriods, filter.balancesRange.thisPeriod, filter.balancesRange.orderBy, filter.additionalBalances, balanceSheetProjectViewState.uiState.projectsToFilterOut);
|
|
88
|
+
const balanceSheetByProjectReport = (0, balanceSheetProjectViewSelector_1.getBalanceSheetProjectView)(balanceSheetProjectFilter, accountState, projectState, sectionProjectViewState, balanceSheetProjectViewState);
|
|
83
89
|
const cashFlowReport = (0, cashFlowSelector_1.getCashFlow)(filter, accountState, accountGroupState, sectionAccountsViewState, cashFlowState);
|
|
84
90
|
const allReports = [
|
|
85
91
|
profitAndLossReport.reducedAnyFetchState,
|
|
@@ -108,6 +114,18 @@ exports.getFinanceStatement = (0, toolkit_1.createSelector)((state) => state.acc
|
|
|
108
114
|
error: balanceSheetReport.error,
|
|
109
115
|
};
|
|
110
116
|
break;
|
|
117
|
+
case 'balance_sheet_by_classes':
|
|
118
|
+
selectedReportAndTimeframeFetchState = {
|
|
119
|
+
fetchState: balanceSheetByClassReport.fetchState,
|
|
120
|
+
error: balanceSheetByClassReport.error,
|
|
121
|
+
};
|
|
122
|
+
break;
|
|
123
|
+
case 'balance_sheet_by_projects':
|
|
124
|
+
selectedReportAndTimeframeFetchState = {
|
|
125
|
+
fetchState: balanceSheetByProjectReport.fetchState,
|
|
126
|
+
error: balanceSheetByProjectReport.error,
|
|
127
|
+
};
|
|
128
|
+
break;
|
|
111
129
|
case 'cash_flow':
|
|
112
130
|
selectedReportAndTimeframeFetchState = {
|
|
113
131
|
fetchState: cashFlowReport.fetchState,
|
|
@@ -135,6 +153,8 @@ exports.getFinanceStatement = (0, toolkit_1.createSelector)((state) => state.acc
|
|
|
135
153
|
profitAndLossByProjectReport,
|
|
136
154
|
profitAndLossByClassHorizontalReport,
|
|
137
155
|
balanceSheetReport,
|
|
156
|
+
balanceSheetByClassReport,
|
|
157
|
+
balanceSheetByProjectReport,
|
|
138
158
|
cashFlowReport,
|
|
139
159
|
filter,
|
|
140
160
|
selectedReportId: financeStatementState.selectedReportId,
|
|
@@ -3,9 +3,9 @@ import { ZeniAPIStatus } from '../../responsePayload';
|
|
|
3
3
|
import { VendorReviewViewAllRecommendationsPayload } from '../vendorReviewView/common/payload/commonTypes';
|
|
4
4
|
import { GlobalMerchantViewState, GlobalRecommendationFetchSource, NewGlobalMerchantCurrentSelection } from './globalMerchantViewState';
|
|
5
5
|
export declare const initialState: GlobalMerchantViewState;
|
|
6
|
-
export declare const createGlobalMerchant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[merchantId?: string | undefined, context?: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts" | undefined], {
|
|
6
|
+
export declare const createGlobalMerchant: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[merchantId?: string | undefined, context?: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts" | undefined], {
|
|
7
7
|
merchantId: string | undefined;
|
|
8
|
-
context: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts" | undefined;
|
|
8
|
+
context: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts" | undefined;
|
|
9
9
|
}, "globalMerchantView/createGlobalMerchant", never, never>, createGlobalMerchantSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
10
|
merchantId: ID;
|
|
11
11
|
}, "globalMerchantView/createGlobalMerchantSuccess">, createGlobalMerchantFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -7,5 +7,9 @@ export type SaveInvoicingSubscriptionResponse = ZeniAPIResponse<InvoicingSubscri
|
|
|
7
7
|
* Build the create/update subscription request body from the form draft. The
|
|
8
8
|
* shipping address is sent as an object (captured via the shared Address
|
|
9
9
|
* screen); the backend persists it — same pattern as the customer save flow.
|
|
10
|
+
*
|
|
11
|
+
* `remaining_billing_cycles` is omitted when the user left the field empty, so
|
|
12
|
+
* the backend applies the plan's own `billing_cycles` (or renews forever when
|
|
13
|
+
* the plan sets no limit) rather than being pinned to a value the form invented.
|
|
10
14
|
*/
|
|
11
15
|
export declare const localDataToSaveInvoicingSubscriptionPayload: (localData: InvoicingSubscriptionFormLocalData, shippingAddress?: AddressUpdatableInfo) => Record<string, unknown>;
|
|
@@ -7,6 +7,10 @@ const invoicingSubscriptionFormConfig_1 = require("./invoicingSubscriptionFormCo
|
|
|
7
7
|
* Build the create/update subscription request body from the form draft. The
|
|
8
8
|
* shipping address is sent as an object (captured via the shared Address
|
|
9
9
|
* screen); the backend persists it — same pattern as the customer save flow.
|
|
10
|
+
*
|
|
11
|
+
* `remaining_billing_cycles` is omitted when the user left the field empty, so
|
|
12
|
+
* the backend applies the plan's own `billing_cycles` (or renews forever when
|
|
13
|
+
* the plan sets no limit) rather than being pinned to a value the form invented.
|
|
10
14
|
*/
|
|
11
15
|
const localDataToSaveInvoicingSubscriptionPayload = (localData, shippingAddress) => {
|
|
12
16
|
const frequency = (0, invoicingSubscriptionFormConfig_1.billingFrequencyToPeriod)(localData.billingFrequency);
|
|
@@ -14,32 +18,40 @@ const localDataToSaveInvoicingSubscriptionPayload = (localData, shippingAddress)
|
|
|
14
18
|
{
|
|
15
19
|
item_price_code: localData.planPriceCode,
|
|
16
20
|
item_type: 'plan',
|
|
17
|
-
quantity:
|
|
21
|
+
quantity: (0, invoicingSubscriptionFormConfig_1.toInvoicingSubscriptionQuantity)(localData.planQuantity),
|
|
18
22
|
},
|
|
19
23
|
...localData.addonPriceCodes.map((priceCode) => ({
|
|
20
24
|
item_price_code: priceCode,
|
|
21
25
|
item_type: 'addon',
|
|
22
|
-
quantity:
|
|
26
|
+
quantity: (0, invoicingSubscriptionFormConfig_1.toInvoicingSubscriptionQuantity)(localData.addonQuantities[priceCode]),
|
|
23
27
|
})),
|
|
24
28
|
...localData.chargePriceCodes.map((priceCode) => ({
|
|
25
29
|
item_price_code: priceCode,
|
|
26
30
|
item_type: 'charge',
|
|
27
|
-
quantity:
|
|
31
|
+
quantity: (0, invoicingSubscriptionFormConfig_1.toInvoicingSubscriptionQuantity)(localData.chargeQuantities[priceCode]),
|
|
28
32
|
})),
|
|
29
33
|
];
|
|
30
34
|
const setupFee = localData.setupFee?.amount;
|
|
31
35
|
const poNumber = localData.poNumber.trim();
|
|
32
36
|
const trialEnd = localData.trialEnd.trim();
|
|
37
|
+
const startedAt = localData.startedAt.trim();
|
|
38
|
+
const remainingBillingCycles = localData.remainingBillingCycles.trim();
|
|
33
39
|
return {
|
|
34
40
|
auto_collection: localData.autoCollection ? 'on' : 'off',
|
|
35
41
|
billing_period: frequency.period,
|
|
36
42
|
billing_period_unit: frequency.unit,
|
|
37
43
|
currency_code: localData.preferredCurrencyCode,
|
|
38
44
|
customer_id: localData.customerId,
|
|
45
|
+
started_at: startedAt !== '' ? startedAt : (0, invoicingSubscriptionFormConfig_1.invoicingSubscriptionTodayIso)(),
|
|
39
46
|
subscription_items: items,
|
|
40
47
|
...(setupFee != null ? { setup_fee: setupFee } : {}),
|
|
41
48
|
...(poNumber !== '' ? { po_number: poNumber } : {}),
|
|
42
49
|
...(trialEnd !== '' ? { trial_end: trialEnd } : {}),
|
|
50
|
+
...(remainingBillingCycles !== ''
|
|
51
|
+
? {
|
|
52
|
+
remaining_billing_cycles: (0, invoicingSubscriptionFormConfig_1.toInvoicingSubscriptionQuantity)(Number(remainingBillingCycles)),
|
|
53
|
+
}
|
|
54
|
+
: {}),
|
|
43
55
|
...(localData.couponId !== '' ? { coupon_ids: [localData.couponId] } : {}),
|
|
44
56
|
...(shippingAddress != null
|
|
45
57
|
? { shipping_address: (0, addressViewPayload_1.toAddressUpdatableInfoPayload)(shippingAddress) }
|
|
@@ -9,15 +9,32 @@ import { FetchedState, ID } from '../../../commonStateTypes/common';
|
|
|
9
9
|
*/
|
|
10
10
|
export interface InvoicingSubscriptionFormLocalData {
|
|
11
11
|
addonPriceCodes: string[];
|
|
12
|
+
/**
|
|
13
|
+
* Per-add-on quantity, keyed by item price code. Only the codes currently in
|
|
14
|
+
* `addonPriceCodes` are read when the save payload is built, so a code left
|
|
15
|
+
* behind by a deselect is inert; a missing key bills as 1.
|
|
16
|
+
*/
|
|
17
|
+
addonQuantities: Record<string, number>;
|
|
12
18
|
autoCollection: boolean;
|
|
13
19
|
billingFrequency: string;
|
|
14
20
|
chargePriceCodes: string[];
|
|
21
|
+
/** Per-charge quantity, keyed by item price code. See `addonQuantities`. */
|
|
22
|
+
chargeQuantities: Record<string, number>;
|
|
15
23
|
couponId: string;
|
|
16
24
|
customerId: string;
|
|
17
25
|
planPriceCode: string;
|
|
18
26
|
planQuantity: number;
|
|
19
27
|
poNumber: string;
|
|
20
28
|
preferredCurrencyCode: string;
|
|
29
|
+
/**
|
|
30
|
+
* Number of paid billing cycles including the first invoice, held as a string
|
|
31
|
+
* so an empty field stays distinguishable from a real 0. Empty means "no
|
|
32
|
+
* limit set here" — the payload omits it and the backend falls back to the
|
|
33
|
+
* plan's `billing_cycles` (renewing forever when the plan has no limit).
|
|
34
|
+
*/
|
|
35
|
+
remainingBillingCycles: string;
|
|
36
|
+
/** `YYYY-MM-DD`. Empty falls back to today when the payload is built. */
|
|
37
|
+
startedAt: string;
|
|
21
38
|
trialEnd: string;
|
|
22
39
|
/** Unset until the user enters one, so an explicit 0 stays distinguishable. */
|
|
23
40
|
setupFee?: Amount;
|
package/lib/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.d.ts
CHANGED
|
@@ -15,6 +15,13 @@ export declare const billingFrequencyToPeriod: (value: string) => {
|
|
|
15
15
|
};
|
|
16
16
|
/** Map an existing subscription's period/unit back to a billing-frequency value. */
|
|
17
17
|
export declare const periodToBillingFrequency: (period?: number, unit?: string) => string;
|
|
18
|
+
/** Today as `YYYY-MM-DD`, the default subscription start date. */
|
|
19
|
+
export declare const invoicingSubscriptionTodayIso: () => string;
|
|
20
|
+
/**
|
|
21
|
+
* Clamp a subscription-item quantity to the minimum the API accepts. Shared by
|
|
22
|
+
* the plan, add-on and charge items so none of them can bill a 0 or a fraction.
|
|
23
|
+
*/
|
|
24
|
+
export declare const toInvoicingSubscriptionQuantity: (quantity?: number) => number;
|
|
18
25
|
export declare const initialInvoicingSubscriptionFormLocalData: InvoicingSubscriptionFormLocalData;
|
|
19
26
|
/** Seed the form draft from an existing subscription entity (edit mode). */
|
|
20
27
|
export declare const entityToInvoicingSubscriptionFormLocalData: (subscription?: InvoicingSubscription) => InvoicingSubscriptionFormLocalData;
|
package/lib/view/invoicing/editInvoicingSubscriptionDetailView/invoicingSubscriptionFormConfig.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.entityToInvoicingSubscriptionFormLocalData = exports.initialInvoicingSubscriptionFormLocalData = exports.periodToBillingFrequency = exports.billingFrequencyToPeriod = exports.INVOICING_SUBSCRIPTION_BILLING_FREQUENCY_VALUES = exports.INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE = void 0;
|
|
3
|
+
exports.entityToInvoicingSubscriptionFormLocalData = exports.initialInvoicingSubscriptionFormLocalData = exports.toInvoicingSubscriptionQuantity = exports.invoicingSubscriptionTodayIso = exports.periodToBillingFrequency = exports.billingFrequencyToPeriod = exports.INVOICING_SUBSCRIPTION_BILLING_FREQUENCY_VALUES = exports.INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE = void 0;
|
|
4
4
|
/** `AddressType` key used when the subscription form opens the shared Address screen. */
|
|
5
5
|
exports.INVOICING_SUBSCRIPTION_SHIPPING_ADDRESS_TYPE = 'invoicing_subscription_shipping_address';
|
|
6
6
|
/**
|
|
@@ -38,17 +38,44 @@ const subscriptionItemPriceCodes = (subscription, itemType) => subscription?.sub
|
|
|
38
38
|
?.filter((item) => item.itemType === itemType)
|
|
39
39
|
.map((item) => item.itemPriceCode)
|
|
40
40
|
.filter((code) => code != null && code !== '') ?? [];
|
|
41
|
+
const subscriptionItemQuantities = (subscription, itemType) => {
|
|
42
|
+
const quantities = {};
|
|
43
|
+
subscription?.subscriptionItems
|
|
44
|
+
?.filter((item) => item.itemType === itemType)
|
|
45
|
+
.forEach((item) => {
|
|
46
|
+
if (item.itemPriceCode != null && item.itemPriceCode !== '') {
|
|
47
|
+
quantities[item.itemPriceCode] = (0, exports.toInvoicingSubscriptionQuantity)(item.quantity);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return quantities;
|
|
51
|
+
};
|
|
52
|
+
/** Today as `YYYY-MM-DD`, the default subscription start date. */
|
|
53
|
+
const invoicingSubscriptionTodayIso = () => new Date().toISOString().slice(0, 10);
|
|
54
|
+
exports.invoicingSubscriptionTodayIso = invoicingSubscriptionTodayIso;
|
|
55
|
+
/**
|
|
56
|
+
* Clamp a subscription-item quantity to the minimum the API accepts. Shared by
|
|
57
|
+
* the plan, add-on and charge items so none of them can bill a 0 or a fraction.
|
|
58
|
+
*/
|
|
59
|
+
const toInvoicingSubscriptionQuantity = (quantity) => {
|
|
60
|
+
const whole = Math.floor(Number(quantity));
|
|
61
|
+
return Number.isFinite(whole) && whole > 0 ? whole : 1;
|
|
62
|
+
};
|
|
63
|
+
exports.toInvoicingSubscriptionQuantity = toInvoicingSubscriptionQuantity;
|
|
41
64
|
exports.initialInvoicingSubscriptionFormLocalData = {
|
|
42
65
|
addonPriceCodes: [],
|
|
66
|
+
addonQuantities: {},
|
|
43
67
|
autoCollection: true,
|
|
44
68
|
billingFrequency: 'monthly',
|
|
45
69
|
chargePriceCodes: [],
|
|
70
|
+
chargeQuantities: {},
|
|
46
71
|
couponId: '',
|
|
47
72
|
customerId: '',
|
|
48
73
|
planPriceCode: '',
|
|
49
74
|
planQuantity: 1,
|
|
50
75
|
poNumber: '',
|
|
51
76
|
preferredCurrencyCode: 'USD',
|
|
77
|
+
remainingBillingCycles: '',
|
|
78
|
+
startedAt: '',
|
|
52
79
|
trialEnd: '',
|
|
53
80
|
};
|
|
54
81
|
/** Seed the form draft from an existing subscription entity (edit mode). */
|
|
@@ -59,18 +86,26 @@ const entityToInvoicingSubscriptionFormLocalData = (subscription) => {
|
|
|
59
86
|
const planItem = subscription.subscriptionItems?.find((item) => item.itemType === 'plan');
|
|
60
87
|
return {
|
|
61
88
|
addonPriceCodes: subscriptionItemPriceCodes(subscription, 'addon'),
|
|
89
|
+
addonQuantities: subscriptionItemQuantities(subscription, 'addon'),
|
|
62
90
|
autoCollection: (subscription.autoCollection ?? 'on') === 'on',
|
|
63
91
|
billingFrequency: (0, exports.periodToBillingFrequency)(subscription.billingPeriod, subscription.billingPeriodUnit),
|
|
64
92
|
chargePriceCodes: subscriptionItemPriceCodes(subscription, 'charge'),
|
|
93
|
+
chargeQuantities: subscriptionItemQuantities(subscription, 'charge'),
|
|
65
94
|
couponId: subscription.coupons?.[0]?.couponCode ??
|
|
66
95
|
subscription.coupons?.[0]?.couponID ??
|
|
67
96
|
'',
|
|
68
97
|
customerId: subscription.customerID ?? '',
|
|
69
98
|
planPriceCode: subscriptionItemPriceCodes(subscription, 'plan')[0] ?? '',
|
|
70
|
-
planQuantity: planItem?.quantity
|
|
99
|
+
planQuantity: (0, exports.toInvoicingSubscriptionQuantity)(planItem?.quantity),
|
|
71
100
|
poNumber: subscription.poNumber ?? '',
|
|
72
101
|
preferredCurrencyCode: subscription.currencyCode ?? 'USD',
|
|
102
|
+
remainingBillingCycles: subscription.remainingBillingCycles != null
|
|
103
|
+
? String(subscription.remainingBillingCycles)
|
|
104
|
+
: '',
|
|
73
105
|
setupFee: subscription.setupFee,
|
|
106
|
+
startedAt: subscription.startedAt != null
|
|
107
|
+
? subscription.startedAt.format('YYYY-MM-DD')
|
|
108
|
+
: '',
|
|
74
109
|
trialEnd: subscription.trialEnd != null
|
|
75
110
|
? subscription.trialEnd.format('YYYY-MM-DD')
|
|
76
111
|
: '',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuditLogEntityRouteOptionWire, AuditLogListSortFieldOptionWire, AuditLogSourceLabelOptionWire, InvoicingCatalogLifecycleActionOptionWire, InvoicingDunningActionOption, InvoicingNamedOptionWire, InvoicingQboAccountMappingKindOptionWire, InvoicingSubscriptionEditFieldOptionWire, InvoicingSubscriptionLifecycleActionOptionWire } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
1
|
+
import { AuditLogEntityRouteOptionWire, AuditLogListSortFieldOptionWire, AuditLogSourceLabelOptionWire, InvoicingCatalogLifecycleActionOptionWire, InvoicingDunningActionOption, InvoicingNamedOptionWire, InvoicingNamedOptionsByKeyWire, InvoicingQboAccountMappingKindOptionWire, InvoicingSubscriptionEditFieldOptionWire, InvoicingSubscriptionLifecycleActionOptionWire } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
2
2
|
import { ZeniAPIResponse } from '../../../responsePayload';
|
|
3
3
|
/**
|
|
4
4
|
* Wire payload of the invoicing config API (GET/PUT `/1.0/config`). Follows
|
|
@@ -23,6 +23,7 @@ export interface InvoicingConfigPayload {
|
|
|
23
23
|
subscription_metadata_edit_allowed_from_statuses: string[];
|
|
24
24
|
auto_collection_options?: InvoicingNamedOptionWire[];
|
|
25
25
|
billing_period_unit_options?: InvoicingNamedOptionWire[];
|
|
26
|
+
catalog_tier_type_options_by_pricing_model?: InvoicingNamedOptionsByKeyWire;
|
|
26
27
|
catalog_trial_end_action_options?: InvoicingNamedOptionWire[];
|
|
27
28
|
catalog_trial_unit_options?: InvoicingNamedOptionWire[];
|
|
28
29
|
created_at?: string | null;
|
|
@@ -2,7 +2,7 @@ import { ZeniAPIStatus } from '../../../responsePayload';
|
|
|
2
2
|
import { InvoicingConfigPayload } from './invoicingConfigViewPayload';
|
|
3
3
|
import { InvoicingConfigViewState } from './invoicingConfigViewState';
|
|
4
4
|
export declare const initialState: InvoicingConfigViewState;
|
|
5
|
-
export declare function mapInvoicingConfigPayloadToState(payload: InvoicingConfigPayload): Pick<InvoicingConfigViewState, 'auditLogEntityRouteOptions' | 'auditLogListSortFieldOptions' | 'auditLogSourceLabels' | 'autoCollectionOptions' | 'billingPeriodUnitOptions' | 'catalogTrialEndActionOptions' | 'catalogTrialUnitOptions' | 'customerTypeOptions' | 'dateFormatOptions' | 'discountApplyOnOptions' | 'discountDurationTypeOptions' | 'discountTypeOptions' | 'manualPaymentMethodOptions' | 'netTermDayOptions' | 'paymentGatewayOptions' | 'taxabilityOptions' | 'createdAt' | 'updatedAt' | 'dunningScheduleActionOptions' | 'subscriptionLifecycleActionOptions' | 'subscriptionCommercialEditAllowedFromStatuses' | 'subscriptionMetadataEditAllowedFromStatuses' | 'subscriptionEditFieldOptions' | 'subscriptionCancelTimingOptions' | 'subscriptionChangeOptionOptions' | 'catalogItemLifecycleActionOptions' | 'catalogProductLifecycleActionOptions' | 'discountLifecycleActionOptions' | 'qboAccountMappingKindOptions' | 'qboCustomerMatchingOptions' | 'qboSyncStatusOptions' | 'isInvoicingEnabled' | 'isInvoicingTosAccepted' | 'invoicingTosAcceptanceIp' | 'invoicingTosAcceptanceTime' | 'invoicingTosAcceptanceUserAgent' | 'invoicingTosAcceptanceUserId' | 'isInvoicingSettingsSeeded'>;
|
|
5
|
+
export declare function mapInvoicingConfigPayloadToState(payload: InvoicingConfigPayload): Pick<InvoicingConfigViewState, 'auditLogEntityRouteOptions' | 'auditLogListSortFieldOptions' | 'auditLogSourceLabels' | 'autoCollectionOptions' | 'billingPeriodUnitOptions' | 'catalogTierTypeOptionsByPricingModel' | 'catalogTrialEndActionOptions' | 'catalogTrialUnitOptions' | 'customerTypeOptions' | 'dateFormatOptions' | 'discountApplyOnOptions' | 'discountDurationTypeOptions' | 'discountTypeOptions' | 'manualPaymentMethodOptions' | 'netTermDayOptions' | 'paymentGatewayOptions' | 'taxabilityOptions' | 'createdAt' | 'updatedAt' | 'dunningScheduleActionOptions' | 'subscriptionLifecycleActionOptions' | 'subscriptionCommercialEditAllowedFromStatuses' | 'subscriptionMetadataEditAllowedFromStatuses' | 'subscriptionEditFieldOptions' | 'subscriptionCancelTimingOptions' | 'subscriptionChangeOptionOptions' | 'catalogItemLifecycleActionOptions' | 'catalogProductLifecycleActionOptions' | 'discountLifecycleActionOptions' | 'qboAccountMappingKindOptions' | 'qboCustomerMatchingOptions' | 'qboSyncStatusOptions' | 'isInvoicingEnabled' | 'isInvoicingTosAccepted' | 'invoicingTosAcceptanceIp' | 'invoicingTosAcceptanceTime' | 'invoicingTosAcceptanceUserAgent' | 'invoicingTosAcceptanceUserId' | 'isInvoicingSettingsSeeded'>;
|
|
6
6
|
export declare const fetchInvoicingConfig: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload?: {
|
|
7
7
|
cacheOverride?: boolean;
|
|
8
8
|
} | undefined], {
|
|
@@ -15,6 +15,7 @@ exports.initialState = {
|
|
|
15
15
|
auditLogSourceLabels: [],
|
|
16
16
|
autoCollectionOptions: [],
|
|
17
17
|
billingPeriodUnitOptions: [],
|
|
18
|
+
catalogTierTypeOptionsByPricingModel: undefined,
|
|
18
19
|
catalogTrialEndActionOptions: [],
|
|
19
20
|
catalogTrialUnitOptions: [],
|
|
20
21
|
customerTypeOptions: [],
|
|
@@ -66,6 +67,9 @@ function mapInvoicingConfigPayloadToState(payload) {
|
|
|
66
67
|
})),
|
|
67
68
|
autoCollectionOptions: (payload.auto_collection_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
68
69
|
billingPeriodUnitOptions: (payload.billing_period_unit_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
70
|
+
catalogTierTypeOptionsByPricingModel: payload.catalog_tier_type_options_by_pricing_model != null
|
|
71
|
+
? (0, invoicingCommonPayload_1.toInvoicingNamedOptionsByKey)(payload.catalog_tier_type_options_by_pricing_model)
|
|
72
|
+
: undefined,
|
|
69
73
|
catalogTrialEndActionOptions: (payload.catalog_trial_end_action_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
70
74
|
catalogTrialUnitOptions: (payload.catalog_trial_unit_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
71
75
|
customerTypeOptions: (payload.customer_type_options ?? []).map(invoicingCommonPayload_1.toInvoicingNamedOption),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FetchStateAndError, FetchedState } from '../../../commonStateTypes/common';
|
|
2
|
-
import type { AuditLogEntityRouteOption, AuditLogListSortFieldOption, AuditLogSourceLabelOption, InvoicingCatalogItemLifecycleAction, InvoicingCatalogLifecycleActionOption, InvoicingCatalogProductLifecycleAction, InvoicingDiscountLifecycleActionOption, InvoicingNamedOption, InvoicingQboAccountMappingKindOption, InvoicingSubscriptionEditFieldOption, InvoicingSubscriptionLifecycleActionOption } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
2
|
+
import type { AuditLogEntityRouteOption, AuditLogListSortFieldOption, AuditLogSourceLabelOption, InvoicingCatalogItemLifecycleAction, InvoicingCatalogLifecycleActionOption, InvoicingCatalogProductLifecycleAction, InvoicingDiscountLifecycleActionOption, InvoicingNamedOption, InvoicingNamedOptionsByKey, InvoicingQboAccountMappingKindOption, InvoicingSubscriptionEditFieldOption, InvoicingSubscriptionLifecycleActionOption } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
3
3
|
import { InvoicingDunningActionOption } from '../../../entity/invoicing/invoicingCommonPayload';
|
|
4
4
|
export interface InvoicingConfigViewState extends FetchedState {
|
|
5
5
|
acceptTermsFetchState: FetchStateAndError;
|
|
@@ -33,6 +33,12 @@ export interface InvoicingConfigViewState extends FetchedState {
|
|
|
33
33
|
subscriptionLifecycleActionOptions: InvoicingSubscriptionLifecycleActionOption[];
|
|
34
34
|
subscriptionMetadataEditAllowedFromStatuses: string[];
|
|
35
35
|
taxabilityOptions: InvoicingNamedOption[];
|
|
36
|
+
/**
|
|
37
|
+
* Allowed tier `Type` options per pricing model. `undefined` means the config
|
|
38
|
+
* has not been loaded yet — consumers disable the tier editor rather than
|
|
39
|
+
* falling back to a hardcoded model-to-type map.
|
|
40
|
+
*/
|
|
41
|
+
catalogTierTypeOptionsByPricingModel?: InvoicingNamedOptionsByKey;
|
|
36
42
|
createdAt?: string;
|
|
37
43
|
invoicingTosAcceptanceIp?: string;
|
|
38
44
|
invoicingTosAcceptanceTime?: string;
|
|
@@ -81,13 +81,18 @@ const profitAndLossProjectView = (0, toolkit_1.createSlice)({
|
|
|
81
81
|
draft.uiState.projectsToFilterOut = action.payload.projectsToFilterOut;
|
|
82
82
|
},
|
|
83
83
|
updateProfitAndLossProjectViewUIState(draft, action) {
|
|
84
|
-
const { nodeCollapseState, scrollPosition } = action.payload;
|
|
84
|
+
const { nodeCollapseState, scrollPosition, resetLeftScroll } = action.payload;
|
|
85
85
|
if (nodeCollapseState != null) {
|
|
86
86
|
draft.uiState.nodeCollapseState = Object.assign({}, draft.uiState.nodeCollapseState, {
|
|
87
87
|
[nodeCollapseState.nodeId]: nodeCollapseState.isCollapsed,
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
// Mutually exclusive: resetLeftScroll clears only scrollLeft from the
|
|
91
|
+
// recorded position, scrollPosition replaces the whole record.
|
|
92
|
+
if (resetLeftScroll === true && draft.uiState.scrollPosition != null) {
|
|
93
|
+
draft.uiState.scrollPosition.scrollLeft = undefined;
|
|
94
|
+
}
|
|
95
|
+
else if (scrollPosition != null) {
|
|
91
96
|
draft.uiState.scrollPosition = scrollPosition;
|
|
92
97
|
}
|
|
93
98
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getReimbursementCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
3
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
fetchState: import("../..").FetchState;
|
|
@@ -2,8 +2,8 @@ import { ReportID } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
|
2
2
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
3
3
|
import { ReportsResyncState } from './reportsResyncState';
|
|
4
4
|
export declare const initialReportsResyncState: ReportsResyncState;
|
|
5
|
-
export declare const initiateReportsResync: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reportIdToResync: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts"], {
|
|
6
|
-
reportIdToResync: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
5
|
+
export declare const initiateReportsResync: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[reportIdToResync: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts"], {
|
|
6
|
+
reportIdToResync: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
7
7
|
}, "initiateReportsResync/initiateReportsResync", never, never>, initiateReportsClassViewRefetching: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
8
|
reportIdToResync: ReportID;
|
|
9
9
|
}, "initiateReportsResync/initiateReportsClassViewRefetching">, initiateReportsProjectViewRefetching: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
@@ -163,7 +163,7 @@ const getCategoryValueForBill = (key, bill) => {
|
|
|
163
163
|
case 'dueDate':
|
|
164
164
|
return bill.dueDate;
|
|
165
165
|
case 'amount':
|
|
166
|
-
return bill.amount.amount;
|
|
166
|
+
return bill.totalAmountInUSD?.amount ?? bill.amount.amount;
|
|
167
167
|
case 'paymentMethod': {
|
|
168
168
|
const paymentMethodCode = bill.billPayInfo.billPaymentMethodType.code;
|
|
169
169
|
const paymentMethodSubCode = bill.billPayInfo.billPaymentMethodType.subCode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RootState } from '../../reducer';
|
|
2
2
|
export declare const getTasksCardReport: (state: RootState) => {
|
|
3
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
3
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
4
4
|
reportTitle: string;
|
|
5
5
|
version: string | number | undefined;
|
|
6
6
|
status: import("../..").Status | undefined;
|
|
@@ -4,7 +4,7 @@ import { RootState } from '../../reducer';
|
|
|
4
4
|
import { TopExReport, TopExTimePeriodWithMetaData } from './topExSelectorTypes';
|
|
5
5
|
import { TopExState } from './topExState';
|
|
6
6
|
export declare const getTopExpenses: (accountState: AccountState, topExState: TopExState, numberOfExpenses?: number) => {
|
|
7
|
-
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
7
|
+
reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "operating_expenses_by_projects" | "revenue" | "revenue_by_classes" | "revenue_by_projects" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "net_burn_or_income_by_projects" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "balance_sheet_by_classes" | "balance_sheet_by_projects" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts";
|
|
8
8
|
reportTitle: string;
|
|
9
9
|
version: string | number | undefined;
|
|
10
10
|
status: import("../..").Status | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.95-betaAK0",
|
|
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",
|