@tomei/finance 0.3.22 → 0.3.23

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.22",
3
+ "version": "0.3.23",
4
4
  "description": "NestJS package for finance module",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1034,6 +1034,7 @@ export default class FinanceCompany extends ObjectBase {
1034
1034
  });
1035
1035
 
1036
1036
  const journalEntry = new JournalEntry(dbTransaction);
1037
+ journalEntry.init({ CompanyId: this.CompanyId });
1037
1038
  const transactionDate = new Date();
1038
1039
 
1039
1040
  const debitLT = await journalEntry.newLedgerTransaction(
@@ -1,11 +1,11 @@
1
1
  export interface IJournalEntryAttr {
2
- CompanyId: string;
3
- JournalEntryId: string;
2
+ CompanyId?: string;
3
+ JournalEntryId?: string;
4
4
  Date?: Date;
5
- Name: string;
5
+ Name?: string;
6
6
  Description?: string;
7
7
  AccSystemRefId?: string;
8
- PostedToAccSystemYN: string;
8
+ PostedToAccSystemYN?: string;
9
9
  PostedById?: string;
10
10
  PostedDateTime?: Date;
11
11
  }
@@ -80,7 +80,7 @@ export default class JournalEntry extends AccountSystemEntity {
80
80
  } else {
81
81
  this.init({
82
82
  JournalEntryId: cuid(),
83
- CompanyId: this.CompanyId,
83
+ CompanyId: '',
84
84
  Date: new Date(),
85
85
  Name: '',
86
86
  Description: '',
@@ -214,13 +214,14 @@ export default class JournalEntry extends AccountSystemEntity {
214
214
  // }
215
215
 
216
216
  init(params: IJournalEntryAttr) {
217
- this.JournalEntryId = params.JournalEntryId;
218
- this.Date = params.Date;
219
- this.Name = params.Name;
220
- this.Description = params.Description;
221
- this.PostedById = params.PostedById;
222
- this.PostedToAccSystemYN = params.PostedToAccSystemYN;
223
- this.PostedDateTime = params.PostedDateTime;
217
+ if(params.JournalEntryId) this.JournalEntryId = params.JournalEntryId;
218
+ if(params.CompanyId) this.CompanyId = params.CompanyId;
219
+ if(params.Date) this.Date = params.Date;
220
+ if(params.Name) this.Name = params.Name;
221
+ if(params.Description) this.Description = params.Description;
222
+ if(params.PostedById) this.PostedById = params.PostedById;
223
+ if(params.PostedToAccSystemYN) this.PostedToAccSystemYN = params.PostedToAccSystemYN;
224
+ if(params.PostedDateTime) this.PostedDateTime = params.PostedDateTime;
224
225
  }
225
226
 
226
227
  getData() {