@tomei/finance 0.17.0 → 0.18.2-dev.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.
- package/.commitlintrc.json +23 -23
- package/CHANGELOG.md +17 -0
- package/LICENSE +21 -21
- package/MIGRATION.md +43 -0
- package/configs/config.js +348 -348
- package/dist/document/document.d.ts +3 -0
- package/dist/document/document.d.ts.map +1 -1
- package/dist/document/document.js +5 -0
- package/dist/document/document.js.map +1 -1
- package/dist/document/interfaces/document-attr.interface.d.ts +3 -1
- package/dist/document/interfaces/document-attr.interface.d.ts.map +1 -1
- package/dist/document/interfaces/document-attr.interface.js.map +1 -1
- package/dist/enum/index.d.ts +2 -1
- package/dist/enum/index.d.ts.map +1 -1
- package/dist/enum/index.js +3 -1
- package/dist/enum/index.js.map +1 -1
- package/dist/enum/posting-status.enum.d.ts +7 -0
- package/dist/enum/posting-status.enum.d.ts.map +1 -0
- package/dist/enum/posting-status.enum.js +11 -0
- package/dist/enum/posting-status.enum.js.map +1 -0
- package/dist/finance-company/finance-company.d.ts +7 -3
- package/dist/finance-company/finance-company.d.ts.map +1 -1
- package/dist/finance-company/finance-company.js +48 -16
- package/dist/finance-company/finance-company.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/models/document.entity.d.ts +3 -0
- package/dist/models/document.entity.d.ts.map +1 -1
- package/dist/models/document.entity.js +20 -0
- package/dist/models/document.entity.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/invoice-template/assets/css/style.css.map +12 -12
- package/invoice-template/assets/css/style.min.css +1 -1
- package/invoice-template/assets/img/arrow_bg.svg +11 -11
- package/invoice-template/assets/img/coffy_shop_img.svg +18 -18
- package/invoice-template/assets/img/logo_accent.svg +3 -3
- package/invoice-template/assets/img/logo_white.svg +4 -4
- package/invoice-template/assets/img/sign.svg +12 -12
- package/invoice-template/assets/img/tomei-logo.svg +9 -9
- package/invoice-template/assets/js/html2canvas.min.js +10379 -10379
- package/invoice-template/assets/js/jquery.min.js +1 -1
- package/invoice-template/assets/sass/common/_color_variable.scss +12 -12
- package/invoice-template/assets/sass/common/_typography.scss +178 -178
- package/invoice-template/assets/sass/style.scss +12 -12
- package/migrations/add-discount-collumn-to-document-related-table.js +90 -90
- package/migrations/finance-account-migration.js +97 -97
- package/migrations/finance-company-migration.js +29 -29
- package/migrations/finance-customer-migration.js +51 -51
- package/migrations/finance-document-item-migration.js +111 -111
- package/migrations/finance-document-migration.js +122 -122
- package/migrations/finance-document-tag-migration.js +46 -46
- package/migrations/finance-journal-entry-migration.js +59 -59
- package/migrations/finance-ledger-transaction-migration.js +89 -89
- package/migrations/finance-payment-item-migration.js +52 -52
- package/migrations/finance-payment-method-migration.js +31 -31
- package/migrations/finance-payment-method-type-migration.js +55 -55
- package/migrations/finance-payment-migration.js +96 -96
- package/migrations/finance-post-history-migration.js +45 -45
- package/migrations/finance-tag-group-migration.js +53 -53
- package/migrations/finance-tag-migration.js +63 -63
- package/migrations/finance-tax-migration.js +52 -52
- package/migrations/refactor-finance-document-migration.js +71 -71
- package/migrations/update-document-item.migration.js +87 -87
- package/package.json +81 -79
- package/receipt-template/default/assets/css/style.css +2629 -2629
- package/receipt-template/default/assets/css/style.css.map +12 -12
- package/receipt-template/default/assets/css/style.min.css +1 -1
- package/receipt-template/default/assets/img/arrow_bg.svg +11 -11
- package/receipt-template/default/assets/img/coffy_shop_img.svg +18 -18
- package/receipt-template/default/assets/img/logo.svg +4 -4
- package/receipt-template/default/assets/img/logo_accent.svg +3 -3
- package/receipt-template/default/assets/img/logo_white.svg +4 -4
- package/receipt-template/default/assets/img/sign.svg +12 -12
- package/receipt-template/default/assets/img/tomei-logo.svg +9 -9
- package/receipt-template/default/assets/js/html2canvas.min.js +10379 -10379
- package/receipt-template/default/assets/js/jquery.min.js +1 -1
- package/receipt-template/default/assets/js/main.js +48 -48
- package/receipt-template/default/assets/sass/common/_color_variable.scss +12 -12
- package/receipt-template/default/assets/sass/common/_invoice.scss +1801 -1801
- package/receipt-template/default/assets/sass/common/_normalize.scss +350 -350
- package/receipt-template/default/assets/sass/common/_typography.scss +178 -178
- package/receipt-template/default/assets/sass/style.scss +12 -12
- package/receipt-template/default/index.html +291 -291
- package/scripts/postinstall.js +300 -300
- package/dist/enum/quick-book-client-scopes.enum.d.ts +0 -13
- package/dist/enum/quick-book-client-scopes.enum.js +0 -19
- package/dist/enum/quick-book-client-scopes.enum.js.map +0 -1
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
async up(queryInterface, Sequelize) {
|
|
5
|
-
await queryInterface.createTable('finance_PostHistory', {
|
|
6
|
-
PostId: {
|
|
7
|
-
type: Sequelize.STRING(30),
|
|
8
|
-
primaryKey: true,
|
|
9
|
-
allowNull: false,
|
|
10
|
-
},
|
|
11
|
-
DateTime: {
|
|
12
|
-
type: Sequelize.DATE,
|
|
13
|
-
allowNull: false,
|
|
14
|
-
},
|
|
15
|
-
ItemId: {
|
|
16
|
-
type: Sequelize.STRING(30),
|
|
17
|
-
allowNull: false,
|
|
18
|
-
},
|
|
19
|
-
ItemType: {
|
|
20
|
-
type: Sequelize.STRING(200),
|
|
21
|
-
allowNull: false,
|
|
22
|
-
},
|
|
23
|
-
ItemValue: {
|
|
24
|
-
type: Sequelize.JSON(),
|
|
25
|
-
allowNull: false,
|
|
26
|
-
},
|
|
27
|
-
PostedById: {
|
|
28
|
-
type: Sequelize.STRING(30),
|
|
29
|
-
allowNull: false,
|
|
30
|
-
},
|
|
31
|
-
AccSystemCode: {
|
|
32
|
-
type: Sequelize.STRING(10),
|
|
33
|
-
allowNull: false,
|
|
34
|
-
},
|
|
35
|
-
AccSystemRefId: {
|
|
36
|
-
type: Sequelize.STRING(30),
|
|
37
|
-
allowNull: false,
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
async down(queryInterface) {
|
|
43
|
-
await queryInterface.dropTable('finance_PostHistory');
|
|
44
|
-
},
|
|
45
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
async up(queryInterface, Sequelize) {
|
|
5
|
+
await queryInterface.createTable('finance_PostHistory', {
|
|
6
|
+
PostId: {
|
|
7
|
+
type: Sequelize.STRING(30),
|
|
8
|
+
primaryKey: true,
|
|
9
|
+
allowNull: false,
|
|
10
|
+
},
|
|
11
|
+
DateTime: {
|
|
12
|
+
type: Sequelize.DATE,
|
|
13
|
+
allowNull: false,
|
|
14
|
+
},
|
|
15
|
+
ItemId: {
|
|
16
|
+
type: Sequelize.STRING(30),
|
|
17
|
+
allowNull: false,
|
|
18
|
+
},
|
|
19
|
+
ItemType: {
|
|
20
|
+
type: Sequelize.STRING(200),
|
|
21
|
+
allowNull: false,
|
|
22
|
+
},
|
|
23
|
+
ItemValue: {
|
|
24
|
+
type: Sequelize.JSON(),
|
|
25
|
+
allowNull: false,
|
|
26
|
+
},
|
|
27
|
+
PostedById: {
|
|
28
|
+
type: Sequelize.STRING(30),
|
|
29
|
+
allowNull: false,
|
|
30
|
+
},
|
|
31
|
+
AccSystemCode: {
|
|
32
|
+
type: Sequelize.STRING(10),
|
|
33
|
+
allowNull: false,
|
|
34
|
+
},
|
|
35
|
+
AccSystemRefId: {
|
|
36
|
+
type: Sequelize.STRING(30),
|
|
37
|
+
allowNull: false,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
async down(queryInterface) {
|
|
43
|
+
await queryInterface.dropTable('finance_PostHistory');
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
async up(queryInterface, Sequelize) {
|
|
5
|
-
await queryInterface.createTable('finance_TagGroup', {
|
|
6
|
-
TagGroupId: {
|
|
7
|
-
type: Sequelize.STRING(30),
|
|
8
|
-
primaryKey: true,
|
|
9
|
-
allowNull: false,
|
|
10
|
-
},
|
|
11
|
-
TagGroupName: {
|
|
12
|
-
type: Sequelize.STRING(50),
|
|
13
|
-
allowNull: false,
|
|
14
|
-
},
|
|
15
|
-
CreatedById: {
|
|
16
|
-
type: Sequelize.STRING(30),
|
|
17
|
-
allowNull: false,
|
|
18
|
-
},
|
|
19
|
-
CreatedAt: {
|
|
20
|
-
type: Sequelize.DATE,
|
|
21
|
-
allowNull: false,
|
|
22
|
-
},
|
|
23
|
-
UpdatedById: {
|
|
24
|
-
type: Sequelize.STRING(30),
|
|
25
|
-
allowNull: true,
|
|
26
|
-
},
|
|
27
|
-
UpdatedAt: {
|
|
28
|
-
type: Sequelize.DATE,
|
|
29
|
-
allowNull: true,
|
|
30
|
-
},
|
|
31
|
-
AccSystemRefId: {
|
|
32
|
-
type: Sequelize.STRING(30),
|
|
33
|
-
allowNull: true,
|
|
34
|
-
},
|
|
35
|
-
PostedToAccSystemYN: {
|
|
36
|
-
type: Sequelize.CHAR(1),
|
|
37
|
-
allowNull: true,
|
|
38
|
-
},
|
|
39
|
-
PostedById: {
|
|
40
|
-
type: Sequelize.STRING(30),
|
|
41
|
-
allowNull: true,
|
|
42
|
-
},
|
|
43
|
-
PostedDateTime: {
|
|
44
|
-
type: Sequelize.DATE,
|
|
45
|
-
allowNull: true,
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
async down(queryInterface) {
|
|
51
|
-
await queryInterface.dropTable('finance_TagGroup');
|
|
52
|
-
},
|
|
53
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
async up(queryInterface, Sequelize) {
|
|
5
|
+
await queryInterface.createTable('finance_TagGroup', {
|
|
6
|
+
TagGroupId: {
|
|
7
|
+
type: Sequelize.STRING(30),
|
|
8
|
+
primaryKey: true,
|
|
9
|
+
allowNull: false,
|
|
10
|
+
},
|
|
11
|
+
TagGroupName: {
|
|
12
|
+
type: Sequelize.STRING(50),
|
|
13
|
+
allowNull: false,
|
|
14
|
+
},
|
|
15
|
+
CreatedById: {
|
|
16
|
+
type: Sequelize.STRING(30),
|
|
17
|
+
allowNull: false,
|
|
18
|
+
},
|
|
19
|
+
CreatedAt: {
|
|
20
|
+
type: Sequelize.DATE,
|
|
21
|
+
allowNull: false,
|
|
22
|
+
},
|
|
23
|
+
UpdatedById: {
|
|
24
|
+
type: Sequelize.STRING(30),
|
|
25
|
+
allowNull: true,
|
|
26
|
+
},
|
|
27
|
+
UpdatedAt: {
|
|
28
|
+
type: Sequelize.DATE,
|
|
29
|
+
allowNull: true,
|
|
30
|
+
},
|
|
31
|
+
AccSystemRefId: {
|
|
32
|
+
type: Sequelize.STRING(30),
|
|
33
|
+
allowNull: true,
|
|
34
|
+
},
|
|
35
|
+
PostedToAccSystemYN: {
|
|
36
|
+
type: Sequelize.CHAR(1),
|
|
37
|
+
allowNull: true,
|
|
38
|
+
},
|
|
39
|
+
PostedById: {
|
|
40
|
+
type: Sequelize.STRING(30),
|
|
41
|
+
allowNull: true,
|
|
42
|
+
},
|
|
43
|
+
PostedDateTime: {
|
|
44
|
+
type: Sequelize.DATE,
|
|
45
|
+
allowNull: true,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
async down(queryInterface) {
|
|
51
|
+
await queryInterface.dropTable('finance_TagGroup');
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -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
|
};
|