shareneus 1.5.42 → 1.5.43

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,6 +1,6 @@
1
1
  export declare class UnifiedInvoicePdfService {
2
2
  FontSize: number;
3
- static GetInvoicePrint(ROPrintData: any, numberofCopies: any, isotherIndustry: boolean, withPass: boolean, isAuto: boolean, size: any, moreDiscDetails: boolean): {
3
+ static GetInvoicePrint(ROPrintData: any, numberofCopies: any, withPass: boolean, size: any, moreDiscDetails: boolean, orientation?: 'portrait' | 'landscape'): {
4
4
  watermark: string | {
5
5
  text: string;
6
6
  opacity: number;
@@ -18,6 +18,7 @@ export declare class UnifiedInvoicePdfService {
18
18
  };
19
19
  pageBreakBefore: (currentNode: any, followingNodesOnPage: any, nodesOnNextPage: any, previousNodesOnPage: any) => boolean;
20
20
  pageMargins: number[];
21
+ pageOrientation: "landscape" | "portrait";
21
22
  pageSize: string;
22
23
  content: any[];
23
24
  styles: {
@@ -214,8 +215,8 @@ export declare class UnifiedInvoicePdfService {
214
215
  };
215
216
  };
216
217
  static isHealthcareIndustry(ROPrintData: any): boolean;
217
- static GetMarginsBasedOnPaperSize(size: any, isHealthcare: boolean): number[];
218
- static GetWatermark(ROPrintData: any, isAuto: any, isHealthcare: boolean): "" | {
218
+ static GetMarginsBasedOnPaperSize(size: any, isHealthcare: boolean, orientation?: 'portrait' | 'landscape'): number[];
219
+ static GetWatermark(ROPrintData: any, isHealthcare: boolean): "" | {
219
220
  text: string;
220
221
  opacity: number;
221
222
  };
@@ -277,13 +278,13 @@ export declare class UnifiedInvoicePdfService {
277
278
  style?: undefined;
278
279
  })[];
279
280
  };
280
- static PreparesparePartsTable(ROPrintData: any, isAuto: boolean, isHealthcare: boolean): any;
281
- static GetLaborPartsTableForView(Parts: any, Ops: any, PrintPartNo: any, isHealthcare: boolean): any;
282
- static WithOutDiscountFieldTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number, isHealthcare: boolean): any;
283
- static BuildTableBodyForLaborAndParts(Parts: any, Labor: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number, isHealthcare: boolean): any;
284
- static GetWithOutDiscAndTaxFieldHeader(Parts: any, Ops: any, ShowTaxColumn: any, PrintPartNo: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number, isHealthcare: boolean): any;
281
+ static PreparesparePartsTable(ROPrintData: any, isHealthcare: boolean, orientation?: 'portrait' | 'landscape'): any;
282
+ static GetLaborPartsTableForView(Parts: any, Ops: any, PrintPartNo: any, isHealthcare: boolean, orientation?: 'portrait' | 'landscape'): any;
283
+ static WithOutDiscountFieldTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, DecimalsNumber: number, isHealthcare: boolean, ROPrintData: any, orientation?: 'portrait' | 'landscape'): any;
284
+ static BuildTableBodyForLaborAndParts(Parts: any, Labor: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, DecimalsNumber: number, isHealthcare: boolean): any;
285
+ static GetWithOutDiscAndTaxFieldHeader(Parts: any, Ops: any, ShowTaxColumn: any, PrintPartNo: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, DecimalsNumber: number, isHealthcare: boolean, ROPrintData: any, orientation?: 'portrait' | 'landscape'): any;
285
286
  static TaxTableWidths(PrintPartNo: any, ShowIGST: any, ShowDiscountColumn: any): number[];
286
- static TaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number, isHealthcare: boolean): {
287
+ static TaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, DecimalsNumber: number, isHealthcare: boolean, orientation?: 'portrait' | 'landscape'): {
287
288
  style: string;
288
289
  table: {
289
290
  widths: (string | number)[];
@@ -296,7 +297,7 @@ export declare class UnifiedInvoicePdfService {
296
297
  vLineColor: (i: any, node: any) => string;
297
298
  };
298
299
  };
299
- static ConsolidateDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number, isHealthcare: boolean): {
300
+ static ConsolidateDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, DecimalsNumber: number, isHealthcare: boolean, orientation?: 'portrait' | 'landscape'): {
300
301
  style: string;
301
302
  table: {
302
303
  widths: number[];
@@ -309,7 +310,7 @@ export declare class UnifiedInvoicePdfService {
309
310
  vLineColor: (i: any, node: any) => string;
310
311
  };
311
312
  };
312
- static NoTaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number, isHealthcare: boolean): {
313
+ static NoTaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, DecimalsNumber: number, isHealthcare: boolean, orientation?: 'portrait' | 'landscape'): {
313
314
  style: string;
314
315
  table: {
315
316
  widths: number[];
@@ -324,7 +325,7 @@ export declare class UnifiedInvoicePdfService {
324
325
  };
325
326
  static buildTableForCustomerLabor(Parts: any, Ops: any, PrintPartNo: any, customerorInsurance: any, isHealthcare: boolean): any;
326
327
  static getSummaryHeaders(permission: boolean): any;
327
- static CommonTotalDetails(ROPrintData: any, index: any, numberofCopies: any, withPass: boolean, isAuto: boolean, moreDiscDetails: boolean, isHealthcare: boolean): any[];
328
+ static CommonTotalDetails(ROPrintData: any, index: any, numberofCopies: any, withPass: boolean, moreDiscDetails: boolean, isHealthcare: boolean): any[];
328
329
  static InvoiceDueStatusHC(Type: any, Paid: any, Due: any, Status: any, isCounter: boolean, DecimalsNumber: number): any;
329
330
  static GetBanckdetailswithQRCode(ROPrintData: any): {
330
331
  columns: any[];
@@ -10,22 +10,23 @@ class UnifiedInvoicePdfService {
10
10
  constructor() {
11
11
  this.FontSize = 8;
12
12
  }
13
- static GetInvoicePrint(ROPrintData, numberofCopies, isotherIndustry, withPass, isAuto, size = null, moreDiscDetails) {
13
+ static GetInvoicePrint(ROPrintData, numberofCopies, withPass, size = null, moreDiscDetails, orientation = 'portrait') {
14
14
  const isHealthcare = this.isHealthcareIndustry(ROPrintData);
15
+ const isotherIndustry = false;
15
16
  if (isHealthcare) {
16
17
  ROPrintData.Entity.IsProforma = ROPrintData.IsProforma;
17
18
  }
18
19
  var contents = [];
19
20
  if (tr_utils_1.TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
20
- contents.push(this.CommonHeaderDetails(ROPrintData, null, isotherIndustry, isHealthcare), this.PreparesparePartsTable(ROPrintData, isAuto, isHealthcare), this.CommonTotalDetails(ROPrintData, null, numberofCopies, withPass, isAuto, moreDiscDetails, isHealthcare));
21
+ contents.push(this.CommonHeaderDetails(ROPrintData, null, isotherIndustry, isHealthcare), this.PreparesparePartsTable(ROPrintData, isHealthcare, orientation), this.CommonTotalDetails(ROPrintData, null, numberofCopies, withPass, moreDiscDetails, isHealthcare));
21
22
  }
22
23
  else {
23
24
  numberofCopies.forEach((text, index) => {
24
- contents.push(this.CommonHeaderDetails(ROPrintData, text, isotherIndustry, isHealthcare), this.PreparesparePartsTable(ROPrintData, isAuto, isHealthcare), this.CommonTotalDetails(ROPrintData, index, numberofCopies, withPass, isAuto, moreDiscDetails, isHealthcare));
25
+ contents.push(this.CommonHeaderDetails(ROPrintData, text, isotherIndustry, isHealthcare), this.PreparesparePartsTable(ROPrintData, isHealthcare, orientation), this.CommonTotalDetails(ROPrintData, index, numberofCopies, withPass, moreDiscDetails, isHealthcare));
25
26
  });
26
27
  }
27
28
  var dd = {
28
- watermark: this.GetWatermark(ROPrintData, isAuto, isHealthcare),
29
+ watermark: this.GetWatermark(ROPrintData, isHealthcare),
29
30
  info: {
30
31
  title: this.GetFileName(ROPrintData),
31
32
  },
@@ -41,7 +42,8 @@ class UnifiedInvoicePdfService {
41
42
  pageBreakBefore: function (currentNode, followingNodesOnPage, nodesOnNextPage, previousNodesOnPage) {
42
43
  return currentNode.startPosition.top >= 700 && !tr_utils_1.TrUtils.IsNull(currentNode === null || currentNode === void 0 ? void 0 : currentNode.id) && (currentNode === null || currentNode === void 0 ? void 0 : currentNode.id) === '567';
43
44
  },
44
- pageMargins: this.GetMarginsBasedOnPaperSize(size, isHealthcare),
45
+ pageMargins: this.GetMarginsBasedOnPaperSize(size, isHealthcare, orientation),
46
+ pageOrientation: orientation,
45
47
  pageSize: 'A4',
46
48
  content: contents,
47
49
  styles: shared_pdf_service_1.SharedPDFService.GetStyles()
@@ -52,7 +54,10 @@ class UnifiedInvoicePdfService {
52
54
  var _a, _b;
53
55
  return ((_a = ROPrintData.Entity) === null || _a === void 0 ? void 0 : _a.PrCustBar) !== undefined && ((_b = ROPrintData.Entity) === null || _b === void 0 ? void 0 : _b.PrCustBar) !== null;
54
56
  }
55
- static GetMarginsBasedOnPaperSize(size, isHealthcare) {
57
+ static GetMarginsBasedOnPaperSize(size, isHealthcare, orientation = 'portrait') {
58
+ if (orientation === 'landscape') {
59
+ return [10, 15, 10, 15];
60
+ }
56
61
  if (isHealthcare) {
57
62
  if (size === 'full') {
58
63
  return [25, 15, 15, 15];
@@ -65,7 +70,7 @@ class UnifiedInvoicePdfService {
65
70
  return [10, 15, 10, 15];
66
71
  }
67
72
  }
68
- static GetWatermark(ROPrintData, isAuto, isHealthcare) {
73
+ static GetWatermark(ROPrintData, isHealthcare) {
69
74
  if (isHealthcare) {
70
75
  if (ROPrintData.IsProforma && ROPrintData.Entity.Wmark) {
71
76
  return { text: 'Not a final invoice', opacity: 0.2 };
@@ -75,7 +80,7 @@ class UnifiedInvoicePdfService {
75
80
  }
76
81
  }
77
82
  else {
78
- if (isAuto && ROPrintData.IsProforma && ROPrintData.Entity.Wmark) {
83
+ if (ROPrintData.IsProforma && ROPrintData.Entity.Wmark) {
79
84
  return { text: 'Not a final invoice', opacity: 0.2 };
80
85
  }
81
86
  else {
@@ -146,7 +151,7 @@ class UnifiedInvoicePdfService {
146
151
  ]
147
152
  };
148
153
  }
149
- static PreparesparePartsTable(ROPrintData, isAuto, isHealthcare) {
154
+ static PreparesparePartsTable(ROPrintData, isHealthcare, orientation = 'portrait') {
150
155
  let List = [];
151
156
  const printPartNo = isHealthcare ? false : ROPrintData.Entity.MPN;
152
157
  if (ROPrintData.Entity.Body === 1) {
@@ -154,7 +159,7 @@ class UnifiedInvoicePdfService {
154
159
  if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
155
160
  ROPrintData.PrintInfo[i].Text = '';
156
161
  }
157
- List.push(ROPrintData.PrintInfo[i].Text, this.GetLaborPartsTableForView(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), printPartNo, isHealthcare));
162
+ List.push(ROPrintData.PrintInfo[i].Text, this.GetLaborPartsTableForView(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), printPartNo, isHealthcare, orientation));
158
163
  }
159
164
  }
160
165
  else {
@@ -163,42 +168,44 @@ class UnifiedInvoicePdfService {
163
168
  if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
164
169
  ROPrintData.PrintInfo[i].Text = '';
165
170
  }
166
- List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, printPartNo, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn, isAuto, ROPrintData.Entity.DecimalsNumber, isHealthcare));
171
+ List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, printPartNo, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn, ROPrintData.Entity.DecimalsNumber, isHealthcare, ROPrintData, orientation));
167
172
  }
168
173
  }
169
174
  else {
170
175
  if (ROPrintData.Summary) {
171
- List.push('', this.GetLaborPartsTableForView(ROPrintData.Items, ROPrintData.Ops, printPartNo, isHealthcare));
176
+ List.push('', this.GetLaborPartsTableForView(ROPrintData.Items, ROPrintData.Ops, printPartNo, isHealthcare, orientation));
172
177
  }
173
178
  else {
174
179
  for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
175
180
  if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
176
181
  ROPrintData.PrintInfo[i].Text = '';
177
182
  }
178
- List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, printPartNo, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn, isAuto, ROPrintData.Entity.DecimalsNumber, isHealthcare));
183
+ List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, printPartNo, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn, ROPrintData.Entity.DecimalsNumber, isHealthcare, ROPrintData, orientation));
179
184
  }
180
185
  }
181
186
  }
182
187
  }
183
188
  return List;
184
189
  }
185
- static GetLaborPartsTableForView(Parts, Ops, PrintPartNo, isHealthcare) {
190
+ static GetLaborPartsTableForView(Parts, Ops, PrintPartNo, isHealthcare, orientation = 'portrait') {
186
191
  if (Parts.length !== 0 || Ops.length !== 0) {
187
192
  if (PrintPartNo) {
193
+ const widths = orientation === 'landscape' ? [15, 30, 170, 85, 15, 20, 50, 30, 30, 53] : [25, 30, 170, 85, 15, 20, 50, 30, 30, 50];
188
194
  return {
189
195
  style: 'tableExample',
190
196
  table: {
191
- widths: [25, 30, 170, 85, 15, 20, 50, 30, 30, 50],
197
+ widths: widths,
192
198
  body: this.buildTableForCustomerLabor(Parts, Ops, PrintPartNo, false, isHealthcare)
193
199
  },
194
200
  layout: shared_print_service_1.PrintSharedService.LayOutStyleanother()
195
201
  };
196
202
  }
197
203
  else {
204
+ const widths = orientation === 'landscape' ? [15, 200, 55, 25, 55, 55, 40, 15, 53] : [25, 200, 55, 25, 55, 55, 40, 15, 50];
198
205
  return {
199
206
  style: 'tableExample',
200
207
  table: {
201
- widths: [25, 200, 55, 25, 55, 55, 40, 15, 50],
208
+ widths: widths,
202
209
  body: this.buildTableForCustomerLabor(Parts, Ops, PrintPartNo, false, isHealthcare)
203
210
  },
204
211
  layout: shared_print_service_1.PrintSharedService.LayOutStyleanother()
@@ -210,28 +217,30 @@ class UnifiedInvoicePdfService {
210
217
  return a;
211
218
  }
212
219
  }
213
- static WithOutDiscountFieldTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare) {
220
+ static WithOutDiscountFieldTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare, ROPrintData, orientation = 'portrait') {
214
221
  if (Parts.length !== 0 || Ops.length !== 0) {
215
222
  if (PrintPartNo) {
223
+ const widths = orientation === 'landscape' ? [15, 67, 160, 25, 50, 60, 30, 53] : [25, 60, 155, 30, 50, 60, 30, 50];
216
224
  return {
217
225
  style: 'tableExample',
218
226
  marginLeft: 20,
219
227
  table: {
220
- widths: [25, 60, 155, 30, 50, 60, 30, 50],
228
+ widths: widths,
221
229
  headerRows: 1,
222
- body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare)
230
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare)
223
231
  },
224
232
  layout: shared_print_service_1.PrintSharedService.LayOutStyleanother()
225
233
  };
226
234
  }
227
235
  else {
236
+ const widths = orientation === 'landscape' ? [15, 215, 25, 50, 60, 45, 60] : [25, 215, 25, 50, 60, 45, 50];
228
237
  return {
229
238
  style: 'tableExample',
230
239
  marginLeft: 20,
231
240
  table: {
232
- widths: [25, 215, 25, 50, 60, 45, 50],
241
+ widths: widths,
233
242
  headerRows: 1,
234
- body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare)
243
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare)
235
244
  },
236
245
  layout: shared_print_service_1.PrintSharedService.LayOutStyleanother()
237
246
  };
@@ -242,7 +251,7 @@ class UnifiedInvoicePdfService {
242
251
  return a;
243
252
  }
244
253
  }
245
- static BuildTableBodyForLaborAndParts(Parts, Labor, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare) {
254
+ static BuildTableBodyForLaborAndParts(Parts, Labor, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare) {
246
255
  var body = [];
247
256
  let columns = shared_print_service_1.PrintSharedService.GetWithOutDiscountFieldHeader(PrintPartNo, ShowTaxColumn, Body, ShowIGST, ShowDiscountColumn);
248
257
  for (let i = 0; i < columns.length; i++) {
@@ -254,45 +263,43 @@ class UnifiedInvoicePdfService {
254
263
  const laborLabel = isHealthcare ? 'Procedures' : 'Labor';
255
264
  const laborTotalLabel = isHealthcare ? 'Procedures Total' : 'Labor Total';
256
265
  if (Parts.length !== 0) {
257
- if (isAuto) {
258
- let Qty = 0;
259
- let CGSTAMT = 0;
260
- let SGSTAMT = 0;
261
- let IGSTAMT = 0;
262
- let Taxable = 0;
263
- let FinalTotal = 0;
264
- Parts.forEach((part) => {
265
- if (isHealthcare) {
266
- Qty = Qty + part.Qty;
267
- CGSTAMT = CGSTAMT + part.CGSTAmt;
268
- SGSTAMT = SGSTAMT + part.SGSTAmt;
269
- IGSTAMT = IGSTAMT + part.IGSTAmt;
270
- Taxable = Taxable + part.AfterPartDisc;
271
- FinalTotal = FinalTotal + part.AfterPartTax;
272
- }
273
- else {
274
- Qty = (0, math_operations_1.Add)(Qty, tr_utils_1.TrUtils.FixedTo(part.Qty, DecimalsNumber));
275
- CGSTAMT = (0, math_operations_1.Add)(CGSTAMT, tr_utils_1.TrUtils.FixedTo(part.CGSTAmt, DecimalsNumber));
276
- SGSTAMT = (0, math_operations_1.Add)(SGSTAMT, tr_utils_1.TrUtils.FixedTo(part.SGSTAmt, DecimalsNumber));
277
- IGSTAMT = (0, math_operations_1.Add)(IGSTAMT, tr_utils_1.TrUtils.FixedTo(part.IGSTAmt, DecimalsNumber));
278
- Taxable = (0, math_operations_1.Add)(Taxable, tr_utils_1.TrUtils.FixedTo(part.AfterPartDisc, DecimalsNumber));
279
- FinalTotal = (0, math_operations_1.Add)(FinalTotal, tr_utils_1.TrUtils.FixedTo(part.AfterPartTax, DecimalsNumber));
280
- }
281
- });
282
- let dpartadding1 = {};
283
- dpartadding1.SNo = '';
284
- dpartadding1.Desc = partsTotalLabel;
285
- dpartadding1.QtyAndUoM = tr_utils_1.TrUtils.FixedTo(Qty, DecimalsNumber);
286
- dpartadding1.bold = true;
287
- dpartadding1.UnPr = tr_utils_1.TrUtils.FixedTo(Taxable, DecimalsNumber);
288
- dpartadding1.SGSTAmt = tr_utils_1.TrUtils.FixedTo(SGSTAMT, DecimalsNumber);
289
- dpartadding1.IGSTAmt = tr_utils_1.TrUtils.FixedTo(IGSTAMT, DecimalsNumber);
290
- dpartadding1.CGSTAmt = tr_utils_1.TrUtils.FixedTo(CGSTAMT, DecimalsNumber);
291
- dpartadding1.TCode = ShowTaxColumn ? 114 : undefined;
292
- dpartadding1.LineTotal = tr_utils_1.TrUtils.FixPriceValue(FinalTotal, DecimalsNumber);
293
- Parts.push({ SNo: '' });
294
- Parts.push(dpartadding1);
295
- }
266
+ let Qty = 0;
267
+ let CGSTAMT = 0;
268
+ let SGSTAMT = 0;
269
+ let IGSTAMT = 0;
270
+ let Taxable = 0;
271
+ let FinalTotal = 0;
272
+ Parts.forEach((part) => {
273
+ if (isHealthcare) {
274
+ Qty = Qty + part.Qty;
275
+ CGSTAMT = CGSTAMT + part.CGSTAmt;
276
+ SGSTAMT = SGSTAMT + part.SGSTAmt;
277
+ IGSTAMT = IGSTAMT + part.IGSTAmt;
278
+ Taxable = Taxable + part.AfterPartDisc;
279
+ FinalTotal = FinalTotal + part.AfterPartTax;
280
+ }
281
+ else {
282
+ Qty = (0, math_operations_1.Add)(Qty, tr_utils_1.TrUtils.FixedTo(part.Qty, DecimalsNumber));
283
+ CGSTAMT = (0, math_operations_1.Add)(CGSTAMT, tr_utils_1.TrUtils.FixedTo(part.CGSTAmt, DecimalsNumber));
284
+ SGSTAMT = (0, math_operations_1.Add)(SGSTAMT, tr_utils_1.TrUtils.FixedTo(part.SGSTAmt, DecimalsNumber));
285
+ IGSTAMT = (0, math_operations_1.Add)(IGSTAMT, tr_utils_1.TrUtils.FixedTo(part.IGSTAmt, DecimalsNumber));
286
+ Taxable = (0, math_operations_1.Add)(Taxable, tr_utils_1.TrUtils.FixedTo(part.AfterPartDisc, DecimalsNumber));
287
+ FinalTotal = (0, math_operations_1.Add)(FinalTotal, tr_utils_1.TrUtils.FixedTo(part.AfterPartTax, DecimalsNumber));
288
+ }
289
+ });
290
+ let dpartadding1 = {};
291
+ dpartadding1.SNo = '';
292
+ dpartadding1.Desc = partsTotalLabel;
293
+ dpartadding1.QtyAndUoM = tr_utils_1.TrUtils.FixedTo(Qty, DecimalsNumber);
294
+ dpartadding1.bold = true;
295
+ dpartadding1.UnPr = tr_utils_1.TrUtils.FixedTo(Taxable, DecimalsNumber);
296
+ dpartadding1.SGSTAmt = tr_utils_1.TrUtils.FixedTo(SGSTAMT, DecimalsNumber);
297
+ dpartadding1.IGSTAmt = tr_utils_1.TrUtils.FixedTo(IGSTAMT, DecimalsNumber);
298
+ dpartadding1.CGSTAmt = tr_utils_1.TrUtils.FixedTo(CGSTAMT, DecimalsNumber);
299
+ dpartadding1.TCode = ShowTaxColumn ? 114 : undefined;
300
+ dpartadding1.LineTotal = tr_utils_1.TrUtils.FixPriceValue(FinalTotal, DecimalsNumber);
301
+ Parts.push({ SNo: '' });
302
+ Parts.push(dpartadding1);
296
303
  if (!isHealthcare) {
297
304
  let dummypartadding1 = {};
298
305
  dummypartadding1.SNo = '';
@@ -392,41 +399,39 @@ class UnifiedInvoicePdfService {
392
399
  });
393
400
  SNo = 1;
394
401
  if (Labor.length !== 0) {
395
- if (isAuto) {
396
- let CGSTAMT = 0;
397
- let SGSTAMT = 0;
398
- let IGSTAMT = 0;
399
- let Taxable = 0;
400
- let FinalTotal = 0;
401
- Labor.forEach((operation) => {
402
- if (isHealthcare) {
403
- CGSTAMT = CGSTAMT + operation.CGSTAmt;
404
- SGSTAMT = SGSTAMT + operation.SGSTAmt;
405
- IGSTAMT = IGSTAMT + operation.IGSTAmt;
406
- Taxable = Taxable + operation.AfterLaborDisc;
407
- FinalTotal = FinalTotal + operation.AfterLaborTax;
408
- }
409
- else {
410
- CGSTAMT = (0, math_operations_1.Add)(CGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.CGSTAmt, DecimalsNumber));
411
- SGSTAMT = (0, math_operations_1.Add)(SGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.SGSTAmt, DecimalsNumber));
412
- IGSTAMT = (0, math_operations_1.Add)(IGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.IGSTAmt, DecimalsNumber));
413
- Taxable = (0, math_operations_1.Add)(Taxable, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborDisc, DecimalsNumber));
414
- FinalTotal = (0, math_operations_1.Add)(FinalTotal, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborTax, DecimalsNumber));
415
- }
416
- });
417
- let dpartadding1 = {};
418
- dpartadding1.SNo = '';
419
- dpartadding1.Desc = laborTotalLabel;
420
- dpartadding1.UnPr = tr_utils_1.TrUtils.FixedTo(Taxable, DecimalsNumber);
421
- dpartadding1.SGSTAmt = tr_utils_1.TrUtils.FixedTo(SGSTAMT, DecimalsNumber);
422
- dpartadding1.IGSTAmt = tr_utils_1.TrUtils.FixedTo(IGSTAMT, DecimalsNumber);
423
- dpartadding1.CGSTAmt = tr_utils_1.TrUtils.FixedTo(CGSTAMT, DecimalsNumber);
424
- dpartadding1.TCode = ShowTaxColumn ? 114 : undefined;
425
- dpartadding1.bold = true;
426
- dpartadding1.LineTotal = tr_utils_1.TrUtils.FixPriceValue(FinalTotal, DecimalsNumber);
427
- Labor.push({ SNo: '' });
428
- Labor.push(dpartadding1);
429
- }
402
+ let CGSTAMT = 0;
403
+ let SGSTAMT = 0;
404
+ let IGSTAMT = 0;
405
+ let Taxable = 0;
406
+ let FinalTotal = 0;
407
+ Labor.forEach((operation) => {
408
+ if (isHealthcare) {
409
+ CGSTAMT = CGSTAMT + operation.CGSTAmt;
410
+ SGSTAMT = SGSTAMT + operation.SGSTAmt;
411
+ IGSTAMT = IGSTAMT + operation.IGSTAmt;
412
+ Taxable = Taxable + operation.AfterLaborDisc;
413
+ FinalTotal = FinalTotal + operation.AfterLaborTax;
414
+ }
415
+ else {
416
+ CGSTAMT = (0, math_operations_1.Add)(CGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.CGSTAmt, DecimalsNumber));
417
+ SGSTAMT = (0, math_operations_1.Add)(SGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.SGSTAmt, DecimalsNumber));
418
+ IGSTAMT = (0, math_operations_1.Add)(IGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.IGSTAmt, DecimalsNumber));
419
+ Taxable = (0, math_operations_1.Add)(Taxable, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborDisc, DecimalsNumber));
420
+ FinalTotal = (0, math_operations_1.Add)(FinalTotal, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborTax, DecimalsNumber));
421
+ }
422
+ });
423
+ let dpartadding1 = {};
424
+ dpartadding1.SNo = '';
425
+ dpartadding1.Desc = laborTotalLabel;
426
+ dpartadding1.UnPr = tr_utils_1.TrUtils.FixedTo(Taxable, DecimalsNumber);
427
+ dpartadding1.SGSTAmt = tr_utils_1.TrUtils.FixedTo(SGSTAMT, DecimalsNumber);
428
+ dpartadding1.IGSTAmt = tr_utils_1.TrUtils.FixedTo(IGSTAMT, DecimalsNumber);
429
+ dpartadding1.CGSTAmt = tr_utils_1.TrUtils.FixedTo(CGSTAMT, DecimalsNumber);
430
+ dpartadding1.TCode = ShowTaxColumn ? 114 : undefined;
431
+ dpartadding1.bold = true;
432
+ dpartadding1.LineTotal = tr_utils_1.TrUtils.FixPriceValue(FinalTotal, DecimalsNumber);
433
+ Labor.push({ SNo: '' });
434
+ Labor.push(dpartadding1);
430
435
  if (isHealthcare && Parts.length !== 0) {
431
436
  let dummypartadding1 = {};
432
437
  dummypartadding1.SNo = '';
@@ -536,17 +541,17 @@ class UnifiedInvoicePdfService {
536
541
  });
537
542
  return body;
538
543
  }
539
- static GetWithOutDiscAndTaxFieldHeader(Parts, Ops, ShowTaxColumn, PrintPartNo, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare) {
544
+ static GetWithOutDiscAndTaxFieldHeader(Parts, Ops, ShowTaxColumn, PrintPartNo, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare, ROPrintData, orientation = 'portrait') {
540
545
  if (Parts.length !== 0 || Ops.length !== 0) {
541
546
  if (ShowTaxColumn) {
542
- return this.TaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare);
547
+ return this.TaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare, orientation);
543
548
  }
544
549
  else {
545
550
  if (ConsolidateGST) {
546
- return this.ConsolidateDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare);
551
+ return this.ConsolidateDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare, orientation);
547
552
  }
548
553
  else {
549
- return this.NoTaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare);
554
+ return this.NoTaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare, orientation);
550
555
  }
551
556
  }
552
557
  }
@@ -593,48 +598,50 @@ class UnifiedInvoicePdfService {
593
598
  }
594
599
  }
595
600
  }
596
- static TaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare) {
601
+ static TaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare, orientation = 'portrait') {
597
602
  const layoutStyle = isHealthcare ? shared_print_service_1.PrintSharedService.LayOutStyle1() : shared_print_service_1.PrintSharedService.LayOutStyle();
598
603
  const widths = isHealthcare ? this.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn) : shared_print_service_1.PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn);
