Merge pull request #6096 from expsa/14.0-feat-odex_takaful-auto-20260109_214949
[IMP] odex_takaful: improve data models and business logic
This commit is contained in:
commit
0af05da3f2
|
|
@ -134,7 +134,8 @@ class DonationExtensionHistory(models.Model):
|
||||||
base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url', '')
|
base_url = self.env['ir.config_parameter'].sudo().get_param('web.base.url', '')
|
||||||
for rec in self:
|
for rec in self:
|
||||||
if rec.id:
|
if rec.id:
|
||||||
rec.receipt_url = "%s/report/pdf/odex_takaful.report_extension_receipt_document/%s" % (
|
# Use public route /sponsorship/html/ for public access
|
||||||
|
rec.receipt_url = "%s/sponsorship/html/odex_takaful.report_extension_receipt_document/%s" % (
|
||||||
base_url, rec.id
|
base_url, rec.id
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -99,10 +99,10 @@
|
||||||
<td style="text-align: center; padding: 8px; font-size: 1.3rem; color: #387F75;">
|
<td style="text-align: center; padding: 8px; font-size: 1.3rem; color: #387F75;">
|
||||||
<t t-set="amt" t-value="ext.extension_amount"/>
|
<t t-set="amt" t-value="ext.extension_amount"/>
|
||||||
<t t-if="amt == int(amt)">
|
<t t-if="amt == int(amt)">
|
||||||
<span t-esc="'{:,.0f}'.format(amt)"/> <span t-esc="sponsorship.currency_id.symbol"/>
|
<span t-esc="'{:,.0f}'.format(amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
<t t-else="">
|
<t t-else="">
|
||||||
<span t-esc="'{:,.2f}'.format(amt)"/> <span t-esc="sponsorship.currency_id.symbol"/>
|
<span t-esc="'{:,.2f}'.format(amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -123,10 +123,10 @@
|
||||||
<strong>
|
<strong>
|
||||||
<t t-set="total_amt" t-value="sum(ext.extension_amount for ext in all_extensions)"/>
|
<t t-set="total_amt" t-value="sum(ext.extension_amount for ext in all_extensions)"/>
|
||||||
<t t-if="total_amt == int(total_amt)">
|
<t t-if="total_amt == int(total_amt)">
|
||||||
<span t-esc="'{:,.0f}'.format(total_amt)"/> <span t-esc="sponsorship.currency_id.symbol"/>
|
<span t-esc="'{:,.0f}'.format(total_amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
<t t-else="">
|
<t t-else="">
|
||||||
<span t-esc="'{:,.2f}'.format(total_amt)"/> <span t-esc="sponsorship.currency_id.symbol"/>
|
<span t-esc="'{:,.2f}'.format(total_amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
</strong>
|
</strong>
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -164,10 +164,10 @@
|
||||||
</t>
|
</t>
|
||||||
|
|
||||||
<t t-if="pay_amt == int(pay_amt)">
|
<t t-if="pay_amt == int(pay_amt)">
|
||||||
<span t-esc="'{:,.0f}'.format(pay_amt)"/> <span t-esc="pay.currency_id.symbol"/>
|
<span t-esc="'{:,.0f}'.format(pay_amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
<t t-else="">
|
<t t-else="">
|
||||||
<span t-esc="'{:,.2f}'.format(pay_amt)"/> <span t-esc="pay.currency_id.symbol"/>
|
<span t-esc="'{:,.2f}'.format(pay_amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -181,10 +181,10 @@
|
||||||
<td style="text-align: center; padding: 8px; font-size: 1.4rem; color: #387F75; font-weight: bold;">
|
<td style="text-align: center; padding: 8px; font-size: 1.4rem; color: #387F75; font-weight: bold;">
|
||||||
<t t-set="final_amt" t-value="sum(ext.extension_amount for ext in all_extensions)"/>
|
<t t-set="final_amt" t-value="sum(ext.extension_amount for ext in all_extensions)"/>
|
||||||
<t t-if="final_amt == int(final_amt)">
|
<t t-if="final_amt == int(final_amt)">
|
||||||
<span t-esc="'{:,.0f}'.format(final_amt)"/> <span t-esc="sponsorship.currency_id.symbol"/>
|
<span t-esc="'{:,.0f}'.format(final_amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
<t t-else="">
|
<t t-else="">
|
||||||
<span t-esc="'{:,.2f}'.format(final_amt)"/> <span t-esc="sponsorship.currency_id.symbol"/>
|
<span t-esc="'{:,.2f}'.format(final_amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
|
|
@ -155,10 +155,10 @@
|
||||||
<!-- المبلغ -->
|
<!-- المبلغ -->
|
||||||
<td style="text-align: center; padding: 8px; font-size: 1.3rem; color: #387F75;">
|
<td style="text-align: center; padding: 8px; font-size: 1.3rem; color: #387F75;">
|
||||||
<t t-if="original_amt == int(original_amt)">
|
<t t-if="original_amt == int(original_amt)">
|
||||||
<span t-esc="'{:,.0f}'.format(original_amt)"/> <span t-esc="line.currency_id.symbol"/>
|
<span t-esc="'{:,.0f}'.format(original_amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
<t t-else="">
|
<t t-else="">
|
||||||
<span t-esc="'{:,.2f}'.format(original_amt)"/> <span t-esc="line.currency_id.symbol"/>
|
<span t-esc="'{:,.2f}'.format(original_amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -182,10 +182,10 @@
|
||||||
<strong>
|
<strong>
|
||||||
<t t-set="total_amt" t-value="doc.total_sponsorship_amount"/>
|
<t t-set="total_amt" t-value="doc.total_sponsorship_amount"/>
|
||||||
<t t-if="total_amt == int(total_amt)">
|
<t t-if="total_amt == int(total_amt)">
|
||||||
<span t-esc="'{:,.0f}'.format(total_amt)"/> <span t-esc="doc.currency_id.symbol"/>
|
<span t-esc="'{:,.0f}'.format(total_amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
<t t-else="">
|
<t t-else="">
|
||||||
<span t-esc="'{:,.2f}'.format(total_amt)"/> <span t-esc="doc.currency_id.symbol"/>
|
<span t-esc="'{:,.2f}'.format(total_amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
</strong>
|
</strong>
|
||||||
</td>
|
</td>
|
||||||
|
|
@ -232,10 +232,10 @@
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: center; padding: 8px; font-size: 1.3rem; color: #387F75;">
|
<td style="text-align: center; padding: 8px; font-size: 1.3rem; color: #387F75;">
|
||||||
<t t-if="pay_amt == int(pay_amt)">
|
<t t-if="pay_amt == int(pay_amt)">
|
||||||
<span t-esc="'{:,.0f}'.format(pay_amt)"/> <span t-esc="pay.currency_id.symbol"/>
|
<span t-esc="'{:,.0f}'.format(pay_amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
<t t-else="">
|
<t t-else="">
|
||||||
<span t-esc="'{:,.2f}'.format(pay_amt)"/> <span t-esc="pay.currency_id.symbol"/>
|
<span t-esc="'{:,.2f}'.format(pay_amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -250,10 +250,10 @@
|
||||||
<td style="text-align: center; padding: 8px; font-size: 1.4rem; color: #387F75; font-weight: bold;">
|
<td style="text-align: center; padding: 8px; font-size: 1.4rem; color: #387F75; font-weight: bold;">
|
||||||
<t t-set="final_amt" t-value="doc.total_sponsorship_amount"/>
|
<t t-set="final_amt" t-value="doc.total_sponsorship_amount"/>
|
||||||
<t t-if="final_amt == int(final_amt)">
|
<t t-if="final_amt == int(final_amt)">
|
||||||
<span t-esc="'{:,.0f}'.format(final_amt)"/> <span t-esc="doc.currency_id.symbol"/>
|
<span t-esc="'{:,.0f}'.format(final_amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
<t t-else="">
|
<t t-else="">
|
||||||
<span t-esc="'{:,.2f}'.format(final_amt)"/> <span t-esc="doc.currency_id.symbol"/>
|
<span t-esc="'{:,.2f}'.format(final_amt)"/> ر.س
|
||||||
</t>
|
</t>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue