@bookmypuja-tech/bmp-pdf 0.3.20 → 0.3.22

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/index.d.ts CHANGED
@@ -233,6 +233,19 @@ interface IInvoiceProps {
233
233
  data: IInvoiceData;
234
234
  }
235
235
 
236
+ interface IPostalItem {
237
+ id: string;
238
+ name: string;
239
+ pujaDetails: string;
240
+ phone: string;
241
+ address: string;
242
+ }
243
+ interface IPostalReportProps {
244
+ date: Date;
245
+ templeName: string;
246
+ data?: IPostalItem[];
247
+ }
248
+
236
249
  type sizeOptions = "A4" | "2Inch";
237
250
  declare const getPrintBlob: ({ size, data, dates, }: {
238
251
  size: sizeOptions;
@@ -244,7 +257,7 @@ declare const printDevoteeReceipt2Inch: (data: IPujaReceipt) => Promise<void>;
244
257
  declare const printTotalReceipt2Inch: (data: ITotalReceipt) => Promise<void>;
245
258
  declare const printePujaReport2Inch: (data: IPujaReport) => Promise<void>;
246
259
  declare const printQuickPrintReceipt2Inch: (data: IQuickReport) => Promise<void>;
247
- type IReportOptions = "kitchen" | "transaction" | "prasad-delivery" | "prasad" | "puja-detailed" | "puja-summary" | "combined-report" | "multi-temple-payment" | "settlements-report" | "invoice";
260
+ type IReportOptions = "kitchen" | "transaction" | "prasad-delivery" | "prasad" | "puja-detailed" | "puja-summary" | "combined-report" | "multi-temple-payment" | "settlements-report" | "invoice" | "postal-report";
248
261
  type IReportSize = "A4";
249
262
  type ReportDataTypes = {
250
263
  kitchen: KitchenReportProps;
@@ -257,6 +270,7 @@ type ReportDataTypes = {
257
270
  "multi-temple-payment": IMultiTemplePaymentReport;
258
271
  "settlements-report": ISettlementsReport;
259
272
  "invoice": IInvoiceProps;
273
+ "postal-report": IPostalReportProps;
260
274
  };
261
275
  declare class reportPrinter<T extends IReportOptions> {
262
276
  option: T;
@@ -266,4 +280,4 @@ declare class reportPrinter<T extends IReportOptions> {
266
280
  getBlob(data: ReportDataTypes[T]): Promise<Blob>;
267
281
  }
268
282
 
269
- export { A4Print, type IInvoiceData, type IInvoiceProps, type KitchenReportProps as IKitchenReport, type IMultiTemplePaymentReport, type IPrasadDelivery, type IPrasadReport, type IPrintablePuja, type IPujaReceipt, type IPujaList as IPujaReport, type ISettlementRow, type ISettlementsReport, type ISummaryPujaList as ISummaryPujaReport, type ITransactionReport, T2Inch, getA4SummaryBlob, getPrintBlob, printDevoteeReceipt2Inch, printQuickPrintReceipt2Inch, printTotalReceipt2Inch, printePujaReport2Inch, reportPrinter };
283
+ export { A4Print, type IInvoiceData, type IInvoiceProps, type KitchenReportProps as IKitchenReport, type IMultiTemplePaymentReport, type IPostalReportProps, type IPrasadDelivery, type IPrasadReport, type IPrintablePuja, type IPujaReceipt, type IPujaList as IPujaReport, type ISettlementRow, type ISettlementsReport, type ISummaryPujaList as ISummaryPujaReport, type ITransactionReport, T2Inch, getA4SummaryBlob, getPrintBlob, printDevoteeReceipt2Inch, printQuickPrintReceipt2Inch, printTotalReceipt2Inch, printePujaReport2Inch, reportPrinter };
package/dist/index.js CHANGED
@@ -218,7 +218,7 @@ var A4Print = ({
218
218
  var A4Print_default = A4Print;
219
219
 
220
220
  // src/index.tsx
221
- import React18 from "react";
221
+ import React19 from "react";
222
222
 
223
223
  // src/sizes/T2Inch.tsx
224
224
  import React2 from "react";
@@ -3592,6 +3592,77 @@ var A4Invoice = ({ data }) => {
3592
3592
  };
3593
3593
  var A4Invoice_default = A4Invoice;
3594
3594
 
3595
+ // src/sizes/a4/A4PostalReport.tsx
3596
+ import { Document as Document14, Image as Image15, Page as Page14, View as View13 } from "@react-pdf/renderer";
3597
+ import React18 from "react";
3598
+ var A4PostalReport = ({ date, templeName, data }) => {
3599
+ return /* @__PURE__ */ React18.createElement(Document14, null, /* @__PURE__ */ React18.createElement(Page14, { size: "A4", style: { padding: 30, fontFamily: "Noto Sans" } }, /* @__PURE__ */ React18.createElement(
3600
+ Image15,
3601
+ {
3602
+ fixed: true,
3603
+ style: {
3604
+ height: 15,
3605
+ width: 75,
3606
+ marginBottom: 10
3607
+ },
3608
+ src: bmpLogo
3609
+ }
3610
+ ), /* @__PURE__ */ React18.createElement(Text_default, { style: { fontSize: 11, marginTop: 5, textAlign: "right" } }, "Date: ", date.toDateString()), /* @__PURE__ */ React18.createElement(Text_default, { style: { fontSize: 14, fontWeight: "bold" } }, "Prasad Delivery Postal Report"), /* @__PURE__ */ React18.createElement(Text_default, { style: { fontSize: 12 } }, `${templeName}`), /* @__PURE__ */ React18.createElement(
3611
+ View13,
3612
+ {
3613
+ style: {
3614
+ display: "flex",
3615
+ flexDirection: "row",
3616
+ marginTop: 20,
3617
+ width: "100%",
3618
+ gap: 20,
3619
+ flexWrap: "wrap"
3620
+ }
3621
+ },
3622
+ data && data.map((item) => {
3623
+ return /* @__PURE__ */ React18.createElement(
3624
+ View13,
3625
+ {
3626
+ key: item.id,
3627
+ style: {
3628
+ width: "46%",
3629
+ display: "flex",
3630
+ flexDirection: "column",
3631
+ border: "1px solid black",
3632
+ borderStyle: "dotted",
3633
+ borderWidth: 1.5,
3634
+ padding: 6
3635
+ }
3636
+ },
3637
+ /* @__PURE__ */ React18.createElement(
3638
+ View13,
3639
+ {
3640
+ style: {
3641
+ flexGrow: 1
3642
+ }
3643
+ },
3644
+ /* @__PURE__ */ React18.createElement(Text_default, { style: { fontSize: 10, fontWeight: "bold" } }, item.name),
3645
+ /* @__PURE__ */ React18.createElement(Text_default, { style: { fontSize: 10 } }, item.address),
3646
+ /* @__PURE__ */ React18.createElement(Text_default, { style: { fontSize: 10 } }, item.phone)
3647
+ ),
3648
+ /* @__PURE__ */ React18.createElement(
3649
+ View13,
3650
+ {
3651
+ style: {
3652
+ borderTop: "1px solid black",
3653
+ marginTop: 5,
3654
+ paddingTop: 3,
3655
+ borderStyle: "dotted"
3656
+ }
3657
+ }
3658
+ ),
3659
+ /* @__PURE__ */ React18.createElement(Text_default, { style: { fontSize: 9, marginTop: 3 } }, "Note: ", item.pujaDetails)
3660
+ );
3661
+ })
3662
+ )));
3663
+ };
3664
+ var A4PostalReport_default = A4PostalReport;
3665
+
3595
3666
  // src/index.tsx
3596
3667
  var getPrintBlob = ({
3597
3668
  size,
@@ -3599,15 +3670,15 @@ var getPrintBlob = ({
3599
3670
  dates
3600
3671
  }) => {
3601
3672
  if (size === "A4") {
3602
- const blob = pdf(/* @__PURE__ */ React18.createElement(A4Print_default, { data, dates })).toBlob();
3673
+ const blob = pdf(/* @__PURE__ */ React19.createElement(A4Print_default, { data, dates })).toBlob();
3603
3674
  return blob;
3604
3675
  } else {
3605
- const blob = pdf(/* @__PURE__ */ React18.createElement(T2Inch_default, { data, dates })).toBlob();
3676
+ const blob = pdf(/* @__PURE__ */ React19.createElement(T2Inch_default, { data, dates })).toBlob();
3606
3677
  return blob;
3607
3678
  }
3608
3679
  };
3609
3680
  var getA4SummaryBlob = async () => {
3610
- const blob = await pdf(/* @__PURE__ */ React18.createElement(A4Print_default, { data: [], dates: ["", ""] })).toBlob();
3681
+ const blob = await pdf(/* @__PURE__ */ React19.createElement(A4Print_default, { data: [], dates: ["", ""] })).toBlob();
3611
3682
  return blob;
3612
3683
  };
3613
3684
  var printDevoteeReceipt2Inch = async (data) => {
@@ -3664,6 +3735,9 @@ var options = {
3664
3735
  },
3665
3736
  "invoice": {
3666
3737
  A4: A4Invoice_default
3738
+ },
3739
+ "postal-report": {
3740
+ A4: A4PostalReport_default
3667
3741
  }
3668
3742
  };
3669
3743
  var reportPrinter = class {
@@ -3878,7 +3952,7 @@ var reportPrinter = class {
3878
3952
  }
3879
3953
  async print(data) {
3880
3954
  const ReportComponent = options[this.option][this.size];
3881
- const document = /* @__PURE__ */ React18.createElement(ReportComponent, { ...data });
3955
+ const document = /* @__PURE__ */ React19.createElement(ReportComponent, { ...data });
3882
3956
  const blob = pdf(document).toBlob();
3883
3957
  blob.then((blob2) => {
3884
3958
  var blobURL = URL.createObjectURL(blob2);
@@ -3893,7 +3967,7 @@ var reportPrinter = class {
3893
3967
  }
3894
3968
  async getBlob(data) {
3895
3969
  const ReportComponent = options[this.option][this.size];
3896
- const document = /* @__PURE__ */ React18.createElement(ReportComponent, { ...data });
3970
+ const document = /* @__PURE__ */ React19.createElement(ReportComponent, { ...data });
3897
3971
  const blob = pdf(document).toBlob();
3898
3972
  return blob;
3899
3973
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bookmypuja-tech/bmp-pdf",
3
3
  "description": "PDF Report Generation for Temple360 and T-360 by BookMyPuja",
4
- "version": "0.3.20",
4
+ "version": "0.3.22",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",