@tomei/finance 0.5.0 → 0.5.2

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 (171) hide show
  1. package/dist/account/account.d.ts +35 -35
  2. package/dist/account/account.js +233 -231
  3. package/dist/account/account.js.map +1 -1
  4. package/dist/account/account.repository.d.ts +5 -5
  5. package/dist/account/account.repository.js +11 -11
  6. package/dist/account/interfaces/account-attr.interface.d.ts +29 -29
  7. package/dist/account/interfaces/account-attr.interface.js +2 -2
  8. package/dist/account-system-entity/account-system-entity.d.ts +11 -11
  9. package/dist/account-system-entity/account-system-entity.js +66 -66
  10. package/dist/account-system-entity/post-history.repository.d.ts +5 -5
  11. package/dist/account-system-entity/post-history.repository.js +11 -11
  12. package/dist/config.d.ts +1888 -1888
  13. package/dist/config.js +331 -331
  14. package/dist/customer/customer.d.ts +43 -41
  15. package/dist/customer/customer.js +236 -214
  16. package/dist/customer/customer.js.map +1 -1
  17. package/dist/customer/finance-customer.repository.d.ts +5 -5
  18. package/dist/customer/finance-customer.repository.js +25 -25
  19. package/dist/customer/interfaces/customer.repository.interface.d.ts +3 -3
  20. package/dist/customer/interfaces/customer.repository.interface.js +2 -2
  21. package/dist/customer/interfaces/finance-customer-attr.interface.d.ts +10 -10
  22. package/dist/customer/interfaces/finance-customer-attr.interface.js +2 -2
  23. package/dist/customer/interfaces/finance-customer.repository.interface.d.ts +3 -3
  24. package/dist/customer/interfaces/finance-customer.repository.interface.js +2 -2
  25. package/dist/database.d.ts +4 -4
  26. package/dist/database.js +14 -14
  27. package/dist/document/document-item.d.ts +38 -38
  28. package/dist/document/document-item.js +83 -83
  29. package/dist/document/document-item.repository.d.ts +5 -5
  30. package/dist/document/document-item.repository.js +11 -11
  31. package/dist/document/document.d.ts +76 -76
  32. package/dist/document/document.js +566 -566
  33. package/dist/document/document.repository.d.ts +5 -5
  34. package/dist/document/document.repository.js +11 -11
  35. package/dist/document/interfaces/document-attr.interface.d.ts +27 -27
  36. package/dist/document/interfaces/document-attr.interface.js +6 -6
  37. package/dist/document/interfaces/document-item-attr.interface.d.ts +22 -22
  38. package/dist/document/interfaces/document-item-attr.interface.js +6 -6
  39. package/dist/document/interfaces/document-item.repository.interface.d.ts +3 -3
  40. package/dist/document/interfaces/document-item.repository.interface.js +2 -2
  41. package/dist/enum/doc-type.enum.d.ts +8 -8
  42. package/dist/enum/doc-type.enum.js +12 -12
  43. package/dist/enum/document-status.enum.d.ts +6 -6
  44. package/dist/enum/document-status.enum.js +10 -10
  45. package/dist/enum/index.d.ts +8 -8
  46. package/dist/enum/index.js +17 -17
  47. package/dist/enum/payment-method.enum.d.ts +3 -3
  48. package/dist/enum/payment-method.enum.js +7 -7
  49. package/dist/enum/payment-status.enum.d.ts +4 -4
  50. package/dist/enum/payment-status.enum.js +8 -8
  51. package/dist/enum/payment-type.enum.d.ts +4 -4
  52. package/dist/enum/payment-type.enum.js +8 -8
  53. package/dist/enum/quick-book-client-scopes.enum.d.ts +13 -13
  54. package/dist/enum/quick-book-client-scopes.enum.js +18 -18
  55. package/dist/enum/transaction-type.enum.d.ts +4 -4
  56. package/dist/enum/transaction-type.enum.js +8 -8
  57. package/dist/finance-company/finance-company.d.ts +57 -57
  58. package/dist/finance-company/finance-company.js +1192 -1192
  59. package/dist/finance-company/finance-company.repository.d.ts +5 -5
  60. package/dist/finance-company/finance-company.repository.js +11 -11
  61. package/dist/helpers/typeof.d.ts +1 -1
  62. package/dist/helpers/typeof.js +26 -26
  63. package/dist/index.d.ts +17 -17
  64. package/dist/index.js +32 -32
  65. package/dist/interfaces/account-system.interface.d.ts +13 -13
  66. package/dist/interfaces/account-system.interface.js +2 -2
  67. package/dist/interfaces/index.d.ts +2 -2
  68. package/dist/interfaces/index.js +2 -2
  69. package/dist/journal-entry/interfaces/journal-entry-attr.interface.d.ts +11 -11
  70. package/dist/journal-entry/interfaces/journal-entry-attr.interface.js +2 -2
  71. package/dist/journal-entry/journal-entry.d.ts +39 -39
  72. package/dist/journal-entry/journal-entry.js +215 -215
  73. package/dist/journal-entry/journal-entry.repository.d.ts +5 -5
  74. package/dist/journal-entry/journal-entry.repository.js +11 -11
  75. package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts +17 -17
  76. package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.js +2 -2
  77. package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.d.ts +5 -5
  78. package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.js +2 -2
  79. package/dist/ledger-transaction/ledger-transaction.d.ts +48 -48
  80. package/dist/ledger-transaction/ledger-transaction.js +155 -155
  81. package/dist/ledger-transaction/ledger-transaction.repository.d.ts +5 -5
  82. package/dist/ledger-transaction/ledger-transaction.repository.js +11 -11
  83. package/dist/models/account.entity.d.ts +30 -30
  84. package/dist/models/account.entity.js +232 -232
  85. package/dist/models/account.entity.js.map +1 -1
  86. package/dist/models/customer.entity.d.ts +13 -13
  87. package/dist/models/customer.entity.js +109 -109
  88. package/dist/models/document-item.entity.d.ts +27 -27
  89. package/dist/models/document-item.entity.js +172 -172
  90. package/dist/models/document.entity.d.ts +36 -36
  91. package/dist/models/document.entity.js +242 -242
  92. package/dist/models/finance-company.entity.d.ts +9 -9
  93. package/dist/models/finance-company.entity.js +44 -44
  94. package/dist/models/journal-entry.entity.d.ts +16 -16
  95. package/dist/models/journal-entry.entity.js +127 -127
  96. package/dist/models/ledger-transaction.entity.d.ts +24 -24
  97. package/dist/models/ledger-transaction.entity.js +172 -172
  98. package/dist/models/payment-item.entity.d.ts +12 -12
  99. package/dist/models/payment-item.entity.js +75 -75
  100. package/dist/models/payment-method-type.entity.d.ts +13 -13
  101. package/dist/models/payment-method-type.entity.js +85 -85
  102. package/dist/models/payment-method.entity.d.ts +10 -10
  103. package/dist/models/payment-method.entity.js +62 -62
  104. package/dist/models/payment-paid-with.entity.d.ts +24 -24
  105. package/dist/models/payment-paid-with.entity.js +158 -158
  106. package/dist/models/payment.entity.d.ts +27 -27
  107. package/dist/models/payment.entity.js +188 -188
  108. package/dist/models/post-history.entity.d.ts +11 -11
  109. package/dist/models/post-history.entity.js +63 -63
  110. package/dist/payment/interfaces/payment-attr.interface.d.ts +22 -22
  111. package/dist/payment/interfaces/payment-attr.interface.js +6 -6
  112. package/dist/payment/interfaces/payment-params.interface.d.ts +7 -7
  113. package/dist/payment/interfaces/payment-params.interface.js +2 -2
  114. package/dist/payment/payment.d.ts +51 -51
  115. package/dist/payment/payment.js +179 -179
  116. package/dist/payment/payment.repository.d.ts +5 -5
  117. package/dist/payment/payment.repository.js +11 -11
  118. package/dist/payment-item/interfaces/payment-item-attr.interface.d.ts +10 -10
  119. package/dist/payment-item/interfaces/payment-item-attr.interface.js +6 -6
  120. package/dist/payment-item/payment-item.d.ts +23 -23
  121. package/dist/payment-item/payment-item.js +115 -115
  122. package/dist/payment-item/payment-item.repository.d.ts +5 -5
  123. package/dist/payment-item/payment-item.repository.js +11 -11
  124. package/dist/payment-method/interfaces/payment-method-attr.interface.d.ts +5 -5
  125. package/dist/payment-method/interfaces/payment-method-attr.interface.js +2 -2
  126. package/dist/payment-method/payment-method.d.ts +18 -18
  127. package/dist/payment-method/payment-method.js +98 -98
  128. package/dist/payment-method/payment-method.repository.d.ts +5 -5
  129. package/dist/payment-method/payment-method.repository.js +11 -11
  130. package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.d.ts +8 -8
  131. package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.js +2 -2
  132. package/dist/payment-method-type/payment-method-type.d.ts +16 -16
  133. package/dist/payment-method-type/payment-method-type.js +70 -70
  134. package/dist/payment-method-type/payment-method-type.repository.d.ts +5 -5
  135. package/dist/payment-method-type/payment-method-type.repository.js +11 -11
  136. package/dist/payment-paid-with/interfaces/payment-paid-with.interface.d.ts +19 -19
  137. package/dist/payment-paid-with/interfaces/payment-paid-with.interface.js +6 -6
  138. package/dist/payment-paid-with/payment-paid-with.d.ts +31 -31
  139. package/dist/payment-paid-with/payment-paid-with.js +52 -52
  140. package/dist/payment-paid-with/payment-paid-with.repository.d.ts +5 -5
  141. package/dist/payment-paid-with/payment-paid-with.repository.js +11 -11
  142. package/dist/test-document.d.ts +3 -3
  143. package/dist/test-document.js +18 -18
  144. package/dist/test.d.ts +1 -1
  145. package/dist/test.js +7 -7
  146. package/dist/tsconfig.tsbuildinfo +1 -1
  147. package/package.json +1 -1
  148. package/src/account/account.ts +3 -1
  149. package/src/customer/customer.ts +40 -0
  150. package/src/models/account.entity.ts +1 -1
  151. package/dist/account/interfaces/account.repository.interface.d.ts +0 -3
  152. package/dist/account/interfaces/account.repository.interface.js +0 -3
  153. package/dist/account/interfaces/account.repository.interface.js.map +0 -1
  154. package/dist/document/interfaces/document.repository.interface.d.ts +0 -3
  155. package/dist/document/interfaces/document.repository.interface.js +0 -3
  156. package/dist/document/interfaces/document.repository.interface.js.map +0 -1
  157. package/dist/journal-entry/interfaces/journal-entry.repository.interface.d.ts +0 -10
  158. package/dist/journal-entry/interfaces/journal-entry.repository.interface.js +0 -3
  159. package/dist/journal-entry/interfaces/journal-entry.repository.interface.js.map +0 -1
  160. package/dist/payment/interfaces/payment-item-attr.interface.d.ts +0 -7
  161. package/dist/payment/interfaces/payment-item-attr.interface.js +0 -7
  162. package/dist/payment/interfaces/payment-item-attr.interface.js.map +0 -1
  163. package/dist/payment/interfaces/payment-item.repository.interface.d.ts +0 -3
  164. package/dist/payment/interfaces/payment-item.repository.interface.js +0 -3
  165. package/dist/payment/interfaces/payment-item.repository.interface.js.map +0 -1
  166. package/dist/payment/interfaces/payment.repository.interface.d.ts +0 -3
  167. package/dist/payment/interfaces/payment.repository.interface.js +0 -3
  168. package/dist/payment/interfaces/payment.repository.interface.js.map +0 -1
  169. package/dist/payment/payment-item.repository.d.ts +0 -17
  170. package/dist/payment/payment-item.repository.js +0 -51
  171. package/dist/payment/payment-item.repository.js.map +0 -1
