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,658 @@
1
+ import { SharedPDFService } from '../../shared/shared-pdf.service';
2
+ import { PrintSharedService } from '../../shared/shared-print.service';
3
+ import { TrUtils } from '../../utils/tr-utils';
4
+ import { EquipmentDesignPdf } from './equipment-design-pdf.service';
5
+
6
+ export class SalesPdfService {
7
+
8
+ static FontSize: number = 8;
9
+
10
+ static GetSalesPrint(ROPrintData: any, numberofCopies: any, isOtherIndustry: boolean, Entity: any, Sites: any, Items: any, Image: any, moreDiscDetails:boolean) {
11
+ var contents = [];
12
+ if (TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
13
+ contents.push(
14
+ this.CommonHeaderDetails(ROPrintData, null),
15
+ this.PreparesparePartsTable(ROPrintData),
16
+ this.CommonTotalDetails(ROPrintData, null, numberofCopies, moreDiscDetails)
17
+ );
18
+ } else {
19
+ numberofCopies.forEach((text: any, index: any) => {
20
+ contents.push(
21
+ this.CommonHeaderDetails(ROPrintData, text),
22
+ this.PreparesparePartsTable(ROPrintData),
23
+ this.CommonTotalDetails(ROPrintData, index, numberofCopies, moreDiscDetails)
24
+ );
25
+ });
26
+ }
27
+ if (isOtherIndustry && !TrUtils.IsNull(Sites) && Sites.length != 0) {
28
+ contents.push({ text: '', pageBreak: 'after' });
29
+ contents.push(EquipmentDesignPdf.GetContentData(TrUtils.Stringify(Entity), Sites, Items, Image));
30
+ }
31
+ var dd = {
32
+ info: {
33
+ title: this.GetFileName(ROPrintData),
34
+ },
35
+ background: function (currentPage: any, pageSize: any) {
36
+ return SharedPDFService.GetWatermarkImage(ROPrintData.Image, pageSize, ROPrintData.Entity.Wmark);
37
+ },
38
+ header: function (currentPage: any, pageCount: any) {
39
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
40
+ },
41
+ pageMargins: [10, 15, 10, 15],
42
+ content: contents,
43
+ defaultStyle: {
44
+ fontSize: 10,
45
+ },
46
+ styles: SharedPDFService.GetStyles()
47
+ };
48
+ return dd;
49
+ }
50
+
51
+ static GetFileName(ROPrintData: any) {
52
+ let fileName: string = ROPrintData.HeaderName;
53
+ if (!TrUtils.IsNull(ROPrintData.Product) && !TrUtils.IsEmpty(ROPrintData.Product.RegNo)) {
54
+ fileName = fileName + '-' + ROPrintData.Product.RegNo;
55
+ }
56
+ return fileName;
57
+ }
58
+
59
+ static CommonHeaderDetails(ROPrintData: any, text: any) {
60
+ return [
61
+ this.GetMainHeaderDetails(ROPrintData.Entity, ROPrintData.HeaderName, ROPrintData.Image, ROPrintData.HColor, ROPrintData.AColor, text),
62
+ SharedPDFService.GetSOCustomerAndOthDetails(ROPrintData._id, ROPrintData.CrDate, ROPrintData.PrDate,
63
+ ROPrintData.PrintType, ROPrintData.For, ROPrintData.SurName, ROPrintData.SurPhone, ROPrintData.Type, ROPrintData.SurEmail, ROPrintData.ShippmentTo,
64
+ ROPrintData.PolNo, ROPrintData.PolType, ROPrintData.Customer, ROPrintData.DoS, ROPrintData.RefNo, null, null, null, null, null),
65
+ SharedPDFService.GetOwnerDetails(ROPrintData.Cust, ROPrintData.Type, ROPrintData.For),
66
+ SharedPDFService.CustomerAndVehicleDetailsAfterLine(),
67
+ SharedPDFService.GetDisplayTable(),
68
+ ];
69
+ }
70
+
71
+ static GetMainHeaderDetails(Entity: any, HeaderName: any, Image: any, HColor: any, AColor: any, text: any) {
72
+ return [
73
+ // SharedPDFService.MainHeading(Entity.CName, Entity.Header, Image, HColor, text),
74
+ SharedPDFService.GetMainHeader(Entity, Image, AColor, HColor, text),
75
+ SharedPDFService.GetPrintType(HeaderName),
76
+ SharedPDFService.HeaderAfterLine()
77
+ ];
78
+ }
79
+
80
+ static PreparesparePartsTable(ROPrintData: any) {
81
+ let List: any = [];
82
+ if (ROPrintData.Entity.Body === 1) {
83
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
84
+ if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
85
+ ROPrintData.PrintInfo[i].Text = '';
86
+ }
87
+ List.push(ROPrintData.PrintInfo[i].Text,
88
+ this.GetLaborPartsTableForView(TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), ROPrintData.Entity.MPN)
89
+ );
90
+
91
+ }
92
+ } else {
93
+ if (ROPrintData.Entity.Body === 2) {
94
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
95
+ if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
96
+ ROPrintData.PrintInfo[i].Text = '';
97
+ }
98
+ List.push(ROPrintData.PrintInfo[i].Text,
99
+ this.WithOutDiscountFieldTable(TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), ROPrintData.ShowTaxColumn,
100
+ ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn)
101
+ );
102
+
103
+ }
104
+ } else {
105
+ if (ROPrintData.Summary) {
106
+ List.push('',
107
+ this.GetLaborPartsTableForView(ROPrintData.Items, ROPrintData.Entity.MPN)
108
+ );
109
+ } else {
110
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
111
+ if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
112
+ ROPrintData.PrintInfo[i].Text = '';
113
+ }
114
+ List.push(ROPrintData.PrintInfo[i].Text,
115
+ this.GetWithOutDiscAndTaxFieldHeader(TrUtils.Stringify(ROPrintData.PrintInfo[i].Items),
116
+ ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn)
117
+ );
118
+
119
+ }
120
+ }
121
+ }
122
+ }
123
+ return List;
124
+ }
125
+
126
+ static GetLaborPartsTableForView(Parts: any, PrintPartNo: any) {
127
+ if (Parts.length !== 0) {
128
+ if (PrintPartNo) {
129
+ return {
130
+ style: 'tableExample',
131
+ // marginLeft: 20,
132
+ table: {
133
+ widths: [15, 30, 170, 85, 15, 20, 50, 30, 30, 60],
134
+ // headerRows: 2,
135
+ body: this.buildTableForCustomerLabor(Parts, PrintPartNo, false)
136
+ },
137
+ layout: PrintSharedService.LayOutStyleanother()
138
+ };
139
+ } else {
140
+ return {
141
+ style: 'tableExample',
142
+ // marginLeft: 20,
143
+ table: {
144
+ widths: [15, 200, 55, 25, 55, 55, 40, 15, 60],
145
+ // headerRows: 2,
146
+ body: this.buildTableForCustomerLabor(Parts, PrintPartNo, false)
147
+ },
148
+ layout: PrintSharedService.LayOutStyleanother()
149
+ };
150
+ }
151
+ } else {
152
+ let a: any = '';
153
+ return a;
154
+ }
155
+ }
156
+
157
+ static WithOutDiscountFieldTable(Parts: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any) {
158
+ if (Parts.length !== 0) {
159
+ if (PrintPartNo) {
160
+ return {
161
+ style: 'tableExample',
162
+ marginLeft: 20,
163
+ table: {
164
+ widths: [15, 67, 160, 25, 50, 60, 30, 53],
165
+ headerRows: 1,
166
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
167
+ },
168
+ layout: PrintSharedService.LayOutStyleanother()
169
+ };
170
+ } else {
171
+ return {
172
+ style: 'tableExample',
173
+ marginLeft: 20,
174
+ table: {
175
+ widths: [15, 215, 25, 50, 60, 45, 60],
176
+ headerRows: 1,
177
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
178
+ },
179
+ layout: PrintSharedService.LayOutStyleanother()
180
+ };
181
+ }
182
+ } else {
183
+ let a: any = '';
184
+ return a;
185
+ }
186
+ }
187
+
188
+ static BuildTableBodyForLaborAndParts(Parts: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any) {
189
+ var body: any = [];
190
+ let columns: any = PrintSharedService.GetWithOutDiscountFieldHeader(PrintPartNo, ShowTaxColumn, Body, ShowIGST, ShowDiscountColumn);
191
+ // if (ShowTaxColumn) {
192
+ for (let i = 0; i < columns.length; i++) {
193
+ body.push(columns[i]);
194
+ }
195
+ columns = columns[1];
196
+ // } else {
197
+ // body.push(columns);
198
+ // }
199
+
200
+
201
+ let DummyOps: any = [];
202
+
203
+ // if (Parts.length !== 0) {
204
+ // let dummypartadding1: any = {};
205
+ // dummypartadding1.SNo = '';
206
+ // dummypartadding1.Desc = 'Spare Parts';
207
+ // dummypartadding1.Qty = '';
208
+ // dummypartadding1.UnPr = '';
209
+ // dummypartadding1.LineTotal = '';
210
+ // Parts.unshift(dummypartadding1);
211
+ // }
212
+
213
+ let SNo: number = 1;
214
+ Parts.forEach((part: any) => {
215
+ var dataRow: any = [];
216
+ columns.forEach((column: any) => {
217
+ if (
218
+ ((!TrUtils.IsNull(part.Type) && part.Type !== 'Lab') || (!TrUtils.IsFixedZero(part[column.Field]) && !TrUtils.IsNull(part[column.Field])))
219
+ || (column.text === 'Line Total')) {
220
+ if (part[column.Field] === 'Spare Parts') {
221
+ dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
222
+ } else {
223
+ if (!TrUtils.IsNull(part.Type) && part.Type !== 'Lab') {
224
+ if (column.Field === 'Desc') {
225
+ if (part.Type === 'Note') {
226
+ dataRow.push({ text: part[column.Field].toString(), colSpan: 11, bold: true });
227
+ } else {
228
+ dataRow.push({ text: part[column.Field].toString(), colSpan: 10, alignment: 'right' });
229
+ }
230
+ } else {
231
+ if ((part.Type === 'Sub' || part.Type === 'Disc' || part.Type === 'Tax' || part.Type === 'Tot') && column.text === 'Line Total') {
232
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true, bold: true });
233
+ } else {
234
+ if (column.Field === 'SNo') {
235
+ dataRow.push({ text: '' });
236
+ } else {
237
+ dataRow.push({});
238
+ }
239
+ }
240
+ }
241
+ } else {
242
+ if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
243
+ && TrUtils.CheckInvalidSelect(part.TCode))) {
244
+ part[column.Field] = '';
245
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
246
+ } else {
247
+ if (column.text === 'Line Total' || column.Field === 'UnPr' || column.Field === 'QtyAndUoM'
248
+ || column.text === 'Tax' || column.Field === 'Disc' || column.Field === 'Perc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
249
+ || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
250
+ if (column.Field === 'Disc') {
251
+ if (column.type === 'percentage') {
252
+ if (!TrUtils.IsEmpty(part[column.Field])) {
253
+ dataRow.push({ text: part[column.Field].toString(), noWrap: true });
254
+ } else {
255
+ dataRow.push({ text: '', noWrap: true });
256
+ }
257
+ } else {
258
+ if (!TrUtils.IsZero(part[column.Field])) {
259
+ dataRow.push({ text: part[column.Field].toString(), noWrap: true });
260
+ } else {
261
+ dataRow.push({ text: '', noWrap: true });
262
+ }
263
+ }
264
+ } else {
265
+ if (!TrUtils.IsZero(part[column.Field])) {
266
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
267
+ } else {
268
+ dataRow.push({ text: '', noWrap: true });
269
+ }
270
+ }
271
+ } else {
272
+ // dataRow.push(part[column.Field].toString());
273
+ if (column.Field === 'Desc') {
274
+ let DescData: any = [];
275
+ DescData.push(part[column.Field].toString());
276
+ if (!TrUtils.IsEmpty(part['EDesc'])) {
277
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
278
+ }
279
+ dataRow.push({ stack: DescData });
280
+ } else {
281
+ part[column.Field] = TrUtils.IsNull(part[column.Field]) ? '' : part[column.Field];
282
+ dataRow.push({ text: part[column.Field].toString() });
283
+ }
284
+ }
285
+ }
286
+ }
287
+
288
+ }
289
+ } else {
290
+ if (column.Field === 'SNo') {
291
+ part[column.Field] = SNo;
292
+ SNo = SNo + 1;
293
+ } else {
294
+ part[column.Field] = '';
295
+ }
296
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
297
+ }
298
+ });
299
+
300
+ body.push(dataRow);
301
+ });
302
+
303
+ // if (Labor.length !== 0) {
304
+ // let dummypartadding1: any = {};
305
+ // dummypartadding1.SNo = '';
306
+ // dummypartadding1.Desc = 'Labor';
307
+ // dummypartadding1.Qty = '';
308
+ // dummypartadding1.UnPr = '';
309
+ // dummypartadding1.LineTotal = '';
310
+ // Labor.unshift(dummypartadding1);
311
+ // // DummyOps.unshift(dummypartadding1);
312
+ // }
313
+ // if (Body === 2) {
314
+ // for (let i = 0; i < Labor.length; i++) {
315
+ // Labor[i].UnPr = '';
316
+ // }
317
+ // }
318
+
319
+ // Labor.forEach((Ops: any) => {
320
+ // var dataRow: any = [];
321
+ // columns.forEach((column: any) => {
322
+ // if ((!TrUtils.IsFixedZero(Ops[column.Field]) && !TrUtils.IsNull(Ops[column.Field]))
323
+ // || (column.text === 'Line Total')) {
324
+ // if (Ops[column.Field] === 'Labor') {
325
+ // dataRow.push({ text: Ops[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
326
+ // } else {
327
+ // if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
328
+ // && TrUtils.CheckInvalidSelect(Ops.TCode))) {
329
+ // Ops[column.Field] = '';
330
+ // dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
331
+ // } else {
332
+ // if (column.text === 'Line Total' || column.Field === 'Price' || column.text === 'Tax' || column.Field === 'UnPr'
333
+ // || column.Field === 'QtyAndUoM' || column.Field === 'Disc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
334
+ // || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
335
+ // if (column.Field === 'Disc') {
336
+ // if (column.type === 'percentage') {
337
+ // if (Ops.Perc && !TrUtils.IsZero(Ops[column.Field])) {
338
+ // dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
339
+ // } else {
340
+ // dataRow.push({ text: '', noWrap: true });
341
+ // }
342
+ // } else {
343
+ // if (!Ops.Perc && !TrUtils.IsZero(Ops[column.Field])) {
344
+ // dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
345
+ // } else {
346
+ // dataRow.push({ text: '', noWrap: true });
347
+ // }
348
+ // }
349
+ // } else {
350
+ // if (!TrUtils.IsZero(Ops[column.Field])) {
351
+ // dataRow.push({ text: Ops[column.Field].toString(), alignment: 'right', nowrap: true });
352
+ // } else {
353
+ // dataRow.push({ text: '', noWrap: true });
354
+ // }
355
+ // }
356
+
357
+ // } else {
358
+ // dataRow.push(Ops[column.Field].toString());
359
+ // }
360
+ // }
361
+ // }
362
+ // } else {
363
+ // if (column.Field === 'SNo') {
364
+ // Ops[column.Field] = SNo;
365
+ // SNo = SNo + 1;
366
+ // } else {
367
+ // Ops[column.Field] = '';
368
+ // }
369
+ // dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
370
+ // }
371
+ // });
372
+ // body.push(dataRow);
373
+ // });
374
+ return body;
375
+ }
376
+
377
+ static GetWithOutDiscAndTaxFieldHeader(Parts: any, ShowTaxColumn: any, PrintPartNo: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any) {
378
+ if (Parts.length !== 0) {
379
+ if (ShowTaxColumn) {
380
+ return this.TaxDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn);
381
+ } else {
382
+ if (ConsolidateGST) {
383
+ return this.ConsolidateDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn);
384
+ } else {
385
+ return this.NoTaxDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn);
386
+ }
387
+ }
388
+ } else {
389
+ let a: any = '';
390
+ return a;
391
+ }
392
+ }
393
+
394
+ static TaxDataTable(Parts: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any) {
395
+ if (PrintPartNo) {
396
+ if (ShowIGST) {
397
+ return {
398
+ style: 'tableExample',
399
+ table: {
400
+ widths: PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
401
+ // headerRows: 2,
402
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
403
+ },
404
+ layout: PrintSharedService.LayOutStyle()
405
+ };
406
+ } else {
407
+ return {
408
+ style: 'tableExample',
409
+ table: {
410
+ widths: PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
411
+ // headerRows: 2,
412
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
413
+ },
414
+ layout: PrintSharedService.LayOutStyle()
415
+ };
416
+ }
417
+
418
+ } else {
419
+ if (ShowIGST) {
420
+ return {
421
+ style: 'tableExample',
422
+ table: {
423
+ widths: PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
424
+ // headerRows: 2,
425
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
426
+ },
427
+ layout: PrintSharedService.LayOutStyle()
428
+ };
429
+ } else {
430
+ return {
431
+ style: 'tableExample',
432
+ table: {
433
+ widths: PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
434
+ // headerRows: 2,
435
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
436
+ },
437
+ layout: PrintSharedService.LayOutStyle()
438
+ };
439
+ }
440
+
441
+ }
442
+ }
443
+
444
+ static ConsolidateDataTable(Parts: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any) {
445
+ if (PrintPartNo) {
446
+ return {
447
+ style: 'tableExample',
448
+ table: {
449
+ widths: [15, 70, 273, 25, 60, 80, 10, 40],
450
+ // headerRows: 1,
451
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
452
+ },
453
+ layout: PrintSharedService.LayOutStyle()
454
+ };
455
+ } else {
456
+ return {
457
+ style: 'tableExample',
458
+ table: {
459
+ widths: [20, 300, 50, 80, 80, 10, 40],
460
+ // headerRows: 1,
461
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
462
+ },
463
+ layout: PrintSharedService.LayOutStyle()
464
+ };
465
+ }
466
+ }
467
+
468
+ static NoTaxDataTable(Parts: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any) {
469
+ if (PrintPartNo) {
470
+ return {
471
+ style: 'tableExample',
472
+ table: {
473
+ widths: PrintSharedService.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
474
+ // headerRows: 1,
475
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
476
+ },
477
+ layout: PrintSharedService.LayOutStyle()
478
+ };
479
+ } else {
480
+ return {
481
+ style: 'tableExample',
482
+ table: {
483
+ widths: PrintSharedService.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
484
+ // headerRows: 1,
485
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
486
+ },
487
+ layout: PrintSharedService.LayOutStyle()
488
+ };
489
+ }
490
+ }
491
+
492
+ static buildTableForCustomerLabor(Parts: any, PrintPartNo: any, customerorInsurance: any) {
493
+ var body: any = [];
494
+ let columns: any;
495
+ columns = this.getSummaryHeaders(PrintPartNo);
496
+ body.push(columns);
497
+
498
+ if (Parts.length !== 0) {
499
+ let dummypartadding1: any = {};
500
+ dummypartadding1.SNo = '';
501
+ dummypartadding1.Desc = 'Spare Parts';
502
+ dummypartadding1.Qty = '';
503
+ dummypartadding1.UnPr = '';
504
+ dummypartadding1.Price = '';
505
+ dummypartadding1.DiscountedPrice = '';
506
+ dummypartadding1.LineTotal = '';
507
+ dummypartadding1.QtyAndUoM = '';
508
+ dummypartadding1.HSN = '';
509
+ dummypartadding1.MPN = '';
510
+ Parts.unshift(dummypartadding1);
511
+ }
512
+
513
+ let SNo: number = 1;
514
+ Parts.forEach((part: any) => {
515
+ var dataRow: any = [];
516
+ columns.forEach((column: any) => {
517
+ if (!TrUtils.IsFixedZero(part[column.Field]) && !TrUtils.IsNull(part[column.Field])
518
+ || column.text === 'Line Total') {
519
+ if (part[column.Field] === 'Spare Parts') {
520
+ dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
521
+ } else {
522
+ // tslint:disable-next-line:max-line-length
523
+ if (column.text === 'Line Total' || column.Field === 'QtyAndUoM' || column.Field === 'CustPrice' || column.Field === 'InsPrice' ||
524
+ column.Field === 'DiscountedPrice' || column.Field === 'TaxAmount' || column.Field === 'UnPr') {
525
+ if (column.Field === 'Disc Amt') {
526
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', noWrap: true });
527
+
528
+ } else {
529
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
530
+ }
531
+
532
+ } else {
533
+ // dataRow.push({ text: part[column.Field].toString() });
534
+ if (column.Field === 'Desc') {
535
+ let DescData: any = [];
536
+ DescData.push(part[column.Field].toString());
537
+ if (!TrUtils.IsEmpty(part['EDesc'])) {
538
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
539
+ }
540
+ dataRow.push({ stack: DescData });
541
+ } else {
542
+ dataRow.push({ text: part[column.Field].toString() });
543
+ }
544
+ }
545
+ }
546
+ } else {
547
+ if (column.Field === 'SNo') {
548
+ part[column.Field] = SNo;
549
+ SNo = SNo + 1;
550
+ } else {
551
+ part[column.Field] = '';
552
+ }
553
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
554
+ }
555
+ });
556
+
557
+ body.push(dataRow);
558
+ });
559
+
560
+ // if (Ops.length !== 0) {
561
+ // let dummypartadding1: any = {};
562
+ // dummypartadding1.SNo = '';
563
+ // dummypartadding1.Desc = 'Labor';
564
+ // dummypartadding1.Qty = '';
565
+ // dummypartadding1.UnPr = '';
566
+ // dummypartadding1.Price = '';
567
+ // dummypartadding1.DiscountedPrice = '';
568
+ // dummypartadding1.LineTotal = '';
569
+ // dummypartadding1.QtyAndUoM = '';
570
+ // dummypartadding1.HSN = '';
571
+ // Ops.unshift(dummypartadding1);
572
+ // }
573
+
574
+ // Ops.forEach((labor: any) => {
575
+ // var dataRow: any = [];
576
+ // columns.forEach((column: any) => {
577
+ // if (!TrUtils.IsFixedZero(labor[column.Field]) && !TrUtils.IsNull(labor[column.Field])
578
+ // || column.text === 'Line Total') {
579
+ // if (labor[column.Field] === 'Labor') {
580
+ // dataRow.push({ text: labor[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
581
+ // } else {
582
+ // if (column.text === 'Line Total' || column.Field === 'QtyAndUoM' || column.Field === 'DiscountedPrice' || column.Field === 'TaxAmount'
583
+ // || column.Field === 'UnPr' || column.Field === 'CustPrice' || column.Field === 'InsPrice') {
584
+ // if (column.Field === 'Disc Amt') {
585
+ // dataRow.push({ text: labor[column.Field].toString(), alignment: 'right', noWrap: true });
586
+ // } else {
587
+ // dataRow.push({ text: labor[column.Field].toString(), alignment: 'right', nowrap: true });
588
+ // }
589
+
590
+ // } else {
591
+ // dataRow.push({ text: labor[column.Field].toString() });
592
+ // }
593
+ // }
594
+ // } else {
595
+ // if (column.Field === 'SNo') {
596
+ // labor[column.Field] = SNo;
597
+ // SNo = SNo + 1;
598
+ // } else {
599
+ // labor[column.Field] = '';
600
+ // }
601
+ // dataRow.push({ text: labor[column.Field].toString(), alignment: 'center' });
602
+ // }
603
+ // });
604
+ // body.push(dataRow);
605
+ // });
606
+ return body;
607
+ }
608
+
609
+ static getSummaryHeaders(permission: boolean) {
610
+ let headersNames: any = [{ text: 'Description', style: 'tableheader', Field: 'Desc' },
611
+ { text: 'HSN / SAC', style: 'tableheader', Field: 'SAC' },
612
+ { text: 'Qty', style: 'tableheader', Field: 'QtyAndUoM' },
613
+ // { text: 'Rate / Unit', style: 'tableheader', Field: 'UnPr' },
614
+ { text: 'Ins. Amt', style: 'tableheader', Field: 'AssPr' },
615
+ { text: 'Cust. Amt', style: 'tableheader', Field: 'Pr' },
616
+ { text: 'Disc.(Rs)', style: 'tableheader', Field: 'DiscountedPrice' },
617
+ { text: 'Tax %', style: 'tableheader', Field: 'TaxAmount' },
618
+ { text: 'Line Total', style: 'tableheader', Field: 'LineTotal' }];
619
+ if (permission) {
620
+ let sno = { text: 'S.No.', style: 'tableheader', Field: 'SNo' };
621
+ let MPN = { text: 'Part No', style: 'tableheader', Field: 'MPN' };
622
+ headersNames.unshift(sno, MPN);
623
+ } else {
624
+ let sno = { text: 'S.No.', style: 'tableheader', Field: 'SNo' };
625
+ headersNames.unshift(sno);
626
+ }
627
+
628
+
629
+ return headersNames;
630
+ }
631
+
632
+ static CommonTotalDetails(ROPrintData: any, index: any, numberofCopies: any, moreDiscDetails:boolean) {
633
+ let CommonDetails = [
634
+ SharedPDFService.GetFinalTotalDetails(ROPrintData,'0.00', '0.00', '0.00',
635
+ '0.00', '0.00', '0.00', ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn,
636
+ ROPrintData.CustItemsTotalBeforeDisc, ROPrintData.CustItemsDiscTotal, ROPrintData.CustItemCGST,
637
+ ROPrintData.CustItemSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts,
638
+ '0.00', ROPrintData.CustItemAfterTax, ROPrintData.FixedDisc, ROPrintData.For,
639
+ ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal,
640
+ ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn,
641
+ TrUtils.isTaxable(ROPrintData.Settings.Tax), '0.00',
642
+ ROPrintData.CustItemITax, ROPrintData.Consolidate, ROPrintData.From, null,ROPrintData.SubTotal, moreDiscDetails),
643
+
644
+ SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false, ROPrintData.Entity.DecimalsNumber),
645
+ SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
646
+ SharedPDFService.GetUnderLine(),
647
+ SharedPDFService.GetSignatures(ROPrintData.Entity.CName, ROPrintData.Type, ROPrintData.For),
648
+ ];
649
+ if (ROPrintData.Type !== 'Invoice') {
650
+ CommonDetails.splice(2, 0, SharedPDFService.GetUnderLine());
651
+ }
652
+ if (!TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
653
+ CommonDetails.push({ text: '', pageBreak: 'after' })
654
+ }
655
+ return CommonDetails;
656
+ }
657
+
658
+ }