@zeniai/client-epic-state 4.8.54 → 4.8.55
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/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/entity/tenant/tenantPayload.d.ts +0 -5
- package/lib/entity/userRole/userRolePayload.d.ts +0 -5
- package/lib/entity/userRole/userRolePayload.js +0 -15
- package/lib/entity/userRole/userRoleType.d.ts +3 -16
- package/lib/entity/userRole/userRoleType.js +6 -198
- package/lib/epic.d.ts +1 -3
- package/lib/epic.js +1 -3
- package/lib/index.d.ts +12 -14
- package/lib/index.js +18 -50
- package/lib/view/commonVendorView/vendorView/epics/saveVendorEpic.js +4 -31
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.d.ts +1 -5
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewReducer.js +2 -18
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.d.ts +0 -14
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewSelector.js +4 -36
- package/lib/view/commonVendorView/vendorsTabVendorView/vendorsTabVendorViewState.d.ts +0 -7
- 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/settingsView/settingsViewPayload.d.ts +0 -7
- package/lib/view/settingsView/settingsViewReducer.d.ts +2 -7
- package/lib/view/settingsView/settingsViewReducer.js +2 -115
- package/lib/view/settingsView/settingsViewSelector.d.ts +0 -2
- package/lib/view/settingsView/settingsViewSelector.js +1 -4
- package/lib/view/settingsView/settingsViewState.d.ts +0 -18
- package/lib/view/settingsView/settingsViewState.js +0 -15
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.d.ts +0 -1
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +1 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +0 -3
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +24 -49
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +0 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.js +0 -2
- package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js +9 -16
- package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.d.ts +1 -1
- package/lib/view/spendManagement/billPay/editBillView/epics/parseInvoiceToBillEpic.js +9 -21
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +1 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +3 -6
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +6 -9
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +3 -6
- package/lib/view/spendManagement/helpers.js +4 -11
- package/lib/view/taskManager/taskDetailView/epics/saveTaskDetailEpic.js +1 -5
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.d.ts +0 -1
- package/lib/view/taskManager/taskDetailView/taskDetailReducer.js +6 -8
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.d.ts +0 -2
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +1 -7
- package/lib/view/taskManager/taskListView/taskListSelector.js +1 -1
- package/lib/view/transactionList/fetchTransactionListByEntityEpic.js +0 -3
- package/lib/view/transactionList/transactionListByEntitySelector.d.ts +0 -4
- package/lib/view/transactionList/transactionListByEntitySelector.js +1 -62
- package/lib/view/transactionList/transactionListReducer.d.ts +1 -2
- package/lib/view/transactionList/transactionListReducer.js +2 -2
- package/lib/view/vendorReviewView/vendorFirstReviewView/epics/saveVendorFirstReviewViewEpic.js +6 -9
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewPayload.d.ts +0 -1
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.d.ts +2 -2
- package/lib/view/vendorReviewView/vendorFirstReviewView/vendorFirstReviewViewReducer.js +2 -2
- package/lib/zeniAPI.d.ts +0 -1
- package/package.json +1 -1
- package/lib/view/settingsView/epic/fetchNotificationSettingsEpic.d.ts +0 -17
- package/lib/view/settingsView/epic/fetchNotificationSettingsEpic.js +0 -23
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.d.ts +0 -31
- package/lib/view/settingsView/epic/saveNotificationSettingsEpic.js +0 -70
- package/lib/view/settingsView/settingsViewHelpers.d.ts +0 -2
- package/lib/view/settingsView/settingsViewHelpers.js +0 -11
|
@@ -3,14 +3,13 @@ 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.getWithdrawFrom = exports.
|
|
6
|
+
exports.getWithdrawFrom = exports.getRecurringBillLocalData = exports.getCurrentPaymentToOption = exports.toPaymentToOption = exports.getActualPaymentTypeBasedOnAccType = 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");
|
|
10
10
|
const bankAccountSelector_1 = require("../../../../entity/bankAccount/bankAccountSelector");
|
|
11
11
|
const paymentAccountSelector_1 = require("../../../../entity/paymentAccount/paymentAccountSelector");
|
|
12
12
|
const vendorSelector_1 = require("../../../../entity/vendor/vendorSelector");
|
|
13
|
-
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
14
13
|
const accountListSelector_1 = require("../../../accountList/accountListSelector");
|
|
15
14
|
const classListSelector_1 = require("../../../classList/classListSelector");
|
|
16
15
|
const billDetailViewState_1 = require("../billDetailView/billDetailViewState");
|
|
@@ -31,7 +30,7 @@ const transferDetailSelector_1 = require("../../zeniAccounts/transferDetail/tran
|
|
|
31
30
|
const depositAccountListSelector_1 = require("../../zeniAccounts/depositAccountList/depositAccountListSelector");
|
|
32
31
|
const depositAccountSelector_1 = require("../../../../entity/depositAccount/depositAccountSelector");
|
|
33
32
|
const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAccountsEnabled, billId) => {
|
|
34
|
-
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
|
|
33
|
+
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;
|
|
35
34
|
const { accountListState, accountState, bankAccountState, billDetailViewState, setupViewState, billTransactionState, billPayConfigState, classListState, classState, editBillDetailViewState, paymentAccountState, vendorState, tenantState, companyState, userState, commonHistoryState, contactState, paymentInstrumentState, recurringBillState, depositAccountListState, depositAccountState, } = state;
|
|
36
35
|
const transaction = (0, get_1.default)(billTransactionState.transactionById, billId !== null && billId !== void 0 ? billId : '', undefined);
|
|
37
36
|
let recommendations = {};
|
|
@@ -42,7 +41,6 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
42
41
|
const sourceBillDetail = billId != null
|
|
43
42
|
? (_a = editBillDetailViewState.editBillStateById) === null || _a === void 0 ? void 0 : _a[key]
|
|
44
43
|
: editBillDetailViewState.newBillState;
|
|
45
|
-
const showVendorGptRecommendationText = (_b = sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.billDetailLocalData.showVendorGptRecommendationText) !== null && _b !== void 0 ? _b : false;
|
|
46
44
|
let vendorDetails;
|
|
47
45
|
let recommendedVendor;
|
|
48
46
|
let lastRecommendedVendorName;
|
|
@@ -93,10 +91,10 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
93
91
|
let qboId;
|
|
94
92
|
const { currentTenantId } = tenantState;
|
|
95
93
|
const bookCloseDate = currentTenantId != null
|
|
96
|
-
? (
|
|
94
|
+
? (_c = (_b = tenantState.tenantsById) === null || _b === void 0 ? void 0 : _b[currentTenantId]) === null || _c === void 0 ? void 0 : _c.bookCloseDate
|
|
97
95
|
: undefined;
|
|
98
96
|
const companyId = currentTenantId != null
|
|
99
|
-
? (
|
|
97
|
+
? (_e = (_d = tenantState.tenantsById) === null || _d === void 0 ? void 0 : _d[currentTenantId]) === null || _e === void 0 ? void 0 : _e.companyId
|
|
100
98
|
: undefined;
|
|
101
99
|
const currentCompany = (0, companySelector_1.getCompanyByCompanyId)(companyState, companyId !== null && companyId !== void 0 ? companyId : '');
|
|
102
100
|
const payNowCutOffTime = currentCompany === null || currentCompany === void 0 ? void 0 : currentCompany.company.companyBillPayInfo.payNowCutOffTimeByMethod.ach;
|
|
@@ -118,25 +116,24 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
118
116
|
let recurringConfig;
|
|
119
117
|
let recurringBillInstances;
|
|
120
118
|
if (billId != null) {
|
|
121
|
-
isDeleted = (
|
|
122
|
-
createdBy = (0, userSelector_1.getUserByUserId)(userState, (
|
|
119
|
+
isDeleted = (_f = transaction === null || transaction === void 0 ? void 0 : transaction.isDeleted) !== null && _f !== void 0 ? _f : false;
|
|
120
|
+
createdBy = (0, userSelector_1.getUserByUserId)(userState, (_g = transaction === null || transaction === void 0 ? void 0 : transaction.createdBy) !== null && _g !== void 0 ? _g : '');
|
|
123
121
|
createTime = transaction === null || transaction === void 0 ? void 0 : transaction.createTime;
|
|
124
|
-
qboId = (
|
|
122
|
+
qboId = (_h = transaction === null || transaction === void 0 ? void 0 : transaction.account) === null || _h === void 0 ? void 0 : _h.qboId;
|
|
125
123
|
billPayInfo = transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo;
|
|
126
124
|
toAccountVendorEmail = transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.toAccountVendorEmail;
|
|
127
125
|
isCollectToAccountInfoFromVendorContact =
|
|
128
|
-
(
|
|
129
|
-
const initialVendor = (0, vendorSelector_1.getVendorByQboId)(vendorState, (
|
|
126
|
+
(_j = transaction === null || transaction === void 0 ? void 0 : transaction.billPayInfo.isCollectToAccountInfoFromVendorContact) !== null && _j !== void 0 ? _j : false;
|
|
127
|
+
const initialVendor = (0, vendorSelector_1.getVendorByQboId)(vendorState, (_l = (_k = transaction === null || transaction === void 0 ? void 0 : transaction.vendor) === null || _k === void 0 ? void 0 : _k.id) !== null && _l !== void 0 ? _l : '');
|
|
130
128
|
const initialWhatForSection = {
|
|
131
129
|
invoiceNumber: transaction === null || transaction === void 0 ? void 0 : transaction.documentId,
|
|
132
130
|
invoiceDate: transaction === null || transaction === void 0 ? void 0 : transaction.date,
|
|
133
131
|
billDueDate: transaction === null || transaction === void 0 ? void 0 : transaction.dueDate,
|
|
134
132
|
memo: transaction === null || transaction === void 0 ? void 0 : transaction.memo,
|
|
135
|
-
isInvoiceDateAutoUpdated: false,
|
|
136
133
|
};
|
|
137
134
|
const updatesByLineId = {};
|
|
138
135
|
if (accountList.fetchState === 'Completed') {
|
|
139
|
-
(
|
|
136
|
+
(_m = transaction === null || transaction === void 0 ? void 0 : transaction.lines) === null || _m === void 0 ? void 0 : _m.forEach((line) => {
|
|
140
137
|
var _a;
|
|
141
138
|
updatesByLineId[line.id] = Object.assign(Object.assign({}, line), { account: (_a = accountList.accounts.find((account) => {
|
|
142
139
|
var _a;
|
|
@@ -146,10 +143,10 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
146
143
|
});
|
|
147
144
|
}
|
|
148
145
|
const initialPaymentDetailsSection = {
|
|
149
|
-
paymentType: (0, exports.getPaymentMethodType)(billPayConfigState, (
|
|
146
|
+
paymentType: (0, exports.getPaymentMethodType)(billPayConfigState, (_o = billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.fromAccount.billAccountType) !== null && _o !== void 0 ? _o : 'depositAccount', billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.billPaymentMethodType, billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.internationalTransferFeeBearerPaymentMethod),
|
|
150
147
|
paymentDate: billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.paymentDate,
|
|
151
|
-
withdrawFrom: (0, exports.getWithdrawFrom)(paymentAccountState, depositAccountState, (
|
|
152
|
-
paymentTo: ((
|
|
148
|
+
withdrawFrom: (0, exports.getWithdrawFrom)(paymentAccountState, depositAccountState, (_p = billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.fromAccount.billAccountId) !== null && _p !== void 0 ? _p : '', (_q = billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.fromAccount.billAccountType) !== null && _q !== void 0 ? _q : ''),
|
|
149
|
+
paymentTo: ((_r = billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.toAccount.billAccountId) === null || _r === void 0 ? void 0 : _r.length) != null &&
|
|
153
150
|
(billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.toAccount.billAccountId.length) > 0
|
|
154
151
|
? billPayInfo.toAccount.billAccountId
|
|
155
152
|
: undefined,
|
|
@@ -166,7 +163,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
166
163
|
if (sourceBillDetail != null) {
|
|
167
164
|
const billViewState = billDetailViewState.billDetailById[key];
|
|
168
165
|
isCancelled = sourceBillDetail.billDetailLocalData.isCancelled;
|
|
169
|
-
billStage = (
|
|
166
|
+
billStage = (_s = billPayInfo === null || billPayInfo === void 0 ? void 0 : billPayInfo.stage.code) !== null && _s !== void 0 ? _s : 'draft';
|
|
170
167
|
if (billViewState != null) {
|
|
171
168
|
fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
172
169
|
sourceBillDetail.fetchStatus,
|
|
@@ -178,7 +175,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
178
175
|
}
|
|
179
176
|
}
|
|
180
177
|
//recurringBill Details
|
|
181
|
-
isRecurring = (
|
|
178
|
+
isRecurring = (_t = transaction === null || transaction === void 0 ? void 0 : transaction.isRecurring) !== null && _t !== void 0 ? _t : false;
|
|
182
179
|
if (isRecurring && transaction != null) {
|
|
183
180
|
const { recurringConfigLocalData, recurringBillInstancesLocalData } = (0, exports.getRecurringBillLocalData)(recurringBillState, transaction);
|
|
184
181
|
recurringConfig = recurringConfigLocalData;
|
|
@@ -208,9 +205,9 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
208
205
|
? (0, vendorSelector_1.getVendorByVendorId)(vendorState, updatedRecord.vendor.id)
|
|
209
206
|
: undefined;
|
|
210
207
|
file = updatedRecord.file;
|
|
211
|
-
const bankAccInBill = (0, bankAccountSelector_1.getBankAccountByBankAccountId)(bankAccountState, (
|
|
212
|
-
const vendorBankAccounts = (0, bankAccountSelector_1.getBankAccountsByBankAccountIds)(bankAccountState, (
|
|
213
|
-
const vendorPaymentInstruments = (0, paymentInstrumentSelector_1.getPaymentInstrumentsByIds)(paymentInstrumentState, (
|
|
208
|
+
const bankAccInBill = (0, bankAccountSelector_1.getBankAccountByBankAccountId)(bankAccountState, (_v = (_u = updatedRecord.paymentDetailsSection) === null || _u === void 0 ? void 0 : _u.paymentTo) !== null && _v !== void 0 ? _v : '');
|
|
209
|
+
const vendorBankAccounts = (0, bankAccountSelector_1.getBankAccountsByBankAccountIds)(bankAccountState, (_w = vendorDetails === null || vendorDetails === void 0 ? void 0 : vendorDetails.bankAccountIds) !== null && _w !== void 0 ? _w : []);
|
|
210
|
+
const vendorPaymentInstruments = (0, paymentInstrumentSelector_1.getPaymentInstrumentsByIds)(paymentInstrumentState, (_x = vendorDetails === null || vendorDetails === void 0 ? void 0 : vendorDetails.paymentInstrumentIds) !== null && _x !== void 0 ? _x : []);
|
|
214
211
|
const isBankAccInBillExistInVendor = bankAccInBill != null
|
|
215
212
|
? vendorBankAccounts
|
|
216
213
|
.map((bankAc) => bankAc.bankAccountId)
|
|
@@ -260,7 +257,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
260
257
|
(recommendedVendor === null || recommendedVendor === void 0 ? void 0 : recommendedVendor.vendorCurrencyCode) != null) {
|
|
261
258
|
whatForSection.currencyCode = recommendedVendor.vendorCurrencyCode;
|
|
262
259
|
}
|
|
263
|
-
isRecurring = (
|
|
260
|
+
isRecurring = (_y = sourceBillDetail.billDetailLocalData.isRecurring) !== null && _y !== void 0 ? _y : false;
|
|
264
261
|
recurringConfig = sourceBillDetail.billDetailLocalData.recurringConfig;
|
|
265
262
|
recurringBillInstances =
|
|
266
263
|
sourceBillDetail.billDetailLocalData.recurringBillInstances;
|
|
@@ -280,7 +277,7 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
280
277
|
}
|
|
281
278
|
const vendorContactSaveStatus = editBillDetailViewState.updateVendorContactState;
|
|
282
279
|
const lineDetailSection = {};
|
|
283
|
-
const lineDetailSectionUpdatesByLineId = (
|
|
280
|
+
const lineDetailSectionUpdatesByLineId = (_0 = (_z = sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.billDetailLocalData) === null || _z === void 0 ? void 0 : _z.updatesByLineId) !== null && _0 !== void 0 ? _0 : {};
|
|
284
281
|
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
285
282
|
if (accountList.fetchState === 'Completed') {
|
|
286
283
|
Object.keys(lineDetailSectionUpdatesByLineId).forEach((lineId) => {
|
|
@@ -302,14 +299,13 @@ const getEditBillDetail = (state, isVendorRecommendationFeatureEnabled, isZeniAc
|
|
|
302
299
|
const classHeirarchyList = (0, classListSelector_1.getNestedClassListHeirarchy)(classListState);
|
|
303
300
|
const duplicateBills = (0, billPayReviewSelector_1.getDuplicateBills)(state, billId);
|
|
304
301
|
return {
|
|
305
|
-
showVendorGptRecommendationText,
|
|
306
302
|
recommendedVendor,
|
|
307
303
|
lastRecommendedVendorName,
|
|
308
304
|
duplicateBills,
|
|
309
305
|
fetchState: fetchState,
|
|
310
|
-
saveStatus: (
|
|
311
|
-
error: (
|
|
312
|
-
uploadStatus: (
|
|
306
|
+
saveStatus: (_1 = sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.saveStatus) !== null && _1 !== void 0 ? _1 : undefined,
|
|
307
|
+
error: (_3 = (_2 = sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.fetchStatus) === null || _2 === void 0 ? void 0 : _2.error) !== null && _3 !== void 0 ? _3 : undefined,
|
|
308
|
+
uploadStatus: (_4 = sourceBillDetail === null || sourceBillDetail === void 0 ? void 0 : sourceBillDetail.uploadFetchState) !== null && _4 !== void 0 ? _4 : undefined,
|
|
313
309
|
version: 0,
|
|
314
310
|
createdBy,
|
|
315
311
|
createTime,
|
|
@@ -410,7 +406,7 @@ const getPaymentMethodType = (billPayConfigState, accType, paymentMethod, intern
|
|
|
410
406
|
};
|
|
411
407
|
exports.getPaymentMethodType = getPaymentMethodType;
|
|
412
408
|
function getWhatForSection(updatedWhatForSection) {
|
|
413
|
-
var _a, _b, _c, _d, _e
|
|
409
|
+
var _a, _b, _c, _d, _e;
|
|
414
410
|
return {
|
|
415
411
|
invoiceNumber: (updatedWhatForSection === null || updatedWhatForSection === void 0 ? void 0 : updatedWhatForSection.invoiceNumber) != null &&
|
|
416
412
|
((_a = updatedWhatForSection.invoiceNumber) === null || _a === void 0 ? void 0 : _a.length) > 0
|
|
@@ -423,7 +419,6 @@ function getWhatForSection(updatedWhatForSection) {
|
|
|
423
419
|
? updatedWhatForSection.memo
|
|
424
420
|
: '',
|
|
425
421
|
currencyCode: (_e = updatedWhatForSection === null || updatedWhatForSection === void 0 ? void 0 : updatedWhatForSection.currencyCode) !== null && _e !== void 0 ? _e : 'USD',
|
|
426
|
-
isInvoiceDateAutoUpdated: (_f = updatedWhatForSection === null || updatedWhatForSection === void 0 ? void 0 : updatedWhatForSection.isInvoiceDateAutoUpdated) !== null && _f !== void 0 ? _f : false,
|
|
427
422
|
};
|
|
428
423
|
}
|
|
429
424
|
exports.getWhatForSection = getWhatForSection;
|
|
@@ -557,26 +552,6 @@ const getRecurringBillLocalData = (recurringBillState, transaction) => {
|
|
|
557
552
|
return { recurringConfigLocalData, recurringBillInstancesLocalData };
|
|
558
553
|
};
|
|
559
554
|
exports.getRecurringBillLocalData = getRecurringBillLocalData;
|
|
560
|
-
const getInvoiceDate = (invoiceDate, bookCloseDate) => {
|
|
561
|
-
if (bookCloseDate != null && invoiceDate.isBefore(bookCloseDate)) {
|
|
562
|
-
return (0, zeniDayJS_1.dateNow)().startOf('month');
|
|
563
|
-
}
|
|
564
|
-
else {
|
|
565
|
-
return invoiceDate;
|
|
566
|
-
}
|
|
567
|
-
};
|
|
568
|
-
exports.getInvoiceDate = getInvoiceDate;
|
|
569
|
-
const getDueDate = (dueDate, invoiceDate, bookCloseDate) => {
|
|
570
|
-
if (bookCloseDate != null &&
|
|
571
|
-
invoiceDate != null &&
|
|
572
|
-
invoiceDate.isBefore(bookCloseDate)) {
|
|
573
|
-
return (0, zeniDayJS_1.dateNow)().startOf('month');
|
|
574
|
-
}
|
|
575
|
-
else {
|
|
576
|
-
return dueDate;
|
|
577
|
-
}
|
|
578
|
-
};
|
|
579
|
-
exports.getDueDate = getDueDate;
|
|
580
555
|
const getWithdrawFrom = (paymentAccountState, depositAccountState, fromAccountId, fromAccountType) => {
|
|
581
556
|
const withdrawFromAsDepositAcc = (0, depositAccountSelector_1.getDepositAccountByDepositAccountId)(depositAccountState, fromAccountId);
|
|
582
557
|
const withdrawFromAsPaymentAcc = (0, paymentAccountSelector_1.getPaymentAccountByPaymentAccountId)(paymentAccountState, fromAccountId);
|
|
@@ -45,7 +45,6 @@ export interface RecurringBillInstance {
|
|
|
45
45
|
billPaymentStatus?: RecurringBillPaymentStatus;
|
|
46
46
|
}
|
|
47
47
|
export interface BillDetailLocalData {
|
|
48
|
-
showVendorGptRecommendationText: boolean;
|
|
49
48
|
vendor?: Vendor;
|
|
50
49
|
candidateVendorname?: string;
|
|
51
50
|
whatForSection?: WhatForSection;
|
|
@@ -70,7 +69,6 @@ export interface WhatForSection {
|
|
|
70
69
|
billDueDate?: ZeniDate;
|
|
71
70
|
memo?: string;
|
|
72
71
|
currencyCode?: string;
|
|
73
|
-
isInvoiceDateAutoUpdated?: boolean;
|
|
74
72
|
}
|
|
75
73
|
export interface PaymentDetailsSection {
|
|
76
74
|
internationalTransferFeeBearerPaymentMethod?: InternationalTransferFeeBearerPaymentMethod;
|
|
@@ -16,14 +16,12 @@ exports.initialBillDetail = {
|
|
|
16
16
|
error: undefined,
|
|
17
17
|
},
|
|
18
18
|
billDetailLocalData: {
|
|
19
|
-
showVendorGptRecommendationText: false,
|
|
20
19
|
vendor: undefined,
|
|
21
20
|
whatForSection: {
|
|
22
21
|
invoiceNumber: '',
|
|
23
22
|
invoiceDate: undefined,
|
|
24
23
|
billDueDate: undefined,
|
|
25
24
|
memo: '',
|
|
26
|
-
isInvoiceDateAutoUpdated: false,
|
|
27
25
|
},
|
|
28
26
|
updatesByLineId: {},
|
|
29
27
|
paymentDetailsSection: {
|
package/lib/view/spendManagement/billPay/editBillView/epics/initializeBillToLocalStoreEpic.js
CHANGED
|
@@ -128,29 +128,23 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
const { tenantState, companyState } = state;
|
|
132
|
-
const { currentTenantId } = tenantState;
|
|
133
|
-
const companyId = currentTenantId != null
|
|
134
|
-
? (_f = (_e = tenantState.tenantsById) === null || _e === void 0 ? void 0 : _e[currentTenantId]) === null || _f === void 0 ? void 0 : _f.companyId
|
|
135
|
-
: undefined;
|
|
136
|
-
const currentCompany = (0, companySelector_1.getCompanyByCompanyId)(companyState, companyId !== null && companyId !== void 0 ? companyId : '');
|
|
137
|
-
const bookCloseDate = currentCompany === null || currentCompany === void 0 ? void 0 : currentCompany.company.companyInfo.bookCloseDate;
|
|
138
131
|
const whatForSection = {
|
|
139
132
|
invoiceNumber: transaction.documentId,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
: transaction.dueDate,
|
|
143
|
-
invoiceDate: (0, editBillViewSelector_1.getInvoiceDate)(transaction.date, bookCloseDate),
|
|
133
|
+
invoiceDate: transaction.date,
|
|
134
|
+
billDueDate: transaction.dueDate,
|
|
144
135
|
memo: transaction.memo,
|
|
145
136
|
currencyCode: transaction.amount.currencyCode,
|
|
146
|
-
isInvoiceDateAutoUpdated: transaction.date != null
|
|
147
|
-
? transaction.date.isBefore(bookCloseDate)
|
|
148
|
-
: false,
|
|
149
137
|
};
|
|
150
138
|
const updatesByLineId = {};
|
|
151
|
-
(
|
|
139
|
+
(_e = transaction.lines) === null || _e === void 0 ? void 0 : _e.forEach((line) => {
|
|
152
140
|
updatesByLineId[line.id] = Object.assign(Object.assign({}, line), (0, exports.getLineRecommendationsLocalData)(line.id, line, recommendations, accountList, classList, vendor));
|
|
153
141
|
});
|
|
142
|
+
const { tenantState, companyState } = state;
|
|
143
|
+
const { currentTenantId } = tenantState;
|
|
144
|
+
const companyId = currentTenantId != null
|
|
145
|
+
? (_g = (_f = tenantState.tenantsById) === null || _f === void 0 ? void 0 : _f[currentTenantId]) === null || _g === void 0 ? void 0 : _g.companyId
|
|
146
|
+
: undefined;
|
|
147
|
+
const currentCompany = (0, companySelector_1.getCompanyByCompanyId)(companyState, companyId !== null && companyId !== void 0 ? companyId : '');
|
|
154
148
|
const payNowCutOffTime = currentCompany === null || currentCompany === void 0 ? void 0 : currentCompany.company.companyBillPayInfo.payNowCutOffTimeByMethod.ach;
|
|
155
149
|
const isPayNowEnabled = payNowCutOffTime != null
|
|
156
150
|
? (0, zeniDayJS_1.dateNow)().isSameOrBefore(payNowCutOffTime)
|
|
@@ -180,7 +174,6 @@ const initializeBillToLocalStoreEpic = (actions$, state$) => actions$.pipe((0, o
|
|
|
180
174
|
recurringBillInstances = recurringBillInstancesLocalData;
|
|
181
175
|
}
|
|
182
176
|
const billDetailLocalData = {
|
|
183
|
-
showVendorGptRecommendationText: false,
|
|
184
177
|
vendor,
|
|
185
178
|
whatForSection,
|
|
186
179
|
updatesByLineId,
|
|
@@ -10,5 +10,5 @@ import { fetchPreviousBills } from '../../previousBills/previousBillsReducer';
|
|
|
10
10
|
import { fetchDuplicateBill } from '../../billPayReview/billPayReviewReducer';
|
|
11
11
|
export declare type ActionType = ReturnType<typeof parseInvoiceToBill> | ReturnType<typeof saveBillUpdatesToLocalStore> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchPreviousBills> | ReturnType<typeof fetchDuplicateBill> | ReturnType<typeof updateShowAutofill> | ReturnType<typeof updateAddBillAutoFields> | ReturnType<typeof updateBillUploadFetchState>;
|
|
12
12
|
export declare const parseInvoiceToBillEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
13
|
-
export declare const toBillDetailLocalData: (state: RootState,
|
|
13
|
+
export declare const toBillDetailLocalData: (state: RootState, billPayload: Partial<BillTransactionPayload>, vendor: Vendor | undefined, recommendedVendorId?: string | undefined) => BillDetailLocalData;
|
|
14
14
|
export declare const getAutoFieldsData: (finalBill: BillDetailLocalData, isVendorWithNewCurrency: boolean, tentativeVendorName?: string | undefined, currencyInInvoice?: string | undefined, vendorCurrency?: string | undefined) => AddBillAutoFields;
|
|
@@ -54,7 +54,6 @@ const parseInvoiceToBillEpic = (actions$, state$) => actions$.pipe((0, operators
|
|
|
54
54
|
let vendorCurrency = '';
|
|
55
55
|
const vendors = (0, vendorListSelector_1.getVendorList)(state).vendors;
|
|
56
56
|
let recommendedVendorId;
|
|
57
|
-
let showVendorGptRecommendationText = false;
|
|
58
57
|
let suggestedVendor;
|
|
59
58
|
if (vendorNameFromInvoice != null && vendorNameFromInvoice.length > 0) {
|
|
60
59
|
finalVendor = vendors.filter((vendor) => vendor.name.toLowerCase() === vendorNameFromInvoice.toLowerCase())[0];
|
|
@@ -72,7 +71,6 @@ const parseInvoiceToBillEpic = (actions$, state$) => actions$.pipe((0, operators
|
|
|
72
71
|
if (matchScore > 85) {
|
|
73
72
|
if (vendorCurrency === currencyInInvoice) {
|
|
74
73
|
finalVendor = suggestedVendor;
|
|
75
|
-
showVendorGptRecommendationText = true;
|
|
76
74
|
}
|
|
77
75
|
else {
|
|
78
76
|
isVendorWithNewCurrency = true;
|
|
@@ -83,7 +81,6 @@ const parseInvoiceToBillEpic = (actions$, state$) => actions$.pipe((0, operators
|
|
|
83
81
|
vendorNameFromInvoice.toLowerCase()) {
|
|
84
82
|
if (vendorCurrency === currencyInInvoice) {
|
|
85
83
|
finalVendor = suggestedVendor;
|
|
86
|
-
showVendorGptRecommendationText = true;
|
|
87
84
|
}
|
|
88
85
|
else {
|
|
89
86
|
isVendorWithNewCurrency = true;
|
|
@@ -92,13 +89,12 @@ const parseInvoiceToBillEpic = (actions$, state$) => actions$.pipe((0, operators
|
|
|
92
89
|
else {
|
|
93
90
|
recommendedVendorId = suggestedVendor === null || suggestedVendor === void 0 ? void 0 : suggestedVendor.id;
|
|
94
91
|
finalVendor = suggestedVendor;
|
|
95
|
-
showVendorGptRecommendationText = true;
|
|
96
92
|
}
|
|
97
93
|
}
|
|
98
94
|
}
|
|
99
95
|
}
|
|
100
96
|
const file = (0, attachmentPayload_1.mapFiletoAttachment)(invoiceProcessingPayload.files[0]);
|
|
101
|
-
const finalBill = Object.assign(Object.assign({}, (0, exports.toBillDetailLocalData)(state,
|
|
97
|
+
const finalBill = Object.assign(Object.assign({}, (0, exports.toBillDetailLocalData)(state, invoiceProcessingPayload.bills[0], finalVendor, recommendedVendorId)), { file: file });
|
|
102
98
|
const addBillAutoFields = (0, exports.getAutoFieldsData)(finalBill, isVendorWithNewCurrency, vendorNameFromInvoice, currencyInInvoice, vendorCurrency);
|
|
103
99
|
if (finalVendor != null) {
|
|
104
100
|
return (0, rxjs_1.of)((0, editBillViewReducer_1.saveBillUpdatesToLocalStore)({ billDetailLocalData: finalBill }), (0, previousBillsReducer_1.fetchPreviousBills)(finalVendor.qboId, false), (0, billPayReviewReducer_1.fetchDuplicateBill)(finalVendor.name, finalVendor.id, (_e = (_d = finalBill.totalAmount) === null || _d === void 0 ? void 0 : _d.amount) !== null && _e !== void 0 ? _e : 0, (_f = finalBill.whatForSection) === null || _f === void 0 ? void 0 : _f.invoiceNumber), (0, editBillViewReducer_1.updateShowAutofill)(false), (0, editBillViewReducer_1.updateAddBillAutoFields)(addBillAutoFields), (0, editBillViewReducer_1.updateBillUploadFetchState)({
|
|
@@ -124,7 +120,7 @@ const parseInvoiceToBillEpic = (actions$, state$) => actions$.pipe((0, operators
|
|
|
124
120
|
}
|
|
125
121
|
}));
|
|
126
122
|
exports.parseInvoiceToBillEpic = parseInvoiceToBillEpic;
|
|
127
|
-
const toBillDetailLocalData = (state,
|
|
123
|
+
const toBillDetailLocalData = (state, billPayload, vendor, recommendedVendorId) => {
|
|
128
124
|
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;
|
|
129
125
|
const currency = {
|
|
130
126
|
currencyCode: (_a = billPayload.currency_code) !== null && _a !== void 0 ? _a : '',
|
|
@@ -188,28 +184,20 @@ const toBillDetailLocalData = (state, showVendorGptRecommendationText, billPaylo
|
|
|
188
184
|
? (0, zeniDayJS_1.dateNow)().isSameOrBefore(payNowCutOffTime)
|
|
189
185
|
: false;
|
|
190
186
|
const fromAccountType = (0, billPayConfigPayload_1.getAccountTypeSubConfigCodeKey)((0, billPayConfigState_1.toAccType)((_m = (_l = billPayload.bill_pay_info) === null || _l === void 0 ? void 0 : _l.from_account.account_type) !== null && _m !== void 0 ? _m : ''));
|
|
191
|
-
const bookCloseDate = currentCompany === null || currentCompany === void 0 ? void 0 : currentCompany.company.companyInfo.bookCloseDate;
|
|
192
|
-
const invoiceDate = Boolean(billPayload.transaction_date) === true
|
|
193
|
-
? (0, editBillViewSelector_1.getInvoiceDate)((0, zeniDayJS_1.date)(billPayload.transaction_date), bookCloseDate)
|
|
194
|
-
: undefined;
|
|
195
|
-
const dueDate = Boolean(billPayload.due_date) === true
|
|
196
|
-
? Boolean(billPayload.transaction_date) === true
|
|
197
|
-
? (0, editBillViewSelector_1.getDueDate)((0, zeniDayJS_1.date)(billPayload.due_date), (0, zeniDayJS_1.date)(billPayload.transaction_date), bookCloseDate)
|
|
198
|
-
: (0, zeniDayJS_1.date)(billPayload.due_date)
|
|
199
|
-
: undefined;
|
|
200
187
|
return {
|
|
201
188
|
recommendedVendorId,
|
|
202
|
-
showVendorGptRecommendationText,
|
|
203
189
|
lastRecommendedVendorName: recommendedVendorId != null ? vendor === null || vendor === void 0 ? void 0 : vendor.name : undefined,
|
|
204
190
|
vendor: vendor,
|
|
205
191
|
whatForSection: {
|
|
206
192
|
invoiceNumber: billPayload.invoice_number,
|
|
207
|
-
billDueDate:
|
|
193
|
+
billDueDate: billPayload.due_date != null && billPayload.due_date.length > 0
|
|
194
|
+
? (0, zeniDayJS_1.date)(billPayload.due_date)
|
|
195
|
+
: undefined,
|
|
208
196
|
memo: billPayload.transaction_memo,
|
|
209
|
-
invoiceDate:
|
|
210
|
-
|
|
211
|
-
? (0, zeniDayJS_1.date)(billPayload.transaction_date)
|
|
212
|
-
:
|
|
197
|
+
invoiceDate: billPayload.transaction_date != null &&
|
|
198
|
+
billPayload.transaction_date.length > 0
|
|
199
|
+
? (0, zeniDayJS_1.date)(billPayload.transaction_date)
|
|
200
|
+
: undefined,
|
|
213
201
|
currencyCode: billPayload.currency_code,
|
|
214
202
|
},
|
|
215
203
|
updatesByLineId: linesById,
|
|
@@ -5,7 +5,7 @@ import { UserRolePayload } from '../../../../entity/userRole/userRolePayload';
|
|
|
5
5
|
import { ZeniAPIResponse } from '../../../../responsePayload';
|
|
6
6
|
export interface ChargeCardListPayload {
|
|
7
7
|
cards: ChargeCardPayload[];
|
|
8
|
-
unassigned_credit
|
|
8
|
+
unassigned_credit: AmountPayload;
|
|
9
9
|
users: UserPayload[];
|
|
10
10
|
user_roles: UserRolePayload[];
|
|
11
11
|
}
|
|
@@ -3,8 +3,7 @@ import { ChargeCardListPayload, CreditAccountPayload } from './chargeCardListPay
|
|
|
3
3
|
import { ChargeCardListState, ChargeCardListUIState, ChargeCardLocalData, CreditAccount } from './chargeCardList';
|
|
4
4
|
import { FetchState } from '../../../../commonStateTypes/common';
|
|
5
5
|
export declare const initialState: ChargeCardListState;
|
|
6
|
-
export declare const fetchChargeCardListPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
7
|
-
doFetchCreditAccounts: boolean;
|
|
6
|
+
export declare const fetchChargeCardListPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any], {
|
|
8
7
|
cacheOverride: any;
|
|
9
8
|
}, string, never, never>, fetchCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountPayload[], string>, updateCreditAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, string>, fetchChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
9
|
chargeCardListPayload: ChargeCardListPayload;
|
|
@@ -29,9 +29,9 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
29
29
|
reducer() {
|
|
30
30
|
//do nothing
|
|
31
31
|
},
|
|
32
|
-
prepare(
|
|
32
|
+
prepare(cacheOverride = false) {
|
|
33
33
|
return {
|
|
34
|
-
payload: {
|
|
34
|
+
payload: { cacheOverride },
|
|
35
35
|
};
|
|
36
36
|
},
|
|
37
37
|
},
|
|
@@ -58,10 +58,7 @@ const chargeCardList = (0, toolkit_1.createSlice)({
|
|
|
58
58
|
action.payload.keepExistingListItems === true
|
|
59
59
|
? [...new Set([...draft.cardIds, ...newCard])]
|
|
60
60
|
: newCard;
|
|
61
|
-
draft.unAssignedCredits =
|
|
62
|
-
unassigned_credit != null
|
|
63
|
-
? (0, amount_1.toAmount)(unassigned_credit.amount, unassigned_credit.currency_code, unassigned_credit.currency_symbol)
|
|
64
|
-
: undefined;
|
|
61
|
+
draft.unAssignedCredits = (0, amount_1.toAmount)(unassigned_credit.amount, unassigned_credit.currency_code, unassigned_credit.currency_symbol);
|
|
65
62
|
draft.fetchState = 'Completed';
|
|
66
63
|
draft.error = undefined;
|
|
67
64
|
},
|
|
@@ -28,4 +28,4 @@ export interface ChargeCardListSelectorView extends SelectorView {
|
|
|
28
28
|
searchText: string;
|
|
29
29
|
unAssignedCredits?: Amount;
|
|
30
30
|
}
|
|
31
|
-
export declare const getChargeCardListView: (state: RootState
|
|
31
|
+
export declare const getChargeCardListView: (state: RootState) => ChargeCardListSelectorView;
|
|
@@ -13,7 +13,7 @@ const classSelector_1 = require("../../../../entity/class/classSelector");
|
|
|
13
13
|
const userSelector_1 = require("../../../../entity/user/userSelector");
|
|
14
14
|
const userRoleSelector_1 = require("../../../../entity/userRole/userRoleSelector");
|
|
15
15
|
const userListViewSelector_1 = require("../../../userListView/userListViewSelector");
|
|
16
|
-
const getChargeCardListView = (state
|
|
16
|
+
const getChargeCardListView = (state) => {
|
|
17
17
|
const { addressState, chargeCardListState, chargeCardState, classState, userState, userRoleState, chargeCardConfigState, classListState, } = state;
|
|
18
18
|
const searchText = chargeCardListState.searchText
|
|
19
19
|
.trim()
|
|
@@ -56,14 +56,11 @@ const getChargeCardListView = (state, includeCreditAccount) => {
|
|
|
56
56
|
}, sortOrder);
|
|
57
57
|
const userListSelectorView = (0, userListViewSelector_1.getUserList)(state, 'cardHolderCandidate');
|
|
58
58
|
const userList = userListSelectorView.users;
|
|
59
|
-
const fetchState =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
]).fetchState
|
|
65
|
-
: (0, reduceFetchState_1.reduceFetchState)([chargeCardListState, chargeCardConfigState])
|
|
66
|
-
.fetchState;
|
|
59
|
+
const fetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
60
|
+
chargeCardListState,
|
|
61
|
+
chargeCardListState.creditAccount,
|
|
62
|
+
chargeCardConfigState,
|
|
63
|
+
]).fetchState;
|
|
67
64
|
const issueCardPageFetchState = (0, reduceFetchState_1.reduceFetchState)([
|
|
68
65
|
chargeCardConfigState,
|
|
69
66
|
userListSelectorView,
|
|
@@ -8,13 +8,11 @@ const chargeCardListReducer_1 = require("./chargeCardListReducer");
|
|
|
8
8
|
const userListViewReducer_1 = require("../../../userListView/userListViewReducer");
|
|
9
9
|
const classListReducer_1 = require("../../../classList/classListReducer");
|
|
10
10
|
const fetchChargeCardListPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(chargeCardListReducer_1.fetchChargeCardListPage.match), (0, operators_1.mergeMap)((action) => {
|
|
11
|
-
const {
|
|
11
|
+
const { cacheOverride } = action.payload;
|
|
12
12
|
const chargeCardListPageAction = [];
|
|
13
13
|
const state = state$.value;
|
|
14
14
|
if (cacheOverride === true) {
|
|
15
|
-
|
|
16
|
-
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccount)());
|
|
17
|
-
}
|
|
15
|
+
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccount)());
|
|
18
16
|
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchChargeCardList)());
|
|
19
17
|
chargeCardListPageAction.push((0, chargeCardConfigReducer_1.fetchChargeCardConfig)());
|
|
20
18
|
chargeCardListPageAction.push((0, userListViewReducer_1.fetchUserListByType)('cardHolderCandidate', true));
|
|
@@ -22,8 +20,7 @@ const fetchChargeCardListPageEpic = (actions$, state$) => actions$.pipe((0, oper
|
|
|
22
20
|
}
|
|
23
21
|
else {
|
|
24
22
|
const chargeCardList = state.chargeCardListState;
|
|
25
|
-
if (
|
|
26
|
-
chargeCardList.creditAccount.fetchState !== 'Completed' &&
|
|
23
|
+
if (chargeCardList.creditAccount.fetchState !== 'Completed' &&
|
|
27
24
|
chargeCardList.creditAccount.fetchState !== 'In-Progress') {
|
|
28
25
|
chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccount)());
|
|
29
26
|
}
|
|
@@ -128,9 +128,7 @@ const getTotalPayments = (startDate, endDate, frequency, currentInstance) => {
|
|
|
128
128
|
switch (frequency) {
|
|
129
129
|
case 'weekly':
|
|
130
130
|
case 'biweekly':
|
|
131
|
-
totalPayments =
|
|
132
|
-
endDate.diff(currentStartDate, 'day') /
|
|
133
|
-
getRecurringFrequencyInDays(frequency);
|
|
131
|
+
totalPayments = endDate.diff(currentStartDate, 'day') / getRecurringFrequencyInDays(frequency);
|
|
134
132
|
break;
|
|
135
133
|
case 'monthly':
|
|
136
134
|
totalPayments = endDate.diff(currentStartDate, 'month');
|
|
@@ -170,15 +168,9 @@ function getRecurringBillInstances(startDate, frequency, totalPayments, currentI
|
|
|
170
168
|
const getRecurringFrequencyWithOffset = (frequency) => {
|
|
171
169
|
switch (frequency) {
|
|
172
170
|
case 'weekly':
|
|
173
|
-
return {
|
|
174
|
-
offSetValue: getRecurringFrequencyInDays(frequency),
|
|
175
|
-
offSetUnit: 'day',
|
|
176
|
-
};
|
|
171
|
+
return { offSetValue: getRecurringFrequencyInDays(frequency), offSetUnit: 'day' };
|
|
177
172
|
case 'biweekly':
|
|
178
|
-
return {
|
|
179
|
-
offSetValue: getRecurringFrequencyInDays(frequency),
|
|
180
|
-
offSetUnit: 'day',
|
|
181
|
-
};
|
|
173
|
+
return { offSetValue: getRecurringFrequencyInDays(frequency), offSetUnit: 'day' };
|
|
182
174
|
case 'monthly':
|
|
183
175
|
return { offSetValue: 1, offSetUnit: 'month' };
|
|
184
176
|
case 'quarterly':
|
|
@@ -189,6 +181,7 @@ function getRecurringBillInstances(startDate, frequency, totalPayments, currentI
|
|
|
189
181
|
for (let i = 0; i < totalPayments; i++) {
|
|
190
182
|
updatedInstances.push(Object.assign({ instance: currentInstance + i, isDeleted: false, amount: billAmount }, checkIfHolidayAndGetNextDate(startDate.add(i * offSetValue, offSetUnit))));
|
|
191
183
|
}
|
|
184
|
+
;
|
|
192
185
|
return updatedInstances;
|
|
193
186
|
}
|
|
194
187
|
function getRecurringFrequencyInDays(frequency) {
|
|
@@ -16,15 +16,11 @@ const saveTaskDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, oper
|
|
|
16
16
|
? zeniAPI.putAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks/${taskId}`, payload)
|
|
17
17
|
: zeniAPI.postAndGetJSON(`${zeniAPI.apiEndPoints.taskMicroServiceBaseUrl}/1.0/task-manager/tasks`, payload);
|
|
18
18
|
return saveTaskApi.pipe((0, operators_1.mergeMap)((response) => {
|
|
19
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) &&
|
|
20
|
-
response.data != null &&
|
|
21
|
-
response.data.tasks.length > 0) {
|
|
22
|
-
const newTaskId = response.data.tasks[0].task_id;
|
|
19
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
23
20
|
const fetchActions = [
|
|
24
21
|
(0, taskReducer_1.updateTasks)(response.data.tasks),
|
|
25
22
|
(0, taskDetailReducer_1.saveTaskSuccessOrFailure)({
|
|
26
23
|
fetchState: 'Completed',
|
|
27
|
-
newTaskId,
|
|
28
24
|
taskId,
|
|
29
25
|
}),
|
|
30
26
|
];
|
|
@@ -25,7 +25,6 @@ export declare const fetchTaskDetailPage: import("@reduxjs/toolkit").ActionCreat
|
|
|
25
25
|
taskId: string | undefined;
|
|
26
26
|
}, string, never, never>, saveTaskSuccessOrFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
27
27
|
fetchState: FetchState;
|
|
28
|
-
newTaskId?: string | undefined;
|
|
29
28
|
taskId?: string | undefined;
|
|
30
29
|
error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
|
|
31
30
|
}, string>, deleteTask: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[taskId?: string | undefined], {
|
|
@@ -113,16 +113,14 @@ const taskDetailView = (0, toolkit_1.createSlice)({
|
|
|
113
113
|
},
|
|
114
114
|
},
|
|
115
115
|
saveTaskSuccessOrFailure(draft, action) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
draft.editTaskStateById[taskId].saveStatus.fetchState =
|
|
119
|
-
|
|
116
|
+
if (action.payload.taskId != null) {
|
|
117
|
+
const { taskId } = action.payload;
|
|
118
|
+
draft.editTaskStateById[taskId].saveStatus.fetchState =
|
|
119
|
+
action.payload.fetchState;
|
|
120
|
+
draft.editTaskStateById[taskId].saveStatus.error = action.payload.error;
|
|
120
121
|
}
|
|
121
122
|
else {
|
|
122
|
-
|
|
123
|
-
draft.newTaskState.taskId = newTaskId;
|
|
124
|
-
}
|
|
125
|
-
draft.newTaskState.saveStatus.fetchState = fetchState;
|
|
123
|
+
draft.newTaskState.saveStatus.fetchState = action.payload.fetchState;
|
|
126
124
|
draft.newTaskState.saveStatus.error = action.payload.error;
|
|
127
125
|
}
|
|
128
126
|
},
|
|
@@ -7,7 +7,6 @@ import { File } from '../../../entity/file/fileState';
|
|
|
7
7
|
import { UserListSelectorView } from '../../userListView/userListViewSelector';
|
|
8
8
|
import { EditTaskDetail } from './taskDetail';
|
|
9
9
|
import { HistoricEvent } from '../../spendManagement/commonHistoryView/commonHistory';
|
|
10
|
-
import { UserAndRole } from '../../companyView/types/userAndRole';
|
|
11
10
|
export interface TaskDetailSelectorView extends SelectorView {
|
|
12
11
|
taskDetailView: EditTaskDetail;
|
|
13
12
|
userList: UserListSelectorView;
|
|
@@ -17,7 +16,6 @@ export interface TaskDetailSelectorView extends SelectorView {
|
|
|
17
16
|
files: File[];
|
|
18
17
|
taskHistory: HistoricEvent[];
|
|
19
18
|
showTaskDetailFormFooter: boolean;
|
|
20
|
-
createdByUser?: UserAndRole;
|
|
21
19
|
}
|
|
22
20
|
export declare const getTaskDetail: (state: RootState, taskId?: string | undefined) => TaskDetailSelectorView;
|
|
23
21
|
export declare const allTaskTags: TaskTag[];
|