@tomei/finance 0.11.8 → 0.12.1

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 (80) hide show
  1. package/.commitlintrc.json +23 -23
  2. package/LICENSE +21 -21
  3. package/configs/config.js +348 -348
  4. package/dist/document/document-item.d.ts +6 -1
  5. package/dist/document/document-item.d.ts.map +1 -1
  6. package/dist/document/document-item.js +23 -0
  7. package/dist/document/document-item.js.map +1 -1
  8. package/dist/document/document.d.ts +4 -1
  9. package/dist/document/document.d.ts.map +1 -1
  10. package/dist/document/document.js +23 -2
  11. package/dist/document/document.js.map +1 -1
  12. package/dist/document/interfaces/document-attr.interface.d.ts +4 -1
  13. package/dist/document/interfaces/document-attr.interface.d.ts.map +1 -1
  14. package/dist/document/interfaces/document-attr.interface.js.map +1 -1
  15. package/dist/document/interfaces/document-item-attr.interface.d.ts +4 -0
  16. package/dist/document/interfaces/document-item-attr.interface.d.ts.map +1 -1
  17. package/dist/document/interfaces/document-item-attr.interface.js.map +1 -1
  18. package/dist/enum/discount-type.enum.d.ts +5 -0
  19. package/dist/enum/discount-type.enum.d.ts.map +1 -0
  20. package/dist/enum/discount-type.enum.js +9 -0
  21. package/dist/enum/discount-type.enum.js.map +1 -0
  22. package/dist/enum/index.d.ts +2 -1
  23. package/dist/enum/index.d.ts.map +1 -1
  24. package/dist/enum/index.js +3 -1
  25. package/dist/enum/index.js.map +1 -1
  26. package/dist/finance-company/finance-company.d.ts.map +1 -1
  27. package/dist/finance-company/finance-company.js +18 -0
  28. package/dist/finance-company/finance-company.js.map +1 -1
  29. package/dist/journal-entry/journal-entry.d.ts.map +1 -1
  30. package/dist/journal-entry/journal-entry.js +2 -2
  31. package/dist/journal-entry/journal-entry.js.map +1 -1
  32. package/dist/ledger-transaction/ledger-transaction.d.ts.map +1 -1
  33. package/dist/ledger-transaction/ledger-transaction.js +5 -2
  34. package/dist/ledger-transaction/ledger-transaction.js.map +1 -1
  35. package/dist/models/document-item.entity.d.ts +6 -1
  36. package/dist/models/document-item.entity.d.ts.map +1 -1
  37. package/dist/models/document-item.entity.js +22 -0
  38. package/dist/models/document-item.entity.js.map +1 -1
  39. package/dist/models/document.entity.d.ts +8 -2
  40. package/dist/models/document.entity.d.ts.map +1 -1
  41. package/dist/models/document.entity.js +24 -1
  42. package/dist/models/document.entity.js.map +1 -1
  43. package/dist/tsconfig.tsbuildinfo +1 -1
  44. package/invoice-template/assets/css/style.css.map +12 -12
  45. package/invoice-template/assets/css/style.min.css +1 -1
  46. package/invoice-template/assets/img/arrow_bg.svg +11 -11
  47. package/invoice-template/assets/img/coffy_shop_img.svg +18 -18
  48. package/invoice-template/assets/img/logo_accent.svg +3 -3
  49. package/invoice-template/assets/img/logo_white.svg +4 -4
  50. package/invoice-template/assets/img/sign.svg +12 -12
  51. package/invoice-template/assets/img/tomei-logo.svg +9 -9
  52. package/invoice-template/assets/js/html2canvas.min.js +10379 -10379
  53. package/invoice-template/assets/js/jquery.min.js +1 -1
  54. package/invoice-template/assets/sass/common/_color_variable.scss +12 -12
  55. package/invoice-template/assets/sass/common/_typography.scss +178 -178
  56. package/invoice-template/assets/sass/style.scss +12 -12
  57. package/migrations/add-discount-collumn-to-document-related-table.js +91 -0
  58. package/migrations/finance-account-migration.js +97 -97
  59. package/migrations/finance-company-migration.js +29 -29
  60. package/migrations/finance-customer-migration.js +51 -51
  61. package/migrations/finance-document-item-migration.js +111 -111
  62. package/migrations/finance-document-migration.js +122 -122
  63. package/migrations/finance-document-tag-migration.js +46 -46
  64. package/migrations/finance-journal-entry-migration.js +59 -59
  65. package/migrations/finance-ledger-transaction-migration.js +89 -89
  66. package/migrations/finance-payment-item-migration.js +52 -52
  67. package/migrations/finance-payment-method-migration.js +31 -31
  68. package/migrations/finance-payment-method-type-migration.js +55 -55
  69. package/migrations/finance-payment-migration.js +96 -96
  70. package/migrations/finance-post-history-migration.js +45 -45
  71. package/migrations/finance-tag-group-migration.js +53 -53
  72. package/migrations/finance-tag-migration.js +63 -63
  73. package/migrations/finance-tax-migration.js +52 -52
  74. package/migrations/refactor-finance-document-migration.js +71 -71
  75. package/migrations/update-document-item.migration.js +87 -87
  76. package/package.json +77 -77
  77. package/dist/enum/quick-book-client-scopes.enum.d.ts +0 -14
  78. package/dist/enum/quick-book-client-scopes.enum.d.ts.map +0 -1
  79. package/dist/enum/quick-book-client-scopes.enum.js +0 -52
  80. package/dist/enum/quick-book-client-scopes.enum.js.map +0 -1
