shareneus 1.7.354 → 1.7.355

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.
@@ -529,7 +529,7 @@ export declare class SharedPDFService {
529
529
  Field: string;
530
530
  })[];
531
531
  static ALLPartsCGSTTaxListTable(PartsTaxInfo: any, ShowAccParts: any, ShowTaxColumn: any): any;
532
- static CreateHeadingAllHSNTaxList(ShowIGST: any): {
532
+ static CreateHeadingAllHSNTaxList(ShowIGST: any, hasCESS: boolean): {
533
533
  text: string;
534
534
  style: string;
535
535
  fontSize: number;
@@ -1555,11 +1555,12 @@ class SharedPDFService {
1555
1555
  }
1556
1556
  }
1557
1557
  static AllHSNPartCGSTTaxListTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
1558
+ const hasCESS = this.hasCESS(PartsTaxInfo);
1558
1559
  if (ShowIGST) {
1559
1560
  return {
1560
1561
  style: 'tableExample',
1561
1562
  table: {
1562
- widths: [25, 60, 50],
1563
+ widths: hasCESS ? [25, 60, 50, 40] : [25, 60, 50],
1563
1564
  headerRows: 1,
1564
1565
  body: this.CreateHSNTaxTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
1565
1566
  },
@@ -1570,7 +1571,7 @@ class SharedPDFService {
1570
1571
  return {
1571
1572
  style: 'tableExample',
1572
1573
  table: {
1573
- widths: [25, 60, 40, 40],
1574
+ widths: hasCESS ? [25, 60, 40, 40, 40] : [25, 60, 40, 40],
1574
1575
  headerRows: 1,
1575
1576
  body: this.CreateHSNTaxTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
1576
1577
  },
@@ -1579,11 +1580,12 @@ class SharedPDFService {
1579
1580
  }
1580
1581
  }
1581
1582
  static AllHSNPartCGSTTaxListTable(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
1583
+ const hasCESS = this.hasCESS(PartsTaxInfo);
1582
1584
  if (ShowIGST) {
1583
1585
  return {
1584
1586
  style: 'tableExample',
1585
1587
  table: {
1586
- widths: [40, 'auto', 50],
1588
+ widths: hasCESS ? [40, 'auto', 50, 40] : [40, 'auto', 50],
1587
1589
  headerRows: 1,
1588
1590
  body: this.CreateHSNTaxTable(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
1589
1591
  },
@@ -1594,7 +1596,7 @@ class SharedPDFService {
1594
1596
  return {
1595
1597
  style: 'tableExample',
1596
1598
  table: {
1597
- widths: [50, 65, 50, 50],
1599
+ widths: hasCESS ? [50, 65, 50, 50, 40] : [50, 65, 50, 50],
1598
1600
  headerRows: 1,
1599
1601
  body: this.CreateHSNTaxTable(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
1600
1602
  },
@@ -1675,7 +1677,7 @@ class SharedPDFService {
1675
1677
  return [{}];
1676
1678
  }
1677
1679
  }
1678
- static CreateHeadingAllHSNTaxList(ShowIGST) {
1680
+ static CreateHeadingAllHSNTaxList(ShowIGST, hasCESS) {
1679
1681
  let HeaderNames = [{ text: 'HSN', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'HSN' },
1680
1682
  // { text: 'CGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CGST' },
1681
1683
  // { text: 'SGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'SGST' },
@@ -1690,6 +1692,9 @@ class SharedPDFService {
1690
1692
  HeaderNames.splice(1, 0, { text: 'CGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
1691
1693
  HeaderNames.splice(2, 0, { text: 'SGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'SGST' });
1692
1694
  }
1695
+ if (hasCESS) {
1696
+ HeaderNames.push({ text: 'CESS', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CESS' });
1697
+ }
1693
1698
  return HeaderNames;
1694
1699
  }
1695
1700
  static CreateHeadingAllTaxList(ShowIGST, hasCESS) {
@@ -1728,7 +1733,9 @@ class SharedPDFService {
1728
1733
  static CreateHSNTaxTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
1729
1734
  if (!tr_utils_1.TrUtils.IsNull(PartsTaxInfo) && PartsTaxInfo.length !== 0 && ShowAccParts && ShowTaxColumn) {
1730
1735
  var body = [];
1736
+ console.log('PartsTaxInfo', PartsTaxInfo);
1731
1737
  const hasCESS = this.hasCESS(PartsTaxInfo);
1738
+ console.log('hasCESS', hasCESS);
1732
1739
  let columns = this.CreateHeadingAllTaxList(ShowIGST, hasCESS);
1733
1740
  body.push(columns);
1734
1741
  PartsTaxInfo.forEach((part) => {
@@ -1762,13 +1769,14 @@ class SharedPDFService {
1762
1769
  static CreateHSNTaxTable(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
1763
1770
  if (!tr_utils_1.TrUtils.IsNull(PartsTaxInfo) && PartsTaxInfo.length !== 0 && ShowAccParts && ShowTaxColumn) {
1764
1771
  var body = [];
1765
- let columns = this.CreateHeadingAllHSNTaxList(ShowIGST);
1772
+ const hasCESS = this.hasCESS(PartsTaxInfo);
1773
+ let columns = this.CreateHeadingAllHSNTaxList(ShowIGST, hasCESS);
1766
1774
  body.push(columns);
1767
1775
  PartsTaxInfo.forEach((part) => {
1768
1776
  var dataRow = [];
1769
1777
  columns.forEach((column) => {
1770
1778
  if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) &&
1771
- !tr_utils_1.TrUtils.IsNull(part[column.Field]) || column.Field === 'SGST' || column.Field === 'CGST'
1779
+ !tr_utils_1.TrUtils.IsNull(part[column.Field]) || column.Field === 'SGST' || column.Field === 'CGST' || column.Field === 'CESS'
1772
1780
  || column.Field === 'TotalTaxAmount') {
1773
1781
  if (column.Field === 'SGSTLaborAmt') {
1774
1782
  dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.7.354",
3
+ "version": "1.7.355",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1649,12 +1649,12 @@ export class SharedPDFService {
1649
1649
  }
1650
1650
 
1651
1651
  static AllHSNPartCGSTTaxListTable1(PartsTaxInfo: any, ShowAccParts: any, ShowIGST: any, ShowTaxColumn: any) {
1652
-
1652
+ const hasCESS: boolean = this.hasCESS(PartsTaxInfo);
1653
1653
  if (ShowIGST) {
1654
1654
  return {
1655
1655
  style: 'tableExample',
1656
1656
  table: {
1657
- widths: [25, 60, 50],
1657
+ widths: hasCESS ? [25, 60, 50, 40] : [25, 60, 50],
1658
1658
  headerRows: 1,
1659
1659
  body: this.CreateHSNTaxTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
1660
1660
  },
@@ -1664,7 +1664,7 @@ export class SharedPDFService {
1664
1664
  return {
1665
1665
  style: 'tableExample',
1666
1666
  table: {
1667
- widths: [25, 60, 40, 40],
1667
+ widths: hasCESS ? [25, 60, 40, 40, 40] : [25, 60, 40, 40],
1668
1668
  headerRows: 1,
1669
1669
  body: this.CreateHSNTaxTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
1670
1670
  },
@@ -1674,12 +1674,12 @@ export class SharedPDFService {
1674
1674
  }
1675
1675
 
1676
1676
  static AllHSNPartCGSTTaxListTable(PartsTaxInfo: any, ShowAccParts: any, ShowIGST: any, ShowTaxColumn: any) {
1677
-
1677
+ const hasCESS: boolean = this.hasCESS(PartsTaxInfo);
1678
1678
  if (ShowIGST) {
1679
1679
  return {
1680
1680
  style: 'tableExample',
1681
1681
  table: {
1682
- widths: [40, 'auto', 50],
1682
+ widths: hasCESS ? [40, 'auto', 50, 40] : [40, 'auto', 50],
1683
1683
  headerRows: 1,
1684
1684
  body: this.CreateHSNTaxTable(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
1685
1685
  },
@@ -1689,7 +1689,7 @@ export class SharedPDFService {
1689
1689
  return {
1690
1690
  style: 'tableExample',
1691
1691
  table: {
1692
- widths: [50, 65, 50, 50],
1692
+ widths: hasCESS ? [50, 65, 50, 50, 40] : [50, 65, 50, 50],
1693
1693
  headerRows: 1,
1694
1694
  body: this.CreateHSNTaxTable(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
1695
1695
  },
@@ -1773,7 +1773,7 @@ export class SharedPDFService {
1773
1773
  }
1774
1774
  }
1775
1775
 
1776
- static CreateHeadingAllHSNTaxList(ShowIGST: any) {
1776
+ static CreateHeadingAllHSNTaxList(ShowIGST: any, hasCESS: boolean) {
1777
1777
  let HeaderNames = [{ text: 'HSN', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'HSN' },
1778
1778
  // { text: 'CGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CGST' },
1779
1779
  // { text: 'SGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'SGST' },
@@ -1782,10 +1782,13 @@ export class SharedPDFService {
1782
1782
  { text: 'Amount', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'TotalTaxAmount' },
1783
1783
  ];
1784
1784
  if (ShowIGST) {
1785
- HeaderNames.splice(1, 0, { text: 'IGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'IGST' })
1785
+ HeaderNames.splice(1, 0, { text: 'IGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'IGST' });
1786
1786
  } else {
1787
- HeaderNames.splice(1, 0, { text: 'CGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CGST' })
1788
- HeaderNames.splice(2, 0, { text: 'SGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'SGST' })
1787
+ HeaderNames.splice(1, 0, { text: 'CGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
1788
+ HeaderNames.splice(2, 0, { text: 'SGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'SGST' });
1789
+ }
1790
+ if (hasCESS) {
1791
+ HeaderNames.push({ text: 'CESS', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CESS' });
1789
1792
  }
1790
1793
  return HeaderNames;
1791
1794
  }
@@ -1829,7 +1832,9 @@ export class SharedPDFService {
1829
1832
  static CreateHSNTaxTable1(PartsTaxInfo: any, ShowAccParts: any, ShowIGST: any, ShowTaxColumn: any) {
1830
1833
  if (!TrUtils.IsNull(PartsTaxInfo) && PartsTaxInfo.length !== 0 && ShowAccParts && ShowTaxColumn) {
1831
1834
  var body: any = [];
1835
+ console.log('PartsTaxInfo', PartsTaxInfo);
1832
1836
  const hasCESS: boolean = this.hasCESS(PartsTaxInfo);
1837
+ console.log('hasCESS', hasCESS);
1833
1838
  let columns: any = this.CreateHeadingAllTaxList(ShowIGST, hasCESS);
1834
1839
  body.push(columns);
1835
1840
  PartsTaxInfo.forEach((part: any) => {
@@ -1861,13 +1866,14 @@ export class SharedPDFService {
1861
1866
  static CreateHSNTaxTable(PartsTaxInfo: any, ShowAccParts: any, ShowIGST: any, ShowTaxColumn: any) {
1862
1867
  if (!TrUtils.IsNull(PartsTaxInfo) && PartsTaxInfo.length !== 0 && ShowAccParts && ShowTaxColumn) {
1863
1868
  var body: any = [];
1864
- let columns: any = this.CreateHeadingAllHSNTaxList(ShowIGST);
1869
+ const hasCESS: boolean = this.hasCESS(PartsTaxInfo);
1870
+ let columns: any = this.CreateHeadingAllHSNTaxList(ShowIGST, hasCESS);
1865
1871
  body.push(columns);
1866
1872
  PartsTaxInfo.forEach((part: any) => {
1867
1873
  var dataRow: any = [];
1868
1874
  columns.forEach((column: any) => {
1869
1875
  if (!TrUtils.IsFixedZero(part[column.Field]) &&
1870
- !TrUtils.IsNull(part[column.Field]) || column.Field === 'SGST' || column.Field === 'CGST'
1876
+ !TrUtils.IsNull(part[column.Field]) || column.Field === 'SGST' || column.Field === 'CGST' || column.Field === 'CESS'
1871
1877
  || column.Field === 'TotalTaxAmount') {
1872
1878
  if (column.Field === 'SGSTLaborAmt') {
1873
1879
  dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });