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,879 @@
1
+ import { MyDate } from '../utils/my-date';
2
+ import { TrUtils } from '../utils/tr-utils';
3
+
4
+ export class PrintSharedService {
5
+
6
+ static GetEntityHeaderStyles(PDFData: any, Entity: any, image: any) {
7
+ PDFData.Image = image;
8
+ PDFData.HColor = Entity.Entity.Settings.Common.PrOptions.NameClr;
9
+ PDFData.AColor = Entity.Entity.Settings.Common.PrOptions.AdrsClr;
10
+ return PDFData;
11
+ }
12
+
13
+ static GetFormattedEntityDataForPrint(argEntityData: any, RecordType: string, OriginalData: any) {
14
+ let EntityData: any = TrUtils.Stringify(argEntityData);
15
+ let tempEntity: any = !TrUtils.IsNull(EntityData.Entity) ? EntityData.Entity : EntityData;
16
+ if (!TrUtils.IsNull(tempEntity.Address) && tempEntity.Address.length !== 0) {
17
+ tempEntity.Address = TrUtils.Stringify(tempEntity.Address[0]);
18
+ }
19
+ if (TrUtils.IsNull(EntityData.User.TZ)) {
20
+ EntityData.User.TZ = 'Asia/Calcutta';
21
+ }
22
+ // MyDate.UserTimeZone = EntityData.User.TZ;
23
+ let Entity: any = {};
24
+ Entity.User = EntityData.User;
25
+ Entity.DecimalsNumber = 2;
26
+ if (TrUtils.IsNull(tempEntity.Settings.Common)) {
27
+ tempEntity.Settings.Common = {};
28
+ }
29
+ if (TrUtils.IsNull(tempEntity.Settings.Common.Tax)) {
30
+ tempEntity.Settings.Common.Tax = {};
31
+ }
32
+
33
+ if (TrUtils.IsNull(tempEntity.Settings.Acc)) {
34
+ tempEntity.Settings.Acc = {};
35
+ }
36
+
37
+ if (!TrUtils.IsNull(tempEntity.Settings.Acc) && !TrUtils.IsNull(tempEntity.Settings.Acc.Banks)) {
38
+ let Bank = tempEntity.Settings.Acc.Banks.filter((bank: any) => {
39
+ return bank.Def;
40
+ });
41
+ Entity.Bank = Bank[0];
42
+ Entity.PrBank = tempEntity.Settings.Acc.PrBnk;
43
+ Entity.PrUPI = tempEntity.Settings.Acc.PrUPI;
44
+ Entity.PrCustBar = tempEntity.Settings.Acc.PrCustBar;
45
+ Entity.UPI = tempEntity.Settings.Acc.UPI;
46
+ Entity.UPIPhone = tempEntity.Settings.Acc.UPIPhone;
47
+ }
48
+ if (TrUtils.IsNull(tempEntity.Settings.Common.Tax.GSTIN)) {
49
+ Entity.GSTIN = '';
50
+ } else {
51
+ Entity.GSTIN = tempEntity.Settings.Common.Tax.GSTIN;
52
+ }
53
+ if (TrUtils.IsNull(tempEntity.Settings.Common.DLNo)) {
54
+ Entity.DLNo = '';
55
+ } else {
56
+ Entity.DLNo = tempEntity.Settings.Common.DLNo;
57
+ }
58
+
59
+ if (TrUtils.IsNull(tempEntity.Settings.Common.RegNo)) {
60
+ Entity.RegNo = '';
61
+ } else {
62
+ Entity.RegNo = tempEntity.Settings.Common.RegNo;
63
+ }
64
+ if (!TrUtils.IsNull(tempEntity.Settings.Common.Tax)) {
65
+ Entity.TaxIds = tempEntity.Settings.Common.Tax.TaxIds;
66
+ }
67
+
68
+ if (TrUtils.IsNull(tempEntity.Settings.Common.Tax.GSTType)) {
69
+ Entity.GSTType = '';
70
+ } else {
71
+ Entity.GSTType = tempEntity.Settings.Common.Tax.GSTType;
72
+ }
73
+
74
+ if (TrUtils.IsNull(tempEntity.Settings.Common.Tax.TIN)) {
75
+ Entity.TIN = '';
76
+ } else {
77
+ Entity.TIN = tempEntity.Settings.Common.Tax.TIN;
78
+ }
79
+ if (TrUtils.IsNull(tempEntity.Settings.Common.Tax.CIN)) {
80
+ Entity.CIN = '';
81
+ } else {
82
+ Entity.CIN = tempEntity.Settings.Common.Tax.CIN;
83
+ }
84
+ if (TrUtils.IsNull(tempEntity.Settings.Common.Tax.GST)) {
85
+ Entity.GST = '';
86
+ } else {
87
+ Entity.GST = tempEntity.Settings.Common.Tax.GST;
88
+ }
89
+ if (TrUtils.IsNull(tempEntity.Settings.Common.Tax.CST)) {
90
+ Entity.CST = '';
91
+ } else {
92
+ Entity.CST = tempEntity.Settings.Common.Tax.CST;
93
+ }
94
+ if (TrUtils.IsNull(tempEntity.Settings.Common.Tax.PAN)) {
95
+ Entity.PAN = '';
96
+ } else {
97
+ Entity.PAN = tempEntity.Settings.Common.Tax.PAN;
98
+ }
99
+
100
+ if (!TrUtils.IsNull(tempEntity.Phone2) && !TrUtils.IsNull(tempEntity.Phone2.No)) {
101
+ Entity.Phone2 = tempEntity.Phone2.No;
102
+ } else {
103
+ Entity.Phone2 = '';
104
+ }
105
+ Entity.CName = tempEntity.DName;
106
+ Entity.TLine = tempEntity.TagLine;
107
+ Entity.Adrs1 = tempEntity.Address.A1;
108
+ Entity.Adrs2 = tempEntity.Address.A2;
109
+ Entity.City = tempEntity.Address.Ct;
110
+ Entity.State = tempEntity.Address.St;
111
+ Entity.PIN = tempEntity.Address.Pin;
112
+ let Email = this.GetEntityEmailDetails(tempEntity);
113
+ if (!TrUtils.IsEmpty(Email)) {
114
+ Entity.Email = Email;
115
+ }
116
+ Entity.Phone = this.GetEntityContactDetails(tempEntity);
117
+ if (TrUtils.IsNull(tempEntity.Settings.Common.PrOptions)) {
118
+ tempEntity.Settings.Common.PrOptions = {};
119
+ }
120
+ // if (RecordType === "Work Order" || RecordType === "Estimate") {
121
+ if (TrUtils.IsNull(tempEntity.Settings.Service)) {
122
+ tempEntity.Settings.Service = {};
123
+ }
124
+ if (TrUtils.IsNull(tempEntity.Settings.Service.PrMPN)) {
125
+ tempEntity.Settings.Service.PrMPN = false;
126
+ }
127
+ Entity.MPN = tempEntity.Settings.Service.PrMPN;
128
+
129
+ if (TrUtils.IsNull(tempEntity.Settings.Acc)) {
130
+ tempEntity.Settings.Acc = {};
131
+ }
132
+ if (TrUtils.IsNull(tempEntity.Settings.Acc.Round)) {
133
+ tempEntity.Settings.Service.Round = false;
134
+ }
135
+ Entity.Round = tempEntity.Settings.Acc.Round;
136
+
137
+
138
+ // }else{
139
+ // Entity.MPN = false;
140
+ // }
141
+ if (TrUtils.IsNull(tempEntity.Settings.Common.PrOptions.Header)) {
142
+ tempEntity.Settings.Common.PrOptions.Header = 1;
143
+ }
144
+ if (TrUtils.IsNull(tempEntity.Settings.Common.PrOptions.Wmark)) {
145
+ tempEntity.Settings.Common.PrOptions.Wmark = false;
146
+ }
147
+ if (TrUtils.IsNull(tempEntity.Settings.Common.PrOptions.Body)) {
148
+ tempEntity.Settings.PrOptions.Body = 1;
149
+ }
150
+ Entity.Header = tempEntity.Settings.Common.PrOptions.Header;
151
+ Entity.Wmark = tempEntity.Settings.Common.PrOptions.Wmark;
152
+ Entity.PrLogo = tempEntity.Settings.Common.PrOptions.PrLogo;
153
+ Entity.FootText = tempEntity.Settings.Common.PrOptions.FootText;
154
+ Entity.Body = 3;
155
+
156
+
157
+
158
+
159
+ if (RecordType === "Invoice") {
160
+ Entity.Terms = TrUtils.IsEmpty(OriginalData.TC) ? EntityData.Entity.Settings.Acc.ITerms : OriginalData.TC;
161
+ } else if (RecordType === "Work Order") {
162
+ Entity.Terms = TrUtils.IsEmpty(OriginalData.TC) ? EntityData.Entity.Settings.Service.WTerms : OriginalData.TC;
163
+ } else if (RecordType === "Estimate") {
164
+ Entity.Terms = TrUtils.IsEmpty(OriginalData.TC) ? EntityData.Entity.Settings.Service.ETerms : OriginalData.TC;
165
+ // Entity.Terms = "Estimate Terms";
166
+ } else if (RecordType === "SalesOrder") {
167
+ Entity.Terms = TrUtils.IsEmpty(OriginalData.TC) ? "Sales Order Terms" : OriginalData.TC;
168
+ } else if (RecordType === "Sales Estimate") {
169
+ Entity.Terms = TrUtils.IsEmpty(OriginalData.TC) ? "Estimate Terms" : OriginalData.TC;
170
+ } else {
171
+ Entity.Terms = "";
172
+ }
173
+ return Entity;
174
+ }
175
+
176
+ static GetEntityContactDetails(EntityInfo: any) {
177
+ let Phone: string = '';
178
+ // console.log('EntityInfo', TrUtils.Stringify(EntityInfo));
179
+ if (!TrUtils.IsNull(EntityInfo.Phone1) && !TrUtils.IsNull(EntityInfo.Phone1.No)) {
180
+ if (EntityInfo.Phone1.PrHead) {
181
+ Phone += EntityInfo.Phone1.No;
182
+ }
183
+ }
184
+ if (!TrUtils.IsNull(EntityInfo.Phone2) && !TrUtils.IsNull(EntityInfo.Phone2.No)) {
185
+ if (EntityInfo.Phone2.PrHead) {
186
+ Phone += ' , ' + EntityInfo.Phone2.No;
187
+ }
188
+ }
189
+ if (!TrUtils.IsNull(EntityInfo.Phone3) && !TrUtils.IsNull(EntityInfo.Phone3.No)) {
190
+ if (EntityInfo.Phone3.PrHead) {
191
+ Phone += ' , ' + EntityInfo.Phone3.No;
192
+ }
193
+ }
194
+ return Phone;
195
+ }
196
+
197
+ static GetEntityEmailDetails(EntityInfo: any) {
198
+ let Email: string = '';
199
+ if (!TrUtils.IsEmpty(EntityInfo.EMail1) && !TrUtils.IsEmpty(EntityInfo.EMail1.Email)) {
200
+ if (EntityInfo.EMail1.PrHead) {
201
+ Email += EntityInfo.EMail1.Email;
202
+ }
203
+ }
204
+ if (!TrUtils.IsEmpty(EntityInfo.EMail2) && !TrUtils.IsEmpty(EntityInfo.EMail2.Email)) {
205
+ if (EntityInfo.EMail2.PrHead) {
206
+ Email += ' , ' + EntityInfo.EMail2.Email;
207
+ }
208
+ }
209
+ return Email;
210
+ }
211
+
212
+ static GetVehicleFromServiceAndFormatData(originalvehicledata: any) {
213
+ let Vehicle: any = TrUtils.Stringify(originalvehicledata);
214
+ let FormattedVehicleData = this.GetVehicleDataForPrint(Vehicle);
215
+ return FormattedVehicleData;
216
+ }
217
+
218
+ static GetVehicleDataForPrint(vehicle: any) {
219
+ let Vehicle: any = {};
220
+ Vehicle.RegNo = vehicle.RegNo;
221
+ Vehicle.SNo = vehicle.SNo;
222
+ Vehicle.Make = vehicle.Make;
223
+ Vehicle.Model = vehicle.Model;
224
+ Vehicle.Var = vehicle.Var;
225
+ if (!TrUtils.IsNull(vehicle.VIN)) {
226
+ Vehicle.VIN = vehicle.VIN;
227
+ } else {
228
+ Vehicle.VIN = '';
229
+ }
230
+ if (!TrUtils.IsEmpty(vehicle.EngNo)) {
231
+ Vehicle.EngNo = vehicle.EngNo;
232
+ } else {
233
+ Vehicle.EngNo = '';
234
+ }
235
+ if (!TrUtils.IsEmpty(vehicle.DDate)) {
236
+ Vehicle.DDate = MyDate.ConvertUTCDateToReadable(vehicle.DDate);
237
+ } else {
238
+ Vehicle.DDate = '';
239
+ }
240
+ return Vehicle;
241
+ }
242
+
243
+ static GetCustomerFromServiceAndFormatData(originalcustomerdata: any) {
244
+ let Customer: any = TrUtils.Stringify(originalcustomerdata);
245
+ let FormattedCustData: any = this.GetCustomerDataForROEstPrint(Customer);
246
+ return FormattedCustData;
247
+ }
248
+
249
+ static GetCustomerDataForROEstPrint(customer: any) {
250
+ let Customer: any = {
251
+ Name: customer.Sltn + ' ' + customer.Name,
252
+ GSTIN: customer.GSTIN,
253
+ Ph: customer.Ph,
254
+ Cons: [
255
+ {
256
+ Type: 'M',
257
+ No: customer.Ph
258
+ }
259
+ ],
260
+ Adrs: this.GetAddress(customer.Adrs)
261
+ }
262
+ if (!TrUtils.IsNull(customer.Adrs)) {
263
+ Customer.Pin = customer.Adrs.Pin;
264
+ }
265
+ return Customer;
266
+ }
267
+
268
+ static GetAddress(Address: any) {
269
+ let Adrs: any[] = [];
270
+ if (!TrUtils.IsNull(Address)) {
271
+ if (!TrUtils.IsEmpty(Address.A1)) {
272
+ Adrs.push(this.AddingComaAsaLastLetter(Address.A1));
273
+ }
274
+ if (!TrUtils.IsEmpty(Address.A2)) {
275
+ Adrs.push(this.AddingComaAsaLastLetter(Address.A2));
276
+ }
277
+ if (!TrUtils.IsEmpty(Address.Ct)) {
278
+ Adrs.push(this.AddingComaAsaLastLetter(Address.Ct));
279
+ }
280
+ // if (!TrUtils.IsEmpty(Address.Pin)) {
281
+ // Adrs.push(Address.Pin);
282
+ // }
283
+ }
284
+ return Adrs;
285
+ }
286
+
287
+ static AddingComaAsaLastLetter(Stmt: string) {
288
+ // console.log(Stmt, Stmt.slice(-1));
289
+ // console.log(Stmt.slice(-1) !== ',');
290
+ if (!TrUtils.IsNull(Stmt) && Stmt.slice(-1) !== ',') {
291
+ Stmt = Stmt + ', ';
292
+ } else {
293
+ Stmt = Stmt + ' ';
294
+ }
295
+ return Stmt;
296
+ }
297
+
298
+ static GetCustomerDataForTechnicianPrint(customer: any) {
299
+ let Customer = {
300
+ Name: customer.Sltn + ' ' + customer.Name,
301
+ GSTIN: customer.GSTIN,
302
+ Adrs: this.GetAddress(customer.Adrs)
303
+ }
304
+ return Customer;
305
+ }
306
+
307
+ static GetCGSTValueBasedOnTaxCode(TCode: any, argTaxCodes: any) {
308
+ if (TrUtils.IsNull(TCode)) {
309
+ return 0;
310
+ }
311
+ let TaxCodes: any = TrUtils.Stringify(argTaxCodes);
312
+ let TCodeIndex: any = TaxCodes.findIndex((TaxCode: any) => {
313
+ return TaxCode._id === Number(TCode);
314
+ });
315
+ if (TCodeIndex !== -1) {
316
+ if (TrUtils.IsNull(TaxCodes[TCodeIndex].CGST)) {
317
+ return 0;
318
+ } else {
319
+ return TrUtils.FixedTo(TaxCodes[TCodeIndex].CGST);
320
+ }
321
+ } else {
322
+ return 0;
323
+ }
324
+ }
325
+
326
+ static GetSGSTValueBasedOnTaxCode(TCode: any, argTaxCodes: any) {
327
+ if (TrUtils.IsNull(TCode)) {
328
+ return 0;
329
+ }
330
+ let TaxCodes: any = TrUtils.Stringify(argTaxCodes);
331
+ let TCodeIndex: any = TaxCodes.findIndex((TaxCode: any) => {
332
+ return TaxCode._id === Number(TCode);
333
+ });
334
+ if (TCodeIndex !== -1) {
335
+ if (TrUtils.IsNull(TaxCodes[TCodeIndex].SGST)) {
336
+ return 0;
337
+ } else {
338
+ return TrUtils.FixedTo(TaxCodes[TCodeIndex].SGST);
339
+ }
340
+ } else {
341
+ return 0;
342
+ }
343
+ }
344
+
345
+ static GetIGSTValueBasedOnTaxCode(TCode: any, argTaxCodes: any) {
346
+ if (TrUtils.IsNull(TCode)) {
347
+ return 0;
348
+ }
349
+ let TaxCodes: any = TrUtils.Stringify(argTaxCodes);
350
+ let TCodeIndex: any = TaxCodes.findIndex((TaxCode: any) => {
351
+ return TaxCode._id === Number(TCode);
352
+ });
353
+ if (TCodeIndex !== -1) {
354
+ if (TrUtils.IsNull(TaxCodes[TCodeIndex].IGST)) {
355
+ return 0;
356
+ } else {
357
+ return TrUtils.FixedTo(TaxCodes[TCodeIndex].IGST);
358
+ }
359
+ } else {
360
+ return 0;
361
+ }
362
+ }
363
+
364
+ static CheckItemIndexWithDisc(RecordInfo: any) {
365
+ let DiscItem: number = RecordInfo.PrintInfo.findIndex((PrintInfo: any) => {
366
+ let LaborDiscItem: number = -1;
367
+ if (!TrUtils.IsNull(PrintInfo.Ops)) {
368
+ LaborDiscItem = PrintInfo.Ops.findIndex((Labor: any) => {
369
+ if (!TrUtils.IsZero(Labor.Disc)) {
370
+ return Labor;
371
+ }
372
+ });
373
+ }
374
+ let PartDiscItem: number = -1;
375
+ if (!TrUtils.IsNull(PrintInfo.Parts)) {
376
+ PartDiscItem = PrintInfo.Parts.findIndex((Part: any) => {
377
+ if (!TrUtils.IsZero(Part.Disc)) {
378
+ return Part;
379
+ }
380
+ });
381
+ } else if (!TrUtils.IsNull(PrintInfo.Items)) {
382
+ PartDiscItem = PrintInfo.Items.findIndex((Item: any) => {
383
+ return !TrUtils.IsZero(Item.Disc);
384
+ });
385
+ }
386
+ if (LaborDiscItem !== -1 || PartDiscItem !== -1) {
387
+ return PrintInfo;
388
+ }
389
+ });
390
+ return DiscItem;
391
+ }
392
+
393
+ static GetWithOutDiscountFieldHeader(permission: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ShowDiscountColumn: any) {
394
+ if (Body === 2) {
395
+ let headersNames: any = [{ text: 'Description', style: 'tableheader', Field: 'Desc' },
396
+ { text: 'Qty', style: 'tableheader', Field: 'QtyAndUoM' },
397
+ { text: 'Unit Price', style: 'tableheader', Field: 'UnPr', Field1: 'UnCo' },
398
+ { text: 'Labor Charges', style: 'tableheader', Field: 'Price' },
399
+ { text: 'Tax', style: 'tableheader', Field: 'TaxAmount' },
400
+ { text: 'Line Total', style: 'tableheader', Field: 'LineTotal' }];
401
+ if (permission) {
402
+ let sno = { text: 'S.No.', style: 'tableheader', Field: 'SNo' };
403
+ let MPN = { text: 'Part No', style: 'tableheader', Field: 'MPN' };
404
+ headersNames.unshift(sno, MPN);
405
+ } else {
406
+ let sno = { text: 'S.No.', style: 'tableheader', Field: 'SNo' };
407
+ headersNames.unshift(sno);
408
+ }
409
+ return headersNames;
410
+ } else {
411
+ if (ShowTaxColumn) {
412
+ return this.GetWithOutDiscountFieldHeader1(permission, Body, ShowIGST, ShowDiscountColumn);
413
+ } else {
414
+ return this.GetWithOutDiscountFieldHeader2(permission, Body, ShowDiscountColumn);
415
+ }
416
+ }
417
+ }
418
+
419
+ static GetWithOutDiscountFieldHeader1(permission: any, Body: any, ShowIGST: any, ShowDiscountColumn: any) {
420
+ let headersNames: any;
421
+ if (permission) {
422
+ headersNames = [[{ text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 },
423
+ { text: 'Part No', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 },
424
+ { text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.5 },
425
+ { text: 'HSN/SAC', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
426
+ { text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.5 },
427
+ { text: 'Unit Price', style: 'tableheader', rowSpan: 2, lineHeight: 0.5, alignment: 'center', },
428
+ { text: 'Line Total', rowSpan: 2, lineHeight: 0.5, style: 'tabFleheader' }
429
+ ],
430
+ [{ text: '', Field: 'SNo', lineHeight: 0.5 }, { text: '', Field: 'MPN', lineHeight: 0.5 },
431
+ { text: '', Field: 'Desc', lineHeight: 0.5 }, { text: 'HSN/SAC', Field: 'HSN', lineHeight: 0.5 },
432
+ { text: '', Field: 'QtyAndUoM', lineHeight: 0.5 }, { text: 'Unit Price', Field: 'UnPr', Field1: 'UnCo', lineHeight: 0.5 },
433
+ { text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
434
+ ]
435
+ ];
436
+ let Count: number = 6;
437
+ if (ShowDiscountColumn) {
438
+ headersNames[0].splice(Count, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
439
+ headersNames[0].splice(Count + 1, 0, {});
440
+ headersNames[1].splice(Count, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
441
+ headersNames[1].splice(Count + 1, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
442
+ Count = 8;
443
+ }
444
+ if (ShowIGST) {
445
+ headersNames[0].splice(Count, 0, { text: 'IGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
446
+ headersNames[0].splice(Count + 1, 0, {});
447
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'IGSTPerc', type: 'percentage', lineHeight: 0.8 });
448
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'IGSTAmt', type: 'amount', lineHeight: 0.5 });
449
+ } else {
450
+ headersNames[0].splice(Count, 0, { text: 'CGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
451
+ headersNames[0].splice(Count + 1, 0, {});
452
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'CGSTPerc', type: 'percentage', lineHeight: 0.8 });
453
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'CGSTAmt', type: 'amount', lineHeight: 0.7 });
454
+ headersNames[0].splice(Count + 2, 0, { text: 'SGST/UTGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
455
+ headersNames[0].splice(Count + 3, 0, {});
456
+ headersNames[1].splice(Count + 2, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'SGSTPerc', type: 'percentage', lineHeight: 0.8 });
457
+ headersNames[1].splice(Count + 3, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'SGSTAmt', type: 'amount', lineHeight: 0.5 });
458
+ }
459
+ } else {
460
+ headersNames = [[{ text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.6 },
461
+ { text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.6 },
462
+ { text: 'HSN/SAC', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
463
+ { text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.6 },
464
+ { text: 'Unit Price', style: 'tableheader', rowSpan: 2, alignment: 'center', lineHeight: 0.6 },
465
+ { text: 'Line Total', rowSpan: 2, style: 'tableheader', lineHeight: 0.6 }
466
+ ],
467
+ [{ text: '', Field: 'SNo', lineHeight: 0.5 },
468
+ { text: '', Field: 'Desc', lineHeight: 0.5 }, { text: 'HSN/SAC', Field: 'HSN', lineHeight: 0.5 },
469
+ { text: '', Field: 'QtyAndUoM', lineHeight: 0.5 }, { text: 'Unit Price', Field: 'UnPr', Field1: 'UnCo', lineHeight: 0.5 },
470
+ { text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
471
+ ]];
472
+ let Count: number = 5;
473
+ if (ShowDiscountColumn) {
474
+ headersNames[0].splice(Count, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
475
+ headersNames[0].splice(Count + 1, 0, {});
476
+ headersNames[1].splice(Count, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
477
+ headersNames[1].splice(Count + 1, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
478
+ Count = 7;
479
+ }
480
+ if (ShowIGST) {
481
+ headersNames[0].splice(Count, 0, { text: 'IGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
482
+ headersNames[0].splice(Count + 1, 0, {});
483
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'IGSTPerc', type: 'percentage', lineHeight: 0.8 });
484
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'IGSTAmt', type: 'amount', lineHeight: 0.5 });
485
+ } else {
486
+ headersNames[0].splice(Count, 0, { text: 'CGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
487
+ headersNames[0].splice(Count + 1, 0, {});
488
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'CGSTPerc', type: 'percentage', lineHeight: 0.8 });
489
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'CGSTAmt', type: 'amount', lineHeight: 0.5 });
490
+ headersNames[0].splice(Count + 2, 0, { text: 'SGST/UTGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
491
+ headersNames[0].splice(Count + 3, 0, {});
492
+ headersNames[1].splice(Count + 2, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'SGSTPerc', type: 'percentage', lineHeight: 0.8 });
493
+ headersNames[1].splice(Count + 3, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'SGSTAmt', type: 'amount', lineHeight: 0.5 });
494
+ }
495
+ }
496
+ return headersNames;
497
+ }
498
+
499
+ static GetWithOutDiscountFieldHeaderSharedInv(permission: any, Body: any, ShowDiscountColumn: any) {
500
+
501
+ let headersNames: any = [[
502
+ { text: 'Description', style: 'tableheader', alignment: 'center', lineHeight: 0.5, Field: 'Desc' },
503
+ { text: 'HSN/SAC', Field: 'HSN', style: 'tableheader', lineHeight: 1 },
504
+ { text: 'Qty', style: 'tableheader', lineHeight: 0.5, Field: 'QtyAndUoM' },
505
+ { text: 'Unit Price', style: 'tableheader', lineHeight: 0.5, alignment: 'right', Field: 'Shared' },
506
+ { text: 'Taxable Amount', style: 'tableheader', lineHeight: 0.5, alignment: 'right', Field: 'UnPr', Field1: 'UnCo' },
507
+ { text: 'Tax Amount', style: 'tableheader', lineHeight: 0.5, alignment: 'right', Field: 'Tax' },
508
+ { text: 'Line Total', lineHeight: 0.5, style: 'tableheader', Field: 'LineTotal' }
509
+ ]];
510
+ if (permission) {
511
+ let sno = { text: 'S.No.', style: 'tableheader', lineHeight: 0.5, Field: 'SNo' };
512
+ let MPN = { text: 'Part No', style: 'tableheader', lineHeight: 0.5, Field: 'MPN' };
513
+ headersNames[0].unshift(sno, MPN);
514
+ } else {
515
+ let sno = { text: 'S.No.', style: 'tableheader', lineHeight: 0.5, Field: 'SNo' };
516
+ headersNames[0].unshift(sno);
517
+ }
518
+ return headersNames;
519
+ }
520
+
521
+ static GetWithOutDiscountFieldHeader2(permission: any, Body: any, ShowDiscountColumn: any) {
522
+
523
+ let headersNames: any = [[
524
+ { text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.5 },
525
+ { text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.5 },
526
+ { text: 'Unit Price', style: 'tableheader', rowSpan: 2, lineHeight: 0.5, alignment: 'right', },
527
+ { text: 'Line Total', rowSpan: 2, lineHeight: 0.5, style: 'tableheader' }
528
+ ],
529
+ [
530
+ { text: '', Field: 'Desc', lineHeight: 0.5 },
531
+ { text: '', Field: 'QtyAndUoM', lineHeight: 0.5 }, { text: 'Unit Price', Field: 'UnPr', Field1: 'UnCo', lineHeight: 0.5 },
532
+ { text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
533
+ ]];
534
+ if (permission) {
535
+ let sno = { text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 };
536
+ let MPN = { text: 'Part No', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 };
537
+ let sno1 = { text: '', Field: 'SNo', lineHeight: 0.5 };
538
+ let MPN1 = { text: '', Field: 'MPN', lineHeight: 0.5 };
539
+ headersNames[0].unshift(sno, MPN);
540
+ headersNames[1].unshift(sno1, MPN1);
541
+ if (ShowDiscountColumn) {
542
+ headersNames[0].splice(5, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.5 });
543
+ headersNames[0].splice(6, 0, {});
544
+ headersNames[1].splice(5, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
545
+ headersNames[1].splice(6, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
546
+ }
547
+ } else {
548
+ let sno = { text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 };
549
+ let sno1 = { text: '', Field: 'SNo', lineHeight: 0.5 };
550
+ headersNames[0].unshift(sno);
551
+ headersNames[1].unshift(sno1);
552
+ if (ShowDiscountColumn) {
553
+ headersNames[0].splice(4, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.5 });
554
+ headersNames[0].splice(5, 0, {});
555
+ headersNames[1].splice(4, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
556
+ headersNames[1].splice(5, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
557
+ }
558
+ }
559
+ return headersNames;
560
+ }
561
+
562
+ static GetReceiptWithOutDiscountFieldHeader(permission: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ShowDiscountColumn: any) {
563
+ if (Body === 2) {
564
+ let headersNames: any = [{ text: 'Description', style: 'tableheader', Field: 'Desc' },
565
+ { text: 'Qty', style: 'tableheader', Field: 'QtyAndUoM' },
566
+ { text: 'Unit Price', style: 'tableheader', Field: 'UnPr', Field1: 'UnCo' },
567
+ { text: 'Labor Charges', style: 'tableheader', Field: 'Price' },
568
+ { text: 'Tax', style: 'tableheader', Field: 'TaxAmount' },
569
+ { text: 'Line Total', style: 'tableheader', Field: 'LineTotal' }];
570
+ if (permission) {
571
+ let sno = { text: 'S.No.', style: 'tableheader', Field: 'SNo' };
572
+ let MPN = { text: 'Part No', style: 'tableheader', Field: 'MPN' };
573
+ headersNames.unshift(sno, MPN);
574
+ } else {
575
+ let sno = { text: 'S.No.', style: 'tableheader', Field: 'SNo' };
576
+ headersNames.unshift(sno);
577
+ }
578
+ return headersNames;
579
+ } else {
580
+ if (ShowTaxColumn) {
581
+ return this.GetReceiptWithOutDiscountFieldHeader1(permission, Body, ShowIGST, ShowDiscountColumn);
582
+ } else {
583
+ return this.GetReceiptWithOutDiscountFieldHeader2(permission, Body, ShowDiscountColumn);
584
+ }
585
+ }
586
+ }
587
+
588
+ static GetReceiptWithOutDiscountFieldHeader1(permission: any, Body: any, ShowIGST: any, ShowDiscountColumn: any) {
589
+ let headersNames: any;
590
+ if (permission) {
591
+ headersNames = [[{ text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 },
592
+ { text: 'Part No', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 },
593
+ { text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.5 },
594
+ { text: 'HSN/SAC', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
595
+ { text: 'Batch', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.5 },
596
+ { text: 'Exp.Date', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.5 },
597
+ { text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.5 },
598
+ { text: 'Unit Price', style: 'tableheader', rowSpan: 2, lineHeight: 0.5, alignment: 'center', },
599
+ { text: 'Line Total', rowSpan: 2, lineHeight: 0.5, style: 'tabFleheader' }
600
+ ],
601
+ [{ text: '', Field: 'SNo', lineHeight: 0.5 }, { text: '', Field: 'MPN', lineHeight: 0.5 },
602
+ { text: '', Field: 'Desc', lineHeight: 0.5 }, { text: 'HSN/SAC', Field: 'HSN', lineHeight: 0.5 },
603
+ { text: '', lineHeight: 0.5, Field: 'Batch' }, { text: '', Field: 'ExDt', lineHeight: 0.5 },
604
+ { text: '', Field: 'QtyAndUoM', lineHeight: 0.5 }, { text: 'Unit Price', Field: 'UnPr', Field1: 'UnCo', lineHeight: 0.5 },
605
+ { text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
606
+ ]
607
+ ];
608
+ let Count: number = 8;
609
+ if (ShowDiscountColumn) {
610
+ headersNames[0].splice(Count, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
611
+ headersNames[0].splice(Count + 1, 0, {});
612
+ headersNames[1].splice(Count, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
613
+ headersNames[1].splice(Count + 1, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
614
+ Count = 10;
615
+ }
616
+ if (ShowIGST) {
617
+ headersNames[0].splice(Count, 0, { text: 'IGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
618
+ headersNames[0].splice(Count + 1, 0, {});
619
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'IGSTPerc', type: 'percentage', lineHeight: 0.8 });
620
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'IGSTAmt', type: 'amount', lineHeight: 0.5 });
621
+ } else {
622
+ headersNames[0].splice(Count, 0, { text: 'CGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
623
+ headersNames[0].splice(Count + 1, 0, {});
624
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'CGSTPerc', type: 'percentage', lineHeight: 0.8 });
625
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'CGSTAmt', type: 'amount', lineHeight: 0.7 });
626
+ headersNames[0].splice(Count + 2, 0, { text: 'SGST/UTGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
627
+ headersNames[0].splice(Count + 3, 0, {});
628
+ headersNames[1].splice(Count + 2, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'SGSTPerc', type: 'percentage', lineHeight: 0.8 });
629
+ headersNames[1].splice(Count + 3, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'SGSTAmt', type: 'amount', lineHeight: 0.5 });
630
+ }
631
+ } else {
632
+ headersNames = [[{ text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.6 },
633
+ { text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.6 },
634
+ { text: 'HSN/SAC', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
635
+ { text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.6 },
636
+ { text: 'Unit Price', style: 'tableheader', rowSpan: 2, alignment: 'center', lineHeight: 0.6 },
637
+ { text: 'Line Total', rowSpan: 2, style: 'tableheader', lineHeight: 0.6 }
638
+ ],
639
+ [{ text: '', Field: 'SNo', lineHeight: 0.5 },
640
+ { text: '', Field: 'Desc', lineHeight: 0.5 }, { text: 'HSN/SAC', Field: 'HSN', lineHeight: 0.5 },
641
+ { text: '', Field: 'QtyAndUoM', lineHeight: 0.5 }, { text: 'Unit Price', Field: 'UnPr', Field1: 'UnCo', lineHeight: 0.5 },
642
+ { text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
643
+ ]];
644
+ let Count: number = 7;
645
+ if (ShowDiscountColumn) {
646
+ headersNames[0].splice(Count, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
647
+ headersNames[0].splice(Count + 1, 0, {});
648
+ headersNames[1].splice(Count, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
649
+ headersNames[1].splice(Count + 1, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
650
+ Count = 9;
651
+ }
652
+ if (ShowIGST) {
653
+ headersNames[0].splice(Count, 0, { text: 'IGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
654
+ headersNames[0].splice(Count + 1, 0, {});
655
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'IGSTPerc', type: 'percentage', lineHeight: 0.8 });
656
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'IGSTAmt', type: 'amount', lineHeight: 0.5 });
657
+ } else {
658
+ headersNames[0].splice(Count, 0, { text: 'CGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
659
+ headersNames[0].splice(Count + 1, 0, {});
660
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'CGSTPerc', type: 'percentage', lineHeight: 0.8 });
661
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'CGSTAmt', type: 'amount', lineHeight: 0.5 });
662
+ headersNames[0].splice(Count + 2, 0, { text: 'SGST/UTGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
663
+ headersNames[0].splice(Count + 3, 0, {});
664
+ headersNames[1].splice(Count + 2, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'SGSTPerc', type: 'percentage', lineHeight: 0.8 });
665
+ headersNames[1].splice(Count + 3, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'SGSTAmt', type: 'amount', lineHeight: 0.5 });
666
+ }
667
+ }
668
+ return headersNames;
669
+ }
670
+
671
+ static GetReceiptWithOutDiscountFieldHeader2(permission: any, Body: any, ShowDiscountColumn: any) {
672
+
673
+ let headersNames: any = [[
674
+ { text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.5 },
675
+ { text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.5 },
676
+ { text: 'Unit Price', style: 'tableheader', rowSpan: 2, lineHeight: 0.5, alignment: 'right', },
677
+ { text: 'Line Total', rowSpan: 2, lineHeight: 0.5, style: 'tableheader' }
678
+ ],
679
+ [
680
+ { text: '', Field: 'Desc', lineHeight: 0.5 },
681
+ { text: '', Field: 'QtyAndUoM', lineHeight: 0.5 }, { text: 'Unit Price', Field: 'UnPr', Field1: 'UnCo', lineHeight: 0.5 },
682
+ { text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
683
+ ]];
684
+ if (permission) {
685
+ let sno = { text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 };
686
+ let MPN = { text: 'Part No', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 };
687
+ let sno1 = { text: '', Field: 'SNo', lineHeight: 0.5 };
688
+ let MPN1 = { text: '', Field: 'MPN', lineHeight: 0.5 };
689
+ headersNames[0].unshift(sno, MPN);
690
+ headersNames[1].unshift(sno1, MPN1);
691
+ if (ShowDiscountColumn) {
692
+ headersNames[0].splice(5, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.5 });
693
+ headersNames[0].splice(6, 0, {});
694
+ headersNames[1].splice(5, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
695
+ headersNames[1].splice(6, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
696
+ }
697
+ } else {
698
+ let sno = { text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 };
699
+ let sno1 = { text: '', Field: 'SNo', lineHeight: 0.5 };
700
+ headersNames[0].unshift(sno);
701
+ headersNames[1].unshift(sno1);
702
+ if (ShowDiscountColumn) {
703
+ headersNames[0].splice(4, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.5 });
704
+ headersNames[0].splice(5, 0, {});
705
+ headersNames[1].splice(4, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
706
+ headersNames[1].splice(5, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
707
+ }
708
+ }
709
+ return headersNames;
710
+ }
711
+
712
+ static TaxReceiptTableWidths(PrintPartNo: any, ShowIGST: any, ShowDiscountColumn: any) {
713
+ // console.log(PrintPartNo, ShowIGST, ShowDiscountColumn);
714
+ if (PrintPartNo) {
715
+ if (ShowIGST) {
716
+ if (ShowDiscountColumn) {
717
+ return [24, 50, 160, 37, 50, 30, 25, 40, 17, 33, 17, 33, 45];
718
+ } else {
719
+ return [24, 50, 222, 37, 25, 40, 17, 35, 51, 50, 50];
720
+ }
721
+ } else {
722
+ if (ShowDiscountColumn) {
723
+ return [24, 45, 100, 35, 50, 30, 22, 40, 17, 34, 17, 32, 17, 32, 48,];
724
+ } else {
725
+ return [20, 40, 90, 35, 50, 38, 22, 40, 17, 32, 17, 32, 36];
726
+ }
727
+ }
728
+ } else {
729
+ if (ShowIGST) {
730
+ if (ShowDiscountColumn) {
731
+ return [24, 215, 40, 25, 40, 17, 35, 17, 35, 41, 50, 50];
732
+ } else {
733
+ return [24, 270, 40, 25, 40, 20, 40, 50, 50, 50];
734
+ }
735
+ } else {
736
+ if (ShowDiscountColumn) {
737
+ return [24, 155, 35, 22, 40, 17, 34, 17, 32, 17, 32, 45, 50, 50];
738
+ } else {
739
+ return [24, 216, 35, 22, 40, 17, 32, 17, 32, 50, 50, 50];
740
+ }
741
+ }
742
+ }
743
+ }
744
+
745
+ static TaxTableWidths(PrintPartNo: any, ShowIGST: any, ShowDiscountColumn: any) {
746
+ if (PrintPartNo) {
747
+ if (ShowIGST) {
748
+ if (ShowDiscountColumn) {
749
+ return [24, 50, 158, 35, 25, 40, 17, 35, 17, 35, 45];
750
+ } else {
751
+ return [24, 50, 222, 37, 25, 40, 17, 35, 51];
752
+ }
753
+ } else {
754
+ if (ShowDiscountColumn) {
755
+ return [24, 45, 100, 35, 22, 40, 17, 34, 17, 32, 17, 32, 48];
756
+ } else {
757
+ return [24, 50, 150, 40, 22, 40, 17, 32, 17, 32, 54];
758
+ }
759
+ }
760
+ } else {
761
+ if (ShowIGST) {
762
+ if (ShowDiscountColumn) {
763
+ return [24, 215, 40, 25, 40, 17, 35, 17, 35, 41];
764
+ } else {
765
+ return [24, 270, 40, 25, 40, 20, 40, 50];
766
+ }
767
+ } else {
768
+ if (ShowDiscountColumn) {
769
+ return [24, '*', 40, 30, 40, 17, 34, 17, 35, 17, 35, 45];
770
+ } else {
771
+ return [24, '*', 45, 30, 40, 17, 35, 17, 35, 50];
772
+ }
773
+ }
774
+ }
775
+ }
776
+
777
+ static WidthForInsuranceOrNot(ShowDiscountColumn: any, PrintPartNo: boolean) {
778
+ if (PrintPartNo) {
779
+ if (ShowDiscountColumn) {
780
+ return [24, 70, 200, 25, 60, 38, 38, 50];
781
+ } else {
782
+ return [25, 70, 250, 35, 60, 80];
783
+ }
784
+ } else {
785
+ if (ShowDiscountColumn) {
786
+ return [25, 210, 40, 75, 40, 40, 80];
787
+ } else {
788
+ return [25, 308, 52, 65, 80];
789
+ }
790
+ }
791
+
792
+ }
793
+
794
+ static LayOutStyle1() {
795
+ return {
796
+ hLineWidth: function (i: any, node: any) {
797
+ return (i === 0 || i === node.table.body.length) ? 0.7 : 0.7;
798
+ },
799
+ vLineWidth: function (i: any, node: any) {
800
+ return (i === 0 || i === node.table.widths.length) ? 0.7 : 0.7;
801
+ },
802
+ hLineColor: function (i: any, node: any) {
803
+ let color;
804
+ if (i === 0 || i === node.table.body.length) {
805
+ color = 'grey';
806
+ } else {
807
+ if (i === 1 || i === 2) {
808
+ color = 'gray';
809
+ } else {
810
+ color = '#f8f8f8';
811
+ }
812
+ }
813
+
814
+ return color;
815
+ },
816
+ vLineColor: function (i: any, node: any) {
817
+ let color;
818
+ if (i === 0 || i === node.table.widths.length) {
819
+ color = 'grey';
820
+ } else {
821
+ color = 'lightgrey';
822
+ }
823
+ return color;
824
+ },
825
+ };
826
+ }
827
+
828
+ static LayOutStyle() {
829
+ return {
830
+ hLineWidth: function (i: any, node: any) {
831
+ return (i === 0 || i === node.table.body.length) ? 0.7 : 0.7;
832
+ },
833
+ vLineWidth: function (i: any, node: any) {
834
+ return (i === 0 || i === node.table.widths.length) ? 0.7 : 0.7;
835
+ },
836
+ hLineColor: function (i: any, node: any) {
837
+ let color;
838
+ if (i === 0 || i === node.table.body.length) {
839
+ color = 'black';
840
+ } else {
841
+ if (i === 1) {
842
+ color = 'gray';
843
+ } else {
844
+ color = 'lightgray';
845
+ }
846
+ }
847
+
848
+ return color;
849
+ },
850
+ vLineColor: function (i: any, node: any) {
851
+ let color;
852
+ if (i === 0 || i === node.table.widths.length) {
853
+ color = 'black';
854
+ } else {
855
+ color = 'lightgray';
856
+ }
857
+ return color;
858
+ },
859
+ };
860
+ }
861
+
862
+ static LayOutStyleanother() {
863
+ return {
864
+ hLineWidth: function (i: any, node: any) {
865
+ return (i === 0 || i === 1 || i === 2 || i === node.table.body.length) ? 0.7 : 0.7;
866
+ },
867
+ vLineWidth: function (i: any, node: any) {
868
+ return (i === 0 || i === node.table.widths.length) ? 0.7 : 0.7;
869
+ },
870
+ hLineColor: function (i: any, node: any) {
871
+ return (i === 0 || i === node.table.body.length) ? 'black' : 'gray';
872
+ },
873
+ vLineColor: function (i: any, node: any) {
874
+ return (i === 0 || i === node.table.widths.length) ? 'black' : 'gray';
875
+ }
876
+ };
877
+ }
878
+
879
+ }