shareneus 1.7.4 → 1.7.6

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.
Files changed (212) hide show
  1. package/README.md +1 -0
  2. package/dist/accounting/invoice/invoice-pdf/invoice-pdf.service.js +18 -45
  3. package/dist/accounting/invoice/reports/excel/analysis-excel.service.js +17 -7
  4. package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.js +17 -7
  5. package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.js +17 -7
  6. package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.js +17 -7
  7. package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.js +17 -7
  8. package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.js +17 -7
  9. package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +17 -7
  10. package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.js +17 -7
  11. package/dist/accounting/invoice/reports/excel/operator-wise-details.js +17 -7
  12. package/dist/accounting/invoice/reports/excel/operator-wise-summary.js +17 -7
  13. package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.js +17 -7
  14. package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.js +17 -7
  15. package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.js +17 -7
  16. package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.js +17 -7
  17. package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.js +17 -7
  18. package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.js +17 -7
  19. package/dist/accounting/invoice/unified-invoice-pdf.service.d.ts +1 -1
  20. package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.js +17 -7
  21. package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.js +17 -7
  22. package/dist/common/reports/excel/product-without-owner-excel.service.js +17 -7
  23. package/dist/gst/excel/GSTR-RO-excel.service.js +17 -7
  24. package/dist/gst/excel/GSTR1-excel.service.js +17 -7
  25. package/dist/gst/excel/GSTR2-excel.service.js +17 -7
  26. package/dist/gst/excel/hsn-summary.js +17 -7
  27. package/dist/gst/excel/tally-sales-import.service.js +17 -7
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +6 -6
  30. package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.js +17 -7
  31. package/dist/inventory/items/reports/excel/item-wise-mout-details.js +17 -7
  32. package/dist/inventory/items/reports/excel/item-wise-mout-summary.js +17 -7
  33. package/dist/inventory/items/reports/excel/spares-issue-excel.service.js +17 -7
  34. package/dist/inventory/items/reports/excel/stock-excel.service.js +17 -7
  35. package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.js +17 -7
  36. package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.js +17 -7
  37. package/dist/services/reports/excel/insurance-expire-excel.service.js +17 -7
  38. package/dist/services/reports/excel/next-service-date-excel.service.js +17 -7
  39. package/dist/services/reports/excel/repair-orders-excel.service.js +17 -7
  40. package/dist/shared/table-section/pdf-table.header.d.ts +1 -1
  41. package/dist/shared/table-section/pdf-table.header.js +14 -2
  42. package/dist/shared/table-section/pdf-table.section.js +6 -13
  43. package/dist/{accounting/invoice/invoice-pdf.service.js → shared/transactions-pdf.service.js} +15 -15
  44. package/package.json +1 -1
  45. package/src/accounting/counter-sales/auto-sales-receipt-pdf.service.ts +569 -0
  46. package/src/accounting/counter-sales/pos-receipt-pdf.ts +577 -0
  47. package/src/accounting/counter-sales/sales-receipt-pdf.service.ts +628 -0
  48. package/src/accounting/counter-sales/sales-receipt-print.service.ts +506 -0
  49. package/src/accounting/credit-note/cn-print.service.ts +264 -0
  50. package/src/accounting/credit-note/credit-note-pdf.service.ts +602 -0
  51. package/src/accounting/credit-note/credit-note-totals.service.ts +424 -0
  52. package/src/accounting/debit-note/debit-note-pdf.service.ts +681 -0
  53. package/src/accounting/debit-note/debit-note-print.service.ts +276 -0
  54. package/src/accounting/debit-note/debit-note-totals.service.ts +361 -0
  55. package/src/accounting/invoice/hc-inv-pdf.service.ts +880 -0
  56. package/src/accounting/invoice/inv-pdf.service.ts +812 -0
  57. package/src/accounting/invoice/inv-print.service.ts +532 -0
  58. package/src/accounting/invoice/invoice-landscape-pdf.service.ts +947 -0
  59. package/src/accounting/invoice/invoice-letterhead-pdf.service.ts +813 -0
  60. package/src/accounting/invoice/invoice-pdf/invoice-pdf.service.ts +359 -0
  61. package/src/accounting/invoice/invoice-portrait-pdf.ts +972 -0
  62. package/src/accounting/invoice/invoice-print.service.ts +2906 -0
  63. package/src/accounting/invoice/invoice-total.service.ts +834 -0
  64. package/src/accounting/invoice/reports/excel/analysis-excel.service.ts +291 -0
  65. package/src/accounting/invoice/reports/excel/category-wise-item-excel.service.ts +267 -0
  66. package/src/accounting/invoice/reports/excel/cust-wise-sales-details.ts +321 -0
  67. package/src/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.ts +300 -0
  68. package/src/accounting/invoice/reports/excel/invoice-wise-excel.service.ts +859 -0
  69. package/src/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.ts +255 -0
  70. package/src/accounting/invoice/reports/excel/items-wise-sales-excel.service.ts +312 -0
  71. package/src/accounting/invoice/reports/excel/manf-wise-sales-excel.service.ts +273 -0
  72. package/src/accounting/invoice/reports/excel/operator-wise-details.ts +258 -0
  73. package/src/accounting/invoice/reports/excel/operator-wise-summary.ts +259 -0
  74. package/src/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.ts +230 -0
  75. package/src/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.ts +231 -0
  76. package/src/accounting/invoice/reports/excel/sale-summary-excel.service.ts +326 -0
  77. package/src/accounting/invoice/reports/excel/sales-by-service-details-excel.service.ts +0 -0
  78. package/src/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.ts +432 -0
  79. package/src/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.ts +373 -0
  80. package/src/accounting/invoice/reports/excel/scheduled-drugs-excel.service.ts +372 -0
  81. package/src/accounting/invoice/reports/pdf/analysis-pdf.service.ts +113 -0
  82. package/src/accounting/invoice/reports/pdf/category-wise-item-pdf.service.ts +107 -0
  83. package/src/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.ts +125 -0
  84. package/src/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.ts +119 -0
  85. package/src/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.ts +180 -0
  86. package/src/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.ts +193 -0
  87. package/src/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.ts +188 -0
  88. package/src/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.ts +118 -0
  89. package/src/accounting/invoice/reports/pdf/operator-wise-summary-pdf.ts +116 -0
  90. package/src/accounting/invoice/reports/pdf/sales-by-service-pdf.service.ts +132 -0
  91. package/src/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.ts +191 -0
  92. package/src/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.ts +202 -0
  93. package/src/accounting/invoice/shared-inv-pdf.service.ts +787 -0
  94. package/src/accounting/invoice/unified-invoice-pdf.service.ts +937 -0
  95. package/src/accounting/payment-receive/payment-pdf.service.ts +410 -0
  96. package/src/accounting/payment-receive/payment-receipt-pdf/receipt-pdf.service.ts +470 -0
  97. package/src/accounting/payment-receive/receipt-print.service.ts +71 -0
  98. package/src/accounting/payment-receive/reports/excel/cust-balance-excel.service.ts +298 -0
  99. package/src/accounting/payment-receive/reports/excel/payment-receive-excel.service.ts +221 -0
  100. package/src/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.ts +182 -0
  101. package/src/accounting/payment-receive/reports/pdf/payment-report-pdf.service.ts +116 -0
  102. package/src/aggregation/aggregation.ts +58 -0
  103. package/src/appointments/appointments/appointment-total.service.ts +298 -0
  104. package/src/appointments/consultations/consultation-fee-receipt.service.ts +407 -0
  105. package/src/appointments/consultations/consultation-full-pdf.service.ts +238 -0
  106. package/src/appointments/consultations/consultation-letterhead-pdf.service.ts +430 -0
  107. package/src/appointments/consultations/consultation-pdf.service.ts +417 -0
  108. package/src/common/reports/excel/product-without-owner-excel.service.ts +308 -0
  109. package/src/common/reports/pdf/product-without-owner-pdf.service.ts +146 -0
  110. package/src/enums/cache-enums.ts +33 -0
  111. package/src/enums/code-enums.ts +291 -0
  112. package/src/enums/country-enums.ts +9 -0
  113. package/src/enums/enums.ts +364 -0
  114. package/src/enums/industry-enums.ts +26 -0
  115. package/src/enums/treatment-enums.ts +9 -0
  116. package/src/gst/excel/GSTR-RO-excel.service.ts +926 -0
  117. package/src/gst/excel/GSTR1-excel.service.ts +313 -0
  118. package/src/gst/excel/GSTR2-excel.service.ts +314 -0
  119. package/src/gst/excel/hsn-summary.ts +314 -0
  120. package/src/gst/excel/tally-sales-import.service.ts +767 -0
  121. package/src/gst/pdf/hsn-summary-pdf.ts +176 -0
  122. package/src/index.ts +194 -0
  123. package/src/inventory/items/adjustment-pdf.service.ts +177 -0
  124. package/src/inventory/items/issue-parts-pdf.service.ts +795 -0
  125. package/src/inventory/items/item-bar-code-label-pdf.ts +194 -0
  126. package/src/inventory/items/item-detais-pdf.ts +141 -0
  127. package/src/inventory/items/item-price-for-pricelist.ts +368 -0
  128. package/src/inventory/items/reports/excel/expiring-drugs-excel.service.ts +290 -0
  129. package/src/inventory/items/reports/excel/item-wise-mout-details.ts +284 -0
  130. package/src/inventory/items/reports/excel/item-wise-mout-summary.ts +279 -0
  131. package/src/inventory/items/reports/excel/spares-issue-excel.service.ts +494 -0
  132. package/src/inventory/items/reports/excel/stock-excel.service.ts +319 -0
  133. package/src/inventory/items/reports/pdf/expiring-drugs-pdf.service.ts +172 -0
  134. package/src/inventory/items/reports/pdf/item-wise-mout-details-pdf.ts +122 -0
  135. package/src/inventory/items/reports/pdf/item-wise-mout-summary-pdf.ts +115 -0
  136. package/src/inventory/items/reports/pdf/reorder-point-pdf.service.ts +163 -0
  137. package/src/inventory/material-out/mout-pdf.service.ts +545 -0
  138. package/src/inventory/transfer-order/transfer-order-pdf.service.ts +154 -0
  139. package/src/purchases/bills/bill-pdf/bill-pdf.service.ts +211 -0
  140. package/src/purchases/bills/bill-pdf.service.ts +21 -0
  141. package/src/purchases/payment-made/reports/excel/payments-made-excel.service.ts +313 -0
  142. package/src/purchases/payment-made/reports/excel/ven-balance-excel.service.ts +307 -0
  143. package/src/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.ts +114 -0
  144. package/src/purchases/purchase-order/po-totals.service.ts +343 -0
  145. package/src/purchases/purchase-order/purchase-order-pdf.service.ts +1016 -0
  146. package/src/purchases/purchase-order/purchase-order-print.service.ts +279 -0
  147. package/src/purchases/purchase-order/purchase-order-totals.service.ts +637 -0
  148. package/src/purchases/vendor-credit-note/vendor-credit-note-pdf.service.ts +1055 -0
  149. package/src/purchases/vendor-credit-note/vendor-credit-note-print.service.ts +145 -0
  150. package/src/purchases/vendor-credit-note/vendor-credit-note-totals.service.ts +399 -0
  151. package/src/purchases/vendor-debit-note/vendor-debit-note-pdf.service.ts +582 -0
  152. package/src/purchases/vendor-debit-note/vendor-debit-note-print.service.ts +295 -0
  153. package/src/purchases/vendor-debit-note/vendor-debit-note-totals.service.ts +377 -0
  154. package/src/sales/delivery-challan/dc-landscape-pdf.service.ts +922 -0
  155. package/src/sales/delivery-challan/dc-landscape-without-price-pdf.service.ts +869 -0
  156. package/src/sales/delivery-challan/dc-without-price-pdf.service.ts +505 -0
  157. package/src/sales/delivery-challan/delivery-challan-pdf.service.ts +461 -0
  158. package/src/sales/delivery-challan/delivery-challan-print.service.ts +229 -0
  159. package/src/sales/delivery-challan/delivery-challan-totals.ts +466 -0
  160. package/src/sales/sales/equipment-design-pdf.service.ts +153 -0
  161. package/src/sales/sales/pack-ship-pdf.service.ts +128 -0
  162. package/src/sales/sales/pack-ship-print.service.ts +198 -0
  163. package/src/sales/sales/sales-pdf.service.ts +658 -0
  164. package/src/sales/sales/sales-print.service.ts +376 -0
  165. package/src/sales/sales/sales-totals.service.ts +500 -0
  166. package/src/sales-receive/sales-receive-pdf.service.ts +602 -0
  167. package/src/sales-receive/sales-receive-print.service.ts +242 -0
  168. package/src/sales-receive/sales-receive-totals.service.ts +651 -0
  169. package/src/services/checklist-pdf.ts +151 -0
  170. package/src/services/checklists-pdf.ts +133 -0
  171. package/src/services/est.print-service.ts +1155 -0
  172. package/src/services/reports/excel/insurance-expire-excel.service.ts +292 -0
  173. package/src/services/reports/excel/next-service-date-excel.service.ts +317 -0
  174. package/src/services/reports/excel/repair-orders-excel.service.ts +249 -0
  175. package/src/services/reports/pdf/insurance-expire-pdf.service.ts +115 -0
  176. package/src/services/reports/pdf/next-service-date-pdf.service.ts +198 -0
  177. package/src/services/reports/pdf/repair-orders-pdf.service.ts +184 -0
  178. package/src/services/ro-pdf.service.ts +1917 -0
  179. package/src/services/ro-print-service.ts +881 -0
  180. package/src/services/ro-totals.service.ts +1314 -0
  181. package/src/services/separate-wo-print.service.ts +396 -0
  182. package/src/services/service-history-pdf.service.ts +145 -0
  183. package/src/services/service-price-for-pricelist.ts +649 -0
  184. package/src/services/technician-pdf.service.ts +234 -0
  185. package/src/services/technician-print.service.ts +95 -0
  186. package/src/shared/header-footer-section/pdf-header-footer.section.ts +519 -0
  187. package/src/shared/header-footer-section/pdf-shared.utils.ts +46 -0
  188. package/src/shared/math-operations.ts +208 -0
  189. package/src/shared/party-details-section/pdf-party-details.section.ts +602 -0
  190. package/src/shared/shared-pdf.service.ts +3042 -0
  191. package/src/shared/shared-print.service.ts +879 -0
  192. package/src/shared/table-section/pdf-table.config.ts +8 -0
  193. package/src/shared/table-section/pdf-table.header.ts +396 -0
  194. package/src/shared/table-section/pdf-table.row.ts +248 -0
  195. package/src/shared/table-section/pdf-table.section.ts +447 -0
  196. package/src/shared/totals-section/pdf-totals.section.ts +921 -0
  197. package/src/shared/transactions-pdf.service.ts +191 -0
  198. package/src/shared/util.ts +101 -0
  199. package/src/tasks/meetings/meeting-pdf.ts +410 -0
  200. package/src/tasks/tasks/task-pdf.service.ts +238 -0
  201. package/src/tasks/tasks/task-reports-pdf.service.ts +313 -0
  202. package/src/tax/index.ts +86 -0
  203. package/src/tax/tax-calculator.ts +1025 -0
  204. package/src/tax/tax.types.ts +535 -0
  205. package/src/transaction-calculations/discounts-distribution.ts +343 -0
  206. package/src/transaction-calculations/index.ts +3 -0
  207. package/src/transaction-calculations/total-calculation.ts +443 -0
  208. package/src/transaction-calculations/transaction-calculation-engine.ts +903 -0
  209. package/src/utils/my-date.ts +111 -0
  210. package/src/utils/tr-utils.ts +104 -0
  211. package/tsconfig.json +2 -2
  212. /package/dist/{accounting/invoice/invoice-pdf.service.d.ts → shared/transactions-pdf.service.d.ts} +0 -0
