law-common 11.3.21-beta.4 → 11.3.21-beta.5
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.
|
@@ -15,4 +15,10 @@ export interface IVendorAdvanceEntity extends IEntityAuditColumn {
|
|
|
15
15
|
amountPaid: number;
|
|
16
16
|
status: VendorAdvanceStatusEnum;
|
|
17
17
|
appliedAmount?: Nullable<number>;
|
|
18
|
+
gstRateId: number;
|
|
19
|
+
gstAmount: number;
|
|
20
|
+
invoiceAmount: number;
|
|
21
|
+
tdsRateId: number;
|
|
22
|
+
tdsAmount: number;
|
|
23
|
+
netAmount: number;
|
|
18
24
|
}
|
|
@@ -8,19 +8,19 @@ import { IVendorAdvanceEntity } from "../interface/vendor_advance.entity.interfa
|
|
|
8
8
|
import { VendorAdvancePaymentMode } from "../enums/vendor_advance_payment_mode";
|
|
9
9
|
import { VendorAdvanceStatusEnum } from "../enums/vendor_advance_status_enum";
|
|
10
10
|
import { VendorEntityModel } from "./vendor.entity.model";
|
|
11
|
+
import { GstRateEntityModel } from "./gst_rate.entity.model";
|
|
12
|
+
import { TdsRateEntityModel } from "./tds_rate.entity.model";
|
|
11
13
|
import { StateEntityModel } from "./state.entity.model";
|
|
12
14
|
import { CountryEntityModel } from "./country.entity.model";
|
|
13
15
|
import { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
|
|
14
16
|
import { OfficeLocationEntityModel } from "./office_location.entity.model";
|
|
15
17
|
import { VendorInvoiceItemEntityModel } from "./vendor_invoice_item.entity.model";
|
|
16
18
|
import { VoucherTypeEntityModel } from "./voucher_type.entity.model";
|
|
17
|
-
import { TdsRateEntityModel } from "./tds_rate.entity.model";
|
|
18
19
|
import { OrganizationTypeEntityModel } from "./organization_type.entity.model";
|
|
19
20
|
import { VendorTdsLiabilityEntityModel } from "./vendor_tds_liability.entity.model";
|
|
20
21
|
import { VendorTdsChallanEntityModel } from "./vendor_tds_challan.entity.model";
|
|
21
22
|
import { BankEntityModel } from "./bank.entity.model";
|
|
22
23
|
import { ExpenseHeadEntityModel } from "./expense_head.entity.model";
|
|
23
|
-
import { GstRateEntityModel } from "./gst_rate.entity.model";
|
|
24
24
|
import { VendorInvoicePaymentEntityModel } from "./vendor_invoice_payment.entity.model";
|
|
25
25
|
import { VendorAdvanceActionEnum } from "../../api";
|
|
26
26
|
import { IVendorAdvanceFlowConfigContextData } from "../flow-configs/vendor_advance_flow.config";
|
|
@@ -34,6 +34,12 @@ export declare class VendorAdvanceEntityModel extends BaseEntityModel<EntityEnum
|
|
|
34
34
|
tdsPercent: number;
|
|
35
35
|
purpose?: string;
|
|
36
36
|
advanceDocument?: string;
|
|
37
|
+
gstRateId: number;
|
|
38
|
+
gstAmount: number;
|
|
39
|
+
invoiceAmount: number;
|
|
40
|
+
tdsRateId: number;
|
|
41
|
+
tdsAmount: number;
|
|
42
|
+
netAmount: number;
|
|
37
43
|
amountPaid: number;
|
|
38
44
|
status: VendorAdvanceStatusEnum;
|
|
39
45
|
appliedAmount?: number;
|
|
@@ -42,7 +48,9 @@ export declare class VendorAdvanceEntityModel extends BaseEntityModel<EntityEnum
|
|
|
42
48
|
createdBy: number;
|
|
43
49
|
updatedBy: number;
|
|
44
50
|
vendor?: VendorEntityModel;
|
|
45
|
-
|
|
51
|
+
gstRate?: GstRateEntityModel;
|
|
52
|
+
tdsRate?: TdsRateEntityModel;
|
|
53
|
+
static relationConfigs: RelationConfigs<[EntityEnum.VENDOR, EntityEnum.GST_RATE, EntityEnum.TDS_RATE], EntityEnum.VENDOR_ADVANCE>;
|
|
46
54
|
static fromEntity(entity: IVendorAdvanceEntity): VendorAdvanceEntityModel;
|
|
47
55
|
getRelationConfigs(): any[];
|
|
48
56
|
get state(): StateEntityModel | undefined;
|
|
@@ -51,13 +59,11 @@ export declare class VendorAdvanceEntityModel extends BaseEntityModel<EntityEnum
|
|
|
51
59
|
get officeLocations(): OfficeLocationEntityModel[] | undefined;
|
|
52
60
|
get vendorInvoiceItems(): VendorInvoiceItemEntityModel[] | undefined;
|
|
53
61
|
get voucherTypes(): VoucherTypeEntityModel[] | undefined;
|
|
54
|
-
get
|
|
55
|
-
get organizationType(): OrganizationTypeEntityModel | undefined;
|
|
62
|
+
get organizationTypes(): OrganizationTypeEntityModel[] | undefined;
|
|
56
63
|
get vendorTdsLiabilitys(): VendorTdsLiabilityEntityModel[] | undefined;
|
|
57
64
|
get vendorTdsChallans(): VendorTdsChallanEntityModel[] | undefined;
|
|
58
65
|
get banks(): BankEntityModel[] | undefined;
|
|
59
66
|
get expenseHeads(): ExpenseHeadEntityModel[] | undefined;
|
|
60
|
-
get gstRates(): GstRateEntityModel[] | undefined;
|
|
61
67
|
get vendorInvoicePayments(): VendorInvoicePaymentEntityModel[] | undefined;
|
|
62
68
|
getNextStatus(currentUser: IUserEntity, action: VendorAdvanceActionEnum, vendorAdvanceFlowConfigContextData: IVendorAdvanceFlowConfigContextData): VendorAdvanceStatusEnum;
|
|
63
69
|
getAvailableActions(currentUser: UserEntityModel, config?: {
|
|
@@ -20,6 +20,12 @@ class VendorAdvanceEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
20
20
|
this.paymentMode = vendor_advance_payment_mode_1.VendorAdvancePaymentMode.NEFT;
|
|
21
21
|
this.reference = "";
|
|
22
22
|
this.tdsPercent = 0;
|
|
23
|
+
this.gstRateId = 0;
|
|
24
|
+
this.gstAmount = 0;
|
|
25
|
+
this.invoiceAmount = 0;
|
|
26
|
+
this.tdsRateId = 0;
|
|
27
|
+
this.tdsAmount = 0;
|
|
28
|
+
this.netAmount = 0;
|
|
23
29
|
this.amountPaid = 0;
|
|
24
30
|
this.status = vendor_advance_status_enum_1.VendorAdvanceStatusEnum.APPROVED;
|
|
25
31
|
this.createdOn = 0;
|
|
@@ -73,81 +79,48 @@ class VendorAdvanceEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
73
79
|
}, []);
|
|
74
80
|
}
|
|
75
81
|
get vendorInvoiceItems() {
|
|
76
|
-
//
|
|
77
|
-
// {'vendor_advance->
|
|
78
|
-
// ['
|
|
79
|
-
// ['
|
|
82
|
+
// many_to_many -> many_to_many verified
|
|
83
|
+
// {'vendor_advance->tds_rate': 'many_to_one', 'tds_rate->vendor_invoice_item': 'one_to_many'}
|
|
84
|
+
// ['vendor_advance', 'tds_rate'] -> many_to_one
|
|
85
|
+
// ['tds_rate', 'vendor_invoice_item'] -> one_to_many
|
|
80
86
|
var _a;
|
|
81
|
-
return (_a = this.
|
|
82
|
-
if (!accumulator.some((vendorInvoiceItem) => vendorInvoiceItem.id === current.id)) {
|
|
83
|
-
accumulator.push(current);
|
|
84
|
-
}
|
|
85
|
-
return accumulator;
|
|
86
|
-
}, []);
|
|
87
|
+
return (_a = this.tdsRate) === null || _a === void 0 ? void 0 : _a.vendorInvoiceItems;
|
|
87
88
|
}
|
|
88
89
|
get voucherTypes() {
|
|
89
90
|
// many_to_many -> many_to_many verified
|
|
90
|
-
// {'vendor_advance->
|
|
91
|
-
// ['
|
|
92
|
-
// ['
|
|
91
|
+
// {'vendor_advance->tds_rate': 'many_to_one', 'tds_rate->voucher_type': 'many_to_many'}
|
|
92
|
+
// ['vendor_advance', 'tds_rate'] -> many_to_one
|
|
93
|
+
// ['tds_rate', 'voucher_type'] -> many_to_many
|
|
93
94
|
var _a;
|
|
94
|
-
return (_a = this.
|
|
95
|
-
if (!accumulator.some((voucherType) => voucherType.id === current.id)) {
|
|
96
|
-
accumulator.push(current);
|
|
97
|
-
}
|
|
98
|
-
return accumulator;
|
|
99
|
-
}, []);
|
|
95
|
+
return (_a = this.tdsRate) === null || _a === void 0 ? void 0 : _a.voucherTypes;
|
|
100
96
|
}
|
|
101
|
-
get
|
|
97
|
+
get organizationTypes() {
|
|
102
98
|
// many_to_many -> many_to_many verified
|
|
103
|
-
// {'vendor_advance->
|
|
104
|
-
// ['
|
|
105
|
-
// ['
|
|
99
|
+
// {'vendor_advance->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many'}
|
|
100
|
+
// ['vendor_advance', 'tds_rate'] -> many_to_one
|
|
101
|
+
// ['tds_rate', 'organization_type'] -> many_to_many
|
|
106
102
|
var _a;
|
|
107
|
-
return (_a = this.
|
|
108
|
-
if (!accumulator.some((tdsRate) => tdsRate.id === current.id)) {
|
|
109
|
-
accumulator.push(current);
|
|
110
|
-
}
|
|
111
|
-
return accumulator;
|
|
112
|
-
}, []);
|
|
113
|
-
}
|
|
114
|
-
get organizationType() {
|
|
115
|
-
// many_to_one -> many_to_one verified
|
|
116
|
-
// {'vendor_advance->vendor': 'many_to_one', 'vendor->organization_type': 'many_to_one'}
|
|
117
|
-
// ['vendor_advance', 'vendor'] -> many_to_one
|
|
118
|
-
// ['vendor', 'organization_type'] -> many_to_one
|
|
119
|
-
var _a;
|
|
120
|
-
return (_a = this.vendor) === null || _a === void 0 ? void 0 : _a.organizationType;
|
|
103
|
+
return (_a = this.tdsRate) === null || _a === void 0 ? void 0 : _a.organizationTypes;
|
|
121
104
|
}
|
|
122
105
|
get vendorTdsLiabilitys() {
|
|
123
106
|
// many_to_many -> many_to_many verified
|
|
124
|
-
// {'vendor_advance->
|
|
125
|
-
// ['
|
|
107
|
+
// {'vendor_advance->tds_rate': 'many_to_one', 'tds_rate->vendor_tds_liability': 'one_to_many'}
|
|
108
|
+
// ['vendor_advance', 'tds_rate'] -> many_to_one
|
|
126
109
|
// ['tds_rate', 'vendor_tds_liability'] -> one_to_many
|
|
127
110
|
var _a;
|
|
128
|
-
return (_a = this.
|
|
129
|
-
if (!accumulator.some((vendorTdsLiability) => vendorTdsLiability.id === current.id)) {
|
|
130
|
-
accumulator.push(current);
|
|
131
|
-
}
|
|
132
|
-
return accumulator;
|
|
133
|
-
}, []);
|
|
111
|
+
return (_a = this.tdsRate) === null || _a === void 0 ? void 0 : _a.vendorTdsLiabilitys;
|
|
134
112
|
}
|
|
135
113
|
get vendorTdsChallans() {
|
|
136
114
|
// many_to_many -> many_to_many verified
|
|
137
|
-
// {'vendor_advance->
|
|
138
|
-
// ['
|
|
115
|
+
// {'vendor_advance->tds_rate': 'many_to_one', 'tds_rate->vendor_tds_challan': 'one_to_many'}
|
|
116
|
+
// ['vendor_advance', 'tds_rate'] -> many_to_one
|
|
139
117
|
// ['tds_rate', 'vendor_tds_challan'] -> one_to_many
|
|
140
118
|
var _a;
|
|
141
|
-
return (_a = this.
|
|
142
|
-
if (!accumulator.some((vendorTdsChallan) => vendorTdsChallan.id === current.id)) {
|
|
143
|
-
accumulator.push(current);
|
|
144
|
-
}
|
|
145
|
-
return accumulator;
|
|
146
|
-
}, []);
|
|
119
|
+
return (_a = this.tdsRate) === null || _a === void 0 ? void 0 : _a.vendorTdsChallans;
|
|
147
120
|
}
|
|
148
121
|
get banks() {
|
|
149
122
|
// many_to_many -> many_to_many verified
|
|
150
|
-
// {'vendor_advance->
|
|
123
|
+
// {'vendor_advance->tds_rate': 'many_to_one', 'tds_rate->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->bank': 'many_to_one'}
|
|
151
124
|
// ['tds_rate', 'vendor_tds_challan'] -> one_to_many
|
|
152
125
|
// ['vendor_tds_challan', 'bank'] -> many_to_one
|
|
153
126
|
var _a;
|
|
@@ -160,30 +133,17 @@ class VendorAdvanceEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
160
133
|
}
|
|
161
134
|
get expenseHeads() {
|
|
162
135
|
// many_to_many -> many_to_many verified
|
|
163
|
-
// {'vendor_advance->
|
|
164
|
-
// ['
|
|
165
|
-
// ['
|
|
136
|
+
// {'vendor_advance->tds_rate': 'many_to_one', 'tds_rate->voucher_type': 'many_to_many', 'voucher_type->expense_head': 'one_to_many'}
|
|
137
|
+
// ['tds_rate', 'voucher_type'] -> many_to_many
|
|
138
|
+
// ['voucher_type', 'expense_head'] -> one_to_many
|
|
166
139
|
var _a;
|
|
167
|
-
return (_a = this.
|
|
140
|
+
return (_a = this.voucherTypes) === null || _a === void 0 ? void 0 : _a.flatMap((voucherType) => voucherType.expenseHeads).filter((expenseHead) => !!expenseHead).reduce((accumulator, current) => {
|
|
168
141
|
if (!accumulator.some((expenseHead) => expenseHead.id === current.id)) {
|
|
169
142
|
accumulator.push(current);
|
|
170
143
|
}
|
|
171
144
|
return accumulator;
|
|
172
145
|
}, []);
|
|
173
146
|
}
|
|
174
|
-
get gstRates() {
|
|
175
|
-
// many_to_many -> many_to_many verified
|
|
176
|
-
// {'vendor_advance->vendor': 'many_to_one', 'vendor->vendor_invoice': 'one_to_many', 'vendor_invoice->vendor_invoice_item': 'one_to_many', 'vendor_invoice_item->gst_rate': 'many_to_one'}
|
|
177
|
-
// ['vendor_invoice', 'vendor_invoice_item'] -> one_to_many
|
|
178
|
-
// ['vendor_invoice_item', 'gst_rate'] -> many_to_one
|
|
179
|
-
var _a;
|
|
180
|
-
return (_a = this.vendorInvoiceItems) === null || _a === void 0 ? void 0 : _a.flatMap((vendorInvoiceItem) => vendorInvoiceItem.gstRate).filter((gstRate) => !!gstRate).reduce((accumulator, current) => {
|
|
181
|
-
if (!accumulator.some((gstRate) => gstRate.id === current.id)) {
|
|
182
|
-
accumulator.push(current);
|
|
183
|
-
}
|
|
184
|
-
return accumulator;
|
|
185
|
-
}, []);
|
|
186
|
-
}
|
|
187
147
|
get vendorInvoicePayments() {
|
|
188
148
|
// one_to_many -> many_to_many mismatch
|
|
189
149
|
// {'vendor_advance->vendor': 'many_to_one', 'vendor->vendor_invoice': 'one_to_many', 'vendor_invoice->vendor_invoice_payment': 'one_to_many'}
|
|
@@ -257,6 +217,7 @@ class VendorAdvanceEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
257
217
|
}
|
|
258
218
|
}
|
|
259
219
|
exports.VendorAdvanceEntityModel = VendorAdvanceEntityModel;
|
|
220
|
+
// vendorInvoiceAdvances?: VendorInvoiceAdvanceEntityModel[];
|
|
260
221
|
VendorAdvanceEntityModel.relationConfigs = [
|
|
261
222
|
{
|
|
262
223
|
name: entity_utils_interface_1.EntityEnum.VENDOR,
|
|
@@ -267,4 +228,31 @@ VendorAdvanceEntityModel.relationConfigs = [
|
|
|
267
228
|
key: "vendorId",
|
|
268
229
|
},
|
|
269
230
|
},
|
|
231
|
+
{
|
|
232
|
+
name: entity_utils_interface_1.EntityEnum.GST_RATE,
|
|
233
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
234
|
+
key: "gstRate",
|
|
235
|
+
mapKeyConfig: {
|
|
236
|
+
relationKey: "id",
|
|
237
|
+
key: "gstRateId",
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
name: entity_utils_interface_1.EntityEnum.TDS_RATE,
|
|
242
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
243
|
+
key: "tdsRate",
|
|
244
|
+
mapKeyConfig: {
|
|
245
|
+
relationKey: "id",
|
|
246
|
+
key: "tdsRateId",
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
// {
|
|
250
|
+
// name: EntityEnum.VENDOR_INVOICE_ADVANCE,
|
|
251
|
+
// relation: RelationType.MANY,
|
|
252
|
+
// key: "vendorInvoiceAdvances",
|
|
253
|
+
// mapKeyConfig: {
|
|
254
|
+
// relationKey: "vendorAdvanceId",
|
|
255
|
+
// key: "id",
|
|
256
|
+
// },
|
|
257
|
+
// },
|
|
270
258
|
];
|