@bookmypuja-tech/bmp-pdf 0.3.2 → 0.3.3

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
@@ -171,6 +171,24 @@ interface IMultiTemplePaymentReport {
171
171
  data: ITempleData[];
172
172
  }
173
173
 
174
+ interface ISettlementRow {
175
+ srNo: number;
176
+ settlement_amount: string;
177
+ utr: string;
178
+ invoices: {
179
+ number: string;
180
+ amount: string;
181
+ }[];
182
+ transaction_id: string;
183
+ remarks: string;
184
+ }
185
+ interface ISettlementsReport {
186
+ startDate: Date;
187
+ endDate: Date;
188
+ templeName: string;
189
+ settlements: ISettlementRow[];
190
+ }
191
+
174
192
  type sizeOptions = "A4" | "2Inch";
175
193
  declare const getPrintBlob: ({ size, data, dates, }: {
176
194
  size: sizeOptions;
@@ -182,7 +200,7 @@ declare const printDevoteeReceipt2Inch: (data: IPujaReceipt) => Promise<void>;
182
200
  declare const printTotalReceipt2Inch: (data: ITotalReceipt) => Promise<void>;
183
201
  declare const printePujaReport2Inch: (data: IPujaReport) => Promise<void>;
184
202
  declare const printQuickPrintReceipt2Inch: (data: IQuickReport) => Promise<void>;
185
- type IReportOptions = "kitchen" | "transaction" | "prasad-delivery" | "prasad" | "puja-detailed" | "puja-summary" | "combined-report" | "multi-temple-payment";
203
+ type IReportOptions = "kitchen" | "transaction" | "prasad-delivery" | "prasad" | "puja-detailed" | "puja-summary" | "combined-report" | "multi-temple-payment" | "settlements-report";
186
204
  type IReportSize = "A4";
187
205
  type ReportDataTypes = {
188
206
  kitchen: KitchenReportProps;
@@ -193,6 +211,7 @@ type ReportDataTypes = {
193
211
  "puja-summary": ISummaryPujaList;
194
212
  "combined-report": CombinedReportData;
195
213
  "multi-temple-payment": IMultiTemplePaymentReport;
214
+ "settlements-report": ISettlementsReport;
196
215
  };
197
216
  declare class reportPrinter<T extends IReportOptions> {
198
217
  option: T;
@@ -202,4 +221,4 @@ declare class reportPrinter<T extends IReportOptions> {
202
221
  getBlob(data: ReportDataTypes[T]): Promise<Blob>;
203
222
  }
204
223
 
205
- 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 };
224
+ export { A4Print, 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 };
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 React16 from "react";
219
+ import React17 from "react";
220
220
 
221
221
  // src/sizes/T2Inch.tsx
222
222
  import React2 from "react";
@@ -2817,6 +2817,212 @@ var A4MultiTemplePaymentReport = ({
2817
2817
  };
2818
2818
  var A4MultiTemplePaymentReport_default = A4MultiTemplePaymentReport;
2819
2819
 
2820
+ // src/sizes/a4/A4SettlementsReport.tsx
2821
+ import React16 from "react";
2822
+ import { Page as Page12, Document as Document12, Image as Image13, View as View11 } from "@react-pdf/renderer";
2823
+ var A4SettlementsReport = ({
2824
+ startDate,
2825
+ endDate,
2826
+ templeName,
2827
+ settlements
2828
+ }) => {
2829
+ return /* @__PURE__ */ React16.createElement(Document12, null, /* @__PURE__ */ React16.createElement(
2830
+ Page12,
2831
+ {
2832
+ size: "A4",
2833
+ style: {
2834
+ padding: 30,
2835
+ fontFamily: "Noto Sans"
2836
+ }
2837
+ },
2838
+ /* @__PURE__ */ React16.createElement(
2839
+ Image13,
2840
+ {
2841
+ fixed: true,
2842
+ style: {
2843
+ height: 15,
2844
+ width: 75,
2845
+ marginBottom: 10
2846
+ },
2847
+ src: bmpLogo
2848
+ }
2849
+ ),
2850
+ /* @__PURE__ */ React16.createElement(Text_default, { style: { fontSize: 11, marginTop: 5, textAlign: "right" } }, "Dates: ", startDate.toDateString(), " - ", endDate.toDateString()),
2851
+ /* @__PURE__ */ React16.createElement(Text_default, { style: { fontSize: 14, fontWeight: "bold" } }, "Settlements Report"),
2852
+ /* @__PURE__ */ React16.createElement(Text_default, { style: { fontSize: 12 } }, `${templeName}`),
2853
+ /* @__PURE__ */ React16.createElement(
2854
+ View11,
2855
+ {
2856
+ style: {
2857
+ display: "flex",
2858
+ flexDirection: "column",
2859
+ marginTop: 20
2860
+ }
2861
+ },
2862
+ /* @__PURE__ */ React16.createElement(
2863
+ View11,
2864
+ {
2865
+ style: {
2866
+ display: "flex",
2867
+ flexDirection: "row",
2868
+ border: "1px solid #000",
2869
+ fontSize: 10,
2870
+ fontWeight: "semibold"
2871
+ }
2872
+ },
2873
+ /* @__PURE__ */ React16.createElement(
2874
+ View11,
2875
+ {
2876
+ style: {
2877
+ padding: 6,
2878
+ borderRight: "1px solid #000",
2879
+ width: "10%"
2880
+ }
2881
+ },
2882
+ /* @__PURE__ */ React16.createElement(Text_default, null, "Sr no")
2883
+ ),
2884
+ /* @__PURE__ */ React16.createElement(
2885
+ View11,
2886
+ {
2887
+ style: {
2888
+ padding: 6,
2889
+ borderRight: "1px solid #000",
2890
+ width: "15%"
2891
+ }
2892
+ },
2893
+ /* @__PURE__ */ React16.createElement(Text_default, null, "Settlement")
2894
+ ),
2895
+ /* @__PURE__ */ React16.createElement(
2896
+ View11,
2897
+ {
2898
+ style: {
2899
+ padding: 6,
2900
+ borderRight: "1px solid #000",
2901
+ width: "20%"
2902
+ }
2903
+ },
2904
+ /* @__PURE__ */ React16.createElement(Text_default, null, "UTR")
2905
+ ),
2906
+ /* @__PURE__ */ React16.createElement(
2907
+ View11,
2908
+ {
2909
+ style: {
2910
+ padding: 6,
2911
+ borderRight: "1px solid #000",
2912
+ width: "25%"
2913
+ }
2914
+ },
2915
+ /* @__PURE__ */ React16.createElement(Text_default, null, "Invoice")
2916
+ ),
2917
+ /* @__PURE__ */ React16.createElement(
2918
+ View11,
2919
+ {
2920
+ style: {
2921
+ padding: 6,
2922
+ borderRight: "1px solid #000",
2923
+ width: "20%"
2924
+ }
2925
+ },
2926
+ /* @__PURE__ */ React16.createElement(Text_default, null, "Transaction ID")
2927
+ ),
2928
+ /* @__PURE__ */ React16.createElement(
2929
+ View11,
2930
+ {
2931
+ style: {
2932
+ padding: 6,
2933
+ // borderRight: "1px solid #000",
2934
+ width: "15%"
2935
+ }
2936
+ },
2937
+ /* @__PURE__ */ React16.createElement(Text_default, null, "Remarks")
2938
+ )
2939
+ ),
2940
+ settlements?.map((item, index) => {
2941
+ return /* @__PURE__ */ React16.createElement(
2942
+ View11,
2943
+ {
2944
+ style: {
2945
+ display: "flex",
2946
+ flexDirection: "row",
2947
+ border: "1px solid #000",
2948
+ borderTop: "none",
2949
+ fontSize: 10
2950
+ }
2951
+ },
2952
+ /* @__PURE__ */ React16.createElement(
2953
+ View11,
2954
+ {
2955
+ style: {
2956
+ padding: 6,
2957
+ borderRight: "1px solid #000",
2958
+ width: "10%"
2959
+ }
2960
+ },
2961
+ /* @__PURE__ */ React16.createElement(Text_default, null, index + 1)
2962
+ ),
2963
+ /* @__PURE__ */ React16.createElement(
2964
+ View11,
2965
+ {
2966
+ style: {
2967
+ padding: 6,
2968
+ borderRight: "1px solid #000",
2969
+ width: "15%"
2970
+ }
2971
+ },
2972
+ /* @__PURE__ */ React16.createElement(Text_default, null, item.settlement_amount)
2973
+ ),
2974
+ /* @__PURE__ */ React16.createElement(
2975
+ View11,
2976
+ {
2977
+ style: {
2978
+ padding: 6,
2979
+ borderRight: "1px solid #000",
2980
+ width: "20%",
2981
+ fontSize: 9
2982
+ }
2983
+ },
2984
+ /* @__PURE__ */ React16.createElement(Text_default, null, item.utr)
2985
+ ),
2986
+ /* @__PURE__ */ React16.createElement(
2987
+ View11,
2988
+ {
2989
+ style: {
2990
+ padding: 6,
2991
+ borderRight: "1px solid #000",
2992
+ width: "25%",
2993
+ fontSize: 9
2994
+ }
2995
+ },
2996
+ /* @__PURE__ */ React16.createElement(
2997
+ View11,
2998
+ {
2999
+ style: {
3000
+ display: "flex",
3001
+ flexDirection: "column"
3002
+ }
3003
+ },
3004
+ item.invoices.map((invoice, idx) => /* @__PURE__ */ React16.createElement(Text_default, { key: idx }, invoice.number, " (", invoice.amount, ")"))
3005
+ )
3006
+ ),
3007
+ /* @__PURE__ */ React16.createElement(
3008
+ View11,
3009
+ {
3010
+ style: {
3011
+ padding: 6,
3012
+ borderRight: "1px solid #000",
3013
+ width: "20%"
3014
+ }
3015
+ },
3016
+ /* @__PURE__ */ React16.createElement(Text_default, null, item.transaction_id)
3017
+ ),
3018
+ /* @__PURE__ */ React16.createElement(View11, { style: { padding: 6, width: "15%", fontSize: 7 } }, /* @__PURE__ */ React16.createElement(Text_default, null, item.remarks))
3019
+ );
3020
+ })
3021
+ )
3022
+ ));
3023
+ };
3024
+ var A4SettlementsReport_default = A4SettlementsReport;
3025
+
2820
3026
  // src/index.tsx
2821
3027
  var getPrintBlob = ({
2822
3028
  size,
@@ -2824,15 +3030,15 @@ var getPrintBlob = ({
2824
3030
  dates
2825
3031
  }) => {
2826
3032
  if (size === "A4") {
2827
- const blob = pdf(/* @__PURE__ */ React16.createElement(A4Print_default, { data, dates })).toBlob();
3033
+ const blob = pdf(/* @__PURE__ */ React17.createElement(A4Print_default, { data, dates })).toBlob();
2828
3034
  return blob;
2829
3035
  } else {
2830
- const blob = pdf(/* @__PURE__ */ React16.createElement(T2Inch_default, { data, dates })).toBlob();
3036
+ const blob = pdf(/* @__PURE__ */ React17.createElement(T2Inch_default, { data, dates })).toBlob();
2831
3037
  return blob;
2832
3038
  }
2833
3039
  };
2834
3040
  var getA4SummaryBlob = async () => {
2835
- const blob = await pdf(/* @__PURE__ */ React16.createElement(A4Print_default, { data: [], dates: ["", ""] })).toBlob();
3041
+ const blob = await pdf(/* @__PURE__ */ React17.createElement(A4Print_default, { data: [], dates: ["", ""] })).toBlob();
2836
3042
  return blob;
2837
3043
  };
2838
3044
  var printDevoteeReceipt2Inch = async (data) => {
@@ -2883,6 +3089,9 @@ var options = {
2883
3089
  },
2884
3090
  "multi-temple-payment": {
2885
3091
  A4: A4MultiTemplePaymentReport_default
3092
+ },
3093
+ "settlements-report": {
3094
+ A4: A4SettlementsReport_default
2886
3095
  }
2887
3096
  };
2888
3097
  var reportPrinter = class {
@@ -3097,7 +3306,7 @@ var reportPrinter = class {
3097
3306
  }
3098
3307
  async print(data) {
3099
3308
  const ReportComponent = options[this.option][this.size];
3100
- const document = /* @__PURE__ */ React16.createElement(ReportComponent, { ...data });
3309
+ const document = /* @__PURE__ */ React17.createElement(ReportComponent, { ...data });
3101
3310
  const blob = pdf(document).toBlob();
3102
3311
  blob.then((blob2) => {
3103
3312
  var blobURL = URL.createObjectURL(blob2);
@@ -3112,7 +3321,7 @@ var reportPrinter = class {
3112
3321
  }
3113
3322
  async getBlob(data) {
3114
3323
  const ReportComponent = options[this.option][this.size];
3115
- const document = /* @__PURE__ */ React16.createElement(ReportComponent, { ...data });
3324
+ const document = /* @__PURE__ */ React17.createElement(ReportComponent, { ...data });
3116
3325
  const blob = pdf(document).toBlob();
3117
3326
  return blob;
3118
3327
  }
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.2",
4
+ "version": "0.3.3",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",