Skip to content

Commit

Permalink
Merge pull request openeducat#768 from rosh-2010/17.0-ros-fees-detail…
Browse files Browse the repository at this point in the history
…-report

[17.0][MOD] Modify Fees detail report
  • Loading branch information
parthivgls committed May 3, 2024
2 parents bb7bfd8 + 8cae586 commit f6f57eb
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 18 deletions.
11 changes: 9 additions & 2 deletions openeducat_fees/report/fees_analysis_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,22 @@ def get_invoice_amount(self, student_id):
@api.model
def _get_report_values(self, docids, data=None):
student_ids = []
docargs = {}
if data['fees_filter'] == 'student':
student_ids = self.env['op.student'].browse([data['student']])
else:
student_ids = self.env['op.student'].search(
[('course_detail_ids.course_id', '=', data['course'])])
docargs = {
course_id = self.env['op.course'].search([('id', '=', data['course'])])
report_type = 'course'
docargs.update({
'report_type': report_type,
'course_name': course_id.name,
})
docargs.update({
'doc_ids': self.ids,
'doc_model': 'op.student',
'docs': student_ids,
'get_invoice_amount': self.get_invoice_amount,
}
})
return docargs
32 changes: 17 additions & 15 deletions openeducat_fees/report/fees_analysis_report_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,26 @@
<t t-call="web.external_layout">
<div class="font">
<div class="page">
<br/>
<br/>
<br/>
<div class="text-center" style="font-size:16px;">
<h3>
<strong>Fees Detail</strong>
<div class="text-center">
<h3 class="mx-auto">
<t t-if="report_type == 'course'">
<span t-esc="course_name"/>
-
</t>
<span>Fees Detail</span>
</h3>
<hr style="width: 150px;margin: 0 auto;opacity: 1;"/>
</div>
<br></br>
<table class="table table-bordered">
<thead class="text-center" style="background-color:#eeeeee; font-size:14px; font-weight:600;">
<table class="table table-bordered mt-5">
<thead class="text-center"
style="background-color:#eeeeee; font-size:14px; font-weight:600;">
<th>Student Name</th>
<th>Total Amount</th>
<th>Total Invoiced</th>
<th>Total Paid</th>
<th>Total Left</th>
<th>Total Unpaid</th>
</thead>
<tbody style="font-size:12px;">
<tbody style="font-size:12px;border-top:0">
<t t-foreach="docs" t-as="doc">
<t t-set="amount" t-value="get_invoice_amount(doc)"/>
<t t-set="total_amount" t-value="amount[0]"/>
Expand All @@ -31,16 +33,16 @@
<td class="text-center">
<span t-out="doc.name"/>
</td>
<td class="text-right">
<td class="text-end">
<span t-esc="total_amount"/>
</td>
<td class="text-right">
<td class="text-end">
<span t-esc="doc.total_invoiced"/>
</td>
<td class="text-right">
<td class="text-end">
<span t-esc="total_paid"/>
</td>
<td class="text-right">
<td class="text-end">
<span t-esc="total_amount - total_paid"/>
</td>
</tr>
Expand Down
17 changes: 16 additions & 1 deletion openeducat_fees/report/report_menu.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="paper_format_fees_analysis_report" model="report.paperformat">
<field name="name">Fees Report Paper Format</field>
<field name="default" eval="True"/>
<field name="format">A4</field>
<field name="page_height">0</field>
<field name="page_width">0</field>
<field name="orientation">Portrait</field>
<field name="margin_top">40</field>
<field name="margin_bottom">10</field>
<field name="margin_left">5</field>
<field name="margin_right">5</field>
<field name="header_spacing">35</field>
<field name="dpi">90</field>
</record>
<record id="action_report_fees_detail_analysis" model="ir.actions.report">
<field name="name">Fees Detail Analysi</field>
<field name="name">Fees Details Report</field>
<field name="model">op.student</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">openeducat_fees.report_fees_analysis</field>
<field name="report_file">openeducat_fees.report_fees_analysis</field>
<field name="paperformat_id" ref="openeducat_fees.paper_format_fees_analysis_report"/>
</record>
</odoo>

0 comments on commit f6f57eb

Please sign in to comment.