@@ -1,63 +1,63 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- async up(queryInterface, Sequelize) {
5
- await queryInterface.createTable('finance_Tag', {
6
- TagId: {
7
- type: Sequelize.STRING(30),
8
- primaryKey: true,
9
- allowNull: false,
10
- },
11
- TagName: {
12
- type: Sequelize.STRING(50),
13
- allowNull: false,
14
- },
15
- TagGroupId: {
16
- type: Sequelize.STRING(30),
17
- allowNull: false,
18
- references: {
19
- model: 'finance_TagGroup',
20
- key: 'TagGroupId',
21
- },
22
- onUpdate: 'CASCADE',
23
- onDelete: 'CASCADE',
24
- },
25
- CreatedById: {
26
- type: Sequelize.STRING(30),
27
- allowNull: false,
28
- },
29
- CreatedAt: {
30
- type: Sequelize.DATE,
31
- allowNull: false,
32
- },
33
- UpdatedById: {
34
- type: Sequelize.STRING(30),
35
- allowNull: true,
36
- },
37
- UpdatedAt: {
38
- type: Sequelize.DATE,
39
- allowNull: true,
40
- },
41
- AccSystemRefId: {
42
- type: Sequelize.STRING(30),
43
- allowNull: true,
44
- },
45
- PostedToAccSystemYN: {
46
- type: Sequelize.CHAR(1),
47
- allowNull: true,
48
- },
49
- PostedById: {
50
- type: Sequelize.STRING(30),
51
- allowNull: true,
52
- },
53
- PostedDateTime: {
54
- type: Sequelize.DATE,
55
- allowNull: true,
56
- },
57
- });
58
- },
59
-
60
- async down(queryInterface) {
61
- await queryInterface.dropTable('finance_Tag');
62
- },
63
- };
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ async up(queryInterface, Sequelize) {
5
+ await queryInterface.createTable('finance_Tag', {
6
+ TagId: {
7
+ type: Sequelize.STRING(30),
8
+ primaryKey: true,
9
+ allowNull: false,
10
+ },
11
+ TagName: {
12
+ type: Sequelize.STRING(50),
13
+ allowNull: false,
14
+ },
15
+ TagGroupId: {
16
+ type: Sequelize.STRING(30),
17
+ allowNull: false,
18
+ references: {
19
+ model: 'finance_TagGroup',
20
+ key: 'TagGroupId',
21
+ },
22
+ onUpdate: 'CASCADE',
23
+ onDelete: 'CASCADE',
24
+ },
25
+ CreatedById: {
26
+ type: Sequelize.STRING(30),
27
+ allowNull: false,
28
+ },
29
+ CreatedAt: {
30
+ type: Sequelize.DATE,
31
+ allowNull: false,
32
+ },
33
+ UpdatedById: {
34
+ type: Sequelize.STRING(30),
35
+ allowNull: true,
36
+ },
37
+ UpdatedAt: {
38
+ type: Sequelize.DATE,
39
+ allowNull: true,
40
+ },
41
+ AccSystemRefId: {
42
+ type: Sequelize.STRING(30),
43
+ allowNull: true,
44
+ },
45
+ PostedToAccSystemYN: {
46
+ type: Sequelize.CHAR(1),
47
+ allowNull: true,
48
+ },
49
+ PostedById: {
50
+ type: Sequelize.STRING(30),
51
+ allowNull: true,
52
+ },
53
+ PostedDateTime: {
54
+ type: Sequelize.DATE,
55
+ allowNull: true,
56
+ },
57
+ });
58
+ },
59
+
60
+ async down(queryInterface) {
61
+ await queryInterface.dropTable('finance_Tag');
62
+ },
63
+ };
@@ -1,52 +1,52 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- async up(queryInterface, Sequelize) {
5
- await queryInterface.createTable('finance_Tax', {
6
- TaxCode: {
7
- type: Sequelize.STRING(30),
8
- primaryKey: true,
9
- allowNull: false,
10
- },
11
- TaxRate: {
12
- type: Sequelize.DECIMAL(10, 2),
13
- allowNull: false,
14
- },
15
- Description: {
16
- type: Sequelize.STRING(1000),
17
- },
18
- CompanyId: {
19
- type: Sequelize.STRING(30),
20
- allowNull: false,
21
- references: {
22
- model: 'finance_Company',
23
- key: 'CompanyId',
24
- },
25
- onUpdate: 'CASCADE',
26
- onDelete: 'CASCADE',
27
- },
28
- CreatedAt: {
29
- allowNull: false,
30
- defaultValue: new Date(),
31
- type: Sequelize.DATE,
32
- },
33
- CreatedById: {
34
- type: Sequelize.STRING(30),
35
- allowNull: false,
36
- },
37
- UpdatedAt: {
38
- allowNull: false,
39
- defaultValue: new Date(),
40
- type: Sequelize.DATE,
41
- },
42
- UpdatedById: {
43
- type: Sequelize.STRING(30),
44
- allowNull: false,
45
- },
46
- });
47
- },
48
-
49
- async down(queryInterface) {
50
- await queryInterface.dropTable('finance_Tax');
51
- },
52
- };
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ async up(queryInterface, Sequelize) {
5
+ await queryInterface.createTable('finance_Tax', {
6
+ TaxCode: {
7
+ type: Sequelize.STRING(30),
8
+ primaryKey: true,
9
+ allowNull: false,
10
+ },
11
+ TaxRate: {
12
+ type: Sequelize.DECIMAL(10, 2),
13
+ allowNull: false,
14
+ },
15
+ Description: {
16
+ type: Sequelize.STRING(1000),
17
+ },
18
+ CompanyId: {
19
+ type: Sequelize.STRING(30),
20
+ allowNull: false,
21
+ references: {
22
+ model: 'finance_Company',
23
+ key: 'CompanyId',
24
+ },
25
+ onUpdate: 'CASCADE',
26
+ onDelete: 'CASCADE',
27
+ },
28
+ CreatedAt: {
29
+ allowNull: false,
30
+ defaultValue: new Date(),
31
+ type: Sequelize.DATE,
32
+ },
33
+ CreatedById: {
34
+ type: Sequelize.STRING(30),
35
+ allowNull: false,
36
+ },
37
+ UpdatedAt: {
38
+ allowNull: false,
39
+ defaultValue: new Date(),
40
+ type: Sequelize.DATE,
41
+ },
42
+ UpdatedById: {
43
+ type: Sequelize.STRING(30),
44
+ allowNull: false,
45
+ },
46
+ });
47
+ },
48
+
49
+ async down(queryInterface) {
50
+ await queryInterface.dropTable('finance_Tax');
51
+ },
52
+ };
@@ -1,72 +1,72 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- up: async (queryInterface, Sequelize) => {
5
- const transaction = await queryInterface.sequelize.transaction();
6
- try {
7
- //Update column type to string
8
- await queryInterface.changeColumn('finance_Document', 'Status', {
9
- type: Sequelize.STRING(30),
10
- allowNull: false,
11
- }, { transaction });
12
- // Update inconsistent data before changing the enum values
13
- await queryInterface.sequelize.query(`
14
- UPDATE finance_Document
15
- SET Status = 'Settled'
16
- WHERE Status = 'Paid'
17
- `, { transaction });
18
-
19
- await queryInterface.sequelize.query(`
20
- UPDATE finance_Document
21
- SET Status = 'Partial Settled'
22
- WHERE Status = 'Partial Paid'
23
- `, { transaction });
24
-
25
- // Change the column to the new enum values
26
- await queryInterface.changeColumn('finance_Document', 'Status', {
27
- type: Sequelize.ENUM(['Unpaid', 'Settled', 'Partial Settled', 'Cancelled']), // new enum values
28
- allowNull: false,
29
- }, { transaction });
30
-
31
- await transaction.commit();
32
- } catch (error) {
33
- await transaction.rollback();
34
- throw error;
35
- }
36
- },
37
-
38
- down: async (queryInterface, Sequelize) => {
39
- const transaction = await queryInterface.sequelize.transaction();
40
- try {
41
- //Update column type to string
42
- await queryInterface.changeColumn('finance_Document', 'Status', {
43
- type: Sequelize.STRING(30),
44
- allowNull: false,
45
- }, { transaction });
46
-
47
- // Update inconsistent data before changing the enum values
48
- await queryInterface.sequelize.query(`
49
- UPDATE finance_Document
50
- SET Status = 'Paid'
51
- WHERE Status = 'Settled'
52
- `, { transaction });
53
-
54
- await queryInterface.sequelize.query(`
55
- UPDATE finance_Document
56
- SET Status = 'Partial Paid'
57
- WHERE Status = 'Partial Settled'
58
- `, { transaction });
59
-
60
- // Change the column to the new enum values
61
- await queryInterface.changeColumn('finance_Document', 'Status', {
62
- type: Sequelize.ENUM(['Unpaid', 'Paid', 'Partial Paid', 'Cancelled']), // new enum values
63
- allowNull: false,
64
- }, { transaction });
65
-
66
- await transaction.commit();
67
- } catch (error) {
68
- await transaction.rollback();
69
- throw error;
70
- }
71
- }
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, Sequelize) => {
5
+ const transaction = await queryInterface.sequelize.transaction();
6
+ try {
7
+ //Update column type to string
8
+ await queryInterface.changeColumn('finance_Document', 'Status', {
9
+ type: Sequelize.STRING(30),
10
+ allowNull: false,
11
+ }, { transaction });
12
+ // Update inconsistent data before changing the enum values
13
+ await queryInterface.sequelize.query(`
14
+ UPDATE finance_Document
15
+ SET Status = 'Settled'
16
+ WHERE Status = 'Paid'
17
+ `, { transaction });
18
+
19
+ await queryInterface.sequelize.query(`
20
+ UPDATE finance_Document
21
+ SET Status = 'Partial Settled'
22
+ WHERE Status = 'Partial Paid'
23
+ `, { transaction });
24
+
25
+ // Change the column to the new enum values
26
+ await queryInterface.changeColumn('finance_Document', 'Status', {
27
+ type: Sequelize.ENUM(['Unpaid', 'Settled', 'Partial Settled', 'Cancelled']), // new enum values
28
+ allowNull: false,
29
+ }, { transaction });
30
+
31
+ await transaction.commit();
32
+ } catch (error) {
33
+ await transaction.rollback();
34
+ throw error;
35
+ }
36
+ },
37
+
38
+ down: async (queryInterface, Sequelize) => {
39
+ const transaction = await queryInterface.sequelize.transaction();
40
+ try {
41
+ //Update column type to string
42
+ await queryInterface.changeColumn('finance_Document', 'Status', {
43
+ type: Sequelize.STRING(30),
44
+ allowNull: false,
45
+ }, { transaction });
46
+
47
+ // Update inconsistent data before changing the enum values
48
+ await queryInterface.sequelize.query(`
49
+ UPDATE finance_Document
50
+ SET Status = 'Paid'
51
+ WHERE Status = 'Settled'
52
+ `, { transaction });
53
+
54
+ await queryInterface.sequelize.query(`
55
+ UPDATE finance_Document
56
+ SET Status = 'Partial Paid'
57
+ WHERE Status = 'Partial Settled'
58
+ `, { transaction });
59
+
60
+ // Change the column to the new enum values
61
+ await queryInterface.changeColumn('finance_Document', 'Status', {
62
+ type: Sequelize.ENUM(['Unpaid', 'Paid', 'Partial Paid', 'Cancelled']), // new enum values
63
+ allowNull: false,
64
+ }, { transaction });
65
+
66
+ await transaction.commit();
67
+ } catch (error) {
68
+ await transaction.rollback();
69
+ throw error;
70
+ }
71
+ }
72
72
  };
