@tomei/finance 0.6.99 → 0.6.102

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 (223) hide show
  1. package/.husky/commit-msg +12 -3
  2. package/.husky/pre-commit +4 -4
  3. package/configs/config.js +1 -1
  4. package/dist/account/account.d.ts +37 -37
  5. package/dist/account/account.js +251 -263
  6. package/dist/account/account.js.map +1 -1
  7. package/dist/account/account.repository.d.ts +5 -5
  8. package/dist/account/account.repository.js +11 -11
  9. package/dist/account/interfaces/account-attr.interface.d.ts +29 -29
  10. package/dist/account/interfaces/account-attr.interface.js +2 -2
  11. package/dist/account-system-entity/account-system-entity.d.ts +12 -12
  12. package/dist/account-system-entity/account-system-entity.js +55 -66
  13. package/dist/account-system-entity/account-system-entity.js.map +1 -1
  14. package/dist/account-system-entity/post-history.repository.d.ts +5 -5
  15. package/dist/account-system-entity/post-history.repository.js +11 -11
  16. package/dist/config.d.ts +1888 -1888
  17. package/dist/config.js +331 -331
  18. package/dist/config.js.map +1 -1
  19. package/dist/customer/customer.d.ts +44 -44
  20. package/dist/customer/customer.js +212 -234
  21. package/dist/customer/customer.js.map +1 -1
  22. package/dist/customer/finance-customer.repository.d.ts +5 -5
  23. package/dist/customer/finance-customer.repository.js +25 -25
  24. package/dist/customer/finance-customer.repository.js.map +1 -1
  25. package/dist/customer/interfaces/customer.repository.interface.d.ts +3 -3
  26. package/dist/customer/interfaces/customer.repository.interface.js +2 -2
  27. package/dist/customer/interfaces/finance-customer-attr.interface.d.ts +10 -10
  28. package/dist/customer/interfaces/finance-customer-attr.interface.js +2 -2
  29. package/dist/customer/interfaces/finance-customer.repository.interface.d.ts +3 -3
  30. package/dist/customer/interfaces/finance-customer.repository.interface.js +2 -2
  31. package/dist/database.d.ts +4 -4
  32. package/dist/database.js +46 -47
  33. package/dist/database.js.map +1 -1
  34. package/dist/document/document-item.d.ts +46 -46
  35. package/dist/document/document-item.js +122 -132
  36. package/dist/document/document-item.js.map +1 -1
  37. package/dist/document/document-item.repository.d.ts +5 -5
  38. package/dist/document/document-item.repository.js +11 -11
  39. package/dist/document/document.d.ts +87 -88
  40. package/dist/document/document.js +735 -766
  41. package/dist/document/document.js.map +1 -1
  42. package/dist/document/document.repository.d.ts +5 -5
  43. package/dist/document/document.repository.js +11 -11
  44. package/dist/document/interfaces/document-attr.interface.d.ts +27 -27
  45. package/dist/document/interfaces/document-attr.interface.js +6 -6
  46. package/dist/document/interfaces/document-find-all.interface.d.ts +13 -13
  47. package/dist/document/interfaces/document-find-all.interface.js +2 -2
  48. package/dist/document/interfaces/document-item-attr.interface.d.ts +26 -26
  49. package/dist/document/interfaces/document-item-attr.interface.js +6 -6
  50. package/dist/document/interfaces/document-item.repository.interface.d.ts +3 -3
  51. package/dist/document/interfaces/document-item.repository.interface.js +2 -2
  52. package/dist/enum/collect-payment-type.d.ts +4 -4
  53. package/dist/enum/collect-payment-type.js +8 -8
  54. package/dist/enum/collect-payment-type.js.map +1 -1
  55. package/dist/enum/doc-type.enum.d.ts +8 -8
  56. package/dist/enum/doc-type.enum.js +12 -12
  57. package/dist/enum/doc-type.enum.js.map +1 -1
  58. package/dist/enum/document-status.enum.d.ts +6 -6
  59. package/dist/enum/document-status.enum.js +10 -10
  60. package/dist/enum/document-status.enum.js.map +1 -1
  61. package/dist/enum/index.d.ts +9 -9
  62. package/dist/enum/index.js +19 -19
  63. package/dist/enum/payment-method.enum.d.ts +3 -3
  64. package/dist/enum/payment-method.enum.js +7 -7
  65. package/dist/enum/payment-method.enum.js.map +1 -1
  66. package/dist/enum/payment-status.enum.d.ts +10 -10
  67. package/dist/enum/payment-status.enum.js +15 -16
  68. package/dist/enum/payment-status.enum.js.map +1 -1
  69. package/dist/enum/payment-type.enum.d.ts +4 -4
  70. package/dist/enum/payment-type.enum.js +8 -8
  71. package/dist/enum/payment-type.enum.js.map +1 -1
  72. package/dist/enum/quick-book-client-scopes.enum.d.ts +13 -13
  73. package/dist/enum/quick-book-client-scopes.enum.js +18 -18
  74. package/dist/enum/quick-book-client-scopes.enum.js.map +1 -1
  75. package/dist/enum/transaction-type.enum.d.ts +4 -4
  76. package/dist/enum/transaction-type.enum.js +8 -8
  77. package/dist/enum/transaction-type.enum.js.map +1 -1
  78. package/dist/finance-company/finance-company.d.ts +88 -88
  79. package/dist/finance-company/finance-company.js +1533 -1576
  80. package/dist/finance-company/finance-company.js.map +1 -1
  81. package/dist/finance-company/finance-company.repository.d.ts +5 -5
  82. package/dist/finance-company/finance-company.repository.js +11 -11
  83. package/dist/helpers/login-user.d.ts +13 -13
  84. package/dist/helpers/login-user.js +28 -28
  85. package/dist/helpers/login-user.js.map +1 -1
  86. package/dist/helpers/typeof.d.ts +1 -1
  87. package/dist/helpers/typeof.js +28 -29
  88. package/dist/helpers/typeof.js.map +1 -1
  89. package/dist/index.d.ts +17 -17
  90. package/dist/index.js +32 -32
  91. package/dist/interfaces/account-system.interface.d.ts +30 -30
  92. package/dist/interfaces/account-system.interface.js +2 -2
  93. package/dist/interfaces/index.d.ts +2 -2
  94. package/dist/interfaces/index.js +2 -2
  95. package/dist/journal-entry/interfaces/journal-entry-attr.interface.d.ts +12 -12
  96. package/dist/journal-entry/interfaces/journal-entry-attr.interface.js +2 -2
  97. package/dist/journal-entry/journal-entry.d.ts +42 -42
  98. package/dist/journal-entry/journal-entry.js +216 -233
  99. package/dist/journal-entry/journal-entry.js.map +1 -1
  100. package/dist/journal-entry/journal-entry.repository.d.ts +6 -6
  101. package/dist/journal-entry/journal-entry.repository.js +16 -27
  102. package/dist/journal-entry/journal-entry.repository.js.map +1 -1
  103. package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts +17 -17
  104. package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.js +2 -2
  105. package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.d.ts +5 -5
  106. package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.js +2 -2
  107. package/dist/ledger-transaction/ledger-transaction.d.ts +54 -54
  108. package/dist/ledger-transaction/ledger-transaction.js +143 -164
  109. package/dist/ledger-transaction/ledger-transaction.js.map +1 -1
  110. package/dist/ledger-transaction/ledger-transaction.repository.d.ts +6 -6
  111. package/dist/ledger-transaction/ledger-transaction.repository.js +16 -27
  112. package/dist/ledger-transaction/ledger-transaction.repository.js.map +1 -1
  113. package/dist/models/account.entity.d.ts +30 -30
  114. package/dist/models/account.entity.js +232 -232
  115. package/dist/models/account.entity.js.map +1 -1
  116. package/dist/models/customer.entity.d.ts +13 -13
  117. package/dist/models/customer.entity.js +109 -109
  118. package/dist/models/customer.entity.js.map +1 -1
  119. package/dist/models/document-item.entity.d.ts +31 -31
  120. package/dist/models/document-item.entity.js +200 -200
  121. package/dist/models/document-item.entity.js.map +1 -1
  122. package/dist/models/document.entity.d.ts +36 -36
  123. package/dist/models/document.entity.js +242 -242
  124. package/dist/models/document.entity.js.map +1 -1
  125. package/dist/models/finance-company.entity.d.ts +15 -15
  126. package/dist/models/finance-company.entity.js +93 -93
  127. package/dist/models/finance-company.entity.js.map +1 -1
  128. package/dist/models/journal-entry.entity.d.ts +16 -16
  129. package/dist/models/journal-entry.entity.js +127 -127
  130. package/dist/models/journal-entry.entity.js.map +1 -1
  131. package/dist/models/ledger-transaction.entity.d.ts +24 -24
  132. package/dist/models/ledger-transaction.entity.js +172 -172
  133. package/dist/models/ledger-transaction.entity.js.map +1 -1
  134. package/dist/models/payment-item.entity.d.ts +12 -12
  135. package/dist/models/payment-item.entity.js +75 -75
  136. package/dist/models/payment-item.entity.js.map +1 -1
  137. package/dist/models/payment-method-type.entity.d.ts +13 -13
  138. package/dist/models/payment-method-type.entity.js +85 -85
  139. package/dist/models/payment-method-type.entity.js.map +1 -1
  140. package/dist/models/payment-method.entity.d.ts +10 -10
  141. package/dist/models/payment-method.entity.js +62 -62
  142. package/dist/models/payment-method.entity.js.map +1 -1
  143. package/dist/models/payment-paid-with.entity.d.ts +24 -24
  144. package/dist/models/payment-paid-with.entity.js +158 -158
  145. package/dist/models/payment-paid-with.entity.js.map +1 -1
  146. package/dist/models/payment.entity.d.ts +29 -29
  147. package/dist/models/payment.entity.js +193 -193
  148. package/dist/models/payment.entity.js.map +1 -1
  149. package/dist/models/post-history.entity.d.ts +11 -11
  150. package/dist/models/post-history.entity.js +63 -63
  151. package/dist/models/post-history.entity.js.map +1 -1
  152. package/dist/models/tax.entity.d.ts +13 -13
  153. package/dist/models/tax.entity.js +89 -89
  154. package/dist/models/tax.entity.js.map +1 -1
  155. package/dist/payment/interfaces/payment-attr.interface.d.ts +22 -22
  156. package/dist/payment/interfaces/payment-attr.interface.js +6 -6
  157. package/dist/payment/interfaces/payment-params.interface.d.ts +7 -7
  158. package/dist/payment/interfaces/payment-params.interface.js +2 -2
  159. package/dist/payment/payment.d.ts +53 -53
  160. package/dist/payment/payment.js +186 -201
  161. package/dist/payment/payment.js.map +1 -1
  162. package/dist/payment/payment.repository.d.ts +5 -5
  163. package/dist/payment/payment.repository.js +11 -11
  164. package/dist/payment-item/interfaces/payment-item-attr.interface.d.ts +10 -10
  165. package/dist/payment-item/interfaces/payment-item-attr.interface.js +6 -6
  166. package/dist/payment-item/payment-item.d.ts +25 -25
  167. package/dist/payment-item/payment-item.js +111 -122
  168. package/dist/payment-item/payment-item.js.map +1 -1
  169. package/dist/payment-item/payment-item.repository.d.ts +5 -5
  170. package/dist/payment-item/payment-item.repository.js +11 -11
  171. package/dist/payment-method/interfaces/payment-method-attr.interface.d.ts +5 -5
  172. package/dist/payment-method/interfaces/payment-method-attr.interface.js +2 -2
  173. package/dist/payment-method/payment-method.d.ts +21 -21
  174. package/dist/payment-method/payment-method.js +104 -117
  175. package/dist/payment-method/payment-method.js.map +1 -1
  176. package/dist/payment-method/payment-method.repository.d.ts +5 -5
  177. package/dist/payment-method/payment-method.repository.js +11 -11
  178. package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.d.ts +8 -8
  179. package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.js +2 -2
  180. package/dist/payment-method-type/payment-method-type.d.ts +18 -18
  181. package/dist/payment-method-type/payment-method-type.js +65 -76
  182. package/dist/payment-method-type/payment-method-type.js.map +1 -1
  183. package/dist/payment-method-type/payment-method-type.repository.d.ts +5 -5
  184. package/dist/payment-method-type/payment-method-type.repository.js +11 -11
  185. package/dist/payment-paid-with/interfaces/payment-paid-with.interface.d.ts +19 -19
  186. package/dist/payment-paid-with/interfaces/payment-paid-with.interface.js +6 -6
  187. package/dist/payment-paid-with/payment-paid-with.d.ts +33 -33
  188. package/dist/payment-paid-with/payment-paid-with.js +56 -56
  189. package/dist/payment-paid-with/payment-paid-with.js.map +1 -1
  190. package/dist/payment-paid-with/payment-paid-with.repository.d.ts +5 -5
  191. package/dist/payment-paid-with/payment-paid-with.repository.js +11 -11
  192. package/dist/tax/interfaces/tax-attr.interface.d.ts +10 -10
  193. package/dist/tax/interfaces/tax-attr.interface.js +2 -2
  194. package/dist/tax/tax.d.ts +26 -26
  195. package/dist/tax/tax.js +51 -51
  196. package/dist/tax/tax.js.map +1 -1
  197. package/dist/tax/tax.repository.d.ts +5 -5
  198. package/dist/tax/tax.repository.js +11 -11
  199. package/dist/test-document.d.ts +3 -3
  200. package/dist/test-document.js +18 -18
  201. package/dist/test.d.ts +1 -1
  202. package/dist/test.js +6 -7
  203. package/dist/test.js.map +1 -1
  204. package/dist/tsconfig.tsbuildinfo +1 -1
  205. package/eslint.config.mjs +58 -0
  206. package/invoice-template/assets/js/html2canvas.min.js +16 -16
  207. package/package.json +35 -41
  208. package/src/account/account.ts +2 -1
  209. package/src/customer/customer.ts +8 -7
  210. package/src/document/document-item.ts +3 -2
  211. package/src/document/document.ts +20 -13
  212. package/src/enum/collect-payment-type.ts +3 -3
  213. package/src/enum/payment-status.enum.ts +1 -1
  214. package/src/finance-company/finance-company.ts +5 -7
  215. package/src/journal-entry/journal-entry.ts +0 -1
  216. package/src/ledger-transaction/ledger-transaction.ts +4 -4
  217. package/src/payment-method-type/payment-method-type.ts +1 -1
  218. package/src/tax/tax.ts +0 -1
  219. package/tsconfig.json +4 -3
  220. package/.eslintrc.js +0 -72
  221. package/img.png +0 -0
  222. package/img_1.png +0 -0
  223. package/tslint.json +0 -18