@@ -1,26 +1,26 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.FinanceCustomerRepository = void 0;
13
- const decorators_1 = require("@nestjs/common/decorators");
14
- const general_1 = require("@tomei/general");
15
- const customer_entity_1 = require("../models/customer.entity");
16
- let FinanceCustomerRepository = class FinanceCustomerRepository extends general_1.RepositoryBase {
17
- constructor() {
18
- super(customer_entity_1.default);
19
- }
20
- };
21
- FinanceCustomerRepository = __decorate([
22
- (0, decorators_1.Injectable)(),
23
- __metadata("design:paramtypes", [])
24
- ], FinanceCustomerRepository);
25
- exports.FinanceCustomerRepository = FinanceCustomerRepository;
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.FinanceCustomerRepository = void 0;
13
+ const decorators_1 = require("@nestjs/common/decorators");
14
+ const general_1 = require("@tomei/general");
15
+ const customer_entity_1 = require("../models/customer.entity");
16
+ let FinanceCustomerRepository = class FinanceCustomerRepository extends general_1.RepositoryBase {
17
+ constructor() {
18
+ super(customer_entity_1.default);
19
+ }
20
+ };
21
+ FinanceCustomerRepository = __decorate([
22
+ (0, decorators_1.Injectable)(),
23
+ __metadata("design:paramtypes", [])
24
+ ], FinanceCustomerRepository);
25
+ exports.FinanceCustomerRepository = FinanceCustomerRepository;
26
26
  //# sourceMappingURL=finance-customer.repository.js.map
