@tomei/finance 0.6.39 → 0.6.40

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 (75) hide show
  1. package/dist/account/account.d.ts +2 -0
  2. package/dist/account/account.js +4 -0
  3. package/dist/account/account.js.map +1 -1
  4. package/dist/account-system-entity/account-system-entity.d.ts +1 -0
  5. package/dist/account-system-entity/account-system-entity.js.map +1 -1
  6. package/dist/customer/customer.d.ts +1 -0
  7. package/dist/customer/customer.js.map +1 -1
  8. package/dist/document/document-item.d.ts +2 -0
  9. package/dist/document/document-item.js +4 -0
  10. package/dist/document/document-item.js.map +1 -1
  11. package/dist/document/document.d.ts +2 -0
  12. package/dist/document/document.js +4 -0
  13. package/dist/document/document.js.map +1 -1
  14. package/dist/finance-company/finance-company.js +6 -10
  15. package/dist/finance-company/finance-company.js.map +1 -1
  16. package/dist/helpers/typeof.js +3 -0
  17. package/dist/helpers/typeof.js.map +1 -1
  18. package/dist/journal-entry/journal-entry.d.ts +2 -0
  19. package/dist/journal-entry/journal-entry.js +5 -2
  20. package/dist/journal-entry/journal-entry.js.map +1 -1
  21. package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts +1 -1
  22. package/dist/ledger-transaction/ledger-transaction.d.ts +5 -3
  23. package/dist/ledger-transaction/ledger-transaction.js +14 -10
  24. package/dist/ledger-transaction/ledger-transaction.js.map +1 -1
  25. package/dist/ledger-transaction/ledger-transaction.repository.d.ts +1 -0
  26. package/dist/ledger-transaction/ledger-transaction.repository.js +16 -0
  27. package/dist/ledger-transaction/ledger-transaction.repository.js.map +1 -1
  28. package/dist/models/ledger-transaction.entity.d.ts +1 -1
  29. package/dist/models/ledger-transaction.entity.js +2 -2
  30. package/dist/models/ledger-transaction.entity.js.map +1 -1
  31. package/dist/models/payment-paid-with.entity.d.ts +1 -1
  32. package/dist/models/payment-paid-with.entity.js +1 -1
  33. package/dist/models/payment-paid-with.entity.js.map +1 -1
  34. package/dist/payment/payment.d.ts +3 -1
  35. package/dist/payment/payment.js +4 -1
  36. package/dist/payment/payment.js.map +1 -1
  37. package/dist/payment-item/payment-item.d.ts +2 -0
  38. package/dist/payment-item/payment-item.js +4 -0
  39. package/dist/payment-item/payment-item.js.map +1 -1
  40. package/dist/payment-method/payment-method.d.ts +2 -0
  41. package/dist/payment-method/payment-method.js +4 -0
  42. package/dist/payment-method/payment-method.js.map +1 -1
  43. package/dist/payment-method-type/payment-method-type.d.ts +2 -0
  44. package/dist/payment-method-type/payment-method-type.js +4 -0
  45. package/dist/payment-method-type/payment-method-type.js.map +1 -1
  46. package/dist/payment-paid-with/interfaces/payment-paid-with.interface.d.ts +1 -1
  47. package/dist/payment-paid-with/payment-paid-with.d.ts +1 -1
  48. package/dist/payment-paid-with/payment-paid-with.js +1 -1
  49. package/dist/payment-paid-with/payment-paid-with.js.map +1 -1
  50. package/dist/tax/tax.d.ts +2 -0
  51. package/dist/tax/tax.js +4 -0
  52. package/dist/tax/tax.js.map +1 -1
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/migrations/finance-ledger-transaction-migration.js +5 -1
  55. package/package.json +2 -2
  56. package/src/account/account.ts +5 -0
  57. package/src/account-system-entity/account-system-entity.ts +1 -0
  58. package/src/customer/customer.ts +1 -0
  59. package/src/document/document-item.ts +4 -0
  60. package/src/document/document.ts +5 -1
  61. package/src/finance-company/finance-company.ts +6 -13
  62. package/src/helpers/typeof.ts +6 -0
  63. package/src/journal-entry/journal-entry.ts +7 -2
  64. package/src/ledger-transaction/interfaces/ledger-transaction-attr.interface.ts +1 -1
  65. package/src/ledger-transaction/ledger-transaction.repository.ts +6 -0
  66. package/src/ledger-transaction/ledger-transaction.ts +17 -9
  67. package/src/models/ledger-transaction.entity.ts +2 -2
  68. package/src/models/payment-paid-with.entity.ts +1 -1
  69. package/src/payment/payment.ts +7 -2
  70. package/src/payment-item/payment-item.ts +5 -0
  71. package/src/payment-method/payment-method.ts +5 -0
  72. package/src/payment-method-type/payment-method-type.ts +5 -0
  73. package/src/payment-paid-with/interfaces/payment-paid-with.interface.ts +1 -1
  74. package/src/payment-paid-with/payment-paid-with.ts +1 -1
  75. package/src/tax/tax.ts +61 -57
