Commit e595eb12 authored by Deep Dey's avatar Deep Dey

Merge branch 'master' into 'master'

feat: dynamically change fees structure according the class of the student

See merge request !12
parents 826055b6 4fa04f5f
......@@ -16,6 +16,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Service
// @AllArgsConstructor(onConstructor_ = @__({@Autowired}))
......@@ -52,8 +53,13 @@ public class TemplateService {
context.setVariable("currentDate", LocalDate.now().format(formatter));
context.setVariable("givenYear", Integer.parseInt(givenYear));
context.setVariable("showSignature", true);
context.setVariable("fees", FEES_STRUCTURE.getFeesStructure(
admissionFormData.getSchool(),
admissionFormData.getAdmissionClass(),
false));
return templateEngine.process("AdmissionConfirmationFormListTemplate", context);
return templateEngine.process("NewAdmissionConfirmationFormListTemplate", context);
}
public String generateSpecialAdmissionConfirmationFormTemplate(
......@@ -115,6 +121,17 @@ public class TemplateService {
context.setVariable("givenYear", Integer.parseInt(givenYear));
context.setVariable("showSignature", false);
List<List<String>> feesStructureList = admissionFormDataList.stream()
.map(formData -> FEES_STRUCTURE.getFeesStructure(
formData.getSchool(),
formData.getAdmissionClass(),
false))
.filter(Objects::nonNull) // Prevents adding null values
.toList();
context.setVariable("feesList", feesStructureList);
return templateEngine.process("AdmissionConfirmationFormListTemplatePdf", context);
}
......
logging.level.web=DEBUG
#server.error.include-binding-errors=never
#server.error.include-message=always
server.http2.enabled=true
spring.datasource.url=jdbc:postgresql://103.154.184.85:5433/webomagic_lamartin
#spring.datasource.url=jdbc:postgresql://65.0.101.174:5432/webomagic_lamartin
spring.web.resources.cache.cachecontrol.s-max-age=3600000
spring.datasource.username=webomagic_python_db
spring.datasource.password=P@$$w0rdIITKGP
spring.redis.host=103.154.184.85
spring.redis.port=6377
#spring.redis.host=65.0.101.174
#spring.redis.port=6379
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=noreply@lamartiniere.co
spring.mail.password=xoobqggzxputgvky
lamartin.static.resources.root.path=/home/iitkgpssh/docker/data
lamartin.static.server.path=https://adm.lamartiniere.co/webomagic-lamartin/
#lamartin.static.resources.root.path=/home/ubuntu/webomagic_lamartin/data
#lamartin.static.server.path=http://65.0.101.174:8084/webomagic-lamartin/
\ No newline at end of file
......@@ -105,7 +105,9 @@
</head>
<body>
<div class="container" th:each="admissionForm : ${admissionFormList}">
<div class="container" th:each="admissionForm, formIndex : ${admissionFormList}">
<!-- Get the corresponding feesList entry -->
<th:block th:with="fees=${feesList[__${formIndex.index}__]}">
<div class="header">
<!-- <div class="left">
<h4>Supriyo Dhar, HRM, MBA, LLB<br />Secretary</h4>
......@@ -169,8 +171,7 @@
</strong> in person, along with a printout of this letter on <b><span th:text="${admissionForm.admissionDate}"></span> at <span th:text="${admissionForm.admissionTime}"></span></b> for necessary formalities.</p>
<p>Parents willing to pay the full year fee may do so, or pay quarterly by way of Pay Order favouring <b>&quot;La
Martiniere Calcutta&quot;</b> or bank transfer, at the time of admission.</p>
<p>For the <b>1<sup>st</sup> Quarter (April to June <span th:text="(${givenYear + 1})"></span>)</b>, parents are to pay <b>Rs. 1,79,500/- (Rupees
One Lacs Seventy Nine Thousand Five Hundred only)</b> towards Tuition Fees, Session Fees,
<p>For the <b>1<sup>st</sup> Quarter (April to June <span th:text="(${givenYear + 1})"></span>)</b>, parents are to pay <b>Rs. <span th:text="${fees.get(0)}"></span></b> towards Tuition Fees, Session Fees,
Infrastructure Development Fees, Admission Fees, Building Development Fees and Security Deposit
(refundable). The amount may be transferred directly to the following account.</p>
<br />
......@@ -211,27 +212,27 @@
</tr>
<tr>
<td>1<sup>st</sup> Quarter (April to June <span th:text="(${givenYear + 1})"></span>)</td>
<td>Rs. 1,79,500.00</td>
<td>Rs. <span th:text="${fees.get(0)}"></span></td>
<td>On the date of admission</td>
</tr>
<tr>
<td>2<sup>nd</sup> Quarter (July to Sept. <span th:text="(${givenYear + 1})"></span>)</td>
<td>Rs. 1,34,500.00</td>
<td>Rs. <span th:text="${fees.get(1)}"></span></td>
<td>1<sup>st</sup> to 5<sup>th</sup> July, <span th:text="(${givenYear + 1})"></span></td>
</tr>
<tr>
<td>3<sup>rd</sup> Quarter (Oct to Dec. <span th:text="(${givenYear + 1})"></span>)</td>
<td>Rs. 1,34,500.00</td>
<td>Rs. <span th:text="${fees.get(2)}"></span></td>
<td>1<sup>st</sup> to 5<sup>th</sup> Oct. <span th:text="(${givenYear + 1})"></span></td>
</tr>
<tr>
<td>4<sup>th</sup> Quarter (Jan to March <span th:text="(${givenYear + 2})"></span>)</td>
<td>Rs. 1,34,500.00</td>
<td>Rs. <span th:text="${fees.get(3)}"></span></td>
<td>6<sup>th</sup> to 11<sup>th</sup> Jan <span th:text="(${givenYear + 2})"></span></td>
</tr>
<tr>
<td><b>Total</b></td>
<td colspan="2"><b>Rs 5,83,000.00</b></td>
<td colspan="2"><b>Rs. <span th:text="${fees.get(4)}"></span></b></td>
</tr>
</table>
......
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
<title>Intimation for Admission</title>
<style>
* {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
font-size: 12px;
}
body {
margin: 0px 20px;
}
.header,
.content,
.footer {
text-align: center;
position: relative;
width: 100%;
}
.content {
text-align: justify;
}
.left,
.center,
.right {
display: inline-block;
}
.left {
position: absolute !important;
left: 0 !important;
}
.right {
position: absolute !important;
right: 0 !important;
}
.middle {
margin: 0 auto;
text-align: center;
}
.header img {
height: 80px;
}
.content {
margin-top: 10px;
}
.content p {
margin: 5px 0;
}
.content b {
font-weight: bold;
}
.account-details,
.fee-details {
width: 100%;
margin-top: 20px;
border-collapse: collapse;
}
.account-details td,
.fee-details td,
.fee-details th {
border: 1px solid black;
padding: 5px;
text-align: left;
}
.fee-details th {
text-align: center;
}
.signature {
margin-top: 40px;
text-align: left;
}
.signature img {
width: 18%;
height: 18%;
}
.page-break { page-break-after: always; }
</style>
</head>
<body>
<div class="container" th:each="admissionForm : ${admissionFormList}">
<div class="header">
<div class="left">
<h4>Supriyo Dhar, HRM, MBA, LLB<br />Secretary</h4>
</div>
<div class="center">
<img th:src="@{${serverPath + 'static/la-martin-logo.png'}}" alt="Logo" height="110px" />
</div>
<div class="right">
<h2>La Martiniere</h2>
</div>
</div>
<div class="content page-break">
<div class="left">
<p><b>To,</b><br />
<b th:text="${admissionForm.fatherName}">Pratik Shrivastava</b>
<span th:if="${admissionForm.motherName != null}">
/ <b th:text="${admissionForm.motherName}"></b>
</span>
</p>
</div>
<div class="right">
<p><b th:text="${currentDate}">17/07/2024</b></p>
</div>
<br />
<br />
<br />
<div class="middle">
<strong>Sub: <u>Intimation for Admission</u></strong>
</div>
<p>Dear Parent/s,</p>
<br />
<p>
We are pleased to inform you that your
<span th:if="${admissionForm.school == 'La Martiniere for Boys'}">
<span>son </span>
</span>
<span th:if="${admissionForm.school == 'La Martiniere for Girls'}">
<span>daughter </span>
</span>
<b th:text="${admissionForm.fullName}"></b>
has been
granted admission to <b th:text="${admissionForm.admissionClass}"></b> for the year <span th:text="(${givenYear + 1}) + ' - ' + (${givenYear + 2})">2025 - 2026</span>.
</p>
<p>
Please contact the
<strong>
Principal's office of
<span th:text="${admissionForm.school}"></span>
<span th:if="${admissionForm.school == 'La Martiniere for Boys'}">
<span>11, Dr. U.N. Brahmachari Street, Kolkata - 700 017,</span>
</span>
<span th:if="${admissionForm.school == 'La Martiniere for Girls'}">
<span>14, Sarojini Naidu Sarani, Kolkata - 700 017,</span>
</span>
</strong> in person, along with a printout of this letter on <b><span th:text="${admissionForm.admissionDate}"></span> at <span th:text="${admissionForm.admissionTime}"></span></b> for necessary formalities.</p>
<p>Parents willing to pay the full year fee may do so, or pay quarterly by way of Pay Order favouring <b>&quot;La
Martiniere Calcutta&quot;</b> or bank transfer, at the time of admission.</p>
<p>For the <b>1<sup>st</sup> Quarter (April to June <span th:text="(${givenYear + 1})"></span>)</b>, parents are to pay <b>Rs. <span th:text="${fees.get(0)}"></span></b> towards Tuition Fees, Session Fees,
Infrastructure Development Fees, Admission Fees, Building Development Fees and Security Deposit
(refundable). The amount may be transferred directly to the following account.</p>
<br />
<p><b><u>Penalty of Rs.5000/- will be levied if fees not paid on the due date.</u></b></p>
<table class="account-details">
<tr>
<td>Account Name</td>
<td> La Martiniere, Calcutta</td>
</tr>
<tr>
<td>Account Number</td>
<td> 031201001229</td>
</tr>
<tr>
<td>Bank Name</td>
<td> ICICI Bank, Gorky Terrace</td>
</tr>
<tr>
<td>Account Type</td>
<td> Savings</td>
</tr>
<tr>
<td>RTGS/NEFT/IFS Code</td>
<td> ICIC0000312</td>
</tr>
</table>
<br />
<p><b><u>IMPORTANT</u> &ndash; School fees from the 2nd Quarter will be directly debited from your account by the Auto Debit process which is <u>mandatory</u>. Please bring a cancelled cheque for all Savings and Current accounts (along with a company rubber stamp for Current and HUF accounts) to complete the setting up of the auto debit process at the time of admission of your ward.</b></p>
<table class="fee-details">
<tr>
<th>Quarters</th>
<th>Amount</th>
<th>Date of Payment</th>
</tr>
<tr>
<td>1<sup>st</sup> Quarter (April to June <span th:text="(${givenYear + 1})"></span>)</td>
<td>Rs. <span th:text="${fees.get(0)}"></span></td>
<td>On the date of admission</td>
</tr>
<tr>
<td>2<sup>nd</sup> Quarter (July to Sept. <span th:text="(${givenYear + 1})"></span>)</td>
<td>Rs. <span th:text="${fees.get(1)}"></span></td>
<td>1<sup>st</sup> to 5<sup>th</sup> July, <span th:text="(${givenYear + 1})"></span></td>
</tr>
<tr>
<td>3<sup>rd</sup> Quarter (Oct to Dec. <span th:text="(${givenYear + 1})"></span>)</td>
<td>Rs. <span th:text="${fees.get(2)}"></span></td>
<td>1<sup>st</sup> to 5<sup>th</sup> Oct. <span th:text="(${givenYear + 1})"></span></td>
</tr>
<tr>
<td>4<sup>th</sup> Quarter (Jan to March <span th:text="(${givenYear + 2})"></span>)</td>
<td>Rs. <span th:text="${fees.get(3)}"></span></td>
<td>6<sup>th</sup> to 11<sup>th</sup> Jan <span th:text="(${givenYear + 2})"></span></td>
</tr>
<tr>
<td><b>Total</b></td>
<td colspan="2"><b>Rs <span th:text="${fees.get(4)}"></span></b></td>
</tr>
</table>
<div class="signature">
<p style="margin-bottom: 10px;">Yours faithfully,</p>
<span th:if="${showSignature == true}">
<img th:src="@{${serverPath + 'static/signature.png'}}" width="70px" alt=""/>
</span>
<span th:if="${showSignature == false}">
<br/>
</span>
<p><b>SUPRIYO DHAR</b><br />Secretary<br />La Martiniere, Kolkata</p>
</div>
<div class="footer" style="margin-top: 10px;">
<div class="left">
<p>11 Dr. U.N. Brahmachari Street<br />Kolkata - 700 017 (INDIA)</p>
</div>
<div class="center">
<p>+91-33-4040-6600/01<br />22890112(D)</p>
</div>
<div class="right">
<p>secretary@lamartiniere.co<br />lamartiniere.co</p>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment