@bookmypuja-tech/bmp-pdf 0.2.23 → 0.2.24
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 +13 -2
- package/dist/index.js +153 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -159,6 +159,16 @@ interface CombinedReportData {
|
|
|
159
159
|
deliveryData: IPrasadItem$1[];
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
interface ITempleData {
|
|
163
|
+
name: string;
|
|
164
|
+
revenue: number;
|
|
165
|
+
bookings: number;
|
|
166
|
+
}
|
|
167
|
+
interface IMultiTemplePaymentReport {
|
|
168
|
+
date: Date;
|
|
169
|
+
data: ITempleData[];
|
|
170
|
+
}
|
|
171
|
+
|
|
162
172
|
type sizeOptions = "A4" | "2Inch";
|
|
163
173
|
declare const getPrintBlob: ({ size, data, dates, }: {
|
|
164
174
|
size: sizeOptions;
|
|
@@ -170,7 +180,7 @@ declare const printDevoteeReceipt2Inch: (data: IPujaReceipt) => Promise<void>;
|
|
|
170
180
|
declare const printTotalReceipt2Inch: (data: ITotalReceipt) => Promise<void>;
|
|
171
181
|
declare const printePujaReport2Inch: (data: IPujaReport) => Promise<void>;
|
|
172
182
|
declare const printQuickPrintReceipt2Inch: (data: IQuickReport) => Promise<void>;
|
|
173
|
-
type IReportOptions = "kitchen" | "transaction" | "prasad-delivery" | "prasad" | "puja-detailed" | "puja-summary" | "combined-report";
|
|
183
|
+
type IReportOptions = "kitchen" | "transaction" | "prasad-delivery" | "prasad" | "puja-detailed" | "puja-summary" | "combined-report" | "multi-temple-payment";
|
|
174
184
|
type IReportSize = "A4";
|
|
175
185
|
type ReportDataTypes = {
|
|
176
186
|
kitchen: KitchenReportProps;
|
|
@@ -180,6 +190,7 @@ type ReportDataTypes = {
|
|
|
180
190
|
"puja-detailed": IPujaList;
|
|
181
191
|
"puja-summary": ISummaryPujaList;
|
|
182
192
|
"combined-report": CombinedReportData;
|
|
193
|
+
"multi-temple-payment": IMultiTemplePaymentReport;
|
|
183
194
|
};
|
|
184
195
|
declare class reportPrinter<T extends IReportOptions> {
|
|
185
196
|
option: T;
|
|
@@ -189,4 +200,4 @@ declare class reportPrinter<T extends IReportOptions> {
|
|
|
189
200
|
getBlob(data: ReportDataTypes[T]): Promise<Blob>;
|
|
190
201
|
}
|
|
191
202
|
|
|
192
|
-
export { A4Print, type KitchenReportProps as IKitchenReport, type IPrasadDelivery, type IPrasadReport, type IPrintablePuja, type IPujaReceipt, type IPujaList as IPujaReport, type ISummaryPujaList as ISummaryPujaReport, type ITransactionReport, T2Inch, getA4SummaryBlob, getPrintBlob, printDevoteeReceipt2Inch, printQuickPrintReceipt2Inch, printTotalReceipt2Inch, printePujaReport2Inch, reportPrinter };
|
|
203
|
+
export { A4Print, type KitchenReportProps as IKitchenReport, type IMultiTemplePaymentReport, type IPrasadDelivery, type IPrasadReport, type IPrintablePuja, type IPujaReceipt, type IPujaList as IPujaReport, type ISummaryPujaList as ISummaryPujaReport, type ITransactionReport, T2Inch, getA4SummaryBlob, getPrintBlob, printDevoteeReceipt2Inch, printQuickPrintReceipt2Inch, printTotalReceipt2Inch, printePujaReport2Inch, reportPrinter };
|
package/dist/index.js
CHANGED
|
@@ -216,7 +216,7 @@ var A4Print = ({
|
|
|
216
216
|
var A4Print_default = A4Print;
|
|
217
217
|
|
|
218
218
|
// src/index.tsx
|
|
219
|
-
import
|
|
219
|
+
import React15 from "react";
|
|
220
220
|
|
|
221
221
|
// src/sizes/T2Inch.tsx
|
|
222
222
|
import React2 from "react";
|
|
@@ -2570,6 +2570,150 @@ var A4CombinedReport = ({
|
|
|
2570
2570
|
};
|
|
2571
2571
|
var A4CombinedReport_default = A4CombinedReport;
|
|
2572
2572
|
|
|
2573
|
+
// src/sizes/a4/A4MultiTemplePaymentReport.tsx
|
|
2574
|
+
import { Document as Document10, Image as Image12, Page as Page10, Text as Text14, View as View10 } from "@react-pdf/renderer";
|
|
2575
|
+
import React14 from "react";
|
|
2576
|
+
var A4MultiTemplePaymentReport = ({
|
|
2577
|
+
date,
|
|
2578
|
+
data
|
|
2579
|
+
}) => {
|
|
2580
|
+
return /* @__PURE__ */ React14.createElement(Document10, null, /* @__PURE__ */ React14.createElement(Page10, { size: "A4", style: { padding: 30, fontFamily: "Noto Sans" } }, /* @__PURE__ */ React14.createElement(
|
|
2581
|
+
Image12,
|
|
2582
|
+
{
|
|
2583
|
+
fixed: true,
|
|
2584
|
+
style: {
|
|
2585
|
+
height: 15,
|
|
2586
|
+
width: 75,
|
|
2587
|
+
marginBottom: 10
|
|
2588
|
+
},
|
|
2589
|
+
src: bmpLogo
|
|
2590
|
+
}
|
|
2591
|
+
), /* @__PURE__ */ React14.createElement(Text14, { style: { fontSize: 11, marginTop: 5, textAlign: "right" } }, "Date: ", date.toDateString()), /* @__PURE__ */ React14.createElement(Text14, { style: { fontSize: 14, fontWeight: "bold" } }, "Temple Payment Report"), /* @__PURE__ */ React14.createElement(
|
|
2592
|
+
View10,
|
|
2593
|
+
{
|
|
2594
|
+
style: {
|
|
2595
|
+
display: "flex",
|
|
2596
|
+
flexDirection: "column",
|
|
2597
|
+
marginTop: 20
|
|
2598
|
+
}
|
|
2599
|
+
},
|
|
2600
|
+
/* @__PURE__ */ React14.createElement(
|
|
2601
|
+
View10,
|
|
2602
|
+
{
|
|
2603
|
+
style: {
|
|
2604
|
+
display: "flex",
|
|
2605
|
+
flexDirection: "row",
|
|
2606
|
+
border: "1px solid black",
|
|
2607
|
+
fontWeight: "semibold",
|
|
2608
|
+
fontSize: 10
|
|
2609
|
+
}
|
|
2610
|
+
},
|
|
2611
|
+
/* @__PURE__ */ React14.createElement(
|
|
2612
|
+
View10,
|
|
2613
|
+
{
|
|
2614
|
+
style: {
|
|
2615
|
+
padding: 6,
|
|
2616
|
+
borderRight: "1px solid black",
|
|
2617
|
+
width: "10%"
|
|
2618
|
+
}
|
|
2619
|
+
},
|
|
2620
|
+
/* @__PURE__ */ React14.createElement(Text14, null, "S.No.")
|
|
2621
|
+
),
|
|
2622
|
+
/* @__PURE__ */ React14.createElement(
|
|
2623
|
+
View10,
|
|
2624
|
+
{
|
|
2625
|
+
style: {
|
|
2626
|
+
padding: 6,
|
|
2627
|
+
borderRight: "1px solid black",
|
|
2628
|
+
width: "55%"
|
|
2629
|
+
}
|
|
2630
|
+
},
|
|
2631
|
+
/* @__PURE__ */ React14.createElement(Text14, null, "Temple Name")
|
|
2632
|
+
),
|
|
2633
|
+
/* @__PURE__ */ React14.createElement(
|
|
2634
|
+
View10,
|
|
2635
|
+
{
|
|
2636
|
+
style: {
|
|
2637
|
+
padding: 6,
|
|
2638
|
+
borderRight: "1px solid black",
|
|
2639
|
+
width: "15%"
|
|
2640
|
+
}
|
|
2641
|
+
},
|
|
2642
|
+
/* @__PURE__ */ React14.createElement(Text14, null, "Bookings")
|
|
2643
|
+
),
|
|
2644
|
+
/* @__PURE__ */ React14.createElement(
|
|
2645
|
+
View10,
|
|
2646
|
+
{
|
|
2647
|
+
style: {
|
|
2648
|
+
padding: 6,
|
|
2649
|
+
width: "20%"
|
|
2650
|
+
}
|
|
2651
|
+
},
|
|
2652
|
+
/* @__PURE__ */ React14.createElement(Text14, null, "Revenue")
|
|
2653
|
+
)
|
|
2654
|
+
),
|
|
2655
|
+
data?.map((temple, index) => {
|
|
2656
|
+
return /* @__PURE__ */ React14.createElement(
|
|
2657
|
+
View10,
|
|
2658
|
+
{
|
|
2659
|
+
key: index,
|
|
2660
|
+
style: {
|
|
2661
|
+
display: "flex",
|
|
2662
|
+
flexDirection: "row",
|
|
2663
|
+
border: "1px solid black",
|
|
2664
|
+
borderTop: "none",
|
|
2665
|
+
fontSize: 10
|
|
2666
|
+
}
|
|
2667
|
+
},
|
|
2668
|
+
/* @__PURE__ */ React14.createElement(
|
|
2669
|
+
View10,
|
|
2670
|
+
{
|
|
2671
|
+
style: {
|
|
2672
|
+
padding: 6,
|
|
2673
|
+
borderRight: "1px solid black",
|
|
2674
|
+
width: "10%"
|
|
2675
|
+
}
|
|
2676
|
+
},
|
|
2677
|
+
/* @__PURE__ */ React14.createElement(Text14, null, index + 1)
|
|
2678
|
+
),
|
|
2679
|
+
/* @__PURE__ */ React14.createElement(
|
|
2680
|
+
View10,
|
|
2681
|
+
{
|
|
2682
|
+
style: {
|
|
2683
|
+
padding: 6,
|
|
2684
|
+
borderRight: "1px solid black",
|
|
2685
|
+
width: "55%"
|
|
2686
|
+
}
|
|
2687
|
+
},
|
|
2688
|
+
/* @__PURE__ */ React14.createElement(Text14, null, temple.name)
|
|
2689
|
+
),
|
|
2690
|
+
/* @__PURE__ */ React14.createElement(
|
|
2691
|
+
View10,
|
|
2692
|
+
{
|
|
2693
|
+
style: {
|
|
2694
|
+
padding: 6,
|
|
2695
|
+
borderRight: "1px solid black",
|
|
2696
|
+
width: "15%"
|
|
2697
|
+
}
|
|
2698
|
+
},
|
|
2699
|
+
/* @__PURE__ */ React14.createElement(Text14, null, temple.bookings)
|
|
2700
|
+
),
|
|
2701
|
+
/* @__PURE__ */ React14.createElement(
|
|
2702
|
+
View10,
|
|
2703
|
+
{
|
|
2704
|
+
style: {
|
|
2705
|
+
padding: 6,
|
|
2706
|
+
width: "20%"
|
|
2707
|
+
}
|
|
2708
|
+
},
|
|
2709
|
+
/* @__PURE__ */ React14.createElement(Text14, null, "\u20B9", temple.revenue)
|
|
2710
|
+
)
|
|
2711
|
+
);
|
|
2712
|
+
})
|
|
2713
|
+
)));
|
|
2714
|
+
};
|
|
2715
|
+
var A4MultiTemplePaymentReport_default = A4MultiTemplePaymentReport;
|
|
2716
|
+
|
|
2573
2717
|
// src/index.tsx
|
|
2574
2718
|
var getPrintBlob = ({
|
|
2575
2719
|
size,
|
|
@@ -2577,15 +2721,15 @@ var getPrintBlob = ({
|
|
|
2577
2721
|
dates
|
|
2578
2722
|
}) => {
|
|
2579
2723
|
if (size === "A4") {
|
|
2580
|
-
const blob = pdf(/* @__PURE__ */
|
|
2724
|
+
const blob = pdf(/* @__PURE__ */ React15.createElement(A4Print_default, { data, dates })).toBlob();
|
|
2581
2725
|
return blob;
|
|
2582
2726
|
} else {
|
|
2583
|
-
const blob = pdf(/* @__PURE__ */
|
|
2727
|
+
const blob = pdf(/* @__PURE__ */ React15.createElement(T2Inch_default, { data, dates })).toBlob();
|
|
2584
2728
|
return blob;
|
|
2585
2729
|
}
|
|
2586
2730
|
};
|
|
2587
2731
|
var getA4SummaryBlob = async () => {
|
|
2588
|
-
const blob = await pdf(/* @__PURE__ */
|
|
2732
|
+
const blob = await pdf(/* @__PURE__ */ React15.createElement(A4Print_default, { data: [], dates: ["", ""] })).toBlob();
|
|
2589
2733
|
return blob;
|
|
2590
2734
|
};
|
|
2591
2735
|
var printDevoteeReceipt2Inch = async (data) => {
|
|
@@ -2633,6 +2777,9 @@ var options = {
|
|
|
2633
2777
|
},
|
|
2634
2778
|
"combined-report": {
|
|
2635
2779
|
A4: A4CombinedReport_default
|
|
2780
|
+
},
|
|
2781
|
+
"multi-temple-payment": {
|
|
2782
|
+
A4: A4MultiTemplePaymentReport_default
|
|
2636
2783
|
}
|
|
2637
2784
|
};
|
|
2638
2785
|
var reportPrinter = class {
|
|
@@ -2659,7 +2806,7 @@ var reportPrinter = class {
|
|
|
2659
2806
|
}
|
|
2660
2807
|
async print(data) {
|
|
2661
2808
|
const ReportComponent = options[this.option][this.size];
|
|
2662
|
-
const document = /* @__PURE__ */
|
|
2809
|
+
const document = /* @__PURE__ */ React15.createElement(ReportComponent, { ...data });
|
|
2663
2810
|
const blob = pdf(document).toBlob();
|
|
2664
2811
|
blob.then((blob2) => {
|
|
2665
2812
|
var blobURL = URL.createObjectURL(blob2);
|
|
@@ -2674,7 +2821,7 @@ var reportPrinter = class {
|
|
|
2674
2821
|
}
|
|
2675
2822
|
async getBlob(data) {
|
|
2676
2823
|
const ReportComponent = options[this.option][this.size];
|
|
2677
|
-
const document = /* @__PURE__ */
|
|
2824
|
+
const document = /* @__PURE__ */ React15.createElement(ReportComponent, { ...data });
|
|
2678
2825
|
const blob = pdf(document).toBlob();
|
|
2679
2826
|
return blob;
|
|
2680
2827
|
}
|
package/package.json
CHANGED