@tomei/finance 0.6.50 → 0.6.52

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.6.50",
3
+ "version": "0.6.52",
4
4
  "description": "NestJS package for finance module",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -353,16 +353,25 @@ export default class FinanceCompany extends ObjectBase {
353
353
  );
354
354
  }
355
355
 
356
- const totalCreditAmount = creditTransactions.reduce(
356
+ let totalCreditAmount = creditTransactions.reduce(
357
357
  (accumulator, currentValue) => accumulator + currentValue.CreditAmount,
358
358
  0,
359
359
  );
360
- const totalDebitAmount = debitTransactions.reduce(
360
+ let totalDebitAmount = debitTransactions.reduce(
361
361
  (accumulator, currentValue) => accumulator + currentValue.DebitAmount,
362
362
  0,
363
363
  );
364
+ console.log('totalCreditAmount: ', totalCreditAmount);
365
+ console.log('totalDebitAmount: ', totalDebitAmount);
364
366
 
365
- if (totalCreditAmount !== totalDebitAmount) {
367
+ if (typeof totalCreditAmount === 'string') {
368
+ totalCreditAmount = parseFloat(totalCreditAmount);
369
+ }
370
+
371
+ if (typeof totalDebitAmount === 'string') {
372
+ totalDebitAmount = parseFloat(totalDebitAmount);
373
+ }
374
+ if (totalCreditAmount.toFixed(2) !== totalDebitAmount.toFixed(2)) {
366
375
  throw new Error(
367
376
  'Credit ledger transaction and debit ledger transaction should the same amount',
368
377
  );
@@ -45,6 +45,7 @@ export default class PaymentMethodType extends ObjectBase {
45
45
  dbTransaction,
46
46
  methodTypeId,
47
47
  );
48
+ paymentMethodType.MethodId = paymentMethodTypeData.MethodId
48
49
  paymentMethodType.Name = paymentMethodTypeData.Name;
49
50
  paymentMethodType.AccountNo = paymentMethodTypeData.AccountNo;
50
51
  paymentMethodType.ProcessingFeeRate =