@@ -1,3 +1,3 @@
1
- export interface ICustomerRepository<T> {
2
- findOne?(options: any): Promise<T>;
3
- }
1
+ export interface ICustomerRepository<T> {
2
+ findOne?(options: any): Promise<T>;
3
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=customer.repository.interface.js.map
@@ -1,10 +1,10 @@
1
- export interface IFinanceCustomerAttr {
2
- CustomerId: string;
3
- CompanyId: string;
4
- CustSystemCode: string;
5
- CustSystemRefId: string;
6
- AccSystemRefId: string;
7
- PostedToAccSystemYN: string;
8
- PostedById: string;
9
- PostedDateTime?: Date;
10
- }
1
+ export interface IFinanceCustomerAttr {
2
+ CustomerId: string;
3
+ CompanyId: string;
4
+ CustSystemCode: string;
5
+ CustSystemRefId: string;
6
+ AccSystemRefId: string;
7
+ PostedToAccSystemYN: string;
8
+ PostedById: string;
9
+ PostedDateTime?: Date;
10
+ }
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=finance-customer-attr.interface.js.map
@@ -1,3 +1,3 @@
1
- import { IRepositoryBase } from '@tomei/general';
2
- import FinanceCustomerModel from '../../models/customer.entity';
3
- export type IFinanceCustomerRepository = IRepositoryBase<FinanceCustomerModel>;
1
+ import { IRepositoryBase } from '@tomei/general';
2
+ import FinanceCustomerModel from '../../models/customer.entity';
3
+ export type IFinanceCustomerRepository = IRepositoryBase<FinanceCustomerModel>;
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=finance-customer.repository.interface.js.map
@@ -1,4 +1,4 @@
1
- import { Sequelize, SequelizeOptions } from 'sequelize-typescript';
2
- declare function init(sequelizeOptions: SequelizeOptions): void;
3
- declare function getConnection(): Sequelize;
4
- export { init, getConnection };
1
+ import { Sequelize, SequelizeOptions } from 'sequelize-typescript';
2
+ declare function init(sequelizeOptions: SequelizeOptions): void;
3
+ declare function getConnection(): Sequelize;
4
+ export { init, getConnection };
package/dist/database.js CHANGED
@@ -1,15 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getConnection = exports.init = void 0;
4
- const sequelize_typescript_1 = require("sequelize-typescript");
5
- let sequelize;
6
- function init(sequelizeOptions) {
7
- sequelize = new sequelize_typescript_1.Sequelize(sequelizeOptions);
8
- sequelize.addModels([__dirname + '/models']);
9
- }
10
- exports.init = init;
11
- function getConnection() {
12
- return sequelize;
13
- }
14
- exports.getConnection = getConnection;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getConnection = exports.init = void 0;
4
+ const sequelize_typescript_1 = require("sequelize-typescript");
5
+ let sequelize;
6
+ function init(sequelizeOptions) {
7
+ sequelize = new sequelize_typescript_1.Sequelize(sequelizeOptions);
8
+ sequelize.addModels([__dirname + '/models']);
9
+ }
10
+ exports.init = init;
11
+ function getConnection() {
12
+ return sequelize;
13
+ }
14
+ exports.getConnection = getConnection;
15
15
  //# sourceMappingURL=database.js.map
@@ -1,38 +1,38 @@
1
- import Document from './document';
2
- import { ObjectBase } from '@tomei/general';
3
- export default class DocumentItem extends ObjectBase {
4
- DocumentItemId: string;
5
- DocNo: string;
6
- Name: string;
7
- NameBM: string;
8
- Description?: string;
9
- ItemId: string;
10
- ItemType: string;
11
- ItemSKU: string;
12
- ItemSerialNo: string;
13
- Currency: string;
14
- UnitPrice: number;
15
- Quantity: number;
16
- QuantityUOM: string;
17
- private _Amount;
18
- TaxCode: string;
19
- TaxAmount: number;
20
- TaxRate: number;
21
- TaxInclusiveYN: string;
22
- DtAccountNo: string;
23
- CtAccountNo: string;
24
- private static _RepositoryBase;
25
- private _DbTransaction;
26
- private _Document;
27
- get ObjectId(): string;
28
- get ObjectName(): string;
29
- get TableName(): string;
30
- get Document(): Document;
31
- set Document(document: Document);
32
- get DbTransaction(): any;
33
- set DbTransaction(dbTransaction: any);
34
- get Amount(): number;
35
- set Amount(amount: number);
36
- constructor(dbTransaction: any, document: Document);
37
- init(data: any): void;
38
- }
1
+ import Document from './document';
2
+ import { ObjectBase } from '@tomei/general';
3
+ export default class DocumentItem extends ObjectBase {
4
+ DocumentItemId: string;
5
+ DocNo: string;
6
+ Name: string;
7
+ NameBM: string;
8
+ Description?: string;
9
+ ItemId: string;
10
+ ItemType: string;
11
+ ItemSKU: string;
12
+ ItemSerialNo: string;
13
+ Currency: string;
14
+ UnitPrice: number;
15
+ Quantity: number;
16
+ QuantityUOM: string;
17
+ private _Amount;
18
+ TaxCode: string;
19
+ TaxAmount: number;
20
+ TaxRate: number;
21
+ TaxInclusiveYN: string;
22
+ DtAccountNo: string;
23
+ CtAccountNo: string;
24
+ private static _RepositoryBase;
25
+ private _DbTransaction;
26
+ private _Document;
27
+ get ObjectId(): string;
28
+ get ObjectName(): string;
29
+ get TableName(): string;
30
+ get Document(): Document;
31
+ set Document(document: Document);
32
+ get DbTransaction(): any;
33
+ set DbTransaction(dbTransaction: any);
34
+ get Amount(): number;
35
+ set Amount(amount: number);
36
+ constructor(dbTransaction: any, document: Document);
37
+ init(data: any): void;
38
+ }
@@ -1,84 +1,84 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const general_1 = require("@tomei/general");
4
- const document_item_repository_1 = require("./document-item.repository");
5
- class DocumentItem extends general_1.ObjectBase {
6
- get ObjectId() {
7
- return this.ItemId;
8
- }
9
- get ObjectName() {
10
- return this.Name;
11
- }
12
- get TableName() {
13
- return 'finance_DocumentItem';
14
- }
15
- get Document() {
16
- return this._Document;
17
- }
18
- set Document(document) {
19
- this._Document = document;
20
- }
21
- get DbTransaction() {
22
- return this._DbTransaction;
23
- }
24
- set DbTransaction(dbTransaction) {
25
- this._DbTransaction = dbTransaction;
26
- }
27
- get Amount() {
28
- return this._Amount;
29
- }
30
- set Amount(amount) {
31
- this._Amount = amount;
32
- this._Document.reCalculateAmount();
33
- }
34
- constructor(dbTransaction, document) {
35
- super();
36
- this.DocumentItemId = 'New';
37
- this.DocNo = '';
38
- this.Name = '';
39
- this.NameBM = '';
40
- this.Description = '';
41
- this.ItemId = '';
42
- this.ItemType = '';
43
- this.ItemSKU = '';
44
- this.ItemSerialNo = '';
45
- this.Currency = 'MYR';
46
- this.UnitPrice = 0;
47
- this.Quantity = 0;
48
- this.QuantityUOM = 'Pieces';
49
- this._Amount = 0;
50
- this.TaxCode = '';
51
- this.TaxAmount = 0;
52
- this.TaxRate = 0;
53
- this.TaxInclusiveYN = 'N';
54
- this.DtAccountNo = '';
55
- this.CtAccountNo = '';
56
- this._DbTransaction = dbTransaction;
57
- this._Document = document;
58
- }
59
- init(data) {
60
- this.DocumentItemId = data.DocumentItemId || this.DocumentItemId;
61
- this.DocNo = data.DocNo || this.DocNo;
62
- this.Name = data.Name || this.Name;
63
- this.NameBM = data.NameBM || this.NameBM;
64
- this.Description = data.Description || this.Description;
65
- this.ItemId = data.ItemId || this.ItemId;
66
- this.ItemType = data.ItemType || this.ItemType;
67
- this.ItemSKU = data.ItemSKU || this.ItemSKU;
68
- this.ItemSerialNo = data.ItemSerialNo || this.ItemSerialNo;
69
- this.Currency = data.Currency || this.Currency;
70
- this.UnitPrice = data.UnitPrice || this.UnitPrice;
71
- this.Quantity = data.Quantity || this.Quantity;
72
- this.QuantityUOM = data.QuantityUOM || this.QuantityUOM;
73
- this._Amount = data.Amount || this._Amount;
74
- this.TaxCode = data.TaxCode || this.TaxCode;
75
- this.TaxAmount = data.TaxAmount || this.TaxAmount;
76
- this.TaxRate = data.TaxRate || this.TaxRate;
77
- this.TaxInclusiveYN = data.TaxInclusiveYN || this.TaxInclusiveYN;
78
- this.DtAccountNo = data.DtAccountNo || this.DtAccountNo;
79
- this.CtAccountNo = data.CtAccountNo || this.CtAccountNo;
80
- }
81
- }
82
- exports.default = DocumentItem;
83
- DocumentItem._RepositoryBase = new document_item_repository_1.DocumentItemRepository();
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const general_1 = require("@tomei/general");
4
+ const document_item_repository_1 = require("./document-item.repository");
5
+ class DocumentItem extends general_1.ObjectBase {
6
+ get ObjectId() {
7
+ return this.ItemId;
8
+ }
9
+ get ObjectName() {
10
+ return this.Name;
11
+ }
12
+ get TableName() {
13
+ return 'finance_DocumentItem';
14
+ }
15
+ get Document() {
16
+ return this._Document;
17
+ }
18
+ set Document(document) {
19
+ this._Document = document;
20
+ }
21
+ get DbTransaction() {
22
+ return this._DbTransaction;
23
+ }
24
+ set DbTransaction(dbTransaction) {
25
+ this._DbTransaction = dbTransaction;
26
+ }
27
+ get Amount() {
28
+ return this._Amount;
29
+ }
30
+ set Amount(amount) {
31
+ this._Amount = amount;
32
+ this._Document.reCalculateAmount();
33
+ }
34
+ constructor(dbTransaction, document) {
35
+ super();
36
+ this.DocumentItemId = 'New';
37
+ this.DocNo = '';
38
+ this.Name = '';
39
+ this.NameBM = '';
40
+ this.Description = '';
41
+ this.ItemId = '';
42
+ this.ItemType = '';
43
+ this.ItemSKU = '';
44
+ this.ItemSerialNo = '';
45
+ this.Currency = 'MYR';
46
+ this.UnitPrice = 0;
47
+ this.Quantity = 0;
48
+ this.QuantityUOM = 'Pieces';
49
+ this._Amount = 0;
50
+ this.TaxCode = '';
51
+ this.TaxAmount = 0;
52
+ this.TaxRate = 0;
53
+ this.TaxInclusiveYN = 'N';
54
+ this.DtAccountNo = '';
55
+ this.CtAccountNo = '';
56
+ this._DbTransaction = dbTransaction;
57
+ this._Document = document;
58
+ }
59
+ init(data) {
60
+ this.DocumentItemId = data.DocumentItemId || this.DocumentItemId;
61
+ this.DocNo = data.DocNo || this.DocNo;
62
+ this.Name = data.Name || this.Name;
63
+ this.NameBM = data.NameBM || this.NameBM;
64
+ this.Description = data.Description || this.Description;
65
+ this.ItemId = data.ItemId || this.ItemId;
66
+ this.ItemType = data.ItemType || this.ItemType;
67
+ this.ItemSKU = data.ItemSKU || this.ItemSKU;
68
+ this.ItemSerialNo = data.ItemSerialNo || this.ItemSerialNo;
69
+ this.Currency = data.Currency || this.Currency;
70
+ this.UnitPrice = data.UnitPrice || this.UnitPrice;
71
+ this.Quantity = data.Quantity || this.Quantity;
72
+ this.QuantityUOM = data.QuantityUOM || this.QuantityUOM;
73
+ this._Amount = data.Amount || this._Amount;
74
+ this.TaxCode = data.TaxCode || this.TaxCode;
75
+ this.TaxAmount = data.TaxAmount || this.TaxAmount;
76
+ this.TaxRate = data.TaxRate || this.TaxRate;
77
+ this.TaxInclusiveYN = data.TaxInclusiveYN || this.TaxInclusiveYN;
78
+ this.DtAccountNo = data.DtAccountNo || this.DtAccountNo;
79
+ this.CtAccountNo = data.CtAccountNo || this.CtAccountNo;
80
+ }
81
+ }
82
+ exports.default = DocumentItem;
83
+ DocumentItem._RepositoryBase = new document_item_repository_1.DocumentItemRepository();
84
84
  //# sourceMappingURL=document-item.js.map
@@ -1,5 +1,5 @@
1
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
- import DocumentItemModel from '../models/document-item.entity';
3
- export declare class DocumentItemRepository extends RepositoryBase<DocumentItemModel> implements IRepositoryBase<DocumentItemModel> {
4
- constructor();
5
- }
1
+ import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
+ import DocumentItemModel from '../models/document-item.entity';
3
+ export declare class DocumentItemRepository extends RepositoryBase<DocumentItemModel> implements IRepositoryBase<DocumentItemModel> {
4
+ constructor();
5
+ }
@@ -1,12 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DocumentItemRepository = void 0;
4
- const general_1 = require("@tomei/general");
5
- const document_item_entity_1 = require("../models/document-item.entity");
6
- class DocumentItemRepository extends general_1.RepositoryBase {
7
- constructor() {
8
- super(document_item_entity_1.default);
9
- }
10
- }
11
- exports.DocumentItemRepository = DocumentItemRepository;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentItemRepository = void 0;
4
+ const general_1 = require("@tomei/general");
5
+ const document_item_entity_1 = require("../models/document-item.entity");
6
+ class DocumentItemRepository extends general_1.RepositoryBase {
7
+ constructor() {
8
+ super(document_item_entity_1.default);
9
+ }
10
+ }
11
+ exports.DocumentItemRepository = DocumentItemRepository;
12
12
  //# sourceMappingURL=document-item.repository.js.map
@@ -1,76 +1,76 @@
1
- /// <reference types="multer" />
2
- import { CommonService as MediaCommonService, MediasModel } from '@tomei/media';
3
- import { DocumentStatus, DocType } from '../enum';
4
- import { IDocumentAttr } from './interfaces/document-attr.interface';
5
- import DocumentItem from './document-item';
6
- import { AccountSystemEntity } from '../account-system-entity/account-system-entity';
7
- import { DocumentRepository } from './document.repository';
8
- import FinanceCustomerBase from '../customer/customer';
9
- import DocumentModel from '../models/document.entity';
10
- export default class Document extends AccountSystemEntity {
11
- DocNo: string;
12
- private _DocType;
13
- private _DocDate;
14
- Currency: string;
15
- private _Amount;
16
- Description: string;
17
- private _Status;
18
- IssuedById: string;
19
- IssuedToId: string;
20
- IssuedToType: string;
21
- RelatedObjectId: string;
22
- RelatedObjectType: string;
23
- CreatedById: string;
24
- CreatedAt: Date;
25
- UpdatedById: string;
26
- UpdatedAt: Date;
27
- UseAccSystemDocYN: string;
28
- private _DocHTMLFileMediaId;
29
- private _DocPDFFileMediaId;
30
- private static _RepositoryBase;
31
- private static _DocumentItemRepository;
32
- private _DbTransaction;
33
- private _IsNewRecord;
34
- private _DocumentItems;
35
- private static _MediaRepository;
36
- mediaCommonService: MediaCommonService;
37
- private get IsNewRecord();
38
- private set IsNewRecord(value);
39
- get DocType(): DocType;
40
- set DocType(docType: DocType);
41
- get DocDate(): Date;
42
- set DocDate(date: Date);
43
- get DocHTMLFileMediaId(): string;
44
- set DocHTMLFileMediaId(mediaId: string);
45
- get DocPDFFileMediaId(): string;
46
- set DocPDFFileMediaId(mediaId: string);
47
- get Amount(): number;
48
- private set Amount(value);
49
- get Status(): DocumentStatus;
50
- private set Status(value);
51
- get RepositoryBase(): DocumentRepository;
52
- get ObjectId(): string;
53
- get ObjectName(): string;
54
- get TableName(): string;
55
- constructor(dbTransaction?: any, docNo?: string);
56
- static initDocument(dbTransaction: any, docNo: string): Promise<Document>;
57
- reCalculateAmount(): Promise<void>;
58
- get DocumentItems(): Promise<DocumentItem[]>;
59
- static DEFAULT_INVOICE_TEMPLATE_HTML(): Promise<Express.Multer.File>;
60
- DEFAULT_INVOICE_TEMPLATE_PDF(customer: FinanceCustomerBase): Promise<Express.Multer.File>;
61
- DEFAULT_RECEIPT_TEMPLATE_PDF(customer: FinanceCustomerBase): Promise<Express.Multer.File>;
62
- get DocumentFileInHTML(): Promise<MediasModel>;
63
- get DocumentFileInPDF(): Promise<MediasModel>;
64
- init(params: IDocumentAttr): void;
65
- generateInvoice(userId?: string, customer?: FinanceCustomerBase): Promise<{
66
- HTMLMedia: MediasModel;
67
- PDFMedia: MediasModel;
68
- }>;
69
- generateReceipt(userId?: string, customer?: FinanceCustomerBase): Promise<{
70
- HTMLMedia: MediasModel;
71
- PDFMedia: MediasModel;
72
- }>;
73
- generateCreditNote(userId?: string, customer?: FinanceCustomerBase): Promise<void>;
74
- newDocumentItem(documentItem?: DocumentItem): Promise<DocumentItem>;
75
- getPreviousDocument(docType: DocType): Promise<DocumentModel>;
76
- }
1
+ /// <reference types="multer" />
2
+ import { CommonService as MediaCommonService, MediasModel } from '@tomei/media';
3
+ import { DocumentStatus, DocType } from '../enum';
4
+ import { IDocumentAttr } from './interfaces/document-attr.interface';
5
+ import DocumentItem from './document-item';
6
+ import { AccountSystemEntity } from '../account-system-entity/account-system-entity';
7
+ import { DocumentRepository } from './document.repository';
8
+ import FinanceCustomerBase from '../customer/customer';
9
+ import DocumentModel from '../models/document.entity';
10
+ export default class Document extends AccountSystemEntity {
11
+ DocNo: string;
12
+ private _DocType;
13
+ private _DocDate;
14
+ Currency: string;
15
+ private _Amount;
16
+ Description: string;
17
+ private _Status;
18
+ IssuedById: string;
19
+ IssuedToId: string;
20
+ IssuedToType: string;
21
+ RelatedObjectId: string;
22
+ RelatedObjectType: string;
23
+ CreatedById: string;
24
+ CreatedAt: Date;
25
+ UpdatedById: string;
26
+ UpdatedAt: Date;
27
+ UseAccSystemDocYN: string;
28
+ private _DocHTMLFileMediaId;
29
+ private _DocPDFFileMediaId;
30
+ private static _RepositoryBase;
31
+ private static _DocumentItemRepository;
32
+ private _DbTransaction;
33
+ private _IsNewRecord;
34
+ private _DocumentItems;
35
+ private static _MediaRepository;
36
+ mediaCommonService: MediaCommonService;
37
+ private get IsNewRecord();
38
+ private set IsNewRecord(value);
39
+ get DocType(): DocType;
40
+ set DocType(docType: DocType);
41
+ get DocDate(): Date;
42
+ set DocDate(date: Date);
43
+ get DocHTMLFileMediaId(): string;
44
+ set DocHTMLFileMediaId(mediaId: string);
45
+ get DocPDFFileMediaId(): string;
46
+ set DocPDFFileMediaId(mediaId: string);
47
+ get Amount(): number;
48
+ private set Amount(value);
49
+ get Status(): DocumentStatus;
50
+ private set Status(value);
51
+ get RepositoryBase(): DocumentRepository;
52
+ get ObjectId(): string;
53
+ get ObjectName(): string;
54
+ get TableName(): string;
55
+ constructor(dbTransaction?: any, docNo?: string);
56
+ static initDocument(dbTransaction: any, docNo: string): Promise<Document>;
57
+ reCalculateAmount(): Promise<void>;
58
+ get DocumentItems(): Promise<DocumentItem[]>;
59
+ static DEFAULT_INVOICE_TEMPLATE_HTML(): Promise<Express.Multer.File>;
60
+ DEFAULT_INVOICE_TEMPLATE_PDF(customer: FinanceCustomerBase): Promise<Express.Multer.File>;
61
+ DEFAULT_RECEIPT_TEMPLATE_PDF(customer: FinanceCustomerBase): Promise<Express.Multer.File>;
62
+ get DocumentFileInHTML(): Promise<MediasModel>;
63
+ get DocumentFileInPDF(): Promise<MediasModel>;
64
+ init(params: IDocumentAttr): void;
65
+ generateInvoice(userId?: string, customer?: FinanceCustomerBase): Promise<{
66
+ HTMLMedia: MediasModel;
67
+ PDFMedia: MediasModel;
68
+ }>;
69
+ generateReceipt(userId?: string, customer?: FinanceCustomerBase): Promise<{
70
+ HTMLMedia: MediasModel;
71
+ PDFMedia: MediasModel;
72
+ }>;
73
+ generateCreditNote(userId?: string, customer?: FinanceCustomerBase): Promise<void>;
74
+ newDocumentItem(documentItem?: DocumentItem): Promise<DocumentItem>;
75
+ getPreviousDocument(docType: DocType): Promise<DocumentModel>;
76
+ }