@zeniai/client-epic-state 4.10.19 → 4.10.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/billPay/billTransaction/billTransactionPayload.d.ts +3 -3
- package/lib/entity/billPay/billTransaction/billTransactionPayload.js +1 -7
- package/lib/entity/billPay/billTransaction/billTransactionState.d.ts +1 -1
- package/lib/entity/tenant/tenantSelector.d.ts +2 -2
- package/lib/entity/tenant/tenantSelector.js +8 -4
- package/lib/view/reviewCompanyView/reviewCompanyViewSelector.d.ts +0 -4
- package/lib/view/reviewCompanyView/reviewCompanyViewSelector.js +1 -10
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +2 -2
- package/package.json +1 -1
|
@@ -11,9 +11,9 @@ export interface BillTransactionPayload extends VendorTransactionPayload {
|
|
|
11
11
|
is_recurring: boolean;
|
|
12
12
|
recurring_bill_config_id: string | null;
|
|
13
13
|
recurring_bill_instance: number | null;
|
|
14
|
-
home_currency_amount
|
|
15
|
-
home_currency_code
|
|
16
|
-
home_currency_symbol
|
|
14
|
+
home_currency_amount: number;
|
|
15
|
+
home_currency_code: string;
|
|
16
|
+
home_currency_symbol: string;
|
|
17
17
|
class_id?: ID | null;
|
|
18
18
|
class_name?: string | null;
|
|
19
19
|
qbo_class_id?: ID | null;
|
|
@@ -9,13 +9,7 @@ const billTransactionState_1 = require("./billTransactionState");
|
|
|
9
9
|
const billPayConfigPayload_1 = require("../../../view/spendManagement/billPay/billPayConfig/billPayConfigPayload");
|
|
10
10
|
const toBillTransaction = (payload) => {
|
|
11
11
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
12
|
-
return Object.assign(Object.assign({}, (0, vendorTransactionPayload_1.toVendorTransaction)(payload)), { billPayInfo: (0, exports.toBillPayInfo)(payload.bill_pay_info), classId: (_a = payload.class_id) !== null && _a !== void 0 ? _a : '', className: (_b = payload.class_name) !== null && _b !== void 0 ? _b : '', qboClassId: (_c = payload.qbo_class_id) !== null && _c !== void 0 ? _c : '', transactionReferenceId: (_d = payload.transaction_reference_id) !== null && _d !== void 0 ? _d : '', entityApprovalId: payload.entity_approval_id, updateTime: (0, zeniDayJS_1.date)(payload.update_time), createdBy: (_e = payload.created_by_user_id) !== null && _e !== void 0 ? _e : '', candidateVendorName: (_f = payload.candidate_vendor_name) !== null && _f !== void 0 ? _f : '', bookCloseDate: payload.book_close_date != null
|
|
13
|
-
? (0, zeniDayJS_1.date)(payload.book_close_date)
|
|
14
|
-
: undefined, lastUpdatedByUserId: (_g = payload.last_updated_by_user_id) !== null && _g !== void 0 ? _g : '', paymentProcessingTotalFee: (0, amount_1.toAmount)((_h = payload.total_fee) !== null && _h !== void 0 ? _h : 0, payload.currency_code, payload.currency_symbol), isDeleted: payload.is_deleted, deletionInfo: (0, exports.toDeletionInfo)(payload.deletion_info), isRecurring: payload.is_recurring, recurringBillConfigId: (_j = payload.recurring_bill_config_id) !== null && _j !== void 0 ? _j : undefined, recurringBillInstance: (_k = payload.recurring_bill_instance) !== null && _k !== void 0 ? _k : undefined, totalAmountInUSD: payload.home_currency_amount != null &&
|
|
15
|
-
payload.home_currency_code != null &&
|
|
16
|
-
payload.home_currency_symbol != null
|
|
17
|
-
? (0, amount_1.toAmount)(payload.home_currency_amount, payload.home_currency_code, payload.home_currency_symbol)
|
|
18
|
-
: undefined });
|
|
12
|
+
return (Object.assign(Object.assign({}, (0, vendorTransactionPayload_1.toVendorTransaction)(payload)), { billPayInfo: (0, exports.toBillPayInfo)(payload.bill_pay_info), classId: (_a = payload.class_id) !== null && _a !== void 0 ? _a : '', className: (_b = payload.class_name) !== null && _b !== void 0 ? _b : '', qboClassId: (_c = payload.qbo_class_id) !== null && _c !== void 0 ? _c : '', transactionReferenceId: (_d = payload.transaction_reference_id) !== null && _d !== void 0 ? _d : '', entityApprovalId: payload.entity_approval_id, updateTime: (0, zeniDayJS_1.date)(payload.update_time), createdBy: (_e = payload.created_by_user_id) !== null && _e !== void 0 ? _e : '', candidateVendorName: (_f = payload.candidate_vendor_name) !== null && _f !== void 0 ? _f : '', bookCloseDate: payload.book_close_date != null ? (0, zeniDayJS_1.date)(payload.book_close_date) : undefined, lastUpdatedByUserId: (_g = payload.last_updated_by_user_id) !== null && _g !== void 0 ? _g : '', paymentProcessingTotalFee: (0, amount_1.toAmount)((_h = payload.total_fee) !== null && _h !== void 0 ? _h : 0, payload.currency_code, payload.currency_symbol), isDeleted: payload.is_deleted, deletionInfo: (0, exports.toDeletionInfo)(payload.deletion_info), isRecurring: payload.is_recurring, recurringBillConfigId: (_j = payload.recurring_bill_config_id) !== null && _j !== void 0 ? _j : undefined, recurringBillInstance: (_k = payload.recurring_bill_instance) !== null && _k !== void 0 ? _k : undefined, totalAmountInUSD: (0, amount_1.toAmount)(payload.home_currency_amount, payload.home_currency_code, payload.home_currency_symbol) }));
|
|
19
13
|
};
|
|
20
14
|
exports.toBillTransaction = toBillTransaction;
|
|
21
15
|
const toBillPayInfo = (payload) => {
|
|
@@ -19,7 +19,7 @@ export interface BillTransaction extends VendorTransaction {
|
|
|
19
19
|
isDeleted: boolean;
|
|
20
20
|
deletionInfo: DeletionInfo;
|
|
21
21
|
isRecurring: boolean;
|
|
22
|
-
totalAmountInUSD
|
|
22
|
+
totalAmountInUSD: Amount;
|
|
23
23
|
recurringBillConfigId?: ID;
|
|
24
24
|
recurringBillInstance?: number;
|
|
25
25
|
bookCloseDate?: ZeniDate;
|
|
@@ -73,6 +73,6 @@ export declare const isZeniDomainTenant: (currentTenant: TenantView) => boolean;
|
|
|
73
73
|
export declare const isTenantUsingZeniCOA: (currentTenant: TenantView) => boolean;
|
|
74
74
|
export declare const getCurrentTenantExternalConnections: (tenantState: TenantState, companyState: CompanyState) => TenantExternalConnections | undefined;
|
|
75
75
|
export declare const toTenantCoreDetailsView: (tenantsBaseView: TenantBaseView[]) => TenantCoreDetailsView[];
|
|
76
|
-
export declare const isTenantBankingOnly: (tenant: Tenant) => boolean;
|
|
77
|
-
export declare const isTenantBookkeepingEnabled: (tenant: Tenant) => boolean;
|
|
76
|
+
export declare const isTenantBankingOnly: (tenant: Tenant | undefined) => boolean;
|
|
77
|
+
export declare const isTenantBookkeepingEnabled: (tenant: Tenant | undefined) => boolean;
|
|
78
78
|
export {};
|
|
@@ -243,12 +243,16 @@ const toTenantCoreDetailsView = (tenantsBaseView) => {
|
|
|
243
243
|
};
|
|
244
244
|
exports.toTenantCoreDetailsView = toTenantCoreDetailsView;
|
|
245
245
|
const isTenantBankingOnly = (tenant) => {
|
|
246
|
-
return
|
|
247
|
-
|
|
248
|
-
|
|
246
|
+
return tenant != null
|
|
247
|
+
? tenant.productSettings.isBankingEnabled === true &&
|
|
248
|
+
tenant.productSettings.isBookkeepingEnabled === false &&
|
|
249
|
+
tenant.productSettings.isSpendManagementEnabled === false
|
|
250
|
+
: false;
|
|
249
251
|
};
|
|
250
252
|
exports.isTenantBankingOnly = isTenantBankingOnly;
|
|
251
253
|
const isTenantBookkeepingEnabled = (tenant) => {
|
|
252
|
-
return tenant
|
|
254
|
+
return tenant != null
|
|
255
|
+
? tenant.productSettings.isBookkeepingEnabled === true
|
|
256
|
+
: true;
|
|
253
257
|
};
|
|
254
258
|
exports.isTenantBookkeepingEnabled = isTenantBookkeepingEnabled;
|
|
@@ -2,12 +2,8 @@ import { RootState } from '../../reducer';
|
|
|
2
2
|
import { ReviewCompany, ReviewCompanyListUIState } from './reviewCompanyViewState';
|
|
3
3
|
import { User } from '../../entity/user/userState';
|
|
4
4
|
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
|
-
import { UserAndRole } from '../companyView/types/userAndRole';
|
|
6
|
-
import { AllowedValue } from '../../commonStateTypes/allowedValue';
|
|
7
5
|
export interface ReviewCompanyView extends ReviewCompany {
|
|
8
6
|
noteLastUpdatedBy?: User;
|
|
9
|
-
controllers: UserAndRole[];
|
|
10
|
-
customerGroups: AllowedValue[];
|
|
11
7
|
}
|
|
12
8
|
export interface ReviewCompanySelectorView extends SelectorView {
|
|
13
9
|
companies: ReviewCompanyView[];
|
|
@@ -8,8 +8,6 @@ const toolkit_1 = require("@reduxjs/toolkit");
|
|
|
8
8
|
const orderBy_1 = __importDefault(require("lodash/orderBy"));
|
|
9
9
|
const values_1 = __importDefault(require("lodash/values"));
|
|
10
10
|
const userSelector_1 = require("../../entity/user/userSelector");
|
|
11
|
-
const companySelector_1 = require("../../entity/company/companySelector");
|
|
12
|
-
const userAndRole_1 = require("../companyView/types/userAndRole");
|
|
13
11
|
exports.getReviewCompanySelectorView = (0, toolkit_1.createSelector)((state) => state, (rootState) => {
|
|
14
12
|
const { filterText, sortKey, sortOrder } = rootState.reviewCompanyViewState.uiState;
|
|
15
13
|
const companies = (0, values_1.default)(rootState.reviewCompanyViewState.reviewCompanyById)
|
|
@@ -18,14 +16,7 @@ exports.getReviewCompanySelectorView = (0, toolkit_1.createSelector)((state) =>
|
|
|
18
16
|
.toLowerCase()
|
|
19
17
|
.includes(filterText.toLowerCase()))
|
|
20
18
|
.map((company) => {
|
|
21
|
-
|
|
22
|
-
const companyWithSchema = (0, companySelector_1.getCompanyByCompanyId)(rootState.companyState, company.companyId);
|
|
23
|
-
const controllerUserIds = (_a = companyWithSchema === null || companyWithSchema === void 0 ? void 0 : companyWithSchema.company.managegmentInfo.controllerUserIds) !== null && _a !== void 0 ? _a : [];
|
|
24
|
-
const controllers = controllerUserIds
|
|
25
|
-
.map((userId) => (0, userAndRole_1.getUserAndUserRole)(rootState.userState, rootState.userRoleState, rootState.addressState, userId))
|
|
26
|
-
.filter((value) => value != null);
|
|
27
|
-
const groups = (_b = companyWithSchema === null || companyWithSchema === void 0 ? void 0 : companyWithSchema.schema.companyGroup) !== null && _b !== void 0 ? _b : [];
|
|
28
|
-
const reviewViewCompany = Object.assign(Object.assign({}, company), { controllers, customerGroups: groups });
|
|
19
|
+
const reviewViewCompany = Object.assign({}, company);
|
|
29
20
|
if (company.noteLastUpdatedUserId != null) {
|
|
30
21
|
reviewViewCompany.noteLastUpdatedBy = (0, userSelector_1.getUserByUserId)(rootState.userState, company.noteLastUpdatedUserId);
|
|
31
22
|
}
|
|
@@ -400,7 +400,7 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
|
|
|
400
400
|
}
|
|
401
401
|
};
|
|
402
402
|
const sortedTransactionsWithSortKeyValue = (0, orderBy_1.default)(transactionsWithSortKeyValue, (transaction) => {
|
|
403
|
-
var _a, _b
|
|
403
|
+
var _a, _b;
|
|
404
404
|
switch (sortKey) {
|
|
405
405
|
case 'name':
|
|
406
406
|
return (_a = transaction.vendor) === null || _a === void 0 ? void 0 : _a.name.toLowerCase();
|
|
@@ -413,7 +413,7 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
|
|
|
413
413
|
case 'status':
|
|
414
414
|
return getStatusPerTab(transaction);
|
|
415
415
|
case 'amount':
|
|
416
|
-
return (
|
|
416
|
+
return (_b = transaction.totalAmountInUSD.amount) !== null && _b !== void 0 ? _b : 0;
|
|
417
417
|
case 'paymentMethod':
|
|
418
418
|
return transaction.billPayInfo.billPaymentMethodType.name;
|
|
419
419
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.20",
|
|
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",
|