@zeniai/client-epic-state 4.12.87 → 4.12.89
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/account/accountPayload.d.ts +8 -1
- package/lib/entity/account/accountPayload.js +15 -7
- package/lib/entity/account/accountSelector.d.ts +6 -6
- package/lib/entity/account/accountSelector.js +1 -0
- package/lib/entity/account/accountState.d.ts +10 -2
- package/lib/entity/account/accountState.js +0 -4
- package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +2 -2
- package/lib/entity/accountGroup/accountGroupSelector.d.ts +44 -44
- package/lib/index.d.ts +2 -2
- package/lib/view/accountList/accountListReducer.d.ts +2 -2
- package/lib/view/accountList/accountListReducer.js +0 -2
- package/lib/view/accountMappingView/accountMappingPayload.d.ts +0 -2
- package/lib/view/accountMappingView/accountMappingPayload.js +55 -100
- package/lib/view/accountMappingView/accountMappingReducer.js +40 -14
- package/lib/view/accountMappingView/accountMappingState.d.ts +10 -4
- package/lib/view/accountMappingView/accountMappingViewSelector.d.ts +2 -2
- package/lib/view/accountMappingView/accountMappingViewSelector.js +5 -5
- package/lib/view/accountMappingView/fetchAccountListForAccountTypesEpic.js +1 -0
- package/lib/view/accountMappingView/saveAccountMappingViewEpic.js +1 -2
- package/lib/view/cardBalance/cardBalanceSelector.d.ts +2 -2
- package/lib/view/cashBalance/cashBalanceSelector.d.ts +2 -2
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigPayload.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigReducer.js +1 -1
- package/lib/view/spendManagement/reimbursement/reimbursementConfig/reimbursementConfigPayload.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/reimbursementConfig/reimbursementConfigReducer.js +1 -1
- package/lib/view/topEx/topExSelector.d.ts +1 -1
- package/lib/view/transactionList/transactionListReducer.d.ts +12 -12
- package/package.json +1 -1
|
@@ -1,125 +1,80 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toSaveAccountMappingPayload = void 0;
|
|
4
4
|
const toSaveAccountMappingPayload = (accountingLocalData) => {
|
|
5
|
-
var _a, _b, _c, _d;
|
|
6
5
|
const accounts = [];
|
|
7
|
-
|
|
8
|
-
accounts.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (Boolean(accountingLocalData.selectedBillPayAccountId) === true) {
|
|
33
|
-
accounts.push({
|
|
34
|
-
account_id: accountingLocalData.selectedBillPayAccountId,
|
|
35
|
-
labels: ['bank_charges_and_fees'],
|
|
36
|
-
});
|
|
6
|
+
const findAndUpdateAccount = (accountId, label, tax1099Config) => {
|
|
7
|
+
const existingAccount = accounts.find((account) => account.account_id === accountId);
|
|
8
|
+
if (existingAccount) {
|
|
9
|
+
// Add label if not already present
|
|
10
|
+
if (label != '' &&
|
|
11
|
+
existingAccount.labels &&
|
|
12
|
+
!existingAccount.labels.includes(label)) {
|
|
13
|
+
existingAccount.labels.push(label);
|
|
14
|
+
}
|
|
15
|
+
// Merge tax_1099_config fields, updating them if new values are non-null
|
|
16
|
+
if (tax1099Config != null) {
|
|
17
|
+
existingAccount.tax_1099_config = Object.assign(Object.assign({}, existingAccount.tax_1099_config), tax1099Config);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
// Add a new account if it doesn't exist
|
|
22
|
+
accounts.push({
|
|
23
|
+
account_id: accountId,
|
|
24
|
+
labels: label.length === 0 ? [] : [label],
|
|
25
|
+
tax_1099_config: tax1099Config,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
if (accountingLocalData.selectedIncomeAccountId != null) {
|
|
30
|
+
findAndUpdateAccount(accountingLocalData.selectedIncomeAccountId, 'uncategorized_income');
|
|
37
31
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
account_id: accountingLocalData.previousBillPayAccount
|
|
41
|
-
.accountId,
|
|
42
|
-
labels: [],
|
|
43
|
-
});
|
|
32
|
+
if (accountingLocalData.selectedExpenseAccountId != null) {
|
|
33
|
+
findAndUpdateAccount(accountingLocalData.selectedExpenseAccountId, 'uncategorized_expense');
|
|
44
34
|
}
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
account_id: accountingLocalData.selectedReimbursementsAccountId,
|
|
48
|
-
labels: ['travel_transportation'],
|
|
49
|
-
});
|
|
35
|
+
if (accountingLocalData.selectedBillPayAccountId != null) {
|
|
36
|
+
findAndUpdateAccount(accountingLocalData.selectedBillPayAccountId, 'bank_charges_and_fees');
|
|
50
37
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
account_id: accountingLocalData.previousReimbursementsAccount.accountId,
|
|
54
|
-
labels: [],
|
|
55
|
-
});
|
|
38
|
+
if (accountingLocalData.selectedReimbursementsAccountId != null) {
|
|
39
|
+
findAndUpdateAccount(accountingLocalData.selectedReimbursementsAccountId, 'travel_transportation');
|
|
56
40
|
}
|
|
57
41
|
if (accountingLocalData.selectedPrepaidExpensesAccountIds.length > 0) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
account_id: accountId,
|
|
61
|
-
labels: ['prepaid_expenses'],
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
else if (accountingLocalData.previousPrepaidExpensesAccount.length > 0) {
|
|
66
|
-
accountingLocalData.previousPrepaidExpensesAccount.forEach((account) => {
|
|
67
|
-
accounts.push({
|
|
68
|
-
account_id: account.accountId,
|
|
69
|
-
labels: [],
|
|
70
|
-
});
|
|
42
|
+
accountingLocalData.selectedPrepaidExpensesAccountIds.forEach((accountId) => {
|
|
43
|
+
findAndUpdateAccount(accountId, 'prepaid_expenses');
|
|
71
44
|
});
|
|
72
45
|
}
|
|
73
46
|
if (accountingLocalData.selectedFixedAssetsAccountIds.length > 0) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
account_id: accountId,
|
|
77
|
-
labels: ['fixed_assets'],
|
|
78
|
-
});
|
|
47
|
+
accountingLocalData.selectedFixedAssetsAccountIds.forEach((accountId) => {
|
|
48
|
+
findAndUpdateAccount(accountId, 'fixed_assets');
|
|
79
49
|
});
|
|
80
50
|
}
|
|
81
|
-
|
|
82
|
-
accountingLocalData.
|
|
83
|
-
|
|
84
|
-
account_id: account.accountId,
|
|
85
|
-
labels: [],
|
|
86
|
-
});
|
|
51
|
+
if (accountingLocalData.selectedAccruedExpensesAccountIds.length > 0) {
|
|
52
|
+
accountingLocalData.selectedAccruedExpensesAccountIds.forEach((accountId) => {
|
|
53
|
+
findAndUpdateAccount(accountId, 'accrued_expenses');
|
|
87
54
|
});
|
|
88
55
|
}
|
|
89
|
-
if (accountingLocalData.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
56
|
+
if (accountingLocalData.selectedBankAccounts1099FilingAccountIds.length > 0) {
|
|
57
|
+
accountingLocalData.selectedBankAccounts1099FilingAccountIds.forEach((accountId) => {
|
|
58
|
+
findAndUpdateAccount(accountId, '', {
|
|
59
|
+
is_bank_account: true,
|
|
60
|
+
is_expense_account: false,
|
|
61
|
+
expense_type: null,
|
|
62
|
+
type_1099: null,
|
|
63
|
+
box_type: null,
|
|
94
64
|
});
|
|
95
65
|
});
|
|
96
66
|
}
|
|
97
|
-
|
|
98
|
-
accountingLocalData.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
67
|
+
if (accountingLocalData.selectedExpenseAccounts1099FilingAccountIds.length > 0) {
|
|
68
|
+
accountingLocalData.selectedExpenseAccounts1099FilingAccountIds.forEach((account) => {
|
|
69
|
+
findAndUpdateAccount(account.accountId, '', {
|
|
70
|
+
is_bank_account: false,
|
|
71
|
+
is_expense_account: true,
|
|
72
|
+
expense_type: account.expenseType,
|
|
73
|
+
type_1099: account.type1099,
|
|
74
|
+
box_type: account.boxType,
|
|
102
75
|
});
|
|
103
76
|
});
|
|
104
77
|
}
|
|
105
78
|
return accounts;
|
|
106
79
|
};
|
|
107
80
|
exports.toSaveAccountMappingPayload = toSaveAccountMappingPayload;
|
|
108
|
-
const toSaveFiling1099Payload = (accountingLocalData) => {
|
|
109
|
-
const gl_accounts = {
|
|
110
|
-
account_ids: [],
|
|
111
|
-
gl_account_ids: [],
|
|
112
|
-
};
|
|
113
|
-
const account_ids = [];
|
|
114
|
-
const gl_account_Ids = [];
|
|
115
|
-
accountingLocalData.selectedGLAccounts1099FilingAccountIds.forEach((glaccountId) => {
|
|
116
|
-
gl_account_Ids.push(glaccountId);
|
|
117
|
-
}),
|
|
118
|
-
accountingLocalData.selectedBankAccounts1099FilingAccountIds.forEach((accountId) => {
|
|
119
|
-
account_ids.push(accountId);
|
|
120
|
-
}),
|
|
121
|
-
(gl_accounts.account_ids = account_ids);
|
|
122
|
-
gl_accounts.gl_account_ids = gl_account_Ids;
|
|
123
|
-
return gl_accounts;
|
|
124
|
-
};
|
|
125
|
-
exports.toSaveFiling1099Payload = toSaveFiling1099Payload;
|
|
@@ -20,7 +20,7 @@ exports.initialState = {
|
|
|
20
20
|
selectedFixedAssetsAccountIds: [],
|
|
21
21
|
selectedAccruedExpensesAccountIds: [],
|
|
22
22
|
selectedBankAccounts1099FilingAccountIds: [],
|
|
23
|
-
|
|
23
|
+
selectedExpenseAccounts1099FilingAccountIds: [],
|
|
24
24
|
previousExpenseAccount: undefined,
|
|
25
25
|
previousIncomeAccount: undefined,
|
|
26
26
|
previousBillPayAccount: undefined,
|
|
@@ -29,7 +29,7 @@ exports.initialState = {
|
|
|
29
29
|
previousFixedAssetsAccount: [],
|
|
30
30
|
previousAccruedExpensesAccount: [],
|
|
31
31
|
previousBankAccounts1099FilingAccount: [],
|
|
32
|
-
|
|
32
|
+
previousExpenseAccounts1099FilingAccount: [],
|
|
33
33
|
},
|
|
34
34
|
accountListFetchState: {
|
|
35
35
|
error: undefined,
|
|
@@ -64,8 +64,8 @@ exports.initialState = {
|
|
|
64
64
|
accruedExpensesRecommendations: [],
|
|
65
65
|
bankAccounts1099FilingAccountIdList: [],
|
|
66
66
|
bankAccounts1099FilingNestedAccountListHierarchy: [],
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
expenseAccounts1099FilingAccountIdList: [],
|
|
68
|
+
expenseAccounts1099FilingNestedAccountListHierarchy: [],
|
|
69
69
|
};
|
|
70
70
|
const accountMapping = (0, toolkit_1.createSlice)({
|
|
71
71
|
name: 'accountMapping',
|
|
@@ -160,7 +160,7 @@ const doUpdateAccountListForAccountTypes = (draft, accountPayloadList) => {
|
|
|
160
160
|
const fixedAssetsList = [];
|
|
161
161
|
const accruedExpensesList = [];
|
|
162
162
|
const bankAccounts1099FilingList = [];
|
|
163
|
-
const
|
|
163
|
+
const expenseAccounts1099FilingList = [];
|
|
164
164
|
accountPayloadList.forEach((account) => {
|
|
165
165
|
if (account.account_type === 'income') {
|
|
166
166
|
incomeList.push(account); // list for uncategorized income
|
|
@@ -181,7 +181,7 @@ const doUpdateAccountListForAccountTypes = (draft, accountPayloadList) => {
|
|
|
181
181
|
else if (account.account_type === 'bank') {
|
|
182
182
|
bankAccounts1099FilingList.push(account); // list for bank accounts for Filing 1099
|
|
183
183
|
}
|
|
184
|
-
|
|
184
|
+
expenseAccounts1099FilingList.push(account); // list for gl accounts
|
|
185
185
|
});
|
|
186
186
|
draft.incomeAccountIdList = incomeList.map((account) => account.account_id);
|
|
187
187
|
draft.expenseAccountIdList = expenseList.map((account) => account.account_id);
|
|
@@ -189,7 +189,10 @@ const doUpdateAccountListForAccountTypes = (draft, accountPayloadList) => {
|
|
|
189
189
|
draft.fixedAssetsAccountIdList = fixedAssetsList.map((account) => account.account_id);
|
|
190
190
|
draft.accruedExpensesAccountIdList = accruedExpensesList.map((account) => account.account_id);
|
|
191
191
|
draft.bankAccounts1099FilingAccountIdList = bankAccounts1099FilingList.map((account) => account.account_id);
|
|
192
|
-
draft.
|
|
192
|
+
draft.expenseAccounts1099FilingAccountIdList =
|
|
193
|
+
expenseAccounts1099FilingList.map((account) => account.account_id);
|
|
194
|
+
/* Uncategorized Mapping Section Start */
|
|
195
|
+
// Uncategorized income
|
|
193
196
|
const incomeAccountMetadata = incomeList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
|
|
194
197
|
const incomeAccountBase = incomeList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
|
|
195
198
|
const incomeAccountIdentified = incomeAccountBase.find((account) => account.labels.includes('uncategorized_income'));
|
|
@@ -197,6 +200,7 @@ const doUpdateAccountListForAccountTypes = (draft, accountPayloadList) => {
|
|
|
197
200
|
draft.data = Object.assign(Object.assign({}, draft.data), { selectedIncomeAccountId: incomeAccountIdentified.accountId, previousIncomeAccount: incomeAccountIdentified });
|
|
198
201
|
}
|
|
199
202
|
draft.incomeNestedAccountListHierarchy = (0, getNestedAccountIDHierarchyForReport_1.geNestedAccountIDHierarchyForReport)(incomeAccountMetadata);
|
|
203
|
+
// Uncategorized expense
|
|
200
204
|
const expenseAccountMetadata = expenseList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
|
|
201
205
|
const expenseAccountBase = expenseList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
|
|
202
206
|
const expenseAccountIdentified = expenseAccountBase.find((account) => account.labels.includes('uncategorized_expense'));
|
|
@@ -204,47 +208,69 @@ const doUpdateAccountListForAccountTypes = (draft, accountPayloadList) => {
|
|
|
204
208
|
draft.data = Object.assign(Object.assign({}, draft.data), { selectedExpenseAccountId: expenseAccountIdentified.accountId, previousExpenseAccount: expenseAccountIdentified });
|
|
205
209
|
}
|
|
206
210
|
draft.expenseNestedAccountListHierarchy = (0, getNestedAccountIDHierarchyForReport_1.geNestedAccountIDHierarchyForReport)(expenseAccountMetadata);
|
|
211
|
+
/* Uncategorized Mapping Section End */
|
|
212
|
+
/* Billpay Mapping Section Start */
|
|
207
213
|
const billPayAccountIdentified = expenseAccountBase.find((account) => account.labels.includes('bank_charges_and_fees'));
|
|
208
214
|
if (billPayAccountIdentified != null) {
|
|
209
215
|
draft.data = Object.assign(Object.assign({}, draft.data), { selectedBillPayAccountId: billPayAccountIdentified.accountId, previousBillPayAccount: billPayAccountIdentified });
|
|
210
216
|
}
|
|
211
217
|
draft.billPayNestedAccountListHierarchy = (0, getNestedAccountIDHierarchyForReport_1.geNestedAccountIDHierarchyForReport)(expenseAccountMetadata);
|
|
218
|
+
/* Billpay Mapping Section End */
|
|
219
|
+
/* Reimbursements Mapping Section Start */
|
|
212
220
|
const reimbursementsAccountIdentified = expenseAccountBase.find((account) => account.labels.includes('travel_transportation'));
|
|
213
221
|
if (reimbursementsAccountIdentified != null) {
|
|
214
222
|
draft.data = Object.assign(Object.assign({}, draft.data), { selectedReimbursementsAccountId: reimbursementsAccountIdentified.accountId, previousReimbursementsAccount: reimbursementsAccountIdentified });
|
|
215
223
|
}
|
|
216
224
|
draft.reimbursementsNestedAccountListHierarchy =
|
|
217
225
|
(0, getNestedAccountIDHierarchyForReport_1.geNestedAccountIDHierarchyForReport)(expenseAccountMetadata);
|
|
226
|
+
/* Reimbursements Mapping Section End */
|
|
227
|
+
/* Vendor Mapping Section Start */
|
|
228
|
+
// Prepaid expenses
|
|
218
229
|
const prepaidExpensesAccountMetadata = prepaidExpensesList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
|
|
219
230
|
const prepaidExpensesAccountBase = prepaidExpensesList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
|
|
220
231
|
const prepaidExpensesAccountsIdentified = prepaidExpensesAccountBase.filter((account) => account.labels.includes('prepaid_expenses'));
|
|
221
232
|
draft.data = Object.assign(Object.assign({}, draft.data), { selectedPrepaidExpensesAccountIds: prepaidExpensesAccountsIdentified.map((account) => account.accountId), previousPrepaidExpensesAccount: prepaidExpensesAccountsIdentified });
|
|
222
233
|
draft.prepaidExpensesNestedAccountListHierarchy =
|
|
223
234
|
(0, getNestedAccountIDHierarchyForReport_1.geNestedAccountIDHierarchyForReport)(prepaidExpensesAccountMetadata);
|
|
235
|
+
// Fixed assets
|
|
224
236
|
const fixedAssetsAccountMetadata = fixedAssetsList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
|
|
225
237
|
const fixedAssetsAccountBase = fixedAssetsList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
|
|
226
238
|
const fixedAssetsAccountsIdentified = fixedAssetsAccountBase.filter((account) => account.labels.includes('fixed_assets'));
|
|
227
239
|
draft.data = Object.assign(Object.assign({}, draft.data), { selectedFixedAssetsAccountIds: fixedAssetsAccountsIdentified.map((account) => account.accountId), previousFixedAssetsAccount: fixedAssetsAccountsIdentified });
|
|
228
240
|
draft.fixedAssetsNestedAccountListHierarchy =
|
|
229
241
|
(0, getNestedAccountIDHierarchyForReport_1.geNestedAccountIDHierarchyForReport)(fixedAssetsAccountMetadata);
|
|
242
|
+
// Accrued expenses
|
|
230
243
|
const accruedExpensesAccountMetadata = accruedExpensesList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
|
|
231
244
|
const accruedExpensesAccountBase = accruedExpensesList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
|
|
232
245
|
const accruedExpensesAccountsIdentified = accruedExpensesAccountBase.filter((account) => account.labels.includes('accrued_expenses'));
|
|
233
246
|
draft.data = Object.assign(Object.assign({}, draft.data), { selectedAccruedExpensesAccountIds: accruedExpensesAccountsIdentified.map((account) => account.accountId), previousAccruedExpensesAccount: accruedExpensesAccountsIdentified });
|
|
234
247
|
draft.accruedExpensesNestedAccountListHierarchy =
|
|
235
248
|
(0, getNestedAccountIDHierarchyForReport_1.geNestedAccountIDHierarchyForReport)(accruedExpensesAccountMetadata);
|
|
249
|
+
/* Vendor Mapping Section End */
|
|
250
|
+
/* 1099 Mapping Section Start */
|
|
251
|
+
// Bank accounts for 1099 filing
|
|
236
252
|
const bankAccounts1099FilingAccountMetadata = bankAccounts1099FilingList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
|
|
237
253
|
const bankAccounts1099FilingAccountBase = bankAccounts1099FilingList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
|
|
238
|
-
const bankAccounts1099FilingAccountsIdentified = bankAccounts1099FilingAccountBase.filter((account) => account.
|
|
254
|
+
const bankAccounts1099FilingAccountsIdentified = bankAccounts1099FilingAccountBase.filter((account) => { var _a; return (_a = account.tax1099Config) === null || _a === void 0 ? void 0 : _a.isBankAccount; });
|
|
239
255
|
draft.data = Object.assign(Object.assign({}, draft.data), { selectedBankAccounts1099FilingAccountIds: bankAccounts1099FilingAccountsIdentified.map((account) => account.accountId), previousBankAccounts1099FilingAccount: bankAccounts1099FilingAccountsIdentified });
|
|
240
256
|
draft.bankAccounts1099FilingNestedAccountListHierarchy =
|
|
241
257
|
(0, getNestedAccountIDHierarchyForReport_1.geNestedAccountIDHierarchyForReport)(bankAccounts1099FilingAccountMetadata);
|
|
242
|
-
|
|
243
|
-
const
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
draft.
|
|
247
|
-
|
|
258
|
+
// Expense Categories for 1099 filing
|
|
259
|
+
const expenseAccounts1099FilingAccountMetadata = expenseAccounts1099FilingList.map((acc) => (0, accountPayload_1.mapAccountMetadataPayloadToAccountMetadata)(acc));
|
|
260
|
+
const expenseAccounts1099FilingAccountBase = expenseAccounts1099FilingList.map((acc) => (0, accountPayload_1.mapAccountBasePayloadToAccountBase)(acc));
|
|
261
|
+
const expenseAccounts1099FilingAccountsIdentified = expenseAccounts1099FilingAccountBase.filter((account) => { var _a; return (_a = account.tax1099Config) === null || _a === void 0 ? void 0 : _a.isExpenseAccount; });
|
|
262
|
+
draft.data = Object.assign(Object.assign({}, draft.data), { selectedExpenseAccounts1099FilingAccountIds: expenseAccounts1099FilingAccountsIdentified.map((account) => {
|
|
263
|
+
var _a, _b, _c, _d, _e, _f;
|
|
264
|
+
return ({
|
|
265
|
+
accountId: account.accountId,
|
|
266
|
+
expenseType: (_b = (_a = account.tax1099Config) === null || _a === void 0 ? void 0 : _a.expenseType1099) !== null && _b !== void 0 ? _b : '',
|
|
267
|
+
type1099: (_d = (_c = account.tax1099Config) === null || _c === void 0 ? void 0 : _c.type1099) !== null && _d !== void 0 ? _d : '',
|
|
268
|
+
boxType: (_f = (_e = account.tax1099Config) === null || _e === void 0 ? void 0 : _e.boxType) !== null && _f !== void 0 ? _f : '',
|
|
269
|
+
});
|
|
270
|
+
}), previousExpenseAccounts1099FilingAccount: expenseAccounts1099FilingAccountsIdentified });
|
|
271
|
+
draft.expenseAccounts1099FilingNestedAccountListHierarchy =
|
|
272
|
+
(0, getNestedAccountIDHierarchyForReport_1.geNestedAccountIDHierarchyForReport)(expenseAccounts1099FilingAccountMetadata);
|
|
273
|
+
/* 1099 Mapping Section End */
|
|
248
274
|
draft.accountListFetchState = {
|
|
249
275
|
error: undefined,
|
|
250
276
|
fetchState: 'Completed',
|
|
@@ -11,7 +11,7 @@ export interface AccountMappingLocalData {
|
|
|
11
11
|
selectedPrepaidExpensesAccountIds: ID[];
|
|
12
12
|
selectedAccruedExpensesAccountIds: ID[];
|
|
13
13
|
selectedBankAccounts1099FilingAccountIds: ID[];
|
|
14
|
-
|
|
14
|
+
selectedExpenseAccounts1099FilingAccountIds: ExpenseCategory1099Filing[];
|
|
15
15
|
isIncomeRecommendationChecked: boolean;
|
|
16
16
|
isExpenseRecommendationChecked: boolean;
|
|
17
17
|
isBillPayRecommendationChecked: boolean;
|
|
@@ -24,7 +24,13 @@ export interface AccountMappingLocalData {
|
|
|
24
24
|
previousFixedAssetsAccount: AccountBase[];
|
|
25
25
|
previousAccruedExpensesAccount: AccountBase[];
|
|
26
26
|
previousBankAccounts1099FilingAccount: AccountBase[];
|
|
27
|
-
|
|
27
|
+
previousExpenseAccounts1099FilingAccount: AccountBase[];
|
|
28
|
+
}
|
|
29
|
+
export interface ExpenseCategory1099Filing {
|
|
30
|
+
accountId: ID;
|
|
31
|
+
expenseType: string;
|
|
32
|
+
type1099: string;
|
|
33
|
+
boxType: string;
|
|
28
34
|
}
|
|
29
35
|
export interface AccountMappingState {
|
|
30
36
|
data: AccountMappingLocalData;
|
|
@@ -52,6 +58,6 @@ export interface AccountMappingState {
|
|
|
52
58
|
accruedExpensesRecommendations: Recommendation[];
|
|
53
59
|
bankAccounts1099FilingAccountIdList: ID[];
|
|
54
60
|
bankAccounts1099FilingNestedAccountListHierarchy: NestedAccountHierarchyForReport[];
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
expenseAccounts1099FilingAccountIdList: ID[];
|
|
62
|
+
expenseAccounts1099FilingNestedAccountListHierarchy: NestedAccountHierarchyForReport[];
|
|
57
63
|
}
|
|
@@ -14,7 +14,7 @@ export interface AccountMappingView extends SelectorView {
|
|
|
14
14
|
fixedAssetsAccountList: AccountBase[];
|
|
15
15
|
accruedExpensesAccountList: AccountBase[];
|
|
16
16
|
bankAccounts1099FilingAccountList: AccountBase[];
|
|
17
|
-
|
|
17
|
+
expenseAccounts1099FilingAccountList: AccountBase[];
|
|
18
18
|
incomeRecommendation?: Recommendation;
|
|
19
19
|
expenseRecommendation?: Recommendation;
|
|
20
20
|
billPayRecommendation?: Recommendation;
|
|
@@ -30,7 +30,7 @@ export interface AccountMappingView extends SelectorView {
|
|
|
30
30
|
fixedAssetsAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
31
31
|
accruedExpensesAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
32
32
|
bankAccounts1099FilingAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
33
|
-
|
|
33
|
+
expenseAccounts1099FilingAccountHierarchy: NestedAccountHierarchyForReport[];
|
|
34
34
|
accountMappingLocalData?: AccountMappingLocalData;
|
|
35
35
|
saveState: FetchStateAndError;
|
|
36
36
|
}
|
|
@@ -61,11 +61,11 @@ exports.getAccountMappingView = (0, toolkit_1.createSelector)((state) => state.a
|
|
|
61
61
|
bankAccounts1099FilingAccountList.push(account);
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
-
const
|
|
65
|
-
accountMappingState.
|
|
64
|
+
const expenseAccounts1099FilingAccountList = [];
|
|
65
|
+
accountMappingState.expenseAccounts1099FilingAccountIdList.forEach((accountId) => {
|
|
66
66
|
const account = (0, accountSelector_1.getAccountBase)(accountState, accountId, 'account_list_by_type');
|
|
67
67
|
if (account != null) {
|
|
68
|
-
|
|
68
|
+
expenseAccounts1099FilingAccountList.push(account);
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
const fetchState = (0, reduceFetchState_1.reduceAllFetchState)([
|
|
@@ -82,7 +82,7 @@ exports.getAccountMappingView = (0, toolkit_1.createSelector)((state) => state.a
|
|
|
82
82
|
fixedAssetsAccountList,
|
|
83
83
|
accruedExpensesAccountList,
|
|
84
84
|
bankAccounts1099FilingAccountList,
|
|
85
|
-
|
|
85
|
+
expenseAccounts1099FilingAccountList,
|
|
86
86
|
incomeRecommendation: accountMappingState.incomeRecommendations.length > 0
|
|
87
87
|
? accountMappingState.incomeRecommendations[0]
|
|
88
88
|
: undefined,
|
|
@@ -107,7 +107,7 @@ exports.getAccountMappingView = (0, toolkit_1.createSelector)((state) => state.a
|
|
|
107
107
|
fixedAssetsAccountHierarchy: accountMappingState.fixedAssetsNestedAccountListHierarchy,
|
|
108
108
|
accruedExpensesAccountHierarchy: accountMappingState.accruedExpensesNestedAccountListHierarchy,
|
|
109
109
|
bankAccounts1099FilingAccountHierarchy: accountMappingState.bankAccounts1099FilingNestedAccountListHierarchy,
|
|
110
|
-
|
|
110
|
+
expenseAccounts1099FilingAccountHierarchy: accountMappingState.expenseAccounts1099FilingNestedAccountListHierarchy,
|
|
111
111
|
fetchState: fetchState.fetchState,
|
|
112
112
|
saveState,
|
|
113
113
|
};
|
|
@@ -9,6 +9,7 @@ const accountMappingReducer_1 = require("./accountMappingReducer");
|
|
|
9
9
|
const fetchAccountListForAccountTypesEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(accountMappingReducer_1.fetchAccountListForAccountTypes.match), (0, operators_1.switchMap)(() => {
|
|
10
10
|
const queryParam = {
|
|
11
11
|
is_bookkeeping_admin: false,
|
|
12
|
+
is_include_tax_1099_config: true,
|
|
12
13
|
};
|
|
13
14
|
return zeniAPI
|
|
14
15
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accounts?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
@@ -11,13 +11,12 @@ const snackbarReducer_1 = require("../../entity/snackbar/snackbarReducer");
|
|
|
11
11
|
const saveAccountMappingViewEpic = (actions$, state, zeniAPI) => actions$.pipe((0, operators_1.filter)(accountMappingReducer_1.saveAccountMapping.match), (0, operators_1.mergeMap)(() => {
|
|
12
12
|
const accountMappingState = state.value.accountMappingState;
|
|
13
13
|
const payload = (0, accountMappingPayload_1.toSaveAccountMappingPayload)(accountMappingState.data);
|
|
14
|
-
const payloadFiling1099 = (0, accountMappingPayload_1.toSaveFiling1099Payload)(accountMappingState.data);
|
|
15
14
|
if (payload.length === 0) {
|
|
16
15
|
return (0, rxjs_1.from)([]);
|
|
17
16
|
}
|
|
18
17
|
else {
|
|
19
18
|
return zeniAPI
|
|
20
|
-
.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accounts`, { accounts: payload
|
|
19
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accounts`, { accounts: payload })
|
|
21
20
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
22
21
|
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
23
22
|
const actionsSuccess = [
|
|
@@ -9,7 +9,7 @@ export declare const getCardBalance: (state: RootState) => {
|
|
|
9
9
|
accountsInOrder: {
|
|
10
10
|
accountId: string;
|
|
11
11
|
accountName: string;
|
|
12
|
-
accountType: "cash_position" | "fixed_assets" | "bank" | "credit_card" | "expenses" | "cogs" | "income" | "cash_in" | "cash_out" | "other_income" | "other_expense" | "accounts_receivable" | "other_current_assets" | "other_assets" | "accounts_payable" | "other_current_liabilities" | "long_term_liabilities" | "equity" | "current_liabilities" | "current_assets" |
|
|
12
|
+
accountType: "cash_position" | "fixed_assets" | "bank" | "credit_card" | "expenses" | "cogs" | "income" | "cash_in" | "cash_out" | "other_income" | "other_expense" | "accounts_receivable" | "other_current_assets" | "other_assets" | "accounts_payable" | "other_current_liabilities" | "long_term_liabilities" | "equity" | "current_liabilities" | "current_assets" | undefined;
|
|
13
13
|
accountSubType: string | undefined;
|
|
14
14
|
accountDescription: string;
|
|
15
15
|
last4Digits: string | undefined;
|
|
@@ -21,7 +21,7 @@ export declare const getCardBalance: (state: RootState) => {
|
|
|
21
21
|
coaId: string | undefined;
|
|
22
22
|
classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
|
|
23
23
|
accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
|
|
24
|
-
labels: ("prepaid_expenses" | "fixed_assets" | "
|
|
24
|
+
labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses")[];
|
|
25
25
|
}[];
|
|
26
26
|
balance: import("../..").Balance | undefined;
|
|
27
27
|
firstMonthOfFY: 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
@@ -9,7 +9,7 @@ export declare const getCashBalance: (state: RootState) => {
|
|
|
9
9
|
accountsInOrder: {
|
|
10
10
|
accountId: string;
|
|
11
11
|
accountName: string;
|
|
12
|
-
accountType: "cash_position" | "fixed_assets" | "bank" | "credit_card" | "expenses" | "cogs" | "income" | "cash_in" | "cash_out" | "other_income" | "other_expense" | "accounts_receivable" | "other_current_assets" | "other_assets" | "accounts_payable" | "other_current_liabilities" | "long_term_liabilities" | "equity" | "current_liabilities" | "current_assets" |
|
|
12
|
+
accountType: "cash_position" | "fixed_assets" | "bank" | "credit_card" | "expenses" | "cogs" | "income" | "cash_in" | "cash_out" | "other_income" | "other_expense" | "accounts_receivable" | "other_current_assets" | "other_assets" | "accounts_payable" | "other_current_liabilities" | "long_term_liabilities" | "equity" | "current_liabilities" | "current_assets" | undefined;
|
|
13
13
|
accountSubType: string | undefined;
|
|
14
14
|
accountDescription: string;
|
|
15
15
|
last4Digits: string | undefined;
|
|
@@ -21,7 +21,7 @@ export declare const getCashBalance: (state: RootState) => {
|
|
|
21
21
|
coaId: string | undefined;
|
|
22
22
|
classesViewParentId: import("../../commonStateTypes/classesView/nestedClassID").ClassesViewParentID | undefined;
|
|
23
23
|
accountsViewParentId: import("../../commonStateTypes/accountView/nestedAccountID").AccountsViewParentID | undefined;
|
|
24
|
-
labels: ("prepaid_expenses" | "fixed_assets" | "
|
|
24
|
+
labels: ("prepaid_expenses" | "fixed_assets" | "uncategorized_income" | "uncategorized_expense" | "bank_charges_and_fees" | "travel_transportation" | "accrued_expenses")[];
|
|
25
25
|
}[];
|
|
26
26
|
balance: import("../..").Balance | undefined;
|
|
27
27
|
firstMonthOfFY: 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
@@ -11,7 +11,7 @@ export interface BillPayConfigPayload {
|
|
|
11
11
|
is_international_wire_enabled: boolean;
|
|
12
12
|
is_international_wires_verified: boolean;
|
|
13
13
|
payment_processor: BillPayConfigPaymentProcessorPayload;
|
|
14
|
-
|
|
14
|
+
max_bills_allowed_for_bulk_action: number;
|
|
15
15
|
required_fields: {
|
|
16
16
|
ach: Record<PaymentAchSubConfigCodeType, string[]>;
|
|
17
17
|
wire: Record<BillPaymentWireSubConfigCodeType, string[]>;
|
|
@@ -79,7 +79,7 @@ const billPayConfig = (0, toolkit_1.createSlice)({
|
|
|
79
79
|
draft.fetchState = 'Completed';
|
|
80
80
|
draft.error = undefined;
|
|
81
81
|
draft.billPayBotEmail = payload.bill_pay_bot_email;
|
|
82
|
-
draft.billBulkSubmissionLimit = payload.
|
|
82
|
+
draft.billBulkSubmissionLimit = payload.max_bills_allowed_for_bulk_action;
|
|
83
83
|
draft.vendor.supportedCountries = vendor.supported_countries.map((country) => {
|
|
84
84
|
return {
|
|
85
85
|
countryCode: country.country_code,
|
package/lib/view/spendManagement/reimbursement/reimbursementConfig/reimbursementConfigPayload.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface ReimbursementConfigPayload {
|
|
|
9
9
|
};
|
|
10
10
|
currency_country_map: CurrencyCountryPayload[];
|
|
11
11
|
reimbursement_bot_email: string;
|
|
12
|
-
|
|
12
|
+
max_reimbursements_allowed_for_bulk_action: number;
|
|
13
13
|
}
|
|
14
14
|
interface ReimbursementConfigPaymentProcessorPayload {
|
|
15
15
|
payment_timeline: Record<ReimbursementmentConfigCodeType, Record<ReimbursementmentSubConfigCodeType, ConfigTimelinePayload>>;
|
package/lib/view/spendManagement/reimbursement/reimbursementConfig/reimbursementConfigReducer.js
CHANGED
|
@@ -41,7 +41,7 @@ const reimbursementConfig = (0, toolkit_1.createSlice)({
|
|
|
41
41
|
draft.error = undefined;
|
|
42
42
|
draft.reimbursementBotEmail = payload.reimbursement_bot_email;
|
|
43
43
|
draft.reimbursementBulkSubmissionLimit =
|
|
44
|
-
payload.
|
|
44
|
+
payload.max_reimbursements_allowed_for_bulk_action;
|
|
45
45
|
},
|
|
46
46
|
updateReimbursementConfigFailure(draft, action) {
|
|
47
47
|
draft.fetchState = 'Error';
|
|
@@ -22,7 +22,7 @@ export declare const getTopExpenses: (accountState: AccountState, topExState: To
|
|
|
22
22
|
accountsOrdered: {
|
|
23
23
|
accountId: string;
|
|
24
24
|
accountName: string;
|
|
25
|
-
accountType: "cash_position" | "fixed_assets" | "bank" | "credit_card" | "expenses" | "cogs" | "income" | "cash_in" | "cash_out" | "other_income" | "other_expense" | "accounts_receivable" | "other_current_assets" | "other_assets" | "accounts_payable" | "other_current_liabilities" | "long_term_liabilities" | "equity" | "current_liabilities" | "current_assets" |
|
|
25
|
+
accountType: "cash_position" | "fixed_assets" | "bank" | "credit_card" | "expenses" | "cogs" | "income" | "cash_in" | "cash_out" | "other_income" | "other_expense" | "accounts_receivable" | "other_current_assets" | "other_assets" | "accounts_payable" | "other_current_liabilities" | "long_term_liabilities" | "equity" | "current_liabilities" | "current_assets" | undefined;
|
|
26
26
|
accountSubType: string | undefined;
|
|
27
27
|
accountDescription: string;
|
|
28
28
|
logo: import("url-parse")<string> | import("url-parse")<Record<string, string | undefined>> | undefined;
|