@bookmypuja-tech/bmp-pdf 0.3.30 → 0.3.32

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
@@ -228,9 +228,19 @@ interface IInvoiceData {
228
228
  subTotal: string;
229
229
  paymentMethod: string;
230
230
  prasads?: {
231
- name: string;
232
- timings: string;
233
- }[];
231
+ morning: {
232
+ name: string;
233
+ timings: string;
234
+ }[];
235
+ afternoon: {
236
+ name: string;
237
+ timings: string;
238
+ }[];
239
+ evening: {
240
+ name: string;
241
+ timings: string;
242
+ }[];
243
+ };
234
244
  }
235
245
  interface IInvoiceProps {
236
246
  data: IInvoiceData;
package/dist/index.js CHANGED
@@ -1835,32 +1835,31 @@ var A4PujaList = ({
1835
1835
  gap: 15
1836
1836
  }
1837
1837
  },
1838
- pujas.map((puja, pujaIndex) => {
1839
- if (!puja.bookings.some((booking) => booking.requires_coupon))
1840
- return null;
1841
- return puja.bookings.map((booking, bookingIndex) => {
1842
- if (!booking.requires_coupon) return null;
1843
- return /* @__PURE__ */ React12.createElement(
1844
- View7,
1845
- {
1846
- key: bookingIndex,
1847
- style: {
1848
- marginBottom: 10,
1849
- fontSize: 18,
1850
- padding: 10,
1851
- border: "1px dotted black"
1852
- },
1853
- wrap: false
1854
- },
1855
- /* @__PURE__ */ React12.createElement(
1838
+ (() => {
1839
+ const allCouponBookings = pujas.flatMap(
1840
+ (puja) => puja.bookings.filter((booking) => booking.requires_coupon).map((booking) => ({ ...booking, pujaName: puja.name }))
1841
+ );
1842
+ const grouped = {};
1843
+ for (const booking of allCouponBookings) {
1844
+ if (!grouped[booking.invoiceNumber])
1845
+ grouped[booking.invoiceNumber] = [];
1846
+ grouped[booking.invoiceNumber].push(booking);
1847
+ }
1848
+ return Object.entries(grouped).map(
1849
+ ([invoiceNumber, bookings], groupIdx) => {
1850
+ const bookingsArr = bookings;
1851
+ const first = bookingsArr[0];
1852
+ return /* @__PURE__ */ React12.createElement(
1856
1853
  View7,
1857
1854
  {
1855
+ key: invoiceNumber,
1858
1856
  style: {
1859
- display: "flex",
1860
- flexDirection: "row",
1861
- justifyContent: "space-between",
1862
- gap: 10
1863
- }
1857
+ marginBottom: 10,
1858
+ fontSize: 18,
1859
+ padding: 10,
1860
+ border: "1px dotted black"
1861
+ },
1862
+ wrap: false
1864
1863
  },
1865
1864
  /* @__PURE__ */ React12.createElement(
1866
1865
  View7,
@@ -1868,44 +1867,43 @@ var A4PujaList = ({
1868
1867
  style: {
1869
1868
  display: "flex",
1870
1869
  flexDirection: "row",
1870
+ justifyContent: "space-between",
1871
1871
  gap: 10
1872
1872
  }
1873
1873
  },
1874
1874
  /* @__PURE__ */ React12.createElement(
1875
- Text_default,
1875
+ View7,
1876
1876
  {
1877
1877
  style: {
1878
- fontWeight: "semibold"
1878
+ display: "flex",
1879
+ flexDirection: "row",
1880
+ gap: 10
1879
1881
  }
1880
1882
  },
1881
- booking.invoiceNumber
1883
+ /* @__PURE__ */ React12.createElement(Text_default, { style: { fontWeight: "semibold" } }, invoiceNumber),
1884
+ /* @__PURE__ */ React12.createElement(Text_default, null, first.date ? new Date(first.date).toDateString() : date.toDateString())
1882
1885
  ),
1883
- /* @__PURE__ */ React12.createElement(Text_default, null, booking.date ? new Date(booking.date).toDateString() : date.toDateString())
1886
+ /* @__PURE__ */ React12.createElement(Text_default, null, first.phone_number)
1884
1887
  ),
1885
- /* @__PURE__ */ React12.createElement(Text_default, null, booking.phone_number)
1886
- ),
1887
- /* @__PURE__ */ React12.createElement(
1888
- View7,
1889
- {
1890
- style: {
1891
- height: 15,
1892
- width: "100%"
1893
- }
1894
- }
1895
- ),
1896
- /* @__PURE__ */ React12.createElement(
1897
- View7,
1898
- {
1899
- style: {
1900
- display: "flex",
1901
- flexDirection: "row"
1902
- }
1903
- },
1904
- /* @__PURE__ */ React12.createElement(Text_default, null, `${booking.devoteeName} ----- ${booking.nakshatra} ----- ${puja.name}`)
1905
- )
1906
- );
1907
- });
1908
- })
1888
+ /* @__PURE__ */ React12.createElement(View7, { style: { height: 15, width: "100%" } }),
1889
+ bookingsArr.map(
1890
+ (booking, idx) => /* @__PURE__ */ React12.createElement(
1891
+ View7,
1892
+ {
1893
+ key: idx,
1894
+ style: {
1895
+ display: "flex",
1896
+ flexDirection: "row",
1897
+ marginTop: 25
1898
+ }
1899
+ },
1900
+ /* @__PURE__ */ React12.createElement(Text_default, null, `${booking.devoteeName} ----- ${booking.nakshatra} ----- ${booking.pujaName}`)
1901
+ )
1902
+ )
1903
+ );
1904
+ }
1905
+ );
1906
+ })()
1909
1907
  )) : null));
