shareneus 1.4.38 → 1.4.40

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