7 changed files with 802 additions and 14 deletions
-
9entertainmenttax/src/main/java/com/gcc/entertainmenttax/configuration/DataSourceConfig.java
-
12entertainmenttax/src/main/java/com/gcc/entertainmenttax/controller/Apicontroller.java
-
7entertainmenttax/src/main/java/com/gcc/entertainmenttax/controller/Maincontroller.java
-
43entertainmenttax/src/main/java/com/gcc/entertainmenttax/service/Entertainmentservice.java
-
2entertainmenttax/src/main/resources/application.properties
-
7entertainmenttax/src/main/resources/templates/modules/form.html
-
736entertainmenttax/src/main/resources/templates/modules/report.html
@ -1 +1 @@ |
|||||
spring.profiles.active=dev |
|
||||
|
spring.profiles.active=prod |
||||
@ -0,0 +1,736 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
||||
|
|
||||
|
<head> |
||||
|
|
||||
|
<meta charset="UTF-8"> |
||||
|
|
||||
|
<title>Entertainment Tax Registration Report</title> |
||||
|
|
||||
|
<meta name="viewport" content="width=device-width, initial-scale=1"> |
||||
|
|
||||
|
<base th:href="${baseURL}" /> |
||||
|
|
||||
|
<link rel="stylesheet" th:href="@{assets/node_modules/bootstrap/dist/css/bootstrap.min.css}"> |
||||
|
|
||||
|
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap4.min.css"> |
||||
|
|
||||
|
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap4.min.css"> |
||||
|
|
||||
|
<link rel="stylesheet" th:href="@{assets/node_modules/sweetalert2/sweetalert2.min.css}"> |
||||
|
|
||||
|
<style> |
||||
|
body { |
||||
|
background-color: #ebf1fa; |
||||
|
} |
||||
|
|
||||
|
.header { |
||||
|
background-color: #1d495a; |
||||
|
padding: 10px 20px; |
||||
|
color: white; |
||||
|
} |
||||
|
|
||||
|
.header .logo img { |
||||
|
height: 60px; |
||||
|
} |
||||
|
|
||||
|
.center-text { |
||||
|
text-align: center; |
||||
|
font-size: 24px; |
||||
|
} |
||||
|
|
||||
|
#entertainmentTaxReport td:nth-child(6) { |
||||
|
min-width: 250px; |
||||
|
max-width: 300px; |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
.report-header { |
||||
|
background-color: #1d495a; |
||||
|
color: white; |
||||
|
padding: 12px 15px; |
||||
|
border-radius: 4px; |
||||
|
margin-bottom: 20px; |
||||
|
} |
||||
|
|
||||
|
.report-header h5 { |
||||
|
margin: 0; |
||||
|
color: white; |
||||
|
} |
||||
|
|
||||
|
label { |
||||
|
font-weight: 600; |
||||
|
font-size: small; |
||||
|
} |
||||
|
|
||||
|
.required { |
||||
|
color: red; |
||||
|
} |
||||
|
|
||||
|
.filter-card { |
||||
|
padding: 20px; |
||||
|
margin-bottom: 20px; |
||||
|
} |
||||
|
|
||||
|
.table-card { |
||||
|
padding: 20px; |
||||
|
} |
||||
|
|
||||
|
#entertainmentTaxReport th { |
||||
|
white-space: nowrap; |
||||
|
text-align: center; |
||||
|
vertical-align: middle; |
||||
|
} |
||||
|
|
||||
|
#entertainmentTaxReport td { |
||||
|
vertical-align: middle; |
||||
|
} |
||||
|
|
||||
|
.dataTables_wrapper { |
||||
|
width: 100%; |
||||
|
} |
||||
|
|
||||
|
.dt-buttons { |
||||
|
margin-bottom: 10px; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
</head> |
||||
|
|
||||
|
<body> |
||||
|
|
||||
|
<header> |
||||
|
|
||||
|
<div class="header d-flex justify-content-between align-items-center"> |
||||
|
|
||||
|
<div class="logo"> |
||||
|
<img src="https://gccservices.in/gcc/assets/images/logo.png" alt="Logo"> |
||||
|
</div> |
||||
|
|
||||
|
<div class="center-text"> |
||||
|
GREATER CHENNAI CORPORATION |
||||
|
</div> |
||||
|
|
||||
|
<div></div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</header> |
||||
|
|
||||
|
|
||||
|
<main class="container-fluid mt-4"> |
||||
|
|
||||
|
<div class="card shadow"> |
||||
|
|
||||
|
<div class="card-body"> |
||||
|
|
||||
|
<!-- Report Header --> |
||||
|
|
||||
|
<div class="report-header"> |
||||
|
|
||||
|
<h5> |
||||
|
ENTERTAINMENT TAX REGISTRATION REPORT |
||||
|
</h5> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<!-- Filters --> |
||||
|
|
||||
|
<div class="card filter-card"> |
||||
|
|
||||
|
<div class="row"> |
||||
|
|
||||
|
<div class="col-md-4"> |
||||
|
|
||||
|
<label for="fromDate"> |
||||
|
From Date <span class="required">*</span> |
||||
|
</label> |
||||
|
|
||||
|
<input type="date" id="fromDate" class="form-control"> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="col-md-4"> |
||||
|
|
||||
|
<label for="toDate"> |
||||
|
To Date <span class="required">*</span> |
||||
|
</label> |
||||
|
|
||||
|
<input type="date" id="toDate" class="form-control"> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="col-md-4" style="margin-top:30px;"> |
||||
|
|
||||
|
<button type="button" class="btn btn-primary" id="searchBtn"> |
||||
|
|
||||
|
Search |
||||
|
|
||||
|
</button> |
||||
|
|
||||
|
<button type="button" class="btn btn-secondary" id="resetBtn"> |
||||
|
|
||||
|
Reset |
||||
|
|
||||
|
</button> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<!-- Report Table --> |
||||
|
|
||||
|
<div class="card table-card"> |
||||
|
|
||||
|
<div class="table-responsive"> |
||||
|
|
||||
|
<table id="entertainmentTaxReport" class="table table-bordered table-striped table-hover" |
||||
|
style="width:100%"> |
||||
|
|
||||
|
<thead> |
||||
|
|
||||
|
<tr> |
||||
|
|
||||
|
<th>S.No</th> |
||||
|
|
||||
|
<th>Reference ID</th> |
||||
|
|
||||
|
<th>Venue</th> |
||||
|
|
||||
|
<th>Concert By</th> |
||||
|
|
||||
|
<th>Organizer Name</th> |
||||
|
|
||||
|
<th>Address</th> |
||||
|
|
||||
|
<th>Email ID</th> |
||||
|
|
||||
|
<th>Contact<br> Number</th> |
||||
|
|
||||
|
<th>Registration<br> Date</th> |
||||
|
|
||||
|
<th>Programme<br> Date</th> |
||||
|
<th> Website Url</th> |
||||
|
|
||||
|
<th>GST Number</th> |
||||
|
|
||||
|
<th>PAN Number</th> |
||||
|
|
||||
|
<th>Organization located <br>Other Than Chennai</th> |
||||
|
|
||||
|
<th>Authorized<br> Person Name</th> |
||||
|
|
||||
|
<th>Designation</th> |
||||
|
|
||||
|
<th>Authorized<br> Person Contact</th> |
||||
|
|
||||
|
|
||||
|
</tr> |
||||
|
|
||||
|
</thead> |
||||
|
|
||||
|
<tbody> |
||||
|
</tbody> |
||||
|
|
||||
|
</table> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
</main> |
||||
|
|
||||
|
|
||||
|
<script th:src="@{assets/node_modules/jquery/dist/jquery.min.js}"> |
||||
|
</script> |
||||
|
|
||||
|
<script th:src="@{assets/node_modules/bootstrap/dist/js/bootstrap.min.js}"> |
||||
|
</script> |
||||
|
|
||||
|
<script th:src="@{assets/node_modules/sweetalert2/sweetalert2.min.js}"> |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
<!-- DataTables --> |
||||
|
|
||||
|
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"> |
||||
|
</script> |
||||
|
|
||||
|
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap4.min.js"> |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
<!-- DataTables Buttons --> |
||||
|
|
||||
|
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"> |
||||
|
</script> |
||||
|
|
||||
|
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap4.min.js"> |
||||
|
</script> |
||||
|
|
||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"> |
||||
|
</script> |
||||
|
|
||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"> |
||||
|
</script> |
||||
|
|
||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"> |
||||
|
</script> |
||||
|
|
||||
|
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"> |
||||
|
</script> |
||||
|
|
||||
|
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.print.min.js"> |
||||
|
</script> |
||||
|
|
||||
|
|
||||
|
<script> |
||||
|
|
||||
|
let reportTable = null; |
||||
|
|
||||
|
|
||||
|
$(document).ready(function () { |
||||
|
|
||||
|
let today = new Date().toISOString().split("T")[0]; |
||||
|
|
||||
|
$("#fromDate").attr("max", today); |
||||
|
$("#toDate").attr("max", today); |
||||
|
$("#fromDate").val(today); |
||||
|
$("#toDate").val(today); |
||||
|
|
||||
|
$("#fromDate").on("change", function () { |
||||
|
|
||||
|
let fromDate = $(this).val(); |
||||
|
|
||||
|
// To Date cannot be before From Date |
||||
|
$("#toDate").attr("min", fromDate); |
||||
|
|
||||
|
// To Date cannot be after today |
||||
|
$("#toDate").attr("max", today); |
||||
|
|
||||
|
// Clear To Date if it is outside the valid range |
||||
|
let toDate = $("#toDate").val(); |
||||
|
|
||||
|
if (toDate && (toDate < fromDate || toDate > today)) { |
||||
|
$("#toDate").val(""); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
/* |
||||
|
* Search |
||||
|
*/ |
||||
|
|
||||
|
$("#searchBtn").click(function () { |
||||
|
|
||||
|
let fromDate = $("#fromDate").val(); |
||||
|
let toDate = $("#toDate").val(); |
||||
|
|
||||
|
|
||||
|
if (fromDate === "") { |
||||
|
|
||||
|
Swal.fire( |
||||
|
"Warning", |
||||
|
"Please select From Date", |
||||
|
"warning" |
||||
|
); |
||||
|
|
||||
|
return; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
if (toDate === "") { |
||||
|
|
||||
|
Swal.fire( |
||||
|
"Warning", |
||||
|
"Please select To Date", |
||||
|
"warning" |
||||
|
); |
||||
|
|
||||
|
return; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
if (fromDate > toDate) { |
||||
|
|
||||
|
Swal.fire( |
||||
|
"Warning", |
||||
|
"From Date cannot be greater than To Date", |
||||
|
"warning" |
||||
|
); |
||||
|
|
||||
|
return; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
loadEntertainmentTaxReport(true); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
|
||||
|
/* |
||||
|
* Reset |
||||
|
*/ |
||||
|
|
||||
|
$("#resetBtn").click(function () { |
||||
|
|
||||
|
$("#fromDate").val(today); |
||||
|
$("#toDate").val(today); |
||||
|
|
||||
|
$("#toDate").attr("min", today); |
||||
|
|
||||
|
loadEntertainmentTaxReport(); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
|
||||
|
/* |
||||
|
* Initial load |
||||
|
*/ |
||||
|
|
||||
|
loadEntertainmentTaxReport(); |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
|
||||
|
function loadEntertainmentTaxReport(isUserAction = false) { |
||||
|
|
||||
|
let fromDate = $("#fromDate").val(); |
||||
|
let toDate = $("#toDate").val(); |
||||
|
|
||||
|
if (isUserAction) { |
||||
|
|
||||
|
if (!fromDate && !toDate) { |
||||
|
Swal.fire({ |
||||
|
icon: "warning", |
||||
|
title: "Validation", |
||||
|
text: "Please select From Date and To Date." |
||||
|
}); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if (fromDate && !toDate) { |
||||
|
Swal.fire({ |
||||
|
icon: "warning", |
||||
|
title: "Validation", |
||||
|
text: "Please select To Date." |
||||
|
}); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if (!fromDate && toDate) { |
||||
|
Swal.fire({ |
||||
|
icon: "warning", |
||||
|
title: "Validation", |
||||
|
text: "Please select From Date." |
||||
|
}); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
if (fromDate > toDate) { |
||||
|
Swal.fire({ |
||||
|
icon: "warning", |
||||
|
title: "Validation", |
||||
|
text: "From Date cannot be greater than To Date." |
||||
|
}); |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
$('#pageLoader').show(); |
||||
|
|
||||
|
$.ajax({ |
||||
|
|
||||
|
url: "/entertainmenttax/api/report", |
||||
|
|
||||
|
type: "GET", |
||||
|
|
||||
|
data: { |
||||
|
fromDate: fromDate, |
||||
|
toDate: toDate |
||||
|
}, |
||||
|
|
||||
|
success: function (response) { |
||||
|
// console.log(response); |
||||
|
|
||||
|
$('#pageLoader').hide(); |
||||
|
|
||||
|
// Destroy existing DataTable |
||||
|
if ($.fn.DataTable.isDataTable('#entertainmentTaxReport')) { |
||||
|
$('#entertainmentTaxReport').DataTable().destroy(); |
||||
|
} |
||||
|
|
||||
|
// Clear old rows |
||||
|
$('#entertainmentTaxReport tbody').empty(); |
||||
|
|
||||
|
// Create DataTable again |
||||
|
reportTable = $('#entertainmentTaxReport').DataTable({ |
||||
|
|
||||
|
destroy: true, |
||||
|
|
||||
|
data: response, |
||||
|
|
||||
|
processing: true, |
||||
|
|
||||
|
columns: [ |
||||
|
|
||||
|
{ |
||||
|
data: null, |
||||
|
render: function (data, type, row, meta) { |
||||
|
return meta.row + 1; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
data: "ref_id", |
||||
|
defaultContent: "-" |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
data: "venue", |
||||
|
defaultContent: "-" |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
data: "concertby", |
||||
|
defaultContent: "-" |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
data: "organizer_name", |
||||
|
defaultContent: "-" |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
data: "address", |
||||
|
defaultContent: "-" |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
data: "mailid", |
||||
|
defaultContent: "-" |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
data: "contactno", |
||||
|
defaultContent: "-" |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
data: "cdate", |
||||
|
defaultContent: "-", |
||||
|
render: function (data) { |
||||
|
return formatDate(data); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
data: "program_date", |
||||
|
defaultContent: "-", |
||||
|
render: function (data) { |
||||
|
return formatDate(data); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
data: "website_url", |
||||
|
defaultContent: "-", |
||||
|
render: function (data) { |
||||
|
|
||||
|
if (!data) { |
||||
|
return "-"; |
||||
|
} |
||||
|
|
||||
|
let url = data.trim(); |
||||
|
|
||||
|
if (!/^https?:\/\//i.test(url)) { |
||||
|
url = "https://" + url; |
||||
|
} |
||||
|
|
||||
|
return '<a href="' + url + |
||||
|
'" target="_blank" rel="noopener noreferrer">' + |
||||
|
data + |
||||
|
'</a>'; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
data: "gstno", |
||||
|
defaultContent: "-" |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
data: "panno", |
||||
|
defaultContent: "-" |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
data: "program_check", |
||||
|
render: function (data) { |
||||
|
return data == 1 ? "Yes" : "No"; |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
data: "person_name", |
||||
|
render: function (data) { |
||||
|
return data && data.trim() !== "" ? data : "-"; |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
data: "Designation", |
||||
|
render: function (data) { |
||||
|
return data && data.trim() !== "" ? data : "-"; |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
data: "person_contactno", |
||||
|
render: function (data) { |
||||
|
return data && data.toString().trim() !== "" ? data : "-"; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
], |
||||
|
|
||||
|
columnDefs: [ |
||||
|
{ |
||||
|
orderable: false, |
||||
|
targets: [0] |
||||
|
} |
||||
|
], |
||||
|
|
||||
|
dom: |
||||
|
'<"row"<"col-md-6"B><"col-md-6"f>>' + |
||||
|
'<"row"<"col-md-12"tr>>' + |
||||
|
'<"row"<"col-md-5"i><"col-md-7"p>>', |
||||
|
|
||||
|
buttons: [ |
||||
|
{ |
||||
|
extend: "excelHtml5", |
||||
|
title: "Entertainment Tax Registration Report" |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
extend: "pdfHtml5", |
||||
|
title: "Entertainment Tax Registration Report", |
||||
|
orientation: "landscape", |
||||
|
pageSize: "A3", |
||||
|
|
||||
|
exportOptions: { |
||||
|
columns: ':visible' |
||||
|
}, |
||||
|
|
||||
|
customize: function (doc) { |
||||
|
|
||||
|
doc.pageMargins = [15, 30, 15, 30]; |
||||
|
|
||||
|
doc.defaultStyle.fontSize = 6; |
||||
|
|
||||
|
doc.styles.tableHeader.fontSize = 6; |
||||
|
doc.styles.tableHeader.bold = true; |
||||
|
|
||||
|
// Find the report table |
||||
|
let table = doc.content.find(function (item) { |
||||
|
return item.table; |
||||
|
}); |
||||
|
|
||||
|
if (table) { |
||||
|
|
||||
|
table.table.widths = [ |
||||
|
25, // S.No |
||||
|
75, // Reference ID |
||||
|
45, // Venue |
||||
|
45, // Concert By |
||||
|
65, // Organizer Name |
||||
|
80, // Address |
||||
|
95, // Email ID |
||||
|
60, // Contact Number |
||||
|
55, // Registration Date |
||||
|
55, // Programme Date |
||||
|
80, // website_url |
||||
|
70, // GST Number |
||||
|
70, // PAN Number |
||||
|
45, // Other Than Chennai |
||||
|
70, // Authorized Person Name |
||||
|
60, // Designation |
||||
|
70 // Authorized Person Contact |
||||
|
]; |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
|
||||
|
pageLength: 10, |
||||
|
|
||||
|
lengthMenu: [ |
||||
|
[10, 25, 50, 100, -1], |
||||
|
[10, 25, 50, 100, "All"] |
||||
|
], |
||||
|
|
||||
|
order: [], |
||||
|
|
||||
|
scrollX: true, |
||||
|
|
||||
|
autoWidth: false |
||||
|
|
||||
|
}); |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
error: function () { |
||||
|
|
||||
|
$('#pageLoader').hide(); |
||||
|
|
||||
|
Swal.fire({ |
||||
|
icon: "error", |
||||
|
title: "Error", |
||||
|
text: "Unable to load Entertainment Tax Report." |
||||
|
}); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
function formatDate(dateStr) { |
||||
|
if (!dateStr) return "-"; |
||||
|
|
||||
|
// Already formatted (dd-mm-yyyy) |
||||
|
if (/^\d{2}-\d{2}-\d{4}$/.test(dateStr)) { |
||||
|
return dateStr; |
||||
|
} |
||||
|
|
||||
|
// Remove time if present |
||||
|
dateStr = dateStr.split("T")[0]; |
||||
|
|
||||
|
const parts = dateStr.split("-"); |
||||
|
|
||||
|
if (parts.length !== 3) { |
||||
|
return dateStr; |
||||
|
} |
||||
|
|
||||
|
const [y, m, d] = parts; |
||||
|
|
||||
|
return `${d}-${m}-${y}`; |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
</body> |
||||
|
|
||||
|
</html> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue