@tomei/finance 0.3.57 → 0.3.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/finance",
3
- "version": "0.3.57",
3
+ "version": "0.3.58",
4
4
  "description": "NestJS package for finance module",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -19,6 +19,15 @@ export default abstract class FinanceCustomerBase
19
19
  extends AccountSystemEntity
20
20
  implements IPerson
21
21
  {
22
+ CustomerId = 'New';
23
+ CustSystemCode = '';
24
+ CustSystemRefId = '';
25
+
26
+ protected abstract ParentARAccountNo: string;
27
+ protected abstract ParentAPAccountNo: string;
28
+ protected abstract ARAccountNo: string;
29
+ protected abstract APAccountNo: string;
30
+
22
31
  abstract FullName: string;
23
32
  abstract IDNo: string;
24
33
  abstract IDType: string;
@@ -49,10 +58,6 @@ export default abstract class FinanceCustomerBase
49
58
  }
50
59
 
51
60
  protected static _FinanceCustomerRepository = new FinanceCustomerRepository();
52
-
53
- CustomerId: string;
54
- CustSystemCode: string;
55
- CustSystemRefId: string;
56
61
  RepositoryBase: IRepositoryBase<any>;
57
62
 
58
63
  constructor(
@@ -140,8 +145,10 @@ export default abstract class FinanceCustomerBase
140
145
  this._AccountReceivable.OwnerId = accountData.OwnerId;
141
146
  this._AccountReceivable.OwnerType = accountData.OwnerType;
142
147
  } else {
143
- this._AccountReceivable.AccountNo = `${this.CustSystemCode}-AR-123456789`;
144
- this._AccountReceivable.ParentAccountNo = `${this.CustSystemCode}-AR`;
148
+ // this._AccountReceivable.AccountNo = `${this.CustSystemCode}-AR-123456789`;
149
+ // this._AccountReceivable.ParentAccountNo = `${this.CustSystemCode}-AR`;
150
+ this._AccountReceivable.AccountNo = this.ARAccountNo; //SystemInfo.SYSTEM_CODE + '-AR-' + '8 digit running no'
151
+ this._AccountReceivable.ParentAccountNo = this.ParentARAccountNo; //SystemInfo.SYSTEM_CODE + '-AR'
145
152
  this._AccountReceivable.AccountType = 'Account Receivable';
146
153
  this._AccountReceivable.OwnerId = this.CustomerId;
147
154
  this._AccountReceivable.OwnerType = type(this);
@@ -183,8 +190,10 @@ export default abstract class FinanceCustomerBase
183
190
  this._AccountPayable.OwnerId = accountData.OwnerId;
184
191
  this._AccountPayable.OwnerType = accountData.OwnerType;
185
192
  } else {
186
- this._AccountPayable.AccountNo = `${this.CustSystemCode}-AP-123456789`;
187
- this._AccountPayable.ParentAccountNo = `${this.CustSystemCode}-AP`;
193
+ // this._AccountPayable.AccountNo = `${this.CustSystemCode}-AP-123456789`;
194
+ // this._AccountPayable.ParentAccountNo = `${this.CustSystemCode}-AP`;
195
+ this._AccountPayable.AccountNo = this.APAccountNo; //SystemInfo.SYSTEM_CODE + '-AP-' + '8 digit running no'
196
+ this._AccountPayable.ParentAccountNo = this.ParentAPAccountNo; //SystemInfo.SYSTEM_CODE + '-AP'
188
197
  this._AccountPayable.AccountType = 'Account Payable';
189
198
  this._AccountPayable.OwnerId = this.CustomerId;
190
199
  this._AccountPayable.OwnerType = type(this);
@@ -517,10 +517,15 @@ export default class Document extends AccountSystemEntity {
517
517
  *
518
518
  * @returns {DocumentItem}
519
519
  */
520
- async newDocumentItem(documentItem?: any): Promise<DocumentItem> {
521
- const di = new DocumentItem(this._DbTransaction, this);
520
+ async newDocumentItem(documentItem?: DocumentItem): Promise<DocumentItem> {
521
+ let di: DocumentItem;
522
+ if (documentItem) {
523
+ di = documentItem;
524
+ } else {
525
+ di = new DocumentItem(this._DbTransaction, this);
526
+ }
522
527
  di.DocNo = this.DocNo;
523
- this._DocumentItems.push(documentItem);
528
+ this._DocumentItems.push(di);
524
529
  return documentItem;
525
530
  }
526
531
 
@@ -567,6 +567,7 @@ export default class FinanceCompany extends ObjectBase {
567
567
  } else {
568
568
  /*todo: check config file to see which invoice template is to be used for specific project*/
569
569
  /*Generating invoice based on template*/
570
+ /*note: had to comment this due to unresolved */
570
571
  // invoice.generateInvoice(invoice.IssuedById);
571
572
  }
572
573
 
@@ -9,6 +9,7 @@ export default class LedgerTransaction {
9
9
  JournalEntryId = '';
10
10
  AccountNo = '';
11
11
  Date = new Date();
12
+ Name = '';
12
13
  Description = '';
13
14
  Currency = 'MYR';
14
15
  DebitAmount = 0;
package/CHANGELOG.md DELETED
@@ -1 +0,0 @@
1
- RELEASE 1.0.0