@@ -0,0 +1,1917 @@
1
+ import { ROTypeEnum } from '../enums/code-enums';
2
+ import { ROStatusEnum } from '../enums/enums';
3
+ import { SharedPDFService } from '../shared/shared-pdf.service';
4
+ import { PrintSharedService } from '../shared/shared-print.service';
5
+ import { TrUtils } from '../utils/tr-utils';
6
+ declare var pdfMake: any;
7
+
8
+ export class RoprintService {
9
+
10
+ static FontSize: number = 8;
11
+ static PrintFile: any;
12
+
13
+ static CommonHeaderDetails(ROPrintData: any, text: any, isOtherIndustry: boolean) {
14
+ // console.log('ROPrintData', ROPrintData);
15
+ return [
16
+ this.GetMainHeaderDetails(ROPrintData.Entity, ROPrintData.HeaderName, ROPrintData.Image, ROPrintData.HColor, ROPrintData.AColor, text),
17
+ // this.GetHeaderDetails(ROPrintData.HeaderName, ROPrintData.Entity, ROPrintData.Image),
18
+ // SharedPDFService.HeaderAfterLine()
19
+ SharedPDFService.GetCustomerAndVehicleDetails(ROPrintData._id, ROPrintData.CrDate, ROPrintData.PrDate,
20
+ ROPrintData.MOut, ROPrintData.MIn, ROPrintData.Vehicle, ROPrintData.Type, ROPrintData.Payee,
21
+ ROPrintData.SurName, ROPrintData.SurPhone, ROPrintData.Type, ROPrintData.SurEmail, ROPrintData.InsComp,
22
+ ROPrintData.PolNo, ROPrintData.PolType, ROPrintData.Customer, false, ROPrintData.Settings, ROPrintData.Location, isOtherIndustry, null, null,null,null, ROPrintData.DoS),
23
+ SharedPDFService.CustomerAndVehicleDetailsAfterLine(),
24
+ // SharedPDFService.GetDisplayTable()
25
+ ];
26
+ }
27
+
28
+ static GetMainHeaderDetails(Entity: any, HeaderName: any, Image: any, HColor: any, AColor: any, text: any) {
29
+ return [
30
+ // SharedPDFService.MainHeading(Entity.CName, Entity.Header, Image, HColor, text),
31
+ SharedPDFService.GetMainHeader(Entity, Image, AColor, HColor, text),
32
+ SharedPDFService.GetPrintType(HeaderName),
33
+ SharedPDFService.HeaderAfterLine()
34
+ ];
35
+ }
36
+
37
+ static CommonTotalDetails(ROPrintData: any, index: any, numberofCopies: any) {
38
+ let CommonDetails = [
39
+ SharedPDFService.GetFinalTotalDetails(ROPrintData,ROPrintData.CustLaborTotalBeforeDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST,
40
+ ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST,
41
+ ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST,
42
+ ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts,
43
+ ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.Payee,
44
+ ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal,
45
+ ROPrintData.ShowDetailedLaborTaxInfo, ROPrintData.ShowDetailedPartTaxInfo,
46
+ TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax,
47
+ ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, null,null,false),
48
+ // SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false, ROPrintData.Entity.DecimalsNumber),
49
+ SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
50
+ SharedPDFService.GetUnderLine(),
51
+ SharedPDFService.GetSignatures(ROPrintData.Entity.CName, ROPrintData.Type, ROPrintData.Payee),
52
+ ];
53
+ if (ROPrintData.Type !== 'Invoice') {
54
+ CommonDetails.splice(1, 0, SharedPDFService.GetUnderLine());
55
+ }
56
+ if (!TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
57
+ CommonDetails.push({ text: '', pageBreak: 'after' })
58
+ }
59
+ return CommonDetails;
60
+ }
61
+
62
+ static CommonInsTotalDetails(ROPrintData: any, index: any, numberofCopies: any) {
63
+ let CommonDetails = [
64
+ SharedPDFService.GetFinalTotalDetails(ROPrintData,ROPrintData.InsLaborTotalBeforeDisc, ROPrintData.InsLaborDiscTotal, ROPrintData.InsLaborCGST,
65
+ ROPrintData.InsLaborSGST, ROPrintData.InsLaborIGST, ROPrintData.InsPartIGST, ROPrintData.ShowIGST,
66
+ ROPrintData.ShowTaxColumn, ROPrintData.InsPartsTotalBeforeDisc, ROPrintData.InsPartsDiscTotal, ROPrintData.InsPartCGST,
67
+ ROPrintData.InsPartSGST, ROPrintData.InsTaxGroupData, ROPrintData.ShowAccParts,
68
+ ROPrintData.InsLaborTotalAfterTax, ROPrintData.InsPartsTotalAfterTax, ROPrintData.FixedDisc, ROPrintData.Payee,
69
+ ROPrintData.FixedInsTotal, ROPrintData.InsTotalRoundedBy, ROPrintData.InsRoundedTotal,
70
+ ROPrintData.ShowDetailedLaborTaxInfo, ROPrintData.ShowDetailedPartTaxInfo,
71
+ TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.InsLaborITax,
72
+ ROPrintData.InsPartITax, ROPrintData.Consolidate, ROPrintData.From, null,null,false),
73
+ // SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false, ROPrintData.Entity.DecimalsNumber),
74
+ SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
75
+ SharedPDFService.GetUnderLine(),
76
+ SharedPDFService.GetSignatures(ROPrintData.Entity.CName, ROPrintData.Type, ROPrintData.Payee),
77
+ ];
78
+ if (ROPrintData.Type !== 'Invoice') {
79
+ CommonDetails.splice(1, 0, SharedPDFService.GetUnderLine());
80
+ }
81
+
82
+ if (!TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
83
+ CommonDetails.push({ text: '', pageBreak: 'after' })
84
+ }
85
+ return CommonDetails;
86
+ }
87
+
88
+ // Customer Only Print Method
89
+ static GetCustomerPrint(ROPrintData: any, numberofCopies: any, isOtherIndustry: boolean) {
90
+ console.log(ROPrintData,numberofCopies,isOtherIndustry);
91
+ var contents = [];
92
+ if (TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
93
+ contents.push(
94
+ this.CommonHeaderDetails(ROPrintData, null, isOtherIndustry),
95
+ this.CustomersparePartsTable(ROPrintData),
96
+ this.CommonTotalDetails(ROPrintData, null, numberofCopies)
97
+ );
98
+ } else {
99
+ numberofCopies.forEach((text: any, index: any) => {
100
+ contents.push(
101
+ this.CommonHeaderDetails(ROPrintData, text, isOtherIndustry),
102
+ this.CustomersparePartsTable(ROPrintData),
103
+ this.CommonTotalDetails(ROPrintData, index, numberofCopies)
104
+ );
105
+ });
106
+ }
107
+ var dd = {
108
+ info: {
109
+ title: this.GetFileName(ROPrintData),
110
+ },
111
+
112
+ header: function (currentPage: any, pageCount: any, pageSize: any) {
113
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
114
+ },
115
+ background: function (currentPage: any, pageSize: any) {
116
+ return SharedPDFService.GetWatermarkImage(ROPrintData.Image, pageSize, ROPrintData.Entity.Wmark);
117
+ },
118
+ pageMargins: [10, 25, 10, 15],
119
+ content: contents,
120
+ styles: SharedPDFService.GetStyles()
121
+ };
122
+ return dd;
123
+ }
124
+
125
+ static GetHeaderDetails(HeaderName: any, Entity: any, Image: any) {
126
+ return {
127
+ columns: [{
128
+ stack: [{
129
+ image: Image,
130
+ width: 150, marginBottom: 15
131
+ }, { text: HeaderName, fontSize: 20 }]
132
+ }, {
133
+ stack: this.CompanyDetails(Entity),
134
+ }], marginLeft: 20, marginRight: 20, marginTop: 15, marginBottom: 5
135
+ }
136
+ }
137
+
138
+ static CompanyDetails(Entity: any) {
139
+ let Details: any = [
140
+ { text: Entity.CName, alignment: 'right', lineHeight: 1.5, fontSize: 8 },
141
+ { text: Entity.Adrs1 + ',', alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 },
142
+ { text: '' + Entity.City + SharedPDFService.getPinCode(Entity.PIN) + ', ' + 'Ph: ' + Entity.Phone, alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 },
143
+ { text: '' + SharedPDFService.GetEmail(Entity.Email) + '', alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 },
144
+ { text: 'GSTIN : ' + Entity.GSTIN, alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 },
145
+ { text: 'PAN No : ' + Entity.PAN, alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 }]
146
+ if (!TrUtils.IsEmpty(Entity.Adrs2)) {
147
+ Details.splice(2, 0, { text: Entity.Adrs2 + '', alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 });
148
+ }
149
+ return Details;
150
+ }
151
+
152
+ static GetFileName(ROPrintData: any) {
153
+ let fileName: string = ROPrintData.HeaderName;
154
+ if (!TrUtils.IsEmpty(ROPrintData.Vehicle.RegNo)) {
155
+ fileName = fileName + '-' + ROPrintData.Vehicle.RegNo
156
+ }
157
+ return fileName;
158
+ }
159
+
160
+ static CustomersparePartsTable(ROPrintData: any) {
161
+ let List: any = [];
162
+ if (ROPrintData.Entity.Body === 1) {
163
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
164
+ if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
165
+ ROPrintData.PrintInfo[i].Text = '';
166
+ }
167
+ List.push(ROPrintData.PrintInfo[i].Text,
168
+ this.GetLaborPartsTableForView(TrUtils.Stringify(ROPrintData.PrintInfo[i].Parts), TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.Entity.MPN),
169
+ this.GetCustomerIndPartsTable(ROPrintData.PrintInfo[i].Colli, ROPrintData.PrintInfo[i].Type, ROPrintData.PrintInfo[i].Sts,
170
+ ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn)
171
+ );
172
+
173
+ }
174
+ } else {
175
+ if (ROPrintData.Entity.Body === 2) {
176
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
177
+ if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
178
+ ROPrintData.PrintInfo[i].Text = '';
179
+ }
180
+ List.push(ROPrintData.PrintInfo[i].Text,
181
+ this.WithOutDiscountFieldTable(TrUtils.Stringify(ROPrintData.PrintInfo[i].Parts), TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn,
182
+ ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn),
183
+ this.GetCustomerIndPartsTable(ROPrintData.PrintInfo[i].Colli, ROPrintData.PrintInfo[i].Type, ROPrintData.PrintInfo[i].Sts,
184
+ ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn),
185
+ );
186
+
187
+ }
188
+ } else {
189
+ if (ROPrintData.Summary) {
190
+ List.push('',
191
+ this.GetLaborPartsTableForView(ROPrintData.Parts, ROPrintData.Ops, ROPrintData.Entity.MPN)
192
+ // this.GetCustomerIndPartsTable(null, ROPrintData.Type, ROPrintData.Sts,
193
+ // ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn)
194
+ );
195
+ } else {
196
+ console.log('new', ROPrintData.PrintInfo);
197
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
198
+ const printInfo = ROPrintData.PrintInfo[i];
199
+ const hasText = !TrUtils.IsEmpty(printInfo.Text) && ('' + printInfo.Text).trim() !== '';
200
+ const hasPartsOrOps = (!TrUtils.IsNull(printInfo.Parts) && printInfo.Parts.length > 0)
201
+ || (!TrUtils.IsNull(printInfo.Ops) && printInfo.Ops.length > 0);
202
+ const hasColli = !TrUtils.IsNull(printInfo.Colli) && printInfo.Colli.length > 0;
203
+
204
+ if (hasText) {
205
+ List.push(printInfo.Text);
206
+ }
207
+ if (hasPartsOrOps) {
208
+ List.push(
209
+ this.GetWithOutDiscAndTaxFieldHeader(TrUtils.Stringify(printInfo.Parts), TrUtils.Stringify(printInfo.Ops),
210
+ ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn)
211
+ );
212
+ }
213
+ if (hasColli) {
214
+ List.push(
215
+ this.GetCustomerIndPartsTable(printInfo.Colli, printInfo.Type, printInfo.Sts,
216
+ ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn)
217
+ );
218
+ }
219
+
220
+ }
221
+ }
222
+ }
223
+ }
224
+ return List;
225
+ }
226
+
227
+ static GetCustomerIndPartsTable(Colli: any, Type: any, Status: any, PrintPartNo: any, ShowTaxColumn: any) {
228
+ let Table: any = {};
229
+ if (!TrUtils.IsNull(Colli) && Colli.length !== 0) {
230
+ let Approved: boolean = (Status === ROStatusEnum.New || Status === ROStatusEnum.WtngForAppr) ? false : true;
231
+ let isRepairOrder: boolean = (Type === ROTypeEnum.RepairOrder) ? true : false;
232
+ Table = this.CustomerAccidentalPartsTableAfterApproval(Colli, ShowTaxColumn, PrintPartNo, Approved, isRepairOrder);
233
+ return Table;
234
+ } else {
235
+ return Table;
236
+ }
237
+ }
238
+
239
+ static GetInsurancePrint(ROPrintData: any, numberofCopies: any, isOtherIndustry: boolean) {
240
+ var contents = [];
241
+ if (TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
242
+ contents.push(
243
+ this.CommonHeaderDetails(ROPrintData, null, isOtherIndustry),
244
+ this.InsurancesparePartsTable(ROPrintData),
245
+ this.CommonInsTotalDetails(ROPrintData, null, numberofCopies)
246
+ );
247
+ } else {
248
+ numberofCopies.forEach((text: any, index: any) => {
249
+ contents.push(
250
+ this.CommonHeaderDetails(ROPrintData, text, isOtherIndustry),
251
+ this.InsurancesparePartsTable(ROPrintData),
252
+ this.CommonInsTotalDetails(ROPrintData, index, numberofCopies)
253
+ );
254
+ });
255
+ }
256
+ var dd = {
257
+ info: {
258
+ title: this.GetFileName(ROPrintData),
259
+ },
260
+ background: function (currentPage: any, pageSize: any) {
261
+ return SharedPDFService.GetWatermarkImage(ROPrintData.Image, pageSize, ROPrintData.Entity.Wmark);
262
+ },
263
+ header: function (currentPage: any, pageCount: any) {
264
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
265
+ },
266
+ pageMargins: [10, 25, 10, 15],
267
+ content: contents,
268
+ styles: SharedPDFService.GetStyles()
269
+ };
270
+ // if (!TrUtils.IsNull(win)) {
271
+ // pdfMake.createPdf(dd).open({}, win);
272
+ // } else {
273
+ // pdfMake.createPdf(dd).open();
274
+ // }
275
+ return dd;
276
+ // this.PrintFile = TrUtils.Stringify(dd);
277
+ // pdfMake.createPdf(dd).getDataUrl(function (outDoc: any) {
278
+ // document.getElementById('pdf').setAttribute('src', outDoc);
279
+ // });
280
+ }
281
+
282
+ // Insurance Only Print Method
283
+ static InsurancesparePartsTable(ROPrintData: any) {
284
+ let List: any = [];
285
+ if (ROPrintData.Entity.Body === 1) {
286
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
287
+ if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
288
+ ROPrintData.PrintInfo[i].Text = '';
289
+ }
290
+ List.push(ROPrintData.PrintInfo[i].Text,
291
+ this.GetLaborPartsTableForView(TrUtils.Stringify(ROPrintData.PrintInfo[i].Parts), TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.Entity.MPN),
292
+ this.GetInsuranceIndPartsTable(ROPrintData.PrintInfo[i], ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn)
293
+ );
294
+
295
+ }
296
+ } else {
297
+ if (ROPrintData.Entity.Body === 2) {
298
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
299
+ if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
300
+ ROPrintData.PrintInfo[i].Text = '';
301
+ }
302
+ List.push(ROPrintData.PrintInfo[i].Text,
303
+ this.WithOutDiscountFieldTable(TrUtils.Stringify(ROPrintData.PrintInfo[i].Parts), TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn,
304
+ ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn),
305
+ this.GetInsuranceIndPartsTable(ROPrintData.PrintInfo[i], ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn)
306
+ );
307
+
308
+ }
309
+ } else {
310
+ if (ROPrintData.Summary) {
311
+ List.push('',
312
+ this.GetLaborPartsTableForView(ROPrintData.Parts, ROPrintData.Ops, ROPrintData.Entity.MPN)
313
+ // this.GetCustomerIndPartsTable(null, ROPrintData.Type, ROPrintData.Sts,
314
+ // ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn)
315
+ );
316
+ } else {
317
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
318
+ const printInfo = ROPrintData.PrintInfo[i];
319
+ const hasText = !TrUtils.IsNull(printInfo.Text) && ('' + printInfo.Text).trim() !== '';
320
+ const hasPartsOrOps = (!TrUtils.IsNull(printInfo.Parts) && printInfo.Parts.length > 0)
321
+ || (!TrUtils.IsNull(printInfo.Ops) && printInfo.Ops.length > 0);
322
+ const hasColli = !TrUtils.IsNull(printInfo.Colli) && printInfo.Colli.length > 0;
323
+
324
+ if (hasText) {
325
+ List.push(printInfo.Text);
326
+ }
327
+ if (hasPartsOrOps) {
328
+ List.push(
329
+ this.GetWithOutDiscAndTaxFieldHeader(TrUtils.Stringify(printInfo.Parts), TrUtils.Stringify(printInfo.Ops),
330
+ ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn)
331
+ );
332
+ }
333
+ if (hasColli) {
334
+ List.push(
335
+ this.GetInsuranceIndPartsTable(printInfo, ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn)
336
+ );
337
+ }
338
+
339
+ }
340
+ }
341
+
342
+ }
343
+ }
344
+ return List;
345
+ }
346
+
347
+ static GetInsuranceIndPartsTable(PrintInfo: any, PrintPartNo: any, ShowTaxColumn: any) {
348
+ let Table: any = {};
349
+ if (!TrUtils.IsNull(PrintInfo.Colli) && PrintInfo.Colli.length !== 0) {
350
+ if (PrintInfo.Sts === ROStatusEnum.New || PrintInfo.Sts === ROStatusEnum.WtngForAppr) {
351
+ Table = this.GetTableForApproval(PrintInfo.Colli, PrintPartNo, ShowTaxColumn);
352
+ } else {
353
+ Table = this.InsuranceAccidentalPartsTableAfterApproval(PrintInfo.Colli, ShowTaxColumn, PrintPartNo);
354
+ }
355
+ return Table;
356
+ } else {
357
+ return Table;
358
+ }
359
+
360
+ }
361
+
362
+ // Insurance & Customer Print Method
363
+ static GetInsuranceAndCustomerPrint(ROPrintData: any, numberofCopies: any, isOtherIndustry: boolean) {
364
+ var contents = [];
365
+ if (TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
366
+ contents.push(
367
+ this.CommonHeaderDetails(ROPrintData, null, isOtherIndustry),
368
+ this.InsuranceAndCustomersparePartsTable(ROPrintData),
369
+ this.CommonInsTotalDetails(ROPrintData, null, numberofCopies)
370
+ );
371
+ } else {
372
+ numberofCopies.forEach((text: any, index: any) => {
373
+ contents.push(
374
+ this.CommonHeaderDetails(ROPrintData, text, isOtherIndustry),
375
+ this.InsuranceAndCustomersparePartsTable(ROPrintData),
376
+ this.CommonInsTotalDetails(ROPrintData, index, numberofCopies)
377
+ );
378
+ });
379
+ }
380
+ var dd = {
381
+ info: {
382
+ title: this.GetFileName(ROPrintData),
383
+ },
384
+ background: function (currentPage: any, pageSize: any) {
385
+ return SharedPDFService.GetWatermarkImage(ROPrintData.Image, pageSize, ROPrintData.Entity.Wmark);
386
+ },
387
+ header: function (currentPage: any, pageCount: any) {
388
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
389
+ },
390
+ pageMargins: [10, 25, 10, 15],
391
+ content: contents,
392
+ styles: SharedPDFService.GetStyles()
393
+ };
394
+ // if (!TrUtils.IsNull(win)) {
395
+ // pdfMake.createPdf(dd).open({}, win);
396
+ // } else {
397
+ // pdfMake.createPdf(dd).open();
398
+ // }
399
+ return dd;
400
+ // this.PrintFile = TrUtils.Stringify(dd);
401
+ // pdfMake.createPdf(dd).getDataUrl(function (outDoc: any) {
402
+ // document.getElementById('pdf').setAttribute('src', outDoc);
403
+ // });
404
+ }
405
+
406
+ static InsuranceAndCustomersparePartsTable(ROPrintData: any) {
407
+ let List: any = [];
408
+ if (ROPrintData.Entity.Body === 1) {
409
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
410
+ if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
411
+ ROPrintData.PrintInfo[i].Text = '';
412
+ }
413
+ List.push(ROPrintData.PrintInfo[i].Text,
414
+ this.GetLaborPartsTableForView(TrUtils.Stringify(ROPrintData.PrintInfo[i].Parts), TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.Entity.MPN),
415
+ this.GetInsuranceAndCustomerIndPartsTable(ROPrintData.PrintInfo[i], ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn)
416
+ );
417
+
418
+ }
419
+ } else {
420
+ if (ROPrintData.Entity.Body === 2) {
421
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
422
+ if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
423
+ ROPrintData.PrintInfo[i].Text = '';
424
+ }
425
+ List.push(ROPrintData.PrintInfo[i].Text,
426
+ this.WithOutDiscountFieldTable(TrUtils.Stringify(ROPrintData.PrintInfo[i].Parts), TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn,
427
+ ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn),
428
+ this.GetInsuranceAndCustomerIndPartsTable(ROPrintData.PrintInfo[i], ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn)
429
+ );
430
+
431
+ }
432
+ } else {
433
+ if (ROPrintData.Summary) {
434
+ List.push('',
435
+ this.GetInsuranceOrCustomerLaborPartsTableForView(TrUtils.Stringify(ROPrintData.Parts), TrUtils.Stringify(ROPrintData.Ops), ROPrintData.Entity.MPN));
436
+ } else {
437
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
438
+ const printInfo = ROPrintData.PrintInfo[i];
439
+ const hasText = !TrUtils.IsNull(printInfo.Text) && ('' + printInfo.Text).trim() !== '';
440
+ const hasPartsOrOps = (!TrUtils.IsNull(printInfo.Parts) && printInfo.Parts.length > 0)
441
+ || (!TrUtils.IsNull(printInfo.Ops) && printInfo.Ops.length > 0);
442
+ const hasColli = !TrUtils.IsNull(printInfo.Colli) && printInfo.Colli.length > 0;
443
+
444
+ if (hasText) {
445
+ List.push(printInfo.Text);
446
+ }
447
+ if (hasPartsOrOps) {
448
+ List.push(
449
+ this.GetWithOutDiscAndTaxFieldHeader(TrUtils.Stringify(printInfo.Parts), TrUtils.Stringify(printInfo.Ops), ROPrintData.ShowTaxColumn,
450
+ ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn)
451
+ );
452
+ }
453
+ if (hasColli) {
454
+ List.push(
455
+ this.GetInsuranceAndCustomerIndPartsTable(printInfo, ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn)
456
+ );
457
+ }
458
+
459
+ }
460
+ }
461
+ }
462
+ }
463
+ return List;
464
+ }
465
+
466
+ static GetInsuranceAndCustomerIndPartsTable(PrintInfo: any, PrintPartNo: any, ShowTaxColumn: any) {
467
+ let Table: any = {};
468
+ if (!TrUtils.IsNull(PrintInfo.Colli) && PrintInfo.Colli.length !== 0) {
469
+ Table = this.GetTableAsCombinedColForCustAndIns(PrintInfo.Colli, PrintPartNo, ShowTaxColumn);
470
+ return Table;
471
+ } else {
472
+ return Table;
473
+ }
474
+ }
475
+
476
+ // Insurance | Customer Print Method
477
+ static GetInsuranceOrCustomerPrint(ROPrintData: any, numberofCopies: any, isOtherIndustry: boolean) {
478
+ var contents = [];
479
+ if (TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
480
+ contents.push(
481
+ this.CommonHeaderDetails(ROPrintData, null, isOtherIndustry),
482
+ this.InsuranceOrCustomersparePartsTable(ROPrintData),
483
+ this.CommonInsTotalDetails(ROPrintData, null, numberofCopies)
484
+ );
485
+ } else {
486
+ numberofCopies.forEach((text: any, index: any) => {
487
+ contents.push(
488
+ this.CommonHeaderDetails(ROPrintData, text, isOtherIndustry),
489
+ this.InsuranceOrCustomersparePartsTable(ROPrintData),
490
+ this.CommonInsTotalDetails(ROPrintData, index, numberofCopies)
491
+ );
492
+ });
493
+ }
494
+ var dd = {
495
+ info: {
496
+ title: this.GetFileName(ROPrintData),
497
+ },
498
+ background: function (currentPage: any, pageSize: any) {
499
+ return SharedPDFService.GetWatermarkImage(ROPrintData.Image, pageSize, ROPrintData.Entity.Wmark);
500
+ },
501
+ header: function (currentPage: any, pageCount: any) {
502
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
503
+ },
504
+ pageMargins: [10, 25, 10, 15],
505
+ content: contents,
506
+ styles: SharedPDFService.GetStyles()
507
+ };
508
+ // if (!TrUtils.IsNull(win)) {
509
+ // pdfMake.createPdf(dd).open({}, win);
510
+ // } else {
511
+ // pdfMake.createPdf(dd).open();
512
+ // }
513
+ return dd;
514
+ // this.PrintFile = TrUtils.Stringify(dd);
515
+ // pdfMake.createPdf(dd).getDataUrl(function (outDoc: any) {
516
+ // document.getElementById('pdf').setAttribute('src', outDoc);
517
+ // });
518
+ }
519
+
520
+ static InsuranceOrCustomersparePartsTable(ROPrintData: any) {
521
+ let List: any = [];
522
+ if (ROPrintData.Entity.Body === 1) {
523
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
524
+ if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
525
+ ROPrintData.PrintInfo[i].Text = '';
526
+ }
527
+ List.push(ROPrintData.PrintInfo[i].Text,
528
+ this.GetLaborPartsTableForView(ROPrintData.PrintInfo[i].Parts, ROPrintData.PrintInfo[i].Ops, ROPrintData.Entity.MPN),
529
+ this.GetInsuranceOrCustomerIndPartsTable(ROPrintData.PrintInfo[i], ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn)
530
+ );
531
+
532
+ }
533
+ } else {
534
+ if (ROPrintData.Entity.Body === 2) {
535
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
536
+ if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
537
+ ROPrintData.PrintInfo[i].Text = '';
538
+ }
539
+ List.push(ROPrintData.PrintInfo[i].Text,
540
+ this.WithOutDiscountFieldTable(ROPrintData.PrintInfo[i].Parts, ROPrintData.PrintInfo[i].Ops, ROPrintData.ShowTaxColumn,
541
+ ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn),
542
+ this.GetInsuranceOrCustomerIndPartsTable(ROPrintData.PrintInfo[i], ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn)
543
+
544
+ );
545
+
546
+ }
547
+ } else {
548
+ if (ROPrintData.Summary) {
549
+ List.push('',
550
+ this.GetInsuranceOrCustomerLaborPartsTableForView(ROPrintData.Parts, ROPrintData.Ops, ROPrintData.Entity.MPN));
551
+
552
+ } else {
553
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
554
+ const printInfo = ROPrintData.PrintInfo[i];
555
+ const hasText = !TrUtils.IsNull(printInfo.Text) && ('' + printInfo.Text).trim() !== '';
556
+ const hasPartsOrOps = (!TrUtils.IsNull(printInfo.Parts) && printInfo.Parts.length > 0)
557
+ || (!TrUtils.IsNull(printInfo.Ops) && printInfo.Ops.length > 0);
558
+ const hasColli = !TrUtils.IsNull(printInfo.Colli) && printInfo.Colli.length > 0;
559
+
560
+ if (hasText) {
561
+ List.push(printInfo.Text);
562
+ }
563
+ if (hasPartsOrOps) {
564
+ List.push(
565
+ this.GetWithOutDiscAndTaxFieldHeader(printInfo.Parts, printInfo.Ops,
566
+ ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGS, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn)
567
+ );
568
+ }
569
+ if (hasColli) {
570
+ List.push(
571
+ this.GetInsuranceOrCustomerIndPartsTable(printInfo, ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn)
572
+ );
573
+ }
574
+
575
+ }
576
+ }
577
+ }
578
+ }
579
+ return List;
580
+ }
581
+
582
+ static GetInsuranceOrCustomerIndPartsTable(PrintInfo: any, PrintPartNo: any, ShowTaxColumn: any) {
583
+ let Table: any = {};
584
+ if (!TrUtils.IsNull(PrintInfo.Colli) && PrintInfo.Colli.length !== 0) {
585
+ Table = this.GetTableAsSeparateColForCustAndIns(PrintInfo.Colli, PrintPartNo, ShowTaxColumn);
586
+ return Table;
587
+ } else {
588
+ return Table;
589
+ }
590
+ }
591
+
592
+ static GetLaborPartsTableForView(Parts: any, Ops: any, PrintPartNo: any) {
593
+ if (Parts.length !== 0 || Ops.length !== 0) {
594
+ if (PrintPartNo) {
595
+ return {
596
+ style: 'tableExample',
597
+ // marginLeft: 20,
598
+ table: {
599
+ widths: [25, 85, 170, 20, 50, 30, 30, 50],
600
+ // headerRows: 2,
601
+ body: this.buildTableForCustomerLabor(Parts, Ops, PrintPartNo, false)
602
+ },
603
+ layout: PrintSharedService.LayOutStyleanother()
604
+ };
605
+ } else {
606
+ return {
607
+ style: 'tableExample',
608
+ // marginLeft: 20,
609
+ table: {
610
+ widths: [25, 200, 55, 25, 55, 55, 40, 50],
611
+ // headerRows: 2,
612
+ body: this.buildTableForCustomerLabor(Parts, Ops, PrintPartNo, false)
613
+ },
614
+ layout: PrintSharedService.LayOutStyleanother()
615
+ };
616
+ }
617
+ } else {
618
+ let a: any = '';
619
+ return a;
620
+ }
621
+ }
622
+
623
+ static GetInsuranceOrCustomerLaborPartsTableForView(Parts: any, Ops: any, PrintPartNo: any) {
624
+ if (Parts.length !== 0 || Ops.length !== 0) {
625
+ if (PrintPartNo) {
626
+ return {
627
+ style: 'tableExample',
628
+ // marginLeft: 20,
629
+ table: {
630
+ widths: [25, 85, 170, 20, 50, 30, 30, 50],
631
+ // headerRows: 2,
632
+ body: this.buildTableForCustomerLabor(Parts, Ops, PrintPartNo, true)
633
+ },
634
+ layout: PrintSharedService.LayOutStyleanother()
635
+ };
636
+ } else {
637
+ return {
638
+ style: 'tableExample',
639
+ // marginLeft: 20,
640
+ table: {
641
+ widths: [25, 185, 45, 20, 50, 50, 40, 30, 50],
642
+ // headerRows: 2,
643
+ body: this.buildTableForCustomerLabor(Parts, Ops, PrintPartNo, true)
644
+ },
645
+ layout: PrintSharedService.LayOutStyleanother()
646
+ };
647
+ }
648
+ } else {
649
+ let a: any = '';
650
+ return a;
651
+ }
652
+ }
653
+
654
+ static buildTableBody(Parts: any, Ops: any, PrintPartNo: any) {
655
+ var body: any = [];
656
+ let columns: any = SharedPDFService.GetHeaders(PrintPartNo);
657
+ // body.push(columns);
658
+ for (let i = 0; i < columns.length; i++) {
659
+ body.push(columns[i]);
660
+ }
661
+
662
+
663
+ let DummyOps: any = [];
664
+
665
+ if (Parts.length !== 0) {
666
+ let dummypartadding1: any = {};
667
+ dummypartadding1.SNo = '';
668
+ dummypartadding1.Desc = 'Spare Parts';
669
+ dummypartadding1.Qty = '';
670
+ dummypartadding1.UnPr = '';
671
+ dummypartadding1.LineTotal = '';
672
+ Parts.unshift(dummypartadding1);
673
+ }
674
+
675
+ let SNo: number = 1;
676
+ Parts.forEach((part: any) => {
677
+ var dataRow: any = [];
678
+ columns[1].forEach((column: any) => {
679
+ if (!TrUtils.IsFixedZero(part[column.Field]) && !TrUtils.IsNull(part[column.Field])
680
+ || column.text === 'Line Total') {
681
+ if (part[column.Field] === 'Spare Parts') {
682
+ dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
683
+ } else {
684
+ // tslint:disable-next-line:max-line-length
685
+ if (column.text === 'Line Total' || column.Field === 'QtyAndUoM' || column.Field === 'Disc' || column.Field === 'UnPr') {
686
+ if (column.Field === 'Disc') {
687
+ if (column.type === 'percentage') {
688
+ if (!TrUtils.IsEmpty(part.Perc)) {
689
+ dataRow.push({ text: part.Perc.toString(), alignment: 'right', noWrap: true });
690
+ } else {
691
+ dataRow.push({ text: '', noWrap: true });
692
+ }
693
+ } else {
694
+ if (!TrUtils.IsZero(part[column.Field])) {
695
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', noWrap: true });
696
+ } else {
697
+ dataRow.push({ text: '', noWrap: true });
698
+ }
699
+ }
700
+ } else {
701
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
702
+ }
703
+
704
+ } else {
705
+ if (column.Field === 'Desc') {
706
+ let DescData: any = [];
707
+ DescData.push(part[column.Field].toString());
708
+ if (!TrUtils.IsEmpty(part['EDesc'])) {
709
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
710
+ }
711
+ dataRow.push({ stack: DescData });
712
+ } else {
713
+ dataRow.push({ text: part[column.Field].toString() });
714
+ }
715
+ }
716
+ }
717
+ } else {
718
+ if (column.Field === 'SNo') {
719
+ part[column.Field] = SNo;
720
+ SNo = SNo + 1;
721
+ } else {
722
+ part[column.Field] = '';
723
+ }
724
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
725
+ }
726
+ });
727
+
728
+ body.push(dataRow);
729
+ });
730
+
731
+ if (Ops.length !== 0) {
732
+ let dummypartadding1: any = {};
733
+ dummypartadding1.SNo = '';
734
+ dummypartadding1.Desc = 'Labor';
735
+ dummypartadding1.Qty = '';
736
+ dummypartadding1.UnPr = '';
737
+ dummypartadding1.LineTotal = '';
738
+ Ops.unshift(dummypartadding1);
739
+ }
740
+
741
+ Ops.forEach((labor: any) => {
742
+ var dataRow: any = [];
743
+ columns[1].forEach((column: any) => {
744
+ if (!TrUtils.IsFixedZero(labor[column.Field]) && !TrUtils.IsNull(labor[column.Field])
745
+ || column.text === 'Line Total') {
746
+ if (labor[column.Field] === 'Labor') {
747
+ dataRow.push({ text: labor[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
748
+ } else {
749
+ if (column.text === 'Line Total' || column.Field === 'QtyAndUoM' || column.Field === 'Disc'
750
+ || column.Field === 'UnPr') {
751
+ if (column.Field === 'Disc') {
752
+ if (column.type === 'percentage') {
753
+ if (!TrUtils.IsEmpty(labor.Perc)) {
754
+ dataRow.push({ text: labor.Perc.toString(), alignment: 'right', noWrap: true });
755
+ } else {
756
+ dataRow.push({ text: '', noWrap: true });
757
+ }
758
+ } else {
759
+ if (!TrUtils.IsZero(labor[column.Field])) {
760
+ dataRow.push({ text: labor[column.Field].toString(), alignment: 'right', noWrap: true });
761
+ } else {
762
+ dataRow.push({ text: '', noWrap: true });
763
+ }
764
+ }
765
+ } else {
766
+ dataRow.push({ text: labor[column.Field].toString(), alignment: 'right', nowrap: true });
767
+ }
768
+
769
+ } else {
770
+ dataRow.push(labor[column.Field].toString());
771
+ }
772
+ }
773
+ } else {
774
+ if (column.Field === 'SNo') {
775
+ labor[column.Field] = SNo;
776
+ SNo = SNo + 1;
777
+ } else {
778
+ labor[column.Field] = '';
779
+ }
780
+ dataRow.push({ text: labor[column.Field].toString(), alignment: 'center' });
781
+ }
782
+ });
783
+ body.push(dataRow);
784
+ });
785
+ return body;
786
+ }
787
+
788
+ static GetTableForApproval(Colli: any, PrintPartNo: any, ShowTaxColumn: any) {
789
+ if (ShowTaxColumn) {
790
+ return {
791
+ style: 'tableExample',
792
+ marginTop: 7,
793
+ lineHeight: 1,
794
+ dontBreakRows: true,
795
+ table: {
796
+ widths: [10, 94, 28, 20, 34, 35, 34, 35, 34, 35, 34, 35, 35],
797
+ // headerRows: 3,
798
+ body: this.GetApprovalTableHeaderBody(Colli, PrintPartNo, ShowTaxColumn)
799
+ },
800
+ layout: this.threeLayOutStyle()
801
+ };
802
+ } else {
803
+ return {
804
+ style: 'tableExample',
805
+ marginTop: 7,
806
+ lineHeight: 1,
807
+ dontBreakRows: true,
808
+ table: {
809
+ widths: [10, 130, 20, 34, 35, 34, 35, 34, 35, 34, 35, 35],
810
+ // headerRows: 3,
811
+ body: this.GetApprovalTableHeaderBody(Colli, PrintPartNo, ShowTaxColumn)
812
+ },
813
+ layout: this.threeLayOutStyle()
814
+ };
815
+ }
816
+
817
+ }
818
+
819
+ static GetApprovalTableHeaderBody(Colli: any, PrintPartNo: any, ShowTaxColumn: any) {
820
+ var body: any = [];
821
+ let SNo: number = 1;
822
+ let columns: any = this.GetTableHeadersForApproval(PrintPartNo, ShowTaxColumn);
823
+ for (let i = 0; i < columns.length; i++) {
824
+ body.push(columns[i]);
825
+ }
826
+ Colli.forEach((part: any) => {
827
+ var dataRow: any = [];
828
+ columns[2].forEach((column: any) => {
829
+
830
+ if (!TrUtils.IsNull(column.Parent)) {
831
+ if (column.Field === 'AssPr') {
832
+ dataRow.push({ text: '', alignment: 'center' });
833
+ } else {
834
+ if (!TrUtils.IsNull(part[column.Parent]) && !TrUtils.IsFixedZero(part[column.Parent][column.Field]) && !TrUtils.IsNull(part[column.Parent][column.Field])) {
835
+ dataRow.push({ text: part[column.Parent][column.Field].toString(), alignment: 'right', fontSize: 7, nowrap: true });
836
+ } else {
837
+ dataRow.push({ text: '', alignment: 'center' });
838
+ }
839
+ }
840
+ } else {
841
+ if (!TrUtils.IsFixedZero(part[column.Field]) && !TrUtils.IsNull(part[column.Field])) {
842
+ if (column.Field === 'SNo' || column.Field === 'Desc'
843
+ || column.text === 'Description/PartNo') {
844
+ // dataRow.push(part[column.Field].toString());
845
+ if (column.Field === 'Desc') {
846
+ let DescData: any = [];
847
+ DescData.push(part[column.Field].toString());
848
+ if (!TrUtils.IsEmpty(part['EDesc'])) {
849
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
850
+ }
851
+ dataRow.push({ stack: DescData });
852
+ } else {
853
+ dataRow.push({ text: part[column.Field].toString() });
854
+ }
855
+ } else {
856
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', fontSize: 7, nowrap: true });
857
+ }
858
+
859
+ } else {
860
+ if (column.Field === 'SNo') {
861
+ part[column.Field] = SNo;
862
+ SNo = SNo + 1;
863
+ } else {
864
+ part[column.Field] = '';
865
+ }
866
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
867
+ }
868
+ }
869
+ });
870
+ body.push(dataRow);
871
+ });
872
+ return body;
873
+ }
874
+
875
+ static GetTableHeadersForApproval(PrintPartNo: any, ShowTaxColumn: any) {
876
+ let headersNames: any[] =
877
+ [
878
+ [{ text: 'S. No.', rowSpan: 3, style: ['tableheader', 'withOutApp'], lineHeight: 1 },
879
+ { text: 'Qty', style: ['tableheader', 'withOutApp'], rowSpan: 3 },
880
+ { text: 'Unit Price', style: ['tableheader', 'withOutApp'], rowSpan: 2, colSpan: 2 },
881
+ {},
882
+ { text: 'Labor charges', style: ['tableheader', 'withOutApp'], colSpan: 6 }, {}, {}, {}, {}, {},
883
+ { text: 'Line Total', rowSpan: 3, style: 'tableheader', alignment: 'center', lineHeight: 1 }],
884
+
885
+ [{}, {}, {}, {}, {},
886
+ { text: 'R&R/Labor', colSpan: 2, style: ['tableheader', 'withOutApp'] }, {},
887
+ { text: 'Denting', colSpan: 2, style: ['tableheader', 'withOutApp'] }, {},
888
+ { text: 'Painting', colSpan: 2, style: ['tableheader', 'withOutApp'] }, {}, {}],
889
+
890
+ [{ text: '', Field: 'SNo', lineHeight: 0.5 },
891
+ { text: '', Field: 'Desc', lineHeight: 0.5 },
892
+ { text: '', Field: 'QtyAndUoM', Parent: 'PartData', lineHeight: 0.5 },
893
+ { text: 'Estimate', fontSize: this.FontSize, style: ['tableheader', 'withOutApp'], Parent: 'PartData', Field: 'EstPr', },
894
+ { text: 'Assessed', fontSize: this.FontSize, style: ['tableheader', 'withOutApp'], Parent: 'PartData', Field: 'AssPr', },
895
+ { text: 'Estimate', fontSize: this.FontSize, style: ['tableheader', 'withOutApp'], Parent: 'RRFData', Field: 'EstPr', },
896
+ { text: 'Assessed', fontSize: this.FontSize, style: ['tableheader', 'withOutApp'], Parent: 'RRFData', Field: 'AssPr', },
897
+ { text: 'Estimate', fontSize: this.FontSize, style: ['tableheader', 'withOutApp'], Parent: 'DtngData', Field: 'EstPr', },
898
+ { text: 'Assessed', fontSize: this.FontSize, style: ['tableheader', 'withOutApp'], Parent: 'DtngData', Field: 'AssPr', },
899
+ { text: 'Estimate', fontSize: this.FontSize, style: ['tableheader', 'withOutApp'], Parent: 'PtngData', Field: 'EstPr', },
900
+ { text: 'Assessed', fontSize: this.FontSize, style: ['tableheader', 'withOutApp'], Parent: 'PtngData', Field: 'AssPr', },
901
+ { text: '', Field: 'LineTotal', lineHeight: 1, alignment: 'center' }]
902
+ ];
903
+ if (PrintPartNo) {
904
+ headersNames[0].splice(1, 0, { text: 'Description/PartNo', rowSpan: 3, style: ['tableheader', 'withOutApp'] });
905
+ } else {
906
+ headersNames[0].splice(1, 0, { text: 'Description', rowSpan: 3, style: ['tableheader', 'withOutApp'] });
907
+ }
908
+
909
+ if (ShowTaxColumn) {
910
+ headersNames[0].splice(2, 0, { text: 'HSN', style: ['tableheader', 'withOutApp'], rowSpan: 3 });
911
+ headersNames[1].splice(2, 0, {});
912
+ headersNames[2].splice(2, 0, { text: '', Parent: 'PartData', Field: 'HSN', lineHeight: 0.5 });
913
+ }
914
+ return headersNames;
915
+ }
916
+
917
+ static GetTableAsSeparateColForCustAndIns(Colli: any, PrintPartNo: any, ShowTaxColumn: any) {
918
+ if (ShowTaxColumn) {
919
+ return {
920
+ style: 'tableExample',
921
+ marginTop: 7,
922
+ lineHeight: 1,
923
+ table: {
924
+ widths: [10, 96, 28, 20, 34, 33, 34, 33, 34, 33, 34, 33, 40],
925
+ // headerRows: 3,
926
+ body: this.GetApprovedCustInsTableHeaderBody(Colli, PrintPartNo, ShowTaxColumn)
927
+ },
928
+ layout: PrintSharedService.LayOutStyle()
929
+ };
930
+ } else {
931
+ return {
932
+ style: 'tableExample',
933
+ marginTop: 7,
934
+ lineHeight: 1,
935
+ table: {
936
+ widths: [10, 130, 20, 34, 33, 34, 33, 34, 33, 34, 33, 40],
937
+ // headerRows: 3,
938
+ body: this.GetApprovedCustInsTableHeaderBody(Colli, PrintPartNo, ShowTaxColumn)
939
+ },
940
+ layout: PrintSharedService.LayOutStyle()
941
+ };
942
+ }
943
+
944
+ }
945
+
946
+ static GetApprovedCustInsTableHeaderBody(Parts: any, PrintPartNo: any, ShowTaxColumn: any) {
947
+ var body: any = [];
948
+ let SNo: number = 1;
949
+ let columns = this.GetTableHeadersForCustAndIns(PrintPartNo, ShowTaxColumn);
950
+ for (let i = 0; i < columns.length; i++) {
951
+ body.push(columns[i]);
952
+ }
953
+ Parts.forEach((part: any) => {
954
+ var dataRow: any = [];
955
+ columns[2].forEach((column: any) => {
956
+ if (!TrUtils.IsNull(column.Parent)) {
957
+ if (!TrUtils.IsNull(part[column.Parent]) && !TrUtils.IsFixedZero(part[column.Parent][column.Field]) && !TrUtils.IsNull(part[column.Parent][column.Field])) {
958
+ dataRow.push({ text: part[column.Parent][column.Field].toString(), alignment: 'right', fontSize: 7, nowrap: true });
959
+ } else {
960
+ dataRow.push({ text: '', alignment: 'center' });
961
+ }
962
+ } else {
963
+ if (!TrUtils.IsFixedZero(part[column.Field]) && !TrUtils.IsNull(part[column.Field])) {
964
+ if (column.Field === 'SNo' || column.Field === 'Desc'
965
+ || column.text === 'Description/PartNo') {
966
+ // dataRow.push(part[column.Field].toString());
967
+ if (column.Field === 'Desc') {
968
+ let DescData: any = [];
969
+ DescData.push(part[column.Field].toString());
970
+ if (!TrUtils.IsEmpty(part['EDesc'])) {
971
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
972
+ }
973
+ dataRow.push({ stack: DescData });
974
+ } else {
975
+ dataRow.push({ text: part[column.Field].toString() });
976
+ }
977
+ } else {
978
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', fontSize: 7, nowrap: true });
979
+ }
980
+ } else {
981
+ if (column.Field === 'SNo') {
982
+ part[column.Field] = SNo;
983
+ SNo = SNo + 1;
984
+ } else {
985
+ part[column.Field] = '';
986
+ }
987
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
988
+ }
989
+ }
990
+ });
991
+ body.push(dataRow);
992
+ });
993
+ return body;
994
+ }
995
+
996
+ static GetTableHeadersForCustAndIns(PrintPartNo: any, ShowTaxColumn: any) {
997
+ let headersNames: any[] =
998
+ [
999
+ [{ text: 'S. No.', rowSpan: 3, style: ['tableheader', 'withOutApp'], lineHeight: 1 },
1000
+ { text: 'Qty', style: ['tableheader', 'withOutApp'], rowSpan: 3 },
1001
+ { text: 'Unit Price', style: ['tableheader', 'withOutApp'], rowSpan: 2, colSpan: 2, },
1002
+ {},
1003
+ { text: 'Labor charges', style: ['tableheader', 'withOutApp'], colSpan: 6 }, {}, {}, {}, {}, {},
1004
+ { text: 'Line Total', rowSpan: 3, style: 'tableheader', alignment: 'center', lineHeight: 1 }],
1005
+
1006
+ [{}, {}, {}, {}, {},
1007
+ { text: 'R&R/Labor', colSpan: 2, style: ['tableheader', 'withOutApp'] }, {},
1008
+ { text: 'Denting', colSpan: 2, style: ['tableheader', 'withOutApp'] }, {},
1009
+ { text: 'Painting', colSpan: 2, style: ['tableheader', 'withOutApp'] }, {}, {}],
1010
+
1011
+ [{ text: '', Field: 'SNo' },
1012
+ { text: '', Field: 'Desc' },
1013
+ { text: '', Field: 'QtyAndUoM', Parent: 'PartData' },
1014
+ { text: 'Assessed', fontSize: this.FontSize, style: ['tableheader', 'withOutApp'], Field: 'AssPr', Parent: 'PartData' },
1015
+ { text: 'Customer', fontSize: this.FontSize, style: ['tableheader', 'withOutApp'], Field: 'UnPr', Parent: 'PartData', lineHeight: 1 },
1016
+ { text: 'Assessed', fontSize: this.FontSize, style: ['tableheader', 'withOutApp'], Field: 'AssPr', Parent: 'RRFData' },
1017
+ { text: 'Customer', fontSize: this.FontSize, style: ['tableheader', 'withOutApp'], Field: 'NetAmt', Parent: 'RRFData', lineHeight: 1 },
1018
+ { text: 'Assessed', fontSize: this.FontSize, style: ['tableheader', 'withOutApp'], Field: 'AssPr', Parent: 'DtngData' },
1019
+ {
1020
+ text: 'Customer', fontSize: this.FontSize,
1021
+ style: ['tableheader', 'withOutApp'], Field: 'NetAmt', Parent: 'DtngData', lineHeight: 1
1022
+ },
1023
+ { text: 'Assessed', fontSize: this.FontSize, style: ['tableheader', 'withOutApp'], Parent: 'PtngData', Field: 'AssPr' },
1024
+ {
1025
+ text: 'Customer', fontSize: this.FontSize,
1026
+ style: ['tableheader', 'withOutApp'], Field: 'NetAmt', Parent: 'PtngData', lineHeight: 1
1027
+ },
1028
+ { text: '', Field: 'LineTotal' }]
1029
+ ];
1030
+ if (PrintPartNo) {
1031
+ headersNames[0].splice(1, 0, { text: 'Description/PartNo', rowSpan: 3, style: ['tableheader', 'withOutApp'] });
1032
+ } else {
1033
+ headersNames[0].splice(1, 0, { text: 'Description', rowSpan: 3, style: ['tableheader', 'withOutApp'] });
1034
+ }
1035
+
1036
+ if (ShowTaxColumn) {
1037
+ headersNames[0].splice(2, 0, { text: 'HSN', style: ['tableheader', 'withOutApp'], rowSpan: 3 });
1038
+ headersNames[1].splice(2, 0, {});
1039
+ headersNames[2].splice(2, 0, { text: '', Parent: 'PartData', Field: 'HSN' });
1040
+ }
1041
+ return headersNames;
1042
+ }
1043
+
1044
+ static GetTableAsCombinedColForCustAndIns(Colli: any, PrintPartNo: any, ShowTaxColumn: any) {
1045
+ if (ShowTaxColumn) {
1046
+ return {
1047
+ style: 'tableExample',
1048
+ lineHeight: 1,
1049
+ marginTop: 7,
1050
+ // marginLeft: 20,
1051
+ table: {
1052
+ // widths: [15, 179, 35, 25, 45, 49, 49, 49, 49],
1053
+ widths: [24, 180, 35, 25, 45, 45, 45, 45, 45],
1054
+ // headerRows: 2,
1055
+ body: this.GetCombinedCustAndInsTableBodyAndHeaders(Colli, PrintPartNo, ShowTaxColumn)
1056
+ },
1057
+ layout: PrintSharedService.LayOutStyle()
1058
+ };
1059
+ } else {
1060
+ {
1061
+ return {
1062
+ style: 'tableExample',
1063
+ lineHeight: 1,
1064
+ marginTop: 7,
1065
+ // marginLeft: 20,
1066
+ table: {
1067
+ // widths: [15, 179, 35, 25, 45, 49, 49, 49, 49],
1068
+ widths: [25, 220, 25, 45, 45, 45, 45, 45],
1069
+ // headerRows: 2,
1070
+ body: this.GetCombinedCustAndInsTableBodyAndHeaders(Colli, PrintPartNo, ShowTaxColumn)
1071
+ },
1072
+ layout: PrintSharedService.LayOutStyle()
1073
+ };
1074
+ }
1075
+ }
1076
+ }
1077
+
1078
+ static GetCombinedCustAndInsTableBodyAndHeaders(Colli: any, PrintPartNo: any, ShowTaxColumn: any) {
1079
+ let SNo: number = 1;
1080
+ let body: any[] = [];
1081
+ let columns: any[] = this.GetCombinedCustAndInsColumns(PrintPartNo, ShowTaxColumn);
1082
+ for (let i = 0; i < columns.length; i++) {
1083
+ body.push(columns[i]);
1084
+ }
1085
+ Colli.forEach((part: any) => {
1086
+ var dataRow: any = [];
1087
+ columns[1].forEach((column: any) => {
1088
+ if (!TrUtils.IsNull(column.Parent)) {
1089
+ if (!TrUtils.IsNull(part[column.Parent]) && !TrUtils.IsFixedZero(part[column.Parent][column.Field]) && !TrUtils.IsNull(part[column.Parent][column.Field])) {
1090
+ dataRow.push({ text: part[column.Parent][column.Field].toString(), alignment: 'right', nowrap: true });
1091
+ } else {
1092
+ dataRow.push({ text: '', alignment: 'center' });
1093
+ }
1094
+ } else {
1095
+ if (!TrUtils.IsFixedZero(part[column.Field]) && !TrUtils.IsNull(part[column.Field])) {
1096
+ if (column.Field === 'SNo' || column.Field === 'Desc'
1097
+ || column.text === 'Description/PartNo') {
1098
+ // dataRow.push(part[column.Field].toString());
1099
+ if (column.Field === 'Desc') {
1100
+ let DescData: any = [];
1101
+ DescData.push(part[column.Field].toString());
1102
+ if (!TrUtils.IsEmpty(part['EDesc'])) {
1103
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
1104
+ }
1105
+ dataRow.push({ stack: DescData });
1106
+ } else {
1107
+ dataRow.push({ text: part[column.Field].toString() });
1108
+ }
1109
+ } else {
1110
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
1111
+ }
1112
+
1113
+ } else {
1114
+ if (column.Field === 'SNo') {
1115
+ part[column.Field] = SNo;
1116
+ SNo = SNo + 1;
1117
+ } else {
1118
+ part[column.Field] = '';
1119
+ }
1120
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
1121
+ }
1122
+ }
1123
+ });
1124
+ body.push(dataRow);
1125
+ });
1126
+ return body;
1127
+ }
1128
+
1129
+ static GetCombinedCustAndInsColumns(PrintPartNo: any, ShowTaxColumn: any) {
1130
+ let headersNames: any = [
1131
+ [{ text: 'S.No.', rowSpan: 2, style: ['tableheader', 'withApp'] },
1132
+
1133
+ { text: 'Qty', style: ['tableheader', 'withApp'], rowSpan: 2, },
1134
+ { text: 'Unit Price', style: ['tableheader', 'withApp'], rowSpan: 2, lineHeight: 1 },
1135
+ { text: 'Labor charges', style: ['tableheader', 'withApp'], colSpan: 3, }, {}, {},
1136
+ { text: 'Line Total', rowSpan: 2, style: ['tableheader', 'withApp'] }
1137
+ ],
1138
+ [{ text: '', Field: 'SNo' }, { text: '', Field: 'Desc' },
1139
+ { text: '', Field: 'QtyAndUoM', Parent: 'PartData' }, { text: '', Field: 'AssPr', Parent: 'PartData' },
1140
+ { text: 'R&R/Labor', fontSize: this.FontSize, style: ['tableheader', 'withApp'], Field: 'AssPr', Parent: 'RRFData' },
1141
+ { text: 'Denting', fontSize: this.FontSize, style: ['tableheader', 'withApp'], Field: 'AssPr', Parent: 'DtngData' },
1142
+ { text: 'Painting', fontSize: this.FontSize, style: ['tableheader', 'withApp'], Field: 'AssPr', Parent: 'PtngData' },
1143
+ { text: '', Field: 'LineTotal', style: ['tableheader', 'withApp'] }
1144
+ ]
1145
+ ];
1146
+ if (PrintPartNo) {
1147
+ headersNames[0].splice(1, 0, { text: 'Description/PartNo', rowSpan: 2, style: ['tableheader', 'withOutApp'] });
1148
+ } else {
1149
+ headersNames[0].splice(1, 0, { text: 'Description', rowSpan: 2, style: ['tableheader', 'withOutApp'] });
1150
+ }
1151
+
1152
+ if (ShowTaxColumn) {
1153
+ headersNames[0].splice(2, 0, { text: 'HSN', style: ['tableheader', 'withApp'], rowSpan: 2, });
1154
+ headersNames[1].splice(2, 0, { text: '', Parent: 'PartData', Field: 'HSN' });
1155
+ }
1156
+ return headersNames;
1157
+ }
1158
+
1159
+ static CustomerAccidentalPartsTableAfterApproval(Colli: any, ShowTaxColumn: any, PrintPartNo: boolean, Approved: boolean, isRepairOrder: boolean) {
1160
+ if (ShowTaxColumn) {
1161
+ return {
1162
+ style: 'tableExample',
1163
+ marginTop: 7,
1164
+ lineHeight: 1,
1165
+ // marginLeft: 20,
1166
+ table: {
1167
+ // widths: [15, 174, 35, 25, 49, 49, 49, 49, 49],
1168
+ widths: [24, 185, 35, 25, 45, 45, 45, 45, 45],
1169
+ // headerRows: 2,
1170
+ body: this.GetCustomerAccidentalPartsTableBodyData(Colli, ShowTaxColumn, PrintPartNo, Approved, isRepairOrder)
1171
+ },
1172
+ layout: PrintSharedService.LayOutStyle()
1173
+ };
1174
+ } else {
1175
+ return {
1176
+ style: 'tableExample',
1177
+ marginTop: 7,
1178
+ lineHeight: 1,
1179
+ // marginLeft: 20,
1180
+ table: {
1181
+ // widths: [15, 174, 35, 25, 49, 49, 49, 49, 49],
1182
+ widths: [25, 220, 25, 45, 45, 45, 45, 45],
1183
+ // headerRows: 2,
1184
+ body: this.GetCustomerAccidentalPartsTableBodyData(Colli, ShowTaxColumn, PrintPartNo, Approved, isRepairOrder)
1185
+ },
1186
+ layout: PrintSharedService.LayOutStyle()
1187
+ };
1188
+ }
1189
+
1190
+ }
1191
+
1192
+ static InsuranceAccidentalPartsTableAfterApproval(Colli: any, ShowTaxColumn: any, PrintPartNo: boolean) {
1193
+ if (ShowTaxColumn) {
1194
+ return {
1195
+ style: 'tableExample',
1196
+ marginTop: 7,
1197
+ // lineHeight: 1,
1198
+ // marginLeft: 20,
1199
+ table: {
1200
+ widths: [24, 185, 35, 25, 45, 45, 45, 45, 45],
1201
+ // headerRows: 2,
1202
+ body: this.GetInsuranceAccidentalPartsTableBodyData(Colli, ShowTaxColumn, PrintPartNo)
1203
+ },
1204
+ layout: PrintSharedService.LayOutStyle()
1205
+ };
1206
+ } else {
1207
+ return {
1208
+ style: 'tableExample',
1209
+ marginTop: 7,
1210
+ // lineHeight: 1,
1211
+ // marginLeft: 20,
1212
+ table: {
1213
+ widths: [25, 220, 25, 45, 45, 45, 45, 45],
1214
+ // headerRows: 2,
1215
+ body: this.GetInsuranceAccidentalPartsTableBodyData(Colli, ShowTaxColumn, PrintPartNo)
1216
+ },
1217
+ layout: PrintSharedService.LayOutStyle()
1218
+ };
1219
+ }
1220
+
1221
+ }
1222
+
1223
+ static GetCustomerAccidentalPartsTableBodyData(Parts: any, ShowTaxColumn: any, PrintPartNo: boolean, Approved: boolean, isRepairOrder: boolean) {
1224
+ let columns: any = this.GetCustomerAccidentalPartsHeaders(ShowTaxColumn, PrintPartNo, Approved, isRepairOrder);
1225
+ var body: any = [];
1226
+ for (let i = 0; i < columns.length; i++) {
1227
+ body.push(columns[i]);
1228
+ }
1229
+ let SNo: number = 1;
1230
+ Parts.forEach((part: any) => {
1231
+ var dataRow: any = [];
1232
+ columns[1].forEach((column: any) => {
1233
+ if (!TrUtils.IsNull(column.Parent)) {
1234
+ if (!TrUtils.IsNull(part[column.Parent]) && !TrUtils.IsFixedZero(part[column.Parent][column.Field]) && !TrUtils.IsNull(part[column.Parent][column.Field])) {
1235
+ dataRow.push({ text: part[column.Parent][column.Field].toString(), alignment: 'right', nowrap: true });
1236
+ } else {
1237
+ dataRow.push({ text: '', alignment: 'center' });
1238
+ }
1239
+ } else {
1240
+ if (!TrUtils.IsFixedZero(part[column.Field]) && !TrUtils.IsNull(part[column.Field])) {
1241
+ if (column.Field === 'SNo' || column.Field === 'Desc'
1242
+ || column.text === 'Description/PartNo') {
1243
+ // dataRow.push(part[column.Field].toString());
1244
+ if (column.Field === 'Desc') {
1245
+ let DescData: any = [];
1246
+ DescData.push(part[column.Field].toString());
1247
+ if (!TrUtils.IsEmpty(part['EDesc'])) {
1248
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
1249
+ }
1250
+ dataRow.push({ stack: DescData });
1251
+ } else {
1252
+ dataRow.push({ text: part[column.Field].toString() });
1253
+ }
1254
+ } else {
1255
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
1256
+ }
1257
+ } else {
1258
+ if (column.Field === 'SNo') {
1259
+ part[column.Field] = SNo;
1260
+ SNo = SNo + 1;
1261
+ } else {
1262
+ part[column.Field] = '';
1263
+ }
1264
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
1265
+ }
1266
+ }
1267
+ });
1268
+ body.push(dataRow);
1269
+ });
1270
+ return body;
1271
+ }
1272
+
1273
+ static GetInsuranceAccidentalPartsTableBodyData(Parts: any, ShowTaxColumn: any, PrintPartNo: boolean) {
1274
+ let columns: any = this.GetInsuranceAccidentalPartsHeaders(ShowTaxColumn, PrintPartNo);
1275
+ var body: any = [];
1276
+ for (let i = 0; i < columns.length; i++) {
1277
+ body.push(columns[i]);
1278
+ }
1279
+ let SNo: number = 1;
1280
+ Parts.forEach((part: any) => {
1281
+ var dataRow: any = [];
1282
+ columns[1].forEach((column: any) => {
1283
+ if (!TrUtils.IsNull(column.Parent)) {
1284
+ if (!TrUtils.IsNull(part[column.Parent]) && !TrUtils.IsFixedZero(part[column.Parent][column.Field]) && !TrUtils.IsNull(part[column.Parent][column.Field])) {
1285
+ dataRow.push({ text: part[column.Parent][column.Field].toString(), alignment: 'right', nowrap: true });
1286
+ } else {
1287
+ dataRow.push({ text: '', alignment: 'center' });
1288
+ }
1289
+ } else {
1290
+ if (!TrUtils.IsFixedZero(part[column.Field]) && !TrUtils.IsNull(part[column.Field])) {
1291
+ if (column.Field === 'SNo' || column.Field === 'Desc'
1292
+ || column.text === 'Description/PartNo') {
1293
+ // dataRow.push(part[column.Field].toString());
1294
+ if (column.Field === 'Desc') {
1295
+ let DescData: any = [];
1296
+ DescData.push(part[column.Field].toString());
1297
+ if (!TrUtils.IsEmpty(part['EDesc'])) {
1298
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
1299
+ }
1300
+ dataRow.push({ stack: DescData });
1301
+ } else {
1302
+ dataRow.push({ text: part[column.Field].toString() });
1303
+ }
1304
+ } else {
1305
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
1306
+ }
1307
+ } else {
1308
+ if (column.Field === 'SNo') {
1309
+ part[column.Field] = SNo;
1310
+ SNo = SNo + 1;
1311
+ } else {
1312
+ part[column.Field] = '';
1313
+ }
1314
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
1315
+ }
1316
+ }
1317
+ });
1318
+
1319
+ body.push(dataRow);
1320
+ });
1321
+ return body;
1322
+ }
1323
+
1324
+ static GetInsuranceAccidentalPartsHeaders(ShowTaxColumn: any, PrintPartNo: boolean) {
1325
+ let headersNames: any = [
1326
+ [{ text: 'S.No.', rowSpan: 2, style: ['tableheader', 'withApp'] },
1327
+ { text: 'Qty', style: ['tableheader', 'withApp'], rowSpan: 2, },
1328
+ { text: 'Unit Price', style: ['tableheader', 'withApp'], rowSpan: 2, },
1329
+ { text: 'Labor charges ', style: ['tableheader', 'withApp'], colSpan: 3, }, {}, {},
1330
+ { text: 'Line Total', rowSpan: 2, style: ['tableheader', 'withApp'] }
1331
+ ],
1332
+ [{ text: '', Field: 'SNo' }, { text: '', Field: 'Desc' },
1333
+ { text: '', Field: 'QtyAndUoM', Parent: 'PartData' }, { text: '', Parent: 'PartData', Field: 'AssPr' },
1334
+ { text: 'R&R/Labor', fontSize: this.FontSize, style: ['tableheader', 'withApp'], Parent: 'RRFData', Field: 'AssPr' },
1335
+ { text: 'Denting', fontSize: this.FontSize, style: ['tableheader', 'withApp'], Parent: 'DtngData', Field: 'AssPr' },
1336
+ { text: 'Painting', fontSize: this.FontSize, style: ['tableheader', 'withApp'], Parent: 'PtngData', Field: 'AssPr' },
1337
+ { text: '', Field: 'LineTotal', style: ['tableheader', 'withApp'] }
1338
+ ]
1339
+ ];
1340
+
1341
+ if (PrintPartNo) {
1342
+ headersNames[0].splice(1, 0, { text: 'Description/PartNo', rowSpan: 2, style: ['tableheader', 'withApp'] });
1343
+ } else {
1344
+ headersNames[0].splice(1, 0, { text: 'Description', rowSpan: 2, style: ['tableheader', 'withApp'] });
1345
+ }
1346
+
1347
+ if (ShowTaxColumn) {
1348
+ headersNames[0].splice(2, 0, { text: 'HSN', rowSpan: 2, style: ['tableheader', 'withApp'] });
1349
+ headersNames[1].splice(2, 0, { text: '', Parent: 'PartData', Field: 'HSN' });
1350
+ }
1351
+
1352
+ return headersNames;
1353
+ }
1354
+
1355
+ static GetCustomerAccidentalPartsHeaders(ShowTaxColumn: any, PrintPartNo: boolean, Approved: boolean, isRepairOrder: boolean) {
1356
+ let headersNames: any = [];
1357
+
1358
+ if (Approved || isRepairOrder) {
1359
+ headersNames = [
1360
+ [{ text: 'S.No.', rowSpan: 2, style: ['tableheader', 'withApp'], alignment: 'center' },
1361
+ { text: 'Qty', style: ['tableheader', 'withApp'], rowSpan: 2, alignment: 'center' },
1362
+ { text: 'Unit Price', style: ['tableheader', 'withApp'], rowSpan: 2, alignment: 'center' },
1363
+ { text: 'Labor charges ', style: ['tableheader', 'withApp'], colSpan: 3, alignment: 'center' }, {}, {},
1364
+ { text: 'Line Total', rowSpan: 2, alignment: 'center', style: ['tableheader', 'withApp'] }
1365
+ ],
1366
+ [{ text: '', Field: 'SNo' }, { text: '', Field: 'Desc' },
1367
+ { text: '', Parent: 'PartData', Field: 'QtyAndUoM' }, { text: '', Parent: 'PartData', Field: 'UnPr' },
1368
+ { text: 'R&R/Labor', fontSize: this.FontSize, style: ['tableheader', 'withApp'], Parent: 'RRFData', Field: 'UnPr' },
1369
+ {
1370
+ text: 'Denting', fontSize: this.FontSize, Parent: 'DtngData',
1371
+ style: ['tableheader', 'withApp'], Field: 'UnPr'
1372
+ },
1373
+ {
1374
+ text: 'Painting', fontSize: this.FontSize, Parent: 'PtngData',
1375
+ style: ['tableheader', 'withApp'], Field: 'UnPr', alignment: 'center'
1376
+ },
1377
+ { text: '', Field: 'LineTotal' }
1378
+ ]
1379
+ ];
1380
+ } else {
1381
+ headersNames = [
1382
+ [{ text: 'S.No.', rowSpan: 2, style: ['tableheader', 'withApp'], alignment: 'center' },
1383
+ { text: 'Qty', style: ['tableheader', 'withApp'], rowSpan: 2, alignment: 'center' },
1384
+ { text: 'Unit Price', style: ['tableheader', 'withApp'], rowSpan: 2, alignment: 'center' },
1385
+ { text: 'Labor charges ', style: ['tableheader', 'withApp'], colSpan: 3, alignment: 'center' }, {}, {},
1386
+ { text: 'Line Total', rowSpan: 2, alignment: 'center', style: ['tableheader', 'withApp'] }
1387
+ ],
1388
+ [{ text: '', Field: 'SNo' }, { text: '', Field: 'Desc' },
1389
+ { text: '', Parent: 'PartData', Field: 'QtyAndUoM' }, { text: '', Parent: 'PartData', Field: 'EstPr' },
1390
+ { text: 'R&R/Labor', fontSize: this.FontSize, style: ['tableheader', 'withApp'], Parent: 'RRFData', Field: 'EstPr' },
1391
+ {
1392
+ text: 'Denting', fontSize: this.FontSize,
1393
+ style: ['tableheader', 'withApp'], Parent: 'DtngData', Field: 'EstPr'
1394
+ },
1395
+ {
1396
+ text: 'Painting', fontSize: this.FontSize,
1397
+ style: ['tableheader', 'withApp'], Parent: 'PtngData', Field: 'EstPr', alignment: 'center'
1398
+ },
1399
+ { text: '', Field: 'LineTotal' }
1400
+ ]
1401
+ ];
1402
+ }
1403
+
1404
+ if (PrintPartNo) {
1405
+ headersNames[0].splice(1, 0, { text: 'Description/PartNo', rowSpan: 2, style: ['tableheader', 'withApp'] });
1406
+ } else {
1407
+ headersNames[0].splice(1, 0, { text: 'Description', rowSpan: 2, style: ['tableheader', 'withApp'] });
1408
+ }
1409
+
1410
+ if (ShowTaxColumn) {
1411
+ headersNames[0].splice(2, 0, { text: 'HSN', rowSpan: 2, style: ['tableheader', 'withApp'], alignment: 'center' });
1412
+ headersNames[1].splice(2, 0, { text: '', Parent: 'PartData', Field: 'HSN' });
1413
+ }
1414
+
1415
+ return headersNames;
1416
+ }
1417
+
1418
+ static threeLayOutStyle() {
1419
+ return {
1420
+ hLineWidth: function (i: any, node: any) {
1421
+ return (i === 0 || i === node.table.body.length) ? 0.7 : 0.7;
1422
+ },
1423
+ vLineWidth: function (i: any, node: any) {
1424
+ return (i === 0 || i === node.table.widths.length) ? 0.7 : 0.7;
1425
+ },
1426
+ hLineColor: function (i: any, node: any) {
1427
+ let color;
1428
+ if (i === 0 || i === node.table.body.length) {
1429
+ color = 'black';
1430
+ } else {
1431
+ if (i === 1 || i === 2 || i === 3) {
1432
+ color = 'gray';
1433
+ } else {
1434
+ color = 'lightgray';
1435
+ }
1436
+ }
1437
+
1438
+ return color;
1439
+ },
1440
+ vLineColor: function (i: any, node: any) {
1441
+ let color;
1442
+ if (i === 0 || i === node.table.widths.length) {
1443
+ color = 'black';
1444
+ } else {
1445
+ color = 'gray';
1446
+ }
1447
+ return color;
1448
+ },
1449
+ };
1450
+ }
1451
+
1452
+ static WithOutDiscountFieldTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any) {
1453
+ if (Parts.length !== 0 || Ops.length !== 0) {
1454
+ if (PrintPartNo) {
1455
+ return {
1456
+ style: 'tableExample',
1457
+ marginLeft: 20,
1458
+ table: {
1459
+ widths: [25, 60, 160, 25, 50, 60, 30, 50],
1460
+ headerRows: 1,
1461
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
1462
+ },
1463
+ layout: PrintSharedService.LayOutStyleanother()
1464
+ };
1465
+ } else {
1466
+ return {
1467
+ style: 'tableExample',
1468
+ marginLeft: 20,
1469
+ table: {
1470
+ widths: [25, 215, 25, 50, 60, 45, 50],
1471
+ headerRows: 1,
1472
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
1473
+ },
1474
+ layout: PrintSharedService.LayOutStyleanother()
1475
+ };
1476
+ }
1477
+ } else {
1478
+ let a: any = '';
1479
+ return a;
1480
+ }
1481
+ }
1482
+
1483
+ static BuildTableBodyForLaborAndParts(Parts: any, Labor: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any) {
1484
+ var body: any = [];
1485
+ let columns: any = PrintSharedService.GetWithOutDiscountFieldHeader(PrintPartNo, ShowTaxColumn, Body, ShowIGST, ShowDiscountColumn);
1486
+ // if (ShowTaxColumn) {
1487
+ for (let i = 0; i < columns.length; i++) {
1488
+ body.push(columns[i]);
1489
+ }
1490
+ columns = columns[1];
1491
+ // } else {
1492
+ // body.push(columns);
1493
+ // }
1494
+
1495
+
1496
+ let DummyOps: any = [];
1497
+
1498
+ if (Parts.length !== 0) {
1499
+ let dummypartadding1: any = {};
1500
+ dummypartadding1.SNo = '';
1501
+ dummypartadding1.Desc = 'Spare Parts';
1502
+ dummypartadding1.Qty = '';
1503
+ dummypartadding1.UnPr = '';
1504
+ dummypartadding1.LineTotal = '';
1505
+ Parts.unshift(dummypartadding1);
1506
+ }
1507
+
1508
+ let SNo: number = 1;
1509
+ Parts.forEach((part: any) => {
1510
+ var dataRow: any = [];
1511
+ columns.forEach((column: any) => {
1512
+ if (
1513
+ (!TrUtils.IsFixedZero(part[column.Field]) && !TrUtils.IsNull(part[column.Field]))
1514
+ || (column.text === 'Line Total')) {
1515
+ if (part[column.Field] === 'Spare Parts') {
1516
+ dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
1517
+ } else {
1518
+ console.log(part.TCode);
1519
+ if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
1520
+ && TrUtils.CheckInvalidSelect(part.TCode))) {
1521
+ part[column.Field] = '';
1522
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
1523
+ } else {
1524
+ if (column.text === 'Line Total' || column.Field === 'UnPr' || column.Field === 'QtyAndUoM'
1525
+ || column.text === 'Tax' || column.Field === 'Disc' || column.Field === 'Perc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
1526
+ || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
1527
+ if (column.Field === 'Disc') {
1528
+ if (column.type === 'percentage') {
1529
+ if (!TrUtils.IsEmpty(part.Perc)) {
1530
+ dataRow.push({ text: part.Perc.toString(), alignment: 'right', noWrap: true });
1531
+ } else {
1532
+ dataRow.push({ text: '', noWrap: true });
1533
+ }
1534
+ } else {
1535
+ if (!TrUtils.IsZero(part[column.Field])) {
1536
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', noWrap: true });
1537
+ } else {
1538
+ dataRow.push({ text: '', noWrap: true });
1539
+ }
1540
+ }
1541
+ } else {
1542
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
1543
+ }
1544
+ } else {
1545
+ // dataRow.push(part[column.Field].toString());
1546
+ if (column.Field === 'Desc') {
1547
+ let DescData: any = [];
1548
+ DescData.push(part[column.Field].toString());
1549
+ if (!TrUtils.IsEmpty(part['EDesc'])) {
1550
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
1551
+ }
1552
+ dataRow.push({ stack: DescData });
1553
+ } else {
1554
+ dataRow.push({ text: part[column.Field].toString() });
1555
+ }
1556
+ }
1557
+ }
1558
+ }
1559
+ } else {
1560
+ if (column.Field === 'SNo') {
1561
+ part[column.Field] = SNo;
1562
+ SNo = SNo + 1;
1563
+ } else {
1564
+ if (TrUtils.IsNull(part[column.Field])) {
1565
+ part[column.Field] = '';
1566
+ }
1567
+ }
1568
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
1569
+ }
1570
+ });
1571
+
1572
+ body.push(dataRow);
1573
+ });
1574
+ SNo = 1;
1575
+ if (Labor.length !== 0) {
1576
+ let dummypartadding1: any = {};
1577
+ dummypartadding1.SNo = '';
1578
+ dummypartadding1.Desc = 'Labor';
1579
+ dummypartadding1.Qty = '';
1580
+ dummypartadding1.UnPr = '';
1581
+ dummypartadding1.LineTotal = '';
1582
+ Labor.unshift(dummypartadding1);
1583
+ // DummyOps.unshift(dummypartadding1);
1584
+ }
1585
+ if (Body === 2) {
1586
+ for (let i = 0; i < Labor.length; i++) {
1587
+ Labor[i].UnPr = '';
1588
+ }
1589
+ }
1590
+
1591
+ Labor.forEach((Ops: any) => {
1592
+ var dataRow: any = [];
1593
+ columns.forEach((column: any) => {
1594
+ if ((!TrUtils.IsFixedZero(Ops[column.Field]) && !TrUtils.IsNull(Ops[column.Field]))
1595
+ || (column.text === 'Line Total')) {
1596
+ if (Ops[column.Field] === 'Labor') {
1597
+ dataRow.push({ text: Ops[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
1598
+ } else {
1599
+ console.log(Ops.TCode);
1600
+ if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
1601
+ && TrUtils.CheckInvalidSelect(Ops.TCode))) {
1602
+ Ops[column.Field] = '';
1603
+ dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
1604
+ } else {
1605
+ if (column.text === 'Line Total' || column.Field === 'Price' || column.text === 'Tax' || column.Field === 'UnPr'
1606
+ || column.Field === 'QtyAndUoM' || column.Field === 'Disc' || column.Field === 'Perc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
1607
+ || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
1608
+ if (column.Field === 'Disc') {
1609
+ if (column.type === 'percentage') {
1610
+ if (!TrUtils.IsEmpty(Ops.Perc)) {
1611
+ dataRow.push({ text: Ops.Perc.toString(), alignment: 'right', noWrap: true });
1612
+ } else {
1613
+ dataRow.push({ text: '', noWrap: true });
1614
+ }
1615
+ } else {
1616
+ if (!TrUtils.IsZero(Ops[column.Field])) {
1617
+ dataRow.push({ text: Ops[column.Field].toString(), alignment: 'right', noWrap: true });
1618
+ } else {
1619
+ dataRow.push({ text: '', noWrap: true });
1620
+ }
1621
+ }
1622
+ } else {
1623
+ dataRow.push({ text: Ops[column.Field].toString(), alignment: 'right', nowrap: true });
1624
+ }
1625
+
1626
+ } else {
1627
+ dataRow.push(Ops[column.Field].toString());
1628
+ }
1629
+ }
1630
+ }
1631
+ } else {
1632
+ if (column.Field === 'SNo') {
1633
+ Ops[column.Field] = SNo;
1634
+ SNo = SNo + 1;
1635
+ } else {
1636
+ if (TrUtils.IsNull(Ops[column.Field])) {
1637
+ Ops[column.Field] = '';
1638
+ }
1639
+ }
1640
+ dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
1641
+ }
1642
+ });
1643
+ body.push(dataRow);
1644
+ });
1645
+ return body;
1646
+ }
1647
+
1648
+ static GetWithOutDiscAndTaxFieldHeader(Parts: any, Ops: any, ShowTaxColumn: any, PrintPartNo: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any) {
1649
+ if (Parts.length !== 0 || Ops.length !== 0) {
1650
+ console.log('ShowTaxColumn', ShowTaxColumn);
1651
+ if (ShowTaxColumn) {
1652
+ return this.TaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn);
1653
+ } else {
1654
+ if (ConsolidateGST) {
1655
+ return this.ConsolidateDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn);
1656
+ } else {
1657
+ return this.NoTaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn);
1658
+ }
1659
+ }
1660
+ } else {
1661
+ let a: any = '';
1662
+ return a;
1663
+ }
1664
+ }
1665
+
1666
+ static TaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any) {
1667
+ if (PrintPartNo) {
1668
+ if (ShowIGST) {
1669
+ return {
1670
+ style: 'tableExample',
1671
+ marginTop:7,
1672
+ table: {
1673
+ widths: PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
1674
+ // headerRows: 2,
1675
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
1676
+ },
1677
+ layout: PrintSharedService.LayOutStyle()
1678
+ };
1679
+ } else {
1680
+ return {
1681
+ style: 'tableExample',
1682
+ marginTop:7,
1683
+ table: {
1684
+ widths: PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
1685
+ // headerRows: 2,
1686
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
1687
+ },
1688
+ layout: PrintSharedService.LayOutStyle()
1689
+ };
1690
+ }
1691
+
1692
+ } else {
1693
+ if (ShowIGST) {
1694
+ return {
1695
+ style: 'tableExample',
1696
+ marginTop:7,
1697
+ table: {
1698
+ widths: PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
1699
+ // headerRows: 2,
1700
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
1701
+ },
1702
+ layout: PrintSharedService.LayOutStyle()
1703
+ };
1704
+ } else {
1705
+ return {
1706
+ style: 'tableExample',
1707
+ marginTop:7,
1708
+ table: {
1709
+ widths: PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
1710
+ // headerRows: 2,
1711
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
1712
+ },
1713
+ layout: PrintSharedService.LayOutStyle()
1714
+ };
1715
+ }
1716
+
1717
+ }
1718
+ }
1719
+
1720
+ static ConsolidateDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any) {
1721
+ if (PrintPartNo) {
1722
+ return {
1723
+ style: 'tableExample',
1724
+ marginTop:7,
1725
+ table: {
1726
+ widths: [25, 65, 273, 25, 60, 75, 10, 40],
1727
+ // headerRows: 1,
1728
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
1729
+ },
1730
+ layout: PrintSharedService.LayOutStyle()
1731
+ };
1732
+ } else {
1733
+ return {
1734
+ style: 'tableExample',
1735
+ marginTop:7,
1736
+ table: {
1737
+ widths: [25, 290, 50, 80, 80, 10, 40],
1738
+ // headerRows: 1,
1739
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
1740
+ },
1741
+ layout: PrintSharedService.LayOutStyle()
1742
+ };
1743
+ }
1744
+ }
1745
+
1746
+ static NoTaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any) {
1747
+ if (PrintPartNo) {
1748
+ return {
1749
+ style: 'tableExample',
1750
+ marginTop:7,
1751
+ table: {
1752
+ widths: PrintSharedService.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
1753
+ // headerRows: 1,
1754
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
1755
+ },
1756
+ layout: PrintSharedService.LayOutStyle()
1757
+ };
1758
+ } else {
1759
+ return {
1760
+ style: 'tableExample',
1761
+ marginTop:7,
1762
+ table: {
1763
+ widths: PrintSharedService.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
1764
+ // headerRows: 1,
1765
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
1766
+ },
1767
+ layout: PrintSharedService.LayOutStyle()
1768
+ };
1769
+ }
1770
+ }
1771
+
1772
+ static buildTableForCustomerLabor(Parts: any, Ops: any, PrintPartNo: any, customerorInsurance: any) {
1773
+ var body: any = [];
1774
+ let columns: any;
1775
+ columns = this.getSummaryHeaders(PrintPartNo);
1776
+ // console.log(columns);
1777
+ body.push(columns);
1778
+
1779
+ if (Parts.length !== 0) {
1780
+ let dummypartadding1: any = {};
1781
+ dummypartadding1.SNo = '';
1782
+ dummypartadding1.Desc = 'Spare Parts';
1783
+ dummypartadding1.Qty = '';
1784
+ dummypartadding1.UnPr = '';
1785
+ dummypartadding1.Price = '';
1786
+ dummypartadding1.DiscountedPrice = '';
1787
+ dummypartadding1.LineTotal = '';
1788
+ dummypartadding1.QtyAndUoM = '';
1789
+ dummypartadding1.HSN = '';
1790
+ dummypartadding1.MPN = '';
1791
+ Parts.unshift(dummypartadding1);
1792
+ }
1793
+
1794
+ let SNo: number = 1;
1795
+ Parts.forEach((part: any) => {
1796
+ var dataRow: any = [];
1797
+ columns.forEach((column: any) => {
1798
+ if (!TrUtils.IsFixedZero(part[column.Field]) && !TrUtils.IsNull(part[column.Field])
1799
+ || column.text === 'Line Total') {
1800
+ if (part[column.Field] === 'Spare Parts') {
1801
+ dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
1802
+ } else {
1803
+ // tslint:disable-next-line:max-line-length
1804
+ if (column.text === 'Line Total' || column.Field === 'QtyAndUoM' || column.Field === 'CustPrice' || column.Field === 'InsPrice' ||
1805
+ column.Field === 'DiscountedPrice' || column.Field === 'TaxAmount' || column.Field === 'UnPr') {
1806
+ if (column.Field === 'Disc Amt') {
1807
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', noWrap: true });
1808
+
1809
+ } else {
1810
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
1811
+ }
1812
+
1813
+ } else {
1814
+ // dataRow.push({ text: part[column.Field].toString() });
1815
+ if (column.Field === 'Desc') {
1816
+ let DescData: any = [];
1817
+ DescData.push(part[column.Field].toString());
1818
+ if (!TrUtils.IsEmpty(part['EDesc'])) {
1819
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
1820
+ }
1821
+ dataRow.push({ stack: DescData });
1822
+ } else {
1823
+ dataRow.push({ text: part[column.Field].toString() });
1824
+ }
1825
+ }
1826
+ }
1827
+ } else {
1828
+ if (column.Field === 'SNo') {
1829
+ part[column.Field] = SNo;
1830
+ SNo = SNo + 1;
1831
+ } else {
1832
+ if (TrUtils.IsNull(part[column.Field])) {
1833
+ part[column.Field] = '';
1834
+ }
1835
+ }
1836
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
1837
+ }
1838
+ });
1839
+
1840
+ body.push(dataRow);
1841
+ });
1842
+ SNo = 1;
1843
+ if (Ops.length !== 0) {
1844
+ let dummypartadding1: any = {};
1845
+ dummypartadding1.SNo = '';
1846
+ dummypartadding1.Desc = 'Labor';
1847
+ dummypartadding1.Qty = '';
1848
+ dummypartadding1.UnPr = '';
1849
+ dummypartadding1.Price = '';
1850
+ dummypartadding1.DiscountedPrice = '';
1851
+ dummypartadding1.LineTotal = '';
1852
+ dummypartadding1.QtyAndUoM = '';
1853
+ dummypartadding1.HSN = '';
1854
+ Ops.unshift(dummypartadding1);
1855
+ }
1856
+
1857
+ Ops.forEach((labor: any) => {
1858
+ var dataRow: any = [];
1859
+ columns.forEach((column: any) => {
1860
+ if (!TrUtils.IsFixedZero(labor[column.Field]) && !TrUtils.IsNull(labor[column.Field])
1861
+ || column.text === 'Line Total') {
1862
+ if (labor[column.Field] === 'Labor') {
1863
+ dataRow.push({ text: labor[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
1864
+ } else {
1865
+ if (column.text === 'Line Total' || column.Field === 'QtyAndUoM' || column.Field === 'DiscountedPrice' || column.Field === 'TaxAmount'
1866
+ || column.Field === 'UnPr' || column.Field === 'CustPrice' || column.Field === 'InsPrice') {
1867
+ if (column.Field === 'Disc Amt') {
1868
+ dataRow.push({ text: labor[column.Field].toString(), alignment: 'right', noWrap: true });
1869
+ } else {
1870
+ dataRow.push({ text: labor[column.Field].toString(), alignment: 'right', nowrap: true });
1871
+ }
1872
+
1873
+ } else {
1874
+ dataRow.push({ text: labor[column.Field].toString() });
1875
+ }
1876
+ }
1877
+ } else {
1878
+ if (column.Field === 'SNo') {
1879
+ labor[column.Field] = SNo;
1880
+ SNo = SNo + 1;
1881
+ } else {
1882
+ if (TrUtils.IsNull(labor[column.Field])) {
1883
+ labor[column.Field] = '';
1884
+ }
1885
+ }
1886
+ dataRow.push({ text: labor[column.Field].toString(), alignment: 'center' });
1887
+ }
1888
+ });
1889
+ body.push(dataRow);
1890
+ });
1891
+ return body;
1892
+ }
1893
+
1894
+ static getSummaryHeaders(permission: boolean) {
1895
+ let headersNames: any = [{ text: 'Description', style: 'tableheader', Field: 'Desc' },
1896
+ { text: 'HSN / SAC', style: 'tableheader', Field: 'SAC' },
1897
+ { text: 'Qty', style: 'tableheader', Field: 'QtyAndUoM' },
1898
+ // { text: 'Rate / Unit', style: 'tableheader', Field: 'UnPr' },
1899
+ { text: 'Ins. Amt', style: 'tableheader', Field: 'InsPrice' },
1900
+ { text: 'Cust. Amt', style: 'tableheader', Field: 'CustPrice' },
1901
+ { text: 'Disc.(Rs)', style: 'tableheader', Field: 'DiscountedPrice' },
1902
+ { text: 'Tax %', style: 'tableheader', Field: 'TaxAmount' },
1903
+ { text: 'Line Total', style: 'tableheader', Field: 'LineTotal' }];
1904
+ if (permission) {
1905
+ let sno = { text: 'S.No.', style: 'tableheader', Field: 'SNo' };
1906
+ let MPN = { text: 'Part No', style: 'tableheader', Field: 'MPN' };
1907
+ headersNames.unshift(sno, MPN);
1908
+ } else {
1909
+ let sno = { text: 'S.No.', style: 'tableheader', Field: 'SNo' };
1910
+ headersNames.unshift(sno);
1911
+ }
1912
+
1913
+
1914
+ return headersNames;
1915
+ }
1916
+
1917
+ }