@zeniai/client-epic-state 4.8.87 → 4.8.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/jeSchedules/jeSchedulesPayload.js +5 -12
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailLocalDataHelper.js +1 -1
- package/lib/view/scheduleView/scheduleDetailView/scheduleDetailPayload.js +7 -11
- package/lib/view/spendManagement/billPay/editBillView/epics/saveBillDetailEpic.js +3 -0
- package/package.json +1 -1
|
@@ -65,16 +65,12 @@ function toJEAccountPayload(payload, type) {
|
|
|
65
65
|
account_id: payload.je_credit_account_id,
|
|
66
66
|
labels: [],
|
|
67
67
|
}
|
|
68
|
-
:
|
|
69
|
-
account_name: payload.base_transaction.account_name,
|
|
70
|
-
account_id: payload.base_transaction.account_id,
|
|
71
|
-
labels: [],
|
|
72
|
-
};
|
|
68
|
+
: undefined;
|
|
73
69
|
}
|
|
74
70
|
}
|
|
75
71
|
exports.toJEAccountPayload = toJEAccountPayload;
|
|
76
72
|
function toJEClassPayload(payload, type) {
|
|
77
|
-
var _a, _b
|
|
73
|
+
var _a, _b;
|
|
78
74
|
if (type === 'debit') {
|
|
79
75
|
return payload.je_debit_accounting_class_id != null
|
|
80
76
|
? {
|
|
@@ -89,10 +85,7 @@ function toJEClassPayload(payload, type) {
|
|
|
89
85
|
accounting_class_name: (_b = payload.je_credit_accounting_class_name) !== null && _b !== void 0 ? _b : '',
|
|
90
86
|
accounting_class_id: payload.je_credit_accounting_class_id,
|
|
91
87
|
}
|
|
92
|
-
:
|
|
93
|
-
accounting_class_name: (_c = payload.base_transaction.accounting_class_name) !== null && _c !== void 0 ? _c : '',
|
|
94
|
-
accounting_class_id: payload.base_transaction.accounting_class_id,
|
|
95
|
-
};
|
|
88
|
+
: undefined;
|
|
96
89
|
}
|
|
97
90
|
}
|
|
98
91
|
exports.toJEClassPayload = toJEClassPayload;
|
|
@@ -125,8 +118,8 @@ function toJEScheduledTransaction(payload) {
|
|
|
125
118
|
balanceAsOfToday: (_b = payload.balance) !== null && _b !== void 0 ? _b : undefined,
|
|
126
119
|
updatedAt: payload.updated_at != null ? (0, zeniDayJS_1.date)(payload.updated_at) : undefined,
|
|
127
120
|
jeCredit: {
|
|
128
|
-
accountId: (_c = payload.je_credit_account_id) !== null && _c !== void 0 ? _c :
|
|
129
|
-
accountingClassId: (_d = payload.je_credit_accounting_class_id) !== null && _d !== void 0 ? _d :
|
|
121
|
+
accountId: (_c = payload.je_credit_account_id) !== null && _c !== void 0 ? _c : undefined,
|
|
122
|
+
accountingClassId: (_d = payload.je_credit_accounting_class_id) !== null && _d !== void 0 ? _d : undefined,
|
|
130
123
|
},
|
|
131
124
|
jeDebit: {
|
|
132
125
|
accountId: (_e = payload.je_debit_account_id) !== null && _e !== void 0 ? _e : undefined,
|
|
@@ -38,7 +38,7 @@ const createNewSchedulesHelper = (localData, totalAmount, vendorName, otherAttri
|
|
|
38
38
|
return [];
|
|
39
39
|
}
|
|
40
40
|
const averageAmount = Math.abs(Math.round((totalAmount.amount / period) * 100) / 100);
|
|
41
|
-
const lastMonthAmount = Math.abs(Math.round((totalAmount.amount - averageAmount * (period - 1)) * 100) / 100);
|
|
41
|
+
const lastMonthAmount = Math.abs(Math.round((Math.abs(totalAmount.amount) - averageAmount * (period - 1)) * 100) / 100);
|
|
42
42
|
let runningBalance = Math.abs(totalAmount.amount);
|
|
43
43
|
const negativeNumbers = totalAmount.amount < 0 || runningBalance < 0;
|
|
44
44
|
for (let index = 0; index < period; index++) {
|
|
@@ -67,8 +67,8 @@ const mapJEScheduleLocalDataToScheduleDetailPayload = (jeScheduleDetails, jeSche
|
|
|
67
67
|
};
|
|
68
68
|
exports.mapJEScheduleLocalDataToScheduleDetailPayload = mapJEScheduleLocalDataToScheduleDetailPayload;
|
|
69
69
|
const mapJEScheduleTransactionToPayload = (jeScheduleTransactionState, vendorState, scheduleDetailsLocalData, jeScheduleType) => {
|
|
70
|
-
var _a, _b;
|
|
71
|
-
const { vendor, currencyCode, currencySymbol, baseTransaction, status, startDate, endDate, balanceAsOfToday, } = jeScheduleTransactionState;
|
|
70
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
71
|
+
const { vendor, currencyCode, currencySymbol, baseTransaction, status, startDate, endDate, balanceAsOfToday, jeCredit, } = jeScheduleTransactionState;
|
|
72
72
|
const { selectedMonths, selectedAccount, selectedClass, selectedDayOfMonth, lastDayOfMonth, } = scheduleDetailsLocalData;
|
|
73
73
|
const postingDate = selectedDayOfMonth !== null && selectedDayOfMonth !== void 0 ? selectedDayOfMonth : (lastDayOfMonth != null ? timePeriod_1.LAST_SCHEDULE_DAY_OF_MONTH : null);
|
|
74
74
|
const scheduleLength = scheduleDetailsLocalData.jeScheduleDetails.length;
|
|
@@ -93,10 +93,8 @@ const mapJEScheduleTransactionToPayload = (jeScheduleTransactionState, vendorSta
|
|
|
93
93
|
: baseTransaction.amount.amount,
|
|
94
94
|
start_date: (_a = startDate === null || startDate === void 0 ? void 0 : startDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT)) !== null && _a !== void 0 ? _a : firstJEScheduleDate,
|
|
95
95
|
end_date: (_b = endDate === null || endDate === void 0 ? void 0 : endDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT)) !== null && _b !== void 0 ? _b : lastJEScheduleDate,
|
|
96
|
-
je_credit_accounting_class_id: baseTransaction.classBase
|
|
97
|
-
|
|
98
|
-
: null,
|
|
99
|
-
je_credit_account_id: baseTransaction.account.accountId,
|
|
96
|
+
je_credit_accounting_class_id: (_f = (_d = (_c = jeCredit.accountingClass) === null || _c === void 0 ? void 0 : _c.classId) !== null && _d !== void 0 ? _d : (_e = baseTransaction.classBase) === null || _e === void 0 ? void 0 : _e.classId) !== null && _f !== void 0 ? _f : null,
|
|
97
|
+
je_credit_account_id: (_h = (_g = jeCredit.account) === null || _g === void 0 ? void 0 : _g.accountId) !== null && _h !== void 0 ? _h : baseTransaction.account.accountId,
|
|
100
98
|
je_debit_account_id: selectedAccount !== null && selectedAccount !== void 0 ? selectedAccount : null,
|
|
101
99
|
je_debit_accounting_class_id: selectedClass !== null && selectedClass !== void 0 ? selectedClass : null,
|
|
102
100
|
other_attributes: {},
|
|
@@ -105,8 +103,8 @@ const mapJEScheduleTransactionToPayload = (jeScheduleTransactionState, vendorSta
|
|
|
105
103
|
};
|
|
106
104
|
exports.mapJEScheduleTransactionToPayload = mapJEScheduleTransactionToPayload;
|
|
107
105
|
const mapFixedAssetJEScheduleTransactionToPayload = (jeScheduleTransactionState, vendorState, scheduleDetailsLocalData) => {
|
|
108
|
-
var _a, _b;
|
|
109
|
-
const { vendor, currencyCode, currencySymbol, baseTransaction, status, startDate, endDate, balanceAsOfToday, } = jeScheduleTransactionState;
|
|
106
|
+
var _a, _b, _c, _d, _e, _f;
|
|
107
|
+
const { vendor, currencyCode, currencySymbol, baseTransaction, status, startDate, endDate, balanceAsOfToday, jeCredit, } = jeScheduleTransactionState;
|
|
110
108
|
const { selectedMonths, selectedAccount, selectedClass, selectedDayOfMonth, lastDayOfMonth, selectedAccumulatedDepreciationCategory, assetId, } = scheduleDetailsLocalData;
|
|
111
109
|
const postingDate = selectedDayOfMonth !== null && selectedDayOfMonth !== void 0 ? selectedDayOfMonth : (lastDayOfMonth != null ? timePeriod_1.LAST_SCHEDULE_DAY_OF_MONTH : null);
|
|
112
110
|
const scheduleLength = scheduleDetailsLocalData.jeScheduleDetails.length;
|
|
@@ -131,9 +129,7 @@ const mapFixedAssetJEScheduleTransactionToPayload = (jeScheduleTransactionState,
|
|
|
131
129
|
: baseTransaction.amount.amount,
|
|
132
130
|
start_date: (_a = startDate === null || startDate === void 0 ? void 0 : startDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT)) !== null && _a !== void 0 ? _a : firstJEScheduleDate,
|
|
133
131
|
end_date: (_b = endDate === null || endDate === void 0 ? void 0 : endDate.format(formatZeniDateFY_1.DEFAULT_DATE_FORMAT)) !== null && _b !== void 0 ? _b : lastJEScheduleDate,
|
|
134
|
-
je_credit_accounting_class_id: baseTransaction.classBase
|
|
135
|
-
? baseTransaction.classBase.classId
|
|
136
|
-
: null,
|
|
132
|
+
je_credit_accounting_class_id: (_f = (_d = (_c = jeCredit.accountingClass) === null || _c === void 0 ? void 0 : _c.classId) !== null && _d !== void 0 ? _d : (_e = baseTransaction.classBase) === null || _e === void 0 ? void 0 : _e.classId) !== null && _f !== void 0 ? _f : null,
|
|
137
133
|
je_credit_account_id: selectedAccumulatedDepreciationCategory !== null && selectedAccumulatedDepreciationCategory !== void 0 ? selectedAccumulatedDepreciationCategory : null,
|
|
138
134
|
je_debit_account_id: selectedAccount !== null && selectedAccount !== void 0 ? selectedAccount : null,
|
|
139
135
|
je_debit_accounting_class_id: selectedClass !== null && selectedClass !== void 0 ? selectedClass : null,
|
|
@@ -107,6 +107,9 @@ function prepareSaveBillPayload(accountState, billTransactionState, paymentAccou
|
|
|
107
107
|
candidate_vendor_name: isRecommendedVendor
|
|
108
108
|
? undefined
|
|
109
109
|
: (_f = billDetail.addBillAutoFields.tentativeVendorName) !== null && _f !== void 0 ? _f : billDetail.billDetailLocalData.candidateVendorname,
|
|
110
|
+
ocr_parsed_vendor_term: Boolean(billDetail.addBillAutoFields.tentativeVendorName) === true
|
|
111
|
+
? billDetail.addBillAutoFields.tentativeVendorName
|
|
112
|
+
: null,
|
|
110
113
|
transaction_type: 'bill',
|
|
111
114
|
bill_pay_provider: 'zeni',
|
|
112
115
|
account_id: zeniAccountId != null
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.89",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|