@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,41 +1,43 @@
1
- import { IAddress, IRepositoryBase, IPerson, LoginUserBase } from '@tomei/general';
2
- import FinanceCustomerModel from '../models/customer.entity';
3
- import { AccountSystemEntity } from '../account-system-entity/account-system-entity';
4
- import { FinanceCustomerRepository } from './finance-customer.repository';
5
- import Account from '../account/account';
6
- export default abstract class FinanceCustomerBase extends AccountSystemEntity implements IPerson {
7
- CustomerId: string;
8
- CustSystemCode: string;
9
- CustSystemRefId: string;
10
- protected abstract ParentARAccountNo: string;
11
- protected abstract ParentAPAccountNo: string;
12
- protected abstract ARAccountNo: string;
13
- protected abstract APAccountNo: string;
14
- abstract FullName: string;
15
- abstract IDNo: string;
16
- abstract IDType: string;
17
- abstract ContactNo: string;
18
- abstract Email: string;
19
- abstract DefaultAddress: IAddress;
20
- private _AccountReceivable;
21
- private _AccountPayable;
22
- protected _DbTransaction: any;
23
- private static _AccountRepository;
24
- getDetails(): Promise<{
25
- FullName: string;
26
- IDNo: string;
27
- IDType: string;
28
- Email: string;
29
- ContactNo: string;
30
- }>;
31
- protected static _FinanceCustomerRepository: FinanceCustomerRepository;
32
- RepositoryBase: IRepositoryBase<any>;
33
- constructor(custSystemRefId?: string, custSystemCode?: string, sFinanceCompanyId?: string);
34
- static initCustomer<C extends FinanceCustomerBase>(this: new () => C, custSystemRefId: string, custSystemCode: string, sFinanceCompanyId: string, dbTransaction?: any): Promise<C>;
35
- get AccountReceivable(): Promise<Account>;
36
- get AccountPayable(): Promise<Account>;
37
- abstract getBillingAddress(params: any): Promise<IAddress>;
38
- init(person: LoginUserBase): void;
39
- save(accSystemRefId: string, custSystemCode: string, custSystemRefId: string, dbTransaction?: any): Promise<FinanceCustomerModel>;
40
- static isFinanceCustomerExist(custSystemRefId: string, custSystemCode: string, sFinanceCompanyId: string): Promise<boolean>;
41
- }
1
+ import { IAddress, IRepositoryBase, IPerson, LoginUserBase } from '@tomei/general';
2
+ import FinanceCustomerModel from '../models/customer.entity';
3
+ import { AccountSystemEntity } from '../account-system-entity/account-system-entity';
4
+ import { FinanceCustomerRepository } from './finance-customer.repository';
5
+ import Account from '../account/account';
6
+ export default abstract class FinanceCustomerBase extends AccountSystemEntity implements IPerson {
7
+ CustomerId: string;
8
+ CustSystemCode: string;
9
+ CustSystemRefId: string;
10
+ protected abstract ParentARAccountNo: string;
11
+ protected abstract ParentAPAccountNo: string;
12
+ protected abstract ARAccountNo: string;
13
+ protected abstract APAccountNo: string;
14
+ abstract FullName: string;
15
+ abstract IDNo: string;
16
+ abstract IDType: string;
17
+ abstract ContactNo: string;
18
+ abstract Email: string;
19
+ abstract DefaultAddress: IAddress;
20
+ private _AccountReceivable;
21
+ private _AccountPayable;
22
+ protected _DbTransaction: any;
23
+ private static _AccountRepository;
24
+ private static _LedgerTransactionRepository;
25
+ getDetails(): Promise<{
26
+ FullName: string;
27
+ IDNo: string;
28
+ IDType: string;
29
+ Email: string;
30
+ ContactNo: string;
31
+ }>;
32
+ protected static _FinanceCustomerRepository: FinanceCustomerRepository;
33
+ RepositoryBase: IRepositoryBase<any>;
34
+ constructor(custSystemRefId?: string, custSystemCode?: string, sFinanceCompanyId?: string);
35
+ static initCustomer<C extends FinanceCustomerBase>(this: new () => C, custSystemRefId: string, custSystemCode: string, sFinanceCompanyId: string, dbTransaction?: any): Promise<C>;
36
+ get AccountReceivable(): Promise<Account>;
37
+ get AccountPayable(): Promise<Account>;
38
+ abstract getBillingAddress(params: any): Promise<IAddress>;
39
+ init(person: LoginUserBase): void;
40
+ save(accSystemRefId: string, custSystemCode: string, custSystemRefId: string, dbTransaction?: any): Promise<FinanceCustomerModel>;
41
+ static isFinanceCustomerExist(custSystemRefId: string, custSystemCode: string, sFinanceCompanyId: string): Promise<boolean>;
42
+ getOutstandingBalance(dbTransaction: any): Promise<number>;
43
+ }
@@ -1,215 +1,237 @@
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 general_1 = require("@tomei/general");
13
- const account_system_entity_1 = require("../account-system-entity/account-system-entity");
14
- const finance_customer_repository_1 = require("./finance-customer.repository");
15
- const cuid = require("cuid");
16
- const account_1 = require("../account/account");
17
- const account_repository_1 = require("../account/account.repository");
18
- const typeof_1 = require("../helpers/typeof");
19
- const FinanceDb = require("../database");
20
- class FinanceCustomerBase extends account_system_entity_1.AccountSystemEntity {
21
- getDetails() {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- return {
24
- FullName: this.FullName,
25
- IDNo: this.IDNo,
26
- IDType: this.IDType,
27
- Email: this.Email,
28
- ContactNo: this.ContactNo,
29
- };
30
- });
31
- }
32
- constructor(custSystemRefId, custSystemCode, sFinanceCompanyId) {
33
- super();
34
- this.CustomerId = 'New';
35
- this.CustSystemCode = '';
36
- this.CustSystemRefId = '';
37
- if (custSystemRefId && custSystemCode && sFinanceCompanyId) {
38
- const financeCustomerData = FinanceCustomerBase._FinanceCustomerRepository.findOne({
39
- where: {
40
- CompanyId: sFinanceCompanyId,
41
- CustSystemCode: custSystemCode,
42
- CustSystemRefId: custSystemRefId,
43
- },
44
- });
45
- if (financeCustomerData) {
46
- this.CompanyId = sFinanceCompanyId;
47
- this.CustSystemCode = custSystemCode;
48
- this.CustSystemRefId = custSystemRefId;
49
- }
50
- else {
51
- const notFoundError = new general_1.RecordNotFoundError('No Record Found');
52
- throw notFoundError;
53
- }
54
- }
55
- }
56
- static initCustomer(custSystemRefId, custSystemCode, sFinanceCompanyId, dbTransaction) {
57
- return __awaiter(this, void 0, void 0, function* () {
58
- if (!dbTransaction) {
59
- dbTransaction = yield FinanceDb.getConnection().transaction();
60
- }
61
- const financeCustomerData = yield FinanceCustomerBase._FinanceCustomerRepository.findOne({
62
- where: {
63
- CompanyId: sFinanceCompanyId,
64
- CustSystemCode: custSystemCode,
65
- CustSystemRefId: custSystemRefId,
66
- },
67
- transaction: dbTransaction,
68
- });
69
- if (financeCustomerData) {
70
- const self = new this();
71
- self._DbTransaction = dbTransaction;
72
- self.CustomerId = financeCustomerData.CustomerId;
73
- self.CompanyId = sFinanceCompanyId;
74
- self.CustSystemCode = custSystemCode;
75
- self.CustSystemRefId = custSystemRefId;
76
- self.AccSystemRefId = financeCustomerData.AccSystemRefId;
77
- self.PostedToAccSystemYN = financeCustomerData.PostedToAccSystemYN;
78
- self.PostedById = financeCustomerData.PostedById;
79
- self.PostedDateTime = financeCustomerData.PostedDateTime;
80
- return self;
81
- }
82
- else {
83
- const notFoundError = new general_1.RecordNotFoundError('No Record Found');
84
- throw notFoundError;
85
- }
86
- });
87
- }
88
- get AccountReceivable() {
89
- return new Promise((resolve, reject) => {
90
- let transaction = this._DbTransaction;
91
- if (this._AccountReceivable) {
92
- resolve(this._AccountReceivable);
93
- }
94
- else {
95
- return (FinanceCustomerBase._AccountRepository
96
- .findOne({
97
- where: {
98
- AccountType: 'Account Receivable',
99
- OwnerId: this.CustomerId,
100
- OwnerType: (0, typeof_1.type)(this),
101
- },
102
- transaction,
103
- })
104
- .then((accountData) => {
105
- this._AccountReceivable = new account_1.default(transaction);
106
- if (accountData) {
107
- this._AccountReceivable.AccountNo = accountData.AccountNo;
108
- this._AccountReceivable.ParentAccountNo =
109
- accountData.ParentAccountNo;
110
- this._AccountReceivable.AccountType = accountData.AccountType;
111
- this._AccountReceivable.OwnerId = accountData.OwnerId;
112
- this._AccountReceivable.OwnerType = accountData.OwnerType;
113
- }
114
- else {
115
- this._AccountReceivable.AccountNo = this.ARAccountNo;
116
- this._AccountReceivable.ParentAccountNo =
117
- this.ParentARAccountNo;
118
- this._AccountReceivable.AccountType = 'Account Receivable';
119
- this._AccountReceivable.OwnerId = this.CustomerId;
120
- this._AccountReceivable.OwnerType = (0, typeof_1.type)(this);
121
- }
122
- resolve(this._AccountReceivable);
123
- })
124
- .catch((err) => {
125
- reject(err);
126
- }));
127
- }
128
- });
129
- }
130
- get AccountPayable() {
131
- return new Promise((resolve, reject) => {
132
- let transaction = this._DbTransaction;
133
- if (this._AccountPayable) {
134
- resolve(this._AccountPayable);
135
- }
136
- else {
137
- return (FinanceCustomerBase._AccountRepository
138
- .findOne({
139
- where: {
140
- AccountType: 'Account Payable',
141
- OwnerId: this.CustomerId,
142
- OwnerType: (0, typeof_1.type)(this),
143
- },
144
- transaction,
145
- })
146
- .then((accountData) => {
147
- this._AccountPayable = new account_1.default(transaction);
148
- if (accountData) {
149
- this._AccountPayable.AccountNo = accountData.AccountNo;
150
- this._AccountPayable.ParentAccountNo =
151
- accountData.ParentAccountNo;
152
- this._AccountPayable.AccountType = accountData.AccountType;
153
- this._AccountPayable.OwnerId = accountData.OwnerId;
154
- this._AccountPayable.OwnerType = accountData.OwnerType;
155
- }
156
- else {
157
- this._AccountPayable.AccountNo = this.APAccountNo;
158
- this._AccountPayable.ParentAccountNo = this.ParentAPAccountNo;
159
- this._AccountPayable.AccountType = 'Account Payable';
160
- this._AccountPayable.OwnerId = this.CustomerId;
161
- this._AccountPayable.OwnerType = (0, typeof_1.type)(this);
162
- }
163
- resolve(this._AccountPayable);
164
- })
165
- .catch((err) => {
166
- reject(err);
167
- }));
168
- }
169
- });
170
- }
171
- init(person) {
172
- this.FullName = person.FullName;
173
- this.IDNo = person.IDNo;
174
- this.IDType = person.IDType;
175
- this.Email = person.Email;
176
- this.ContactNo = person.ContactNo;
177
- this.DefaultAddress = person.DefaultAddress;
178
- }
179
- save(accSystemRefId, custSystemCode, custSystemRefId, dbTransaction) {
180
- return __awaiter(this, void 0, void 0, function* () {
181
- this.CustSystemCode = custSystemCode;
182
- this.CustSystemRefId = custSystemRefId;
183
- this.AccSystemRefId = accSystemRefId;
184
- this.PostedToAccSystemYN = 'Y';
185
- const data = yield FinanceCustomerBase._FinanceCustomerRepository.create({
186
- CompanyId: this.CompanyId,
187
- CustomerId: cuid(),
188
- CustSystemCode: this.CustSystemCode,
189
- CustSystemRefId: this.CustSystemRefId,
190
- AccSystemRefId: this.AccSystemRefId,
191
- PostedToAccSystemYN: this.PostedToAccSystemYN,
192
- }, { transaction: dbTransaction });
193
- return data;
194
- });
195
- }
196
- static isFinanceCustomerExist(custSystemRefId, custSystemCode, sFinanceCompanyId) {
197
- return __awaiter(this, void 0, void 0, function* () {
198
- const data = yield FinanceCustomerBase._FinanceCustomerRepository.findAll({
199
- where: {
200
- CustSystemRefId: custSystemRefId,
201
- CustSystemCode: custSystemCode,
202
- CompanyId: sFinanceCompanyId,
203
- },
204
- });
205
- if (data.length > 0) {
206
- return true;
207
- }
208
- return false;
209
- });
210
- }
211
- }
212
- exports.default = FinanceCustomerBase;
213
- FinanceCustomerBase._AccountRepository = new account_repository_1.AccountRepository();
214
- FinanceCustomerBase._FinanceCustomerRepository = new finance_customer_repository_1.FinanceCustomerRepository();
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 general_1 = require("@tomei/general");
13
+ const account_system_entity_1 = require("../account-system-entity/account-system-entity");
14
+ const finance_customer_repository_1 = require("./finance-customer.repository");
15
+ const cuid = require("cuid");
16
+ const account_1 = require("../account/account");
17
+ const account_repository_1 = require("../account/account.repository");
18
+ const typeof_1 = require("../helpers/typeof");
19
+ const FinanceDb = require("../database");
20
+ const ledger_transaction_repository_1 = require("../ledger-transaction/ledger-transaction.repository");
21
+ class FinanceCustomerBase extends account_system_entity_1.AccountSystemEntity {
22
+ getDetails() {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ return {
25
+ FullName: this.FullName,
26
+ IDNo: this.IDNo,
27
+ IDType: this.IDType,
28
+ Email: this.Email,
29
+ ContactNo: this.ContactNo,
30
+ };
31
+ });
32
+ }
33
+ constructor(custSystemRefId, custSystemCode, sFinanceCompanyId) {
34
+ super();
35
+ this.CustomerId = 'New';
36
+ this.CustSystemCode = '';
37
+ this.CustSystemRefId = '';
38
+ if (custSystemRefId && custSystemCode && sFinanceCompanyId) {
39
+ const financeCustomerData = FinanceCustomerBase._FinanceCustomerRepository.findOne({
40
+ where: {
41
+ CompanyId: sFinanceCompanyId,
42
+ CustSystemCode: custSystemCode,
43
+ CustSystemRefId: custSystemRefId,
44
+ },
45
+ });
46
+ if (financeCustomerData) {
47
+ this.CompanyId = sFinanceCompanyId;
48
+ this.CustSystemCode = custSystemCode;
49
+ this.CustSystemRefId = custSystemRefId;
50
+ }
51
+ else {
52
+ const notFoundError = new general_1.RecordNotFoundError('No Record Found');
53
+ throw notFoundError;
54
+ }
55
+ }
56
+ }
57
+ static initCustomer(custSystemRefId, custSystemCode, sFinanceCompanyId, dbTransaction) {
58
+ return __awaiter(this, void 0, void 0, function* () {
59
+ if (!dbTransaction) {
60
+ dbTransaction = yield FinanceDb.getConnection().transaction();
61
+ }
62
+ const financeCustomerData = yield FinanceCustomerBase._FinanceCustomerRepository.findOne({
63
+ where: {
64
+ CompanyId: sFinanceCompanyId,
65
+ CustSystemCode: custSystemCode,
66
+ CustSystemRefId: custSystemRefId,
67
+ },
68
+ transaction: dbTransaction,
69
+ });
70
+ if (financeCustomerData) {
71
+ const self = new this();
72
+ self._DbTransaction = dbTransaction;
73
+ self.CustomerId = financeCustomerData.CustomerId;
74
+ self.CompanyId = sFinanceCompanyId;
75
+ self.CustSystemCode = custSystemCode;
76
+ self.CustSystemRefId = custSystemRefId;
77
+ self.AccSystemRefId = financeCustomerData.AccSystemRefId;
78
+ self.PostedToAccSystemYN = financeCustomerData.PostedToAccSystemYN;
79
+ self.PostedById = financeCustomerData.PostedById;
80
+ self.PostedDateTime = financeCustomerData.PostedDateTime;
81
+ return self;
82
+ }
83
+ else {
84
+ const notFoundError = new general_1.RecordNotFoundError('No Record Found');
85
+ throw notFoundError;
86
+ }
87
+ });
88
+ }
89
+ get AccountReceivable() {
90
+ return new Promise((resolve, reject) => {
91
+ let transaction = this._DbTransaction;
92
+ if (this._AccountReceivable) {
93
+ resolve(this._AccountReceivable);
94
+ }
95
+ else {
96
+ return (FinanceCustomerBase._AccountRepository
97
+ .findOne({
98
+ where: {
99
+ AccountType: 'Account Receivable',
100
+ OwnerId: this.CustomerId,
101
+ OwnerType: (0, typeof_1.type)(this),
102
+ },
103
+ transaction,
104
+ })
105
+ .then((accountData) => {
106
+ this._AccountReceivable = new account_1.default(transaction);
107
+ if (accountData) {
108
+ this._AccountReceivable.AccountNo = accountData.AccountNo;
109
+ this._AccountReceivable.ParentAccountNo =
110
+ accountData.ParentAccountNo;
111
+ this._AccountReceivable.AccountType = accountData.AccountType;
112
+ this._AccountReceivable.OwnerId = accountData.OwnerId;
113
+ this._AccountReceivable.OwnerType = accountData.OwnerType;
114
+ }
115
+ else {
116
+ this._AccountReceivable.AccountNo = this.ARAccountNo;
117
+ this._AccountReceivable.ParentAccountNo =
118
+ this.ParentARAccountNo;
119
+ this._AccountReceivable.AccountType = 'Account Receivable';
120
+ this._AccountReceivable.OwnerId = this.CustomerId;
121
+ this._AccountReceivable.OwnerType = (0, typeof_1.type)(this);
122
+ }
123
+ resolve(this._AccountReceivable);
124
+ })
125
+ .catch((err) => {
126
+ reject(err);
127
+ }));
128
+ }
129
+ });
130
+ }
131
+ get AccountPayable() {
132
+ return new Promise((resolve, reject) => {
133
+ let transaction = this._DbTransaction;
134
+ if (this._AccountPayable) {
135
+ resolve(this._AccountPayable);
136
+ }
137
+ else {
138
+ return (FinanceCustomerBase._AccountRepository
139
+ .findOne({
140
+ where: {
141
+ AccountType: 'Account Payable',
142
+ OwnerId: this.CustomerId,
143
+ OwnerType: (0, typeof_1.type)(this),
144
+ },
145
+ transaction,
146
+ })
147
+ .then((accountData) => {
148
+ this._AccountPayable = new account_1.default(transaction);
149
+ if (accountData) {
150
+ this._AccountPayable.AccountNo = accountData.AccountNo;
151
+ this._AccountPayable.ParentAccountNo =
152
+ accountData.ParentAccountNo;
153
+ this._AccountPayable.AccountType = accountData.AccountType;
154
+ this._AccountPayable.OwnerId = accountData.OwnerId;
155
+ this._AccountPayable.OwnerType = accountData.OwnerType;
156
+ }
157
+ else {
158
+ this._AccountPayable.AccountNo = this.APAccountNo;
159
+ this._AccountPayable.ParentAccountNo = this.ParentAPAccountNo;
160
+ this._AccountPayable.AccountType = 'Account Payable';
161
+ this._AccountPayable.OwnerId = this.CustomerId;
162
+ this._AccountPayable.OwnerType = (0, typeof_1.type)(this);
163
+ }
164
+ resolve(this._AccountPayable);
165
+ })
166
+ .catch((err) => {
167
+ reject(err);
168
+ }));
169
+ }
170
+ });
171
+ }
172
+ init(person) {
173
+ this.FullName = person.FullName;
174
+ this.IDNo = person.IDNo;
175
+ this.IDType = person.IDType;
176
+ this.Email = person.Email;
177
+ this.ContactNo = person.ContactNo;
178
+ this.DefaultAddress = person.DefaultAddress;
179
+ }
180
+ save(accSystemRefId, custSystemCode, custSystemRefId, dbTransaction) {
181
+ return __awaiter(this, void 0, void 0, function* () {
182
+ this.CustSystemCode = custSystemCode;
183
+ this.CustSystemRefId = custSystemRefId;
184
+ this.AccSystemRefId = accSystemRefId;
185
+ this.PostedToAccSystemYN = 'Y';
186
+ const data = yield FinanceCustomerBase._FinanceCustomerRepository.create({
187
+ CompanyId: this.CompanyId,
188
+ CustomerId: cuid(),
189
+ CustSystemCode: this.CustSystemCode,
190
+ CustSystemRefId: this.CustSystemRefId,
191
+ AccSystemRefId: this.AccSystemRefId,
192
+ PostedToAccSystemYN: this.PostedToAccSystemYN,
193
+ }, { transaction: dbTransaction });
194
+ return data;
195
+ });
196
+ }
197
+ static isFinanceCustomerExist(custSystemRefId, custSystemCode, sFinanceCompanyId) {
198
+ return __awaiter(this, void 0, void 0, function* () {
199
+ const data = yield FinanceCustomerBase._FinanceCustomerRepository.findAll({
200
+ where: {
201
+ CustSystemRefId: custSystemRefId,
202
+ CustSystemCode: custSystemCode,
203
+ CompanyId: sFinanceCompanyId,
204
+ },
205
+ });
206
+ if (data.length > 0) {
207
+ return true;
208
+ }
209
+ return false;
210
+ });
211
+ }
212
+ getOutstandingBalance(dbTransaction) {
213
+ return __awaiter(this, void 0, void 0, function* () {
214
+ if (!dbTransaction) {
215
+ dbTransaction = yield FinanceDb.getConnection().transaction();
216
+ }
217
+ const ledgerTransactions = yield FinanceCustomerBase._LedgerTransactionRepository.findAll({
218
+ where: {
219
+ AccountNo: (yield this.AccountReceivable).AccountNo,
220
+ },
221
+ transaction: dbTransaction,
222
+ });
223
+ const totalDebitAmount = ledgerTransactions.reduce((accumulator, currentValue) => accumulator + +currentValue.DebitAmount, 0);
224
+ const totalCreditAmount = ledgerTransactions.reduce((accumulator, currentValue) => accumulator + +currentValue.CreditAmount, 0);
225
+ if (totalCreditAmount > totalDebitAmount) {
226
+ return 0;
227
+ }
228
+ const balance = totalDebitAmount - totalCreditAmount;
229
+ return balance;
230
+ });
231
+ }
232
+ }
233
+ exports.default = FinanceCustomerBase;
234
+ FinanceCustomerBase._AccountRepository = new account_repository_1.AccountRepository();
235
+ FinanceCustomerBase._LedgerTransactionRepository = new ledger_transaction_repository_1.LedgerTransactionRepository();
236
+ FinanceCustomerBase._FinanceCustomerRepository = new finance_customer_repository_1.FinanceCustomerRepository();
215
237
  //# sourceMappingURL=customer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"customer.js","sourceRoot":"","sources":["../../src/customer/customer.ts"],"names":[],"mappings":";;;;;;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aAAa,GAAG,MAAM,SAAS,CAAC,aAAa,EAAE,CAAC,WAAW,EAAE,CAAC;aAC/D;YAED,MAAM,kBAAkB,GACtB,MAAM,mBAAmB,CAAC,4BAA4B,CAAC,OAAO,CAAC;gBAC7D,KAAK,EAAE;oBACL,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,iBAAiB,CAAC,CAAC,SAAS;iBACpD;gBACD,WAAW,EAAE,aAAa;aAC3B,CAAC,CAAC;YAEL,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,MAAM,CAChD,CAAC,WAAW,EAAE,YAAY,EAAE,EAAE,CAAC,WAAW,GAAG,CAAC,YAAY,CAAC,WAAW,EACtE,CAAC,CACF,CAAC;YAEF,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,MAAM,CACjD,CAAC,WAAW,EAAE,YAAY,EAAE,EAAE,CAAC,WAAW,GAAG,CAAC,YAAY,CAAC,YAAY,EACvE,CAAC,CACF,CAAC;YAEF,IAAI,iBAAiB,GAAG,gBAAgB,EAAE;gBACxC,OAAO,CAAC,CAAC;aACV;YAED,MAAM,OAAO,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;YACrD,OAAO,OAAO,CAAC;QACjB,CAAC;KAAA;;AAxSH,sCAySC;AAhRgB,sCAAkB,GAAG,IAAI,sCAAiB,EAAE,CAAC;AAC7C,gDAA4B,GACzC,IAAI,2DAA2B,EAAE,CAAC;AAmBnB,8CAA0B,GAAG,IAAI,uDAAyB,EAAE,CAAC"}
@@ -1,5 +1,5 @@
1
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
- import FinanceCustomerModel from '../models/customer.entity';
3
- export declare class FinanceCustomerRepository extends RepositoryBase<FinanceCustomerModel> implements IRepositoryBase<FinanceCustomerModel> {
4
- constructor();
5
- }
1
+ import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
+ import FinanceCustomerModel from '../models/customer.entity';
3
+ export declare class FinanceCustomerRepository extends RepositoryBase<FinanceCustomerModel> implements IRepositoryBase<FinanceCustomerModel> {
4
+ constructor();
5
+ }