diff --git a/src/main/java/com/gcc/commissionerreview/service/VphService.java b/src/main/java/com/gcc/commissionerreview/service/VphService.java index 421d4da..0f6735f 100644 --- a/src/main/java/com/gcc/commissionerreview/service/VphService.java +++ b/src/main/java/com/gcc/commissionerreview/service/VphService.java @@ -329,7 +329,10 @@ public class VphService { rd.email, DATE(rd.visit_date) AS visitDate, rd.no_of_people, - rd.total_amount AS amountPaid, + CASE + WHEN rd.bulk_ref_id IS NULL THEN rd.total_amount + ELSE bvrd.total_amount + END AS amountPaid, rd.id_details AS IdCardNumber, tm.timing AS time, tsm.timing AS slot, @@ -344,6 +347,7 @@ public class VphService { ON ard.slot_id = tsm.slot_id LEFT JOIN visitor_count_details vcd ON rd.ref_id = vcd.ref_id + left join bulk_vistor_reg_details bvrd on bvrd.ref_id=rd.bulk_ref_id WHERE DATE(rd.cdate) = ? AND rd.booking_flag = 'B' GROUP BY @@ -352,7 +356,10 @@ public class VphService { rd.email, DATE(rd.visit_date), rd.no_of_people, - rd.total_amount, + CASE + WHEN rd.bulk_ref_id IS NULL THEN rd.total_amount + ELSE bvrd.total_amount + END, rd.id_details, tm.timing, tm.time_id, @@ -564,7 +571,10 @@ public class VphService { DATE(rd.visit_date) AS visitDate, DATE(rd.cdate) AS bookingDate, rd.no_of_people, - rd.total_amount AS amountPaid, + CASE + WHEN rd.bulk_ref_id IS NULL THEN rd.total_amount + ELSE bvrd.total_amount + END AS amountPaid, rd.id_details AS IdCardNumber, tm.timing AS time, tsm.timing AS slot, @@ -579,6 +589,7 @@ public class VphService { ON ard.slot_id = tsm.slot_id LEFT JOIN visitor_count_details vcd ON rd.ref_id = vcd.ref_id + left join bulk_vistor_reg_details bvrd on bvrd.ref_id=rd.bulk_ref_id WHERE DATE(rd.visit_date) = ? AND rd.booking_flag = 'B' GROUP BY @@ -588,7 +599,10 @@ public class VphService { DATE(rd.visit_date), DATE(rd.cdate) , rd.no_of_people, - rd.total_amount, + CASE + WHEN rd.bulk_ref_id IS NULL THEN rd.total_amount + ELSE bvrd.total_amount + END, rd.id_details, tm.timing, tm.time_id, @@ -702,4 +716,91 @@ public class VphService { resolveToDate(toDate)); } -} \ No newline at end of file +} + +/* + * back up of visit dada before bulkbooking concept + * + * SELECT + * rd.ref_id, + * rd.mob_no, + * rd.email, + * DATE(rd.visit_date) AS visitDate, + * DATE(rd.cdate) AS bookingDate, + * rd.no_of_people, + * rd.total_amount AS amountPaid, + * rd.id_details AS IdCardNumber, + * tm.timing AS time, + * tsm.timing AS slot, + * tm.time_id, + * tsm.language + * FROM reg_details rd + * LEFT JOIN time_master tm + * ON rd.time_id = tm.time_id + * LEFT JOIN avslot_reg_det ard + * ON rd.ref_id = ard.ref_id + * LEFT JOIN time_slot_master tsm + * ON ard.slot_id = tsm.slot_id + * LEFT JOIN visitor_count_details vcd + * ON rd.ref_id = vcd.ref_id + * WHERE DATE(rd.visit_date) = ? + * AND rd.booking_flag = 'B' + * GROUP BY + * rd.ref_id, + * rd.mob_no, + * rd.email, + * DATE(rd.visit_date), + * DATE(rd.cdate) , + * rd.no_of_people, + * rd.total_amount, + * rd.id_details, + * tm.timing, + * tm.time_id, + * tsm.timing, + * tsm.language + * ORDER BY tm.time_id ASC, + * tsm.timing ASC + */ + +/* + * back updata of booking details before bul booking concept + * + * + * SELECT + * rd.ref_id, + * rd.mob_no, + * rd.email, + * DATE(rd.visit_date) AS visitDate, + * rd.no_of_people, + * rd.total_amount AS amountPaid, + * rd.id_details AS IdCardNumber, + * tm.timing AS time, + * tsm.timing AS slot, + * tm.time_id, + * tsm.language + * FROM reg_details rd + * LEFT JOIN time_master tm + * ON rd.time_id = tm.time_id + * LEFT JOIN avslot_reg_det ard + * ON rd.ref_id = ard.ref_id + * LEFT JOIN time_slot_master tsm + * ON ard.slot_id = tsm.slot_id + * LEFT JOIN visitor_count_details vcd + * ON rd.ref_id = vcd.ref_id + * WHERE DATE(rd.cdate) = ? + * AND rd.booking_flag = 'B' + * GROUP BY + * rd.ref_id, + * rd.mob_no, + * rd.email, + * DATE(rd.visit_date), + * rd.no_of_people, + * rd.total_amount, + * rd.id_details, + * tm.timing, + * tm.time_id, + * tsm.timing, + * tsm.language + * ORDER BY tm.time_id ASC, tsm.timing ASC + * """; + */ \ No newline at end of file diff --git a/src/main/resources/templates/modules/vphreportdashboard.html b/src/main/resources/templates/modules/vphreportdashboard.html index 9dc75dc..f3e1c52 100644 --- a/src/main/resources/templates/modules/vphreportdashboard.html +++ b/src/main/resources/templates/modules/vphreportdashboard.html @@ -544,6 +544,18 @@ //with date filter function loadVisitorBasedCards() { + const fromDate = $("#fromDateVisitor").val(); + const toDate = $("#toDateVisitor").val(); + console.log("From Date:", fromDate); + console.log("To Date:", toDate); + if (fromDate > toDate) { + swal.fire({ + icon: 'error', + title: 'Error', + text: 'From Date should be less than To Date' + }); + return; + } $('#pageLoader').show(); @@ -572,6 +584,14 @@ const toDate = $("#toDateTop").val(); console.log("From Date:", fromDate); console.log("To Date:", toDate); + if (fromDate > toDate) { + swal.fire({ + icon: 'error', + title: 'Error', + text: 'From Date should be less than To Date' + }); + return; + } $('#pageLoader').show();