shareneus 1.4.72 → 1.4.74

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.
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HCInvoiceprintService = void 0;
4
- const tr_utils_1 = require("../../utils/tr-utils");
5
4
  const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
6
5
  const shared_print_service_1 = require("../../shared/shared-print.service");
6
+ const tr_utils_1 = require("../../utils/tr-utils");
7
7
  class HCInvoiceprintService {
8
8
  constructor() {
9
9
  this.FontSize = 8;
@@ -277,7 +277,7 @@ class HCInvoiceprintService {
277
277
  Parts.forEach((part) => {
278
278
  var dataRow = [];
279
279
  columns.forEach((column) => {
280
- if ((!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field]))
280
+ if ((!tr_utils_1.TrUtils.IsNull(part[column.Field]))
281
281
  || (column.text === 'Line Total')) {
282
282
  // if (part[column.Field] === 'Medications') {
283
283
  // dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
@@ -288,13 +288,13 @@ class HCInvoiceprintService {
288
288
  dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
289
289
  }
290
290
  else {
291
- if (column.text === 'Line Total' || column.Field === 'UnPr' || column.Field === 'QtyAndUoM'
291
+ if (column.text === 'Line Total' || column.Field === 'UnPr' || column.Field === 'HSN' || column.Field === 'QtyAndUoM'
292
292
  || column.text === 'Tax' || column.Field === 'Disc' || column.Field === 'Perc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
293
293
  || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
294
294
  if (column.Field === 'Disc') {
295
295
  if (column.type === 'percentage') {
296
296
  if (!tr_utils_1.TrUtils.IsEmpty(part[column.Field])) {
297
- dataRow.push({ text: part[column.Field].toString(), noWrap: true });
297
+ dataRow.push({ text: part[column.Field].toString(), noWrap: true, alignment: 'right' });
298
298
  }
299
299
  else {
300
300
  dataRow.push({ text: '', noWrap: true });
@@ -302,7 +302,7 @@ class HCInvoiceprintService {
302
302
  }
303
303
  else {
304
304
  if (!tr_utils_1.TrUtils.IsNull(part[column.Field])) {
305
- dataRow.push({ text: part[column.Field].toString(), noWrap: true });
305
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(part[column.Field]).toString(), alignment: 'right', noWrap: true });
306
306
  }
307
307
  else {
308
308
  dataRow.push({ text: '', noWrap: true });
@@ -399,7 +399,7 @@ class HCInvoiceprintService {
399
399
  Labor.forEach((Ops) => {
400
400
  var dataRow = [];
401
401
  columns.forEach((column) => {
402
- if ((!tr_utils_1.TrUtils.IsFixedZero(Ops[column.Field]) && !tr_utils_1.TrUtils.IsNull(Ops[column.Field]))
402
+ if ((!tr_utils_1.TrUtils.IsNull(Ops[column.Field]))
403
403
  || (column.text === 'Line Total')) {
404
404
  if (Ops[column.Field] === 'Procedures') {
405
405
  dataRow.push({ text: Ops[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
@@ -411,13 +411,13 @@ class HCInvoiceprintService {
411
411
  dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
412
412
  }
413
413
  else {
414
- if (column.text === 'Line Total' || column.Field === 'Price' || column.text === 'Tax' || column.Field === 'UnPr'
414
+ if (column.text === 'Line Total' || column.Field === 'Price' || column.Field === 'HSN' || column.text === 'Tax' || column.Field === 'UnPr'
415
415
  || column.Field === 'QtyAndUoM' || column.Field === 'Disc' || column.Field === 'Perc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
416
416
  || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
417
417
  if (column.Field === 'Disc') {
418
418
  if (column.type === 'percentage') {
419
419
  if (!tr_utils_1.TrUtils.IsEmpty(Ops[column.Field])) {
420
- dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
420
+ dataRow.push({ text: Ops[column.Field].toString(), alignment: 'right', noWrap: true });
421
421
  }
422
422
  else {
423
423
  dataRow.push({ text: '', noWrap: true });
@@ -425,7 +425,7 @@ class HCInvoiceprintService {
425
425
  }
426
426
  else {
427
427
  if (!tr_utils_1.TrUtils.IsNull(Ops[column.Field])) {
428
- dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
428
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(Ops[column.Field]).toString(), alignment: 'right', noWrap: true });
429
429
  }
430
430
  else {
431
431
  dataRow.push({ text: '', noWrap: true });
@@ -642,7 +642,7 @@ class HCInvoiceprintService {
642
642
  Parts.forEach((part) => {
643
643
  var dataRow = [];
644
644
  columns.forEach((column) => {
645
- if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field])
645
+ if (!tr_utils_1.TrUtils.IsNull(part[column.Field])
646
646
  || column.text === 'Line Total') {
647
647
  // if (part[column.Field] === 'Medications') {
648
648
  // dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
@@ -704,7 +704,7 @@ class HCInvoiceprintService {
704
704
  Ops.forEach((labor) => {
705
705
  var dataRow = [];
706
706
  columns.forEach((column) => {
707
- if (!tr_utils_1.TrUtils.IsFixedZero(labor[column.Field]) && !tr_utils_1.TrUtils.IsNull(labor[column.Field])
707
+ if (!tr_utils_1.TrUtils.IsNull(labor[column.Field])
708
708
  || column.text === 'Line Total') {
709
709
  if (labor[column.Field] === 'Procedures') {
710
710
  dataRow.push({ text: labor[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
@@ -796,7 +796,7 @@ class HCInvoiceprintService {
796
796
  body: [[{ text: 'Paid : ' + tr_utils_1.TrUtils.FixPriceValue(Paid, DecimalsNumber) },
797
797
  { text: 'Due : ' + tr_utils_1.TrUtils.FixPriceValue(Due, DecimalsNumber) }]]
798
798
  },
799
- layout: shared_pdf_service_1.SharedPDFService.LayOutStyle(),
799
+ layout: shared_pdf_service_1.SharedPDFService.LayOutLineStyle(),
800
800
  };
801
801
  }
802
802
  else {
@@ -688,7 +688,7 @@ class InvoiceprintService {
688
688
  // ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn,
689
689
  // TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax,
690
690
  // ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, ROPrintData.Adj,ROPrintData.STotal),
691
- shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails1(ROPrintData, ROPrintData.CustLaborTotalAfterDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalAfterDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.TaxSummary, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, ROPrintData.Adj, ROPrintData.CustLaborTaxGroupDataByPerc, ROPrintData.STotal, isAuto, moreDiscDetails),
691
+ shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails1(ROPrintData, ROPrintData.CustLaborTotalAfterDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalAfterDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.TaxSummary, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, ROPrintData.Adj, ROPrintData.TaxSummary, ROPrintData.STotal, isAuto, moreDiscDetails),
692
692
  this.GetNumberInWords(ROPrintData.CustRoundedTotal),
693
693
  shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, ROPrintData.isCountersale, ROPrintData.Entity.DecimalsNumber),
694
694
  shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
@@ -2,8 +2,8 @@ export declare class InvoicePortraitPrintService {
2
2
  static TableHeaders: number;
3
3
  static GetPrint(InvoicePDFData: any, size: string, printOptions: any, moreDiscDetails: boolean): any;
4
4
  static LayOutStyle(): {
5
- hLineColor: (i: any, node: any) => "gray" | "white";
6
- vLineColor: (i: any, node: any) => "gray" | "white";
5
+ hLineColor: (i: any, node: any) => "white" | "gray";
6
+ vLineColor: (i: any, node: any) => "white" | "gray";
7
7
  };
8
8
  static InvoiceDueStatus(Type: any, Paid: any, Due: any, Status: any, isCounter: boolean, DecimalsNumber: number): any;
9
9
  static GetMainHeaderInfo(InvoicePDFData: any): {
@@ -595,23 +595,29 @@ export declare class SharedPDFService {
595
595
  marginTop: number;
596
596
  marginBottom: number;
597
597
  table: {
598
- widths: number[];
598
+ widths: string[];
599
599
  body: {
600
600
  text: string;
601
601
  }[][];
602
602
  };
603
603
  layout: {
604
- hLineColor: (i: any, node: any) => "gray" | "white";
605
- vLineColor: (i: any, node: any) => "gray" | "white";
604
+ hLineColor: (i: any, node: any) => "white" | "gray";
605
+ vLineColor: (i: any, node: any) => "white" | "gray";
606
606
  };
607
607
  };
608
608
  static LayOutStyle(): {
609
- hLineColor: (i: any, node: any) => "gray" | "white";
610
- vLineColor: (i: any, node: any) => "gray" | "white";
609
+ hLineColor: (i: any, node: any) => "white" | "gray";
610
+ vLineColor: (i: any, node: any) => "white" | "gray";
611
+ };
612
+ static LayOutLineStyle(): {
613
+ hLineWidth: (i: any, node: any) => number;
614
+ vLineWidth: (i: any, node: any) => number;
615
+ hLineColor: (i: any, node: any) => "lightgray" | "white";
616
+ vLineColor: (i: any, node: any) => "lightgray" | "white";
611
617
  };
612
618
  static LayOutStyle1(): {
613
- hLineColor: (i: any, node: any) => "gray" | "white";
614
- vLineColor: (i: any, node: any) => "gray" | "white";
619
+ hLineColor: (i: any, node: any) => "white" | "gray";
620
+ vLineColor: (i: any, node: any) => "white" | "gray";
615
621
  };
616
622
  static GetImage(Image: any, PrLogo: boolean): {
617
623
  image: any;
@@ -2121,15 +2121,14 @@ class SharedPDFService {
2121
2121
  return {
2122
2122
  // lineHeight: 0.7,
2123
2123
  fontSize: this.TableHeaders,
2124
- marginTop: 10,
2124
+ marginTop: 3,
2125
2125
  marginBottom: 5,
2126
2126
  table: {
2127
- widths: [200, 174, 174],
2127
+ widths: ['*', 'auto'],
2128
2128
  body: [[{ text: 'Paid : ' + tr_utils_1.TrUtils.FixPriceValue(Paid, DecimalsNumber) },
2129
- { text: 'Due : ' + tr_utils_1.TrUtils.FixPriceValue(Due, DecimalsNumber) },
2130
- { text: 'Status : ' + Status }]]
2129
+ { text: 'Due : ' + tr_utils_1.TrUtils.FixPriceValue(Due, DecimalsNumber) }]]
2131
2130
  },
2132
- layout: this.LayOutStyle(),
2131
+ layout: this.LayOutLineStyle(),
2133
2132
  };
2134
2133
  }
2135
2134
  else {
@@ -2144,10 +2143,9 @@ class SharedPDFService {
2144
2143
  marginTop: 10,
2145
2144
  marginBottom: 5,
2146
2145
  table: {
2147
- widths: [200, 174, 174],
2146
+ widths: ['*', 'auto'],
2148
2147
  body: [[{ text: 'Paid : ' + Paid },
2149
- { text: 'Due : ' + Due },
2150
- { text: 'Status : ' + Status }]]
2148
+ { text: 'Due : ' + Due }]]
2151
2149
  },
2152
2150
  layout: this.LayOutStyle(),
2153
2151
  };
@@ -2165,6 +2163,22 @@ class SharedPDFService {
2165
2163
  }
2166
2164
  };
2167
2165
  }
2166
+ static LayOutLineStyle() {
2167
+ return {
2168
+ hLineWidth: function (i, node) {
2169
+ return (i === 0 || i === node.table.body.length) ? 0.7 : 0.7;
2170
+ },
2171
+ vLineWidth: function (i, node) {
2172
+ return (i === 0 || i === node.table.widths.length) ? 0.7 : 0.7;
2173
+ },
2174
+ hLineColor: function (i, node) {
2175
+ return (i === 0 || i === 1 || i === 2 || i === node.table.body.length) ? 'lightgray' : 'white';
2176
+ },
2177
+ vLineColor: function (i, node) {
2178
+ return (i === 0 || i === node.table.widths.length) ? 'lightgray' : 'white';
2179
+ }
2180
+ };
2181
+ }
2168
2182
  //Not use this function any where
2169
2183
  static LayOutStyle1() {
2170
2184
  return {
@@ -2576,10 +2590,10 @@ class SharedPDFService {
2576
2590
  var fraction = Math.round(this.frac(value) * 100);
2577
2591
  let f_text = '';
2578
2592
  if (fraction > 0) {
2579
- let paisa = (this.convert_number(fraction) === 'ONE') ? 'PAISA' : ' PAISE';
2580
- f_text = 'AND ' + this.convert_number(fraction) + paisa;
2593
+ let paisa = (this.convert_number(fraction) === 'ONE') ? 'Paisa' : ' Paise';
2594
+ f_text = 'And ' + this.convert_number(fraction) + paisa;
2581
2595
  }
2582
- return this.convert_number(value) + ' RUPEE(S) ' + f_text + ' ONLY';
2596
+ return this.convert_number(value) + ' Rupee(s) ' + f_text + ' Only';
2583
2597
  }
2584
2598
  static frac(f) {
2585
2599
  return f % 1;
@@ -2600,25 +2614,25 @@ class SharedPDFService {
2600
2614
  var one = Math.floor(number % 10);
2601
2615
  var res = '';
2602
2616
  if (Gn > 0) {
2603
- res += (this.convert_number(Gn) + ' CRORE');
2617
+ res += (this.convert_number(Gn) + ' Crore');
2604
2618
  }
2605
2619
  if (kn > 0) {
2606
2620
  res += (((res === '') ? '' : ' ') +
2607
- this.convert_number(kn) + ' LAKH');
2621
+ this.convert_number(kn) + ' Lakh');
2608
2622
  }
2609
2623
  if (Hn > 0) {
2610
2624
  res += (((res === '') ? '' : ' ') +
2611
- this.convert_number(Hn) + ' THOUSAND');
2625
+ this.convert_number(Hn) + ' Thousand');
2612
2626
  }
2613
2627
  if (Dn) {
2614
2628
  res += (((res === '') ? '' : ' ') +
2615
- this.convert_number(Dn) + ' HUNDRED');
2629
+ this.convert_number(Dn) + ' Hundred');
2616
2630
  }
2617
- var ones = Array('', 'ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', 'SEVEN', 'EIGHT', 'NINE', 'TEN', 'ELEVEN', 'TWELVE', 'THIRTEEN', 'FOURTEEN', 'FIFTEEN', 'SIXTEEN', 'SEVENTEEN', 'EIGHTEEN', 'NINETEEN');
2618
- var tens = Array('', '', 'TWENTY', 'THIRTY', 'FOURTY', 'FIFTY', 'SIXTY', 'SEVENTY', 'EIGHTY', 'NINETY');
2631
+ var ones = Array('', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen');
2632
+ var tens = Array('', '', 'Twenty', 'Thirty', 'Forty', 'Fifty', 'Sixty', 'Seventy', 'Eighty', 'Ninety');
2619
2633
  if (tn > 0 || one > 0) {
2620
2634
  if (!(res === '')) {
2621
- res += ' AND ';
2635
+ res += ' And ';
2622
2636
  }
2623
2637
  if (tn < 2) {
2624
2638
  res += ones[tn * 10 + one];
@@ -2631,7 +2645,7 @@ class SharedPDFService {
2631
2645
  }
2632
2646
  }
2633
2647
  if (res === '') {
2634
- res = 'ZERO';
2648
+ res = 'Zero';
2635
2649
  }
2636
2650
  return res;
2637
2651
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.4.72",
3
+ "version": "1.4.74",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",