599
604
  return {
600
605
  style: 'tableExample',
601
606
  table: {
602
607
  widths: widths,
603
- body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare)
608
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare)
604
609
  },
605
610
  layout: layoutStyle
606
611
  };
607
612
  }
608
- static ConsolidateDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare) {
613
+ static ConsolidateDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare, orientation = 'portrait') {
609
614
  const layoutStyle = isHealthcare ? shared_print_service_1.PrintSharedService.LayOutStyle1() : shared_print_service_1.PrintSharedService.LayOutStyle();
610
615
  if (PrintPartNo) {
616
+ const widths = orientation === 'landscape' ? [15, 70, 263, 25, 60, 80, 10, 47] : [25, 70, 263, 25, 60, 80, 10, 40];
611
617
  return {
612
618
  style: 'tableExample',
613
619
  table: {
614
- widths: [25, 70, 263, 25, 60, 80, 10, 40],
615
- body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare)
620
+ widths: widths,
621
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare)
616
622
  },
617
623
  layout: layoutStyle
618
624
  };
619
625
  }
620
626
  else {
627
+ const widths = orientation === 'landscape' ? [15, 295, 50, 80, 80, 10, 47] : [25, 295, 50, 80, 80, 10, 40];
621
628
  return {
622
629
  style: 'tableExample',
623
630
  table: {
624
- widths: [25, 295, 50, 80, 80, 10, 40],
625
- body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare)
631
+ widths: widths,
632
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare)
626
633
  },
