@zeniai/client-epic-state 4.19.95-betaJK1 → 4.19.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/esm/view/expenseAutomationView/epics/accountRecon/saveReconciliationReviewEpic.js
CHANGED
|
@@ -4,7 +4,6 @@ import { DEFAULT_DATE_FORMAT } from '../../../../commonStateTypes/fiscalYearHelp
|
|
|
4
4
|
import { addTransactionToReconcileList, excludeReconReviewTransaction, } from '../../../../entity/accountRecon/accountReconReducer';
|
|
5
5
|
import { getAccountReconByAccountIdAndSelectedPeriod, } from '../../../../entity/accountRecon/accountReconSelector';
|
|
6
6
|
import { toAccountReconKey, } from '../../../../entity/accountRecon/accountReconState';
|
|
7
|
-
import { getEntityByEntityIDs } from '../../../../entity/genericEntity/entitySelector';
|
|
8
7
|
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
9
8
|
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
10
9
|
import { updateMultipleReconcileTransactions } from '../../../../entity/transaction/transactionReducer';
|
|
@@ -13,7 +12,6 @@ import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePay
|
|
|
13
12
|
import { saveReconciliationReview, updateReconcileTabLocalData, updateSaveReconciliationReviewFetchStatus, } from '../../reducers/reconciliationViewReducer';
|
|
14
13
|
export const saveReconciliationReviewEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(saveReconciliationReview.match), mergeMap((action) => {
|
|
15
14
|
const state = state$.value;
|
|
16
|
-
const entityState = state.entityState;
|
|
17
15
|
const { transactionId } = action.payload;
|
|
18
16
|
const localData = state.expenseAutomationReconciliationViewState.reconTabsState.review
|
|
19
17
|
.localData[transactionId];
|
|
@@ -61,7 +59,7 @@ export const saveReconciliationReviewEpic = (actions$, state$, zeniAPI) => actio
|
|
|
61
59
|
payload = getPayloadForCCPayment(updatedTransaction, localData, reconciliationData?.account.accountType);
|
|
62
60
|
break;
|
|
63
61
|
case 'record_deposit':
|
|
64
|
-
payload = getPayloadForDeposit(updatedTransaction, localData
|
|
62
|
+
payload = getPayloadForDeposit(updatedTransaction, localData);
|
|
65
63
|
break;
|
|
66
64
|
}
|
|
67
65
|
}
|
|
@@ -161,10 +159,7 @@ function getPayloadForExpenseRecord(updatedTransaction, localData) {
|
|
|
161
159
|
currency_code: updatedTransaction.amount.currencyCode,
|
|
162
160
|
};
|
|
163
161
|
}
|
|
164
|
-
function getPayloadForDeposit(updatedTransaction, localData
|
|
165
|
-
const customerZeniId = localData.customer?.id != null
|
|
166
|
-
? getEntityByEntityIDs(entityState, [localData.customer?.id])[0]?.zeniId
|
|
167
|
-
: undefined;
|
|
162
|
+
function getPayloadForDeposit(updatedTransaction, localData) {
|
|
168
163
|
return {
|
|
169
164
|
amount: updatedTransaction.amount.amount,
|
|
170
165
|
transaction_memo: updatedTransaction.memo,
|
|
@@ -172,7 +167,7 @@ function getPayloadForDeposit(updatedTransaction, localData, entityState) {
|
|
|
172
167
|
transaction_date: updatedTransaction.transactionDate.format(DEFAULT_DATE_FORMAT),
|
|
173
168
|
transaction_direction: updatedTransaction.transactionDirection,
|
|
174
169
|
transaction_id: updatedTransaction.transactionId,
|
|
175
|
-
customer_id:
|
|
170
|
+
customer_id: localData.customer?.id,
|
|
176
171
|
customer_name: localData.customer?.name,
|
|
177
172
|
account_id: localData.categoryId,
|
|
178
173
|
accounting_class_id: localData.classId,
|