shareneus 1.4.63 → 1.4.65

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.
@@ -765,7 +765,7 @@ class HCInvoiceprintService {
765
765
  static CommonTotalDetails(ROPrintData, index, numberofCopies, withPass, isAuto, moreDiscDetails) {
766
766
  // console.log('ROPrintData', ROPrintData);
767
767
  let CommonDetails = [
768
- 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.CustTaxGroupDataByPerc, 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),
768
+ 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.CustTaxGroupDataByPerc, 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),
769
769
  this.GetNumberInWords(ROPrintData.CustRoundedTotal),
770
770
  this.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, ROPrintData.isCountersale, ROPrintData.Entity.DecimalsNumber),
771
771
  shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
@@ -792,10 +792,9 @@ class HCInvoiceprintService {
792
792
  marginTop: 10,
793
793
  marginBottom: 5,
794
794
  table: {
795
- widths: [187, 170, 170],
795
+ widths: ['*', 'auto'],
796
796
  body: [[{ text: 'Paid : ' + tr_utils_1.TrUtils.FixPriceValue(Paid, DecimalsNumber) },
797
- { text: 'Due : ' + tr_utils_1.TrUtils.FixPriceValue(Due, DecimalsNumber) },
798
- { text: 'Status : ' + Status }]]
797
+ { text: 'Due : ' + tr_utils_1.TrUtils.FixPriceValue(Due, DecimalsNumber) }]]
799
798
  },
800
799
  layout: shared_pdf_service_1.SharedPDFService.LayOutStyle(),
801
800
  };
@@ -17,6 +17,7 @@ export declare class InvoiceTotalsService {
17
17
  static GetRetPartsTotalAfterDiscount(PartsList: any): any;
18
18
  static GetNonRetPartsTotalAfterDiscount(PartsList: any): any;
19
19
  static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, opCodesList: any, PartsList: any, TaxCodes: any, DecimalsNumber: any): any;
20
+ static groupTaxData(items: any[], ops: any[]): any[];
20
21
  static GetTaxGroupingForLaborByPerc(opCodesList: any, TaxCodes: any, DecimalsNumber: any): any[];
21
22
  static GetTaxGroupingForPartsByPerc(Parts: any, TaxCodes: any, DecimalsNumber: any): any[];
22
23
  static GetTaxGroupingInfoBySAC(FinalMatchedLabors: any, TaxCodes: any, DecimalsNumber: any): any[];
@@ -246,6 +246,7 @@ class InvoiceTotalsService {
246
246
  finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(PartsList, TaxCodes, DecimalsNumber);
247
247
  finalTotalsData.CustTaxGroupDataByPerc = this.GetTaxGroupingForPartsByPerc(PartsList, TaxCodes, DecimalsNumber);
248
248
  finalTotalsData.CustLaborTaxGroupDataByPerc = this.GetTaxGroupingForLaborByPerc(opCodesList, TaxCodes, DecimalsNumber);
249
+ finalTotalsData.TaxSummary = this.groupTaxData(finalTotalsData.CustTaxGroupData, finalTotalsData.CustLaborTaxGroupDataByPerc);
249
250
  finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
250
251
  finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
251
252
  finalTotalsData.CustRetRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.RetTotal, DecimalsNumber);
@@ -260,6 +261,28 @@ class InvoiceTotalsService {
260
261
  }
261
262
  return finalTotalsData;
262
263
  }
