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