shareneus 1.0.5

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