shareneus 1.4.21 → 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
  }
@@ -38,7 +38,7 @@ class InvoicePortraitPrintService {
38
38
  },
39
39
  this.GetItemsTable(InvoicePDFData.Ops, InvoicePDFData.Items, InvoicePDFData.ShowTaxColumn, InvoicePDFData.SType, printOptions, size),
40
40
  [this.TotalDetails(InvoicePDFData)],
41
- [shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(InvoicePDFData.Type, InvoicePDFData.Paid, InvoicePDFData.Due, InvoicePDFData.Sts, InvoicePDFData.isCountersale),
41
+ [this.InvoiceDueStatus(InvoicePDFData.Type, InvoicePDFData.Paid, InvoicePDFData.Due, InvoicePDFData.Sts, InvoicePDFData.isCountersale),
42
42
  ],
43
43
  {
44
44
  style: 'tableExample',
@@ -92,6 +92,36 @@ class InvoicePortraitPrintService {
92
92
  };
93
93
  return dd;
94
94
  }
95
+ static LayOutStyle() {
96
+ return {
97
+ hLineColor: function (i, node) {
98
+ return (i === 0 || i === 1 || i === 2 || i === node.table.body.length) ? 'gray' : 'white';
99
+ },
100
+ vLineColor: function (i, node) {
101
+ return (i === 0 || i === node.table.widths.length) ? 'gray' : 'white';
102
+ }
103
+ };
104
+ }
105
+ static InvoiceDueStatus(Type, Paid, Due, Status, isCounter) {
106
+ if (Type === 'Invoice' && !isCounter) {
107
+ return {
108
+ // lineHeight: 0.7,
109
+ fontSize: this.TableHeaders,
110
+ marginTop: 10,
111
+ marginBottom: 5,
112
+ table: {
113
+ widths: ['*', '*', '*'],
114
+ body: [[{ text: 'Paid : ' + Paid },
115
+ { text: 'Due : ' + Due },
116
+ { text: 'Status : ' + Status }]]
117
+ },
118
+ layout: this.LayOutStyle(),
119
+ };
120
+ }
121
+ else {
122
+ return this.emptyObject();
123
+ }
124
+ }
95
125
  static GetMainHeaderInfo(InvoicePDFData) {
96
126
  if (!tr_utils_1.TrUtils.IsNull(InvoicePDFData.Image)) {
97
127
  return {
@@ -756,3 +786,4 @@ class InvoicePortraitPrintService {
756
786
  }
757
787
  }
758
788
  exports.InvoicePortraitPrintService = InvoicePortraitPrintService;
789
+ InvoicePortraitPrintService.TableHeaders = 9;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.4.21",
3
+ "version": "1.4.23",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",