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.
- package/dist/aggregation/aggregation.js +60 -0
- package/dist/enums/cache-enums.js +37 -0
- package/dist/enums/code-enums.js +288 -0
- package/dist/enums/enums.js +362 -0
- package/dist/enums/industry-enums.js +24 -0
- package/dist/excel-files/GSTR-RO-excel.service.js +935 -0
- package/dist/excel-files/GSTR1-excel.service.js +295 -0
- package/dist/excel-files/GSTR2-excel.service.js +295 -0
- package/dist/excel-files/analysis-excel.service.js +297 -0
- package/dist/excel-files/category-wise-item-excel.service.js +274 -0
- package/dist/excel-files/cust-balance-excel.service.js +287 -0
- package/dist/excel-files/cust-wise-sales-details.js +320 -0
- package/dist/excel-files/cust-wise-sales-summary-excel.service.js +302 -0
- package/dist/excel-files/expiring-drugs-excel.service.js +292 -0
- package/dist/excel-files/insurance-expire-excel.service.js +301 -0
- package/dist/excel-files/invoice-wise-excel.service.js +857 -0
- package/dist/excel-files/item-wise-doctor-sale-excel.service.js +258 -0
- package/dist/excel-files/item-wise-mout-details.js +292 -0
- package/dist/excel-files/item-wise-mout-summary.js +286 -0
- package/dist/excel-files/items-wise-sales-excel.service.js +314 -0
- package/dist/excel-files/manf-wise-sales-excel.service.js +276 -0
- package/dist/excel-files/operator-wise-details.js +265 -0
- package/dist/excel-files/operator-wise-summary.js +266 -0
- package/dist/excel-files/payment-receive-excel.service.js +225 -0
- package/dist/excel-files/payments-made-excel.service.js +302 -0
- package/dist/excel-files/repair-orders-excel.service.js +255 -0
- package/dist/excel-files/sa-wise-labor-sales-excel.service.js +232 -0
- package/dist/excel-files/sa-wise-part-sales-excel.service.js +232 -0
- package/dist/excel-files/sale-summary-excel.service.js +326 -0
- package/dist/excel-files/sales-by-service-details-excel.service.js +1 -0
- package/dist/excel-files/sales-by-service-summary-excel.service.js +422 -0
- package/dist/excel-files/scheduled-drug-summary-excel.service.js +367 -0
- package/dist/excel-files/scheduled-drugs-excel.service.js +366 -0
- package/dist/excel-files/spares-issue-excel.service.js +492 -0
- package/dist/excel-files/stock-excel.service.js +283 -0
- package/dist/excel-files/tally-sales-import.service.js +765 -0
- package/dist/excel-files/ven-balance-excel.service.js +293 -0
- package/dist/index.js +237 -0
- package/dist/services/analysis-pdf.service.js +105 -0
- package/dist/services/appointment-total.service.js +253 -0
- package/dist/services/auto-sales-receipt-pdf.service.js +539 -0
- package/dist/services/category-wise-item-pdf.service.js +98 -0
- package/dist/services/checklist-pdf.js +140 -0
- package/dist/services/checklists-pdf.js +124 -0
- package/dist/services/cn-print.service.js +211 -0
- package/dist/services/consultation-fee-receipt.service.js +378 -0
- package/dist/services/consultation-full-pdf.service.js +220 -0
- package/dist/services/consultation-pdf.service.js +360 -0
- package/dist/services/credit-note-pdf.service.js +578 -0
- package/dist/services/credit-note-totals.service.js +328 -0
- package/dist/services/cust-wise-sales-details-pdf.service.js +118 -0
- package/dist/services/cust-wise-sales-summary-pdf.service.js +111 -0
- package/dist/services/customer-balances-pdf.service.js +169 -0
- package/dist/services/dc-landscape-pdf.service.js +903 -0
- package/dist/services/dc-landscape-without-price-pdf.service.js +853 -0
- package/dist/services/dc-without-price-pdf.service.js +489 -0
- package/dist/services/debit-note-pdf.service.js +673 -0
- package/dist/services/debit-note-print.service.js +234 -0
- package/dist/services/debit-note-totals.service.js +293 -0
- package/dist/services/delivery-challan-pdf.service.js +434 -0
- package/dist/services/delivery-challan-print.service.js +177 -0
- package/dist/services/delivery-challan-totals.js +339 -0
- package/dist/services/equipment-design-pdf.service.js +144 -0
- package/dist/services/est.print-service.js +1053 -0
- package/dist/services/expiring-drugs-pdf.service.js +156 -0
- package/dist/services/hc-inv-pdf.service.js +837 -0
- package/dist/services/insurance-expire-pdf.service.js +99 -0
- package/dist/services/inv-pdf.service.js +785 -0
- package/dist/services/inv-print.service.js +415 -0
- package/dist/services/invoice-landscape-pdf.service.js +909 -0
- package/dist/services/invoice-total.service.js +659 -0
- package/dist/services/issue-parts-pdf.service.js +763 -0
- package/dist/services/item-detais-pdf.js +136 -0
- package/dist/services/item-wise-doctor-sale-pdf.service.js +164 -0
- package/dist/services/item-wise-mout-details-pdf.js +107 -0
- package/dist/services/item-wise-mout-summary-pdf.js +99 -0
- package/dist/services/item-wise-sales-pdf.service.js +178 -0
- package/dist/services/manf-wise-sales-pdf.service.js +173 -0
- package/dist/services/meeting-pdf.js +369 -0
- package/dist/services/mout-pdf.service.js +503 -0
- package/dist/services/operator-wise-details-pdf.service.js +103 -0
- package/dist/services/operator-wise-summary-pdf.js +101 -0
- package/dist/services/pack-ship-pdf.service.js +105 -0
- package/dist/services/pack-ship-print.service.js +167 -0
- package/dist/services/payment-pdf.service.js +373 -0
- package/dist/services/payment-report-pdf.service.js +106 -0
- package/dist/services/po-totals.service.js +279 -0
- package/dist/services/pos-receipt-pdf.js +438 -0
- package/dist/services/purchase-order-pdf.service.js +924 -0
- package/dist/services/purchase-order-print.service.js +150 -0
- package/dist/services/purchase-order-totals.service.js +280 -0
- package/dist/services/receipt-print.service.js +50 -0
- package/dist/services/reorder-point-pdf.service.js +151 -0
- package/dist/services/repair-orders-pdf.service.js +172 -0
- package/dist/services/ro-pdf.service.js +1764 -0
- package/dist/services/ro-print-service.js +737 -0
- package/dist/services/ro-totals.service.js +1241 -0
- package/dist/services/sales-by-service-pdf.service.js +116 -0
- package/dist/services/sales-pdf.service.js +630 -0
- package/dist/services/sales-print.service.js +305 -0
- package/dist/services/sales-receipt-pdf.service.js +611 -0
- package/dist/services/sales-receipt-print.service.js +425 -0
- package/dist/services/sales-totals.service.js +339 -0
- package/dist/services/scheduled-drug-pdf.service.js +176 -0
- package/dist/services/scheduled-drug-summary-pdf.service.js +188 -0
- package/dist/services/separate-wo-print.service.js +351 -0
- package/dist/services/shared-inv-pdf.service.js +763 -0
- package/dist/services/shared-pdf.service.js +2569 -0
- package/dist/services/shared-print.service.js +885 -0
- package/dist/services/task-pdf.service.js +220 -0
- package/dist/services/task-reports-pdf.service.js +296 -0
- package/dist/services/technician-pdf.service.js +238 -0
- package/dist/services/technician-print.service.js +87 -0
- package/dist/services/transfer-order-pdf.service.js +139 -0
- package/dist/services/vendor-balances-pdf.service.js +101 -0
- package/dist/services/vendor-credit-note-pdf.service.js +1007 -0
- package/dist/services/vendor-credit-note-print.service.js +104 -0
- package/dist/services/vendor-credit-note-totals.service.js +327 -0
- package/dist/services/vendor-debit-note-pdf.service.js +561 -0
- package/dist/services/vendor-debit-note-print.service.js +245 -0
- package/dist/services/vendor-debit-note-totals.service.js +305 -0
- package/dist/utils/my-date.js +652 -0
- package/dist/utils/tr-utils.js +354 -0
- package/package.json +24 -0
- package/tsconfig.json +109 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ItemDetaisPdf = void 0;
|
|
7
|
+
const jsbarcode_1 = __importDefault(require("jsbarcode"));
|
|
8
|
+
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
9
|
+
class ItemDetaisPdf {
|
|
10
|
+
static ItemDetailsPrint(Item, win, custom, txt) {
|
|
11
|
+
let dd = {
|
|
12
|
+
background: function (currentPage, pageSize) {
|
|
13
|
+
if (custom) {
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
canvas: [
|
|
17
|
+
{ type: 'line', x1: 5, y1: 5, x2: 385, y2: 5, lineWidth: 1 }, //Up line
|
|
18
|
+
{ type: 'line', x1: 5, y1: 5, x2: 5, y2: 560, lineWidth: 1 }, //Left line
|
|
19
|
+
{ type: 'line', x1: 5, y1: 560, x2: 385, y2: 560, lineWidth: 1 }, //Bottom line
|
|
20
|
+
{ type: 'line', x1: 385, y1: 5, x2: 385, y2: 560, lineWidth: 1 }, //Rigth line
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return [
|
|
27
|
+
{
|
|
28
|
+
canvas: [
|
|
29
|
+
{ type: 'line', x1: 5, y1: 5, x2: 272, y2: 5, lineWidth: 1 }, //Up line
|
|
30
|
+
{ type: 'line', x1: 5, y1: 5, x2: 5, y2: 420, lineWidth: 1 }, //Left line
|
|
31
|
+
{ type: 'line', x1: 5, y1: 420, x2: 272, y2: 420, lineWidth: 1 }, //Bottom line
|
|
32
|
+
{ type: 'line', x1: 272, y1: 5, x2: 272, y2: 420, lineWidth: 1 }, //Rigth line
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
info: {
|
|
39
|
+
title: 'ItemDetails',
|
|
40
|
+
},
|
|
41
|
+
header: function (currentPage, pageCount) {
|
|
42
|
+
return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
|
|
43
|
+
},
|
|
44
|
+
footer: {
|
|
45
|
+
columns: [
|
|
46
|
+
{
|
|
47
|
+
text: Item.Entity.CName, bold: 'true'
|
|
48
|
+
},
|
|
49
|
+
{ text: Item.Entity.CName, alignment: 'right' }
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
// pageMargins: [10, 15, 10, 15],
|
|
53
|
+
pageMargins: [10, 10, 10, 10],
|
|
54
|
+
pageSize: custom ? 'B7' : {
|
|
55
|
+
width: 277,
|
|
56
|
+
height: 435
|
|
57
|
+
},
|
|
58
|
+
content: [
|
|
59
|
+
// SharedPDFService.MainHeading(CheckListData.Entity.CName, CheckListData.Entity.Header, CheckListData.Image, CheckListData.HColor, null),
|
|
60
|
+
shared_pdf_service_1.SharedPDFService.MainHeading(Item.Entity.CName, Item.Entity, Image, Item.AColor, null),
|
|
61
|
+
shared_pdf_service_1.SharedPDFService.GetHeader(Item.Entity, Item.HColor),
|
|
62
|
+
// SharedPDFService.GetPrintType('INSPECTION'),
|
|
63
|
+
// SharedPDFService.HeaderAfterLine(),
|
|
64
|
+
this.ChangeTableFormat(Item.Item, custom, txt),
|
|
65
|
+
// this.TableCreation(Item.Item),
|
|
66
|
+
// this.CheckListTable(CheckListData.Sections)
|
|
67
|
+
],
|
|
68
|
+
styles: shared_pdf_service_1.SharedPDFService.GetStyles()
|
|
69
|
+
};
|
|
70
|
+
// return dd;
|
|
71
|
+
pdfMake.createPdf(dd).open();
|
|
72
|
+
// this.PrintFile = TrUtils.Stringify(dd);
|
|
73
|
+
// pdfMake.createPdf(dd).getDataUrl((DataURL: any) => {
|
|
74
|
+
// document.getElementById('pdf').setAttribute('src', DataURL);
|
|
75
|
+
// });
|
|
76
|
+
}
|
|
77
|
+
static ChangeTableFormat(Item, custom, txt) {
|
|
78
|
+
if (txt === 'New') {
|
|
79
|
+
return [{ image: this.textToBase64Barcode(Item.MPN, custom), alignment: 'center' },
|
|
80
|
+
{
|
|
81
|
+
alignment: 'center',
|
|
82
|
+
marginTop: 10,
|
|
83
|
+
columns: [{ text: 'GSM : ' + Item.GSM, bold: true, marginTop: 25 }, { stack: [{ text: 'QC : Ok', bold: true, lineHeight: 1.7 }, { text: 'Mil : ' + Item.Mil, bold: true }] }]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
alignment: 'center',
|
|
87
|
+
marginTop: 10,
|
|
88
|
+
stack: [{ text: 'SIZE(mm) : ' + Item.Size, bold: true, lineHeight: 1.7 },
|
|
89
|
+
{ text: 'GROSS Wt(kg) : ' + Item.GWt, bold: true, lineHeight: 1.7 },
|
|
90
|
+
{ text: 'Net Wt(kg) : ' + Item.NWt, bold: true, lineHeight: 1.7 },
|
|
91
|
+
{ text: 'No.of Joins : 2', bold: true, lineHeight: 1.7 }
|
|
92
|
+
]
|
|
93
|
+
}];
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return {
|
|
97
|
+
stack: [{ image: this.textToBase64Barcode(Item.MPN, custom), alignment: 'center' }, {
|
|
98
|
+
style: 'tableExample',
|
|
99
|
+
marginLeft: custom ? 110 : 137,
|
|
100
|
+
marginTop: 20,
|
|
101
|
+
table: {
|
|
102
|
+
marginTop: 10,
|
|
103
|
+
widths: [50, 50],
|
|
104
|
+
body: [[{ text: 'QC', lineHeight: 2 }, { text: '' }]]
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
this.TableCreation(Item)
|
|
108
|
+
]
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
static TableCreation(Item) {
|
|
113
|
+
return {
|
|
114
|
+
style: 'tableExample',
|
|
115
|
+
// marginRight: 5,
|
|
116
|
+
table: {
|
|
117
|
+
widths: ['auto', '*', '*', '*'],
|
|
118
|
+
body: [
|
|
119
|
+
[{ text: 'GSM', lineHeight: 2 }, { text: Item.GSM }, { text: 'Mil' }, { text: Item.Mil }],
|
|
120
|
+
[{ text: 'Item Desc', lineHeight: 2 }, { text: Item.Desc, colSpan: 3 }, {}, {}],
|
|
121
|
+
// [{ text: 'Bar Code' }, { image: this.textToBase64Barcode(Item.MPN), colSpan: 3 }, {}, {}],
|
|
122
|
+
[{ text: 'SIZE(mm)', lineHeight: 2 }, { text: Item.Size, colSpan: 3 }, {}, {}],
|
|
123
|
+
[{ text: 'Gross Wt(Kg)', lineHeight: 2 }, { text: Item.GWt, colSpan: 3 }, {}, {}],
|
|
124
|
+
[{ text: 'Net Wt (Kg)', lineHeight: 2 }, { text: Item.NWt, colSpan: 3 }, {}, {}],
|
|
125
|
+
[{ text: 'No.of Joints', lineHeight: 2 }, { text: '', colSpan: 3 }, {}, {}],
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
static textToBase64Barcode(text, custom) {
|
|
131
|
+
var canvas = document.createElement("canvas");
|
|
132
|
+
(0, jsbarcode_1.default)(canvas, text, { displayValue: true, height: 40, width: 1 });
|
|
133
|
+
return canvas.toDataURL("image/png");
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.ItemDetaisPdf = ItemDetaisPdf;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ItemWiseDoctorSalePDFService = void 0;
|
|
4
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
5
|
+
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
6
|
+
class ItemWiseDoctorSalePDFService {
|
|
7
|
+
static GetItemWiseDoctorSalePrint(InvoicesData, CName, searchValue) {
|
|
8
|
+
var dd = {
|
|
9
|
+
info: {
|
|
10
|
+
title: 'ItemWiseDoctorSale',
|
|
11
|
+
},
|
|
12
|
+
header: function (currentPage, pageCount) {
|
|
13
|
+
return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
|
|
14
|
+
},
|
|
15
|
+
pageMargins: [10, 15, 10, 15],
|
|
16
|
+
content: [
|
|
17
|
+
{ text: '' + CName + '', style: ['header'] },
|
|
18
|
+
{ text: 'Item Wise Doctor Sale', alignment: 'center', fontSize: 15, bold: true },
|
|
19
|
+
// { text: 'As of ' + MyDate.ConvertUTCDateToReadable(MyDate.GetDateTimeNowInUTC()), alignment: 'center', fontSize: 10 },
|
|
20
|
+
// SharedPDFService.HeaderAfterLine(),
|
|
21
|
+
shared_pdf_service_1.SharedPDFService.GetSearchValueDetails(searchValue),
|
|
22
|
+
this.GetInvoiceDataTable(InvoicesData),
|
|
23
|
+
],
|
|
24
|
+
styles: shared_pdf_service_1.SharedPDFService.GetStyles()
|
|
25
|
+
};
|
|
26
|
+
return dd;
|
|
27
|
+
}
|
|
28
|
+
static GetInvoiceDataTable(InvoicesData) {
|
|
29
|
+
let Data = [];
|
|
30
|
+
// InvoicesData.forEach((invoice: any) => {
|
|
31
|
+
Data.push(this.GetItemsTable(InvoicesData));
|
|
32
|
+
// });
|
|
33
|
+
return Data;
|
|
34
|
+
}
|
|
35
|
+
static getTableWidths() {
|
|
36
|
+
// if (isHC) {
|
|
37
|
+
// return [25, '*', '*', '*', '*'];
|
|
38
|
+
// } else {
|
|
39
|
+
return [25, '*', '*', '*', '*'];
|
|
40
|
+
// }
|
|
41
|
+
}
|
|
42
|
+
static GetItemsTable(InvoiceData) {
|
|
43
|
+
// InvoicesData.forEach((InvoiceData: any) => {
|
|
44
|
+
return {
|
|
45
|
+
style: 'tableExample',
|
|
46
|
+
marginTop: 3,
|
|
47
|
+
marginBottom: 5,
|
|
48
|
+
table: {
|
|
49
|
+
widths: this.getTableWidths(),
|
|
50
|
+
headerRows: 1,
|
|
51
|
+
body: this.BuildTableBodyForLaborAndParts(InvoiceData)
|
|
52
|
+
// body:[['fsdfsdf','asfafdas','asdasdas','asdasdasd','asddass']]
|
|
53
|
+
},
|
|
54
|
+
layout: {
|
|
55
|
+
hLineWidth: function (i, node) {
|
|
56
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0.5;
|
|
57
|
+
},
|
|
58
|
+
vLineWidth: function (i, node) {
|
|
59
|
+
return (i === 0 || i === node.table.widths.length) ? 1 : 0.5;
|
|
60
|
+
},
|
|
61
|
+
// hLineStyle: function (i, node) {
|
|
62
|
+
// return (i === 0 || i === 1) ? { dash: { length: 5, space: 5 } } : null;
|
|
63
|
+
// },
|
|
64
|
+
hLineColor: function (i, node) {
|
|
65
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 'gray' : 'lightgrey';
|
|
66
|
+
},
|
|
67
|
+
vLineColor: function (i, node) {
|
|
68
|
+
return 'gray';
|
|
69
|
+
},
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
// });
|
|
73
|
+
}
|
|
74
|
+
static BuildTableBodyForLaborAndParts(InvoiceData) {
|
|
75
|
+
let body = this.GetHeaderNames();
|
|
76
|
+
// let Row: any = [{ text: InvoiceData.Name, alignment: 'left', colSpan: isHC ? 5 : 8, bold: true, fontSize: 12 }, {}, {}, {}, {}];
|
|
77
|
+
// if (!isHC) {
|
|
78
|
+
// Row.push({});
|
|
79
|
+
// Row.push({});
|
|
80
|
+
// Row.push({});
|
|
81
|
+
// }
|
|
82
|
+
// body.unshift(Row);
|
|
83
|
+
// InvoicesData.forEach((InvoiceData: any) => {
|
|
84
|
+
InvoiceData.forEach((invoice, index) => {
|
|
85
|
+
let dataRow = [];
|
|
86
|
+
// if (isHC) {
|
|
87
|
+
// dataRow.push({ text: index + 1 });
|
|
88
|
+
// dataRow.push({ text: invoice.Code });
|
|
89
|
+
// if (!isHC) {
|
|
90
|
+
// dataRow.push({ text: invoice.Prod?.RegNo });
|
|
91
|
+
// dataRow.push({ text: TrUtils.IsNull(invoice.Prod) ? '' : invoice.Prod?.Model + ' ' + invoice.Prod?.Var });
|
|
92
|
+
// }
|
|
93
|
+
// // dataRow.push({ text: invoice.BFrom.Name, alignment: 'left', style: ['headerstyle'], });
|
|
94
|
+
// dataRow.push({ text: MyDate.ConvertUTCDateToReadable(invoice.CrDate), alignment: 'center', style: ['headerstyle'], });
|
|
95
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Total), alignment: 'right', style: ['headerstyle'], });
|
|
96
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Due), alignment: 'right', style: ['headerstyle'], });
|
|
97
|
+
// body.push(dataRow);
|
|
98
|
+
// if (InvoiceData.Invoices.length === (index + 1)) {
|
|
99
|
+
// let Row: any = [{ text: 'Total Due ', alignment: 'right', colSpan: isHC ? 4 : 6, bold: true, fontSize: 9 }, {}, {}, {}, { text: TrUtils.FixPriceValue(InvoiceData.Balance), fontSize: 9, alignment: 'right', bold: true }];
|
|
100
|
+
// if (!isHC) {
|
|
101
|
+
// Row.splice(2, 0, {}, {});
|
|
102
|
+
// // Row.push({});
|
|
103
|
+
// }
|
|
104
|
+
// body.push(Row);
|
|
105
|
+
// }
|
|
106
|
+
// } else {
|
|
107
|
+
dataRow.push({ text: index + 1 });
|
|
108
|
+
dataRow.push({ text: invoice.Name });
|
|
109
|
+
dataRow.push({ text: invoice.Count });
|
|
110
|
+
// if(!isHC){
|
|
111
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Qty), alignment: 'right' });
|
|
112
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.AvgPr), alignment: 'right' });
|
|
113
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Total), alignment: 'right' });
|
|
114
|
+
// dataRow.push({ text: TrUtils.IsNull(invoice.Prod) ? '' : invoice.Prod?.Model + ' ' + invoice.Prod?.Var });
|
|
115
|
+
// }
|
|
116
|
+
// dataRow.push({ text: invoice.BFrom.Name, alignment: 'left', style: ['headerstyle'], });
|
|
117
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.UnAmt + invoice.Tax), alignment: 'right', style: ['headerstyle'], });
|
|
118
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Due), alignment: 'right', style: ['headerstyle'], });
|
|
119
|
+
body.push(dataRow);
|
|
120
|
+
// if (InvoiceData.Invoices.length === (index + 1)) {
|
|
121
|
+
// let Row: any = [{ text: 'Total Due ', alignment: 'right', colSpan: isHC?4:6, bold: true, fontSize: 9 }, {}, {}, {}, { text: TrUtils.FixPriceValue(InvoiceData.Balance), fontSize: 9, alignment: 'right', bold: true }];
|
|
122
|
+
// if(!isHC){
|
|
123
|
+
// Row.splice(2, 0,{},{});
|
|
124
|
+
// // Row.push({});
|
|
125
|
+
// }
|
|
126
|
+
// body.push(Row);
|
|
127
|
+
// }
|
|
128
|
+
// }
|
|
129
|
+
});
|
|
130
|
+
// });
|
|
131
|
+
return body;
|
|
132
|
+
}
|
|
133
|
+
static GetHeaderNames() {
|
|
134
|
+
let HeadingNames;
|
|
135
|
+
// if (isHC) {
|
|
136
|
+
// HeadingNames = [[{ text: 'S.No', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
|
|
137
|
+
// { text: isPhar ? 'Counter Sale Number' : 'Invoice Number', style: 'tableheader1', Field: 'BNo', alignment: 'left' },
|
|
138
|
+
// { text: 'Create Date', style: 'tableheader1', Field: 'CrDate' },
|
|
139
|
+
// { text: 'Total', style: 'tableheader1', Field: 'Total', alignment: 'right' },
|
|
140
|
+
// { text: 'Due', style: 'tableheader1', Field: 'Due', alignment: 'right' }]];
|
|
141
|
+
// if (!isHC) {
|
|
142
|
+
// HeadingNames[0].splice(2, 0, { text: 'Reg No', style: 'tableheader1', Field: 'Reg No', alignment: 'left' }
|
|
143
|
+
// , { text: 'Vehicle', style: 'tableheader1', Field: 'Vehicle', alignment: 'left' });
|
|
144
|
+
// // HeadingNames.splice(3, 0, { text: 'Vehicle', style: 'tableheader1', Field: 'Vehicle', alignment: 'left' });
|
|
145
|
+
// }
|
|
146
|
+
// } else {
|
|
147
|
+
HeadingNames = [[{ text: 'S.No', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
|
|
148
|
+
{ text: 'Item Name', style: 'tableheader1', Field: 'Desc' },
|
|
149
|
+
{ text: 'No. of Transactions', style: 'tableheader1', Field: 'Batch' },
|
|
150
|
+
{ text: 'Quantity', style: 'tableheader1', Field: 'Round', alignment: 'right' },
|
|
151
|
+
{ text: 'Average Price', style: 'tableheader1', Field: 'Total', alignment: 'right' },
|
|
152
|
+
]
|
|
153
|
+
];
|
|
154
|
+
// { text: 'Due', style: 'tableheader1', Field: 'Due', alignment: 'right' }]];
|
|
155
|
+
// if (!isHC) {
|
|
156
|
+
// HeadingNames[0].splice(2, 0, { text: 'Reg No', style: 'tableheader1', Field: 'Reg No', alignment: 'left' }
|
|
157
|
+
// , { text: 'Vehicle', style: 'tableheader1', Field: 'Vehicle', alignment: 'left' });
|
|
158
|
+
// // HeadingNames.splice(3, 0, { text: 'Vehicle', style: 'tableheader1', Field: 'Vehicle', alignment: 'left' });
|
|
159
|
+
// }
|
|
160
|
+
// }
|
|
161
|
+
return HeadingNames;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
exports.ItemWiseDoctorSalePDFService = ItemWiseDoctorSalePDFService;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ItemWiseMODetailsPDF = void 0;
|
|
4
|
+
const my_date_1 = require("../utils/my-date");
|
|
5
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
6
|
+
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
7
|
+
class ItemWiseMODetailsPDF {
|
|
8
|
+
static GetItemWiseMODetailsPrint(InvoicesData, CName, isPhar, isHC, HeaderName, searchValue) {
|
|
9
|
+
var dd = {
|
|
10
|
+
info: {
|
|
11
|
+
title: 'ItemWiseMO',
|
|
12
|
+
},
|
|
13
|
+
header: function (currentPage, pageCount) {
|
|
14
|
+
return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
|
|
15
|
+
},
|
|
16
|
+
pageMargins: [10, 15, 10, 15],
|
|
17
|
+
pageOrientation: 'landscape',
|
|
18
|
+
content: [
|
|
19
|
+
{ text: '' + CName + '', style: ['header'] },
|
|
20
|
+
{ text: HeaderName, alignment: 'center', fontSize: 15, bold: true },
|
|
21
|
+
// { text: 'As of ' + MyDate.ConvertUTCDateToReadable(MyDate.GetDateTimeNowInUTC()), alignment: 'center', fontSize: 10 },
|
|
22
|
+
// SharedPDFService.HeaderAfterLine(),
|
|
23
|
+
shared_pdf_service_1.SharedPDFService.GetSearchValueDetails(searchValue),
|
|
24
|
+
this.GetInvoiceDataTable(InvoicesData, isPhar, isHC),
|
|
25
|
+
],
|
|
26
|
+
styles: shared_pdf_service_1.SharedPDFService.GetStyles()
|
|
27
|
+
};
|
|
28
|
+
return dd;
|
|
29
|
+
}
|
|
30
|
+
static GetInvoiceDataTable(InvoicesData, isPhar, isHC) {
|
|
31
|
+
let Data = [];
|
|
32
|
+
// InvoicesData.forEach((invoice: any) => {
|
|
33
|
+
Data.push(this.GetItemsTable(InvoicesData, isPhar, isHC));
|
|
34
|
+
// });
|
|
35
|
+
return Data;
|
|
36
|
+
}
|
|
37
|
+
static getTableWidths(isHC) {
|
|
38
|
+
return [25, 50, 50, 50, 100, '*', 100, 40, 50, 40, 100];
|
|
39
|
+
}
|
|
40
|
+
static GetItemsTable(InvoiceData, isPhar, isHC) {
|
|
41
|
+
return {
|
|
42
|
+
style: 'tableExample',
|
|
43
|
+
marginTop: 3,
|
|
44
|
+
marginBottom: 5,
|
|
45
|
+
table: {
|
|
46
|
+
widths: this.getTableWidths(isHC),
|
|
47
|
+
headerRows: 1,
|
|
48
|
+
body: this.BuildTableBodyForLaborAndParts(InvoiceData, isPhar, isHC)
|
|
49
|
+
},
|
|
50
|
+
layout: {
|
|
51
|
+
hLineWidth: function (i, node) {
|
|
52
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0.5;
|
|
53
|
+
},
|
|
54
|
+
vLineWidth: function (i, node) {
|
|
55
|
+
return (i === 0 || i === node.table.widths.length) ? 1 : 0.5;
|
|
56
|
+
},
|
|
57
|
+
hLineColor: function (i, node) {
|
|
58
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 'gray' : 'lightgrey';
|
|
59
|
+
},
|
|
60
|
+
vLineColor: function (i, node) {
|
|
61
|
+
return 'gray';
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
static BuildTableBodyForLaborAndParts(InvoiceData, isPhar, isHC) {
|
|
67
|
+
let body = this.GetHeaderNames(isPhar, isHC);
|
|
68
|
+
InvoiceData.forEach((invoice, index) => {
|
|
69
|
+
var _a;
|
|
70
|
+
let dataRow = [];
|
|
71
|
+
dataRow.push({ text: index + 1 });
|
|
72
|
+
dataRow.push({ text: invoice.Code, style: ['headerstyle'], });
|
|
73
|
+
dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadable(invoice.CrDate), alignment: 'left' });
|
|
74
|
+
// dataRow.push({ text: invoice.Qty, alignment: 'right' });
|
|
75
|
+
// dataRow.push({ text: invoice.OfQty, alignment: 'right' });
|
|
76
|
+
dataRow.push({ text: (_a = invoice.BL) === null || _a === void 0 ? void 0 : _a.VNo, alignment: 'left' });
|
|
77
|
+
dataRow.push({ text: invoice.ShipToUser, alignment: 'left' });
|
|
78
|
+
dataRow.push({ text: invoice.Name, alignment: 'left' });
|
|
79
|
+
dataRow.push({ text: invoice.MPN, alignment: 'left' });
|
|
80
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Qty), alignment: 'right' });
|
|
81
|
+
dataRow.push({ text: invoice.ReName, alignment: 'left' });
|
|
82
|
+
dataRow.push({ text: invoice.Sts, alignment: 'left' });
|
|
83
|
+
dataRow.push({ text: invoice.Notes, alignment: 'left' });
|
|
84
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Total ), alignment: 'right', style: ['headerstyle'], });
|
|
85
|
+
body.push(dataRow);
|
|
86
|
+
});
|
|
87
|
+
return body;
|
|
88
|
+
}
|
|
89
|
+
static GetHeaderNames(isPhar, isHC) {
|
|
90
|
+
let HeadingNames;
|
|
91
|
+
HeadingNames = [[{ text: 'S.No', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
|
|
92
|
+
{ text: 'Transaction #', style: 'tableheader1', Field: 'Code', alignment: 'left' },
|
|
93
|
+
{ text: 'Created Date', style: 'tableheader1', Field: 'CrDate', alignment: 'left' },
|
|
94
|
+
{ text: 'Vehicle No', style: 'tableheader1', Field: 'VNo', alignment: 'left' },
|
|
95
|
+
{ text: 'User Name', style: 'tableheader1', Field: 'ShipToUser', alignment: 'left' },
|
|
96
|
+
{ text: 'Item Name', style: 'tableheader1', Field: 'Name', alignment: 'left' },
|
|
97
|
+
{ text: 'MPN', style: 'tableheader1', Field: 'MPN', alignment: 'left' },
|
|
98
|
+
{ text: 'Quantity', style: 'tableheader1', Field: 'Qty', alignment: 'right' },
|
|
99
|
+
{ text: 'Reason Name', style: 'tableheader1', Field: 'ReName', alignment: 'left' },
|
|
100
|
+
{ text: 'Status', style: 'tableheader1', Field: 'Sts', alignment: 'left' },
|
|
101
|
+
{ text: 'Notes', style: 'tableheader1', Field: 'Notes', alignment: 'left' },
|
|
102
|
+
// { text: 'Total', style: 'tableheader1', Field: 'Total', alignment: 'right' }
|
|
103
|
+
]];
|
|
104
|
+
return HeadingNames;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
exports.ItemWiseMODetailsPDF = ItemWiseMODetailsPDF;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ItemWiseMOSummaryPDF = void 0;
|
|
4
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
5
|
+
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
6
|
+
class ItemWiseMOSummaryPDF {
|
|
7
|
+
static GetItemWiseMOSummaryPrint(InvoicesData, CName, isPhar, isHC, HeaderName, searchValue) {
|
|
8
|
+
var dd = {
|
|
9
|
+
info: {
|
|
10
|
+
title: 'ItemWiseMOSummary',
|
|
11
|
+
},
|
|
12
|
+
header: function (currentPage, pageCount) {
|
|
13
|
+
return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
|
|
14
|
+
},
|
|
15
|
+
pageMargins: [10, 15, 10, 15],
|
|
16
|
+
content: [
|
|
17
|
+
{ text: '' + CName + '', style: ['header'] },
|
|
18
|
+
{ text: HeaderName, alignment: 'center', fontSize: 15, bold: true },
|
|
19
|
+
// { text: 'As of ' + MyDate.ConvertUTCDateToReadable(MyDate.GetDateTimeNowInUTC()), alignment: 'center', fontSize: 10 },
|
|
20
|
+
// SharedPDFService.HeaderAfterLine(),
|
|
21
|
+
shared_pdf_service_1.SharedPDFService.GetSearchValueDetails(searchValue),
|
|
22
|
+
this.GetInvoiceDataTable(InvoicesData, isPhar, isHC),
|
|
23
|
+
],
|
|
24
|
+
styles: shared_pdf_service_1.SharedPDFService.GetStyles()
|
|
25
|
+
};
|
|
26
|
+
return dd;
|
|
27
|
+
}
|
|
28
|
+
static GetInvoiceDataTable(InvoicesData, isPhar, isHC) {
|
|
29
|
+
let Data = [];
|
|
30
|
+
// InvoicesData.forEach((invoice: any) => {
|
|
31
|
+
Data.push(this.GetItemsTable(InvoicesData, isPhar, isHC));
|
|
32
|
+
// });
|
|
33
|
+
return Data;
|
|
34
|
+
}
|
|
35
|
+
static getTableWidths(isHC) {
|
|
36
|
+
// if (isHC) {
|
|
37
|
+
// return [25, '*', '*', '*', '*'];
|
|
38
|
+
// } else {
|
|
39
|
+
return [25, '*', '*'];
|
|
40
|
+
// }
|
|
41
|
+
}
|
|
42
|
+
static GetItemsTable(InvoiceData, isPhar, isHC) {
|
|
43
|
+
return {
|
|
44
|
+
style: 'tableExample',
|
|
45
|
+
marginTop: 3,
|
|
46
|
+
marginBottom: 5,
|
|
47
|
+
table: {
|
|
48
|
+
widths: this.getTableWidths(isHC),
|
|
49
|
+
headerRows: 1,
|
|
50
|
+
body: this.BuildTableBodyForLaborAndParts(InvoiceData, isPhar, isHC)
|
|
51
|
+
},
|
|
52
|
+
layout: {
|
|
53
|
+
hLineWidth: function (i, node) {
|
|
54
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0.5;
|
|
55
|
+
},
|
|
56
|
+
vLineWidth: function (i, node) {
|
|
57
|
+
return (i === 0 || i === node.table.widths.length) ? 1 : 0.5;
|
|
58
|
+
},
|
|
59
|
+
hLineColor: function (i, node) {
|
|
60
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 'gray' : 'lightgrey';
|
|
61
|
+
},
|
|
62
|
+
vLineColor: function (i, node) {
|
|
63
|
+
return 'gray';
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
static BuildTableBodyForLaborAndParts(InvoiceData, isPhar, isHC) {
|
|
69
|
+
let body = this.GetHeaderNames(isPhar, isHC);
|
|
70
|
+
InvoiceData.forEach((invoice, index) => {
|
|
71
|
+
let dataRow = [];
|
|
72
|
+
dataRow.push({ text: index + 1 });
|
|
73
|
+
// dataRow.push({ text: invoice.Code, style: ['headerstyle'], });
|
|
74
|
+
// dataRow.push({ text: TrUtils.ConvertDateToReadableFormat(invoice.CrDate), alignment: 'left' });
|
|
75
|
+
// dataRow.push({ text: invoice.Qty, alignment: 'right' });
|
|
76
|
+
// dataRow.push({ text: invoice.OfQty, alignment: 'right' });
|
|
77
|
+
// dataRow.push({ text: invoice.ShipToUser, alignment: 'left' });
|
|
78
|
+
dataRow.push({ text: invoice.Name, alignment: 'left' });
|
|
79
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Qty), alignment: 'right' });
|
|
80
|
+
// dataRow.push({ text: invoice.ReName, alignment: 'left' });
|
|
81
|
+
// dataRow.push({ text: invoice.Sts, alignment: 'left' });
|
|
82
|
+
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Total ), alignment: 'right', style: ['headerstyle'], });
|
|
83
|
+
body.push(dataRow);
|
|
84
|
+
});
|
|
85
|
+
return body;
|
|
86
|
+
}
|
|
87
|
+
static GetHeaderNames(isPhar, isHC) {
|
|
88
|
+
let HeadingNames;
|
|
89
|
+
HeadingNames = [[{ text: 'S.No', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
|
|
90
|
+
// { text: 'Transaction #', style: 'tableheader1', Field: 'Code', alignment: 'left' },
|
|
91
|
+
// { text: 'Created Date', style: 'tableheader1', Field: 'CrDate', alignment: 'left' },
|
|
92
|
+
// { text: 'User Name', style: 'tableheader1', Field: 'ShipToUser', alignment: 'left' },
|
|
93
|
+
{ text: 'Item Name', style: 'tableheader1', Field: 'Name', alignment: 'left' },
|
|
94
|
+
{ text: 'Quantity', style: 'tableheader1', Field: 'Qty', alignment: 'right' },
|
|
95
|
+
]];
|
|
96
|
+
return HeadingNames;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.ItemWiseMOSummaryPDF = ItemWiseMOSummaryPDF;
|