@@ -3,7 +3,7 @@
3
3
  module.exports = {
4
4
  async up(queryInterface, Sequelize) {
5
5
  await queryInterface.createTable('finance_LedgerTransaction', {
6
- TransactionId: {
6
+ LedgerNo: {
7
7
  type: Sequelize.STRING(30),
8
8
  primaryKey: true,
9
9
  allowNull: false,
@@ -12,6 +12,10 @@ module.exports = {
12
12
  type: Sequelize.STRING(20),
13
13
  allowNull: false,
14
14
  },
15
+ JournalBatchNo: {
16
+ type: Sequelize.STRING(30),
17
+ allowNull: true,
18
+ },
15
19
  JournalEntryId: {
16
20
  type: Sequelize.STRING(30),
17
21
  allowNull: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomei/finance",
3
- "version": "0.6.39",
3
+ "version": "0.6.40",
4
4
  "description": "NestJS package for finance module",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -79,4 +79,4 @@
79
79
  "git add ."
80
80
  ]
81
81
  }
82
- }
82
+ }
@@ -21,6 +21,7 @@ export default class Account extends AccountSystemEntity {
21
21
  CreatedAt: Date;
22
22
  UpdatedById = '';
23
23
  UpdatedAt: Date;
24
+ protected _ObjectType = 'Account';
24
25
 
25
26
  private static _RepositoryBase = new AccountRepository();
26
27
 
@@ -35,6 +36,10 @@ export default class Account extends AccountSystemEntity {
35
36
  this._IsNewRecord = record;
36
37
  }
37
38
 
39
+ get ObjectType() {
40
+ return this._ObjectType;
41
+ }
42
+
38
43
  /* AccountSystemEntity Implementation */
39
44
  get RepositoryBase() {
40
45
  return Account._RepositoryBase;
@@ -11,6 +11,7 @@ export abstract class AccountSystemEntity extends ObjectBase {
11
11
  AccSystemRefId = '';
12
12
  PostedById = '';
13
13
  PostedDateTime: Date;
14
+ protected abstract _ObjectType: string;
14
15
  protected abstract RepositoryBase: IRepositoryBase<any>;
15
16
  private static PostHistoryRepository = new PostHistoryRepository();
16
17
 
@@ -28,6 +28,7 @@ export default abstract class FinanceCustomerBase
28
28
  protected abstract ParentAPAccountNo: string;
29
29
  protected abstract ARAccountNo: string;
30
30
  protected abstract APAccountNo: string;
31
+ protected abstract _ObjectType: string;
31
32
 
32
33
  abstract FullName: string;
33
34
  abstract IDNo: string;
@@ -25,6 +25,10 @@ export default class DocumentItem extends ObjectBase {
25
25
  TaxInclusiveYN = 'N';
26
26
  DtAccountNo = '';
27
27
  CtAccountNo = '';
28
+ private _ObjectType = 'DocumentItem';
29
+ get ObjectType() {
30
+ return this._ObjectType;
31
+ }
28
32
 
29
33
  private static _RepositoryBase = new DocumentItemRepository();
30
34
 
@@ -2,7 +2,6 @@ import * as util from 'util';
2
2
  import * as path from 'path';
3
3
  import * as fs from 'fs';
4
4
  import * as puppeteer from 'puppeteer';
5
- import { RecordNotFoundError } from '@tomei/general/dist/class/exceptions/record-not-found.error';
6
5
  import {
7
6
  Medias,
8
7
  InternalMediaDto,
@@ -44,6 +43,11 @@ export default class Document extends AccountSystemEntity {
44
43
  UpdatedById = '';
45
44
  UpdatedAt: Date;
46
45
  UseAccSystemDocYN = 'N';
46
+ protected _ObjectType = 'Document';
47
+
48
+ get ObjectType() {
49
+ return this._ObjectType;
50
+ }
47
51
 
48
52
  private _DocHTMLFileMediaId = '';
49
53
  private _DocPDFFileMediaId = '';
@@ -40,11 +40,6 @@ import { ApplicationConfig } from '@tomei/config';
40
40
  import { TaxRepository } from '../tax/tax.repository';
41
41
  import { Tax } from '../tax/tax';
42
42
 
43
- // eslint-disable-next-line @typescript-eslint/no-var-requires
44
- const getConfig = require('../config');
45
- // eslint-disable-next-line @typescript-eslint/no-var-requires
46
- const config = getConfig();
47
-
48
43
  export default class FinanceCompany extends ObjectBase {
49
44
  private _CompanyId = 'New';
50
45
  private _CompSystemCode = '';
@@ -374,7 +369,6 @@ export default class FinanceCompany extends ObjectBase {
374
369
  );
375
370
 
376
371
  for (const ledgerTransaction of debitTransactions) {
377
- ledgerTransaction.TransactionId = cuid();
378
372
  ledgerTransaction.JournalEntryId = newJournalEntry.JournalEntryId;
379
373
 
380
374
  await ledgerTransaction.save(dbTransaction);
@@ -386,7 +380,6 @@ export default class FinanceCompany extends ObjectBase {
386
380
  }
387
381
 
388
382
  for (const ledgerTransaction of creditTransactions) {
389
- ledgerTransaction.TransactionId = cuid();
390
383
  ledgerTransaction.JournalEntryId = newJournalEntry.JournalEntryId;
391
384
 
392
385
  await ledgerTransaction.save(dbTransaction);
@@ -1113,13 +1106,13 @@ export default class FinanceCompany extends ObjectBase {
1113
1106
  const payload = {
1114
1107
  Action: 'Create',
1115
1108
  Activity: 'Issuing a Credit Note Transaction',
1116
- Description: `Credit Transaction (ID: ${creditTransaction.TransactionId}) has been created`,
1109
+ Description: `Credit Transaction (ID: ${creditTransaction.LedgerNo}) has been created`,
1117
1110
  EntityType: 'CreditTransaction',
1118
1111
  EntityValueBefore: JSON.stringify({}),
1119
1112
  EntityValueAfter: JSON.stringify(creditTransaction),
1120
1113
  PerformedById: loginUser.ObjectId,
1121
1114
  PerformedAt: transactionDate,
1122
- EntityId: creditTransaction.TransactionId,
1115
+ EntityId: creditTransaction.LedgerNo,
1123
1116
  };
1124
1117
 
1125
1118
  await axios.post(
@@ -1348,7 +1341,7 @@ export default class FinanceCompany extends ObjectBase {
1348
1341
  Currency: paymentPaidWithItem.Currency,
1349
1342
  Amount: paymentPaidWithItem.Amount,
1350
1343
  Status: paymentPaidWithItem.Status,
1351
- TransactionId: paymentPaidWithItem.TransactionId,
1344
+ LedgerNo: paymentPaidWithItem.LedgerNo,
1352
1345
  RefBank: paymentPaidWithItem.RefBank,
1353
1346
  RefName: paymentPaidWithItem.RefName,
1354
1347
  RefNo: paymentPaidWithItem.RefNo,
@@ -1523,7 +1516,7 @@ export default class FinanceCompany extends ObjectBase {
1523
1516
  Currency: paymentPaidWithItem.Currency,
1524
1517
  Amount: paymentPaidWithItem.Amount,
1525
1518
  Status: paymentPaidWithItem.Status,
1526
- TransactionId: paymentPaidWithItem.TransactionId,
1519
+ LedgerNo: paymentPaidWithItem.LedgerNo,
1527
1520
  RefBank: paymentPaidWithItem.RefBank,
1528
1521
  RefName: paymentPaidWithItem.RefName,
1529
1522
  RefNo: paymentPaidWithItem.RefNo,
@@ -1664,7 +1657,7 @@ export default class FinanceCompany extends ObjectBase {
1664
1657
  transaction: this._DbTransaction,
1665
1658
  })
1666
1659
  .then((taxes) => {
1667
- let taxList = [];
1660
+ const taxList = [];
1668
1661
  taxes.forEach((tax) => {
1669
1662
  taxList.push(
1670
1663
  new Tax({
@@ -1993,7 +1986,7 @@ export default class FinanceCompany extends ObjectBase {
1993
1986
  Currency: paymentPaidWithItem.Currency,
1994
1987
  Amount: paymentPaidWithItem.Amount,
1995
1988
  Status: paymentPaidWithItem.Status,
1996
- TransactionId: paymentPaidWithItem.TransactionId,
1989
+ LedgerNo: paymentPaidWithItem.LedgerNo,
1997
1990
  RefBank: paymentPaidWithItem.RefBank,
1998
1991
  RefName: paymentPaidWithItem.RefName,
1999
1992
  RefNo: paymentPaidWithItem.RefNo,
@@ -2,12 +2,18 @@ export function type(value: any): string {
2
2
  if (value === null) {
3
3
  return 'null';
4
4
  }
5
+
5
6
  const baseType = typeof value;
6
7
 
7
8
  if (!['object', 'function'].includes(baseType)) {
8
9
  return baseType;
9
10
  }
10
11
 
12
+ // if value is object and have propery ObjectType: string return ObjectType instead.
13
+ if (baseType === 'object' && value.ObjectType) {
14
+ return value.ObjectType;
15
+ }
16
+
11
17
  const tag = value[Symbol.toStringTag];
12
18
  if (typeof tag === 'string') {
13
19
  return tag;
@@ -13,6 +13,7 @@ export default class JournalEntry extends AccountSystemEntity {
13
13
  Date = new Date();
14
14
  Name = '';
15
15
  Description = '';
16
+ protected _ObjectType: 'JournalEntry';
16
17
 
17
18
  private static _RepositoryBase = new JournalEntryRepository();
18
19
  private static _LedgerTransactionRepository =
@@ -30,6 +31,10 @@ export default class JournalEntry extends AccountSystemEntity {
30
31
  this._JournalEntryId = id;
31
32
  }
32
33
 
34
+ get ObjectType() {
35
+ return this._ObjectType;
36
+ }
37
+
33
38
  get RepositoryBase() {
34
39
  return JournalEntry._RepositoryBase;
35
40
  }
@@ -109,7 +114,7 @@ export default class JournalEntry extends AccountSystemEntity {
109
114
  (debitTransactionData) =>
110
115
  new LedgerTransaction(
111
116
  this._DbTransaction,
112
- debitTransactionData.TransactionId,
117
+ debitTransactionData.LedgerNo,
113
118
  ),
114
119
  );
115
120
  return Promise.all(debitTransactionObjects);
@@ -142,7 +147,7 @@ export default class JournalEntry extends AccountSystemEntity {
142
147
  (creditTransactionData) =>
143
148
  new LedgerTransaction(
144
149
  this._DbTransaction,
145
- creditTransactionData.TransactionId,
150
+ creditTransactionData.LedgerNo,
146
151
  ),
147
152
  );
148
153
  return Promise.all(creditTransactionObjects);
@@ -1,7 +1,7 @@
1
1
  import { TransactionTypeOptions } from '../../enum';
2
2
 
3
3
  export interface ILedgerTransactionAttr {
4
- TransactionId?: string;
4
+ LedgerNo?: string;
5
5
  TransactionType?: TransactionTypeOptions;
6
6
  JournalEntryId?: string;
7
7
  AccountNo?: string;
@@ -8,4 +8,10 @@ export class LedgerTransactionRepository
8
8
  constructor() {
9
9
  super(LedgerTransactionModel);
10
10
  }
11
+
12
+ async count(dbTransaction?: any) {
13
+ return await LedgerTransactionModel.count({
14
+ transaction: dbTransaction,
15
+ });
16
+ }
11
17
  }
@@ -5,7 +5,7 @@ import { LedgerTransactionRepository } from './ledger-transaction.repository';
5
5
  import LedgerTransactionModel from '../models/ledger-transaction.entity';
6
6
 
7
7
  export default class LedgerTransaction {
8
- TransactionId = 'New';
8
+ LedgerNo = 'New';
9
9
  TransactionType = TransactionTypeOptions.DEBIT;
10
10
  JournalEntryId = '';
11
11
  AccountNo = '';
@@ -19,28 +19,33 @@ export default class LedgerTransaction {
19
19
  RelatedObjectType = '';
20
20
  RelatedDocNo = '';
21
21
  RelatedPaymentId = '';
22
+ private _ObjectType: 'LedgerTransaction';
22
23
 
23
24
  private _DbTransaction: any;
24
25
 
25
26
  private static _LedgerTransactionRepository =
26
27
  new LedgerTransactionRepository();
27
28
 
29
+ get ObjectType() {
30
+ return this._ObjectType;
31
+ }
32
+
28
33
  constructor(
29
34
  transactionType: TransactionTypeOptions,
30
35
  dbTransaction?: any,
31
- transactionId?: string,
36
+ LedgerNo?: string,
32
37
  ) {
33
38
  this.TransactionType = transactionType;
34
39
  if (dbTransaction) {
35
40
  this._DbTransaction = dbTransaction;
36
41
  }
37
- if (transactionId) {
38
- this.TransactionId = transactionId;
42
+ if (LedgerNo) {
43
+ this.LedgerNo = LedgerNo;
39
44
  }
40
45
  }
41
46
 
42
47
  init(params?: ILedgerTransactionAttr) {
43
- if (params.TransactionId) this.TransactionId = params.TransactionId;
48
+ if (params.LedgerNo) this.LedgerNo = params.LedgerNo;
44
49
  if (params.TransactionType) this.TransactionType = params.TransactionType;
45
50
  if (params.JournalEntryId) this.JournalEntryId = params.JournalEntryId;
46
51
  if (params.AccountNo) this.AccountNo = params.AccountNo;
@@ -57,7 +62,7 @@ export default class LedgerTransaction {
57
62
 
58
63
  getData() {
59
64
  return {
60
- TransactionId: this.TransactionId,
65
+ LedgerNo: this.LedgerNo,
61
66
  TransactionType: this.TransactionType,
62
67
  JournalEntryId: this.JournalEntryId,
63
68
  AccountNo: this.AccountNo,
@@ -76,11 +81,14 @@ export default class LedgerTransaction {
76
81
 
77
82
  async save(dbTransaction?: any): Promise<LedgerTransactionModel> {
78
83
  try {
79
- this.TransactionId = cuid();
84
+ const count = await LedgerTransaction._LedgerTransactionRepository.count(
85
+ dbTransaction,
86
+ );
87
+ this.LedgerNo = `${count + 1}`;
80
88
 
81
89
  return await LedgerTransaction._LedgerTransactionRepository.create(
82
90
  {
83
- TransactionId: this.TransactionId,
91
+ LedgerNo: this.LedgerNo,
84
92
  TransactionType: this.TransactionType,
85
93
  JournalEntryId: this.JournalEntryId,
86
94
  AccountNo: this.AccountNo,
@@ -135,7 +143,7 @@ export default class LedgerTransaction {
135
143
  journalEntryId?: string,
136
144
  ): Promise<any> {
137
145
  this.init({
138
- TransactionId: cuid(),
146
+ LedgerNo: cuid(),
139
147
  TransactionType: transactionType,
140
148
  JournalEntryId: journalEntryId,
141
149
  // Name: journalEntry.Name,
@@ -17,13 +17,13 @@ import PaymentModel from './payment.entity';
17
17
  timestamps: false,
18
18
  })
19
19
  export default class LedgerTransactionModel extends Model {
20
- @ApiProperty({ type: String, description: 'Transactionid' })
20
+ @ApiProperty({ type: String, description: 'LedgerNo' })
21
21
  @Column({
22
22
  primaryKey: true,
23
23
  allowNull: false,
24
24
  type: DataType.STRING(30),
25
25
  })
26
- TransactionId: string;
26
+ LedgerNo: string;
27
27
 
28
28
  @ApiProperty({
29
29
  type: String,
@@ -63,7 +63,7 @@ export default class PaymentPaidWithModel extends Model {
63
63
  allowNull: true,
64
64
  type: DataType.STRING(100),
65
65
  })
66
- TransactionId: string;
66
+ LedgerNo: string;
67
67
 
68
68
  @Column({
69
69
  allowNull: true,
@@ -20,7 +20,7 @@ export default class Payment extends AccountSystemEntity {
20
20
  Currency = 'MYR';
21
21
  Amount = 0;
22
22
  Status: PaymentStatus;
23
- TransactionId: string;
23
+ LedgerNo: string;
24
24
  TransactionApprovalCode: string;
25
25
  TransactionAccountName: string;
26
26
  TransactionAccountNo: string;
@@ -32,6 +32,7 @@ export default class Payment extends AccountSystemEntity {
32
32
  RelatedObjectId = '';
33
33
  RelatedObjectType = '';
34
34
  ReceiptDocNo = '';
35
+ _ObjectType: 'Payment';
35
36
 
36
37
  private static _RepositoryBase = new PaymentRepository();
37
38
  private static _PaymentItemRepository = new PaymentItemRepository();
@@ -47,6 +48,10 @@ export default class Payment extends AccountSystemEntity {
47
48
  return this._PaymentId;
48
49
  }
49
50
 
51
+ get ObjectType() {
52
+ return this._ObjectType;
53
+ }
54
+
50
55
  public set PaymentId(id: string) {
51
56
  this._PaymentId = id;
52
57
  }
@@ -181,7 +186,7 @@ export default class Payment extends AccountSystemEntity {
181
186
  ppw.Currency = paymentPaidWithItem.Currency;
182
187
  ppw.Amount = paymentPaidWithItem.Amount;
183
188
  ppw.Status = paymentPaidWithItem.Status;
184
- ppw.TransactionId = paymentPaidWithItem.TransactionId;
189
+ ppw.LedgerNo = paymentPaidWithItem.LedgerNo;
185
190
  ppw.RefBank = paymentPaidWithItem.RefBank;
186
191
  ppw.RefName = paymentPaidWithItem.RefName;
187
192
  ppw.RefNo = paymentPaidWithItem.RefNo;
@@ -14,6 +14,7 @@ export default class PaymentItem extends ObjectBase {
14
14
  Name = '';
15
15
  Description = '';
16
16
  Remarks = '';
17
+ private _ObjectType = 'PaymentItem';
17
18
 
18
19
  get PaymentId() {
19
20
  return this._PaymentId;
@@ -23,6 +24,10 @@ export default class PaymentItem extends ObjectBase {
23
24
  this._PaymentId = id;
24
25
  }
25
26
 
27
+ get ObjectType() {
28
+ return this._ObjectType;
29
+ }
30
+
26
31
  get PayForObjectId() {
27
32
  return this._PayForObjectId;
28
33
  }
@@ -9,6 +9,11 @@ export default class PaymentMethod extends ObjectBase {
9
9
  MethodId = 'New';
10
10
  Name = '';
11
11
  CompanyId = '';
12
+ private _ObjectType = 'PaymentMethod';
13
+
14
+ get ObjectType() {
15
+ return this._ObjectType;
16
+ }
12
17
 
13
18
  private static _RepositoryBase = new PaymentMethodRepository();
14
19
  private static _PaymentMethodTypeRepository =
@@ -9,6 +9,11 @@ export default class PaymentMethodType extends ObjectBase {
9
9
  AccountNo = '';
10
10
  ProcessingFeeRate = 0.0;
11
11
  ProcessingFeeAccountNo = '';
12
+ private _ObjectType = 'PaymentMethodType';
13
+
14
+ get ObjectType() {
15
+ return this._ObjectType;
16
+ }
12
17
 
13
18
  private _DbTransaction: any;
14
19
 
@@ -6,7 +6,7 @@ export class IPaymentPaidWithAttr {
6
6
  Currency: string;
7
7
  Amount: number;
8
8
  Status: PaymentStatus;
9
- TransactionId?: string;
9
+ LedgerNo?: string;
10
10
  RefBank?: string;
11
11
  RefName?: string;
12
12
  RefNo?: string;
@@ -9,7 +9,7 @@ export default class PaymentPaidWith extends ObjectBase {
9
9
  Currency = 'MYR';
10
10
  Amount = 0;
11
11
  Status: PaymentStatus;
12
- TransactionId = '';
12
+ LedgerNo = '';
13
13
  RefBank = '';
14
14
  RefName = '';
15
15
  RefNo = '';
package/src/tax/tax.ts CHANGED
@@ -1,57 +1,61 @@
1
- import { ITaxAttr } from './interfaces/tax-attr.interface';
2
-
3
- export class Tax {
4
- private _TaxCode = 'New';
5
- private _Description: string;
6
- private _CompanyId: string;
7
- private _TaxRate = 0;
8
- private _CreatedById: string;
9
- private _CreatedAt: Date;
10
- private _UpdatedById: string;
11
- private _UpdatedAt: Date;
12
-
13
- constructor(taxAttr?: ITaxAttr) {
14
- if (taxAttr) {
15
- this._TaxCode = taxAttr.TaxCode;
16
- this._Description = taxAttr.Description;
17
- this._CompanyId = taxAttr.CompanyId;
18
- this._TaxRate = taxAttr.TaxRate;
19
- this._CreatedById = taxAttr.CreatedById;
20
- this._CreatedAt = taxAttr.CreatedAt;
21
- this._UpdatedById = taxAttr.UpdatedById;
22
- this._UpdatedAt = taxAttr.UpdatedAt;
23
- }
24
- }
25
-
26
- get TaxCode(): string {
27
- return this._TaxCode;
28
- }
29
-
30
- get Description(): string {
31
- return this._Description;
32
- }
33
-
34
- get CompanyId(): string {
35
- return this._CompanyId;
36
- }
37
-
38
- get TaxRate(): number {
39
- return this._TaxRate;
40
- }
41
-
42
- get CreatedById(): string {
43
- return this._CreatedById;
44
- }
45
-
46
- get CreatedAt(): Date {
47
- return this._CreatedAt;
48
- }
49
-
50
- get UpdatedById(): string {
51
- return this._UpdatedById;
52
- }
53
-
54
- get UpdatedAt(): Date {
55
- return this._UpdatedAt;
56
- }
57
- }
1
+ import { ITaxAttr } from './interfaces/tax-attr.interface';
2
+
3
+ export class Tax {
4
+ private _TaxCode = 'New';
5
+ private _Description: string;
6
+ private _CompanyId: string;
7
+ private _TaxRate = 0;
8
+ private _CreatedById: string;
9
+ private _CreatedAt: Date;
10
+ private _UpdatedById: string;
11
+ private _UpdatedAt: Date;
12
+ private _ObjectType = 'Tax';
13
+ get ObjectType() {
14
+ return this._ObjectType;
15
+ }
16
+
17
+ constructor(taxAttr?: ITaxAttr) {
18
+ if (taxAttr) {
19
+ this._TaxCode = taxAttr.TaxCode;
20
+ this._Description = taxAttr.Description;
21
+ this._CompanyId = taxAttr.CompanyId;
22
+ this._TaxRate = taxAttr.TaxRate;
23
+ this._CreatedById = taxAttr.CreatedById;
24
+ this._CreatedAt = taxAttr.CreatedAt;
25
+ this._UpdatedById = taxAttr.UpdatedById;
26
+ this._UpdatedAt = taxAttr.UpdatedAt;
27
+ }
28
+ }
29
+
30
+ get TaxCode(): string {
31
+ return this._TaxCode;
32
+ }
33
+
34
+ get Description(): string {
35
+ return this._Description;
36
+ }
37
+
38
+ get CompanyId(): string {
39
+ return this._CompanyId;
40
+ }
41
+
42
+ get TaxRate(): number {
43
+ return this._TaxRate;
44
+ }
45
+
46
+ get CreatedById(): string {
47
+ return this._CreatedById;
48
+ }
49
+
50
+ get CreatedAt(): Date {
51
+ return this._CreatedAt;
52
+ }
53
+
54
+ get UpdatedById(): string {
55
+ return this._UpdatedById;
56
+ }
57
+
58
+ get UpdatedAt(): Date {
59
+ return this._UpdatedAt;
60
+ }
61
+ }