@@ -1,87 +1,87 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- up: async (queryInterface, Sequelize) => {
5
- const transaction = await queryInterface.sequelize.transaction();
6
- try {
7
- await queryInterface.addColumn(
8
- 'finance_DocumentItem',
9
- 'AccSystemRefId',
10
- {
11
- allowNull: false,
12
- type: Sequelize.STRING(30),
13
- defaultValue: 'REF',
14
- },
15
- { transaction },
16
- );
17
- await queryInterface.addColumn(
18
- 'finance_DocumentItem',
19
- 'PostedToAccSystemYN',
20
- {
21
- allowNull: false,
22
- type: Sequelize.CHAR(1),
23
- defaultValue: 'N',
24
- },
25
- { transaction },
26
- );
27
- await queryInterface.addColumn(
28
- 'finance_DocumentItem',
29
- 'PostedById',
30
- {
31
- allowNull: true,
32
- type: Sequelize.STRING(30),
33
- },
34
- { transaction },
35
- );
36
- await queryInterface.addColumn(
37
- 'finance_DocumentItem',
38
- 'PostedDateTime',
39
- {
40
- allowNull: true,
41
- type: Sequelize.DATE,
42
- },
43
- { transaction },
44
- );
45
-
46
- await transaction.commit();
47
- } catch (error) {
48
- await transaction.rollback();
49
- throw error;
50
- }
51
- },
52
-
53
- down: async (queryInterface) => {
54
- const transaction = await queryInterface.sequelize.transaction();
55
- try {
56
- await queryInterface.removeColumn(
57
- 'finance_DocumentItem',
58
- 'AccSystemRefId',
59
- {
60
- transaction: t,
61
- },
62
- );
63
- await queryInterface.removeColumn(
64
- 'finance_DocumentItem',
65
- 'PostedToAccSystemYN',
66
- {
67
- transaction: t,
68
- },
69
- );
70
- await queryInterface.removeColumn('finance_DocumentItem', 'PostedById', {
71
- transaction: t,
72
- });
73
- await queryInterface.removeColumn(
74
- 'finance_DocumentItem',
75
- 'PostedDateTime',
76
- {
77
- transaction: t,
78
- },
79
- );
80
-
81
- await transaction.commit();
82
- } catch (error) {
83
- await transaction.rollback();
84
- throw error;
85
- }
86
- },
87
- };
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ up: async (queryInterface, Sequelize) => {
5
+ const transaction = await queryInterface.sequelize.transaction();
6
+ try {
7
+ await queryInterface.addColumn(
8
+ 'finance_DocumentItem',
9
+ 'AccSystemRefId',
10
+ {
11
+ allowNull: false,
12
+ type: Sequelize.STRING(30),
13
+ defaultValue: 'REF',
14
+ },
15
+ { transaction },
16
+ );
17
+ await queryInterface.addColumn(
18
+ 'finance_DocumentItem',
19
+ 'PostedToAccSystemYN',
20
+ {
21
+ allowNull: false,
22
+ type: Sequelize.CHAR(1),
23
+ defaultValue: 'N',
24
+ },
25
+ { transaction },
26
+ );
27
+ await queryInterface.addColumn(
28
+ 'finance_DocumentItem',
29
+ 'PostedById',
30
+ {
31
+ allowNull: true,
32
+ type: Sequelize.STRING(30),
33
+ },
34
+ { transaction },
35
+ );
36
+ await queryInterface.addColumn(
37
+ 'finance_DocumentItem',
38
+ 'PostedDateTime',
39
+ {
40
+ allowNull: true,
41
+ type: Sequelize.DATE,
42
+ },
43
+ { transaction },
44
+ );
45
+
46
+ await transaction.commit();
47
+ } catch (error) {
48
+ await transaction.rollback();
49
+ throw error;
50
+ }
51
+ },
52
+
53
+ down: async (queryInterface) => {
54
+ const transaction = await queryInterface.sequelize.transaction();
55
+ try {
56
+ await queryInterface.removeColumn(
57
+ 'finance_DocumentItem',
58
+ 'AccSystemRefId',
59
+ {
60
+ transaction: t,
61
+ },
62
+ );
63
+ await queryInterface.removeColumn(
64
+ 'finance_DocumentItem',
65
+ 'PostedToAccSystemYN',
66
+ {
67
+ transaction: t,
68
+ },
69
+ );
70
+ await queryInterface.removeColumn('finance_DocumentItem', 'PostedById', {
71
+ transaction: t,
72
+ });
73
+ await queryInterface.removeColumn(
74
+ 'finance_DocumentItem',
75
+ 'PostedDateTime',
76
+ {
77
+ transaction: t,
78
+ },
79
+ );
80
+
81
+ await transaction.commit();
82
+ } catch (error) {
83
+ await transaction.rollback();
84
+ throw error;
85
+ }
86
+ },
87
+ };