shareneus 1.5.7 → 1.5.8

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.
@@ -83,7 +83,7 @@ export declare class PosReceiptPrintService {
83
83
  static GetHeaderInfo(InvoicePDFData: any, marginleft: number): any;
84
84
  static finalReturnTotal(InvoicePDFData: any): string;
85
85
  static GetMarginsBasedOnPaperSize(size: any): number[];
86
- static GetTotalDeetails(InvoicePDFData: any, size: any): {
86
+ static GetTotalDetails(InvoicePDFData: any, size: any): {
87
87
  style: string[];
88
88
  lineHeight: number;
89
89
  marginBottom: number;
@@ -7,6 +7,7 @@ exports.PosReceiptPrintService = void 0;
7
7
  const tr_utils_1 = require("../../utils/tr-utils");
8
8
  const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
9
9
  const jsbarcode_1 = __importDefault(require("jsbarcode"));
10
+ const math_operations_1 = require("../../shared/math-operations");
10
11
  class PosReceiptPrintService {
11
12
  static GetPrint(InvoicePDFData, size) {
12
13
  var _a;
@@ -104,7 +105,7 @@ class PosReceiptPrintService {
104
105
  // { text: 'Adjust : ' + this.GetAdjustValue(InvoicePDFData.Adj), style: ['headerstyle'], alignment: 'right' },
105
106
  {
106
107
  columns: [{ text: '', width: '*' }, { text: this.finalReturnTotal(InvoicePDFData), width: '*', bold: true, fontSize: 10, alignment: 'center' },
107
- this.GetTotalDeetails(InvoicePDFData, size)]
108
+ this.GetTotalDetails(InvoicePDFData, size)]
108
109
  },
109
110
  // { text: '' , fontSize: 8, alignment: 'left' },
110
111
  {
@@ -268,17 +269,21 @@ class PosReceiptPrintService {
268
269
  return [25, 15, 25, 435.945];
269
270
  }
270
271
  }
271
- static GetTotalDeetails(InvoicePDFData, size) {
272
+ static GetTotalDetails(InvoicePDFData, size) {
273
+ console.log('InvoicePDFData', InvoicePDFData);
272
274
  let TotalData = [];
273
- if (!tr_utils_1.TrUtils.IsFixedZero(InvoicePDFData.STotal)) {
275
+ if (!InvoicePDFData.Consolidate && !tr_utils_1.TrUtils.IsFixedZero(InvoicePDFData.STotal)) {
274
276
  // TotalData.push({ text: 'Sub Total : ' + InvoicePDFData.STotal, style: ['headerstyle'], alignment: 'right', marginRight: 5, })
275
277
  TotalData.push({ name: 'Sub Total', value: InvoicePDFData.STotal });
276
278
  }
279
+ else {
280
+ TotalData.push({ name: 'Sub Total', value: tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(InvoicePDFData.STotal, InvoicePDFData.CustPartITax)) });
281
+ }
277
282
  if (!tr_utils_1.TrUtils.IsFixedZero(this.GetDiscountOverall(InvoicePDFData))) {
278
283
  // TotalData.push({ text: 'Discount : -' + this.GetDiscountOverall(InvoicePDFData), style: ['headerstyle'], alignment: 'right', marginRight: 5, });
279
284
  TotalData.push({ name: 'Discount', value: this.GetDiscountOverall(InvoicePDFData) });
280
285
  }
281
- if (!tr_utils_1.TrUtils.IsFixedZero(InvoicePDFData.CustPartITax) && tr_utils_1.TrUtils.IsFixedZero(InvoicePDFData.CustRetRoundedTotal)) {
286
+ if (!InvoicePDFData.Consolidate && !tr_utils_1.TrUtils.IsFixedZero(InvoicePDFData.CustPartITax) && tr_utils_1.TrUtils.IsFixedZero(InvoicePDFData.CustRetRoundedTotal)) {
282
287
  TotalData.push({ name: 'Tax Amount', value: tr_utils_1.TrUtils.FixPriceValue(InvoicePDFData.CustPartITax) });
283
288
  }
284
289
  if (!tr_utils_1.TrUtils.IsFixedZero(InvoicePDFData.Round) && tr_utils_1.TrUtils.IsFixedZero(InvoicePDFData.CustRetRoundedTotal)) {
@@ -57,7 +57,7 @@ class SaleReceiptPrintService {
57
57
  InvoicePrintData.Sts = PaymentData.Sts;
58
58
  }
59
59
  InvoicePrintData.Consolidate = ConsolidateGST;
60
- InvoicePrintData.ShowDiscountColumn = true;
60
+ InvoicePrintData.ShowDiscountColumn = false;
61
61
  if (!ForInsurance && !ConsolidateGST) {
62
62
  if (shared_print_service_1.PrintSharedService.CheckItemIndexWithDisc(InvoicePrintData) !== -1) {
63
63
  InvoicePrintData.ShowDiscountColumn = (InvoicePrintData.Settings.DiscLvl === 'ITM' || InvoicePrintData.Settings.DiscLvl === 'RECITM') ? true : false;
@@ -177,7 +177,8 @@ class SaleReceiptPrintService {
177
177
  let CTaxAmtPerItem = (0, math_operations_1.Divide)(Item.CGST, Item.Qty);
178
178
  let STaxAmtPerItem = (0, math_operations_1.Divide)(Item.SGST, Item.Qty);
179
179
  let ITaxAmtPerItem = (0, math_operations_1.Divide)(Item.IGST, Item.Qty);
180
- Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
180
+ let DiscPerItem = (0, math_operations_1.Divide)((0, math_operations_1.Add)(Item.Disc, Item.RecDisc), Item.Qty);
181
+ Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(AfterDiscForEach, DiscPerItem, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
181
182
  }
182
183
  else {
183
184
  Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
@@ -198,11 +199,16 @@ class SaleReceiptPrintService {
198
199
  Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
199
200
  Item.TaxName = this.getTaxName(Item.TCode, TaxCodes);
200
201
  Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
201
- if (LineTotal === 'AT') {
202
- Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
202
+ if (Consolidate) {
203
+ Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Multiply)(Item.UnPr, Item.Qty), DecimalsNumber);
203
204
  }
204
205
  else {
205
- Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc), DecimalsNumber);
206
+ if (LineTotal === 'AT') {
207
+ Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
208
+ }
209
+ else {
210
+ Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc), DecimalsNumber);
211
+ }
206
212
  }
207
213
  if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
208
214
  Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
package/dist/index.d.ts CHANGED
@@ -131,3 +131,4 @@ export { CalcItemFinalSalePrice } from "./inventory/items/item-price-for-priceli
131
131
  export { IsNotNull, IsNull } from "./shared/util";
132
132
  export { GetAgeString } from "./shared/util";
133
133
  export { SalesTotalCalculationsWithDecimals } from "./sales-receive/sales-total-calculation";
134
+ export { ServiceHistoryPDFService } from "./services/service-history-pdf.service";
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DebitNotePdfService = exports.DCWithoutPricePdfService = exports.DCLandscapeWithoutPricePdfService = exports.DCLandscapePdfService = exports.CustomerBalancesService = exports.SalesByCustomerPDFService = exports.CustWiseSalesDetailsService = exports.CreditNoteTotalsService = exports.CreditNotePdfService = exports.ConsultationPDFService = exports.ConsultationFullPrintService = exports.ConsultationFeeReceiptPrintService = exports.CNPrintService = exports.ChecklistsPDFService = exports.CheckListPrintService = exports.CategoryWiseItemPDFService = exports.SalesReceiptprintService = exports.AppointmentTotalsService = exports.AnalysisPDFService = exports.VenBalanceXlsxFileService = exports.TallySalesImportXlsxFileService = exports.StockXlsxFileService = exports.IssueSparesXlsxFileService = exports.ScheduledDrugXlsxFileService = exports.ScheduledDrugSummaryXlsxFileService = exports.SalesByServiceSummaryXlsxFileService = exports.SummaryXlsxFileService = exports.ServiceAdvisorWisePartXlsxFileService = exports.ServiceAdvisorWiseLaborXlsxFileService = exports.RepairOrdersXlsxFileService = exports.PaymentsMadeXlsxFileService = exports.PaymentReceiveXlsxFileService = exports.OperatorWiseSummaryXlsxFileService = exports.OperatorWiseDetailsXlsxFileService = exports.ManfWiseSalesXlsxFileService = exports.ItemsWiseSalesXlsxFileService = exports.ItemWiseMOSummaryXlsxFileService = exports.ItemWiseMODetailsXlsxFileService = exports.ItemWiseDoctorSaleXlsxFileService = exports.InvoicesWiseXlsxFileService = exports.InsuranceExpireXlsxFileService = exports.GSTR2ExcelService = exports.GSTR1ExcelService = exports.GSTROXlsxFileService = exports.ExpiringDrugsXlsxFileService = exports.SalesByCustomerXlsxFileService = exports.CustWiseSalesXlsxFileService = exports.CustBalanceXlsxFileService = exports.CategoryWiseItemXlsxFileService = exports.AnalysisXlsxFileService = void 0;
4
4
  exports.SharedPDFService = exports.SharedInvoiceprintService = exports.WOPrintService = exports.ScheduledDrugSummaryPDFService = exports.ScheduledDrugPDFService = exports.SalesTotalsService = exports.SaleReceiptPrintService = exports.SalesReceiptpdfService = exports.SalesPrintService = exports.SalesPdfService = exports.SalesByServiceSummaryPDF = exports.ROTotalsService = exports.ROPrintService = exports.RoprintService = exports.RepairOrdersReportsPDFService = exports.ReorderPointPDFService = exports.ReceiptPrintService = exports.PurchaseOrderPDFService = exports.PurchaseOrderTotalsService = exports.PurchaseOrderPrintService = exports.PosReceiptPrintService = exports.POTotalsService = exports.PaymentsReportPDFService = exports.ReceiptPDFService = exports.PackShipPrintService = exports.PackShipPDFService = exports.OperatorWiseSalesSummaryPDF = exports.OperatorWiseSalesDetailsPDF = exports.MaterialOutprintService = exports.MeetingPdfService = exports.ManfWiseSalesService = exports.ItemWiseSalesPDFService = exports.ItemWiseMOSummaryPDF = exports.ItemWiseMODetailsPDF = exports.ItemWiseDoctorSalePDFService = exports.ItemDetaisPdf = exports.IssuePartsprintService = exports.InvoiceTotalsService = exports.InvoiceLandscapePdfService = exports.InvPrintService = exports.InvoiceprintService = exports.InsuranceExpirePDF = exports.ExpiringDrugPDFService = exports.EstPrintService = exports.EquipmentDesignPdf = exports.DeliveryChallanTotalsService = exports.DeliveryChallanPrintService = exports.DeliveryChallanPdfService = exports.DebitNoteTotalsService = exports.DebitNotePrintService = void 0;
5
- exports.SalesTotalCalculationsWithDecimals = exports.GetAgeString = exports.IsNull = exports.IsNotNull = exports.CalcItemFinalSalePrice = exports.GetItemPriceForPriceList = exports.SalesReceiveTotalsService = exports.SalesReceivePrintService = exports.SalesReceivePdfService = exports.AdjustmentDrugPDFService = exports.HSNSummaryPDFService = exports.HSNSummaryExcelService = exports.ItemBarCodeLabelPdf = exports.NextServiceDatePDFService = exports.NextServiceDateXlsxFileService = exports.ConsultationLetterHeadPDFService = exports.InvoiceLetterheadPdfService = exports.HCInvoiceprintService = exports.InvoicePortraitPrintService = exports.MyDate = exports.TrUtils = exports.VendorDebitNoteTotalsService = exports.VendorDebitNotePrintService = exports.VendorDebitNotePdfService = exports.VendorCreditNoteTotalsService = exports.VendorCreditNotePrintService = exports.VendorCreditNotePDFService = exports.VendorBalancesService = exports.TransferOrderPrintService = exports.TechnicianPrintService = exports.TechnicianpdfService = exports.TaskReportsPDfService = exports.TaskPDfService = exports.PrintSharedService = void 0;
5
+ exports.ServiceHistoryPDFService = exports.SalesTotalCalculationsWithDecimals = exports.GetAgeString = exports.IsNull = exports.IsNotNull = exports.CalcItemFinalSalePrice = exports.GetItemPriceForPriceList = exports.SalesReceiveTotalsService = exports.SalesReceivePrintService = exports.SalesReceivePdfService = exports.AdjustmentDrugPDFService = exports.HSNSummaryPDFService = exports.HSNSummaryExcelService = exports.ItemBarCodeLabelPdf = exports.NextServiceDatePDFService = exports.NextServiceDateXlsxFileService = exports.ConsultationLetterHeadPDFService = exports.InvoiceLetterheadPdfService = exports.HCInvoiceprintService = exports.InvoicePortraitPrintService = exports.MyDate = exports.TrUtils = exports.VendorDebitNoteTotalsService = exports.VendorDebitNotePrintService = exports.VendorDebitNotePdfService = exports.VendorCreditNoteTotalsService = exports.VendorCreditNotePrintService = exports.VendorCreditNotePDFService = exports.VendorBalancesService = exports.TransferOrderPrintService = exports.TechnicianPrintService = exports.TechnicianpdfService = exports.TaskReportsPDfService = exports.TaskPDfService = exports.PrintSharedService = void 0;
6
6
  var analysis_excel_service_1 = require("./accounting/invoice/reports/excel/analysis-excel.service");
7
7
  Object.defineProperty(exports, "AnalysisXlsxFileService", { enumerable: true, get: function () { return analysis_excel_service_1.AnalysisXlsxFileService; } });
8
8
  var category_wise_item_excel_service_1 = require("./accounting/invoice/reports/excel/category-wise-item-excel.service");
@@ -270,3 +270,5 @@ var util_2 = require("./shared/util");
270
270
  Object.defineProperty(exports, "GetAgeString", { enumerable: true, get: function () { return util_2.GetAgeString; } });
271
271
  var sales_total_calculation_1 = require("./sales-receive/sales-total-calculation");
272
272
  Object.defineProperty(exports, "SalesTotalCalculationsWithDecimals", { enumerable: true, get: function () { return sales_total_calculation_1.SalesTotalCalculationsWithDecimals; } });
273
+ var service_history_pdf_service_1 = require("./services/service-history-pdf.service");
274
+ Object.defineProperty(exports, "ServiceHistoryPDFService", { enumerable: true, get: function () { return service_history_pdf_service_1.ServiceHistoryPDFService; } });
@@ -0,0 +1,37 @@
1
+ export declare class ServiceHistoryPDFService {
2
+ static GetPrint(ReOrderPointData: any, DatesDetails: any): any;
3
+ static GetSignatures(CName: any, For: any, Type: any): {
4
+ columns: {
5
+ stack: {
6
+ style: string;
7
+ text: (string | {
8
+ text: any;
9
+ })[];
10
+ }[];
11
+ }[];
12
+ };
13
+ static CompanyName(CName: any): {
14
+ style: string;
15
+ text: (string | {
16
+ text: any;
17
+ })[];
18
+ };
19
+ static GetHistoryTable(WOHistory: any, DecimalsNumber: number): {
20
+ style: string;
21
+ marginTop: number;
22
+ marginBottom: number;
23
+ table: {
24
+ widths: (string | number)[];
25
+ headerRows: number;
26
+ body: any;
27
+ };
28
+ layout: {
29
+ hLineWidth: (i: any, node: any) => 1 | 0.5;
30
+ vLineWidth: (i: any, node: any) => 1 | 0.5;
31
+ hLineColor: (i: any, node: any) => "gray" | "lightgrey";
32
+ vLineColor: (i: any, node: any) => string;
33
+ };
34
+ };
35
+ static BuildTableBodyForHistory(WOHistory: any, DecimalsNumber: number): any;
36
+ static GetHeaderNames(): any;
37
+ }
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ServiceHistoryPDFService = void 0;
4
+ const my_date_1 = require("../utils/my-date");
5
+ const tr_utils_1 = require("../utils/tr-utils");
6
+ class ServiceHistoryPDFService {
7
+ static GetPrint(ReOrderPointData, DatesDetails) {
8
+ // console.log('ReOrderPointData', ReOrderPointData);
9
+ let dd = {
10
+ // info: {
11
+ // title: this.GetFileName(ROPrintData),
12
+ // },
13
+ info: {
14
+ title: 'ExpiringDrugs',
15
+ },
16
+ header: function (currentPage, pageCount, pageSize) {
17
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 25, fontSize: 8, marginTop: 2 };
18
+ },
19
+ pageMargins: [25, 15, 25, 15],
20
+ pageSize: 'A4',
21
+ content: [
22
+ { text: ReOrderPointData.Entity.CName, style: ['headerstyle'], alignment: 'center', fontSize: 20 },
23
+ { text: 'Service History', style: ['headerstyle'], alignment: 'center', fontSize: 12 },
24
+ this.GetHistoryTable(ReOrderPointData.WOHistory, ReOrderPointData.Entity.DecimalsNumber),
25
+ this.GetSignatures(ReOrderPointData.Entity.CName, ReOrderPointData.Type, ReOrderPointData.For),
26
+ ],
27
+ styles: {
28
+ headerstyle: {
29
+ fontFamily: 'Calibri',
30
+ fontSize: 9
31
+ },
32
+ Sign: {
33
+ fontSize: 8,
34
+ margin: [0, 30, 0, 5]
35
+ },
36
+ forCompany: {
37
+ // margin: [0, 10, 30, 0],
38
+ marginRight: 5,
39
+ marginTop: 10,
40
+ fontSize: 9,
41
+ alignment: 'right'
42
+ },
43
+ tableheader: {
44
+ bold: true,
45
+ fontFamily: 'Calibri',
46
+ margin: [0, 1, 0, 5],
47
+ alignment: 'center'
48
+ },
49
+ tableheader1: {
50
+ bold: true,
51
+ fontFamily: 'Calibri',
52
+ margin: [0, 2, 0, 2],
53
+ alignment: 'center'
54
+ },
55
+ tableExample: {
56
+ fontSize: 9
57
+ }
58
+ }
59
+ };
60
+ return dd;
61
+ }
62
+ static GetSignatures(CName, For, Type) {
63
+ return {
64
+ columns: [{
65
+ stack: [
66
+ this.CompanyName(CName),
67
+ ]
68
+ }],
69
+ };
70
+ }
71
+ static CompanyName(CName) {
72
+ return {
73
+ style: 'forCompany',
74
+ text: ['For ', { text: CName, }],
75
+ };
76
+ }
77
+ static GetHistoryTable(WOHistory, DecimalsNumber) {
78
+ return {
79
+ style: 'tableExample',
80
+ marginTop: 3,
81
+ marginBottom: 5,
82
+ table: {
83
+ widths: [100, 80, 80, '*', 100],
84
+ headerRows: 1,
85
+ body: this.BuildTableBodyForHistory(WOHistory, DecimalsNumber)
86
+ },
87
+ layout: {
88
+ hLineWidth: function (i, node) {
89
+ return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0.5;
90
+ },
91
+ vLineWidth: function (i, node) {
92
+ return (i === 0 || i === node.table.widths.length) ? 1 : 0.5;
93
+ },
94
+ hLineColor: function (i, node) {
95
+ return (i === 0 || i === 1 || i === node.table.body.length) ? 'gray' : 'lightgrey';
96
+ },
97
+ vLineColor: function (i, node) {
98
+ return 'gray';
99
+ },
100
+ }
101
+ };
102
+ }
103
+ static BuildTableBodyForHistory(WOHistory, DecimalsNumber) {
104
+ let body = this.GetHeaderNames();
105
+ // let Total: number = 0;
106
+ WOHistory.forEach((item, index) => {
107
+ // Total = Total + (TrUtils.SetValueToZeroIfNull(item.Batch.Qty) * TrUtils.SetValueToZeroIfNull(item.Batch.Cost));
108
+ let dataRow = [];
109
+ dataRow.push({ text: item.Code, });
110
+ dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadable(item.CrDate), alignment: 'center', style: ['headerstyle'], });
111
+ dataRow.push({ text: item.Prod.MIn, alignment: 'center', style: ['headerstyle'], });
112
+ dataRow.push({ text: item.TypeName, alignment: 'center', style: ['headerstyle'], });
113
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Total, DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
114
+ body.push(dataRow);
115
+ });
116
+ // let Row: any = [{ text: 'Total', alignment: 'right', colSpan: 5, bold: true, fontSize: 12 }, {}, {}, {}, {}, { text: TrUtils.FixPriceValue(Total, DecimalsNumber), fontSize: 12, alignment: 'right', bold: true }];
117
+ // body.push(Row);
118
+ return body;
119
+ }
120
+ static GetHeaderNames() {
121
+ let HeadingNames;
122
+ HeadingNames = [[{ text: 'WO#', style: 'tableheader1', Field: 'Code', alignment: 'left', line: true },
123
+ { text: 'Created Date', style: 'tableheader1', Field: 'CrDate', alignment: 'center' },
124
+ { text: 'Mileage In', style: 'tableheader1', Field: 'Mileage', alignment: 'center' },
125
+ { text: 'Service Type', style: 'tableheader1', Field: 'Type', alignment: 'center' },
126
+ { text: 'Total', style: 'tableheader1', Field: 'Total', alignment: 'right' }
127
+ ]];
128
+ return HeadingNames;
129
+ }
130
+ }
131
+ exports.ServiceHistoryPDFService = ServiceHistoryPDFService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.5.07",
3
+ "version": "1.5.08",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",