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,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OperatorWiseSalesSummaryPDF = void 0;
4
+ const tr_utils_1 = require("../utils/tr-utils");
5
+ const shared_pdf_service_1 = require("./shared-pdf.service");
6
+ class OperatorWiseSalesSummaryPDF {
7
+ static GetOperatorWiseSalesSummaryPrint(InvoicesData, CName, isPhar, isHC, HeaderName, searchValue) {
8
+ var dd = {
9
+ info: {
10
+ title: 'OperatorWiseSummary',
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, 40, 40, 50, 50, 50, 80];
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.Name, style: ['headerstyle'], });
74
+ dataRow.push({ text: invoice.Count, alignment: 'right' });
75
+ // dataRow.push({ text: invoice.Qty, alignment: 'right' });
76
+ // dataRow.push({ text: invoice.OfQty, alignment: 'right' });
77
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.SubTotal), alignment: 'right' });
78
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Disc), alignment: 'right' });
79
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Tax), alignment: 'right' });
80
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Adjust), alignment: 'right' });
81
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Round), alignment: 'right' });
82
+ dataRow.push({ text: tr_utils_1.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: 'Name', style: 'tableheader1', Field: 'Name' },
91
+ { text: 'Count', style: 'tableheader1', Field: 'Count', alignment: 'right' },
92
+ { text: 'SubTotal', style: 'tableheader1', Field: 'SubTotal', alignment: 'right' },
93
+ { text: 'Disc', style: 'tableheader1', Field: 'Disc', alignment: 'right' },
94
+ { text: 'Tax', style: 'tableheader1', Field: 'Tax', alignment: 'right' },
95
+ { text: 'Adjustment', style: 'tableheader1', Field: 'Adjust', alignment: 'right' },
96
+ { text: 'Round Off', style: 'tableheader1', Field: 'Round', alignment: 'right' },
97
+ { text: 'Total', style: 'tableheader1', Field: 'Total', alignment: 'right' }]];
98
+ return HeadingNames;
99
+ }
100
+ }
101
+ exports.OperatorWiseSalesSummaryPDF = OperatorWiseSalesSummaryPDF;
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PackShipPDFService = void 0;
4
+ const tr_utils_1 = require("../utils/tr-utils");
5
+ const shared_pdf_service_1 = require("./shared-pdf.service");
6
+ const shared_print_service_1 = require("./shared-print.service");
7
+ class PackShipPDFService {
8
+ static GetPackagesPrint(ShipmentData, numberofCopies) {
9
+ // console.log(ShipmentData);
10
+ var contents = [];
11
+ if (tr_utils_1.TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
12
+ contents.push(this.CommonHeaderDetails(ShipmentData, null), this.GetPackageData(), { text: 'Items', alignment: 'start', fontSize: 14, bold: true }, this.PrepareItemsTable(ShipmentData));
13
+ }
14
+ else {
15
+ numberofCopies.forEach((text, index) => {
16
+ contents.push(this.CommonHeaderDetails(ShipmentData, text), { text: 'Items', alignment: 'start', fontSize: 14, bold: true }, this.PrepareItemsTable(ShipmentData));
17
+ });
18
+ }
19
+ var dd = {
20
+ info: {
21
+ title: this.GetFileName(ShipmentData),
22
+ },
23
+ background: function (currentPage, pageSize) {
24
+ return shared_pdf_service_1.SharedPDFService.GetWatermarkImage(ShipmentData.Image, pageSize, ShipmentData.Entity.Wmark);
25
+ },
26
+ header: function (currentPage, pageCount) {
27
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
28
+ },
29
+ pageMargins: [10, 15, 10, 15],
30
+ content: contents,
31
+ defaultStyle: {
32
+ fontSize: 10,
33
+ },
34
+ styles: shared_pdf_service_1.SharedPDFService.GetStyles()
35
+ };
36
+ return dd;
37
+ }
38
+ static GetPackageData() {
39
+ }
40
+ static PrepareItemsTable(ShipmentData) {
41
+ return {
42
+ style: 'tableExample',
43
+ // marginLeft: 20,
44
+ table: {
45
+ widths: [500, 30],
46
+ // headerRows: 2,
47
+ body: this.buildTableForCustomerLabor(ShipmentData.Items)
48
+ },
49
+ layout: shared_print_service_1.PrintSharedService.LayOutStyleanother()
50
+ };
51
+ // return {
52
+ // style: 'textcust',
53
+ // marginLeft: 5,
54
+ // columns: [
55
+ // // this.GetPackageDetails()
56
+ // ],
57
+ // };
58
+ }
59
+ static buildTableForCustomerLabor(Items) {
60
+ // console.log(Items);
61
+ var body = [];
62
+ let Columns = this.GetColumns();
63
+ body.push(Columns);
64
+ // console.log('Columns', Columns);
65
+ Items.forEach((item) => {
66
+ body.push([{ text: item.Desc }, { text: item.Qty + ' ' + item.UoM }]);
67
+ });
68
+ return body;
69
+ }
70
+ static GetColumns() {
71
+ let headersNames = [
72
+ { text: 'Description', style: 'tableheader', Field: 'Desc' },
73
+ { text: 'Qty', style: 'tableheader', Field: 'Qty' },
74
+ ];
75
+ return headersNames;
76
+ }
77
+ static GetPackageDetails(Packages) {
78
+ }
79
+ static CommonHeaderDetails(ROPrintData, text) {
80
+ return [
81
+ this.GetMainHeaderDetails(ROPrintData.Entity, ROPrintData.HeaderName, ROPrintData.Image, ROPrintData.HColor, ROPrintData.AColor, text),
82
+ shared_pdf_service_1.SharedPDFService.GetSOCustomerAndOthDetails(ROPrintData._id, ROPrintData.CrDate, ROPrintData.PrDate, ROPrintData.PrintType, ROPrintData.For, ROPrintData.SurName, ROPrintData.SurPhone, ROPrintData.Type, ROPrintData.SurEmail, ROPrintData.ShippmentTo, ROPrintData.PolNo, ROPrintData.PolType, ROPrintData.Customer, ROPrintData.Settings, ROPrintData.RefNo, ROPrintData.IsPackage, ROPrintData.PackId, ROPrintData.PackedDate, ROPrintData.ShipId, ROPrintData.ShippedDate),
83
+ shared_pdf_service_1.SharedPDFService.GetOwnerDetails(ROPrintData.Cust, ROPrintData.Type, ROPrintData.For),
84
+ shared_pdf_service_1.SharedPDFService.CustomerAndVehicleDetailsAfterLine(),
85
+ shared_pdf_service_1.SharedPDFService.GetDisplayTable(),
86
+ ];
87
+ }
88
+ static GetMainHeaderDetails(Entity, HeaderName, Image, HColor, AColor, text) {
89
+ return [
90
+ // SharedPDFService.MainHeading(Entity.CName, Entity.Header, Image, HColor, text),
91
+ shared_pdf_service_1.SharedPDFService.GetMainHeader(Entity, Image, AColor, HColor, text),
92
+ shared_pdf_service_1.SharedPDFService.GetPrintType(HeaderName),
93
+ shared_pdf_service_1.SharedPDFService.HeaderAfterLine()
94
+ ];
95
+ }
96
+ static GetFileName(ROPrintData) {
97
+ let fileName = ROPrintData.HeaderName;
98
+ if (!tr_utils_1.TrUtils.IsNull(ROPrintData.Product) && !tr_utils_1.TrUtils.IsEmpty(ROPrintData.Product.RegNo)) {
99
+ fileName = fileName + '-' + ROPrintData.Product.RegNo;
100
+ }
101
+ return fileName;
102
+ }
103
+ }
104
+ exports.PackShipPDFService = PackShipPDFService;
105
+ PackShipPDFService.FontSize = 8;
@@ -0,0 +1,167 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PackShipPrintService = void 0;
4
+ const my_date_1 = require("../utils/my-date");
5
+ const tr_utils_1 = require("../utils/tr-utils");
6
+ const shared_print_service_1 = require("./shared-print.service");
7
+ class PackShipPrintService {
8
+ static GetShipmentPrintInfo(OriginalInvoiceData, OriginalEntityData, image, PackShipData, ItemsList, IsPackage) {
9
+ // console.log(ItemsList);
10
+ let ForInsurance = !tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.ShipTo.InsId);
11
+ let InvoicePrintData = {};
12
+ let argInvoiceData = tr_utils_1.TrUtils.Stringify(OriginalInvoiceData);
13
+ InvoicePrintData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(OriginalEntityData, OriginalInvoiceData.Type, OriginalInvoiceData);
14
+ InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
15
+ InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData, PackShipData, IsPackage);
16
+ InvoicePrintData.Settings = tr_utils_1.TrUtils.Stringify(argInvoiceData.Settings);
17
+ InvoicePrintData.Items = tr_utils_1.TrUtils.Stringify(ItemsList);
18
+ InvoicePrintData = this.GetFormattedProductDataForPrint(argInvoiceData, InvoicePrintData);
19
+ InvoicePrintData = this.GetBillNameForInvoicePrint(argInvoiceData, InvoicePrintData);
20
+ InvoicePrintData = this.GetShipToForSOPrint(argInvoiceData, InvoicePrintData);
21
+ InvoicePrintData = this.GetPackShipHeading(InvoicePrintData, IsPackage);
22
+ return InvoicePrintData;
23
+ }
24
+ static GetPackShipHeading(InvoicePrintData, IsPackage) {
25
+ if (IsPackage) {
26
+ InvoicePrintData.HeaderName = 'Package';
27
+ }
28
+ else {
29
+ InvoicePrintData.HeaderName = 'Shipment';
30
+ }
31
+ return InvoicePrintData;
32
+ }
33
+ static GetPrintConditionsBasedOnInput(InvoicePrintData, IncludeGST, ConsolidateGST, ForInsurance, SType, OriginalInvoiceData, IsProforma) {
34
+ InvoicePrintData.ForInsurance = ForInsurance;
35
+ InvoicePrintData.For = 'SO';
36
+ InvoicePrintData.IncludeGST = IncludeGST;
37
+ InvoicePrintData.ConsolidateGST = ConsolidateGST;
38
+ InvoicePrintData.ShowAccParts = false;
39
+ InvoicePrintData.ShowIGST = (tr_utils_1.TrUtils.IsNull(SType) || (SType === 'Intra')) ? false : true;
40
+ InvoicePrintData.ShowTaxColumn = (IncludeGST && !ConsolidateGST) ? true : false;
41
+ // InvoicePrintData.ShowDiscountColumn = (!ForInsurance && !ConsolidateGST) ? true : false;
42
+ InvoicePrintData.PrDate = tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.PrDate) ? '' : my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.PrDate);
43
+ return InvoicePrintData;
44
+ }
45
+ static GetInvoiceOtherDetailsForPrint(InvoicePrintData, OriginalInvoiceData, PackShipData, IsPackage) {
46
+ InvoicePrintData.Type = OriginalInvoiceData.Type;
47
+ InvoicePrintData._id = OriginalInvoiceData.Code;
48
+ InvoicePrintData.Sts = OriginalInvoiceData.Sts;
49
+ InvoicePrintData.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.CrDate);
50
+ InvoicePrintData.RefNo = OriginalInvoiceData.RefNo;
51
+ InvoicePrintData.IsPackage = IsPackage;
52
+ if (IsPackage) {
53
+ InvoicePrintData.PackId = PackShipData.Id;
54
+ InvoicePrintData.PackedDate = my_date_1.MyDate.ConvertUTCDateToReadable(PackShipData.Date);
55
+ }
56
+ else {
57
+ InvoicePrintData.ShipId = PackShipData.Id;
58
+ InvoicePrintData.ShippedDate = my_date_1.MyDate.ConvertUTCDateToReadable(PackShipData.Date);
59
+ }
60
+ return InvoicePrintData;
61
+ }
62
+ static GetFormattedProductDataForPrint(OriginalInvoiceData, InvoicePrintData) {
63
+ if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.Prod)) {
64
+ InvoicePrintData.Product = OriginalInvoiceData.Prod;
65
+ if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.VIN)) {
66
+ InvoicePrintData.Product.VIN = '';
67
+ }
68
+ if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.RegNo)) {
69
+ InvoicePrintData.Product.RegNo = '';
70
+ }
71
+ if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.EngNo)) {
72
+ InvoicePrintData.Product.EngNo = '';
73
+ }
74
+ InvoicePrintData.MIn = OriginalInvoiceData.Prod.MIn;
75
+ InvoicePrintData.MOut = OriginalInvoiceData.Prod.MOut;
76
+ }
77
+ return InvoicePrintData;
78
+ }
79
+ static GetShipToForSOPrint(OriginalInvoiceData, InvoicePrintData) {
80
+ let Customer = {};
81
+ Customer.Name = OriginalInvoiceData.ShipTo.Name;
82
+ Customer.Adrs = [];
83
+ Customer.Cons = [];
84
+ if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.ShipTo.Adrs)) {
85
+ Customer.Adrs.push(OriginalInvoiceData.ShipTo.Adrs.A1);
86
+ if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.ShipTo.Adrs.A2)) {
87
+ Customer.Adrs.push(OriginalInvoiceData.ShipTo.Adrs.A2);
88
+ }
89
+ if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.ShipTo.Adrs.Ct)) {
90
+ Customer.Adrs.push(OriginalInvoiceData.ShipTo.Adrs.Ct);
91
+ }
92
+ }
93
+ Customer.GSTIN = OriginalInvoiceData.ShipTo.GSTIN;
94
+ if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.ShipTo.Ph)) {
95
+ Customer.Cons = [
96
+ {
97
+ Type: 'M',
98
+ No: OriginalInvoiceData.ShipTo.Ph
99
+ }
100
+ ];
101
+ }
102
+ InvoicePrintData.ShippmentTo = Customer;
103
+ if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.ShipTo.InsId)) {
104
+ InvoicePrintData.Cust = this.GetCustomerDetails(OriginalInvoiceData);
105
+ }
106
+ return InvoicePrintData;
107
+ }
108
+ static GetBillNameForInvoicePrint(OriginalInvoiceData, InvoicePrintData) {
109
+ // console.log('Adress', OriginalInvoiceData);
110
+ let Customer = {};
111
+ Customer.Name = OriginalInvoiceData.ShipTo.Name;
112
+ Customer.Adrs = [];
113
+ Customer.Cons = [];
114
+ if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.ShipTo.Adrs)) {
115
+ Customer.Adrs.push(OriginalInvoiceData.ShipTo.Adrs.A1);
116
+ if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.ShipTo.Adrs.A2)) {
117
+ Customer.Adrs.push(OriginalInvoiceData.ShipTo.Adrs.A2);
118
+ }
119
+ if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.ShipTo.Adrs.Ct)) {
120
+ Customer.Adrs.push(OriginalInvoiceData.ShipTo.Adrs.Ct);
121
+ }
122
+ }
123
+ Customer.GSTIN = OriginalInvoiceData.ShipTo.GSTIN;
124
+ if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.ShipTo.Ph)) {
125
+ Customer.Cons = [
126
+ {
127
+ Type: 'M',
128
+ No: OriginalInvoiceData.ShipTo.Ph
129
+ }
130
+ ];
131
+ }
132
+ InvoicePrintData.Customer = Customer;
133
+ if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.ShipTo.InsId)) {
134
+ InvoicePrintData.Cust = this.GetCustomerDetails(OriginalInvoiceData);
135
+ }
136
+ return InvoicePrintData;
137
+ }
138
+ static GetCustomerDetails(OriginalInvoiceData) {
139
+ let Customer = {};
140
+ Customer.Name = this.GetBillToName(OriginalInvoiceData.Cust.Title, OriginalInvoiceData.Cust.Name);
141
+ Customer.Cons = [];
142
+ if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.Cust.Ph)) {
143
+ Customer.Cons = [
144
+ {
145
+ Type: 'M',
146
+ No: OriginalInvoiceData.Cust.Ph
147
+ }
148
+ ];
149
+ }
150
+ Customer.GSTIN = OriginalInvoiceData.Cust.GSTIN;
151
+ Customer.Adrs = [];
152
+ if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.Cust.Adrs)) {
153
+ Customer.Adrs.push(OriginalInvoiceData.Cust.Adrs.A1);
154
+ if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.Cust.Adrs.A2)) {
155
+ Customer.Adrs.push(OriginalInvoiceData.Cust.Adrs.A2);
156
+ }
157
+ Customer.Adrs.push(OriginalInvoiceData.Cust.Adrs.Ct);
158
+ }
159
+ Customer.ConName = OriginalInvoiceData.Cust.ConName;
160
+ Customer.ConPh = OriginalInvoiceData.Cust.ConPhone;
161
+ return Customer;
162
+ }
163
+ static GetBillToName(Title, Name) {
164
+ return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
165
+ }
166
+ }
167
+ exports.PackShipPrintService = PackShipPrintService;