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,937 @@
1
+ import { Add } from "../../shared/math-operations";
2
+ import { SharedPDFService } from "../../shared/shared-pdf.service";
3
+ import { PrintSharedService } from "../../shared/shared-print.service";
4
+ import { MyDate } from "../../utils/my-date";
5
+ import { TrUtils } from "../../utils/tr-utils";
6
+
7
+ export function GetInvoicePrint(invoicePdfData: any, numberofCopies: any, withPass: boolean, size: any = null, moreDiscDetails: boolean, orientation: 'portrait' | 'landscape' = 'portrait') {
8
+ const isotherIndustry = false;
9
+
10
+ var contents = [];
11
+ if (TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0 || numberofCopies.length === 1) {
12
+ contents.push(
13
+ CommonHeaderDetails(invoicePdfData, null, isotherIndustry, orientation),
14
+ PreparesparePartsTable(invoicePdfData, orientation),
15
+ CommonTotalDetails(invoicePdfData, null, numberofCopies, withPass, moreDiscDetails, orientation)
16
+ );
17
+ } else {
18
+ numberofCopies.forEach((text: any, index: any) => {
19
+ contents.push(
20
+ CommonHeaderDetails(invoicePdfData, text, isotherIndustry, orientation),
21
+ PreparesparePartsTable(invoicePdfData, orientation),
22
+ CommonTotalDetails(invoicePdfData, index, numberofCopies, withPass, moreDiscDetails, orientation)
23
+ );
24
+ });
25
+ }
26
+
27
+ var dd = {
28
+ watermark: GetWatermark(invoicePdfData),
29
+ info: {
30
+ title: GetFileName(invoicePdfData),
31
+ },
32
+ background: function (currentPage: any, pageSize: any) {
33
+ if (size !== 'full') {
34
+ pageSize.height = pageSize.height - 435.945;
35
+ }
36
+ return SharedPDFService.GetWatermarkImage(invoicePdfData.Image, pageSize, invoicePdfData.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
+ pageBreakBefore: function (currentNode: any, followingNodesOnPage: any, nodesOnNextPage: any, previousNodesOnPage: any) {
42
+ return currentNode.startPosition.top >= 700 && !TrUtils.IsNull(currentNode?.id) && currentNode?.id === '567';
43
+ },
44
+ pageMargins: GetMarginsBasedOnPaperSize(size, orientation),
45
+ pageOrientation: orientation,
46
+ pageSize: 'A4',
47
+ content: contents,
48
+ styles: SharedPDFService.GetStyles()
49
+ };
50
+ return dd;
51
+ }
52
+
53
+ export function GetMarginsBasedOnPaperSize(size: any, orientation: 'portrait' | 'landscape' = 'portrait') {
54
+ if (orientation === 'landscape') {
55
+ return [10, 15, 10, 15];
56
+ }
57
+ if (size === 'full') {
58
+ return [10, 15, 10, 15];
59
+ } else {
60
+ return [10, 15, 10, 15];
61
+ }
62
+ }
63
+
64
+ export function GetWatermark(invoicePdfData: any) {
65
+ if (invoicePdfData.IsProforma && invoicePdfData.Entity.Wmark) {
66
+ return { text: 'Not a final invoice', opacity: 0.2 };
67
+ } else {
68
+ return '';
69
+ }
70
+ }
71
+
72
+ export function GetFileName(invoicePdfData: any) {
73
+ let fileName: string = invoicePdfData.HeaderName;
74
+ if (!TrUtils.IsNull(invoicePdfData.Product) && !TrUtils.IsEmpty(invoicePdfData.Product.RegNo)) {
75
+ fileName = fileName + '-' + invoicePdfData.Product.RegNo;
76
+ }
77
+ return fileName;
78
+ }
79
+
80
+ export function CommonHeaderDetails(invoicePdfData: any, text: any, isotherIndustry: boolean, orientation: 'portrait' | 'landscape' = 'portrait') {
81
+ const headerDetails = [
82
+ GetMainHeaderDetails(invoicePdfData.Entity, invoicePdfData.HeaderName, invoicePdfData.Image, invoicePdfData.HColor, invoicePdfData.AColor, text, orientation),
83
+ SharedPDFService.GetNewCustomerAndVehicleDetails(invoicePdfData._id, invoicePdfData.CrDate, invoicePdfData.PrDate,
84
+ invoicePdfData.MOut, invoicePdfData.MIn, invoicePdfData.Product, invoicePdfData.PrintType, invoicePdfData.For,
85
+ invoicePdfData.SurName, invoicePdfData.SurPhone, invoicePdfData.Type, invoicePdfData.SurEmail, invoicePdfData.InsComp,
86
+ invoicePdfData.PolNo, invoicePdfData.PolType, invoicePdfData.Customer, invoicePdfData.IsProforma, invoicePdfData.Settings, invoicePdfData.Location, isotherIndustry, invoicePdfData.BL, invoicePdfData.ROCode, invoicePdfData.TypeName, invoicePdfData.AdmNo, invoicePdfData.DoS, invoicePdfData.Entity.PrCustBar, orientation),
87
+ SharedPDFService.GetOwnerDetails(invoicePdfData.Cust, invoicePdfData.Type, invoicePdfData.For),
88
+ CustomerAndVehicleDetailsAfterLine(orientation),
89
+ // SharedPDFService.GetDisplayTable(),
90
+ ];
91
+ return headerDetails;
92
+ }
93
+
94
+ export function GetMainHeaderDetails(Entity: any, HeaderName: any, Image: any, HColor: any, AColor: any, text: any, orientation: 'portrait' | 'landscape' = 'portrait') {
95
+ return [
96
+ SharedPDFService.GetNewMainHeader(Entity, Image, AColor, HColor, text, orientation),
97
+ SharedPDFService.GetPrintType(HeaderName),
98
+ HeaderAfterLine(orientation)
99
+ ];
100
+ }
101
+
102
+ export function HeaderAfterLine(orientation: 'portrait' | 'landscape' = 'portrait') {
103
+ const lineWidth = orientation === 'landscape' ? 820 : 575;
104
+ return {
105
+ canvas: [
106
+ {
107
+ type: 'line',
108
+ x1: 0, y1: 0,
109
+ x2: lineWidth, y2: 0,
110
+ lineWidth: 0.5
111
+ }
112
+ ], margin: [0, 2, 0, 2]
113
+ };
114
+ }
115
+
116
+ export function CustomerAndVehicleDetailsAfterLine(orientation: 'portrait' | 'landscape' = 'portrait') {
117
+ const lineWidth = orientation === 'landscape' ? 820 : 575;
118
+ return {
119
+ canvas: [
120
+ {
121
+ type: 'line',
122
+ x1: 0, y1: 0,
123
+ x2: lineWidth, y2: 0,
124
+ lineWidth: 0.5
125
+ }
126
+ ], margin: [0, 2, 0, 2]
127
+ };
128
+ }
129
+
130
+ export function PreparesparePartsTable(invoicePdfData: any, orientation: 'portrait' | 'landscape' = 'portrait') {
131
+ let List: any = [];
132
+ const printPartNo = invoicePdfData.Entity.MPN;
133
+
134
+ if (invoicePdfData.Entity.Body === 1) {
135
+ for (let i = 0; i < invoicePdfData.PrintInfo.length; i++) {
136
+ if (TrUtils.IsNull(invoicePdfData.PrintInfo[i].Text)) {
137
+ invoicePdfData.PrintInfo[i].Text = '';
138
+ }
139
+ if (!TrUtils.IsEmpty(invoicePdfData.PrintInfo[i].Text)) {
140
+ List.push(invoicePdfData.PrintInfo[i].Text);
141
+ }
142
+ List.push(
143
+ GetLaborPartsTableForView(TrUtils.Stringify(invoicePdfData.PrintInfo[i].Items), TrUtils.Stringify(invoicePdfData.PrintInfo[i].Ops), printPartNo, orientation)
144
+ );
145
+ }
146
+ } else {
147
+ if (invoicePdfData.Entity.Body === 2) {
148
+ for (let i = 0; i < invoicePdfData.PrintInfo.length; i++) {
149
+ if (TrUtils.IsNull(invoicePdfData.PrintInfo[i].Text)) {
150
+ invoicePdfData.PrintInfo[i].Text = '';
151
+ }
152
+ if (!TrUtils.IsEmpty(invoicePdfData.PrintInfo[i].Text)) {
153
+ List.push(invoicePdfData.PrintInfo[i].Text);
154
+ }
155
+ List.push(
156
+ WithOutDiscountFieldTable(TrUtils.Stringify(invoicePdfData.PrintInfo[i].Items), TrUtils.Stringify(invoicePdfData.PrintInfo[i].Ops), invoicePdfData.ShowTaxColumn,
157
+ printPartNo, invoicePdfData.Entity.Body, invoicePdfData.ShowIGST, invoicePdfData.ConsolidateGST, invoicePdfData.ShowDiscountColumn, invoicePdfData.Entity.DecimalsNumber, invoicePdfData, orientation)
158
+ );
159
+ }
160
+ } else {
161
+ if (invoicePdfData.Summary) {
162
+ List.push(
163
+ GetLaborPartsTableForView(invoicePdfData.Items, invoicePdfData.Ops, printPartNo, orientation)
164
+ );
165
+ } else {
166
+ for (let i = 0; i < invoicePdfData.PrintInfo.length; i++) {
167
+ if (TrUtils.IsNull(invoicePdfData.PrintInfo[i].Text)) {
168
+ invoicePdfData.PrintInfo[i].Text = '';
169
+ }
170
+ if (!TrUtils.IsEmpty(invoicePdfData.PrintInfo[i].Text)) {
171
+ List.push(invoicePdfData.PrintInfo[i].Text);
172
+ }
173
+ List.push(
174
+ GetWithOutDiscAndTaxFieldHeader(TrUtils.Stringify(invoicePdfData.PrintInfo[i].Items), TrUtils.Stringify(invoicePdfData.PrintInfo[i].Ops),
175
+ invoicePdfData.ShowTaxColumn, printPartNo, invoicePdfData.Entity.Body, invoicePdfData.ShowIGST, invoicePdfData.ConsolidateGST, invoicePdfData.ShowDiscountColumn, invoicePdfData.Entity.DecimalsNumber, invoicePdfData, orientation)
176
+ );
177
+ }
178
+ }
179
+ }
180
+ }
181
+ return List;
182
+ }
183
+
184
+ export function GetLaborPartsTableForView(Parts: any, Ops: any, PrintPartNo: any, orientation: 'portrait' | 'landscape' = 'portrait') {
185
+ if (Parts.length !== 0 || Ops.length !== 0) {
186
+ if (PrintPartNo) {
187
+ const widths = orientation === 'landscape' ? [15, 30, 140, 40, 35, 35, 25, 25, 35, 30, 50] : [25, 30, 170, 85, 15, 20, 50, 30, 30, 50];
188
+ return {
189
+ style: 'tableExample',
190
+ table: {
191
+ widths: widths,
192
+ body: buildTableForCustomerLabor(Parts, Ops, PrintPartNo, false, orientation)
193
+ },
194
+ layout: PrintSharedService.LayOutStyleanother()
195
+ };
196
+ } else {
197
+ const widths = orientation === 'landscape' ? [15, 180, 40, 35, 35, 25, 25, 35, 30, 50] : [25, 200, 55, 25, 55, 55, 40, 15, 50];
198
+ return {
199
+ style: 'tableExample',
200
+ table: {
201
+ widths: widths,
202
+ body: buildTableForCustomerLabor(Parts, Ops, PrintPartNo, false, orientation)
203
+ },
204
+ layout: PrintSharedService.LayOutStyleanother()
205
+ };
206
+ }
207
+ } else {
208
+ let a: any = '';
209
+ return a;
210
+ }
211
+ }
212
+
213
+ export function WithOutDiscountFieldTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, DecimalsNumber: number, invoicePdfData: any, orientation: 'portrait' | 'landscape' = 'portrait') {
214
+ if (Parts.length !== 0 || Ops.length !== 0) {
215
+ if (PrintPartNo) {
216
+ const widths = orientation === 'landscape' ? GetLandscapeTaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn) : [25, 60, 155, 30, 50, 60, 30, 50];
217
+ return {
218
+ style: 'tableExample',
219
+ marginLeft: 20,
220
+ table: {
221
+ widths: widths,
222
+ headerRows: orientation === 'landscape' ? 2 : 1,
223
+ body: BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, orientation)
224
+ },
225
+ layout: PrintSharedService.LayOutStyleanother()
226
+ };
227
+ } else {
228
+ const widths = orientation === 'landscape' ? GetLandscapeTaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn) : [25, 215, 25, 50, 60, 45, 50];
229
+ return {
230
+ style: 'tableExample',
231
+ marginLeft: 20,
232
+ table: {
233
+ widths: widths,
234
+ headerRows: orientation === 'landscape' ? 2 : 1,
235
+ body: BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, orientation)
236
+ },
237
+ layout: PrintSharedService.LayOutStyleanother()
238
+ };
239
+ }
240
+ } else {
241
+ let a: any = '';
242
+ return a;
243
+ }
244
+ }
245
+
246
+ function calculatePartsTotals(Parts: any, DecimalsNumber: number) {
247
+ let Qty: number = 0;
248
+ let CGSTAMT: number = 0;
249
+ let SGSTAMT: number = 0;
250
+ let IGSTAMT: number = 0;
251
+ let Taxable: number = 0;
252
+ let FinalTotal: number = 0;
253
+
254
+ Parts.forEach((part: any) => {
255
+ Qty = Add(Qty, TrUtils.FixedTo(part.Qty, DecimalsNumber));
256
+ CGSTAMT = Add(CGSTAMT, TrUtils.FixedTo(part.CGSTAmt, DecimalsNumber));
257
+ SGSTAMT = Add(SGSTAMT, TrUtils.FixedTo(part.SGSTAmt, DecimalsNumber));
258
+ IGSTAMT = Add(IGSTAMT, TrUtils.FixedTo(part.IGSTAmt, DecimalsNumber));
259
+ Taxable = Add(Taxable, TrUtils.FixedTo(part.AfterPartDisc, DecimalsNumber));
260
+ FinalTotal = Add(FinalTotal, TrUtils.FixedTo(part.AfterPartTax, DecimalsNumber));
261
+ });
262
+
263
+ return { Qty, CGSTAMT, SGSTAMT, IGSTAMT, Taxable, FinalTotal };
264
+ }
265
+
266
+ function calculateLaborTotals(Labor: any, DecimalsNumber: number) {
267
+ let CGSTAMT: number = 0;
268
+ let SGSTAMT: number = 0;
269
+ let IGSTAMT: number = 0;
270
+ let Taxable: number = 0;
271
+ let FinalTotal: number = 0;
272
+
273
+ Labor.forEach((operation: any) => {
274
+ CGSTAMT = Add(CGSTAMT, TrUtils.FixedTo(operation.CGSTAmt, DecimalsNumber));
275
+ SGSTAMT = Add(SGSTAMT, TrUtils.FixedTo(operation.SGSTAmt, DecimalsNumber));
276
+ IGSTAMT = Add(IGSTAMT, TrUtils.FixedTo(operation.IGSTAmt, DecimalsNumber));
277
+ Taxable = Add(Taxable, TrUtils.FixedTo(operation.AfterLaborDisc, DecimalsNumber));
278
+ FinalTotal = Add(FinalTotal, TrUtils.FixedTo(operation.AfterLaborTax, DecimalsNumber));
279
+ });
280
+
281
+ return { CGSTAMT, SGSTAMT, IGSTAMT, Taxable, FinalTotal };
282
+ }
283
+
284
+ function addPartsHeaderAndTotalRows(Parts: any, partsLabel: string, partsTotalLabel: string, ShowTaxColumn: any, DecimalsNumber: number) {
285
+ const totals = calculatePartsTotals(Parts, DecimalsNumber);
286
+
287
+ let dpartadding1: any = {};
288
+ dpartadding1.SNo = '';
289
+ dpartadding1.Desc = partsTotalLabel;
290
+ dpartadding1.QtyAndUoM = TrUtils.FixedTo(totals.Qty, DecimalsNumber);
291
+ dpartadding1.bold = true;
292
+ dpartadding1.UnPr = TrUtils.FixedTo(totals.Taxable, DecimalsNumber);
293
+ dpartadding1.SGSTAmt = TrUtils.FixedTo(totals.SGSTAMT, DecimalsNumber);
294
+ dpartadding1.IGSTAmt = TrUtils.FixedTo(totals.IGSTAMT, DecimalsNumber);
295
+ dpartadding1.CGSTAmt = TrUtils.FixedTo(totals.CGSTAMT, DecimalsNumber);
296
+ dpartadding1.TCode = ShowTaxColumn ? 114 : undefined;
297
+ dpartadding1.LineTotal = TrUtils.FixPriceValue(totals.FinalTotal, DecimalsNumber);
298
+ Parts.push({ SNo: '' });
299
+ Parts.push(dpartadding1);
300
+
301
+ let dummypartadding1: any = {};
302
+ dummypartadding1.SNo = '';
303
+ dummypartadding1.Desc = partsLabel;
304
+ dummypartadding1.Qty = '';
305
+ dummypartadding1.UnPr = '';
306
+ dummypartadding1.LineTotal = '';
307
+ Parts.unshift(dummypartadding1);
308
+ }
309
+
310
+ function addLaborHeaderAndTotalRows(Labor: any, laborLabel: string, laborTotalLabel: string, ShowTaxColumn: any, DecimalsNumber: number) {
311
+ const totals = calculateLaborTotals(Labor, DecimalsNumber);
312
+
313
+ let dpartadding1: any = {};
314
+ dpartadding1.SNo = '';
315
+ dpartadding1.Desc = laborTotalLabel;
316
+ dpartadding1.UnPr = TrUtils.FixedTo(totals.Taxable, DecimalsNumber);
317
+ dpartadding1.SGSTAmt = TrUtils.FixedTo(totals.SGSTAMT, DecimalsNumber);
318
+ dpartadding1.IGSTAmt = TrUtils.FixedTo(totals.IGSTAMT, DecimalsNumber);
319
+ dpartadding1.CGSTAmt = TrUtils.FixedTo(totals.CGSTAMT, DecimalsNumber);
320
+ dpartadding1.TCode = ShowTaxColumn ? 114 : undefined;
321
+ dpartadding1.bold = true;
322
+ dpartadding1.LineTotal = TrUtils.FixPriceValue(totals.FinalTotal, DecimalsNumber);
323
+ Labor.push({ SNo: '' });
324
+ Labor.push(dpartadding1);
325
+
326
+ let dummypartadding1: any = {};
327
+ dummypartadding1.SNo = '';
328
+ dummypartadding1.Desc = laborLabel;
329
+ dummypartadding1.Qty = '';
330
+ dummypartadding1.UnPr = '';
331
+ dummypartadding1.LineTotal = '';
332
+ Labor.unshift(dummypartadding1);
333
+ }
334
+
335
+ function buildItemRow(item: any, columns: any, column: any, itemLabel: string) {
336
+ const hasValue = !TrUtils.IsFixedZero(item[column.Field]) && !TrUtils.IsNull(item[column.Field]) || (column.text === 'Line Total');
337
+
338
+ if (hasValue) {
339
+ if (item[column.Field] === itemLabel) {
340
+ return { text: item[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' };
341
+ } else {
342
+ if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
343
+ && TrUtils.CheckInvalidSelect(item.TCode))) {
344
+ item[column.Field] = '';
345
+ return { text: item[column.Field].toString(), alignment: 'center' };
346
+ } else {
347
+ if (column.text === 'Line Total' || column.Field === 'UnPr' || column.Field === 'MRP' || column.Field === 'Batch' || column.Field === 'ExDate' || column.Field === 'QtyAndUoM'
348
+ || column.text === 'Tax' || column.Field === 'Disc' || column.Field === 'Perc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
349
+ || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc' || column.Field === 'Price') {
350
+ if (column.Field === 'Disc') {
351
+ if (column.type === 'percentage') {
352
+ if (!TrUtils.IsEmpty(item[column.Field])) {
353
+ return { text: item[column.Field].toString(), noWrap: true, alignment: 'center' };
354
+ } else {
355
+ return { text: '', noWrap: true };
356
+ }
357
+ } else {
358
+ if (!TrUtils.IsNull(item[column.Field])) {
359
+ return { text: item[column.Field].toString(), alignment: 'right', noWrap: true };
360
+ } else {
361
+ return { text: '', noWrap: true };
362
+ }
363
+ }
364
+ } else {
365
+ if (column.Field === 'Batch') {
366
+ if (!TrUtils.IsNull(item[column.Field])) {
367
+ return { text: item[column.Field].BN, nowrap: true };
368
+ } else {
369
+ return { text: '', noWrap: true };
370
+ }
371
+ } else if (column.Field === 'ExDate') {
372
+ if (!TrUtils.IsNull(item['Batch'])) {
373
+ return { text: MyDate.ConvertUTCDateToReadableExDate(item['Batch'].ExDt), nowrap: true };
374
+ } else {
375
+ return { text: '', noWrap: true };
376
+ }
377
+ } else {
378
+ if (!TrUtils.IsNull(item[column.Field])) {
379
+ return { text: item[column.Field].toString(), bold: item.bold, alignment: 'right', nowrap: true };
380
+ } else {
381
+ return { text: '', noWrap: true };
382
+ }
383
+ }
384
+ }
385
+ } else {
386
+ if (column.Field === 'Desc') {
387
+ let DescData: any = [];
388
+ DescData.push({ text: item[column.Field].toString(), bold: item.bold });
389
+ if (!TrUtils.IsEmpty(item['EDesc'])) {
390
+ DescData.push({ text: item['EDesc'].toString(), color: 'grey' });
391
+ }
392
+ // DescData.push({ text: item['MPN'] ? 'MPN: ' + item['MPN'] : '', color: 'grey', italics: true, marginTop: 2 });
393
+ // const isItemRow = itemLabel === 'Items';
394
+ // const hasBatchOrMrp = !TrUtils.IsNull(item['Batch']?.BN) || !TrUtils.IsNull(item['Batch']?.ExDt) || !TrUtils.IsNull(item['MRP']);
395
+ // if (isItemRow && hasBatchOrMrp) {
396
+ // const exDate = !TrUtils.IsNull(item['Batch']?.ExDt) ? MyDate.ConvertUTCDateToReadableExDate(item['Batch']?.ExDt) : '';
397
+ // DescData.push({
398
+ // marginTop: 5,
399
+ // text: [
400
+ // { text: 'B.No: ', bold: true },
401
+ // { text: (item['Batch']?.BN || '') + '' },
402
+ // { text: ' | Ex.Dt: ', bold: true },
403
+ // { text: exDate + '' },
404
+ // { text: ' | MRP: ', bold: true },
405
+ // { text: (TrUtils.IsNull(item['MRP']) ? '' : item['MRP']) + '' }
406
+ // ]
407
+ // });
408
+ // }
409
+ return { stack: DescData };
410
+ } else {
411
+ return { text: item[column.Field].toString(), bold: item.bold };
412
+ }
413
+ }
414
+ }
415
+ }
416
+ } else {
417
+ if (TrUtils.IsNull(item[column.Field])) {
418
+ item[column.Field] = '';
419
+ }
420
+ return { text: item[column.Field].toString(), alignment: 'center' };
421
+ }
422
+ }
423
+
424
+ function buildTableRows(items: any, columns: any, itemLabel: string, body: any) {
425
+ let SNo: number = 1;
426
+ items.forEach((item: any) => {
427
+ var dataRow: any = [];
428
+ columns.forEach((column: any) => {
429
+ if (column.Field === 'SNo' && (TrUtils.IsFixedZero(item[column.Field]) || TrUtils.IsNull(item[column.Field])) && item[column.Field] !== itemLabel) {
430
+ item[column.Field] = SNo;
431
+ SNo = SNo + 1;
432
+ }
433
+ dataRow.push(buildItemRow(item, columns, column, itemLabel));
434
+ });
435
+ body.push(dataRow);
436
+ });
437
+ }
438
+
439
+ export function BuildTableBodyForLaborAndParts(Parts: any, Labor: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, DecimalsNumber: number, orientation: 'portrait' | 'landscape' = 'portrait') {
440
+ var body: any = [];
441
+ let columns: any = orientation === 'landscape' ? GetLandscapeWithOutDiscountFieldHeader(PrintPartNo, ShowTaxColumn, Body, ShowIGST, ShowDiscountColumn) : PrintSharedService.GetWithOutDiscountFieldHeader(PrintPartNo, ShowTaxColumn, Body, ShowIGST, ShowDiscountColumn);
442
+
443
+ for (let i = 0; i < columns.length; i++) {
444
+ body.push(columns[i]);
445
+ }
446
+ columns = columns[1];
447
+
448
+ const partsLabel = 'Items';
449
+ const partsTotalLabel = 'Items Total';
450
+ const laborLabel = 'Service';
451
+ const laborTotalLabel = 'Service Total';
452
+
453
+ if (Parts.length !== 0) {
454
+ addPartsHeaderAndTotalRows(Parts, partsLabel, partsTotalLabel, ShowTaxColumn, DecimalsNumber);
455
+ }
456
+
457
+ buildTableRows(Parts, columns, partsLabel, body);
458
+
459
+ if (Labor.length !== 0) {
460
+ addLaborHeaderAndTotalRows(Labor, laborLabel, laborTotalLabel, ShowTaxColumn, DecimalsNumber);
461
+ }
462
+
463
+ if (Body === 2) {
464
+ for (let i = 0; i < Labor.length; i++) {
465
+ Labor[i].UnPr = '';
466
+ }
467
+ }
468
+
469
+ buildTableRows(Labor, columns, laborLabel, body);
470
+
471
+ return body;
472
+ }
473
+
474
+ export function GetWithOutDiscAndTaxFieldHeader(Parts: any, Ops: any, ShowTaxColumn: any, PrintPartNo: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, DecimalsNumber: number, invoicePdfData: any, orientation: 'portrait' | 'landscape' = 'portrait') {
475
+
476
+ if (Parts.length !== 0 || Ops.length !== 0) {
477
+ if (ShowTaxColumn) {
478
+ return TaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, orientation);
479
+ } else {
480
+ if (ConsolidateGST) {
481
+ return ConsolidateDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, orientation);
482
+ } else {
483
+ return NoTaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, orientation);
484
+ }
485
+ }
486
+ } else {
487
+ let a: any = '';
488
+ return a;
489
+ }
490
+ }
491
+
492
+ export function TaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, DecimalsNumber: number, orientation: 'portrait' | 'landscape' = 'portrait') {
493
+ const layoutStyle = PrintSharedService.LayOutStyle();
494
+ const widths = orientation === 'landscape' ? GetLandscapeTaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn) : PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn);
495
+
496
+ return {
497
+ style: 'tableExample',
498
+ marginTop: orientation === 'landscape' ? -6 : 7,
499
+ table: {
500
+ widths: widths,
501
+ body: BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, orientation)
502
+ },
503
+ layout: layoutStyle
504
+ };
505
+ }
506
+
507
+ export function ConsolidateDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, DecimalsNumber: number, orientation: 'portrait' | 'landscape' = 'portrait') {
508
+ const layoutStyle = PrintSharedService.LayOutStyle();
509
+
510
+ if (PrintPartNo) {
511
+ const widths = orientation === 'landscape' ? [15, 50, 180, 40, 35, 35, 25, 25, 35, 30, 50] : [25, 70, 263, 25, 60, 80, 10, 40];
512
+ return {
513
+ style: 'tableExample',
514
+ marginTop:7,
515
+ table: {
516
+ widths: widths,
517
+ body: BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, orientation)
518
+ },
519
+ layout: layoutStyle
520
+ };
521
+ } else {
522
+ const widths = orientation === 'landscape' ? [15, 220, 40, 35, 35, 25, 25, 35, 30, 50] : [25, 295, 50, 80, 80, 10, 40];
523
+ return {
524
+ style: 'tableExample',
525
+ marginTop:7,
526
+ table: {
527
+ widths: widths,
528
+ body: BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, orientation)
529
+ },
530
+ layout: layoutStyle
531
+ };
532
+ }
533
+ }
534
+
535
+ export function NoTaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, DecimalsNumber: number, orientation: 'portrait' | 'landscape' = 'portrait') {
536
+ const layoutStyle = PrintSharedService.LayOutStyle();
537
+ const widths = orientation === 'landscape'
538
+ ? (PrintPartNo ? [15, 50, 180, 40, 35, 35, 25, 25, 35, 30, 50] : [15, 220, 40, 35, 35, 25, 25, 35, 30, 50])
539
+ : PrintSharedService.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo);
540
+
541
+ return {
542
+ style: 'tableExample',
543
+ marginTop:7,
544
+ table: {
545
+ widths: widths,
546
+ body: BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, DecimalsNumber, orientation)
547
+ },
548
+ layout: layoutStyle
549
+ };
550
+ }
551
+
552
+ export function buildTableForCustomerLabor(Parts: any, Ops: any, PrintPartNo: any, customerorInsurance: any, orientation: 'portrait' | 'landscape' = 'portrait') {
553
+ var body: any = [];
554
+ let columns: any;
555
+ columns = orientation === 'landscape' ? getLandscapeSummaryHeaders(PrintPartNo) : getSummaryHeaders(PrintPartNo);
556
+ body.push(columns);
557
+
558
+ const partsLabel = 'Items';
559
+ const laborLabel = 'Service';
560
+ let snoRef = { value: 1 };
561
+
562
+ if (Parts.length !== 0) {
563
+ addSummaryHeaderRow(Parts, partsLabel, PrintPartNo);
564
+ }
565
+
566
+ buildSummaryRows(Parts, columns, partsLabel, body, snoRef);
567
+
568
+ snoRef.value = 1;
569
+
570
+ if (Ops.length !== 0) {
571
+ addSummaryHeaderRow(Ops, laborLabel, PrintPartNo);
572
+ }
573
+
574
+ buildSummaryRows(Ops, columns, laborLabel, body, snoRef);
575
+
576
+ return body;
577
+ }
578
+
579
+ function addSummaryHeaderRow(items: any, label: string, PrintPartNo: boolean) {
580
+ let headerRow: any = {};
581
+ headerRow.SNo = '';
582
+ headerRow.Desc = label;
583
+ headerRow.Qty = '';
584
+ headerRow.UnPr = '';
585
+ headerRow.Price = '';
586
+ headerRow.DiscountedPrice = '';
587
+ headerRow.LineTotal = '';
588
+ headerRow.QtyAndUoM = '';
589
+ headerRow.HSN = '';
590
+ if (PrintPartNo) {
591
+ headerRow.MPN = '';
592
+ }
593
+ items.unshift(headerRow);
594
+ }
595
+
596
+ function buildSummaryItemCell(item: any, column: any, itemLabel: string) {
597
+ const hasValue = !TrUtils.IsFixedZero(item[column.Field]) && !TrUtils.IsNull(item[column.Field]) || column.text === 'Line Total';
598
+
599
+ if (hasValue) {
600
+ if (item[column.Field] === itemLabel) {
601
+ return { text: item[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' };
602
+ } else {
603
+ if (column.text === 'Line Total' || column.Field === 'QtyAndUoM' || column.Field === 'CustPrice' || column.Field === 'InsPrice' ||
604
+ column.Field === 'DiscountedPrice' || column.Field === 'TaxAmount' || column.Field === 'UnPr') {
605
+ if (column.Field === 'Disc Amt') {
606
+ return { text: item[column.Field].toString(), alignment: 'right', noWrap: true };
607
+ } else {
608
+ return { text: item[column.Field].toString(), alignment: 'right', nowrap: true };
609
+ }
610
+ } else {
611
+ if (column.Field === 'Desc') {
612
+ let DescData: any = [];
613
+ DescData.push(item[column.Field].toString());
614
+ if (!TrUtils.IsEmpty(item['EDesc'])) {
615
+ DescData.push({ text: item['EDesc'].toString(), color: 'grey' });
616
+ }
617
+ return { stack: DescData };
618
+ } else {
619
+ return { text: item[column.Field].toString() };
620
+ }
621
+ }
622
+ }
623
+ } else {
624
+ if (TrUtils.IsNull(item[column.Field])) {
625
+ item[column.Field] = '';
626
+ }
627
+ return { text: item[column.Field].toString(), alignment: 'center' };
628
+ }
629
+ }
630
+
631
+ function buildSummaryRows(items: any, columns: any, itemLabel: string, body: any, snoRef: {value: number}) {
632
+ items.forEach((item: any) => {
633
+ var dataRow: any = [];
634
+ columns.forEach((column: any) => {
635
+ if (column.Field === 'SNo' && (TrUtils.IsFixedZero(item[column.Field]) || TrUtils.IsNull(item[column.Field])) && item[column.Field] !== itemLabel) {
636
+ item[column.Field] = snoRef.value;
637
+ snoRef.value = snoRef.value + 1;
638
+ }
639
+ dataRow.push(buildSummaryItemCell(item, column, itemLabel));
640
+ });
641
+ body.push(dataRow);
642
+ });
643
+ }
644
+
645
+ export function getSummaryHeaders(permission: boolean) {
646
+ let headersNames: any = [
647
+ { text: 'Description', style: 'tableheader', Field: 'Desc' },
648
+ { text: 'HSN / SAC', style: 'tableheader', Field: 'SAC' },
649
+ { text: 'Qty', style: 'tableheader', Field: 'QtyAndUoM' },
650
+ { text: 'Ins. Amt', style: 'tableheader', Field: 'AssPr' },
651
+ { text: 'Cust. Amt', style: 'tableheader', Field: 'Pr' },
652
+ { text: 'Disc.(Rs)', style: 'tableheader', Field: 'DiscountedPrice' },
653
+ { text: 'Tax %', style: 'tableheader', Field: 'TaxAmount' },
654
+ { text: 'Line Total', style: 'tableheader', Field: 'LineTotal' }
655
+ ];
656
+
657
+ if (permission) {
658
+ let sno = { text: 'S.No.', style: 'tableheader', Field: 'SNo' };
659
+ let MPN = { text: 'Part No', style: 'tableheader', Field: 'MPN' };
660
+ headersNames.unshift(sno, MPN);
661
+ } else {
662
+ let sno = { text: 'S.No.', style: 'tableheader', Field: 'SNo' };
663
+ headersNames.unshift(sno);
664
+ }
665
+
666
+ return headersNames;
667
+ }
668
+
669
+ export function CommonTotalDetails(invoicePdfData: any, index: any, numberofCopies: any, withPass: boolean, moreDiscDetails: boolean, orientation: 'portrait' | 'landscape' = 'portrait') {
670
+ const taxSummaryData = invoicePdfData.TaxSummary || invoicePdfData.CustTaxGroupDataByPerc;
671
+
672
+ let CommonDetails = [
673
+ SharedPDFService.GetFinalTotalDetails1(invoicePdfData, invoicePdfData.CustLaborTotalAfterDisc, invoicePdfData.CustLaborDiscTotal, invoicePdfData.CustLaborCGST,
674
+ invoicePdfData.CustLaborSGST, invoicePdfData.CustLaborIGST, invoicePdfData.CustPartIGST, invoicePdfData.ShowIGST, invoicePdfData.ShowTaxColumn,
675
+ invoicePdfData.CustPartsTotalAfterDisc, invoicePdfData.CustPartsDiscTotal, invoicePdfData.CustPartCGST,
676
+ invoicePdfData.CustPartSGST, taxSummaryData, invoicePdfData.ShowAccParts,
677
+ invoicePdfData.CustLaborAfterTax, invoicePdfData.CustPartAfterTax, invoicePdfData.FixedDisc, invoicePdfData.For,
678
+ invoicePdfData.FixedTotal, invoicePdfData.CustTotalRoundedBy, invoicePdfData.CustRoundedTotal,
679
+ invoicePdfData.ShowTaxColumn, invoicePdfData.ShowTaxColumn,
680
+ TrUtils.isTaxable(invoicePdfData.Settings?.Tax), invoicePdfData.CustLaborITax,
681
+ invoicePdfData.CustPartITax, invoicePdfData.Consolidate, invoicePdfData.From, invoicePdfData.Adj, taxSummaryData, invoicePdfData.STotal, false, moreDiscDetails),
682
+ GetNumberInWords(invoicePdfData.CustRoundedTotal),
683
+ SharedPDFService.InvoiceDueStatus(invoicePdfData.Type, invoicePdfData.Paid, invoicePdfData.Due, invoicePdfData.Sts, invoicePdfData.isCountersale, invoicePdfData.Entity.DecimalsNumber),
684
+ SharedPDFService.GetTemsAndConditions(invoicePdfData.Entity.Terms),
685
+ GetBanckdetailswithQRCode(invoicePdfData),
686
+ SharedPDFService.GetNewUnderLine(orientation),
687
+ SharedPDFService.GetInvSignatures(invoicePdfData.Entity.CName, invoicePdfData.isCountersale),
688
+ SharedPDFService.GetNewUnderLine1(withPass, orientation),
689
+ GetGatePass(withPass, invoicePdfData)
690
+ ];
691
+
692
+ if (invoicePdfData.Type !== 'Invoice') {
693
+ CommonDetails.splice(2, 0, SharedPDFService.GetNewUnderLine(orientation));
694
+ }
695
+
696
+ if (!TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
697
+ CommonDetails.push({ text: '', pageBreak: 'after' })
698
+ }
699
+
700
+ return CommonDetails;
701
+ }
702
+
703
+ export function GetBanckdetailswithQRCode(invoicePdfData: any) {
704
+ return {
705
+ columns: [
706
+ SharedPDFService.GetBankDetials(invoicePdfData.Entity.Bank, invoicePdfData.Entity.PrBank, invoicePdfData.Entity.UPIPhone),
707
+ SharedPDFService.GetEntityDetails(invoicePdfData.Entity)
708
+ ]
709
+ };
710
+ }
711
+
712
+ export function GetNumberInWords(TotalAmount: any) {
713
+ var rupee = SharedPDFService.convertNumberToWords(TotalAmount);
714
+ return { columns: [{ text: 'In Words :', fontSize: 9, width: 45 }, { text: rupee, bold: true, fontSize: 9, width: '*' }] };
715
+ }
716
+
717
+ export function GetGatePass(isGatepass: boolean, invoicePdfData: any) {
718
+ if (isGatepass) {
719
+ return {
720
+ columns: [{
721
+ id: '567',
722
+ text: [{ text: '', id: '1234' }],
723
+ stack: [
724
+ {
725
+ columns: [{ text: '' }, { text: 'Gate Pass', bold: true, fontSize: 9, alignment: 'center', marginTop: 5 },
726
+ { text: 'Date: ' + MyDate.ConvertUTCDateToReadable(MyDate.GetDateTimeNowInUTC(invoicePdfData.Entity.User.TZ)), marginTop: 5, fontSize: 9, alignment: 'right' }]
727
+ },
728
+ { text: invoicePdfData.Entity.CName, alignment: 'center', bold: true, fontSize: 12, marginTop: 5, marginBottom: 5 },
729
+ {
730
+ marginTop: 5,
731
+ columns: [
732
+ { text: '', width: 60 },
733
+ GetCustomerDetails(invoicePdfData, false),
734
+ GetVehicleDetails(invoicePdfData.Product, false)
735
+ ]
736
+ },
737
+ { text: 'Vehicle has been received from workshop and work done as per my satisfaction.', fontSize: 7, marginTop: 10, marginLeft: 60 },
738
+ { columns: [SharedPDFService.CustomerSignature(), { text: '' }, SharedPDFService.Accountantsignature()] }
739
+ ]
740
+ }],
741
+ };
742
+ } else {
743
+ return SharedPDFService.emptyObject();
744
+ }
745
+ }
746
+
747
+ export function GetCustomerDetails(invoicePdfData: any, isOtherIndustry: boolean) {
748
+ let CustomerData = [
749
+ { name: 'Customer Name', value: invoicePdfData.Customer.Name },
750
+ { name: 'Service Advisor', value: invoicePdfData.Name },
751
+ ];
752
+ return SharedPDFService.GetVehicleDataTable(CustomerData);
753
+ }
754
+
755
+ export function GetVehicleDetails(Vehicle: any, isOtherIndustry: boolean) {
756
+ let vehicleData: any;
757
+ vehicleData = [];
758
+
759
+ if (isOtherIndustry) {
760
+ vehicleData.push({ name: 'Serial No', value: SharedPDFService.CheckAndSetString(Vehicle.SNo) });
761
+ }
762
+
763
+ let a: any = [
764
+ { name: 'Vehicle Model', value: SharedPDFService.CheckAndSetString(Vehicle.Model) },
765
+ ];
766
+
767
+ if (!isOtherIndustry) {
768
+ a.unshift({ name: 'Regn. No', value: SharedPDFService.CheckAndSetString(Vehicle.RegNo) });
769
+ if (!TrUtils.IsEmpty(Vehicle.VIN)) {
770
+ a.unshift({ name: 'Chassis No', value: SharedPDFService.CheckAndSetString(Vehicle.VIN) });
771
+ }
772
+ }
773
+
774
+ for (let i = 0; i < a.length; i++) {
775
+ vehicleData.push(a[i]);
776
+ }
777
+
778
+ return SharedPDFService.GetVehicleDataTable(vehicleData);
779
+ }
780
+
781
+ export function GetLandscapeWithOutDiscountFieldHeader(PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ShowDiscountColumn: any) {
782
+ let headersNames: any;
783
+
784
+ if (PrintPartNo) {
785
+ headersNames = [[
786
+ { text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 },
787
+ { text: 'Part No', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 },
788
+ { text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.5 },
789
+ { text: 'HSN/SAC', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
790
+ { text: 'Batch No', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
791
+ { text: 'Expiry', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
792
+ { text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.5 },
793
+ { text: 'Off Qty', style: 'tableheader', rowSpan: 2, lineHeight: 1 },
794
+ { text: 'MRP', style: 'tableheader', rowSpan: 2, lineHeight: 0.5, alignment: 'center' },
795
+ { text: 'Unit Price', style: 'tableheader', rowSpan: 2, lineHeight: 0.5, alignment: 'center' },
796
+ { text: 'Line Total', rowSpan: 2, lineHeight: 0.5, style: 'tableheader' }
797
+ ], [
798
+ { text: '', Field: 'SNo', lineHeight: 0.5 },
799
+ { text: '', Field: 'MPN', lineHeight: 0.5 },
800
+ { text: '', Field: 'Desc', lineHeight: 0.5 },
801
+ { text: 'HSN/SAC', Field: 'HSN', lineHeight: 0.5 },
802
+ { text: '', Field: 'Batch', lineHeight: 0.5 },
803
+ { text: 'Expiry', Field: 'ExDate', lineHeight: 0.5 },
804
+ { text: '', Field: 'QtyAndUoM', lineHeight: 0.5 },
805
+ { text: '', Field: 'OfQty', lineHeight: 0.5 },
806
+ { text: '', Field: 'MRP', lineHeight: 0.5 },
807
+ { text: '', Field: 'UnPr', lineHeight: 0.5 },
808
+ { text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
809
+ ]];
810
+ let Count: number = 10;
811
+ if (ShowDiscountColumn) {
812
+ headersNames[0].splice(Count, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
813
+ headersNames[0].splice(Count + 1, 0, {});
814
+ headersNames[1].splice(Count, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
815
+ headersNames[1].splice(Count + 1, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
816
+ Count = 12;
817
+ }
818
+ if (ShowIGST) {
819
+ headersNames[0].splice(Count, 0, { text: 'IGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
820
+ headersNames[0].splice(Count + 1, 0, {});
821
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'IGSTPerc', type: 'percentage', lineHeight: 0.8 });
822
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'IGSTAmt', type: 'amount', lineHeight: 0.5 });
823
+ } else {
824
+ headersNames[0].splice(Count, 0, { text: 'CGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
825
+ headersNames[0].splice(Count + 1, 0, {});
826
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'CGSTPerc', type: 'percentage', lineHeight: 0.8 });
827
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'CGSTAmt', type: 'amount', lineHeight: 0.7 });
828
+ headersNames[0].splice(Count + 2, 0, { text: 'SGST/UTGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
829
+ headersNames[0].splice(Count + 3, 0, {});
830
+ headersNames[1].splice(Count + 2, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'SGSTPerc', type: 'percentage', lineHeight: 0.8 });
831
+ headersNames[1].splice(Count + 3, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'SGSTAmt', type: 'amount', lineHeight: 0.5 });
832
+ }
833
+ } else {
834
+ headersNames = [[
835
+ { text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.6 },
836
+ { text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.6 },
837
+ { text: 'HSN/SAC', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
838
+ { text: 'Batch No', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
839
+ { text: 'Expiry', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
840
+ { text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.6 },
841
+ { text: 'Off Qty', style: 'tableheader', rowSpan: 2, lineHeight: 1 },
842
+ { text: 'MRP', style: 'tableheader', rowSpan: 2, lineHeight: 0.5, alignment: 'center' },
843
+ { text: 'Unit Price', style: 'tableheader', rowSpan: 2, alignment: 'center', lineHeight: 0.6 },
844
+ { text: 'Line Total', rowSpan: 2, style: 'tableheader', lineHeight: 0.6 }
845
+ ], [
846
+ { text: '', Field: 'SNo', lineHeight: 0.5 },
847
+ { text: '', Field: 'Desc', lineHeight: 0.5 },
848
+ { text: 'HSN/SAC', Field: 'HSN', lineHeight: 0.5 },
849
+ { text: '', Field: 'Batch', lineHeight: 0.5 },
850
+ { text: 'Expiry', Field: 'ExDate', lineHeight: 0.5 },
851
+ { text: '', Field: 'QtyAndUoM', lineHeight: 0.5 },
852
+ { text: '', Field: 'OfQty', lineHeight: 0.5 },
853
+ { text: '', Field: 'MRP', lineHeight: 0.5 },
854
+ { text: '', Field: 'UnPr', lineHeight: 0.5 },
855
+ { text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
856
+ ]];
857
+ let Count: number = 9;
858
+ if (ShowDiscountColumn) {
859
+ headersNames[0].splice(Count, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
860
+ headersNames[0].splice(Count + 1, 0, {});
861
+ headersNames[1].splice(Count, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
862
+ headersNames[1].splice(Count + 1, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
863
+ Count = 11;
864
+ }
865
+ if (ShowIGST) {
866
+ headersNames[0].splice(Count, 0, { text: 'IGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
867
+ headersNames[0].splice(Count + 1, 0, {});
868
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'IGSTPerc', type: 'percentage', lineHeight: 0.8 });
869
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'IGSTAmt', type: 'amount', lineHeight: 0.5 });
870
+ } else {
871
+ headersNames[0].splice(Count, 0, { text: 'CGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
872
+ headersNames[0].splice(Count + 1, 0, {});
873
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'CGSTPerc', type: 'percentage', lineHeight: 0.8 });
874
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'CGSTAmt', type: 'amount', lineHeight: 0.5 });
875
+ headersNames[0].splice(Count + 2, 0, { text: 'SGST/UTGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
876
+ headersNames[0].splice(Count + 3, 0, {});
877
+ headersNames[1].splice(Count + 2, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'SGSTPerc', type: 'percentage', lineHeight: 0.8 });
878
+ headersNames[1].splice(Count + 3, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'SGSTAmt', type: 'amount', lineHeight: 0.5 });
879
+ }
880
+ }
881
+
882
+ return headersNames;
883
+ }
884
+
885
+ export function getLandscapeSummaryHeaders(PrintPartNo: any) {
886
+ var columns: any = [];
887
+
888
+ columns.push({ text: 'S.No', fontSize: 7, alignment: 'center', bold: true });
889
+
890
+ if (PrintPartNo) {
891
+ columns.push({ text: 'Part No', fontSize: 7, alignment: 'left', bold: true });
892
+ }
893
+
894
+ columns.push({ text: 'Description', fontSize: 7, alignment: 'left', bold: true });
895
+ columns.push({ text: 'HSN/SAC', fontSize: 7, alignment: 'center', bold: true });
896
+ columns.push({ text: 'Batch No', fontSize: 7, alignment: 'center', bold: true });
897
+ columns.push({ text: 'Expiry', fontSize: 7, alignment: 'center', bold: true });
898
+ columns.push({ text: 'Qty', fontSize: 7, alignment: 'center', bold: true });
899
+ columns.push({ text: 'Off Qty', fontSize: 7, alignment: 'center', bold: true });
900
+ columns.push({ text: 'MRP', fontSize: 7, alignment: 'right', bold: true });
901
+ columns.push({ text: 'Unit Price', fontSize: 7, alignment: 'right', bold: true });
902
+ columns.push({ text: 'Line Total', fontSize: 7, alignment: 'right', bold: true });
903
+
904
+ return columns;
905
+ }
906
+
907
+ export function GetLandscapeTaxTableWidths(PrintPartNo: any, ShowIGST: any, ShowDiscountColumn: any) {
908
+ if (PrintPartNo) {
909
+ if (ShowIGST) {
910
+ if (ShowDiscountColumn) {
911
+ return [24, 50, '*', 50, 35, 35, 30, 25, 40, 40, 20, 35, 20, 35, 51];
912
+ } else {
913
+ return [24, 50, '*', 50, 35, 35, 30, 25, 40, 40, 20, 35, 51];
914
+ }
915
+ } else {
916
+ if (ShowDiscountColumn) {
917
+ return [24, 45, '*', 50, 35, 35, 30, 22, 40, 40, 20, 34, 20, 32, 20, 32, 48];
918
+ } else {
919
+ return [24, 45, '*', 50, 35, 35, 30, 22, 40, 40, 20, 32, 20, 32, 54];
920
+ }
921
+ }
922
+ } else {
923
+ if (ShowIGST) {
924
+ if (ShowDiscountColumn) {
925
+ return [24, '*', 50, 41, 35, 30, 25, 40, 40, 20, 35, 20, 35, 41];
926
+ } else {
927
+ return [24, '*', 50, 50, 35, 30, 25, 40, 40, 20, 40, 50];
928
+ }
929
+ } else {
930
+ if (ShowDiscountColumn) {
931
+ return [24, '*', 50, 45, 35, 30, 22, 40, 40, 20, 34, 20, 35, 20, 35, 45];
932
+ } else {
933
+ return [24, '*', 50, 50, 35, 30, 22, 40, 40, 20, 35, 20, 35, 50];
934
+ }
935
+ }
936
+ }
937
+ }