shareneus 1.4.22 → 1.4.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.
@@ -42,7 +42,7 @@ class InvPrintService {
42
42
  InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
43
43
  InvoicePrintData = this.GetFormattedProductDataForPrint(argInvoiceData, InvoicePrintData);
44
44
  InvoicePrintData = this.GetBillNameForInvoicePrint(argInvoiceData, InvoicePrintData);
45
- let PaymentData = this.GetPaymentsTotal(argInvoiceData.Payments, InvoicePrintData.Total, argInvoiceData.Sts);
45
+ let PaymentData = this.GetPaymentsTotal(argInvoiceData.Credits, argInvoiceData.Payments, InvoicePrintData.Total, argInvoiceData.Sts);
46
46
  // if (argInvoiceData.Settings.DiscLvl !== 'REC') {
47
47
  // InvoicePrintData.FixedDisc = null;
48
48
  // }
@@ -425,16 +425,22 @@ class InvPrintService {
425
425
  static GetBillToName(Title, Name) {
426
426
  return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
427
427
  }
428
- static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
428
+ static GetPaymentsTotal(Credits, InvoicePayments, Total, InvoiceStatus) {
429
429
  var i = 0;
430
430
  let Data = {};
431
431
  let PaidTotal = 0;
432
432
  if (tr_utils_1.TrUtils.IsNull(InvoicePayments)) {
433
433
  InvoicePayments = [];
434
434
  }
435
+ if (tr_utils_1.TrUtils.IsNull(Credits)) {
436
+ Credits = [];
437
+ }
435
438
  for (i = 0; i < InvoicePayments.length; i++) {
436
439
  PaidTotal += InvoicePayments[i].Paid;
437
440
  }
441
+ for (i = 0; i < Credits.length; i++) {
442
+ PaidTotal += Credits[i].Amt;
443
+ }
438
444
  if (InvoiceStatus === enums_1.InvoiceStatusEnum.Closed) {
439
445
  Data.Due = 0;
440
446
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.4.22",
3
+ "version": "1.4.23",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",