264
+ static groupTaxData(items, ops) {
265
+ const combined = [...items, ...ops];
266
+ const groupedMap = new Map();
267
+ combined.forEach(item => {
268
+ if (groupedMap.has(item.CombinedTaxPercentage)) {
269
+ const existing = groupedMap.get(item.CombinedTaxPercentage);
270
+ existing.CGSTAmt = (0, aggregation_1.addition)(existing.CGSTAmt, item.CGSTAmt);
271
+ existing.SGSTAmt = (0, aggregation_1.addition)(existing.SGSTAmt, item.SGSTAmt);
272
+ // Sum IGST if present
273
+ if (item.IGSTAmt !== undefined) {
274
+ existing.IGSTAmt = (0, aggregation_1.addition)(existing.IGSTAmt || 0, item.IGSTAmt);
275
+ }
276
+ existing.TotalTaxAmount = (0, aggregation_1.addition)(existing.TotalTaxAmount || 0, item.TotalTaxAmount || 0);
277
+ existing.TotalTaxableAmount = (0, aggregation_1.addition)(existing.TotalTaxableAmount || 0, item.TotalTaxableAmount || 0);
278
+ }
279
+ else {
280
+ // Clone the object to avoid mutation
281
+ groupedMap.set(item.CombinedTaxPercentage, Object.assign({}, item));
282
+ }
283
+ });
284
+ return Array.from(groupedMap.values());
285
+ }
263
286
  static GetTaxGroupingForLaborByPerc(opCodesList, TaxCodes, DecimalsNumber) {
264
287
  opCodesList = this.GetCombinedTaxPercentage(tr_utils_1.TrUtils.Stringify(opCodesList), TaxCodes);
265
288
  // opCodesList = this.ResetPartsHSNIfInvalid(opCodesList);
@@ -468,6 +468,7 @@ export declare class SharedPDFService {
468
468
  fontSize: number;
469
469
  lineHeight: number;
470
470
  Field: string;
471
+ alignment: string;
471
472
  }[];
472
473
  static CreateHSNTaxTable1(PartsTaxInfo: any, ShowAccParts: any, ShowIGST: any, ShowTaxColumn: any): any;
473
474
  static CreateHSNTaxTable(PartsTaxInfo: any, ShowAccParts: any, ShowIGST: any, ShowTaxColumn: any): any;
@@ -653,39 +654,57 @@ export declare class SharedPDFService {
653
654
  static GetSignatures(CName: any, For: any, Type: any): {
654
655
  columns: {
655
656
  stack: ({
656
- style: string;
657
- text: (string | {
658
- text: any;
659
- bold: string;
660
- })[];
657
+ text: {
658
+ style: string;
659
+ text: (string | {
660
+ text: any;
661
+ bold: string;
662
+ })[];
663
+ };
664
+ alignment: string;
665
+ columns?: undefined;
661
666
  } | {
662
667
  columns: any[];
668
+ text?: undefined;
669
+ alignment?: undefined;
663
670
  })[];
664
671
  }[];
665
672
  };
666
673
  static GetInvSignatures(CName: any, isCounterSale: boolean): {
667
674
  columns: {
668
675
  stack: ({
669
- style: string;
670
- text: (string | {
671
- text: any;
672
- bold: string;
673
- })[];
676
+ text: {
677
+ style: string;
678
+ text: (string | {
679
+ text: any;
680
+ bold: string;
681
+ })[];
682
+ };
683
+ alignment: string;
684
+ columns?: undefined;
674
685
  } | {
675
686
  columns: any[];
687
+ text?: undefined;
688
+ alignment?: undefined;
676
689
  })[];
677
690
  }[];
678
691
  };
679
692
  static GetHCInvSignatures(CName: any, isCounterSale: boolean): {
680
693
  columns: {
681
694
  stack: ({
682
- style: string;
683
- text: (string | {
684
- text: any;
685
- bold: string;
686
- })[];
695
+ text: {
696
+ style: string;
697
+ text: (string | {
698
+ text: any;
699
+ bold: string;
700
+ })[];
701
+ };
702
+ alignment: string;
703
+ columns?: undefined;
687
704
  } | {
688
705
  columns: any[];
706
+ text?: undefined;
707
+ alignment?: undefined;
689
708
  })[];
690
709
  }[];
691
710
  };
@@ -700,21 +719,22 @@ export declare class SharedPDFService {
700
719
  static Authorizedsignature(): {
701
720
  style: string;
702
721
  text: string[];
722
+ width: string;
703
723
  };
704
724
  static Accountantsignature(): {
705
725
  style: string;
706
726
  text: string[];
707
- marginLeft: number;
727
+ width: string;
708
728
  };
709
729
  static CustomerSignature(): {
710
730
  style: string;
711
731
  text: string[];
712
- marginLeft: number;
732
+ width: string;
713
733
  };
714
734
  static PatientSignature(): {
715
735
  style: string;
716
736
  text: string[];
717
- marginLeft: number;
737
+ width: string;
718
738
  };
719
739
  static SurveyorSignature(For: any, Type: any): any;
720
740
  static GetHeadersWithDiffDisc(ROData: any, PrintPartNumber: any): any;
@@ -848,7 +848,7 @@ class SharedPDFService {
848
848
  static textToSvgBarcode(text) {
849
849
  const svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
850
850
  (0, jsbarcode_1.default)(svgElement, text, {
851
- format: "CODE128", width: 1.25, height: 25, margin: 0, marginTop: 8,
851
+ format: "CODE128", width: 1.25, height: 20, margin: 0, marginTop: 8,
852
852
  displayValue: true, fontSize: 7, textMargin: 0, fontOptions: 'bold'
853
853
  });
854
854
  return { svg: svgElement.outerHTML };
@@ -999,9 +999,9 @@ class SharedPDFService {
999
999
  if (tr_utils_1.TrUtils.IsNull(Customer)) {
1000
1000
  return this.emptyObject();
1001
1001
  }
1002
- let Data = [{ text: CustHeader + ':', style: 'hed' },
1003
- { text: Customer.Code, marginTop: 2, bold: true, fontSize: 15 },
1004
- { text: Customer.Name, marginTop: 2 },
1002
+ let Data = [{ text: CustHeader + ':', style: 'hed2' },
1003
+ { text: Customer.Code, fontSize: this.SubHeaderSize },
1004
+ { text: Customer.Name, fontSize: this.SubHeaderSize },
1005
1005
  { text: this.GetAddress(Customer), marginTop: 3 },
1006
1006
  this.GetCustPhoneNumber(Customer, Type), this.GetCustomerGSTIN(Customer), this.GetCustomerDLNo(Customer),
1007
1007
  ,
@@ -1488,18 +1488,19 @@ class SharedPDFService {
1488
1488
  // { text: 'CGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CGST' },
1489
1489
  // { text: 'SGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'SGST' },
1490
1490
  // { text: 'Count', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'PartsCount' },
1491
- { text: 'Taxable Value', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'TotalTaxableAmount' },
1492
- { text: 'Tax Amount', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'TotalTaxAmount' },
1491
+ { text: 'Tax Rate', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CombinedTaxPercentage', alignment: 'center' },
1492
+ { text: 'Taxable Amount', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'TotalTaxableAmount', alignment: 'right' },
1493
+ // { text: 'Tax Amount', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'TotalTaxAmount' },
1493
1494
  ];
1494
1495
  if (ShowIGST) {
1495
- HeaderNames.splice(1, 0, { text: 'IGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'IGST' });
1496
- HeaderNames.splice(2, 0, { text: 'IGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'IGSTAmt' });
1496
+ // HeaderNames.splice(1, 0, { text: 'IGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'IGST' });
1497
+ HeaderNames.splice(2, 0, { text: 'IGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'IGSTAmt', alignment: 'right' });
1497
1498
  }
1498
1499
  else {
1499
- HeaderNames.splice(1, 0, { text: 'CGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
1500
- HeaderNames.splice(2, 0, { text: 'CGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGSTAmt' });
1501
- HeaderNames.splice(3, 0, { text: 'SGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
1502
- HeaderNames.splice(4, 0, { text: 'SGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'SGSTAmt' });
1500
+ // HeaderNames.splice(1, 0, { text: 'CGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
1501
+ HeaderNames.splice(2, 0, { text: 'CGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGSTAmt', alignment: 'right' });
1502
+ // HeaderNames.splice(3, 0, { text: 'SGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
1503
+ HeaderNames.splice(3, 0, { text: 'SGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'SGSTAmt', alignment: 'right' });
1503
1504
  }
1504
1505
  return HeaderNames;
1505
1506
  }
@@ -1514,9 +1515,12 @@ class SharedPDFService {
1514
1515
  if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) &&
1515
1516
  !tr_utils_1.TrUtils.IsNull(part[column.Field]) || column.Field === 'SGST' || column.Field === 'CGST' || column.Field === 'SGSTAmt' || column.Field === 'CGSTAmt'
1516
1517
  || column.Field === 'TotalTaxAmount') {
1517
- if (column.Field === 'SGSTLaborAmt') {
1518
+ if (column.Field === 'TotalTaxAmount' || column.Field === 'SGSTAmt' || column.Field === 'CGSTAmt' || column.Field === 'IGSTAmt') {
1518
1519
  dataRow.push({ text: part[column.Field].toString(), alignment: 'right', opacity: 0.7, nowrap: true, fontSize: 6 });
1519
1520
  }
1521
+ else if (column.Field === 'CombinedTaxPercentage') {
1522
+ dataRow.push({ text: part[column.Field].toString() + '%', alignment: 'center', opacity: 0.7, nowrap: true, fontSize: 6 });
1523
+ }
1520
1524
  else {
1521
1525
  dataRow.push({ text: part[column.Field].toString(), alignment: 'center', opacity: 0.7, nowrap: true, fontSize: 6 });
1522
1526
  }
@@ -1634,8 +1638,9 @@ class SharedPDFService {
1634
1638
  // PSGST, ShowAccParts, PIGST, ShowIGST, ShowTaxColumn, ShowDetailedPartTaxInfo, From),
1635
1639
  { text: (istaxable && CustLaborTaxGroupDataByPerc.length !== 0) ? serviceName : '', fontSize: 7, opacity: 0.8 },
1636
1640
  this.PartsTaxAmounts1(CustLaborTaxGroupDataByPerc, ShowAccParts, ShowIGST, ShowTaxColumn),
1637
- { text: (istaxable && PartsTaxInfo.length !== 0) ? itemName : '', fontSize: 7, opacity: 0.8 },
1638
- this.PartsTaxAmounts1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
1641
+ // { text: (istaxable && PartsTaxInfo.length !== 0) ? itemName : '', fontSize: 7, opacity: 0.8 },
1642
+ // this.PartsTaxAmounts1(PartsTaxInfo, ShowAccParts, ShowIGST,
1643
+ // ShowTaxColumn)
1639
1644
  ]
1640
1645
  },
1641
1646
  // { text: '', width: 60 },
@@ -2228,8 +2233,8 @@ class SharedPDFService {
2228
2233
  return {
2229
2234
  columns: [{
2230
2235
  stack: [
2231
- this.CompanyName(CName),
2232
- { columns: [this.Authorizedsignature(), this.SurveyorSignature(For, Type), this.CustomerSignature()] }
2236
+ { text: this.CompanyName(CName), alignment: 'right' },
2237
+ { columns: [this.CustomerSignature(), this.SurveyorSignature(For, Type), this.Authorizedsignature()] }
2233
2238
  ]
2234
2239
  }],
2235
2240
  };
@@ -2238,8 +2243,8 @@ class SharedPDFService {
2238
2243
  return {
2239
2244
  columns: [{
2240
2245
  stack: [
2241
- this.CompanyName(CName),
2242
- { columns: [this.Authorizedsignature(), this.SparesSignature(isCounterSale), this.CustomerSignature()] }
2246
+ { text: this.CompanyName(CName), alignment: 'right' },
2247
+ { columns: [this.CustomerSignature(), this.SparesSignature(isCounterSale), this.Authorizedsignature()] }
2243
2248
  ]
2244
2249
  }],
2245
2250
  };
@@ -2248,8 +2253,8 @@ class SharedPDFService {
2248
2253
  return {
2249
2254
  columns: [{
2250
2255
  stack: [
2251
- this.CompanyName(CName),
2252
- { columns: [this.Authorizedsignature(), this.SparesSignature(isCounterSale), this.PatientSignature()] }
2256
+ { text: this.CompanyName(CName), alignment: 'right' },
2257
+ { columns: [this.PatientSignature(), this.SparesSignature(isCounterSale), this.Authorizedsignature()] }
2253
2258
  ]
2254
2259
  }],
2255
2260
  };
@@ -2258,7 +2263,7 @@ class SharedPDFService {
2258
2263
  if (CounterSale) {
2259
2264
  return {
2260
2265
  style: 'Sign',
2261
- text: ['Parts Incharge Signature'], marginLeft: 90
2266
+ text: ['Parts Incharge Signature'], width: '*'
2262
2267
  };
2263
2268
  }
2264
2269
  else {
@@ -2275,33 +2280,33 @@ class SharedPDFService {
2275
2280
  static Authorizedsignature() {
2276
2281
  return {
2277
2282
  style: 'Sign',
2278
- text: ['Authorized Signature'],
2283
+ text: ['Authorized Signature'], width: 'auto'
2279
2284
  };
2280
2285
  }
2281
2286
  static Accountantsignature() {
2282
2287
  return {
2283
2288
  style: 'Sign',
2284
2289
  text: ['Accountant Signature'],
2285
- marginLeft: 90
2290
+ width: '*'
2286
2291
  };
2287
2292
  }
2288
2293
  static CustomerSignature() {
2289
2294
  return {
2290
2295
  style: 'Sign',
2291
- text: ['Customer Signature'], marginLeft: 90
2296
+ text: ['Customer Signature'], width: '*'
2292
2297
  };
2293
2298
  }
2294
2299
  static PatientSignature() {
2295
2300
  return {
2296
2301
  style: 'Sign',
2297
- text: ['Patient Signature'], marginLeft: 90
2302
+ text: ['Patient Signature'], width: '*'
2298
2303
  };
2299
2304
  }
2300
2305
  static SurveyorSignature(For, Type) {
2301
2306
  if (For === enums_1.PayTypeEnum.Insurance && Type === 'Estimate') {
2302
2307
  return {
2303
2308
  style: 'Sign',
2304
- text: ['Surveyor Signature'], marginLeft: 90
2309
+ text: ['Surveyor Signature'], width: '*'
2305
2310
  };
2306
2311
  }
2307
2312
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.4.63",
3
+ "version": "1.4.65",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",