@tomei/finance 0.3.9 → 0.3.11
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/customer/customer.d.ts +1 -1
- package/dist/customer/customer.js +9 -3
- package/dist/customer/customer.js.map +1 -1
- package/dist/finance-company/finance-company.js +2 -2
- package/dist/finance-company/finance-company.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/customer/customer.ts +9 -3
- package/src/finance-company/finance-company.ts +2 -2
package/package.json
CHANGED
package/src/customer/customer.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
import FinanceCustomerModel from '../models/customer.entity';
|
|
9
9
|
import { AccountSystemEntity } from '../account-system-entity/account-system-entity';
|
|
10
10
|
import { FinanceCustomerRepository } from './finance-customer.repository';
|
|
11
|
+
import * as cuid from 'cuid';
|
|
11
12
|
|
|
12
13
|
// const AccountSystemEntity = import('../account-system-entity').then(({AccountSystemEntity}) => AccountSystemEntity);
|
|
13
14
|
export default abstract class FinanceCustomerBase
|
|
@@ -86,20 +87,25 @@ export default abstract class FinanceCustomerBase
|
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
async save(
|
|
89
|
-
|
|
90
|
+
accSystemRefId: string,
|
|
90
91
|
custSystemCode: string,
|
|
91
92
|
custSystemRefId: string,
|
|
92
93
|
dbTransaction?: any,
|
|
93
94
|
): Promise<FinanceCustomerModel> {
|
|
94
95
|
this.CustSystemCode = custSystemCode;
|
|
95
96
|
this.CustSystemRefId = custSystemRefId;
|
|
97
|
+
this.AccSystemRefId = accSystemRefId;
|
|
98
|
+
this.PostedToAccSystemYN = 'Y';
|
|
96
99
|
const data = await FinanceCustomerBase._FinanceCustomerRepository.create(
|
|
97
100
|
{
|
|
98
|
-
|
|
101
|
+
CompanyId: this.CompanyId,
|
|
102
|
+
CustomerId: cuid(),
|
|
99
103
|
CustSystemCode: this.CustSystemCode,
|
|
100
104
|
CustSystemRefId: this.CustSystemRefId,
|
|
105
|
+
AccSystemRefId: accSystemRefId,
|
|
106
|
+
PostedToAccSystemYN: this.PostedToAccSystemYN,
|
|
101
107
|
},
|
|
102
|
-
dbTransaction,
|
|
108
|
+
{ transaction: dbTransaction },
|
|
103
109
|
);
|
|
104
110
|
return data;
|
|
105
111
|
}
|
|
@@ -269,12 +269,12 @@ export default class FinanceCompany extends ObjectBase {
|
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
// Retrieve the type of accounting system, API Key, and API secret based on SysCode from the Config.ts
|
|
272
|
-
const
|
|
272
|
+
const accSystemRefId = await this.AccountingSystem.createCustomer({
|
|
273
273
|
customer,
|
|
274
274
|
});
|
|
275
275
|
|
|
276
276
|
const newCustomer = await customer.save(
|
|
277
|
-
|
|
277
|
+
accSystemRefId,
|
|
278
278
|
custSystemCode,
|
|
279
279
|
custSystemRefId,
|
|
280
280
|
dbTransaction,
|