@tomei/finance 0.3.31 → 0.3.34
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/configs/config.js +336 -82
- package/dist/account/account.js +14 -14
- package/dist/account/account.js.map +1 -1
- package/dist/config.d.ts +1778 -2
- package/dist/config.js +286 -301
- package/dist/config.js.map +1 -1
- package/dist/customer/customer.d.ts +6 -0
- package/dist/customer/customer.js +93 -0
- package/dist/customer/customer.js.map +1 -1
- package/dist/document/document.js +3 -0
- package/dist/document/document.js.map +1 -1
- package/dist/finance-company/finance-company.d.ts +1 -0
- package/dist/finance-company/finance-company.js +97 -11
- package/dist/finance-company/finance-company.js.map +1 -1
- package/dist/helpers/typeof.d.ts +1 -0
- package/dist/helpers/typeof.js +26 -0
- package/dist/helpers/typeof.js.map +1 -0
- package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts +2 -1
- package/dist/ledger-transaction/ledger-transaction.d.ts +4 -2
- package/dist/ledger-transaction/ledger-transaction.js +9 -5
- package/dist/ledger-transaction/ledger-transaction.js.map +1 -1
- package/dist/models/ledger-transaction.entity.d.ts +6 -1
- package/dist/models/ledger-transaction.entity.js +31 -14
- package/dist/models/ledger-transaction.entity.js.map +1 -1
- package/dist/models/payment-item.entity.d.ts +2 -1
- package/dist/models/payment-item.entity.js +9 -2
- package/dist/models/payment-item.entity.js.map +1 -1
- package/dist/models/payment.entity.d.ts +1 -0
- package/dist/models/payment.entity.js +7 -0
- package/dist/models/payment.entity.js.map +1 -1
- package/dist/payment/interfaces/payment-attr.interface.d.ts +1 -0
- package/dist/payment/interfaces/payment-attr.interface.js.map +1 -1
- package/dist/payment/payment.d.ts +1 -0
- package/dist/payment/payment.js +12 -0
- package/dist/payment/payment.js.map +1 -1
- package/dist/payment-item/interfaces/payment-item-attr.interface.d.ts +2 -1
- package/dist/payment-item/interfaces/payment-item-attr.interface.js.map +1 -1
- package/dist/payment-item/payment-item.d.ts +2 -0
- package/dist/payment-item/payment-item.js +5 -0
- package/dist/payment-item/payment-item.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/migrations/finance-ledger-transaction-migration.js +23 -7
- package/migrations/finance-payment-item-migration.js +6 -2
- package/migrations/finance-payment-migration.js +4 -0
- package/migrations/finance-post-history-migration.js +1 -1
- package/package.json +1 -1
- package/src/account/account.ts +14 -14
- package/src/config.ts +295 -301
- package/src/customer/customer.ts +95 -0
- package/src/document/document.ts +6 -0
- package/src/finance-company/finance-company.ts +146 -14
- package/src/helpers/typeof.ts +29 -0
- package/src/ledger-transaction/interfaces/ledger-transaction-attr.interface.ts +2 -1
- package/src/ledger-transaction/ledger-transaction.ts +9 -4
- package/src/models/ledger-transaction.entity.ts +27 -13
- package/src/models/payment-item.entity.ts +8 -2
- package/src/models/payment.entity.ts +6 -0
- package/src/payment/interfaces/payment-attr.interface.ts +1 -0
- package/src/payment/payment.ts +12 -10
- package/src/payment-item/interfaces/payment-item-attr.interface.ts +2 -1
- package/src/payment-item/payment-item.ts +5 -3
|
@@ -36,13 +36,9 @@ module.exports = {
|
|
|
36
36
|
type: Sequelize.DATE,
|
|
37
37
|
allowNull: false,
|
|
38
38
|
},
|
|
39
|
-
Name: {
|
|
40
|
-
type: Sequelize.STRING(200),
|
|
41
|
-
allowNull: false,
|
|
42
|
-
},
|
|
43
39
|
Description: {
|
|
44
40
|
type: Sequelize.STRING(1000),
|
|
45
|
-
allowNull:
|
|
41
|
+
allowNull: false,
|
|
46
42
|
},
|
|
47
43
|
Currency: {
|
|
48
44
|
type: Sequelize.CHAR(3),
|
|
@@ -58,11 +54,31 @@ module.exports = {
|
|
|
58
54
|
},
|
|
59
55
|
RelatedObjectId: {
|
|
60
56
|
type: Sequelize.STRING(30),
|
|
61
|
-
allowNull:
|
|
57
|
+
allowNull: true,
|
|
62
58
|
},
|
|
63
59
|
RelatedObjectType: {
|
|
64
60
|
type: Sequelize.STRING(200),
|
|
65
|
-
allowNull:
|
|
61
|
+
allowNull: true,
|
|
62
|
+
},
|
|
63
|
+
RelatedDocNo: {
|
|
64
|
+
type: Sequelize.STRING(30),
|
|
65
|
+
allowNull: true,
|
|
66
|
+
references: {
|
|
67
|
+
model: 'finance_Document',
|
|
68
|
+
key: 'DocNo',
|
|
69
|
+
},
|
|
70
|
+
onUpdate: 'CASCADE',
|
|
71
|
+
onDelete: 'CASCADE',
|
|
72
|
+
},
|
|
73
|
+
RelatedPaymentId: {
|
|
74
|
+
type: Sequelize.STRING(30),
|
|
75
|
+
allowNull: true,
|
|
76
|
+
references: {
|
|
77
|
+
model: 'finance_Payment',
|
|
78
|
+
key: 'PaymentId',
|
|
79
|
+
},
|
|
80
|
+
onUpdate: 'CASCADE',
|
|
81
|
+
onDelete: 'CASCADE',
|
|
66
82
|
},
|
|
67
83
|
});
|
|
68
84
|
},
|
|
@@ -30,10 +30,14 @@ module.exports = {
|
|
|
30
30
|
type: Sequelize.DECIMAL(10, 2),
|
|
31
31
|
allowNull: false,
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
type: Sequelize.STRING(
|
|
33
|
+
Name: {
|
|
34
|
+
type: Sequelize.STRING(200),
|
|
35
35
|
allowNull: true,
|
|
36
36
|
},
|
|
37
|
+
Description: {
|
|
38
|
+
type: Sequelize.STRING(1000),
|
|
39
|
+
allowNull: false,
|
|
40
|
+
},
|
|
37
41
|
});
|
|
38
42
|
},
|
|
39
43
|
|
package/package.json
CHANGED
package/src/account/account.ts
CHANGED
|
@@ -4,7 +4,7 @@ import AccountModel from '../models/account.entity';
|
|
|
4
4
|
import { AccountRepository } from './account.repository';
|
|
5
5
|
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
7
|
-
const
|
|
7
|
+
const getConfig = require('../config');
|
|
8
8
|
|
|
9
9
|
export default class Account extends AccountSystemEntity {
|
|
10
10
|
AccountNo: string;
|
|
@@ -107,29 +107,29 @@ export default class Account extends AccountSystemEntity {
|
|
|
107
107
|
*/
|
|
108
108
|
static initialize(): void {
|
|
109
109
|
const dbTransaction = null;
|
|
110
|
-
let
|
|
111
|
-
let
|
|
110
|
+
let defaultAccountReceivable: Account;
|
|
111
|
+
let defaultAccountPayable: Account;
|
|
112
112
|
|
|
113
113
|
// const config = getConfig();
|
|
114
114
|
// config.systemConfig['EZC']
|
|
115
115
|
|
|
116
116
|
try {
|
|
117
|
-
|
|
117
|
+
defaultAccountReceivable = new Account(dbTransaction, 'EZC-AR');
|
|
118
118
|
} catch (err) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
defaultAccountReceivable = new Account(dbTransaction);
|
|
120
|
+
defaultAccountReceivable.AccountNo = null;
|
|
121
|
+
defaultAccountReceivable.AccountType = 'Account Receivable';
|
|
122
|
+
defaultAccountReceivable.OwnerId = 'System';
|
|
123
|
+
defaultAccountReceivable.OwnerType = '';
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
try {
|
|
127
|
-
|
|
127
|
+
defaultAccountPayable = new Account(dbTransaction, 'EZC-AP');
|
|
128
128
|
} catch (err) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
defaultAccountPayable = new Account(dbTransaction);
|
|
130
|
+
defaultAccountPayable.AccountNo = null;
|
|
131
|
+
defaultAccountPayable.AccountType = 'Account Payable';
|
|
132
|
+
defaultAccountPayable.OwnerId = 'System';
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
|