@tomei/finance 0.2.11 → 0.2.13
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/dist/account/account.d.ts +1 -7
- package/dist/account/account.js +1 -7
- package/dist/account/account.js.map +1 -1
- package/dist/account-system-entity/account-system-entity.d.ts +18 -7
- package/dist/account-system-entity/account-system-entity.js +59 -8
- package/dist/account-system-entity/account-system-entity.js.map +1 -1
- package/dist/account-system-entity/index.d.ts +2 -0
- package/dist/account-system-entity/index.js +6 -0
- package/dist/account-system-entity/index.js.map +1 -0
- package/dist/account-system-entity/post-history.entity.d.ts +11 -0
- package/dist/account-system-entity/post-history.entity.js +65 -0
- package/dist/account-system-entity/post-history.entity.js.map +1 -0
- package/dist/account-system-entity/post-history.repository.d.ts +5 -0
- package/dist/account-system-entity/post-history.repository.js +13 -0
- package/dist/account-system-entity/post-history.repository.js.map +1 -0
- package/dist/customer/customer.d.ts +18 -13
- package/dist/customer/customer.js +18 -13
- package/dist/customer/customer.js.map +1 -1
- package/dist/customer/entities/customer.entity.d.ts +9 -4
- package/dist/customer/entities/customer.entity.js +46 -9
- package/dist/customer/entities/customer.entity.js.map +1 -1
- package/dist/customer/index.d.ts +2 -2
- package/dist/customer/index.js +3 -3
- package/dist/customer/index.js.map +1 -1
- package/dist/customer/interfaces/finance-customer-attr.interface.d.ts +7 -1
- package/dist/document/document.d.ts +2 -6
- package/dist/document/document.js +1 -2
- package/dist/document/document.js.map +1 -1
- package/dist/finance-company/entities/finance-company.entity.d.ts +13 -0
- package/dist/finance-company/entities/finance-company.entity.js +113 -0
- package/dist/finance-company/entities/finance-company.entity.js.map +1 -0
- package/dist/finance-company/finance-company.d.ts +23 -8
- package/dist/finance-company/finance-company.js +75 -16
- package/dist/finance-company/finance-company.js.map +1 -1
- package/dist/finance-company/finance-company.repository.d.ts +10 -0
- package/dist/finance-company/finance-company.repository.js +38 -0
- package/dist/finance-company/finance-company.repository.js.map +1 -0
- package/dist/finance-company/index.d.ts +5 -1
- package/dist/finance-company/index.js +5 -1
- package/dist/finance-company/index.js.map +1 -1
- package/dist/finance-company/interfaces/finance-company-attr.interface.d.ts +10 -0
- package/dist/finance-company/interfaces/finance-company-attr.interface.js +3 -0
- package/dist/finance-company/interfaces/finance-company-attr.interface.js.map +1 -0
- package/dist/finance-company/interfaces/finance-company.repository.interface.d.ts +3 -0
- package/dist/finance-company/interfaces/finance-company.repository.interface.js +3 -0
- package/dist/finance-company/interfaces/finance-company.repository.interface.js.map +1 -0
- package/dist/journal-entry/interfaces/journal-entry-attr.interface.d.ts +2 -2
- package/dist/journal-entry/journal-entry.d.ts +1 -7
- package/dist/journal-entry/journal-entry.js +3 -10
- package/dist/journal-entry/journal-entry.js.map +1 -1
- package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts +1 -1
- package/dist/payment/payment.d.ts +1 -7
- package/dist/payment/payment.js +1 -8
- package/dist/payment/payment.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/migrations/finance-company-migration.js +45 -0
- package/migrations/finance-customer-migration.js +23 -5
- package/migrations/finance-post-history-migration.js +45 -0
- package/package.json +2 -2
- package/src/account/account.ts +4 -15
- package/src/account-system-entity/account-system-entity.ts +82 -12
- package/src/account-system-entity/index.ts +3 -0
- package/src/account-system-entity/post-history.entity.ts +41 -0
- package/src/account-system-entity/post-history.repository.ts +12 -0
- package/src/customer/customer.ts +38 -26
- package/src/customer/entities/customer.entity.ts +50 -10
- package/src/customer/index.ts +2 -2
- package/src/customer/interfaces/finance-customer-attr.interface.ts +7 -1
- package/src/document/document.ts +2 -6
- package/src/finance-company/entities/finance-company.entity.ts +88 -0
- package/src/finance-company/finance-company.repository.ts +30 -0
- package/src/finance-company/finance-company.ts +152 -24
- package/src/finance-company/index.ts +11 -1
- package/src/finance-company/interfaces/finance-company-attr.interface.ts +10 -0
- package/src/finance-company/interfaces/finance-company.repository.interface.ts +4 -0
- package/src/journal-entry/interfaces/journal-entry-attr.interface.ts +2 -2
- package/src/journal-entry/journal-entry.ts +3 -19
- package/src/ledger-transaction/interfaces/ledger-transaction-attr.interface.ts +1 -2
- package/src/payment/payment.ts +1 -18
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
+
import { Column, DataType, Model, Table, HasMany } from 'sequelize-typescript';
|
|
3
|
+
import { FinanceCustomerModel } from '../../customer/entities/customer.entity';
|
|
4
|
+
|
|
5
|
+
@Table({ tableName: 'finance_Company', createdAt: false, updatedAt: false })
|
|
6
|
+
export class FinanceCompanyModel extends Model {
|
|
7
|
+
@ApiProperty({ type: String, description: 'CompanyId' })
|
|
8
|
+
@Column({
|
|
9
|
+
primaryKey: true,
|
|
10
|
+
allowNull: false,
|
|
11
|
+
type: DataType.STRING(30),
|
|
12
|
+
})
|
|
13
|
+
CompanyId: string;
|
|
14
|
+
|
|
15
|
+
@ApiProperty({
|
|
16
|
+
type: String,
|
|
17
|
+
description: 'CompanySystemCode',
|
|
18
|
+
})
|
|
19
|
+
@Column({
|
|
20
|
+
allowNull: false,
|
|
21
|
+
type: DataType.STRING(10),
|
|
22
|
+
})
|
|
23
|
+
CompSystemCode: string;
|
|
24
|
+
|
|
25
|
+
@ApiProperty({
|
|
26
|
+
type: String,
|
|
27
|
+
description: 'CompanySystemRefId',
|
|
28
|
+
})
|
|
29
|
+
@Column({
|
|
30
|
+
allowNull: false,
|
|
31
|
+
type: DataType.STRING(30),
|
|
32
|
+
})
|
|
33
|
+
CompSystemRefId: string;
|
|
34
|
+
|
|
35
|
+
@ApiProperty({
|
|
36
|
+
type: String,
|
|
37
|
+
description: 'Account System Code eg. "EZC", "CRM"',
|
|
38
|
+
})
|
|
39
|
+
@Column({
|
|
40
|
+
allowNull: false,
|
|
41
|
+
type: DataType.STRING(10),
|
|
42
|
+
})
|
|
43
|
+
AccSystemCode: string;
|
|
44
|
+
|
|
45
|
+
@ApiProperty({
|
|
46
|
+
type: String,
|
|
47
|
+
description: 'Account Company Id in API',
|
|
48
|
+
})
|
|
49
|
+
@Column({
|
|
50
|
+
allowNull: false,
|
|
51
|
+
type: DataType.STRING(30),
|
|
52
|
+
})
|
|
53
|
+
AccSystemRefId: string;
|
|
54
|
+
|
|
55
|
+
@ApiProperty({
|
|
56
|
+
type: String,
|
|
57
|
+
description: 'PostedToAccSystemYN',
|
|
58
|
+
example: 'Y',
|
|
59
|
+
})
|
|
60
|
+
@Column({
|
|
61
|
+
allowNull: false,
|
|
62
|
+
type: DataType.CHAR(1),
|
|
63
|
+
})
|
|
64
|
+
PostedToAccSystemYN: string;
|
|
65
|
+
|
|
66
|
+
@ApiProperty({
|
|
67
|
+
example: '138140891dd211b288d34bc7b4312a49',
|
|
68
|
+
description: 'PostedById',
|
|
69
|
+
})
|
|
70
|
+
@Column({
|
|
71
|
+
allowNull: true,
|
|
72
|
+
type: DataType.STRING(30),
|
|
73
|
+
})
|
|
74
|
+
PostedById: string;
|
|
75
|
+
|
|
76
|
+
@ApiProperty({
|
|
77
|
+
example: new Date(),
|
|
78
|
+
description: 'PostedToAccSystem Date',
|
|
79
|
+
})
|
|
80
|
+
@Column({
|
|
81
|
+
allowNull: true,
|
|
82
|
+
type: DataType.DATE,
|
|
83
|
+
})
|
|
84
|
+
PostedDateTime: Date;
|
|
85
|
+
|
|
86
|
+
@HasMany(() => FinanceCustomerModel)
|
|
87
|
+
FinanceCustomers: FinanceCustomerModel[];
|
|
88
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Injectable } from '@nestjs/common/decorators';
|
|
2
|
+
import { InjectModel } from '@nestjs/sequelize';
|
|
3
|
+
import { BaseRepository } from '@tomei/general';
|
|
4
|
+
import { FinanceCompanyModel } from './entities/finance-company.entity';
|
|
5
|
+
import { IFinanceCompanyAttr } from './interfaces/finance-company-attr.interface';
|
|
6
|
+
import { IFinanceCompanyRepository } from './interfaces/finance-company.repository.interface';
|
|
7
|
+
|
|
8
|
+
@Injectable()
|
|
9
|
+
export class FinanceCompanyRepository
|
|
10
|
+
extends BaseRepository<FinanceCompanyModel>
|
|
11
|
+
implements IFinanceCompanyRepository
|
|
12
|
+
{
|
|
13
|
+
constructor(
|
|
14
|
+
@InjectModel(FinanceCompanyModel)
|
|
15
|
+
private readonly financeCompanyModel: typeof FinanceCompanyModel,
|
|
16
|
+
) {
|
|
17
|
+
super(financeCompanyModel);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
create(
|
|
21
|
+
data: IFinanceCompanyAttr | any,
|
|
22
|
+
options?: any,
|
|
23
|
+
): Promise<FinanceCompanyModel> | any {
|
|
24
|
+
return this.financeCompanyModel.create(data, options);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
findOne(options: any): Promise<FinanceCompanyModel> {
|
|
28
|
+
return this.financeCompanyModel.findOne(options);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,42 +1,169 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import {
|
|
2
|
+
import { HashTable, IBaseRepository, LoginUserBase } from '@tomei/general';
|
|
3
3
|
import { BadRequestException } from '@nestjs/common';
|
|
4
4
|
import { IAccountSystem } from '../interfaces';
|
|
5
5
|
import { JournalEntry, JournalEntryRepository } from '../journal-entry';
|
|
6
6
|
import { LedgerTransactionRepository } from '../ledger-transaction';
|
|
7
7
|
import { Account } from '../account';
|
|
8
8
|
import { Customer, FinanceCustomerRepository } from '../customer';
|
|
9
|
+
import { AccountSystemEntity } from '../account-system-entity';
|
|
10
|
+
import cuid from 'cuid';
|
|
9
11
|
|
|
10
|
-
export class FinanceCompany {
|
|
12
|
+
export class FinanceCompany extends AccountSystemEntity {
|
|
13
|
+
private _CompSystemCode = '';
|
|
14
|
+
private _CompSystemCompanyId = '';
|
|
15
|
+
private _AccSystemCode = '';
|
|
16
|
+
protected BaseRepository: IBaseRepository;
|
|
17
|
+
private static _htFinanceCompanyIds = new HashTable();
|
|
18
|
+
private static _htFinanceCompanies = new HashTable();
|
|
11
19
|
journalEntryRepository: JournalEntryRepository;
|
|
12
20
|
financeCustomerRepository: FinanceCustomerRepository;
|
|
13
21
|
ledgerTransactionRepository: LedgerTransactionRepository;
|
|
14
|
-
|
|
22
|
+
AccountingSystem: IAccountSystem;
|
|
15
23
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
24
|
+
get CompSystemCode(): string {
|
|
25
|
+
return this._CompSystemCode;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
private set CompSystemCode(code: string) {
|
|
29
|
+
this._CompSystemCode = code;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get CompSystemCompanyId() {
|
|
33
|
+
return this._CompSystemCompanyId;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
set CompSystemCompanyId(id: string) {
|
|
37
|
+
this._CompSystemCompanyId = id;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
get AccSystemCode() {
|
|
41
|
+
return this._AccSystemCode;
|
|
42
|
+
}
|
|
20
43
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
44
|
+
private set AccSystemCode(code: string) {
|
|
45
|
+
this._AccSystemCode = code;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
get ObjectId() {
|
|
49
|
+
return this.CompanyId;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
get ObjectName() {
|
|
53
|
+
return `${this.CompSystemCode}-${this.CompSystemCompanyId}-${this.AccSystemCode}`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
get TableName() {
|
|
57
|
+
return 'finance_Company';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
private constructor(
|
|
61
|
+
compSystemCode: string,
|
|
62
|
+
compSystemCompanyId: string,
|
|
24
63
|
accSystemCode: string,
|
|
25
|
-
loginUser: LoginUserBase,
|
|
26
64
|
) {
|
|
27
|
-
|
|
65
|
+
super();
|
|
66
|
+
this.CompSystemCode = compSystemCode;
|
|
67
|
+
this.CompSystemCompanyId = compSystemCompanyId;
|
|
28
68
|
this.AccSystemCode = accSystemCode;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static getFinanceCompanyId(
|
|
72
|
+
compSystemCode: string,
|
|
73
|
+
compSystemCompanyId: string,
|
|
74
|
+
accSystemCode: string,
|
|
75
|
+
): string {
|
|
76
|
+
let sCompanyId = '';
|
|
77
|
+
/*Assemble the hashtable key*/
|
|
78
|
+
const sKey = `${compSystemCode}-${compSystemCompanyId}-${accSystemCode}`;
|
|
79
|
+
/*Check if the FinanceCompany has previously being loaded*/
|
|
80
|
+
if (!FinanceCompany._htFinanceCompanyIds.get(sKey)) {
|
|
81
|
+
/*Instantiate a new FinanceCompany*/
|
|
82
|
+
const financeCompany = new FinanceCompany(
|
|
83
|
+
compSystemCode,
|
|
84
|
+
compSystemCompanyId,
|
|
85
|
+
accSystemCode,
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
/*todo:Retrieve the finance company from finance_Company table using compSystemCode,
|
|
89
|
+
* compSystemCompanyId and accSystemCode */
|
|
90
|
+
|
|
91
|
+
/*todo:Retrieve and store the companyId from the result*/
|
|
92
|
+
financeCompany.CompanyId = 'asdf';
|
|
93
|
+
sCompanyId = financeCompany.CompanyId;
|
|
94
|
+
|
|
95
|
+
/*Add the details into the hashtable*/
|
|
96
|
+
FinanceCompany._htFinanceCompanyIds.add(sKey, financeCompany.CompanyId);
|
|
97
|
+
FinanceCompany._htFinanceCompanies.add(sCompanyId, financeCompany);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (typeof FinanceCompany._htFinanceCompanyIds.get(sKey) === 'string') {
|
|
101
|
+
sCompanyId = FinanceCompany._htFinanceCompanyIds.get(sKey);
|
|
33
102
|
}
|
|
34
103
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
104
|
+
return sCompanyId;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
static getFinanceCompany(companyId: string): FinanceCompany {
|
|
108
|
+
/*Check if the finance company is previously be loaded*/
|
|
109
|
+
if (!FinanceCompany._htFinanceCompanies.get(companyId)) {
|
|
110
|
+
/*todo:Retrieve the finance company from finance_Company table using compSystemCode,
|
|
111
|
+
* compSystemCompanyId and accSystemCode */
|
|
112
|
+
|
|
113
|
+
/*todo:Using the result returned, instantiate a new FinanceCompany*/
|
|
114
|
+
const compSystemCode = '';
|
|
115
|
+
const compSystemCompanyId = '';
|
|
116
|
+
const accSystemCode = '';
|
|
117
|
+
|
|
118
|
+
const financeCompany = new FinanceCompany(
|
|
119
|
+
compSystemCode,
|
|
120
|
+
compSystemCompanyId,
|
|
121
|
+
accSystemCode,
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
/*todo:Retrieve and store the CompanyId from the result*/
|
|
125
|
+
financeCompany.CompanyId = 'asdf';
|
|
126
|
+
|
|
127
|
+
/*Add the details into the hashtable*/
|
|
128
|
+
const sKey = `${compSystemCode}-${compSystemCompanyId}-${accSystemCode}`;
|
|
129
|
+
FinanceCompany._htFinanceCompanyIds.add(sKey, financeCompany.CompanyId);
|
|
130
|
+
FinanceCompany._htFinanceCompanies.add(
|
|
131
|
+
financeCompany.CompanyId,
|
|
132
|
+
financeCompany,
|
|
133
|
+
);
|
|
39
134
|
}
|
|
135
|
+
|
|
136
|
+
return FinanceCompany._htFinanceCompanies.get(companyId);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
static createFinanceCompany(
|
|
140
|
+
dbTransaction: any,
|
|
141
|
+
loginUser: LoginUserBase,
|
|
142
|
+
compSystemCode: string,
|
|
143
|
+
compSystemCompanyId: string,
|
|
144
|
+
accSystemCode: string,
|
|
145
|
+
) {
|
|
146
|
+
/*Instantiate a new FinanceCompany*/
|
|
147
|
+
const financeCompany = new FinanceCompany(
|
|
148
|
+
compSystemCode,
|
|
149
|
+
compSystemCompanyId,
|
|
150
|
+
accSystemCode,
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
/*todo:Validating if the finance company already exists in finance_Company*/
|
|
154
|
+
|
|
155
|
+
/*Generating the companyId*/
|
|
156
|
+
financeCompany.CompanyId = cuid();
|
|
157
|
+
|
|
158
|
+
/*todo:Save the FinanceCompany to the finance_Company table*/
|
|
159
|
+
|
|
160
|
+
/*Add the details to hashtable*/
|
|
161
|
+
const sKey = `${compSystemCode}-${compSystemCompanyId}-${accSystemCode}`;
|
|
162
|
+
FinanceCompany._htFinanceCompanyIds.add(sKey, financeCompany.CompanyId);
|
|
163
|
+
FinanceCompany._htFinanceCompanies.add(
|
|
164
|
+
financeCompany.CompanyId,
|
|
165
|
+
financeCompany,
|
|
166
|
+
);
|
|
40
167
|
}
|
|
41
168
|
|
|
42
169
|
async createCustomer(
|
|
@@ -54,7 +181,8 @@ export class FinanceCompany {
|
|
|
54
181
|
|
|
55
182
|
const financeCustomerData = await this.financeCustomerRepository.findOne({
|
|
56
183
|
where: {
|
|
57
|
-
|
|
184
|
+
/*todo:verify SystemCode*/
|
|
185
|
+
// SystemCode: this.SystemCode,
|
|
58
186
|
AccSystemCode: this.AccSystemCode,
|
|
59
187
|
AccSystemCustomerId: custSystemCode,
|
|
60
188
|
CustomerRefId: custSystemRefId,
|
|
@@ -66,7 +194,7 @@ export class FinanceCompany {
|
|
|
66
194
|
}
|
|
67
195
|
|
|
68
196
|
// Retrieve the type of accounting system, API Key, and API secret based on SysCode from the Config.ts
|
|
69
|
-
const customerId = await this.
|
|
197
|
+
const customerId = await this.AccountingSystem.createCustomer({
|
|
70
198
|
customer,
|
|
71
199
|
});
|
|
72
200
|
|
|
@@ -131,7 +259,7 @@ export class FinanceCompany {
|
|
|
131
259
|
ledgerTransaction.save();
|
|
132
260
|
}
|
|
133
261
|
|
|
134
|
-
await this.
|
|
262
|
+
await this.AccountingSystem.postJournalEntry(newJournalEntry);
|
|
135
263
|
|
|
136
264
|
const payload = {
|
|
137
265
|
Action: 'Create',
|
|
@@ -174,7 +302,7 @@ export class FinanceCompany {
|
|
|
174
302
|
};
|
|
175
303
|
}
|
|
176
304
|
|
|
177
|
-
const accSystemAccountId = await this.
|
|
305
|
+
const accSystemAccountId = await this.AccountingSystem.createAccount(
|
|
178
306
|
createAccountPayload,
|
|
179
307
|
);
|
|
180
308
|
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import { FinanceCompany } from './finance-company';
|
|
2
|
+
import { FinanceCompanyModel } from './entities/finance-company.entity';
|
|
3
|
+
import { IFinanceCompanyAttr } from './interfaces/finance-company-attr.interface';
|
|
4
|
+
import { IFinanceCompanyRepository } from './interfaces/finance-company.repository.interface';
|
|
5
|
+
import { FinanceCompanyRepository } from './finance-company.repository';
|
|
2
6
|
|
|
3
|
-
export {
|
|
7
|
+
export {
|
|
8
|
+
FinanceCompany,
|
|
9
|
+
FinanceCompanyModel,
|
|
10
|
+
IFinanceCompanyAttr,
|
|
11
|
+
IFinanceCompanyRepository,
|
|
12
|
+
FinanceCompanyRepository,
|
|
13
|
+
};
|
|
@@ -6,37 +6,21 @@ import { IJournalEntryAttr } from './interfaces/journal-entry-attr.interface';
|
|
|
6
6
|
import { TransactionTypeOptions } from '../enum';
|
|
7
7
|
import { Op } from 'sequelize';
|
|
8
8
|
import { JournalEntryModel } from './entities/journal-entry.entity';
|
|
9
|
-
import { AccountSystemEntity } from '../account-system-entity
|
|
9
|
+
import { AccountSystemEntity } from '../account-system-entity';
|
|
10
10
|
|
|
11
11
|
export class JournalEntry extends AccountSystemEntity {
|
|
12
12
|
TableName: string;
|
|
13
13
|
protected BaseRepository;
|
|
14
14
|
ObjectId: string;
|
|
15
15
|
ObjectName: string;
|
|
16
|
-
|
|
17
|
-
/*todo:remove when ObjectBase updated.*/
|
|
18
|
-
get objectId(): string {
|
|
19
|
-
return '';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/*todo:remove when ObjectBase updated.*/
|
|
23
|
-
get objectName(): string {
|
|
24
|
-
return '';
|
|
25
|
-
}
|
|
26
16
|
JournalEntryId: string;
|
|
27
17
|
Date: Date;
|
|
28
18
|
Name: string;
|
|
29
19
|
Description: string;
|
|
30
|
-
PostedById: string;
|
|
31
|
-
PostedToAccSystemYN = 'N';
|
|
32
20
|
DatePosted?: string;
|
|
33
21
|
AccSystemCode: string;
|
|
34
|
-
AccSystemRefId: string;
|
|
35
|
-
PostedDateTime: Date;
|
|
36
|
-
|
|
37
22
|
journalEntryRepository: JournalEntryRepository;
|
|
38
23
|
ledgerTransactionRepository: LedgerTransactionRepository;
|
|
39
|
-
|
|
40
24
|
private _DebitTransactions: any = null;
|
|
41
25
|
private _CreditTransactions: any = null;
|
|
42
26
|
|
|
@@ -104,7 +88,7 @@ export class JournalEntry extends AccountSystemEntity {
|
|
|
104
88
|
this.Description = params.Description;
|
|
105
89
|
this.PostedById = params.PostedById;
|
|
106
90
|
this.PostedToAccSystemYN = params.PostedToAccSystemYN;
|
|
107
|
-
this.
|
|
91
|
+
this.PostedDateTime = params.PostedDateTime;
|
|
108
92
|
}
|
|
109
93
|
|
|
110
94
|
getData() {
|
|
@@ -149,7 +133,7 @@ export class JournalEntry extends AccountSystemEntity {
|
|
|
149
133
|
Description: '',
|
|
150
134
|
PostedById: '',
|
|
151
135
|
PostedToAccSystemYN: 'N',
|
|
152
|
-
|
|
136
|
+
PostedDateTime: null,
|
|
153
137
|
});
|
|
154
138
|
|
|
155
139
|
const ledgerTransaction = new LedgerTransaction(
|
package/src/payment/payment.ts
CHANGED
|
@@ -10,13 +10,12 @@ import { IPaymentAttr } from './interfaces/payment-attr.interface';
|
|
|
10
10
|
import { PaymentModel } from './entities/payment.entity';
|
|
11
11
|
import axios from 'axios';
|
|
12
12
|
import { IPaymentParams } from './interfaces/payment-params.interface';
|
|
13
|
-
import { AccountSystemEntity } from '../account-system-entity
|
|
13
|
+
import { AccountSystemEntity } from '../account-system-entity';
|
|
14
14
|
export class Payment extends AccountSystemEntity {
|
|
15
15
|
protected BaseRepository: IBaseRepository;
|
|
16
16
|
TableName: string;
|
|
17
17
|
ObjectId: string;
|
|
18
18
|
ObjectName: string;
|
|
19
|
-
|
|
20
19
|
private Amount: number;
|
|
21
20
|
private Currency: string;
|
|
22
21
|
private Method: PaymentMethod;
|
|
@@ -24,7 +23,6 @@ export class Payment extends AccountSystemEntity {
|
|
|
24
23
|
private Status: string;
|
|
25
24
|
private PaymentType: PaymentType;
|
|
26
25
|
private PaymentDate: Date;
|
|
27
|
-
|
|
28
26
|
private AccountNo: string;
|
|
29
27
|
private SystemCode: string;
|
|
30
28
|
private OwnerId: string;
|
|
@@ -35,7 +33,6 @@ export class Payment extends AccountSystemEntity {
|
|
|
35
33
|
private CreatedById: string;
|
|
36
34
|
private UpdatedAt: Date;
|
|
37
35
|
private UpdatedById: string;
|
|
38
|
-
|
|
39
36
|
private Customer: Customer;
|
|
40
37
|
private ReceivableAccount: Account;
|
|
41
38
|
private DepositAccount: Account;
|
|
@@ -46,12 +43,7 @@ export class Payment extends AccountSystemEntity {
|
|
|
46
43
|
private PaymentRepository: IPaymentRepository;
|
|
47
44
|
private PaymentItemRepository: IPaymentItemRepository;
|
|
48
45
|
private sequelize: Sequelize;
|
|
49
|
-
|
|
50
46
|
AccSystemCode: string;
|
|
51
|
-
PostedToAccSystemYN = 'N';
|
|
52
|
-
AccSystemRefId: string;
|
|
53
|
-
PostedById: string;
|
|
54
|
-
PostedDateTime: Date;
|
|
55
47
|
|
|
56
48
|
constructor(
|
|
57
49
|
AccountingSystem: IAccountSystem,
|
|
@@ -80,15 +72,6 @@ export class Payment extends AccountSystemEntity {
|
|
|
80
72
|
}
|
|
81
73
|
}
|
|
82
74
|
|
|
83
|
-
/*todo:remove when ObjectBase updated.*/
|
|
84
|
-
get objectId(): string {
|
|
85
|
-
return this.ObjectId;
|
|
86
|
-
}
|
|
87
|
-
/*todo:remove when ObjectBase updated.*/
|
|
88
|
-
get objectName(): string {
|
|
89
|
-
return this.ObjectName;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
75
|
init(Params: IPaymentParams): void {
|
|
93
76
|
if (Params.Currency) this.Currency = Params.Currency;
|
|
94
77
|
if (Params.Method) this.Method = Params.Method;
|