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,787 @@
1
+ import { SharedPDFService } from '../../shared/shared-pdf.service';
2
+ import { PrintSharedService } from '../../shared/shared-print.service';
3
+ import { MyDate } from '../../utils/my-date';
4
+ import { TrUtils } from '../../utils/tr-utils';
5
+
6
+ export class SharedInvoiceprintService {
7
+
8
+ FontSize: number = 8;
9
+
10
+ static GetInvoicePrint(ROPrintData: any, numberofCopies: any, isotherIndustry: boolean, withPass: boolean, isAuto: boolean, moreDiscDetails:boolean) {
11
+ var contents = [];
12
+ if (TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
13
+ contents.push(
14
+ this.CommonHeaderDetails(ROPrintData, null, isotherIndustry),
15
+ this.PreparesparePartsTable(ROPrintData, isAuto),
16
+ this.CommonTotalDetails(ROPrintData, null, numberofCopies, withPass, moreDiscDetails)
17
+ );
18
+ } else {
19
+ numberofCopies.forEach((text: any, index: any) => {
20
+ contents.push(
21
+ this.CommonHeaderDetails(ROPrintData, text, isotherIndustry),
22
+ this.PreparesparePartsTable(ROPrintData, isAuto),
23
+ this.CommonTotalDetails(ROPrintData, index, numberofCopies, withPass, moreDiscDetails)
24
+ );
25
+ });
26
+ }
27
+ var dd = {
28
+ info: {
29
+ title: this.GetFileName(ROPrintData),
30
+ },
31
+ background: function (currentPage: any, pageSize: any) {
32
+ return SharedPDFService.GetWatermarkImage(ROPrintData.Image, pageSize, ROPrintData.Entity.Wmark);
33
+ },
34
+ header: function (currentPage: any, pageCount: any) {
35
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
36
+ },
37
+ pageBreakBefore: function (currentNode:any, followingNodesOnPage:any, nodesOnNextPage:any, previousNodesOnPage:any) {
38
+ return currentNode.startPosition.top >= 700 && !TrUtils.IsNull(currentNode?.id) && currentNode?.id === '567';
39
+ },
40
+ pageMargins: [10, 15, 10, 15],
41
+ content: contents,
42
+ styles: SharedPDFService.GetStyles()
43
+ };
44
+ return dd;
45
+ }
46
+
47
+ static GetFileName(ROPrintData: any) {
48
+ let fileName: string = ROPrintData.HeaderName;
49
+ if (!TrUtils.IsNull(ROPrintData.Product) && !TrUtils.IsEmpty(ROPrintData.Product.RegNo)) {
50
+ fileName = fileName + '-' + ROPrintData.Product.RegNo;
51
+ }
52
+ return fileName;
53
+ }
54
+
55
+ static CommonHeaderDetails(ROPrintData: any, text: any, isotherIndustry: boolean) {
56
+ return [
57
+ this.GetMainHeaderDetails(ROPrintData.Entity, ROPrintData.HeaderName, ROPrintData.Image, ROPrintData.HColor, ROPrintData.AColor, text),
58
+ SharedPDFService.GetCustomerAndVehicleDetails(ROPrintData._id, ROPrintData.CrDate, ROPrintData.PrDate,
59
+ ROPrintData.MOut, ROPrintData.MIn, ROPrintData.Product, ROPrintData.PrintType, ROPrintData.For,
60
+ ROPrintData.SurName, ROPrintData.SurPhone, ROPrintData.Type, ROPrintData.SurEmail, ROPrintData.InsComp,
61
+ ROPrintData.PolNo, ROPrintData.PolType, ROPrintData.Customer, ROPrintData.IsProforma, ROPrintData.Settings, ROPrintData.Location, isotherIndustry, ROPrintData.BL, ROPrintData.ROCode, ROPrintData.TypeName,null, ROPrintData.DoS),
62
+ SharedPDFService.GetOwnerDetails(ROPrintData.Cust, ROPrintData.Type, ROPrintData.For),
63
+ SharedPDFService.CustomerAndVehicleDetailsAfterLine(),
64
+ SharedPDFService.GetDisplayTable(),
65
+ ];
66
+ }
67
+
68
+ static GetMainHeaderDetails(Entity: any, HeaderName: any, Image: any, HColor: any, AColor: any, text: any) {
69
+ return [
70
+ // SharedPDFService.MainHeading(Entity.CName, Entity.Header, Image, HColor, text),
71
+ SharedPDFService.GetMainHeader(Entity, Image, AColor, HColor, text),
72
+ SharedPDFService.GetPrintType('TAX INVOICE'),
73
+ SharedPDFService.HeaderAfterLine()
74
+ ];
75
+ }
76
+
77
+ static PreparesparePartsTable(ROPrintData: any, isAuto: boolean) {
78
+ let List: any = [];
79
+ if (ROPrintData.Entity.Body === 1) {
80
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
81
+ if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
82
+ ROPrintData.PrintInfo[i].Text = '';
83
+ }
84
+ List.push(ROPrintData.PrintInfo[i].Text,
85
+ this.GetLaborPartsTableForView(TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.Entity.MPN)
86
+ );
87
+
88
+ }
89
+ } else {
90
+ if (ROPrintData.Entity.Body === 2) {
91
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
92
+ if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
93
+ ROPrintData.PrintInfo[i].Text = '';
94
+ }
95
+ List.push(ROPrintData.PrintInfo[i].Text,
96
+ this.WithOutDiscountFieldTable(TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn,
97
+ ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn, isAuto, ROPrintData.Entity.DecimalsNumber)
98
+ );
99
+
100
+ }
101
+ } else {
102
+ if (ROPrintData.Summary) {
103
+ List.push('',
104
+ this.GetLaborPartsTableForView(ROPrintData.Items, ROPrintData.Ops, ROPrintData.Entity.MPN)
105
+ );
106
+ } else {
107
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
108
+ if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
109
+ ROPrintData.PrintInfo[i].Text = '';
110
+ }
111
+ List.push(ROPrintData.PrintInfo[i].Text,
112
+ this.GetWithOutDiscAndTaxFieldHeader(TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops),
113
+ ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn, isAuto, ROPrintData.Entity.DecimalsNumber)
114
+ );
115
+
116
+ }
117
+ }
118
+ }
119
+ }
120
+ return List;
121
+ }
122
+
123
+ static GetLaborPartsTableForView(Parts: any, Ops: any, PrintPartNo: any) {
124
+ if (Parts.length !== 0 || Ops.length !== 0) {
125
+ if (PrintPartNo) {
126
+ return {
127
+ style: 'tableExample',
128
+ // marginLeft: 20,
129
+ table: {
130
+ widths: [25, 30, 170, 85, 15, 20, 50, 30, 30, 50],
131
+ // headerRows: 2,
132
+ body: this.buildTableForCustomerLabor(Parts, Ops, PrintPartNo, false)
133
+ },
134
+ layout: PrintSharedService.LayOutStyleanother()
135
+ };
136
+ } else {
137
+ return {
138
+ style: 'tableExample',
139
+ // marginLeft: 20,
140
+ table: {
141
+ widths: [25, 200, 55, 25, 55, 55, 40, 15, 50],
142
+ // headerRows: 2,
143
+ body: this.buildTableForCustomerLabor(Parts, Ops, PrintPartNo, false)
144
+ },
145
+ layout: PrintSharedService.LayOutStyleanother()
146
+ };
147
+ }
148
+ } else {
149
+ let a: any = '';
150
+ return a;
151
+ }
152
+ }
153
+
154
+ static WithOutDiscountFieldTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number) {
155
+
156
+ if (Parts.length !== 0 || Ops.length !== 0) {
157
+ if (PrintPartNo) {
158
+ return {
159
+ style: 'tableExample',
160
+ marginLeft: 20,
161
+ table: {
162
+ widths: [25, 60, 155, 30, 50, 60, 30, 50],
163
+ headerRows: 1,
164
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber)
165
+ },
166
+ layout: PrintSharedService.LayOutStyleanother()
167
+ };
168
+ } else {
169
+ // console.log(PrintSharedService.GetWithOutDiscountFieldHeaderSharedInv(PrintPartNo, ShowTaxColumn, Body));
170
+ return {
171
+ style: 'tableExample',
172
+ marginLeft: 20,
173
+ table: {
174
+ widths: [25, 215, 25, 50, 60, 45, 50],
175
+ headerRows: 1,
176
+ body: PrintSharedService.GetWithOutDiscountFieldHeaderSharedInv(PrintPartNo, ShowTaxColumn, Body)
177
+ },
178
+ layout: PrintSharedService.LayOutStyleanother()
179
+ };
180
+ }
181
+ } else {
182
+ let a: any = '';
183
+ return a;
184
+ }
185
+ }
186
+
187
+ static BuildTableBodyForLaborAndParts(Parts: any, Labor: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number) {
188
+ var body: any = [];
189
+ let columns: any = PrintSharedService.GetWithOutDiscountFieldHeaderSharedInv(PrintPartNo, ShowTaxColumn, Body);
190
+ body = columns;
191
+
192
+ let DummyOps: any = [];
193
+
194
+ if (Parts.length !== 0) {
195
+ if (isAuto) {
196
+ let Qty: number = 0;
197
+ let CGSTAMT: number = 0;
198
+ let SGSTAMT: number = 0;
199
+ let IGSTAMT: number = 0;
200
+ let Taxable: number = 0;
201
+ let FinalTotal: number = 0;
202
+ Parts.forEach((part: any) => {
203
+ Qty = Qty + part.Qty;
204
+ CGSTAMT = CGSTAMT + part.CGSTAmt;
205
+ SGSTAMT = SGSTAMT + part.SGSTAmt;
206
+ IGSTAMT = IGSTAMT + part.IGSTAmt;
207
+ Taxable = Taxable + part.AfterPartDisc;
208
+ FinalTotal = FinalTotal + part.AfterPartTax;
209
+ });
210
+ let dpartadding1: any = {};
211
+ dpartadding1.SNo = '';
212
+ dpartadding1.Desc = 'Spare Total';
213
+ dpartadding1.QtyAndUoM = TrUtils.FixedTo(Qty, DecimalsNumber);
214
+ dpartadding1.bold = true;
215
+ dpartadding1.UnPr = TrUtils.FixedTo(Taxable, DecimalsNumber);
216
+ dpartadding1.SGSTAmt = TrUtils.FixedTo(SGSTAMT, DecimalsNumber);
217
+ dpartadding1.IGSTAmt = TrUtils.FixedTo(IGSTAMT, DecimalsNumber);
218
+ dpartadding1.CGSTAmt = TrUtils.FixedTo(CGSTAMT, DecimalsNumber);
219
+ dpartadding1.TCode = ShowTaxColumn ? 114 : undefined;
220
+ dpartadding1.LineTotal = TrUtils.FixPriceValue(FinalTotal, DecimalsNumber);
221
+ Parts.push({ SNo: '' });
222
+ Parts.push(dpartadding1);
223
+ }
224
+
225
+
226
+ let dummypartadding1: any = {};
227
+ dummypartadding1.SNo = '';
228
+ dummypartadding1.Desc = 'Spare Parts';
229
+ dummypartadding1.Qty = '';
230
+ dummypartadding1.UnPr = '';
231
+ dummypartadding1.LineTotal = '';
232
+ Parts.unshift(dummypartadding1);
233
+ }
234
+
235
+ let SNo: number = 1;
236
+ Parts.forEach((part: any) => {
237
+ var dataRow: any = [];
238
+ columns[0].forEach((column: any) => {
239
+ if (
240
+ (!TrUtils.IsFixedZero(part[column.Field]) && !TrUtils.IsNull(part[column.Field]))
241
+ || (column.text === 'Line Total')) {
242
+ if (part[column.Field] === 'Spare Parts') {
243
+ dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
244
+ } else {
245
+ if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
246
+ && TrUtils.CheckInvalidSelect(part.TCode))) {
247
+ part[column.Field] = '';
248
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
249
+ } else {
250
+ if (column.text === 'Line Total' || column.Field === 'Shared' || column.Field === 'Tax' || column.Field === 'UnPr' || column.Field === 'QtyAndUoM'
251
+ || column.text === 'Tax' || column.Field === 'Disc' || column.Field === 'Perc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
252
+ || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
253
+ if (column.Field === 'Disc') {
254
+ if (column.type === 'percentage') {
255
+ if (!TrUtils.IsEmpty(part[column.Field])) {
256
+ dataRow.push({ text: part[column.Field].toString(), noWrap: true });
257
+ } else {
258
+ dataRow.push({ text: '', noWrap: true });
259
+ }
260
+ } else {
261
+ if (!TrUtils.IsNull(part[column.Field])) {
262
+ dataRow.push({ text: part[column.Field].toString(), noWrap: true });
263
+ } else {
264
+ dataRow.push({ text: '', noWrap: true });
265
+ }
266
+ }
267
+ } else {
268
+ if (!TrUtils.IsNull(part[column.Field])) {
269
+ dataRow.push({ text: part[column.Field].toString(), bold: part.bold, alignment: 'right', nowrap: true });
270
+ } else {
271
+ dataRow.push({ text: '', noWrap: true });
272
+ }
273
+ }
274
+ } else {
275
+ // dataRow.push(part[column.Field].toString());
276
+ if (column.Field === 'Desc') {
277
+ let DescData: any = [];
278
+ DescData.push({ text: part[column.Field].toString(), bold: part.bold });
279
+ if (!TrUtils.IsEmpty(part['EDesc'])) {
280
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
281
+ }
282
+ dataRow.push({ stack: DescData });
283
+ } else {
284
+ dataRow.push({ text: part[column.Field].toString() });
285
+ }
286
+ }
287
+ }
288
+ }
289
+ } else {
290
+ if (column.Field === 'SNo') {
291
+ part[column.Field] = SNo;
292
+ SNo = SNo + 1;
293
+ } else {
294
+ if (TrUtils.IsNull(part[column.Field])) {
295
+ part[column.Field] = '';
296
+ }
297
+ }
298
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
299
+ }
300
+ });
301
+ body.push(dataRow);
302
+ });
303
+ SNo = 1;
304
+ if (Labor.length !== 0) {
305
+ // let Qty: number = 0;
306
+ if (isAuto) {
307
+ let CGSTAMT: number = 0;
308
+ let SGSTAMT: number = 0;
309
+ let IGSTAMT: number = 0;
310
+ let Taxable: number = 0;
311
+ let FinalTotal: number = 0;
312
+ Labor.forEach((operation: any) => {
313
+ // console.log('operation', operation);
314
+ // Qty = Qty + operation.Qty;
315
+ CGSTAMT = CGSTAMT + operation.CGSTAmt;
316
+ SGSTAMT = SGSTAMT + operation.SGSTAmt;
317
+ IGSTAMT = IGSTAMT + operation.IGSTAmt;
318
+ Taxable = Taxable + operation.AfterLaborDisc;
319
+ FinalTotal = FinalTotal + operation.AfterLaborTax;
320
+ });
321
+ let dpartadding1: any = {};
322
+ dpartadding1.SNo = '';
323
+ dpartadding1.Desc = 'Labor Total';
324
+ // dpartadding1.QtyAndUoM = Qty;
325
+ dpartadding1.UnPr = TrUtils.FixedTo(Taxable, DecimalsNumber);
326
+ dpartadding1.SGSTAmt = TrUtils.FixedTo(SGSTAMT, DecimalsNumber);
327
+ dpartadding1.IGSTAmt = TrUtils.FixedTo(IGSTAMT, DecimalsNumber);
328
+ dpartadding1.CGSTAmt = TrUtils.FixedTo(CGSTAMT, DecimalsNumber);
329
+ dpartadding1.TCode = ShowTaxColumn ? 114 : undefined;
330
+ dpartadding1.bold = true;
331
+ dpartadding1.LineTotal = TrUtils.FixPriceValue(FinalTotal, DecimalsNumber);
332
+ Labor.push({ SNo: '' });
333
+ Labor.push(dpartadding1);
334
+ }
335
+ let dummypartadding1: any = {};
336
+ dummypartadding1.SNo = '';
337
+ dummypartadding1.Desc = 'Labor';
338
+ dummypartadding1.Qty = '';
339
+ dummypartadding1.UnPr = '';
340
+ dummypartadding1.LineTotal = '';
341
+ Labor.unshift(dummypartadding1);
342
+ // DummyOps.unshift(dummypartadding1);
343
+ }
344
+ if (Body === 2) {
345
+ for (let i = 0; i < Labor.length; i++) {
346
+ Labor[i].UnPr = '';
347
+ }
348
+ }
349
+
350
+ Labor.forEach((Ops: any) => {
351
+ var dataRow: any = [];
352
+ columns[0].forEach((column: any) => {
353
+ if ((!TrUtils.IsFixedZero(Ops[column.Field]) && !TrUtils.IsNull(Ops[column.Field]))
354
+ || (column.text === 'Line Total')) {
355
+ if (Ops[column.Field] === 'Labor') {
356
+ dataRow.push({ text: Ops[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
357
+ } else {
358
+ if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
359
+ && TrUtils.CheckInvalidSelect(Ops.TCode))) {
360
+ Ops[column.Field] = '';
361
+ dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
362
+ } else {
363
+ if (column.text === 'Line Total' || column.Field === 'Price' || column.Field === 'Shared' || column.Field === 'Tax' || column.text === 'Tax' || column.Field === 'UnPr'
364
+ || column.Field === 'QtyAndUoM' || column.Field === 'Disc' || column.Field === 'Perc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
365
+ || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
366
+ if (column.Field === 'Disc') {
367
+ if (column.type === 'percentage') {
368
+ if (!TrUtils.IsEmpty(Ops[column.Field])) {
369
+ dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
370
+ } else {
371
+ dataRow.push({ text: '', noWrap: true });
372
+ }
373
+ } else {
374
+ if (!TrUtils.IsNull(Ops[column.Field])) {
375
+ dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
376
+ } else {
377
+ dataRow.push({ text: '', noWrap: true });
378
+ }
379
+ }
380
+ } else {
381
+ if (!TrUtils.IsNull(Ops[column.Field])) {
382
+ dataRow.push({ text: Ops[column.Field].toString(), alignment: 'right', nowrap: true, bold: Ops.bold });
383
+ } else {
384
+ dataRow.push({ text: '', noWrap: true });
385
+ }
386
+ }
387
+
388
+ } else {
389
+ if (column.Field === 'Desc') {
390
+ let DescData: any = [];
391
+ DescData.push({ text: Ops[column.Field].toString(), bold: Ops.bold });
392
+ if (!TrUtils.IsEmpty(Ops['EDesc'])) {
393
+ DescData.push({ text: Ops['EDesc'].toString(), color: 'grey' });
394
+ }
395
+ dataRow.push({ stack: DescData });
396
+ } else {
397
+ dataRow.push({ text: Ops[column.Field].toString(), bold: Ops.bold });
398
+ }
399
+ }
400
+ }
401
+ }
402
+ } else {
403
+ if (column.Field === 'SNo') {
404
+ Ops[column.Field] = SNo;
405
+ SNo = SNo + 1;
406
+ } else {
407
+ if (TrUtils.IsNull(Ops[column.Field])) {
408
+ Ops[column.Field] = '';
409
+ }
410
+
411
+ }
412
+ dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
413
+ }
414
+ });
415
+ body.push(dataRow);
416
+ });
417
+ return body;
418
+ }
419
+
420
+ static GetWithOutDiscAndTaxFieldHeader(Parts: any, Ops: any, ShowTaxColumn: any, PrintPartNo: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number) {
421
+ if (Parts.length !== 0 || Ops.length !== 0) {
422
+ if (ShowTaxColumn) {
423
+ return this.TaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber);
424
+ } else {
425
+ if (ConsolidateGST) {
426
+ return this.ConsolidateDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber);
427
+ } else {
428
+ return this.NoTaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber);
429
+ }
430
+ }
431
+ } else {
432
+ let a: any = '';
433
+ return a;
434
+ }
435
+ }
436
+
437
+ static TaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number) {
438
+ if (PrintPartNo) {
439
+ // if (ShowIGST) {
440
+ // return {
441
+ // style: 'tableExample',
442
+ // table: {
443
+ // widths: PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
444
+ // // headerRows: 2,
445
+ // body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto)
446
+ // },
447
+ // layout: PrintSharedService.LayOutStyle()
448
+ // };
449
+ // } else {
450
+ return {
451
+ style: 'tableExample',
452
+ table: {
453
+ widths: [25, 50, 150, 40, 25, 50, 70, 50, 40],
454
+ // headerRows: 2,
455
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber)
456
+ },
457
+ layout: PrintSharedService.LayOutStyle()
458
+ };
459
+ // }
460
+
461
+ } else {
462
+ // if (ShowIGST) {
463
+ // return {
464
+ // style: 'tableExample',
465
+ // table: {
466
+ // widths: PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
467
+ // // headerRows: 2,
468
+ // body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto)
469
+ // },
470
+ // layout: PrintSharedService.LayOutStyle()
471
+ // };
472
+ // } else {
473
+ return {
474
+ style: 'tableExample',
475
+ table: {
476
+ widths: [25, 170,40, 40, 50, 70, 60, 50],
477
+ // headerRows: 2,
478
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber)
479
+ },
480
+ layout: PrintSharedService.LayOutStyle()
481
+ };
482
+ // }
483
+
484
+ }
485
+ }
486
+
487
+ static ConsolidateDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number) {
488
+ if (PrintPartNo) {
489
+ return {
490
+ style: 'tableExample',
491
+ table: {
492
+ widths: [25, 70, 263, 25, 60, 80, 10, 40],
493
+ // headerRows: 1,
494
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber)
495
+ },
496
+ layout: PrintSharedService.LayOutStyle()
497
+ };
498
+ } else {
499
+ return {
500
+ style: 'tableExample',
501
+ table: {
502
+ widths: [25, 295, 50, 80, 80, 10, 40],
503
+ // headerRows: 1,
504
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber)
505
+ },
506
+ layout: PrintSharedService.LayOutStyle()
507
+ };
508
+ }
509
+ }
510
+
511
+ static NoTaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number) {
512
+ if (PrintPartNo) {
513
+ return {
514
+ style: 'tableExample',
515
+ table: {
516
+ widths: PrintSharedService.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
517
+ // headerRows: 1,
518
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber)
519
+ },
520
+ layout: PrintSharedService.LayOutStyle()
521
+ };
522
+ } else {
523
+ return {
524
+ style: 'tableExample',
525
+ table: {
526
+ widths: PrintSharedService.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
527
+ // headerRows: 1,
528
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber)
529
+ },
530
+ layout: PrintSharedService.LayOutStyle()
531
+ };
532
+ }
533
+ }
534
+
535
+ static buildTableForCustomerLabor(Parts: any, Ops: any, PrintPartNo: any, customerorInsurance: any) {
536
+ var body: any = [];
537
+ let columns: any;
538
+ columns = this.getSummaryHeaders(PrintPartNo);
539
+ body.push(columns);
540
+ if (Parts.length !== 0) {
541
+ let dummypartadding1: any = {};
542
+ dummypartadding1.SNo = '';
543
+ dummypartadding1.Desc = 'Spare Parts';
544
+ dummypartadding1.Qty = '';
545
+ dummypartadding1.UnPr = '';
546
+ dummypartadding1.Price = '';
547
+ dummypartadding1.DiscountedPrice = '';
548
+ dummypartadding1.LineTotal = '';
549
+ dummypartadding1.QtyAndUoM = '';
550
+ dummypartadding1.HSN = '';
551
+ dummypartadding1.MPN = '';
552
+ Parts.unshift(dummypartadding1);
553
+ }
554
+
555
+ let SNo: number = 1;
556
+ Parts.forEach((part: any) => {
557
+ var dataRow: any = [];
558
+ columns.forEach((column: any) => {
559
+ if (!TrUtils.IsFixedZero(part[column.Field]) && !TrUtils.IsNull(part[column.Field])
560
+ || column.text === 'Line Total') {
561
+ if (part[column.Field] === 'Spare Parts') {
562
+ dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
563
+ } else {
564
+ // tslint:disable-next-line:max-line-length
565
+ if (column.text === 'Line Total' || column.Field === 'QtyAndUoM' || column.Field === 'CustPrice' || column.Field === 'InsPrice' ||
566
+ column.Field === 'DiscountedPrice' || column.Field === 'Shared' || column.Field === 'Tax' || column.Field === 'TaxAmount' || column.Field === 'UnPr') {
567
+ if (column.Field === 'Disc Amt') {
568
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', noWrap: true });
569
+
570
+ } else {
571
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
572
+ }
573
+
574
+ } else {
575
+ if (column.Field === 'Desc') {
576
+ let DescData: any = [];
577
+ DescData.push(part[column.Field].toString());
578
+ if (!TrUtils.IsEmpty(part['EDesc'])) {
579
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
580
+ }
581
+ dataRow.push({ stack: DescData });
582
+ } else {
583
+ dataRow.push({ text: part[column.Field].toString() });
584
+ }
585
+ }
586
+ }
587
+ } else {
588
+ if (column.Field === 'SNo') {
589
+ part[column.Field] = SNo;
590
+ SNo = SNo + 1;
591
+ } else {
592
+ if (TrUtils.IsNull(part[column.Field])) {
593
+ part[column.Field] = '';
594
+ }
595
+ }
596
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
597
+ }
598
+ });
599
+
600
+ body.push(dataRow);
601
+ });
602
+ SNo = 1;
603
+ if (Ops.length !== 0) {
604
+ let dummypartadding1: any = {};
605
+ dummypartadding1.SNo = '';
606
+ dummypartadding1.Desc = 'Labor';
607
+ dummypartadding1.Qty = '';
608
+ dummypartadding1.UnPr = '';
609
+ dummypartadding1.Price = '';
610
+ dummypartadding1.DiscountedPrice = '';
611
+ dummypartadding1.LineTotal = '';
612
+ dummypartadding1.QtyAndUoM = '';
613
+ dummypartadding1.HSN = '';
614
+ Ops.unshift(dummypartadding1);
615
+ }
616
+
617
+ Ops.forEach((labor: any) => {
618
+ var dataRow: any = [];
619
+ columns.forEach((column: any) => {
620
+ if (!TrUtils.IsFixedZero(labor[column.Field]) && !TrUtils.IsNull(labor[column.Field])
621
+ || column.text === 'Line Total') {
622
+ if (labor[column.Field] === 'Labor') {
623
+ dataRow.push({ text: labor[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
624
+ } else {
625
+ if (column.text === 'Line Total' || column.Field === 'QtyAndUoM' || column.Field === 'DiscountedPrice' || column.Field === 'TaxAmount'
626
+ || column.Field === 'UnPr' || column.Field === 'Shared' || column.Field === 'Tax' || column.Field === 'CustPrice' || column.Field === 'InsPrice') {
627
+ if (column.Field === 'Disc Amt') {
628
+ dataRow.push({ text: labor[column.Field].toString(), alignment: 'right', noWrap: true });
629
+ } else {
630
+ dataRow.push({ text: labor[column.Field].toString(), alignment: 'right', nowrap: true });
631
+ }
632
+
633
+ } else {
634
+ dataRow.push({ text: labor[column.Field].toString() });
635
+ }
636
+ }
637
+ } else {
638
+ if (column.Field === 'SNo') {
639
+ labor[column.Field] = SNo;
640
+ SNo = SNo + 1;
641
+ } else {
642
+ if (TrUtils.IsNull(labor[column.Field])) {
643
+ labor[column.Field] = '';
644
+ }
645
+ }
646
+ dataRow.push({ text: labor[column.Field].toString(), alignment: 'center' });
647
+ }
648
+ });
649
+ body.push(dataRow);
650
+ });
651
+ return body;
652
+ }
653
+
654
+ static getSummaryHeaders(permission: boolean) {
655
+ let headersNames: any = [{ text: 'Description', style: 'tableheader', Field: 'Desc' },
656
+ { text: 'HSN / SAC', style: 'tableheader', Field: 'SAC' },
657
+ { text: 'Qty', style: 'tableheader', Field: 'QtyAndUoM' },
658
+ // { text: 'Rate / Unit', style: 'tableheader', Field: 'UnPr' },
659
+ { text: 'Ins. Amt', style: 'tableheader', Field: 'AssPr' },
660
+ { text: 'Cust. Amt', style: 'tableheader', Field: 'Pr' },
661
+ { text: 'Disc.(Rs)', style: 'tableheader', Field: 'DiscountedPrice' },
662
+ { text: 'Tax %', style: 'tableheader', Field: 'TaxAmount' },
663
+ { text: 'Line Total', style: 'tableheader', Field: 'LineTotal' }];
664
+ if (permission) {
665
+ let sno = { text: 'S.No.', style: 'tableheader', Field: 'SNo' };
666
+ let MPN = { text: 'Part No', style: 'tableheader', Field: 'MPN' };
667
+ headersNames.unshift(sno, MPN);
668
+ } else {
669
+ let sno = { text: 'S.No.', style: 'tableheader', Field: 'SNo' };
670
+ headersNames.unshift(sno);
671
+ }
672
+
673
+
674
+ return headersNames;
675
+ }
676
+
677
+ static CommonTotalDetails(ROPrintData: any, index: any, numberofCopies: any, withPass: boolean, moreDiscDetails:boolean) {
678
+ // console.log('ROPrintData', ROPrintData);
679
+ let CommonDetails = [
680
+ SharedPDFService.GetFinalTotalDetails(ROPrintData,ROPrintData.CustLaborTotalAfterDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST,
681
+ ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn,
682
+ ROPrintData.CustPartsTotalAfterDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST,
683
+ ROPrintData.CustPartSGST, ROPrintData.TaxSummary, ROPrintData.ShowAccParts,
684
+ ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For,
685
+ ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal,
686
+ ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn,
687
+ TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax,
688
+ ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, ROPrintData.Adj,ROPrintData.STotal,moreDiscDetails),
689
+ this.GetNumberInWords(ROPrintData.CustRoundedTotal),
690
+ SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, ROPrintData.isCountersale, ROPrintData.Entity.DecimalsNumber),
691
+ SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
692
+ SharedPDFService.GetBankDetials(ROPrintData.Entity.Bank, ROPrintData.Entity.PrBank, ROPrintData.Entity.UPIPhone),
693
+ SharedPDFService.GetUnderLine(),
694
+ SharedPDFService.GetInvSignatures(ROPrintData.Entity.CName, ROPrintData.isCountersale),
695
+ // this.PageBrake(ROPrintData, withPass),
696
+ SharedPDFService.GetUnderLine1(withPass),
697
+ this.GetGatePass(withPass, ROPrintData)
698
+ ];
699
+ if (ROPrintData.Type !== 'Invoice') {
700
+ CommonDetails.splice(2, 0, SharedPDFService.GetUnderLine());
701
+ }
702
+ if (!TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
703
+ CommonDetails.push({ text: '', pageBreak: 'after' })
704
+ }
705
+ return CommonDetails;
706
+ }
707
+
708
+ static GetNumberInWords(TotalAmount:any) {
709
+ var rupee = SharedPDFService.convertNumberToWords(TotalAmount);
710
+ // console.log('rupee', rupee);
711
+ return { columns: [{ text: 'In Words :', fontSize: 9, width: 45 }, { text: rupee, bold: true, fontSize: 9, width: '*' }] }
712
+ }
713
+
714
+ static GetGatePass(isGatepass: boolean, ROPrintData: any) {
715
+ // console.log('ROPrintData', ROPrintData);
716
+ if (isGatepass) {
717
+ return {
718
+ columns: [{
719
+ id: '567',
720
+ text: [{ text: '', id: '1234' }],
721
+ stack: [
722
+ {
723
+ columns: [{ text: '' }, { text: 'Gate Pass', bold: true, fontSize: 9, alignment: 'center', marginTop: 5 },
724
+ { text: 'Date: ' + MyDate.ConvertUTCDateToReadable(MyDate.GetDateTimeNowInUTC(ROPrintData.Entity.User.TZ)), marginTop: 5, fontSize: 9, alignment: 'right' }]
725
+ },
726
+ { text: ROPrintData.Entity.CName, alignment: 'center', bold: true, fontSize: 12, marginTop: 5, marginBottom: 5 },
727
+ {
728
+ marginTop: 5,
729
+ columns: [
730
+ // {
731
+ // stack: [{ text: 'Customer Name :' + ROPrintData.Customer.Name, fontSize: 9 }, { text: 'Service Advisor :', fontSize: 9, marginBottom: 10 },
732
+ // { text: 'Vehicle has been received from workshop and work done as per my satisfaction.', fontSize: 6 }]
733
+ // }
734
+ { text: '', width: 60 },
735
+ this.GetCustomerDetails(ROPrintData, false)
736
+ ,
737
+ this.GetVehicleDetails(ROPrintData.Product, false)
738
+ // {
739
+ // stack: [{ text: 'Chassis No :' + ROPrintData.Product.VIN, fontSize: 9 },
740
+ // { text: 'Vehicle No :' + ROPrintData.Product.RegNo, fontSize: 9 }, { text: 'Vehicle Model :' + ROPrintData.Product.Model, fontSize: 9 }, { text: 'Repair Order No :', fontSize: 9 }]
741
+ // }
742
+ ]
743
+ },
744
+ { text: 'Vehicle has been received from workshop and work done as per my satisfaction.', fontSize: 7, marginTop: 10, marginLeft: 60 },
745
+ { columns: [SharedPDFService.CustomerSignature(), { text: '' }, SharedPDFService.Accountantsignature()] }
746
+ ]
747
+ }],
748
+ };
749
+
750
+
751
+ } else {
752
+ return SharedPDFService.emptyObject();
753
+ }
754
+ }
755
+
756
+ static GetCustomerDetails(ROPrintData: any, isOtherIndustry: boolean) {
757
+ let CustomerData = [
758
+ { name: 'Customer Name', value: ROPrintData.Customer.Name },
759
+ { name: 'Service Advisor', value: ROPrintData.Name },
760
+ ];
761
+ return SharedPDFService.GetVehicleDataTable(CustomerData);
762
+ }
763
+
764
+ static GetVehicleDetails(Vehicle: any, isOtherIndustry: boolean) {
765
+ let vehicleData: any;
766
+ vehicleData = [
767
+ ];
768
+ if (isOtherIndustry) {
769
+ vehicleData.push({ name: 'Serial No', value: SharedPDFService.CheckAndSetString(Vehicle.SNo) });
770
+ }
771
+ let a: any = [
772
+ { name: 'Vehicle Model', value: SharedPDFService.CheckAndSetString(Vehicle.Model) },
773
+ ];
774
+ if (!isOtherIndustry) {
775
+ a.unshift({ name: 'Regn. No', value: SharedPDFService.CheckAndSetString(Vehicle.RegNo) });
776
+ if (!TrUtils.IsEmpty(Vehicle.VIN)) {
777
+ a.unshift({ name: 'Chassis No', value: SharedPDFService.CheckAndSetString(Vehicle.VIN) });
778
+ }
779
+ }
780
+ for (let i = 0; i < a.length; i++) {
781
+ vehicleData.push(a[i]);
782
+ }
783
+
784
+ return SharedPDFService.GetVehicleDataTable(vehicleData);
785
+ }
786
+
787
+ }