@zeniai/client-epic-state 4.14.5 → 4.14.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/billPay/billTransaction/billTransactionPayload.d.ts +1 -0
- package/lib/entity/billPay/billTransaction/billTransactionPayload.js +3 -0
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +6 -3
- package/lib/entity/billPay/billTransaction/billTransactionState.js +18 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/entity/toastNotification/epic/pushToastNotificationEpic.d.ts +1 -1
- package/lib/index.d.ts +11 -11
- package/lib/index.js +23 -15
- package/lib/view/bankAccountView/bankAccountViewReducer.d.ts +2 -2
- package/lib/view/cardPayment/epic/addCardPaymentSourceEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/confirmCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/createCardSetupIntentEpic.d.ts +1 -1
- package/lib/view/cardPayment/epic/fetchPaymentSourcesEpic.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +7 -4
- package/lib/view/expenseAutomationView/epics/common/refreshExpenseAutomationCurrentTabEpic.js +2 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/initializeTransactionCategorizationLocalDataEpic.js +3 -3
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.js +1 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/saveTransactionCategorizationEpic.js +1 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/updateTransactionCategorizationEpic.js +2 -1
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.d.ts +1 -3
- package/lib/view/expenseAutomationView/expenseAutomationViewReducer.js +2 -12
- package/lib/view/expenseAutomationView/expenseAutomationViewSelector.js +13 -12
- package/lib/view/expenseAutomationView/expenseAutomationViewState.d.ts +0 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -0
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +102 -65
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.d.ts +1 -2
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +20 -11
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +4 -1
- package/lib/view/people/changeZeniPersonRolesEpic.d.ts +1 -1
- package/lib/view/people/deletePersonEpic.d.ts +1 -1
- package/lib/view/people/invitePeopleEpic.d.ts +1 -1
- package/lib/view/people/inviteZeniPeopleEpic.d.ts +1 -1
- package/lib/view/people/resendInviteEpic.d.ts +1 -1
- package/lib/view/recommendation/fetchEntityRecommendationsByTransactionIdEpic.js +1 -1
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.d.ts +5 -1
- package/lib/view/spendManagement/billPay/billDetailView/billDetailViewSelector.js +22 -6
- package/lib/view/spendManagement/billPay/billList/billListReducer.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.d.ts +3 -2
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +54 -17
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +7 -2
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.js +18 -6
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.js +6 -0
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +9 -4
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.js +18 -4
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +2 -1
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +2 -0
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +8 -4
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +27 -5
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +4 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +33 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +6 -1
- package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js +16 -5
- package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +27 -13
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.d.ts +7 -3
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.js +48 -28
- package/lib/view/spendManagement/billPay/magicLinkView/magicLinkViewReducer.d.ts +2 -2
- package/lib/view/spendManagement/helpers.d.ts +2 -0
- package/lib/view/spendManagement/helpers.js +9 -1
- package/lib/view/tagView/epics/createTagEpic.d.ts +1 -1
- package/lib/view/tagView/epics/deleteTagEpic.d.ts +1 -1
- package/lib/view/transactionDetail/epics/uploadMissingReceiptSuccessEpic.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT = exports.SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT = exports.NEW_INTERNATIONAL_METHOD_SUBTEXT = exports.BILL_NEW_PAYMENT_METHODS = exports.toAccountTypeSubConfigCodeKeyType = exports.toAccType = exports.ACCOUNT_TYPE_CODES = exports.toBillPaymentSubConfigCodeType = exports.toBillPaymentSubConfigCodeKeyType = exports.INTERNATIONAL_SUB_CODES = exports.INTERNATIONAL_CODES = exports.toBillPaymentWireSubMethodCodeType = exports.BILL_PAYMENT_WIRE_SUB_CODES = exports.toPaymentAchSubMethodCodeType = exports.PAYMENT_ACH_SUB_CODES = exports.toBillPaymentMethodCodeType = exports.BILL_PAYMENT_METHOD_CODE = exports.toDynamicFeeType = exports.getBillPayConfigMethodKey = exports.getBillPayConfigKey = void 0;
|
|
3
|
+
exports.LOCAL_CURRENCY_INTERNATIONAL_METHOD_SUBTEXT = exports.SWIFT_OUR_INTERNATIONAL_METHOD_SUBTEXT = exports.NEW_INTERNATIONAL_METHOD_SUBTEXT = exports.BILL_NEW_PAYMENT_METHODS = exports.toAccountTypeSubConfigCodeKeyType = exports.toAccType = exports.ACCOUNT_TYPE_CODES = exports.toBillPaymentSubConfigCodeType = exports.toBillPaymentSubConfigCodeKeyType = exports.INTERNATIONAL_SUB_CODES = exports.INTERNATIONAL_CODES = exports.toBillPaymentOutsideZeniSubMethodCodeType = exports.BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES = exports.toBillPaymentWireSubMethodCodeType = exports.BILL_PAYMENT_WIRE_SUB_CODES = exports.toPaymentAchSubMethodCodeType = exports.PAYMENT_ACH_SUB_CODES = exports.toBillPaymentMethodCodeType = exports.BILL_PAYMENT_METHOD_CODE = exports.toDynamicFeeType = exports.getBillPayConfigMethodKey = exports.getBillPayConfigKey = void 0;
|
|
4
4
|
const common_1 = require("../../../../commonStateTypes/common");
|
|
5
5
|
const stringToUnion_1 = require("../../../../commonStateTypes/stringToUnion");
|
|
6
6
|
const getBillPayConfigKey = (method, subMethod) => {
|
|
@@ -10,7 +10,7 @@ const getBillPayConfigKey = (method, subMethod) => {
|
|
|
10
10
|
exports.getBillPayConfigKey = getBillPayConfigKey;
|
|
11
11
|
const getBillPayConfigMethodKey = (method, subMethod, accType, internationalMethod, internationalSubMethod) => {
|
|
12
12
|
const keys = ['billPay', method, subMethod];
|
|
13
|
-
if (accType != null) {
|
|
13
|
+
if (method !== 'outside-zeni' && accType != null) {
|
|
14
14
|
keys.push(accType);
|
|
15
15
|
}
|
|
16
16
|
if (internationalMethod != null) {
|
|
@@ -25,7 +25,11 @@ exports.getBillPayConfigMethodKey = getBillPayConfigMethodKey;
|
|
|
25
25
|
const DYNAMIC_FEE_TYPE = ['percent', 'fixed'];
|
|
26
26
|
const toDynamicFeeType = (v) => (0, stringToUnion_1.stringToUnion)(v, DYNAMIC_FEE_TYPE);
|
|
27
27
|
exports.toDynamicFeeType = toDynamicFeeType;
|
|
28
|
-
exports.BILL_PAYMENT_METHOD_CODE = [
|
|
28
|
+
exports.BILL_PAYMENT_METHOD_CODE = [
|
|
29
|
+
'ach',
|
|
30
|
+
'wire',
|
|
31
|
+
'outside-zeni',
|
|
32
|
+
];
|
|
29
33
|
const toBillPaymentMethodCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.BILL_PAYMENT_METHOD_CODE);
|
|
30
34
|
exports.toBillPaymentMethodCodeType = toBillPaymentMethodCodeType;
|
|
31
35
|
exports.PAYMENT_ACH_SUB_CODES = ['standard', 'same-day'];
|
|
@@ -44,6 +48,11 @@ const BILL_PAYMENT_WIRE_SUB_CODES_KEYS = [
|
|
|
44
48
|
'international',
|
|
45
49
|
];
|
|
46
50
|
const toBillPaymentWireSubMethodCodeKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, BILL_PAYMENT_WIRE_SUB_CODES_KEYS);
|
|
51
|
+
exports.BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES = ['outside-zeni'];
|
|
52
|
+
const toBillPaymentOutsideZeniSubMethodCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, exports.BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES);
|
|
53
|
+
exports.toBillPaymentOutsideZeniSubMethodCodeType = toBillPaymentOutsideZeniSubMethodCodeType;
|
|
54
|
+
const BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES_KEYS = ['outsideZeni'];
|
|
55
|
+
const toBillPaymentOutsideZeniSubMethodCodeKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES_KEYS);
|
|
47
56
|
exports.INTERNATIONAL_CODES = [
|
|
48
57
|
'usd-to-local-currency',
|
|
49
58
|
'usd-to-usd',
|
|
@@ -58,9 +67,14 @@ const toInternationalSubMethodCodeKeyType = (v) => (0, stringToUnion_1.stringToU
|
|
|
58
67
|
const toBillPaymentSubConfigCodeKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, [
|
|
59
68
|
...PAYMENT_ACH_SUB_CODES_KEYS,
|
|
60
69
|
...BILL_PAYMENT_WIRE_SUB_CODES_KEYS,
|
|
70
|
+
...BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES_KEYS,
|
|
61
71
|
]);
|
|
62
72
|
exports.toBillPaymentSubConfigCodeKeyType = toBillPaymentSubConfigCodeKeyType;
|
|
63
|
-
const toBillPaymentSubConfigCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, [
|
|
73
|
+
const toBillPaymentSubConfigCodeType = (v) => (0, stringToUnion_1.stringToUnion)(v, [
|
|
74
|
+
...exports.PAYMENT_ACH_SUB_CODES,
|
|
75
|
+
...exports.BILL_PAYMENT_WIRE_SUB_CODES,
|
|
76
|
+
...exports.BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES,
|
|
77
|
+
]);
|
|
64
78
|
exports.toBillPaymentSubConfigCodeType = toBillPaymentSubConfigCodeType;
|
|
65
79
|
exports.ACCOUNT_TYPE_CODES = [
|
|
66
80
|
'deposit_account',
|
|
@@ -5,7 +5,7 @@ import { BillPayInfo, BillTransaction } from '../../../../entity/billPay/billTra
|
|
|
5
5
|
import { Attachment } from '../../../../entity/transaction/stateTypes/attachment';
|
|
6
6
|
import { TransactionWithAccountAndClassLine } from '../../../../entity/transaction/stateTypes/transactionLine';
|
|
7
7
|
import { Vendor } from '../../../../entity/vendor/vendorState';
|
|
8
|
-
import { RecurringBillConfigLocalData } from '../editBillView/editBillViewState';
|
|
8
|
+
import { RecurringBillConfigLocalData, OutsideZeniPaymentLocalData } from '../editBillView/editBillViewState';
|
|
9
9
|
import { PaymentDetailsSectionView } from '../editBillView/editBillViewSelector';
|
|
10
10
|
import { Amount } from '../../../../commonStateTypes/amount';
|
|
11
11
|
import { BillPayConfig } from '../billPayConfig/billPayConfigState';
|
|
@@ -29,6 +29,7 @@ export interface BillPayReviewSelectorView extends SelectorView {
|
|
|
29
29
|
recurringBillInstance?: number;
|
|
30
30
|
recurringConfig?: RecurringBillConfigLocalData;
|
|
31
31
|
isBillMarkedForRetry?: boolean;
|
|
32
|
+
outsideZeniPaymentInfo?: OutsideZeniPaymentLocalData;
|
|
32
33
|
}
|
|
33
34
|
export interface DuplicateBillsSelectorView extends SelectorView {
|
|
34
35
|
bills: BillTransaction[];
|
|
@@ -158,6 +158,7 @@ const getReviewPageBillDetail = (state, billId) => {
|
|
|
158
158
|
currencyCode: (_u = (_t = sourceBillDetail.billDetailLocalData.recipientTotalAmount) === null || _t === void 0 ? void 0 : _t.currencyCode) !== null && _u !== void 0 ? _u : 'USD',
|
|
159
159
|
currencySymbol: (_w = (_v = sourceBillDetail.billDetailLocalData.recipientTotalAmount) === null || _v === void 0 ? void 0 : _v.currencySymbol) !== null && _w !== void 0 ? _w : '$',
|
|
160
160
|
};
|
|
161
|
+
const outsideZeniPaymentInfo = sourceBillDetail.billDetailLocalData.outsideZeniPaymentLocalData;
|
|
161
162
|
return {
|
|
162
163
|
version: 0,
|
|
163
164
|
duplicateBillTransactions: bills,
|
|
@@ -180,6 +181,7 @@ const getReviewPageBillDetail = (state, billId) => {
|
|
|
180
181
|
isBillMarkedForRetry,
|
|
181
182
|
zeniAssistRetryStatus,
|
|
182
183
|
billPayInfo,
|
|
184
|
+
outsideZeniPaymentInfo,
|
|
183
185
|
};
|
|
184
186
|
};
|
|
185
187
|
exports.getReviewPageBillDetail = getReviewPageBillDetail;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
2
|
-
import { AddBillAutoFields, EditBillDetailViewState, BillDetailLocalData } from './editBillViewState';
|
|
2
|
+
import { AddBillAutoFields, EditBillDetailViewState, BillDetailLocalData, OutsideZeniPaymentLocalData } from './editBillViewState';
|
|
3
3
|
import { FetchState, FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
4
4
|
import { InvoiceProcessingPayload } from './editBillViewPayload';
|
|
5
5
|
import { AmountPayload } from '../../../../entity/reimbursement/reimbursementPayload';
|
|
@@ -26,11 +26,10 @@ export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionC
|
|
|
26
26
|
billId?: string | undefined;
|
|
27
27
|
}, string>, discardBillUpdatesInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
28
28
|
billId?: string | undefined;
|
|
29
|
-
}, string>, saveBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billStageCode: "paid" | "pending_approval" | "scheduled" | "draft",
|
|
29
|
+
}, string>, saveBillDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[billStageCode: "paid" | "pending_approval" | "scheduled" | "draft", isForMarkAsPaid: boolean, billId?: string | undefined], {
|
|
30
30
|
billStageCode: "paid" | "pending_approval" | "scheduled" | "draft";
|
|
31
|
-
|
|
31
|
+
isForMarkAsPaid: boolean;
|
|
32
32
|
billId: string | undefined;
|
|
33
|
-
isLocalCurrencyEnabled: boolean | undefined;
|
|
34
33
|
}, string, never, never>, saveBillSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[fetchState: FetchState, billId?: string | undefined, error?: ZeniAPIStatus<Record<string, unknown>> | undefined], {
|
|
35
34
|
fetchState: FetchState;
|
|
36
35
|
billId: string | undefined;
|
|
@@ -77,6 +76,11 @@ export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionC
|
|
|
77
76
|
billId: string | undefined;
|
|
78
77
|
}, string, never, never>, markBillForRetry: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
79
78
|
billId: ID;
|
|
79
|
+
}, string>, updateOutsideZeniPaymentLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
80
|
+
data: OutsideZeniPaymentLocalData;
|
|
81
|
+
billId?: string | undefined;
|
|
82
|
+
}, string>, discardOutsideZeniPaymentLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
83
|
+
billId?: string | undefined;
|
|
80
84
|
}, string>;
|
|
81
85
|
declare const _default: import("@reduxjs/toolkit").Reducer<EditBillDetailViewState, import("@reduxjs/toolkit").AnyAction>;
|
|
82
86
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.markBillForRetry = exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = exports.fetchVendorAndUpdateBillLocalData = exports.updateHomeCurrencyConversion = exports.currencyConversionValueSuccessOrFailure = exports.convertAmountToHomeCurrency = exports.updateVendorContactSuccessOrFailure = exports.updateVendorContact = exports.updateSuggestedVendorIdFromParsedInvoice = exports.updateRecommendedVendorId = exports.updateBillUploadFetchState = exports.updateAddBillAutoFields = exports.updateShowAutofill = exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = exports.waitForVendorByNameThenParsetoLocalStore = exports.waitForBillDetailThenInitializeLocalStore = exports.clearEditBillViewDetail = exports.parseInvoiceToBill = exports.updateEditBillFetchStateCompleted = exports.saveBillSuccessOrFailure = exports.saveBillDetail = exports.discardBillUpdatesInLocalStore = exports.saveBillUpdatesToLocalStore = exports.initializeBillToLocalStore = exports.fetchVendorByNameAndParseInvoice = exports.fetchBillAndInitializeLocalStore = exports.fetchEditBillDetailPage = exports.initialState = void 0;
|
|
4
|
+
exports.discardOutsideZeniPaymentLocalData = exports.updateOutsideZeniPaymentLocalData = exports.markBillForRetry = exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = exports.fetchVendorAndUpdateBillLocalData = exports.updateHomeCurrencyConversion = exports.currencyConversionValueSuccessOrFailure = exports.convertAmountToHomeCurrency = exports.updateVendorContactSuccessOrFailure = exports.updateVendorContact = exports.updateSuggestedVendorIdFromParsedInvoice = exports.updateRecommendedVendorId = exports.updateBillUploadFetchState = exports.updateAddBillAutoFields = exports.updateShowAutofill = exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = exports.waitForVendorByNameThenParsetoLocalStore = exports.waitForBillDetailThenInitializeLocalStore = exports.clearEditBillViewDetail = exports.parseInvoiceToBill = exports.updateEditBillFetchStateCompleted = exports.saveBillSuccessOrFailure = exports.saveBillDetail = exports.discardBillUpdatesInLocalStore = exports.saveBillUpdatesToLocalStore = exports.initializeBillToLocalStore = exports.fetchVendorByNameAndParseInvoice = exports.fetchBillAndInitializeLocalStore = exports.fetchEditBillDetailPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const editBillViewState_1 = require("./editBillViewState");
|
|
7
7
|
const billDetailViewState_1 = require("../billDetailView/billDetailViewState");
|
|
@@ -131,6 +131,29 @@ const editBillView = (0, toolkit_1.createSlice)({
|
|
|
131
131
|
delete draft.newBillState.suggestedVendorIdFromParsedInvoice;
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
|
+
updateOutsideZeniPaymentLocalData(draft, action) {
|
|
135
|
+
const { billId, data } = action.payload;
|
|
136
|
+
if (billId != null) {
|
|
137
|
+
const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
|
|
138
|
+
draft.editBillStateById[key].billDetailLocalData.outsideZeniPaymentLocalData = Object.assign({}, data);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
draft.newBillState.billDetailLocalData.outsideZeniPaymentLocalData = Object.assign({}, data);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
discardOutsideZeniPaymentLocalData(draft, action) {
|
|
145
|
+
const { billId } = action.payload;
|
|
146
|
+
if (billId != null) {
|
|
147
|
+
const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
|
|
148
|
+
delete draft.editBillStateById[key].billDetailLocalData
|
|
149
|
+
.outsideZeniPaymentLocalData;
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
draft.newBillState = editBillViewState_1.initialBillDetail;
|
|
153
|
+
delete draft.newBillState.billDetailLocalData
|
|
154
|
+
.outsideZeniPaymentLocalData;
|
|
155
|
+
}
|
|
156
|
+
},
|
|
134
157
|
// Fire this action to save the latest bill data in ZENI Platform.
|
|
135
158
|
saveBillDetail: {
|
|
136
159
|
reducer(draft, action) {
|
|
@@ -149,13 +172,12 @@ const editBillView = (0, toolkit_1.createSlice)({
|
|
|
149
172
|
} });
|
|
150
173
|
}
|
|
151
174
|
},
|
|
152
|
-
prepare(billStageCode,
|
|
175
|
+
prepare(billStageCode, isForMarkAsPaid, billId) {
|
|
153
176
|
return {
|
|
154
177
|
payload: {
|
|
155
178
|
billStageCode,
|
|
156
|
-
|
|
179
|
+
isForMarkAsPaid,
|
|
157
180
|
billId,
|
|
158
|
-
isLocalCurrencyEnabled,
|
|
159
181
|
},
|
|
160
182
|
};
|
|
161
183
|
},
|
|
@@ -349,7 +371,7 @@ const editBillView = (0, toolkit_1.createSlice)({
|
|
|
349
371
|
},
|
|
350
372
|
},
|
|
351
373
|
});
|
|
352
|
-
_a = editBillView.actions, exports.fetchEditBillDetailPage = _a.fetchEditBillDetailPage, exports.fetchBillAndInitializeLocalStore = _a.fetchBillAndInitializeLocalStore, exports.fetchVendorByNameAndParseInvoice = _a.fetchVendorByNameAndParseInvoice, exports.initializeBillToLocalStore = _a.initializeBillToLocalStore, exports.saveBillUpdatesToLocalStore = _a.saveBillUpdatesToLocalStore, exports.discardBillUpdatesInLocalStore = _a.discardBillUpdatesInLocalStore, exports.saveBillDetail = _a.saveBillDetail, exports.saveBillSuccessOrFailure = _a.saveBillSuccessOrFailure, exports.updateEditBillFetchStateCompleted = _a.updateEditBillFetchStateCompleted, exports.parseInvoiceToBill = _a.parseInvoiceToBill, exports.clearEditBillViewDetail = _a.clearEditBillViewDetail, exports.waitForBillDetailThenInitializeLocalStore = _a.waitForBillDetailThenInitializeLocalStore, exports.waitForVendorByNameThenParsetoLocalStore = _a.waitForVendorByNameThenParsetoLocalStore, exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = _a.updateInternationalTransferFeeBearerPaymentMethodInLocalData, exports.updateShowAutofill = _a.updateShowAutofill, exports.updateAddBillAutoFields = _a.updateAddBillAutoFields, exports.updateBillUploadFetchState = _a.updateBillUploadFetchState, exports.updateRecommendedVendorId = _a.updateRecommendedVendorId, exports.updateSuggestedVendorIdFromParsedInvoice = _a.updateSuggestedVendorIdFromParsedInvoice, exports.updateVendorContact = _a.updateVendorContact, exports.updateVendorContactSuccessOrFailure = _a.updateVendorContactSuccessOrFailure, exports.convertAmountToHomeCurrency = _a.convertAmountToHomeCurrency, exports.currencyConversionValueSuccessOrFailure = _a.currencyConversionValueSuccessOrFailure, exports.updateHomeCurrencyConversion = _a.updateHomeCurrencyConversion, exports.fetchVendorAndUpdateBillLocalData = _a.fetchVendorAndUpdateBillLocalData, exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = _a.waitForVendorByIdThenSaveBillUpdatetoLocalStore, exports.markBillForRetry = _a.markBillForRetry;
|
|
374
|
+
_a = editBillView.actions, exports.fetchEditBillDetailPage = _a.fetchEditBillDetailPage, exports.fetchBillAndInitializeLocalStore = _a.fetchBillAndInitializeLocalStore, exports.fetchVendorByNameAndParseInvoice = _a.fetchVendorByNameAndParseInvoice, exports.initializeBillToLocalStore = _a.initializeBillToLocalStore, exports.saveBillUpdatesToLocalStore = _a.saveBillUpdatesToLocalStore, exports.discardBillUpdatesInLocalStore = _a.discardBillUpdatesInLocalStore, exports.saveBillDetail = _a.saveBillDetail, exports.saveBillSuccessOrFailure = _a.saveBillSuccessOrFailure, exports.updateEditBillFetchStateCompleted = _a.updateEditBillFetchStateCompleted, exports.parseInvoiceToBill = _a.parseInvoiceToBill, exports.clearEditBillViewDetail = _a.clearEditBillViewDetail, exports.waitForBillDetailThenInitializeLocalStore = _a.waitForBillDetailThenInitializeLocalStore, exports.waitForVendorByNameThenParsetoLocalStore = _a.waitForVendorByNameThenParsetoLocalStore, exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = _a.updateInternationalTransferFeeBearerPaymentMethodInLocalData, exports.updateShowAutofill = _a.updateShowAutofill, exports.updateAddBillAutoFields = _a.updateAddBillAutoFields, exports.updateBillUploadFetchState = _a.updateBillUploadFetchState, exports.updateRecommendedVendorId = _a.updateRecommendedVendorId, exports.updateSuggestedVendorIdFromParsedInvoice = _a.updateSuggestedVendorIdFromParsedInvoice, exports.updateVendorContact = _a.updateVendorContact, exports.updateVendorContactSuccessOrFailure = _a.updateVendorContactSuccessOrFailure, exports.convertAmountToHomeCurrency = _a.convertAmountToHomeCurrency, exports.currencyConversionValueSuccessOrFailure = _a.currencyConversionValueSuccessOrFailure, exports.updateHomeCurrencyConversion = _a.updateHomeCurrencyConversion, exports.fetchVendorAndUpdateBillLocalData = _a.fetchVendorAndUpdateBillLocalData, exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = _a.waitForVendorByIdThenSaveBillUpdatetoLocalStore, exports.markBillForRetry = _a.markBillForRetry, exports.updateOutsideZeniPaymentLocalData = _a.updateOutsideZeniPaymentLocalData, exports.discardOutsideZeniPaymentLocalData = _a.discardOutsideZeniPaymentLocalData;
|
|
353
375
|
exports.default = editBillView.reducer;
|
|
354
376
|
function doUpdateRecurringBillLocalData(billDetail, currentConfig, prevConfig) {
|
|
355
377
|
var _a, _b, _c, _d;
|
|
@@ -12,7 +12,7 @@ import { ClassListSelectorView } from '../../../classList/classListSelector';
|
|
|
12
12
|
import { PreviousBillsSelectorView } from '../previousBills/previousBillsSelector';
|
|
13
13
|
import { AddBillAutoFields, PaymentDetailsSection, WhatForSection, PaymentModeType, PaymentMode, RecurringBillConfigLocalData, RecurringBillInstance } from './editBillViewState';
|
|
14
14
|
import { BillActivity } from '../billDetailView/billDetailViewSelector';
|
|
15
|
-
import { BillPaySetupApproverView } from '../billPaySetupApproverView/billPaySetupApproverViewSelectorTypes';
|
|
15
|
+
import { ApprovalRuleWithUser, BillPaySetupApproverView } from '../billPaySetupApproverView/billPaySetupApproverViewSelectorTypes';
|
|
16
16
|
import { User } from '../../../../entity/user/userState';
|
|
17
17
|
import { BillPayConfig, BillPayConfigState, AccountTypeSubConfigCodeKeyType } from '../billPayConfig/billPayConfigState';
|
|
18
18
|
import { ActivityHistorySelectorView } from '../../commonHistoryView/commonHistorySelector';
|
|
@@ -27,6 +27,7 @@ import { ClassBase, RecommendedClassBase } from '../../../../entity/class/classS
|
|
|
27
27
|
import { RecurringBillState } from '../../../../entity/billPay/recurringBills/recurringBillsState';
|
|
28
28
|
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
29
29
|
import { AllowedValueWithCode } from '../../../../commonStateTypes/allowedValue';
|
|
30
|
+
import { LoggedInUser } from '../../../../entity/tenant/tenantState';
|
|
30
31
|
export declare type PaymentToOption = {
|
|
31
32
|
id: ID;
|
|
32
33
|
type: PaymentModeType;
|
|
@@ -120,7 +121,7 @@ export interface EditBillInitialDetails {
|
|
|
120
121
|
}
|
|
121
122
|
export declare const getEditBillDetail: (state: RootState, isVendorRecommendationFeatureEnabled: boolean, isZeniAccountsEnabled: boolean, billId?: string | undefined) => EditBillDetailSelectorView;
|
|
122
123
|
export declare const getBillPayConfigList: (billPayConfigState: BillPayConfigState) => BillPayConfig[];
|
|
123
|
-
export declare const getPaymentMethodType: (billPayConfigState: BillPayConfigState, accType
|
|
124
|
+
export declare const getPaymentMethodType: (billPayConfigState: BillPayConfigState, accType?: "depositAccount" | "paymentAccount" | undefined, paymentMethod?: BillPaymentMethod | undefined, internationalTransferFeeBearerPaymentMethod?: "swift_our" | "swift_sha" | undefined) => BillPayConfig | undefined;
|
|
124
125
|
export declare function getWhatForSection(updatedWhatForSection: WhatForSection | undefined): WhatForSection;
|
|
125
126
|
export declare function getPaymentSection(state: RootState, withdrawFromList: FundingAccount[], updatedPaymentSection: PaymentDetailsSection, companyId?: string, billPayInfo?: BillPayInfo): PaymentDetailsSectionView;
|
|
126
127
|
export declare function toPaymentToOption(paymentMode: PaymentMode): PaymentToOption;
|
|
@@ -148,3 +149,4 @@ export declare const getDefaultWithdrawFromAccount: (state: RootState, depositAc
|
|
|
148
149
|
accountId: ID;
|
|
149
150
|
accountType: AccountTypeSubConfigCodeKeyType;
|
|
150
151
|
} | undefined) => FundingAccount | undefined;
|
|
152
|
+
export declare const checkIfCreatorIsApprover: (billAmount: number, approvalRules: ApprovalRuleWithUser[], signedInUser?: LoggedInUser | undefined) => boolean;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getDefaultWithdrawFromAccount = exports.getWithdrawFrom = exports.getDueDate = exports.getInvoiceDate = exports.getRecurringBillLocalData = exports.toPaymentToOption = exports.getPaymentSection = exports.getWhatForSection = exports.getPaymentMethodType = exports.getBillPayConfigList = exports.getEditBillDetail = void 0;
|
|
6
|
+
exports.checkIfCreatorIsApprover = exports.getDefaultWithdrawFromAccount = exports.getWithdrawFrom = exports.getDueDate = exports.getInvoiceDate = exports.getRecurringBillLocalData = exports.toPaymentToOption = exports.getPaymentSection = exports.getWhatForSection = exports.getPaymentMethodType = exports.getBillPayConfigList = exports.getEditBillDetail = void 0;
|
|
7
7
|
const get_1 = __importDefault(require("lodash/get"));
|
|
8
8
|
const has_1 = __importDefault(require("lodash/has"));
|
|
9
9
|
const reduceFetchState_1 = require("../../../../commonStateTypes/reduceFetchState");
|
|
@@ -406,6 +406,10 @@ const getBillPayConfigList = (billPayConfigState) => {
|
|
|
406
406
|
});
|
|
407
407
|
break;
|
|
408
408
|
}
|
|
409
|
+
case 'outside-zeni': {
|
|
410
|
+
billPayConfigState_1.BILL_PAYMENT_OUTSIDE_ZENI_SUB_CODES.forEach((subCode) => billPayConfigKeys.push((0, billPayConfigState_1.getBillPayConfigMethodKey)(code, (0, billPayConfigPayload_1.getBillPaymentSubConfigCodeKey)(subCode))));
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
409
413
|
}
|
|
410
414
|
});
|
|
411
415
|
return (0, billPayConfigSelector_1.getBillPayConfigByKeys)(billPayConfigState, billPayConfigKeys);
|
|
@@ -455,7 +459,11 @@ function getPaymentSection(state, withdrawFromList, updatedPaymentSection, compa
|
|
|
455
459
|
: (0, exports.getWithdrawFrom)(state, billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.fromAccount.billAccountId, billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.fromAccount.billAccountType, companyId !== null && companyId !== void 0 ? companyId : '', state.billPayConfigState.lastSelectedFromAccount);
|
|
456
460
|
const withdrawFromAccountingName = undefined;
|
|
457
461
|
const availablePaymentOptions = state.billPayConfigState.fetchState === 'Completed'
|
|
458
|
-
? (0, exports.getBillPayConfigList)(state.billPayConfigState).filter((option) => {
|
|
462
|
+
? (0, exports.getBillPayConfigList)(state.billPayConfigState).filter((option) => {
|
|
463
|
+
var _a;
|
|
464
|
+
return (0, helpers_1.isPaymentMethodOutsideZeni)(option.method) ||
|
|
465
|
+
option.method.includes((_a = withdrawFrom === null || withdrawFrom === void 0 ? void 0 : withdrawFrom.accType) !== null && _a !== void 0 ? _a : '');
|
|
466
|
+
})
|
|
459
467
|
: [];
|
|
460
468
|
const isSinglePaymentTypeOption = availablePaymentOptions.length === 1;
|
|
461
469
|
return {
|
|
@@ -664,3 +672,26 @@ const getDefaultWithdrawFromAccount = (state, depositAccounts, companyId, lastSe
|
|
|
664
672
|
return undefined;
|
|
665
673
|
};
|
|
666
674
|
exports.getDefaultWithdrawFromAccount = getDefaultWithdrawFromAccount;
|
|
675
|
+
const checkIfCreatorIsApprover = (billAmount, approvalRules, signedInUser) => {
|
|
676
|
+
let isCreatorAlsoApprover = false;
|
|
677
|
+
const approvalRule = approvalRules.find((rule) => {
|
|
678
|
+
const { max, min } = rule.criteria[0].range;
|
|
679
|
+
return (billAmount > min.amount &&
|
|
680
|
+
((max === null || max === void 0 ? void 0 : max.amount) != null ? billAmount <= (max === null || max === void 0 ? void 0 : max.amount) : true));
|
|
681
|
+
});
|
|
682
|
+
if (approvalRule != null) {
|
|
683
|
+
const requireApprovalSteps = approvalRule.steps.filter((step) => step.action === 'require_approval');
|
|
684
|
+
if (requireApprovalSteps.length === 1) {
|
|
685
|
+
const requiredStep = requireApprovalSteps[0];
|
|
686
|
+
const stepOperator = requiredStep.operator;
|
|
687
|
+
if (stepOperator === 'or' || stepOperator === 'is') {
|
|
688
|
+
const approvers = requiredStep.actors;
|
|
689
|
+
if (approvers.some((user) => user.userId === (signedInUser === null || signedInUser === void 0 ? void 0 : signedInUser.userId))) {
|
|
690
|
+
isCreatorAlsoApprover = true;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
return isCreatorAlsoApprover;
|
|
696
|
+
};
|
|
697
|
+
exports.checkIfCreatorIsApprover = checkIfCreatorIsApprover;
|
|
@@ -7,7 +7,7 @@ import { Vendor } from '../../../../entity/vendor/vendorState';
|
|
|
7
7
|
import { ZeniDate } from '../../../../zeniDayJS';
|
|
8
8
|
import { BillTransactionDetailKey } from '../billDetailView/billDetailViewState';
|
|
9
9
|
import { LineItemOnlyRecommendationsLocalData, LineItemRecommendationsLocalData } from './editBillViewSelector';
|
|
10
|
-
import { InternationalTransferFeeBearerPaymentMethod, BillStage } from '../../../../entity/billPay/billTransaction/billTransactionState';
|
|
10
|
+
import { InternationalTransferFeeBearerPaymentMethod, BillStage, OutsideZeniPaymentModeType } from '../../../../entity/billPay/billTransaction/billTransactionState';
|
|
11
11
|
import { PaymentInstrument } from '../../../../entity/paymentInstrument/paymentInstrument';
|
|
12
12
|
import { BankAccount } from '../../../../entity/bankAccount/bankAccount';
|
|
13
13
|
import { Contact } from '../../../../entity/billPay/contact/contact';
|
|
@@ -66,6 +66,7 @@ export interface BillDetailLocalData {
|
|
|
66
66
|
isRecurring: boolean;
|
|
67
67
|
recurringConfig?: RecurringBillConfigLocalData;
|
|
68
68
|
recurringBillInstances?: RecurringBillInstance[];
|
|
69
|
+
outsideZeniPaymentLocalData?: OutsideZeniPaymentLocalData;
|
|
69
70
|
}
|
|
70
71
|
export interface WhatForSection {
|
|
71
72
|
invoiceNumber?: string;
|
|
@@ -111,4 +112,8 @@ export interface RecurringBillConfigLocalData {
|
|
|
111
112
|
isActive: boolean;
|
|
112
113
|
updateRecurringBills?: EditRecurringBillType;
|
|
113
114
|
}
|
|
115
|
+
export interface OutsideZeniPaymentLocalData {
|
|
116
|
+
paymentMode?: OutsideZeniPaymentModeType;
|
|
117
|
+
paymentDate?: ZeniDate;
|
|
118
|
+
}
|
|
114
119
|
export {};
|
package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js
CHANGED
|
@@ -17,6 +17,7 @@ const classListSelector_1 = require("../../../../classList/classListSelector");
|
|
|
17
17
|
const workingDayHelper_1 = require("../../../../../commonStateTypes/workingDayHelper");
|
|
18
18
|
const zeniDayJS_1 = require("../../../../../zeniDayJS");
|
|
19
19
|
const companySelector_1 = require("../../../../../entity/company/companySelector");
|
|
20
|
+
const helpers_1 = require("../../../helpers");
|
|
20
21
|
const isClassRecommendation = (recommendations, classObj) => {
|
|
21
22
|
if (classObj == null) {
|
|
22
23
|
return false;
|
|
@@ -90,7 +91,7 @@ const getLineRecommendationsLocalData = (lineId, line, recommendations, accountL
|
|
|
90
91
|
};
|
|
91
92
|
exports.getLineRecommendationsLocalData = getLineRecommendationsLocalData;
|
|
92
93
|
const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.initializeBillToLocalStore.match), (0, operators_1.mergeMap)((action) => {
|
|
93
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l
|
|
94
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
94
95
|
const { billId } = action.payload;
|
|
95
96
|
const state = state$.value;
|
|
96
97
|
const detailKey = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
|
|
@@ -158,10 +159,12 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
158
159
|
const isPayNowEnabled = payNowCutOffTime != null
|
|
159
160
|
? (0, zeniDayJS_1.dateNow)().isSameOrBefore(payNowCutOffTime)
|
|
160
161
|
: false;
|
|
162
|
+
const paymentDate = (_h = transaction.billPayInfo.paymentDate) !== null && _h !== void 0 ? _h : (0, zeniDayJS_1.date)((0, workingDayHelper_1.getNextNthWorkingDay)((0, zeniDayJS_1.dateNow)().toDate(), [0, 6], isPayNowEnabled ? 0 : 1).toISOString());
|
|
161
163
|
const paymentDetailsSection = {
|
|
162
|
-
paymentType: (0, editBillViewSelector_1.getPaymentMethodType)(state.billPayConfigState,
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
paymentType: (0, editBillViewSelector_1.getPaymentMethodType)(state.billPayConfigState, transaction.billPayInfo.fromAccount.billAccountType, //Check default conditions if any
|
|
165
|
+
transaction.billPayInfo.billPaymentMethodType, transaction.billPayInfo.internationalTransferFeeBearerPaymentMethod),
|
|
166
|
+
paymentDate,
|
|
167
|
+
withdrawFrom: (0, editBillViewSelector_1.getWithdrawFrom)(state, (_j = transaction.billPayInfo.fromAccount.billAccountId) !== null && _j !== void 0 ? _j : '', (_k = transaction.billPayInfo.fromAccount.billAccountType) !== null && _k !== void 0 ? _k : '', companyId),
|
|
165
168
|
paymentTo: transaction.billPayInfo.toAccount.billAccountId != null &&
|
|
166
169
|
transaction.billPayInfo.toAccount.billAccountId.length > 0
|
|
167
170
|
? transaction.billPayInfo.toAccount.billAccountId
|
|
@@ -171,7 +174,7 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
171
174
|
const totalAmount = transaction.amount;
|
|
172
175
|
const recipientTotalAmount = transaction.recipientTotalAmount;
|
|
173
176
|
const isCancelled = transaction.billPayInfo.isCancelled;
|
|
174
|
-
const file = (
|
|
177
|
+
const file = (_l = transaction.attachments) === null || _l === void 0 ? void 0 : _l[0];
|
|
175
178
|
const candidateVendorname = transaction.candidateVendorName;
|
|
176
179
|
const toAccountVendorEmail = transaction.billPayInfo.toAccountVendorEmail;
|
|
177
180
|
const isCollectToAccountInfoFromVendorContact = transaction.billPayInfo.isCollectToAccountInfoFromVendorContact;
|
|
@@ -183,6 +186,13 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
183
186
|
recurringConfig = recurringConfigLocalData;
|
|
184
187
|
recurringBillInstances = recurringBillInstancesLocalData;
|
|
185
188
|
}
|
|
189
|
+
const isPaymentOutsideZeni = (0, helpers_1.isPaymentMethodOutsideZeni)(transaction.billPayInfo.billPaymentMethodType.code);
|
|
190
|
+
const outsideZeniPaymentLocalData = isPaymentOutsideZeni
|
|
191
|
+
? {
|
|
192
|
+
paymentMode: transaction.billPayInfo.outsideZeniTransactionPaymentMode,
|
|
193
|
+
paymentDate: transaction.billPayInfo.paymentDate,
|
|
194
|
+
}
|
|
195
|
+
: undefined;
|
|
186
196
|
const billDetailLocalData = {
|
|
187
197
|
showVendorGptRecommendationText: false,
|
|
188
198
|
vendor,
|
|
@@ -199,6 +209,7 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
199
209
|
isRecurring,
|
|
200
210
|
recurringConfig,
|
|
201
211
|
recurringBillInstances,
|
|
212
|
+
outsideZeniPaymentLocalData,
|
|
202
213
|
};
|
|
203
214
|
const actions = [
|
|
204
215
|
(0, editBillViewReducer_1.saveBillUpdatesToLocalStore)({ billDetailLocalData, billId }),
|
|
@@ -28,6 +28,7 @@ const billPayConfigPayload_1 = require("../../billPayConfig/billPayConfigPayload
|
|
|
28
28
|
const billTransactionState_1 = require("../../../../../entity/billPay/billTransaction/billTransactionState");
|
|
29
29
|
const workingDayHelper_1 = require("../../../../../commonStateTypes/workingDayHelper");
|
|
30
30
|
const companySelector_1 = require("../../../../../entity/company/companySelector");
|
|
31
|
+
const helpers_1 = require("../../../helpers");
|
|
31
32
|
const parseInvoiceToBillEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(editBillViewReducer_1.parseInvoiceToBill.match), (0, operators_1.mergeMap)((action) => {
|
|
32
33
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
33
34
|
const { invoiceProcessingPayload, isVendorRecommendationFeatureEnabled } = action.payload;
|
|
@@ -144,7 +145,7 @@ const parseInvoiceToBillEpic = (actions$, state$) => actions$.pipe((0, operators
|
|
|
144
145
|
}));
|
|
145
146
|
exports.parseInvoiceToBillEpic = parseInvoiceToBillEpic;
|
|
146
147
|
const toBillDetailLocalData = (state, showVendorGptRecommendationText, billPayload, vendor, recommendedVendorId) => {
|
|
147
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
|
|
148
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
148
149
|
const currency = {
|
|
149
150
|
currencyCode: (_a = billPayload.recipient_currency_code) !== null && _a !== void 0 ? _a : '',
|
|
150
151
|
currencySymbol: (_b = billPayload.recipient_currency_symbol) !== null && _b !== void 0 ? _b : '', //api not returning symbol
|
|
@@ -225,6 +226,18 @@ const toBillDetailLocalData = (state, showVendorGptRecommendationText, billPaylo
|
|
|
225
226
|
? (0, billPayConfigPayload_1.getInternationalSubConfigCodeKey)(internationalSubCode)
|
|
226
227
|
: undefined))
|
|
227
228
|
: undefined;
|
|
229
|
+
const isPaymentOutsideZeni = (0, helpers_1.isPaymentMethodOutsideZeni)(paymentMethodCode !== null && paymentMethodCode !== void 0 ? paymentMethodCode : '');
|
|
230
|
+
const outsideZeniPaymentMode = (_o = billPayload.bill_pay_info) === null || _o === void 0 ? void 0 : _o.outside_zeni_transaction_payment_mode;
|
|
231
|
+
const outsideZeniPaymentLocalData = isPaymentOutsideZeni
|
|
232
|
+
? {
|
|
233
|
+
paymentMode: outsideZeniPaymentMode != null
|
|
234
|
+
? (0, billTransactionState_1.toOutsideZeniPaymentModeType)(outsideZeniPaymentMode)
|
|
235
|
+
: undefined,
|
|
236
|
+
paymentDate: ((_p = billPayload.bill_pay_info) === null || _p === void 0 ? void 0 : _p.payment_date) != null
|
|
237
|
+
? (0, zeniDayJS_1.date)((_q = billPayload.bill_pay_info) === null || _q === void 0 ? void 0 : _q.payment_date)
|
|
238
|
+
: undefined,
|
|
239
|
+
}
|
|
240
|
+
: undefined;
|
|
228
241
|
return {
|
|
229
242
|
recommendedVendorId,
|
|
230
243
|
showVendorGptRecommendationText,
|
|
@@ -245,30 +258,31 @@ const toBillDetailLocalData = (state, showVendorGptRecommendationText, billPaylo
|
|
|
245
258
|
paymentDetailsSection: {
|
|
246
259
|
paymentTo: undefined,
|
|
247
260
|
paymentType: paymentType,
|
|
248
|
-
paymentDate: ((
|
|
249
|
-
? (0, zeniDayJS_1.date)((
|
|
261
|
+
paymentDate: ((_r = billPayload.bill_pay_info) === null || _r === void 0 ? void 0 : _r.payment_date) != null
|
|
262
|
+
? (0, zeniDayJS_1.date)((_s = billPayload.bill_pay_info) === null || _s === void 0 ? void 0 : _s.payment_date)
|
|
250
263
|
: (0, zeniDayJS_1.date)((0, workingDayHelper_1.getNextNthWorkingDay)((0, zeniDayJS_1.dateNow)().toDate(), [0, 6], isPayNowEnabled ? 0 : 1).toISOString()),
|
|
251
|
-
withdrawFrom: (0, editBillViewSelector_1.getWithdrawFrom)(state, (
|
|
252
|
-
internationalTransferFeeBearerPaymentMethod: ((
|
|
253
|
-
? (0, billTransactionState_1.toInternationalTransferFeeBearerPaymentMethod)((
|
|
264
|
+
withdrawFrom: (0, editBillViewSelector_1.getWithdrawFrom)(state, (_u = (_t = billPayload.bill_pay_info) === null || _t === void 0 ? void 0 : _t.from_account.account_id) !== null && _u !== void 0 ? _u : '', (_w = (_v = billPayload.bill_pay_info) === null || _v === void 0 ? void 0 : _v.from_account.account_type) !== null && _w !== void 0 ? _w : ''),
|
|
265
|
+
internationalTransferFeeBearerPaymentMethod: ((_x = billPayload.bill_pay_info) === null || _x === void 0 ? void 0 : _x.international_transfer_fee_bearer_payment_method) != null
|
|
266
|
+
? (0, billTransactionState_1.toInternationalTransferFeeBearerPaymentMethod)((_y = billPayload.bill_pay_info) === null || _y === void 0 ? void 0 : _y.international_transfer_fee_bearer_payment_method)
|
|
254
267
|
: undefined,
|
|
255
268
|
},
|
|
256
269
|
totalAmount: billPayload.amount != null
|
|
257
270
|
? (0, amount_1.toAmountWC)(billPayload.amount, {
|
|
258
|
-
currencyCode: (
|
|
259
|
-
currencySymbol: (
|
|
271
|
+
currencyCode: (_z = billPayload.currency_code) !== null && _z !== void 0 ? _z : 'USD',
|
|
272
|
+
currencySymbol: (_0 = billPayload.currency_symbol) !== null && _0 !== void 0 ? _0 : '$',
|
|
260
273
|
})
|
|
261
274
|
: undefined,
|
|
262
275
|
recipientTotalAmount: billPayload.recipient_total_amount != null
|
|
263
276
|
? (0, amount_1.toAmountWC)(billPayload.recipient_total_amount, {
|
|
264
|
-
currencyCode: (
|
|
265
|
-
currencySymbol: (
|
|
277
|
+
currencyCode: (_1 = billPayload.recipient_currency_code) !== null && _1 !== void 0 ? _1 : 'USD',
|
|
278
|
+
currencySymbol: (_2 = billPayload.recipient_currency_symbol) !== null && _2 !== void 0 ? _2 : '$',
|
|
266
279
|
})
|
|
267
280
|
: undefined,
|
|
268
281
|
isCancelled: false,
|
|
269
|
-
toAccountVendorEmail: (
|
|
270
|
-
isCollectToAccountInfoFromVendorContact: (
|
|
271
|
-
isRecurring: (
|
|
282
|
+
toAccountVendorEmail: (_4 = (_3 = billPayload.bill_pay_info) === null || _3 === void 0 ? void 0 : _3.to_account_vendor_email) !== null && _4 !== void 0 ? _4 : undefined,
|
|
283
|
+
isCollectToAccountInfoFromVendorContact: (_6 = (_5 = billPayload.bill_pay_info) === null || _5 === void 0 ? void 0 : _5.is_collect_to_account_info_from_vendor_contact) !== null && _6 !== void 0 ? _6 : false,
|
|
284
|
+
isRecurring: (_7 = billPayload.is_recurring) !== null && _7 !== void 0 ? _7 : false,
|
|
285
|
+
outsideZeniPaymentLocalData,
|
|
272
286
|
};
|
|
273
287
|
};
|
|
274
288
|
exports.toBillDetailLocalData = toBillDetailLocalData;
|
|
@@ -10,12 +10,12 @@ import { AccountState } from '../../../../../entity/account/accountState';
|
|
|
10
10
|
import { PaymentAccountState } from '../../../../../entity/paymentAccount/paymentAccountState';
|
|
11
11
|
import { updateRecurringBillConfigs, updateRecurringBills } from '../../../../../entity/billPay/recurringBills/recurringBillsReducer';
|
|
12
12
|
import { RecurringBillState } from '../../../../../entity/billPay/recurringBills/recurringBillsState';
|
|
13
|
-
import {
|
|
13
|
+
import { BillPaymentConfigCodeType, BillPaymentSubConfigCodeType } from '../../billPayConfig/billPayConfigState';
|
|
14
14
|
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
15
15
|
import { RecurringBillConfigBodyPayload } from '../../../../../entity/billPay/recurringBills/recurringBillsPayload';
|
|
16
16
|
export declare type ActionType = ReturnType<typeof saveBillDetail> | ReturnType<typeof updateBillTransaction> | ReturnType<typeof openSnackbar> | ReturnType<typeof saveBillSuccessOrFailure> | ReturnType<typeof updateRecurringBillConfigs> | ReturnType<typeof updateRecurringBills>;
|
|
17
17
|
export declare const saveBillDetailEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<ActionType>;
|
|
18
|
-
export declare function prepareSaveBillPayload(accountState: AccountState, billTransactionState: BillTransactionState, paymentAccountState: PaymentAccountState, recurringBillState: RecurringBillState, billDetail: EditBillDetail, billStageCode: BillStageCodeType): Partial<SaveBillPayload>;
|
|
18
|
+
export declare function prepareSaveBillPayload(accountState: AccountState, billTransactionState: BillTransactionState, paymentAccountState: PaymentAccountState, recurringBillState: RecurringBillState, billDetail: EditBillDetail, billStageCode: BillStageCodeType, isForMarkAsPaid: boolean): Partial<SaveBillPayload>;
|
|
19
19
|
interface SaveBillPayload {
|
|
20
20
|
vendor_id: string;
|
|
21
21
|
vendor_name?: string | null;
|
|
@@ -45,11 +45,15 @@ interface SaveBillPayload {
|
|
|
45
45
|
bill_payment_method_type: {
|
|
46
46
|
code: BillPaymentConfigCodeType | null;
|
|
47
47
|
name: string;
|
|
48
|
-
sub_code:
|
|
48
|
+
sub_code: BillPaymentSubConfigCodeType | null;
|
|
49
49
|
};
|
|
50
50
|
to_account_vendor_email?: string | null;
|
|
51
51
|
is_collect_to_account_info_from_vendor_contact?: boolean;
|
|
52
52
|
international_transfer_fee_bearer_payment_method?: string | null;
|
|
53
|
+
outside_zeni_transaction_payment_mode?: string | null;
|
|
54
|
+
bill_payment_status: {
|
|
55
|
+
code: string | null;
|
|
56
|
+
};
|
|
53
57
|
};
|
|
54
58
|
document_id: string;
|
|
55
59
|
transaction_memo: string;
|