@ -115,7 +115,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND DATE(bd.booking_date) <= :toDate " +
"AND DATE(bd.booking_date) <= :toDate " +
"AND bd.booking_status NOT IN ('PENDING')" +
"AND bd.booking_status NOT IN ('PENDING')" +
"GROUP BY " +
"GROUP BY " +
"bd.users_user_id" , nativeQuery = true )
"bd.users_user_id order by u.user_id asc " , nativeQuery = true )
List < Object [ ] > getBookingUserDetailsReport ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate ) ;
List < Object [ ] > getBookingUserDetailsReport ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate ) ;
@ -179,7 +179,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"JOIN users us ON bd.users_user_id = us.user_id " +
"JOIN users us ON bd.users_user_id = us.user_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " +
"AND DATE(bd.booking_date) <= :toDate " +
"AND (:bookingStatus IS NULL OR bd.booking_status = :bookingStatus) " ,
"AND (:bookingStatus IS NULL OR bd.booking_status = :bookingStatus) order by bd.booking_id asc " ,
nativeQuery = true )
nativeQuery = true )
List < Object [ ] > getAllBookingDetailsWithStatus ( @Param ( "fromDate" ) String fromDate ,
List < Object [ ] > getAllBookingDetailsWithStatus ( @Param ( "fromDate" ) String fromDate ,
@Param ( "toDate" ) String toDate ,
@Param ( "toDate" ) String toDate ,
@ -194,7 +194,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"JOIN users us ON bd.users_user_id = us.user_id " +
"JOIN users us ON bd.users_user_id = us.user_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " +
"AND DATE(bd.booking_date) <= :toDate " +
"AND (:bookingId IS NULL OR bd.booking_id = :bookingId)" ,
"AND (:bookingId IS NULL OR bd.booking_id = :bookingId) order by bd.booking_id asc " ,
nativeQuery = true )
nativeQuery = true )
List < Object [ ] > getAllBookingDetailsWithBookingId ( @Param ( "fromDate" ) String fromDate ,
List < Object [ ] > getAllBookingDetailsWithBookingId ( @Param ( "fromDate" ) String fromDate ,
@Param ( "toDate" ) String toDate ,
@Param ( "toDate" ) String toDate ,
@ -210,7 +210,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"WHERE DATE(bd.booking_date) >= :fromDate " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " +
"AND DATE(bd.booking_date) <= :toDate " +
"AND (:bookingId IS NULL OR bd.booking_id = :bookingId)" +
"AND (:bookingId IS NULL OR bd.booking_id = :bookingId)" +
"AND (:bookingStatus IS NULL OR bd.booking_status = :bookingStatus)" ,
"AND (:bookingStatus IS NULL OR bd.booking_status = :bookingStatus) order by bd.booking_id asc " ,
nativeQuery = true )
nativeQuery = true )
List < Object [ ] > getAllBookingDetailsWithBookingIdwithbookingStatus ( @Param ( "fromDate" ) String fromDate ,
List < Object [ ] > getAllBookingDetailsWithBookingIdwithbookingStatus ( @Param ( "fromDate" ) String fromDate ,
@Param ( "toDate" ) String toDate ,
@Param ( "toDate" ) String toDate ,
@ -225,7 +225,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " +
"JOIN hall_details hd ON bd.hall_details_hall_id = hd.hall_id " +
"JOIN users us ON bd.users_user_id = us.user_id " +
"JOIN users us ON bd.users_user_id = us.user_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " ,
"AND DATE(bd.booking_date) <= :toDate order by bd.booking_id asc " ,
nativeQuery = true )
nativeQuery = true )
List < Object [ ] > getAllBookingDetails ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate ) ;
List < Object [ ] > getAllBookingDetails ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate ) ;
@ -322,6 +322,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
+ " WHEN bd.start_date < CURDATE() THEN 'Past'\r\n"
+ " WHEN bd.start_date < CURDATE() THEN 'Past'\r\n"
+ " WHEN bd.start_date = CURDATE() THEN 'Current'\r\n"
+ " WHEN bd.start_date = CURDATE() THEN 'Current'\r\n"
+ " WHEN bd.booking_status = 'WAITING_FOR_NOC' THEN 'waitingfornoc'\r\n"
+ " WHEN bd.booking_status = 'WAITING_FOR_NOC' THEN 'waitingfornoc'\r\n"
+ " WHEN bd.booking_status = 'WAITING_FOR_NOC_APPROVAL' THEN 'waitingfornocapproval'\r\n"
+ " WHEN bd.schedule_count = 0 AND bd.start_date > CURDATE() THEN 'Reschedule'\r\n"
+ " WHEN bd.schedule_count = 0 AND bd.start_date > CURDATE() THEN 'Reschedule'\r\n"
+ " WHEN bd.reason IN ('State Govt Event','Central Govt Event','Commericial & Others') AND bd.booking_status='APPROVED' THEN 'noaction'"
+ " WHEN bd.reason IN ('State Govt Event','Central Govt Event','Commericial & Others') AND bd.booking_status='APPROVED' THEN 'noaction'"
+ " ELSE 'Future' \r\n"
+ " ELSE 'Future' \r\n"
@ -1161,7 +1162,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) " +
"AND bd.booking_status!='PENDING' " , nativeQuery = true )
"AND bd.booking_status!='PENDING' order by bd.booking_id asc " , nativeQuery = true )
List < Object [ ] > getBookingDetailsByBookingDate ( @Param ( "fromDate" ) String fromDate ,
List < Object [ ] > getBookingDetailsByBookingDate ( @Param ( "fromDate" ) String fromDate ,
@Param ( "toDate" ) String toDate , @Param ( "zone" ) String zone , @Param ( "division" ) String division , @Param ( "hallid" ) Integer hallid ) ;
@Param ( "toDate" ) String toDate , @Param ( "zone" ) String zone , @Param ( "division" ) String division , @Param ( "hallid" ) Integer hallid ) ;
@ -1177,7 +1178,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) " +
"AND bd.booking_status = :bookingStatus " , nativeQuery = true )
"AND bd.booking_status = :bookingStatus order by bd.booking_id asc " , nativeQuery = true )
List < Object [ ] > getBookingDetailsByBookingDateWithStatus ( @Param ( "fromDate" ) String fromDate ,
List < Object [ ] > getBookingDetailsByBookingDateWithStatus ( @Param ( "fromDate" ) String fromDate ,
@Param ( "toDate" ) String toDate ,
@Param ( "toDate" ) String toDate ,
@Param ( "bookingStatus" ) String bookingStatus , @Param ( "zone" ) String zone , @Param ( "division" ) String division , @Param ( "hallid" ) Integer hallid ) ;
@Param ( "bookingStatus" ) String bookingStatus , @Param ( "zone" ) String zone , @Param ( "division" ) String division , @Param ( "hallid" ) Integer hallid ) ;
@ -1195,7 +1196,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) " +
"AND bd.booking_status!='PENDING' " , nativeQuery = true )
"AND bd.booking_status!='PENDING' order by bd.booking_id asc " , nativeQuery = true )
List < Object [ ] > getBookingDetailsByEventDate ( @Param ( "fromDate" ) String fromDate ,
List < Object [ ] > getBookingDetailsByEventDate ( @Param ( "fromDate" ) String fromDate ,
@Param ( "toDate" ) String toDate , @Param ( "zone" ) String zone , @Param ( "division" ) String division , @Param ( "hallid" ) Integer hallid ) ;
@Param ( "toDate" ) String toDate , @Param ( "zone" ) String zone , @Param ( "division" ) String division , @Param ( "hallid" ) Integer hallid ) ;
@ -1211,7 +1212,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) " +
"AND bd.booking_status = :bookingStatus" , nativeQuery = true )
"AND bd.booking_status = :bookingStatus order by bd.booking_id asc " , nativeQuery = true )
List < Object [ ] > getBookingDetailsByEventDateWithStatus ( @Param ( "fromDate" ) String fromDate ,
List < Object [ ] > getBookingDetailsByEventDateWithStatus ( @Param ( "fromDate" ) String fromDate ,
@Param ( "toDate" ) String toDate ,
@Param ( "toDate" ) String toDate ,
@Param ( "bookingStatus" ) String bookingStatus , @Param ( "zone" ) String zone , @Param ( "division" ) String division , @Param ( "hallid" ) Integer hallid ) ;
@Param ( "bookingStatus" ) String bookingStatus , @Param ( "zone" ) String zone , @Param ( "division" ) String division , @Param ( "hallid" ) Integer hallid ) ;
@ -1226,7 +1227,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:paymentStatus IS NULL OR p.payment_status = :paymentStatus)" +
"AND (:paymentStatus IS NULL OR p.payment_status = :paymentStatus)" +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) " ,
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) order by bd.booking_id asc " ,
nativeQuery = true )
nativeQuery = true )
List < Object [ ] > getAllPaymentsDetails ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate , @Param ( "paymentStatus" ) String paymentStatus , @Param ( "zone" ) String zone , @Param ( "division" ) String division , @Param ( "hallid" ) Integer hallid ) ;
List < Object [ ] > getAllPaymentsDetails ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate , @Param ( "paymentStatus" ) String paymentStatus , @Param ( "zone" ) String zone , @Param ( "division" ) String division , @Param ( "hallid" ) Integer hallid ) ;
@ -1240,7 +1241,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:paymentStatus IS NULL OR p.payment_status = :paymentStatus)" +
"AND (:paymentStatus IS NULL OR p.payment_status = :paymentStatus)" +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:zone IS NULL OR :zone = 'ALL' OR hd.zone = :zone) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:division IS NULL OR :division = 'ALL' OR hd.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) " ,
"AND (:hallid IS NULL OR :hallid = '1000' OR hd.hall_id = :hallid) order by bd.booking_id asc " ,
nativeQuery = true )
nativeQuery = true )
List < Object [ ] > getAllExtraPaymentsDetails ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate , @Param ( "paymentStatus" ) String paymentStatus , @Param ( "zone" ) String zone , @Param ( "division" ) String division , @Param ( "hallid" ) Integer hallid ) ;
List < Object [ ] > getAllExtraPaymentsDetails ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate , @Param ( "paymentStatus" ) String paymentStatus , @Param ( "zone" ) String zone , @Param ( "division" ) String division , @Param ( "hallid" ) Integer hallid ) ;
@ -1256,7 +1257,8 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"SUM(bd.gst) AS gst, " +
"SUM(bd.gst) AS gst, " +
"SUM(p.amount_received) AS AmountReceived, " +
"SUM(p.amount_received) AS AmountReceived, " +
"COALESCE(SUM(r.amount - r.balace_amount), 0) AS AmountRefund, " +
"COALESCE(SUM(r.amount - r.balace_amount), 0) AS AmountRefund, " +
"COALESCE(SUM(CASE WHEN bd.booking_status IN ('COMPLETED', 'CANCELED') THEN r.balace_amount - bd.gst ELSE 0 END), 0) AS NetRevenue " +
"COALESCE(SUM(CASE WHEN bd.booking_status IN ('COMPLETED', 'CANCELED') THEN r.balace_amount - bd.gst ELSE 0 END), 0) AS NetRevenue ," +
"h.hall_id " +
"FROM " +
"FROM " +
"booking_details bd " +
"booking_details bd " +
"JOIN " +
"JOIN " +
@ -1270,7 +1272,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"AND (:division IS NULL OR :division = 'ALL' OR h.division = :division) " +
"AND (:division IS NULL OR :division = 'ALL' OR h.division = :division) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR h.hall_id = :hallid) " +
"AND (:hallid IS NULL OR :hallid = '1000' OR h.hall_id = :hallid) " +
"GROUP BY " +
"GROUP BY " +
"bd.hall_details_hall_id" , nativeQuery = true )
"bd.hall_details_hall_id order by COUNT(*) desc " , nativeQuery = true )
List < Object [ ] > getBookingHallDetailsReportByBookingDate ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate , @Param ( "zone" ) String zone , @Param ( "division" ) String division , @Param ( "hallid" ) Integer hallid ) ;
List < Object [ ] > getBookingHallDetailsReportByBookingDate ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate , @Param ( "zone" ) String zone , @Param ( "division" ) String division , @Param ( "hallid" ) Integer hallid ) ;
@ -1309,7 +1311,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"JOIN users us ON bd.users_user_id = us.user_id " +
"JOIN users us ON bd.users_user_id = us.user_id " +
"left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " , nativeQuery = true )
"AND DATE(bd.booking_date) <= :toDate order by bd.booking_id asc " , nativeQuery = true )
List < BookingDetails > getAllBookingsettlementDetailsByBookingDate ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate ) ;
List < BookingDetails > getAllBookingsettlementDetailsByBookingDate ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate ) ;
@Query ( value = "SELECT bd.*, hd.hall_name, us.name, us.usertype " +
@Query ( value = "SELECT bd.*, hd.hall_name, us.name, us.usertype " +
@ -1319,7 +1321,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"WHERE DATE(bd.booking_date) >= :fromDate " +
"AND DATE(bd.booking_date) <= :toDate " +
"AND DATE(bd.booking_date) <= :toDate " +
"AND (:refundStatus IS NULL OR bd.refund_status = :refundStatus) " , nativeQuery = true )
"AND (:refundStatus IS NULL OR bd.refund_status = :refundStatus) order by bd.booking_id asc " , nativeQuery = true )
List < BookingDetails > getAllBookingsettlementDetailsByBookingDateWithStatus ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate , @Param ( "refundStatus" ) String refundStatus ) ;
List < BookingDetails > getAllBookingsettlementDetailsByBookingDateWithStatus ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate , @Param ( "refundStatus" ) String refundStatus ) ;
@Query ( value = "SELECT bd.*, hd.hall_name, us.name, us.usertype " +
@Query ( value = "SELECT bd.*, hd.hall_name, us.name, us.usertype " +
@ -1328,7 +1330,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"JOIN users us ON bd.users_user_id = us.user_id " +
"JOIN users us ON bd.users_user_id = us.user_id " +
"left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"WHERE DATE(bd.start_date) >= :fromDate " +
"WHERE DATE(bd.start_date) >= :fromDate " +
"AND DATE(bd.end_date) <= :toDate " , nativeQuery = true )
"AND DATE(bd.end_date) <= :toDate order by bd.booking_id asc " , nativeQuery = true )
List < BookingDetails > getAllBookingsettlementDetailsByEventDate ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate ) ;
List < BookingDetails > getAllBookingsettlementDetailsByEventDate ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate ) ;
@Query ( value = "SELECT bd.*, hd.hall_name, us.name, us.usertype " +
@Query ( value = "SELECT bd.*, hd.hall_name, us.name, us.usertype " +
@ -1338,7 +1340,7 @@ public interface BookingDetailsRepository extends JpaRepository<BookingDetails,
"left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"left JOIN settlement st ON bd.booking_id=st.booking_details_booking_id " +
"WHERE DATE(bd.start_date) >= :fromDate " +
"WHERE DATE(bd.start_date) >= :fromDate " +
"AND DATE(bd.end_date) <= :toDate " +
"AND DATE(bd.end_date) <= :toDate " +
"AND (:refundStatus IS NULL OR bd.refund_status = :refundStatus) " , nativeQuery = true )
"AND (:refundStatus IS NULL OR bd.refund_status = :refundStatus) order by bd.booking_id asc " , nativeQuery = true )
List < BookingDetails > getAllBookingsettlementDetailsByEventDateWithStatus ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate , @Param ( "refundStatus" ) String refundStatus ) ;
List < BookingDetails > getAllBookingsettlementDetailsByEventDateWithStatus ( @Param ( "fromDate" ) String fromDate , @Param ( "toDate" ) String toDate , @Param ( "refundStatus" ) String refundStatus ) ;
/ / In BookingDetailsRepository . java
/ / In BookingDetailsRepository . java