shareneus 1.4.83 → 1.4.85

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.
@@ -442,7 +442,17 @@ class HCInvoiceprintService {
442
442
  }
443
443
  }
444
444
  else {
445
- dataRow.push({ text: Ops[column.Field].toString(), bold: Ops.bold });
445
+ if (column.Field === 'Desc') {
446
+ let DescData = [];
447
+ DescData.push({ text: Ops[column.Field].toString(), bold: Ops.bold });
448
+ if (!tr_utils_1.TrUtils.IsEmpty(Ops['EDesc'])) {
449
+ DescData.push({ text: Ops['EDesc'].toString(), color: 'grey' });
450
+ }
451
+ dataRow.push({ stack: DescData });
452
+ }
453
+ else {
454
+ dataRow.push({ text: Ops[column.Field].toString(), bold: Ops.bold });
455
+ }
446
456
  }
447
457
  }
448
458
  }
@@ -720,7 +730,18 @@ class HCInvoiceprintService {
720
730
  }
721
731
  }
722
732
  else {
723
- dataRow.push({ text: labor[column.Field].toString() });
733
+ // dataRow.push({ text: labor[column.Field].toString() });
734
+ if (column.Field === 'Desc') {
735
+ let DescData = [];
736
+ DescData.push(labor[column.Field].toString());
737
+ if (!tr_utils_1.TrUtils.IsEmpty(labor['EDesc'])) {
738
+ DescData.push({ text: labor['EDesc'].toString(), color: 'grey' });
739
+ }
740
+ dataRow.push({ stack: DescData });
741
+ }
742
+ else {
743
+ dataRow.push({ text: labor[column.Field].toString() });
744
+ }
724
745
  }
725
746
  }
726
747
  }
@@ -113,19 +113,7 @@ export declare class InvoicePortraitPrintService {
113
113
  lineWidth: number;
114
114
  }[];
115
115
  };