@@ -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=account-system.interface.js.map
@@ -1,2 +1,2 @@
1
- import { IAccountSystem } from '../interfaces/account-system.interface';
2
- export { IAccountSystem };
1
+ import { IAccountSystem } from '../interfaces/account-system.interface';
2
+ export { IAccountSystem };
@@ -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=index.js.map
@@ -1,12 +1,12 @@
1
- export interface IJournalEntryAttr {
2
- CompanyId?: string;
3
- JournalEntryId?: string;
4
- Date?: Date;
5
- Name?: string;
6
- Description?: string;
7
- AccSystemRefId?: string;
8
- PostedToAccSystemYN?: string;
9
- PostedById?: string;
10
- PostedDateTime?: Date;
11
- dbTransaction?: any;
12
- }
1
+ export interface IJournalEntryAttr {
2
+ CompanyId?: string;
3
+ JournalEntryId?: string;
4
+ Date?: Date;
5
+ Name?: string;
6
+ Description?: string;
7
+ AccSystemRefId?: string;
8
+ PostedToAccSystemYN?: string;
9
+ PostedById?: string;
10
+ PostedDateTime?: Date;
11
+ dbTransaction?: any;
12
+ }
@@ -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=journal-entry-attr.interface.js.map
@@ -1,42 +1,42 @@
1
- import { IJournalEntryAttr } from './interfaces/journal-entry-attr.interface';
2
- import { TransactionTypeOptions } from '../enum';
3
- import JournalEntryModel from '../models/journal-entry.entity';
4
- import { AccountSystemEntity } from '../account-system-entity/account-system-entity';
5
- import LedgerTransaction from '../ledger-transaction/ledger-transaction';
6
- import { JournalEntryRepository } from './journal-entry.repository';
7
- export default class JournalEntry extends AccountSystemEntity {
8
- private _JournalEntryId;
9
- Date: Date;
10
- Name: string;
11
- Description: string;
12
- protected _ObjectType: 'JournalEntry';
13
- private static _RepositoryBase;
14
- private static _LedgerTransactionRepository;
15
- private _DbTransaction;
16
- private _DebitTransactions;
17
- private _CreditTransactions;
18
- get JournalEntryId(): string;
19
- private set JournalEntryId(value);
20
- get ObjectType(): "JournalEntry";
21
- get RepositoryBase(): JournalEntryRepository;
22
- get TableName(): string;
23
- get ObjectName(): string;
24
- get ObjectId(): string;
25
- constructor(dbTransaction?: any, journalEntryId?: string);
26
- static initJournalEntry(dbTransaction?: any, journalEntryId?: string): Promise<JournalEntry>;
27
- get DebitTransactions(): Promise<LedgerTransaction[]>;
28
- get CreditTransactions(): Promise<LedgerTransaction[]>;
29
- init(params: IJournalEntryAttr): void;
30
- getData(): {
31
- JournalEntryId: string;
32
- Date: Date;
33
- Name: string;
34
- Description: string;
35
- PostedById: string;
36
- PostedToAccSystemYN: string;
37
- PostedDateTime: Date;
38
- };
39
- create(dbTransaction?: any): Promise<JournalEntryModel>;
40
- save(userId: string, dbTransaction?: any): Promise<JournalEntryModel>;
41
- newLedgerTransaction(transactionType: TransactionTypeOptions): Promise<LedgerTransaction>;
42
- }
1
+ import { IJournalEntryAttr } from './interfaces/journal-entry-attr.interface';
2
+ import { TransactionTypeOptions } from '../enum';
3
+ import JournalEntryModel from '../models/journal-entry.entity';
4
+ import { AccountSystemEntity } from '../account-system-entity/account-system-entity';
5
+ import LedgerTransaction from '../ledger-transaction/ledger-transaction';
6
+ import { JournalEntryRepository } from './journal-entry.repository';
7
+ export default class JournalEntry extends AccountSystemEntity {
8
+ private _JournalEntryId;
9
+ Date: Date;
10
+ Name: string;
11
+ Description: string;
12
+ protected _ObjectType: 'JournalEntry';
13
+ private static _RepositoryBase;
14
+ private static _LedgerTransactionRepository;
15
+ private _DbTransaction;
16
+ private _DebitTransactions;
17
+ private _CreditTransactions;
18
+ get JournalEntryId(): string;
19
+ private set JournalEntryId(value);
20
+ get ObjectType(): "JournalEntry";
21
+ get RepositoryBase(): JournalEntryRepository;
22
+ get TableName(): string;
23
+ get ObjectName(): string;
24
+ get ObjectId(): string;
25
+ constructor(dbTransaction?: any, journalEntryId?: string);
26
+ static initJournalEntry(dbTransaction?: any, journalEntryId?: string): Promise<JournalEntry>;
27
+ get DebitTransactions(): Promise<LedgerTransaction[]>;
28
+ get CreditTransactions(): Promise<LedgerTransaction[]>;
29
+ init(params: IJournalEntryAttr): void;
30
+ getData(): {
31
+ JournalEntryId: string;
32
+ Date: Date;
33
+ Name: string;
34
+ Description: string;
35
+ PostedById: string;
36
+ PostedToAccSystemYN: string;
37
+ PostedDateTime: Date;
38
+ };
39
+ create(dbTransaction?: any): Promise<JournalEntryModel>;
40
+ save(userId: string, dbTransaction?: any): Promise<JournalEntryModel>;
41
+ newLedgerTransaction(transactionType: TransactionTypeOptions): Promise<LedgerTransaction>;
42
+ }
@@ -1,234 +1,217 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const enum_1 = require("../enum");
13
- const account_system_entity_1 = require("../account-system-entity/account-system-entity");
14
- const ledger_transaction_repository_1 = require("../ledger-transaction/ledger-transaction.repository");
15
- const ledger_transaction_1 = require("../ledger-transaction/ledger-transaction");
16
- const journal_entry_repository_1 = require("./journal-entry.repository");
17
- const record_not_found_error_1 = require("@tomei/general/dist/class/exceptions/record-not-found.error");
18
- class JournalEntry extends account_system_entity_1.AccountSystemEntity {
19
- get JournalEntryId() {
20
- return this._JournalEntryId;
21
- }
22
- set JournalEntryId(id) {
23
- this._JournalEntryId = id;
24
- }
25
- get ObjectType() {
26
- return this._ObjectType;
27
- }
28
- get RepositoryBase() {
29
- return JournalEntry._RepositoryBase;
30
- }
31
- get TableName() {
32
- return 'finance_JournalEntry';
33
- }
34
- get ObjectName() {
35
- return this.Name;
36
- }
37
- get ObjectId() {
38
- return this._JournalEntryId;
39
- }
40
- constructor(dbTransaction, journalEntryId) {
41
- super();
42
- this._JournalEntryId = 'New';
43
- this.Date = new Date();
44
- this.Name = '';
45
- this.Description = '';
46
- this._DebitTransactions = [];
47
- this._CreditTransactions = [];
48
- if (dbTransaction) {
49
- this._DbTransaction = dbTransaction;
50
- }
51
- if (!journalEntryId) {
52
- this.init({
53
- JournalEntryId: 'New',
54
- CompanyId: '',
55
- Date: new Date(),
56
- Name: '',
57
- Description: '',
58
- AccSystemRefId: '',
59
- PostedToAccSystemYN: 'N',
60
- PostedById: '',
61
- PostedDateTime: null,
62
- });
63
- }
64
- }
65
- static initJournalEntry(dbTransaction, journalEntryId) {
66
- return __awaiter(this, void 0, void 0, function* () {
67
- try {
68
- if (journalEntryId) {
69
- const journalEntryData = yield JournalEntry._RepositoryBase.findOne({
70
- where: {
71
- JournalEntryId: journalEntryId,
72
- },
73
- transaction: dbTransaction,
74
- });
75
- if (journalEntryData) {
76
- const journalEntry = new JournalEntry();
77
- journalEntry.init({
78
- JournalEntryId: journalEntryData.JournalEntryId,
79
- CompanyId: journalEntryData.CompanyId,
80
- Date: new Date(),
81
- Name: journalEntryData.Name,
82
- Description: journalEntryData.Description,
83
- AccSystemRefId: journalEntryData.AccSystemRefId,
84
- PostedToAccSystemYN: journalEntryData.PostedToAccSystemYN,
85
- PostedById: journalEntryData.PostedById,
86
- PostedDateTime: journalEntryData.PostedDateTime,
87
- });
88
- return journalEntry;
89
- }
90
- else {
91
- const notFoundError = new record_not_found_error_1.RecordNotFoundError('JournalEntryErrMsg', 'No Record Found.');
92
- throw notFoundError;
93
- }
94
- }
95
- else {
96
- const journalEntry = new JournalEntry(dbTransaction);
97
- return journalEntry;
98
- }
99
- }
100
- catch (error) {
101
- throw error;
102
- }
103
- });
104
- }
105
- get DebitTransactions() {
106
- return new Promise((resolve, reject) => {
107
- if (this.JournalEntryId !== 'New') {
108
- JournalEntry._LedgerTransactionRepository
109
- .findAll({
110
- where: {
111
- TransactionType: enum_1.TransactionTypeOptions.DEBIT,
112
- },
113
- transaction: this._DbTransaction,
114
- })
115
- .then((debitTransactions) => {
116
- const debitTransactionObjects = debitTransactions.map((debitTransactionData) => new ledger_transaction_1.default(this._DbTransaction, debitTransactionData.LedgerNo));
117
- return Promise.all(debitTransactionObjects);
118
- })
119
- .then((debitTransactionObjects) => {
120
- this._DebitTransactions = debitTransactionObjects;
121
- resolve(this._DebitTransactions);
122
- })
123
- .catch((err) => {
124
- reject(err);
125
- });
126
- }
127
- else {
128
- resolve(this._DebitTransactions);
129
- }
130
- });
131
- }
132
- get CreditTransactions() {
133
- return new Promise((resolve, reject) => {
134
- if (this.JournalEntryId !== 'New') {
135
- JournalEntry._LedgerTransactionRepository
136
- .findAll({
137
- where: {
138
- TransactionType: enum_1.TransactionTypeOptions.CREDIT,
139
- },
140
- transaction: this._DbTransaction,
141
- })
142
- .then((creditTransaction) => {
143
- const creditTransactionObjects = creditTransaction.map((creditTransactionData) => new ledger_transaction_1.default(this._DbTransaction, creditTransactionData.LedgerNo));
144
- return Promise.all(creditTransactionObjects);
145
- })
146
- .then((creditTransactionObjects) => {
147
- this._CreditTransactions = creditTransactionObjects;
148
- resolve(this._CreditTransactions);
149
- })
150
- .catch((err) => {
151
- reject(err);
152
- });
153
- }
154
- else {
155
- resolve(this._CreditTransactions);
156
- }
157
- });
158
- }
159
- init(params) {
160
- if (params.JournalEntryId)
161
- this.JournalEntryId = params.JournalEntryId;
162
- if (params.CompanyId)
163
- this.CompanyId = params.CompanyId;
164
- if (params.Date)
165
- this.Date = params.Date;
166
- if (params.Name)
167
- this.Name = params.Name;
168
- if (params.Description)
169
- this.Description = params.Description;
170
- if (params.PostedById)
171
- this.PostedById = params.PostedById;
172
- if (params.PostedToAccSystemYN)
173
- this.PostedToAccSystemYN = params.PostedToAccSystemYN;
174
- if (params.PostedDateTime)
175
- this.PostedDateTime = params.PostedDateTime;
176
- }
177
- getData() {
178
- return {
179
- JournalEntryId: this.JournalEntryId,
180
- Date: this.Date,
181
- Name: this.Name,
182
- Description: this.Description,
183
- PostedById: this.PostedById,
184
- PostedToAccSystemYN: this.PostedToAccSystemYN,
185
- PostedDateTime: this.PostedDateTime,
186
- };
187
- }
188
- create(dbTransaction) {
189
- return __awaiter(this, void 0, void 0, function* () {
190
- return yield this.RepositoryBase.create(this.getData, {
191
- transaction: dbTransaction,
192
- });
193
- });
194
- }
195
- save(userId, dbTransaction) {
196
- return __awaiter(this, void 0, void 0, function* () {
197
- try {
198
- const count = yield this.RepositoryBase.count(dbTransaction);
199
- this.JournalEntryId = `${count + 1}`;
200
- const data = yield this.RepositoryBase.create({
201
- JournalEntryId: this.JournalEntryId,
202
- CompanyId: this.CompanyId,
203
- Date: this.Date,
204
- Name: this.Name,
205
- Description: this.Description,
206
- PostedById: this.PostedToAccSystemYN == 'Y' ? userId : null,
207
- PostedToAccSystemYN: this.PostedToAccSystemYN,
208
- PostedDateTime: this.PostedToAccSystemYN == 'Y' ? this.PostedDateTime : null,
209
- }, { transaction: dbTransaction });
210
- return data;
211
- }
212
- catch (error) {
213
- throw error;
214
- }
215
- });
216
- }
217
- newLedgerTransaction(transactionType) {
218
- return __awaiter(this, void 0, void 0, function* () {
219
- const ledgerTransaction = new ledger_transaction_1.default(transactionType, this._DbTransaction);
220
- ledgerTransaction.JournalEntryId = this.JournalEntryId;
221
- if (transactionType === enum_1.TransactionTypeOptions.DEBIT) {
222
- this._DebitTransactions.push(ledgerTransaction);
223
- }
224
- else if (transactionType === enum_1.TransactionTypeOptions.CREDIT) {
225
- this._CreditTransactions.push(ledgerTransaction);
226
- }
227
- return ledgerTransaction;
228
- });
229
- }
230
- }
231
- exports.default = JournalEntry;
232
- JournalEntry._RepositoryBase = new journal_entry_repository_1.JournalEntryRepository();
233
- JournalEntry._LedgerTransactionRepository = new ledger_transaction_repository_1.LedgerTransactionRepository();
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const enum_1 = require("../enum");
4
+ const account_system_entity_1 = require("../account-system-entity/account-system-entity");
5
+ const ledger_transaction_repository_1 = require("../ledger-transaction/ledger-transaction.repository");
6
+ const ledger_transaction_1 = require("../ledger-transaction/ledger-transaction");
7
+ const journal_entry_repository_1 = require("./journal-entry.repository");
8
+ const record_not_found_error_1 = require("@tomei/general/dist/class/exceptions/record-not-found.error");
9
+ class JournalEntry extends account_system_entity_1.AccountSystemEntity {
10
+ get JournalEntryId() {
11
+ return this._JournalEntryId;
12
+ }
13
+ set JournalEntryId(id) {
14
+ this._JournalEntryId = id;
15
+ }
16
+ get ObjectType() {
17
+ return this._ObjectType;
18
+ }
19
+ get RepositoryBase() {
20
+ return JournalEntry._RepositoryBase;
21
+ }
22
+ get TableName() {
23
+ return 'finance_JournalEntry';
24
+ }
25
+ get ObjectName() {
26
+ return this.Name;
27
+ }
28
+ get ObjectId() {
29
+ return this._JournalEntryId;
30
+ }
31
+ constructor(dbTransaction, journalEntryId) {
32
+ super();
33
+ this._JournalEntryId = 'New';
34
+ this.Date = new Date();
35
+ this.Name = '';
36
+ this.Description = '';
37
+ this._DebitTransactions = [];
38
+ this._CreditTransactions = [];
39
+ if (dbTransaction) {
40
+ this._DbTransaction = dbTransaction;
41
+ }
42
+ if (!journalEntryId) {
43
+ this.init({
44
+ JournalEntryId: 'New',
45
+ CompanyId: '',
46
+ Date: new Date(),
47
+ Name: '',
48
+ Description: '',
49
+ AccSystemRefId: '',
50
+ PostedToAccSystemYN: 'N',
51
+ PostedById: '',
52
+ PostedDateTime: null,
53
+ });
54
+ }
55
+ }
56
+ static async initJournalEntry(dbTransaction, journalEntryId) {
57
+ try {
58
+ if (journalEntryId) {
59
+ const journalEntryData = await JournalEntry._RepositoryBase.findOne({
60
+ where: {
61
+ JournalEntryId: journalEntryId,
62
+ },
63
+ transaction: dbTransaction,
64
+ });
65
+ if (journalEntryData) {
66
+ const journalEntry = new JournalEntry();
67
+ journalEntry.init({
68
+ JournalEntryId: journalEntryData.JournalEntryId,
69
+ CompanyId: journalEntryData.CompanyId,
70
+ Date: new Date(),
71
+ Name: journalEntryData.Name,
72
+ Description: journalEntryData.Description,
73
+ AccSystemRefId: journalEntryData.AccSystemRefId,
74
+ PostedToAccSystemYN: journalEntryData.PostedToAccSystemYN,
75
+ PostedById: journalEntryData.PostedById,
76
+ PostedDateTime: journalEntryData.PostedDateTime,
77
+ });
78
+ return journalEntry;
79
+ }
80
+ else {
81
+ const notFoundError = new record_not_found_error_1.RecordNotFoundError('JournalEntryErrMsg', 'No Record Found.');
82
+ throw notFoundError;
83
+ }
84
+ }
85
+ else {
86
+ const journalEntry = new JournalEntry(dbTransaction);
87
+ return journalEntry;
88
+ }
89
+ }
90
+ catch (error) {
91
+ throw error;
92
+ }
93
+ }
94
+ get DebitTransactions() {
95
+ return new Promise((resolve, reject) => {
96
+ if (this.JournalEntryId !== 'New') {
97
+ JournalEntry._LedgerTransactionRepository
98
+ .findAll({
99
+ where: {
100
+ TransactionType: enum_1.TransactionTypeOptions.DEBIT,
101
+ },
102
+ transaction: this._DbTransaction,
103
+ })
104
+ .then((debitTransactions) => {
105
+ const debitTransactionObjects = debitTransactions.map((debitTransactionData) => new ledger_transaction_1.default(this._DbTransaction, debitTransactionData.LedgerNo));
106
+ return Promise.all(debitTransactionObjects);
107
+ })
108
+ .then((debitTransactionObjects) => {
109
+ this._DebitTransactions = debitTransactionObjects;
110
+ resolve(this._DebitTransactions);
111
+ })
112
+ .catch((err) => {
113
+ reject(err);
114
+ });
115
+ }
116
+ else {
117
+ resolve(this._DebitTransactions);
118
+ }
119
+ });
120
+ }
121
+ get CreditTransactions() {
122
+ return new Promise((resolve, reject) => {
123
+ if (this.JournalEntryId !== 'New') {
124
+ JournalEntry._LedgerTransactionRepository
125
+ .findAll({
126
+ where: {
127
+ TransactionType: enum_1.TransactionTypeOptions.CREDIT,
128
+ },
129
+ transaction: this._DbTransaction,
130
+ })
131
+ .then((creditTransaction) => {
132
+ const creditTransactionObjects = creditTransaction.map((creditTransactionData) => new ledger_transaction_1.default(this._DbTransaction, creditTransactionData.LedgerNo));
133
+ return Promise.all(creditTransactionObjects);
134
+ })
135
+ .then((creditTransactionObjects) => {
136
+ this._CreditTransactions = creditTransactionObjects;
137
+ resolve(this._CreditTransactions);
138
+ })
139
+ .catch((err) => {
140
+ reject(err);
141
+ });
142
+ }
143
+ else {
144
+ resolve(this._CreditTransactions);
145
+ }
146
+ });
147
+ }
148
+ init(params) {
149
+ if (params.JournalEntryId)
150
+ this.JournalEntryId = params.JournalEntryId;
151
+ if (params.CompanyId)
152
+ this.CompanyId = params.CompanyId;
153
+ if (params.Date)
154
+ this.Date = params.Date;
155
+ if (params.Name)
156
+ this.Name = params.Name;
157
+ if (params.Description)
158
+ this.Description = params.Description;
159
+ if (params.PostedById)
160
+ this.PostedById = params.PostedById;
161
+ if (params.PostedToAccSystemYN)
162
+ this.PostedToAccSystemYN = params.PostedToAccSystemYN;
163
+ if (params.PostedDateTime)
164
+ this.PostedDateTime = params.PostedDateTime;
165
+ }
166
+ getData() {
167
+ return {
168
+ JournalEntryId: this.JournalEntryId,
169
+ Date: this.Date,
170
+ Name: this.Name,
171
+ Description: this.Description,
172
+ PostedById: this.PostedById,
173
+ PostedToAccSystemYN: this.PostedToAccSystemYN,
174
+ PostedDateTime: this.PostedDateTime,
175
+ };
176
+ }
177
+ async create(dbTransaction) {
178
+ return await this.RepositoryBase.create(this.getData, {
179
+ transaction: dbTransaction,
180
+ });
181
+ }
182
+ async save(userId, dbTransaction) {
183
+ try {
184
+ const count = await this.RepositoryBase.count(dbTransaction);
185
+ this.JournalEntryId = `${count + 1}`;
186
+ const data = await this.RepositoryBase.create({
187
+ JournalEntryId: this.JournalEntryId,
188
+ CompanyId: this.CompanyId,
189
+ Date: this.Date,
190
+ Name: this.Name,
191
+ Description: this.Description,
192
+ PostedById: this.PostedToAccSystemYN == 'Y' ? userId : null,
193
+ PostedToAccSystemYN: this.PostedToAccSystemYN,
194
+ PostedDateTime: this.PostedToAccSystemYN == 'Y' ? this.PostedDateTime : null,
195
+ }, { transaction: dbTransaction });
196
+ return data;
197
+ }
198
+ catch (error) {
199
+ throw error;
200
+ }
201
+ }
202
+ async newLedgerTransaction(transactionType) {
203
+ const ledgerTransaction = new ledger_transaction_1.default(transactionType, this._DbTransaction);
204
+ ledgerTransaction.JournalEntryId = this.JournalEntryId;
205
+ if (transactionType === enum_1.TransactionTypeOptions.DEBIT) {
206
+ this._DebitTransactions.push(ledgerTransaction);
207
+ }
208
+ else if (transactionType === enum_1.TransactionTypeOptions.CREDIT) {
209
+ this._CreditTransactions.push(ledgerTransaction);
210
+ }
211
+ return ledgerTransaction;
212
+ }
213
+ }
214
+ JournalEntry._RepositoryBase = new journal_entry_repository_1.JournalEntryRepository();
215
+ JournalEntry._LedgerTransactionRepository = new ledger_transaction_repository_1.LedgerTransactionRepository();
216
+ exports.default = JournalEntry;
234
217
  //# sourceMappingURL=journal-entry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"journal-entry.js","sourceRoot":"","sources":["../../src/journal-entry/journal-entry.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,kCAAiD;AAEjD,0FAAqF;AACrF,uGAAkG;AAClG,iFAAyE;AACzE,yEAAoE;AACpE,wGAAkG;AAElG,MAAqB,YAAa,SAAQ,2CAAmB;IAe3D,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC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