@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.
Files changed (61) hide show
  1. package/configs/config.js +336 -82
  2. package/dist/account/account.js +14 -14
  3. package/dist/account/account.js.map +1 -1
  4. package/dist/config.d.ts +1778 -2
  5. package/dist/config.js +286 -301
  6. package/dist/config.js.map +1 -1
  7. package/dist/customer/customer.d.ts +6 -0
  8. package/dist/customer/customer.js +93 -0
  9. package/dist/customer/customer.js.map +1 -1
  10. package/dist/document/document.js +3 -0
  11. package/dist/document/document.js.map +1 -1
  12. package/dist/finance-company/finance-company.d.ts +1 -0
  13. package/dist/finance-company/finance-company.js +97 -11
  14. package/dist/finance-company/finance-company.js.map +1 -1
  15. package/dist/helpers/typeof.d.ts +1 -0
  16. package/dist/helpers/typeof.js +26 -0
  17. package/dist/helpers/typeof.js.map +1 -0
  18. package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts +2 -1
  19. package/dist/ledger-transaction/ledger-transaction.d.ts +4 -2
  20. package/dist/ledger-transaction/ledger-transaction.js +9 -5
  21. package/dist/ledger-transaction/ledger-transaction.js.map +1 -1
  22. package/dist/models/ledger-transaction.entity.d.ts +6 -1
  23. package/dist/models/ledger-transaction.entity.js +31 -14
  24. package/dist/models/ledger-transaction.entity.js.map +1 -1
  25. package/dist/models/payment-item.entity.d.ts +2 -1
  26. package/dist/models/payment-item.entity.js +9 -2
  27. package/dist/models/payment-item.entity.js.map +1 -1
  28. package/dist/models/payment.entity.d.ts +1 -0
  29. package/dist/models/payment.entity.js +7 -0
  30. package/dist/models/payment.entity.js.map +1 -1
  31. package/dist/payment/interfaces/payment-attr.interface.d.ts +1 -0
  32. package/dist/payment/interfaces/payment-attr.interface.js.map +1 -1
  33. package/dist/payment/payment.d.ts +1 -0
  34. package/dist/payment/payment.js +12 -0
  35. package/dist/payment/payment.js.map +1 -1
  36. package/dist/payment-item/interfaces/payment-item-attr.interface.d.ts +2 -1
  37. package/dist/payment-item/interfaces/payment-item-attr.interface.js.map +1 -1
  38. package/dist/payment-item/payment-item.d.ts +2 -0
  39. package/dist/payment-item/payment-item.js +5 -0
  40. package/dist/payment-item/payment-item.js.map +1 -1
  41. package/dist/tsconfig.tsbuildinfo +1 -1
  42. package/migrations/finance-ledger-transaction-migration.js +23 -7
  43. package/migrations/finance-payment-item-migration.js +6 -2
  44. package/migrations/finance-payment-migration.js +4 -0
  45. package/migrations/finance-post-history-migration.js +1 -1
  46. package/package.json +1 -1
  47. package/src/account/account.ts +14 -14
  48. package/src/config.ts +295 -301
  49. package/src/customer/customer.ts +95 -0
  50. package/src/document/document.ts +6 -0
  51. package/src/finance-company/finance-company.ts +146 -14
  52. package/src/helpers/typeof.ts +29 -0
  53. package/src/ledger-transaction/interfaces/ledger-transaction-attr.interface.ts +2 -1
  54. package/src/ledger-transaction/ledger-transaction.ts +9 -4
  55. package/src/models/ledger-transaction.entity.ts +27 -13
  56. package/src/models/payment-item.entity.ts +8 -2
  57. package/src/models/payment.entity.ts +6 -0
  58. package/src/payment/interfaces/payment-attr.interface.ts +1 -0
  59. package/src/payment/payment.ts +12 -10
  60. package/src/payment-item/interfaces/payment-item-attr.interface.ts +2 -1
  61. 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: true,
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: false,
57
+ allowNull: true,
62
58
  },
63
59
  RelatedObjectType: {
64
60
  type: Sequelize.STRING(200),
65
- allowNull: false,
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
- TaxCode: {
34
- type: Sequelize.STRING(10),
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
 
@@ -37,6 +37,10 @@ module.exports = {
37
37
  onUpdate: 'CASCADE',
38
38
  onDelete: 'CASCADE',
39
39
  },
40
+ Description: {
41
+ type: Sequelize.STRING(1000),
42
+ allowNull: false,
43
+ },
40
44
  Currency: {
41
45
  type: Sequelize.CHAR(3),
42
46
  allowNull: false,
@@ -9,7 +9,7 @@ module.exports = {
9
9
  allowNull: false,
10
10
  },
11
11
  DateTime: {
12
- type: Sequelize.Date,
12
+ type: Sequelize.DATE,
13
13
  allowNull: false,
14
14
  },
15
15
  ItemId: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/finance",
3
- "version": "0.3.31",
3
+ "version": "0.3.34",
4
4
  "description": "NestJS package for finance module",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -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 { getConfig } = require('../config');
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 DefaultAccountReceivable: Account;
111
- let DefaultAccountPayable: Account;
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
- DefaultAccountReceivable = new Account(dbTransaction, 'EZC-AR');
117
+ defaultAccountReceivable = new Account(dbTransaction, 'EZC-AR');
118
118
  } catch (err) {
119
- DefaultAccountReceivable = new Account(dbTransaction);
120
- DefaultAccountReceivable.AccountNo = null;
121
- DefaultAccountReceivable.AccountType = 'Account Receivable';
122
- DefaultAccountReceivable.OwnerId = 'System';
123
- DefaultAccountReceivable.OwnerType = '';
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
- DefaultAccountPayable = new Account(dbTransaction, 'EZC-AP');
127
+ defaultAccountPayable = new Account(dbTransaction, 'EZC-AP');
128
128
  } catch (err) {
129
- DefaultAccountPayable = new Account(dbTransaction);
130
- DefaultAccountPayable.AccountNo = null;
131
- DefaultAccountPayable.AccountType = 'Account Payable';
132
- DefaultAccountPayable.OwnerId = 'System';
129
+ defaultAccountPayable = new Account(dbTransaction);
130
+ defaultAccountPayable.AccountNo = null;
131
+ defaultAccountPayable.AccountType = 'Account Payable';
132
+ defaultAccountPayable.OwnerId = 'System';
133
133
  }
134
134
  }
135
135