116
- static GetSignatures(CName: any, Total: any): ({
117
- columns: ({
118
- text: string;
119
- fontSize: number;
120
- width: number;
121
- bold?: undefined;
122
- } | {
123
- text: string;
124
- bold: boolean;
125
- fontSize: number;
126
- width: string;
127
- })[];
128
- } | {
116
+ static GetSignatures(CName: any, Total: any): (string | {
129
117
  style: string;
130
118
  text: (string | {
131
119
  text: any;
@@ -173,20 +161,23 @@ export declare class InvoicePortraitPrintService {
173
161
  marginTop: number;
174
162
  table: {
175
163
  widths: string[];
176
- body: (string | {
177
- stack: {
178
- style: string;
179
- table: {
180
- widths: number[];
181
- headerRows: number;
182
- body: any;
183
- };
184
- layout: {
185
- hLineWidth: (i: any, node: any) => 0 | 0.1;
186
- vLineWidth: (i: any, node: any) => number;
187
- hLineColor: (i: any, node: any) => string;
188
- };
189
- }[];
164
+ body: ({
165
+ stack: (string | {
166
+ stack: {
167
+ style: string;
168
+ table: {
169
+ widths: number[];
170
+ headerRows: number;
171
+ body: any;
172
+ };
173
+ layout: {
174
+ hLineWidth: (i: any, node: any) => 0 | 0.1;
175
+ vLineWidth: (i: any, node: any) => number;
176
+ hLineColor: (i: any, node: any) => string;
177
+ };
178
+ }[];
179
+ })[];
180
+ columns?: undefined;
190
181
  } | {
191
182
  columns: ({
192
183
  style: string[];
@@ -202,6 +193,7 @@ export declare class InvoicePortraitPrintService {
202
193
  text: string;
203
194
  width: number;
204
195
  })[];
196
+ stack?: undefined;
205
197
  })[][];
206
198
  };
207
199
  layout: string;
@@ -245,6 +237,35 @@ export declare class InvoicePortraitPrintService {
245
237
  hLineColor: (i: any, node: any) => string;
246
238
  };
247
239
  };
240
+ static PartsTaxAmounts1(PartsTaxInfo: any, ShowAccParts: any, ShowIGST: any, ShowTaxColumn: any): "" | {
241
+ stack: {
242
+ style: string;
243
+ table: {
244
+ widths: number[];
245
+ headerRows: number;
246
+ body: any;
247
+ };
248
+ layout: {
249
+ hLineWidth: (i: any, node: any) => 0 | 0.1;
250
+ vLineWidth: (i: any, node: any) => number;
251
+ hLineColor: (i: any, node: any) => string;
252
+ };
253
+ }[];
254
+ };
255
+ static AllHSNPartCGSTTaxListTable1(PartsTaxInfo: any, ShowAccParts: any, ShowIGST: any, ShowTaxColumn: any): {
256
+ style: string;
257
+ table: {
258
+ widths: number[];
259
+ headerRows: number;
260
+ body: any;
261
+ };
262
+ layout: {
263
+ hLineWidth: (i: any, node: any) => 0 | 0.1;
264
+ vLineWidth: (i: any, node: any) => number;
265
+ hLineColor: (i: any, node: any) => string;
266
+ };
267
+ };
268
+ static CreateHSNTaxTable1(PartsTaxInfo: any, ShowAccParts: any, ShowIGST: any, ShowTaxColumn: any): any;
248
269
  static CreateHeadingAllHSNTaxList(ShowIGST: any): {
249
270
  text: string;
250
271
  style: string;
@@ -253,6 +274,14 @@ export declare class InvoicePortraitPrintService {
253
274
  Field: string;
254
275
  alignment: string;
255
276
  }[];
277
+ static CreateHeadingAllTaxList(ShowIGST: any): {
278
+ text: string;
279
+ style: string;
280
+ fontSize: number;
281
+ lineHeight: number;
282
+ Field: string;
283
+ alignment: string;
284
+ }[];
256
285
  static CreateHSNTaxTable(PartsTaxInfo: any, ShowAccParts: any, ShowIGST: any, ShowTaxColumn: any): any;
257
286
  static GetNumberInWords(TotalAmount: any): {
258
287
  columns: ({
@@ -39,6 +39,7 @@ class InvoicePortraitPrintService {
39
39
  },
40
40
  this.GetItemsTable(InvoicePDFData.Ops, InvoicePDFData.Items, InvoicePDFData.ShowTaxColumn, InvoicePDFData.SType, printOptions, size, InvoicePDFData.Entity.DecimalsNumber),
41
41
  [this.TotalDetails(InvoicePDFData, moreDiscDetails, InvoicePDFData.Entity.DecimalsNumber)],
42
+ [this.GetNumberInWords(InvoicePDFData.CustRoundedTotal)],
42
43
  [this.InvoiceDueStatus(InvoicePDFData.Type, InvoicePDFData.Paid, InvoicePDFData.Due, InvoicePDFData.Sts, InvoicePDFData.isCountersale, InvoicePDFData.Entity.DecimalsNumber)
43
44
  ],
44
45
  {
@@ -108,7 +109,7 @@ class InvoicePortraitPrintService {
108
109
  return {
109
110
  // lineHeight: 0.7,
110
111
  fontSize: this.TableHeaders,
111
- marginTop: 10,
112
+ marginTop: 3,
112
113
  marginBottom: 5,
113
114
  table: {
114
115
  widths: ['*', 'auto'],
@@ -359,7 +360,7 @@ class InvoicePortraitPrintService {
359
360
  // };
360
361
  // }
361
362
  static GetSignatures(CName, Total) {
362
- return [[this.GetNumberInWords(Total), this.CompanyName(CName)]];
363
+ return [['', this.CompanyName(CName)]];
363
364
  }
364
365
  static CompanyName(CName) {
365
366
  return {
@@ -434,7 +435,17 @@ class InvoicePortraitPrintService {
434
435
  var _a;
435
436
  let dataRow = [];
436
437
  dataRow.push({ text: index + 1, });
437
- dataRow.push({ text: item.Desc, });
438
+ if (!tr_utils_1.TrUtils.IsEmpty(item.EDesc)) {
439
+ let DescData = [];
440
+ DescData.push({ text: item.Desc, });
441
+ if (!tr_utils_1.TrUtils.IsEmpty(item['EDesc'])) {
442
+ DescData.push({ text: item.EDesc, color: 'grey' });
443
+ }
444
+ dataRow.push({ stack: DescData });
445
+ }
446
+ else {
447
+ dataRow.push({ text: item.Desc, });
448
+ }
438
449
  if (ShowTaxColumn) {
439
450
  dataRow.push({ text: item.SAC, alignment: 'center', style: ['headerstyle'], });
440
451
  }
@@ -503,7 +514,18 @@ class InvoicePortraitPrintService {
503
514
  var _a, _b, _c;
504
515
  let dataRow = [];
505
516
  dataRow.push({ text: index + 1, });
506
- dataRow.push({ text: item.Desc, });
517
+ // dataRow.push({ text: item.Desc, });
518
+ if (!tr_utils_1.TrUtils.IsEmpty(item.EDesc)) {
519
+ let DescData = [];
520
+ DescData.push({ text: item.Desc, });
521
+ if (!tr_utils_1.TrUtils.IsEmpty(item['EDesc'])) {
522
+ DescData.push({ text: item.EDesc, color: 'grey' });
523
+ }
524
+ dataRow.push({ stack: DescData });
525
+ }
526
+ else {
527
+ dataRow.push({ text: item.Desc, });
528
+ }
507
529
  if (ShowTaxColumn) {
508
530
  dataRow.push({ text: item.HSN, alignment: 'center', style: ['headerstyle'], });
509
531
  }
@@ -599,7 +621,9 @@ class InvoicePortraitPrintService {
599
621
  widths: ['*', '*'],
600
622
  body: [
601
623
  [
602
- shared_pdf_service_1.SharedPDFService.PartsTaxAmounts1(ROPrintData.TaxSummary, true, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn),
624
+ {
625
+ stack: [this.PartsTaxAmounts1(ROPrintData.TaxSummary, true, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn)]
626
+ },
603
627
  {
604
628
  columns: [{ text: '', width: moreDiscDetails ? 120 : 150 }, this.GrandTotal(ROPrintData, '0.00', ROPrintData.CustPartsTotalBeforeDisc, totalDisc, totalTax, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, null, ROPrintData.Consolidate, ROPrintData.STotal, moreDiscDetails, ROPrintData.Entity.DecimalsNumber)],
605
629
  }
@@ -721,6 +745,74 @@ class InvoicePortraitPrintService {
721
745
  };
722
746
  }
723
747
  }
748
+ static PartsTaxAmounts1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
749
+ if (ShowTaxColumn && !tr_utils_1.TrUtils.IsNull(PartsTaxInfo) && PartsTaxInfo.length > 0) {
750
+ return {
751
+ stack: [this.AllHSNPartCGSTTaxListTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)]
752
+ };
753
+ }
754
+ else {
755
+ return '';
756
+ }
757
+ }
758
+ static AllHSNPartCGSTTaxListTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
759
+ if (ShowIGST) {
760
+ return {
761
+ style: 'tableExample',
762
+ table: {
763
+ widths: [25, 60, 50],
764
+ headerRows: 1,
765
+ body: this.CreateHSNTaxTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
766
+ },
767
+ layout: this.HeaderLineStyle(),
768
+ };
769
+ }
770
+ else {
771
+ return {
772
+ style: 'tableExample',
773
+ table: {
774
+ widths: [25, 60, 40, 40],
775
+ headerRows: 1,
776
+ body: shared_pdf_service_1.SharedPDFService.CreateHSNTaxTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
777
+ },
778
+ layout: this.HeaderLineStyle(),
779
+ };
780
+ }
781
+ }
782
+ static CreateHSNTaxTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
783
+ if (!tr_utils_1.TrUtils.IsNull(PartsTaxInfo) && PartsTaxInfo.length !== 0 && ShowAccParts && ShowTaxColumn) {
784
+ var body = [];
785
+ let columns = this.CreateHeadingAllTaxList(ShowIGST);
786
+ body.push(columns);
787
+ PartsTaxInfo.forEach((part) => {
788
+ var dataRow = [];
789
+ columns.forEach((column) => {
790
+ if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) &&
791
+ !tr_utils_1.TrUtils.IsNull(part[column.Field]) || column.Field === 'SGST' || column.Field === 'CGST' || column.Field === 'SGSTAmt' || column.Field === 'CGSTAmt'
792
+ || column.Field === 'TotalTaxableAmount') {
793
+ if (column.Field === 'TotalTaxableAmount' || column.Field === 'SGSTAmt' || column.Field === 'CGSTAmt' || column.Field === 'IGSTAmt') {
794
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(part[column.Field]), alignment: 'right', opacity: 0.7, nowrap: true, fontSize: 6 });
795
+ }
796
+ else if (column.Field === 'CombinedTaxPercentage') {
797
+ dataRow.push({ text: part[column.Field].toString() + '%', alignment: 'left', opacity: 0.7, nowrap: true, fontSize: 6 });
798
+ }
799
+ else {
800
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'left', opacity: 0.7, nowrap: true, fontSize: 6 });
801
+ }
802
+ }
803
+ else {
804
+ part[column.Field] = '';
805
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'left', opacity: 0.7, fontSize: 6 });
806
+ }
807
+ });
808
+ body.push(dataRow);
809
+ });
810
+ return body;
811
+ }
812
+ else {
813
+ return [{}];
814
+ }
815
+ }
724
816
  static CreateHeadingAllHSNTaxList(ShowIGST) {
725
817
  let HeaderNames = [{ text: 'HSN', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'HSN', alignment: 'right' },
726
818
  { text: 'Taxable Value', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'TotalTaxableAmount', alignment: 'right' },
@@ -735,11 +827,32 @@ class InvoicePortraitPrintService {
735
827
  }
736
828
  return HeaderNames;
737
829
  }
830
+ static CreateHeadingAllTaxList(ShowIGST) {
831
+ let HeaderNames = [
832
+ // { text: 'CGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CGST' },
833
+ // { text: 'SGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'SGST' },
834
+ // { text: 'Count', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'PartsCount' },
835
+ { text: 'Tax Rate', style: 'tableheader2', fontSize: 6, lineHeight: 0.8, Field: 'CombinedTaxPercentage', alignment: 'left' },
836
+ { text: 'Taxable Amount', style: 'tableheader2', fontSize: 6, lineHeight: 0.8, Field: 'TotalTaxableAmount', alignment: 'right' },
837
+ // { text: 'Tax Amount', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'TotalTaxAmount' },
838
+ ];
839
+ if (ShowIGST) {
840
+ // HeaderNames.splice(1, 0, { text: 'IGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'IGST' });
841
+ HeaderNames.splice(2, 0, { text: 'IGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.8, Field: 'IGSTAmt', alignment: 'right' });
842
+ }
843
+ else {
844
+ // HeaderNames.splice(1, 0, { text: 'CGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
845
+ HeaderNames.splice(2, 0, { text: 'CGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.8, Field: 'CGSTAmt', alignment: 'right' });
846
+ // HeaderNames.splice(3, 0, { text: 'SGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
847
+ HeaderNames.splice(3, 0, { text: 'SGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.8, Field: 'SGSTAmt', alignment: 'right' });
848
+ }
849
+ return HeaderNames;
850
+ }
738
851
  static CreateHSNTaxTable(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
739
852
  if (!tr_utils_1.TrUtils.IsNull(PartsTaxInfo) && PartsTaxInfo.length !== 0 && ShowAccParts && ShowTaxColumn) {
740
853
  var body = [];
741
854
  let columns = this.CreateHeadingAllHSNTaxList(ShowIGST);
742
- body.push(columns);
855
+ // body.push(columns);
743
856
  PartsTaxInfo.forEach((part) => {
744
857
  var dataRow = [];
745
858
  columns.forEach((column) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.4.83",
3
+ "version": "1.4.85",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",