627
634
  layout: layoutStyle
628
635
  };
629
636
  }
630
637
  }
631
- static NoTaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare) {
638
+ static NoTaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare, orientation = 'portrait') {
632
639
  const layoutStyle = isHealthcare ? shared_print_service_1.PrintSharedService.LayOutStyle1() : shared_print_service_1.PrintSharedService.LayOutStyle();
633
640
  return {
634
641
  style: 'tableExample',
635
642
  table: {
636
643
  widths: shared_print_service_1.PrintSharedService.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
637
- body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber, isHealthcare)
644
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, isHealthcare)
638
645
  },
639
646
  layout: layoutStyle
640
647
  };
@@ -821,11 +828,11 @@ class UnifiedInvoicePdfService {
821
828
  }
822
829
  return headersNames;
823
830
  }
824
- static CommonTotalDetails(ROPrintData, index, numberofCopies, withPass, isAuto, moreDiscDetails, isHealthcare) {
831
+ static CommonTotalDetails(ROPrintData, index, numberofCopies, withPass, moreDiscDetails, isHealthcare) {
825
832
  var _a;
826
833
  const taxSummaryData = isHealthcare ? ROPrintData.CustTaxGroupDataByPerc : ROPrintData.TaxSummary;
827
834
  let CommonDetails = [
828
- 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, taxSummaryData, 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((_a = ROPrintData.Settings) === null || _a === void 0 ? void 0 : _a.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, ROPrintData.Adj, taxSummaryData, ROPrintData.STotal, isAuto, moreDiscDetails),
835
+ 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, taxSummaryData, 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((_a = ROPrintData.Settings) === null || _a === void 0 ? void 0 : _a.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, ROPrintData.Adj, taxSummaryData, ROPrintData.STotal, false, moreDiscDetails),
829
836
  this.GetNumberInWords(ROPrintData.CustRoundedTotal, isHealthcare),
830
837
  isHealthcare
831
838
  ? this.InvoiceDueStatusHC(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, ROPrintData.isCountersale, ROPrintData.Entity.DecimalsNumber)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.5.42",
3
+ "version": "1.5.43",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",