diff --git a/odex25_takaful/odex_takaful/__manifest__.py b/odex25_takaful/odex_takaful/__manifest__.py index 996f1e043..eb21b1319 100644 --- a/odex25_takaful/odex_takaful/__manifest__.py +++ b/odex25_takaful/odex_takaful/__manifest__.py @@ -23,6 +23,7 @@ 'data/sequence_data.xml', 'data/scheduled_actions.xml', + 'data/ir_actions_server_data.xml', 'views/reports_paperformats.xml', 'views/reports_templates.xml', 'views/reports_actions.xml', @@ -37,12 +38,12 @@ 'views/assets.xml', 'views/res_config_settings.xml', 'wizards/orphan_replacement_wizard.xml', + 'views/family_member.xml', 'views/takaful_sponorship_view.xml', 'views/donation_item_views.xml', 'views/replacement_reasons_views.xml', 'views/replacement_process_views.xml', 'views/benefit_views.xml', - 'views/family_member.xml', 'views/takaful_contribution_view.xml', 'views/sponsorship_payment_view.xml', @@ -83,6 +84,7 @@ 'views/product_views.xml', 'views/payment_machine_views.xml', 'views/account_payment_views.xml', + 'wizards/global_extension_wizard_view.xml', 'views/takaful_menus_actions.xml', 'views/benefit_category_views.xml', 'data/message_template_data.xml', @@ -90,6 +92,7 @@ 'wizards/transfer_deduction_wizard_views.xml', 'reports/transfer_deduction_report.xml', 'reports/transfer_deduction_report_templates.xml', + ], 'qweb': [ 'static/src/xml/takaful_dashboard.xml', diff --git a/odex25_takaful/odex_takaful/data/ir_actions_server_data.xml b/odex25_takaful/odex_takaful/data/ir_actions_server_data.xml new file mode 100644 index 000000000..faa124192 --- /dev/null +++ b/odex25_takaful/odex_takaful/data/ir_actions_server_data.xml @@ -0,0 +1,12 @@ + + + + + Print Mother/Orphan Report + + + code + action = records.server_action_print_mother_and_orphan_reports() + + + \ No newline at end of file diff --git a/odex25_takaful/odex_takaful/i18n/ar_001.po b/odex25_takaful/odex_takaful/i18n/ar_001.po index 1a803b36a..a6fcb3bdd 100644 --- a/odex25_takaful/odex_takaful/i18n/ar_001.po +++ b/odex25_takaful/odex_takaful/i18n/ar_001.po @@ -751,6 +751,8 @@ msgstr "مقبوضات الكفالة رقم %s" #. module: odex_takaful #: model:ir.model.fields,field_description:odex_takaful.field_account_payment_register__bank_id +#: model:ir.model.fields,field_description:odex_takaful.field_donation_extension_wizard_line__bank_id +#: model:ir.model.fields,field_description:odex_takaful.field_donations_details_lines__bank_id #: model_terms:ir.ui.view,arch_db:odex_takaful.benefit_month_payment_report_pdf #: model_terms:ir.ui.view,arch_db:odex_takaful.benefit_month_payment_share msgid "Bank" @@ -1185,6 +1187,7 @@ msgstr "هل يمكن جعل الكافل نشطًا مرة أخرى؟" #: model_terms:ir.ui.view,arch_db:odex_takaful.add_benefit_wizard_form #: model_terms:ir.ui.view,arch_db:odex_takaful.add_details_wizard_form #: model_terms:ir.ui.view,arch_db:odex_takaful.benefit_month_payment_form +#: model_terms:ir.ui.view,arch_db:odex_takaful.donation_extension_history_form #: model_terms:ir.ui.view,arch_db:odex_takaful.donation_extension_wizard_form #: model_terms:ir.ui.view,arch_db:odex_takaful.kafalat_cancel_wizard_report_form #: model_terms:ir.ui.view,arch_db:odex_takaful.kafalat_payment_wizard_report_form @@ -1197,6 +1200,7 @@ msgstr "هل يمكن جعل الكافل نشطًا مرة أخرى؟" #: model_terms:ir.ui.view,arch_db:odex_takaful.transfer_deduction_wizard_form_view #: model_terms:ir.ui.view,arch_db:odex_takaful.view_account_payment_register_form #: model_terms:ir.ui.view,arch_db:odex_takaful.view_esterdad_wizard_form +#: model_terms:ir.ui.view,arch_db:odex_takaful.view_global_extension_wizard_form #: model_terms:ir.ui.view,arch_db:odex_takaful.view_otp_wizard_form #: model_terms:ir.ui.view,arch_db:odex_takaful.view_payment_details_wizard_form #: model_terms:ir.ui.view,arch_db:odex_takaful.view_replacement_wiz_form @@ -1989,8 +1993,9 @@ msgstr "قالب رسالة SMS انتهاء التبرع" #. module: odex_takaful #: model:ir.model,name:odex_takaful.model_donation_extension_history +#: model:ir.ui.menu,name:odex_takaful.menu_donation_extension_history msgid "Donation Extension History" -msgstr "سجل تمديد التبرع" +msgstr "سجلات التمديد" #. module: odex_takaful #: model:ir.model.fields,field_description:odex_takaful.field_res_company__donation_extension_reminder_sms_template_id @@ -2977,6 +2982,7 @@ msgstr "مفوتر" #: model:ir.model.fields,field_description:odex_takaful.field_sponsorship_payment__invoice_ids #: model:ir.model.fields,field_description:odex_takaful.field_takaful_sponsorship__invoice_count #: model_terms:ir.ui.view,arch_db:odex_takaful.takaful_sponsorship_form +#: model_terms:ir.ui.view,arch_db:odex_takaful.view_esterdad_wizard_form #, python-format msgid "Invoices" msgstr "الفواتير" @@ -3093,18 +3099,22 @@ msgstr "تم الإصدار بواسطة" #. module: odex_takaful #: model:ir.model,name:odex_takaful.model_account_journal -#: model:ir.model.fields,field_description:odex_takaful.field_donation_extension_wizard_line__journal_id -#: model:ir.model.fields,field_description:odex_takaful.field_donations_details_lines__journal_id -#: model:ir.model.fields,field_description:odex_takaful.field_extension_payment_wizard_line__journal_id #: model:ir.model.fields,field_description:odex_takaful.field_grant_benefit_invoice__journal_id #: model:ir.model.fields,field_description:odex_takaful.field_month_payment__journal_id #: model:ir.model.fields,field_description:odex_takaful.field_payment_details_lines__journal_id -#: model:ir.model.fields,field_description:odex_takaful.field_payment_machine__journal_id #: model:ir.model.fields,field_description:odex_takaful.field_points_of_sale_custom__journal_id -#: model:ir.model.fields,field_description:odex_takaful.field_takaful_payment_method__journal_id msgid "Journal" msgstr "دفتر اليومية" +#. module: odex_takaful +#: model:ir.model.fields,field_description:odex_takaful.field_donation_extension_wizard_line__journal_id +#: model:ir.model.fields,field_description:odex_takaful.field_donations_details_lines__journal_id +#: model:ir.model.fields,field_description:odex_takaful.field_extension_payment_wizard_line__journal_id +#: model:ir.model.fields,field_description:odex_takaful.field_payment_machine__journal_id +#: model:ir.model.fields,field_description:odex_takaful.field_takaful_payment_method__journal_id +msgid "Journal" +msgstr "بنك الجمعية" + #. module: odex_takaful #: model:ir.model,name:odex_takaful.model_account_move #: model:ir.model.fields,field_description:odex_takaful.field_takaful_sponsorship__journal_entry_ids @@ -3204,6 +3214,8 @@ msgstr "مستخدم الكفالات" #. module: odex_takaful #: model:ir.model.fields,field_description:odex_takaful.field_account_payment_register__last_digits +#: model:ir.model.fields,field_description:odex_takaful.field_donation_extension_wizard_line__last_digits +#: model:ir.model.fields,field_description:odex_takaful.field_donations_details_lines__last_digits msgid "Last Digits" msgstr "رقم الحساب" @@ -4901,6 +4913,11 @@ msgstr "طباعة ورقة البنك" msgid "Print Excel" msgstr "طباعة Excel" +#. module: odex_takaful +#: model_terms:ir.ui.view,arch_db:odex_takaful.donation_extension_history_form +msgid "Print Extension Receipt" +msgstr "طباعة السند" + #. module: odex_takaful #: model_terms:ir.ui.view,arch_db:odex_takaful.sponsor_report_menu_form #: model_terms:ir.ui.view,arch_db:odex_takaful.transfer_deduction_wizard_form_view @@ -5940,6 +5957,7 @@ msgstr "تأكيد الكفالة - ${object.sponsor_id.name}" #: model:ir.model.fields,field_description:odex_takaful.field_donations_details_lines__sponsorship_creation_date #: model:ir.model.fields,field_description:odex_takaful.field_takaful_sponsorship__sponsorship_creation_date #: model_terms:ir.ui.view,arch_db:odex_takaful.report_transfer_deduction_document +#: model_terms:ir.ui.view,arch_db:odex_takaful.takaful_sponsorship_view_search #, python-format msgid "Sponsorship Creation Date" msgstr "تاريخ الإنشاء" @@ -6956,6 +6974,8 @@ msgid "Yes" msgstr "نعم" #. module: odex_takaful +#: model_terms:ir.ui.view,arch_db:odex_takaful.donation_extension_wizard_form +#: model_terms:ir.ui.view,arch_db:odex_takaful.takaful_sponsorship_form #: model_terms:ir.ui.view,arch_db:odex_takaful.view_account_payment_register_form msgid "You Can Type 4 Digits" msgstr "يمكنك إدخال آخر اربعة أرقام" @@ -7466,6 +7486,18 @@ msgstr "شيك" msgid "Direct Debit" msgstr "استقطاع" +#. module: odex_takaful +#: model:ir.model.fields,field_description:odex_takaful.field_account_payment__direct_debit +#: model:ir.model.fields,field_description:odex_takaful.field_donation_extension_wizard_line__direct_debit +#: model:ir.model.fields,field_description:odex_takaful.field_donations_details_lines__direct_debit +#: model:ir.model.fields,field_description:odex_takaful.field_sponsorship_scheduling_line__direct_debit +#: model:ir.model.fields.selection,name:odex_takaful.selection__account_payment_register__takaful_payment_method__direct_debit +#: model:ir.model.fields.selection,name:odex_takaful.selection__donations_details_lines__direct_debit_filter__direct +#: model_terms:ir.ui.view,arch_db:odex_takaful.donations_details_lines_view_search +#: model_terms:ir.ui.view,arch_db:odex_takaful.view_sponsorship_scheduling_line_search +msgid "Direct Debit" +msgstr "إستقطاع" + #. module: odex_takaful #: code:addons/odex_takaful/static/src/xml/takaful_dashboard.xml:0 msgid "Network" @@ -7516,3 +7548,42 @@ msgstr "طريقة السداد (بالاسم)" #: model:ir.model.fields,field_description:odex_takaful.field_account_payment__payment_method_name msgid "Payment Method Name" msgstr "اسم طريقة السداد" + +#. module: odex_takaful +#: model:ir.model.fields,field_description:odex_takaful.field_global_extension_wizard__number_of_months +msgid "Number of Months" +msgstr "أشهر التمديد" + +#. module: odex_takaful +#: model_terms:ir.ui.view,arch_db:odex_takaful.view_global_extension_wizard_form +msgid "Confirm" +msgstr "تاكيد" + +#. module: odex_takaful +#: model:ir.model.fields,field_description:odex_takaful.field_global_extension_wizard__line_ids +#: model_terms:ir.ui.view,arch_db:odex_takaful.view_global_extension_wizard_form +msgid "Donation Lines" +msgstr "الكفالات" + +#. module: odex_takaful +#: code:addons/odex_takaful/wizards/global_extension_wizard.py:0 +#, python-format +msgid "Extend Donation" +msgstr "تمديد الكفالة" + +#. module: odex_takaful +#: model:ir.actions.act_window,name:odex_takaful.action_global_extension_wizard +#: model:ir.ui.menu,name:odex_takaful.menu_global_extension_wizard +#: model_terms:ir.ui.view,arch_db:odex_takaful.view_global_extension_wizard_form +msgid "Global Extension" +msgstr "التمديد الشامل" + +#. module: odex_takaful +#: model:ir.actions.server,name:odex_takaful.server_action_print_mother_and_orphan_reports +msgid "Print Mother/Orphan Report" +msgstr "طباعة تقرير أم اليتيم/اليتيم" + +#. module: odex_takaful +#: model_terms:ir.ui.view,arch_db:odex_takaful.takaful_account_move_inherit_form +msgid "Previous Payments" +msgstr "المدفوعات السابقة" \ No newline at end of file diff --git a/odex25_takaful/odex_takaful/models/__init__.py b/odex25_takaful/odex_takaful/models/__init__.py index b1d92c5ba..cc34d8c0d 100644 --- a/odex25_takaful/odex_takaful/models/__init__.py +++ b/odex25_takaful/odex_takaful/models/__init__.py @@ -31,3 +31,4 @@ from . import donation_replacement_log from . import payment_machine from . import benefit_category +from . import mail_message diff --git a/odex25_takaful/odex_takaful/models/account_move.py b/odex25_takaful/odex_takaful/models/account_move.py index 552181d0d..c1b6af496 100644 --- a/odex25_takaful/odex_takaful/models/account_move.py +++ b/odex25_takaful/odex_takaful/models/account_move.py @@ -15,6 +15,9 @@ class AccountMove(models.Model): payment_id = fields.Many2one('account.payment', string='Payment', copy=False) esterdad_id = fields.Many2one('esterdad.wizard') + previous_payment_ids = fields.Many2many(related='esterdad_id.payment_ids') + sponsorship_cancel_reason = fields.Text(readonly=True) + def action_view_esterdad_id(self): self.ensure_one() diff --git a/odex25_takaful/odex_takaful/models/donation_details_lines.py b/odex25_takaful/odex_takaful/models/donation_details_lines.py index ddd91a806..d1ec0031d 100644 --- a/odex25_takaful/odex_takaful/models/donation_details_lines.py +++ b/odex25_takaful/odex_takaful/models/donation_details_lines.py @@ -143,6 +143,17 @@ class DonationsDetailsLines(models.Model): ) payment_method_type = fields.Selection(related='payment_method_display.payment_method', string='Payment Method Type', store=True) benefit_kafala_status = fields.Selection(related='benefit_id.kafala_status', string="Benefit Kafala Status") + show_last_digits = fields.Boolean(string="Use 4 Digits", ) + last_digits = fields.Char(string="Last Digits", size=32) + bank_id = fields.Many2one('res.bank', string="Bank") + + @api.onchange("direct_debit_partner_bank_id") + def onchange_direct_debit_partner_bank_id(self): + for rec in self: + if rec.direct_debit_partner_bank_id: + rec.show_last_digits = False + else: + rec.show_last_digits = True @api.onchange('family_id') @@ -1424,3 +1435,14 @@ class DonationsDetailsLines(models.Model): 'default_donation_detail_id': self.id, }, } + + @api.model + def search(self, args, offset=0, limit=None, order=None, count=False): + if self.env.context.get('wizard_force_show_all'): + self = self.sudo() + return super(DonationsDetailsLines, self).search(args, offset, limit, order, count) + + def read(self, fields=None, load='_classic_read'): + if self.env.context.get('wizard_force_show_all'): + self = self.sudo() + return super(DonationsDetailsLines, self).read(fields, load) diff --git a/odex25_takaful/odex_takaful/models/donation_extension_history.py b/odex25_takaful/odex_takaful/models/donation_extension_history.py index f6bfb371e..92d5b97d8 100644 --- a/odex25_takaful/odex_takaful/models/donation_extension_history.py +++ b/odex25_takaful/odex_takaful/models/donation_extension_history.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- from odoo import models, fields, api, _ +from dateutil.relativedelta import relativedelta class DonationExtensionHistory(models.Model): @@ -106,6 +107,7 @@ class DonationExtensionHistory(models.Model): state = fields.Selection([ ('active', 'Active'), + ('wait_pay', 'Wait Pay'), ('paid', 'Paid'), ('cancel', 'Canceled') ], string='State', default='active', tracking=True) @@ -125,6 +127,74 @@ class DonationExtensionHistory(models.Model): store=False ) + direct_debit_partner_bank_id = fields.Many2one("res.partner.bank") + debit_payment_file_attachment = fields.Binary(attachment=True) + debit_payment_attachment_file_name = fields.Char() + journal_id = fields.Many2one('account.journal') + last_digits = fields.Char() + bank_id = fields.Many2one('res.bank') + + paid_amount = fields.Float() + + + def _apply_extension_on_sponsorship(self): + new_end_date = self.donation_detail_id.end_date + relativedelta(months=self.extension_months) + + donation_line_new_vals = { + 'end_date': new_end_date, + 'payment_month_count': self.donation_detail_id.payment_month_count + self.extension_months, + } + if self.new_direct_debit: + donation_line_new_vals.update({ + 'direct_debit': self.new_direct_debit, + 'direct_debit_partner_bank_id': self.direct_debit_partner_bank_id.id, + 'journal_id': self.journal_id.id, + 'debit_payment_file_attachment': self.debit_payment_file_attachment, + 'debit_payment_attachment_file_name': self.debit_payment_attachment_file_name, + 'last_digits': self.last_digits, + 'bank_id': self.bank_id.id, + }) + + self.donation_detail_id.write(donation_line_new_vals) + + benefit_ids = self.donation_detail_id.benefit_ids | self.donation_detail_id.benefit_id + benefit_ids.write({ + 'sponsorship_end_date': new_end_date, + 'kafala_status': 'have_kafala', + }) + + # Create new scheduling lines for the extension period + if self.new_direct_debit: + self._create_extension_scheduling_lines() + + def _create_extension_scheduling_lines(self): + self.ensure_one() + + donation_line = self.donation_detail_id + start_date = donation_line.end_date + relativedelta(months=1) + + # Distribute total amount across months + base_amount, remainder = divmod(self.extension_amount, self.extension_months) + base_amount = float(base_amount) + + for month in range(self.extension_months): + scheduled_date = start_date + relativedelta(months=month) + month_year = scheduled_date.strftime("%m/%Y") + # Distribute remainder across first months + amount = base_amount + 1 if month < remainder else base_amount + # Format the amount to 2 decimal places for better representation + amount = round(amount, 2) + # Create scheduling line + self.env['sponsorship.scheduling.line'].sudo().create({ + 'sponsorship_id': donation_line.sponsorship_id.id or donation_line.sponsorship_mechanism_id.id, + 'donation_detail_linked_id': donation_line.id, + 'beneficiary_id': donation_line.benefit_id.id if donation_line.benefit_id else False, + 'month_year': month_year, + 'scheduled_date': scheduled_date, + 'amount': amount, + 'status': 'unpaid', + }) + def _sms_get_number_fields(self): """Return fields to use for SMS phone number""" return ['sponsor_phone'] @@ -172,7 +242,7 @@ class DonationExtensionHistory(models.Model): 'context': { 'active_model': 'account.move', 'active_ids': self.invoice_id.ids, - 'default_amount': self.extension_amount, + 'default_amount': self.extension_amount - self.paid_amount, 'sponsorship_payment_skip_compute_amount': True, 'dont_redirect_to_payments': True, 'sponsorship_line_ids': self.donation_detail_id.ids, @@ -188,6 +258,23 @@ class DonationExtensionHistory(models.Model): 'type': 'ir.actions.act_window', } + def action_cancel_invoice(self): + self.ensure_one() + + self.sudo().invoice_id.button_draft() + self.sudo().invoice_id.button_cancel() + + if self.new_direct_debit: + scheduling_lines = self.env['sponsorship.scheduling.line'].search([ + ('donation_detail_linked_id', '=', self.donation_detail_id.id), + ('scheduled_date', '>', self.old_end_date) + ]) + scheduling_lines.sudo().unlink() + + self.write({ + 'state': 'cancel' + }) + def action_print_extension_receipt(self): """Print the extension receipt PDF report.""" self.ensure_one() diff --git a/odex25_takaful/odex_takaful/models/family_member.py b/odex25_takaful/odex_takaful/models/family_member.py index 46a74537d..6c66ba8aa 100644 --- a/odex25_takaful/odex_takaful/models/family_member.py +++ b/odex25_takaful/odex_takaful/models/family_member.py @@ -59,6 +59,9 @@ class FamilyMember(models.Model): allowed_sponsorship = fields.Boolean(related='benefit_id.benefit_category_id.allowed_sponsorship') + def server_action_print_mother_and_orphan_reports(self): + return self.env.ref('odex_takaful.action_report_mother_and_orphan').report_action(self) + def name_get(self): result = [] show_age = self.env.context.get('show_age_in_kafalat') diff --git a/odex25_takaful/odex_takaful/models/mail_message.py b/odex25_takaful/odex_takaful/models/mail_message.py new file mode 100644 index 000000000..adefcfeab --- /dev/null +++ b/odex25_takaful/odex_takaful/models/mail_message.py @@ -0,0 +1,12 @@ +from odoo import models, api + + +class Message(models.Model): + _inherit = 'mail.message' + + + @api.model + def _find_allowed_model_wise(self, doc_model, doc_dict): + doc_ids = list(doc_dict) + allowed_doc_ids = self.env[doc_model].with_context(active_test=False).search([('id', 'in', doc_ids)]).ids + return set([message_id for allowed_doc_id in allowed_doc_ids if allowed_doc_id in doc_dict for message_id in doc_dict[allowed_doc_id]]) \ No newline at end of file diff --git a/odex25_takaful/odex_takaful/models/sponsorship_scheduling_line.py b/odex25_takaful/odex_takaful/models/sponsorship_scheduling_line.py index 5b6abd620..90b5522fd 100644 --- a/odex25_takaful/odex_takaful/models/sponsorship_scheduling_line.py +++ b/odex25_takaful/odex_takaful/models/sponsorship_scheduling_line.py @@ -158,6 +158,13 @@ class SchedulingLine(models.Model): elif line.donation_detail_linked_id.state != 'waiting' and line.donation_detail_linked_id.record_type != 'donation' and line.donation_detail_linked_id.record_type == 'sponsorship': line.donation_detail_linked_id.sudo().write({'state': 'active'}) line.donation_detail_linked_id.sponsorship_id.sudo().write({'state': 'wait_pay'}) + histories = self.env['donation.extension.history'].sudo().search([ + ('donation_detail_id', '=', line.donation_detail_linked_id.id), + ('old_end_date', '<', line.scheduled_date), + ('new_end_date', '>=', line.scheduled_date) + ]) + if len(histories): + histories.write({'state': 'wait_pay'}) _logger.info(f"Successfully processed scheduled payment for line {line.sequence_no}") diff --git a/odex25_takaful/odex_takaful/models/takaful_sponorship_model.py b/odex25_takaful/odex_takaful/models/takaful_sponorship_model.py index 037084157..37fc58c6d 100644 --- a/odex25_takaful/odex_takaful/models/takaful_sponorship_model.py +++ b/odex25_takaful/odex_takaful/models/takaful_sponorship_model.py @@ -330,9 +330,9 @@ class TakafulSponsorship(models.Model): context = dict(self.env.context or {}) context['default_sponsor_id'] = rec.id context['default_pay_date'] = rec.pay_date - context['default_amount'] = rec.total_sponsorship_amount + # context['default_amount'] = rec.total_sponsorship_amount context['default_sponsor_name'] = rec.sponsor_id.first_name - context['default_mobile'] = rec.sponsor_id.mobile + context['default_mobile'] = rec.sponsor_phone context['default_id_num'] = rec.sponsor_id.id_number # context['default_payment_ids'] = rec.payment_ids.ids view = self.env.ref('odex_takaful.view_esterdad_wizard_form') @@ -349,13 +349,11 @@ class TakafulSponsorship(models.Model): else: raise UserError(_("You cannot do this. The refund period has expired.")) - - - @api.depends('sponsor_id','sponsor_id.mobile') + @api.depends('sponsor_id', 'sponsor_id.mobile') def _compute_sponsor_phone(self): - for rec in self: - if rec.sponsor_id.id != rec.env.company.faal_kheer_partner_id.id: - rec.sponsor_phone = rec.sponsor_id.mobile if rec.sponsor_id else False + for rec in self.filtered(lambda r: r.state in ['draft']): + if rec.sponsor_or_donor_type == 'registered': + rec.sponsor_phone = rec.sponsor_id.mobile def compute_days_after_payment(self): """Check if the number of hours passed after payment is within the configured limit""" @@ -1057,7 +1055,7 @@ class TakafulSponsorship(models.Model): rec.sponsor_donor_type = 'registered' # Update related fields from selected sponsor - rec.sponsor_phone = rec.sponsor_id.mobile + # rec.sponsor_phone = rec.sponsor_id.mobile rec.preferred_communication = rec.sponsor_id.preferred_communication @api.model @@ -1659,7 +1657,11 @@ class TakafulSponsorship(models.Model): else: pass #self.action_send_whatsapp() - + direct_debit_sponsorship_line_ids = (self.donations_details_lines | self.donations_details_lines_mechanism_ids).filtered( + lambda l: l.direct_debit) + for dd_line in direct_debit_sponsorship_line_ids: + for sched_line in dd_line.sponsorship_scheduling_line_ids: + sched_line.cron_process_scheduled_payments() def action_send_whatsapp(self): config = self.env['ir.config_parameter'].sudo() diff --git a/odex25_takaful/odex_takaful/reports/extension_receipt_report.xml b/odex25_takaful/odex_takaful/reports/extension_receipt_report.xml index 6c482bd0a..78db5836c 100644 --- a/odex25_takaful/odex_takaful/reports/extension_receipt_report.xml +++ b/odex25_takaful/odex_takaful/reports/extension_receipt_report.xml @@ -5,99 +5,98 @@ - - - + + + - - - -
+ + + +
-
-
+
+
- -
-
- مرحباً - + +
+
+ مرحباً + +
+
+ بكل امتنان نشكر لك تجديد كفالتك، ونسأل الله أن يجعلك ممن يرافقون النبي + ﷺ +
في الجنة. +
+
+ ونتشرف دائما باستقبال عطائك المستمر لدعم أبنائكم الأيتام. +
-
- بكل امتنان نشكر لك تجديد كفالتك، ونسأل الله أن يجعلك ممن يرافقون النبي - ﷺ -
في الجنة. -
-
- ونتشرف دائما باستقبال عطائك المستمر لدعم أبنائكم الأيتام. -
-
- -
-
- رقم الكفالة: - + +
+
+ رقم الكفالة: + +
+
+ تاريخ التجديد: + + + +
-
- تاريخ التجديد: - - - -
-
- - - - - - - - - - - - + +
- نوع التبرع - - التفاصيل - - الفترة الجديدة - - المبلغ -
+ + + + + + + + + - - - - - - - - - -
+ نوع التبرع + + التفاصيل + + الفترة الجديدة + + المبلغ +
- + - - - + + - - +
- شهور التمديد: + شهور التمديد:
- من: + من:
- إلى + إلى
- + ر.س @@ -106,100 +105,100 @@
- المجموع: - - - - - - - - - - - ر.س - - - ر.س - - -
+ + + + المجموع: + + + - + + + - + + + + + + ر.س + + + ر.س + + + + + + - - - - - - - - - - - - - - + + + + +
- وسيلة الدفع - - المبلغ -
- - - - - - - + + + + + + + + + + + + + + + - - - ر.س - - - ر.س - + + + - - - - - - - - - - - -
+ وسيلة الدفع + + المبلغ +
+ + + + + + + + + + + ر.س + + + ر.س + +
+ + الإجمالي: + + + + + ر.س + + + ر.س +
- - الإجمالي: - - - - - ر.س - - - ر.س - -
- لا توجد دفعات -
+ +
+ لا توجد دفعات +
+
-
+ diff --git a/odex25_takaful/odex_takaful/reports/orphan_report.xml b/odex25_takaful/odex_takaful/reports/orphan_report.xml index 559834b77..72c904303 100644 --- a/odex25_takaful/odex_takaful/reports/orphan_report.xml +++ b/odex25_takaful/odex_takaful/reports/orphan_report.xml @@ -12,322 +12,374 @@ 0 0 0 + 100 -