1910
1908
  };
1911
1909
  var A4PujaList_default = A4PujaList;
@@ -2490,32 +2488,31 @@ var A4CombinedReport = ({
2490
2488
  gap: 15
2491
2489
  }
2492
2490
  },
2493
- pujaData.map((puja, pujaIndex) => {
2494
- if (!puja.bookings.some((booking) => booking.requires_coupon))
2495
- return null;
2496
- return puja.bookings.map((booking, bookingIndex) => {
2497
- if (!booking.requires_coupon) return null;
2498
- return /* @__PURE__ */ React14.createElement(
2499
- View9,
2500
- {
2501
- key: bookingIndex,
2502
- style: {
2503
- marginBottom: 10,
2504
- fontSize: 18,
2505
- padding: 10,
2506
- border: "1px dotted black"
2507
- },
2508
- wrap: false
2509
- },
2510
- /* @__PURE__ */ React14.createElement(
2491
+ (() => {
2492
+ const allCouponBookings = pujaData.flatMap(
2493
+ (puja) => puja.bookings.filter((booking) => booking.requires_coupon).map((booking) => ({ ...booking, pujaName: puja.name }))
2494
+ );
2495
+ const grouped = {};
2496
+ for (const booking of allCouponBookings) {
2497
+ if (!grouped[booking.invoiceNumber])
2498
+ grouped[booking.invoiceNumber] = [];
2499
+ grouped[booking.invoiceNumber].push(booking);
2500
+ }
2501
+ return Object.entries(grouped).map(
2502
+ ([invoiceNumber, bookings], groupIdx) => {
2503
+ const bookingsArr = bookings;
2504
+ const first = bookingsArr[0];
2505
+ return /* @__PURE__ */ React14.createElement(
2511
2506
  View9,
2512
2507
  {
2508
+ key: invoiceNumber,
2513
2509
  style: {
2514
- display: "flex",
2515
- flexDirection: "row",
2516
- justifyContent: "space-between",
2517
- gap: 10
2518
- }
2510
+ marginBottom: 10,
2511
+ fontSize: 18,
2512
+ padding: 10,
2513
+ border: "1px dotted black"
2514
+ },
2515
+ wrap: false
2519
2516
  },
2520
2517
  /* @__PURE__ */ React14.createElement(
2521
2518
  View9,
@@ -2523,44 +2520,43 @@ var A4CombinedReport = ({
2523
2520
  style: {
2524
2521
  display: "flex",
2525
2522
  flexDirection: "row",
2523
+ justifyContent: "space-between",
2526
2524
  gap: 10
2527
2525
  }
2528
2526
  },
2529
2527
  /* @__PURE__ */ React14.createElement(
2530
- Text_default,
2528
+ View9,
2531
2529
  {
2532
2530
  style: {
2533
- fontWeight: "semibold"
2531
+ display: "flex",
2532
+ flexDirection: "row",
2533
+ gap: 10
2534
2534
  }
2535
2535
  },
2536
- booking.invoiceNumber
2536
+ /* @__PURE__ */ React14.createElement(Text_default, { style: { fontWeight: "semibold" } }, invoiceNumber),
2537
+ /* @__PURE__ */ React14.createElement(Text_default, null, first.date ? new Date(first.date).toDateString() : date.toDateString())
2537
2538
  ),
2538
- /* @__PURE__ */ React14.createElement(Text_default, null, booking.date ? new Date(booking.date).toDateString() : date.toDateString())
2539
+ /* @__PURE__ */ React14.createElement(Text_default, null, first.phone_number)
2539
2540
  ),
2540
- /* @__PURE__ */ React14.createElement(Text_default, null, booking.phone_number)
2541
- ),
2542
- /* @__PURE__ */ React14.createElement(
2543
- View9,
2544
- {
2545
- style: {
2546
- height: 15,
2547
- width: "100%"
2548
- }
2549
- }
2550
- ),
2551
- /* @__PURE__ */ React14.createElement(
2552
- View9,
2553
- {
2554
- style: {
2555
- display: "flex",
2556
- flexDirection: "row"
2557
- }
2558
- },
2559
- /* @__PURE__ */ React14.createElement(Text_default, null, `${booking.devoteeName} ----- ${booking.nakshatra} ----- ${puja.name}`)
2560
- )
2561
- );
2562
- });
2563
- })
2541
+ /* @__PURE__ */ React14.createElement(View9, { style: { height: 15, width: "100%" } }),
2542
+ bookingsArr.map(
2543
+ (booking, idx) => /* @__PURE__ */ React14.createElement(
2544
+ View9,
2545
+ {
2546
+ key: idx,
2547
+ style: {
2548
+ display: "flex",
2549
+ flexDirection: "row",
2550
+ marginTop: 25
2551
+ }
2552
+ },
2553
+ /* @__PURE__ */ React14.createElement(Text_default, null, `${booking.devoteeName} ----- ${booking.nakshatra} ----- ${booking.pujaName}`)
2554
+ )
2555
+ )
2556
+ );
2557
+ }
2558
+ );
2559
+ })()
2564
2560
  )), prasadData.length > 0 && /* @__PURE__ */ React14.createElement(Page10, { size: "A4", style: { padding: 30, fontFamily: "Noto Sans" } }, /* @__PURE__ */ React14.createElement(
2565
2561
  Image11,
2566
2562
  {
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.30",
4
+ "version": "0.3.32",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",