diff --git a/odex25_ensan/odex_takaful/i18n/ar_001.po b/odex25_ensan/odex_takaful/i18n/ar_001.po index 74c96adec..a1db14783 100644 --- a/odex25_ensan/odex_takaful/i18n/ar_001.po +++ b/odex25_ensan/odex_takaful/i18n/ar_001.po @@ -243,6 +243,11 @@ msgstr "تاريخ الدفع:" msgid "Payment Method:" msgstr "طريقة الدفع:" +#. module: enasan_geidea_sponsorship +#: model_terms:ir.ui.view,arch_db:enasan_geidea_sponsorship.view_account_payment_register_form_geidea +msgid "Process on Terminal" +msgstr "الدفع على المنصة" + #. module: odex_takaful #: model_terms:ir.ui.view,arch_db:odex_takaful.report_transfer_deduction_document msgid "Payment Method" diff --git a/odex25_ensan/odex_takaful/models/donation_details_lines.py b/odex25_ensan/odex_takaful/models/donation_details_lines.py index 87527145b..4c4410522 100644 --- a/odex25_ensan/odex_takaful/models/donation_details_lines.py +++ b/odex25_ensan/odex_takaful/models/donation_details_lines.py @@ -99,6 +99,34 @@ class DonationsDetailsLines(models.Model): journal_id = fields.Many2one('account.journal', string="Journal",domain="[('type','=','bank')]",default=_default_journal_id) benefit_status = fields.Selection(related='benefit_id.member_status') ages = fields.Integer(compute='_compute_get_age_range' , store=True) + waiting_date = fields.Date( + string="تاريخ الانتظار", + compute="_compute_dates", + store=True + ) + + replace_date = fields.Date( + string="تاريخ الاستبدال", + compute="_compute_dates", + store=True + ) + + @api.depends('state') + def _compute_dates(self): + """Automatically set waiting_date or replace_date based on state.""" + for rec in self: + if rec.state == 'waiting': + print(date.today()) + rec.waiting_date = date.today() + rec.replace_date = False + elif rec.state == 'replace': + rec.replace_date = date.today() + rec.waiting_date = False + else: + rec.waiting_date = False + rec.replace_date = False + + # cheque_number = fields.Integer(string="Cheque Number") # cheque_due_date = fields.Date(string="Cheque Due Date") # cheque_file_attachment = fields.Binary(string='Cheque Attachment', attachment=True) @@ -881,6 +909,20 @@ class DonationsDetailsLines(models.Model): if sponsorship and len(sponsorship) == 1: message = _("Benefit IDs changed in a donation item:
%s") % "
".join(changes) sponsorship.message_post(body=message) + + # if 'state' in vals: + # print('In Vals') + # print("vals['state'] >>> " , vals['state']) + # if vals['state'] == 'waiting': + # vals['waiting_date'] = date.today() + # print("vals['waiting_date'] >>> " , vals['waiting_date']) + # vals['replace_date'] = False + # elif vals['state'] == 'replace': + # vals['replace_date'] = date.today() + # vals['waiting_date'] = False + # else: + # vals['waiting_date'] = False + # vals['replace_date'] = False self.onset_benefit_id() return res diff --git a/odex25_ensan/odex_takaful/models/res_partner.py b/odex25_ensan/odex_takaful/models/res_partner.py index dddf7dc1a..4167b994d 100644 --- a/odex25_ensan/odex_takaful/models/res_partner.py +++ b/odex25_ensan/odex_takaful/models/res_partner.py @@ -281,6 +281,14 @@ class ResPartner(models.Model): if 'mobile' in vals: self._check_phone_numbers(vals['mobile']) vals['mobile'] = self.phone_format(vals['mobile']) + if 'name' in vals : + if self.kafel_id: + self.kafel_id.name = vals['name'] + + if 'mobile' in vals : + if self.kafel_id: + self.kafel_id.login = vals['mobile'] + res = super(ResPartner, self).write(vals) return res diff --git a/odex25_ensan/odex_takaful/views/donations_details_lines.xml b/odex25_ensan/odex_takaful/views/donations_details_lines.xml index 5582f6347..1268e2518 100644 --- a/odex25_ensan/odex_takaful/views/donations_details_lines.xml +++ b/odex25_ensan/odex_takaful/views/donations_details_lines.xml @@ -61,11 +61,12 @@ donations.details.lines.view.tree donations.details.lines - + + @@ -84,6 +85,8 @@ + + + @@ -362,16 +366,18 @@ Donations Details Lines waiting donations.details.lines tree,form + [('state', '=', 'waiting')] - {'create': False, 'delete': False, 'search_default_filter_waiting': 1} + {'create': False, 'delete': False} Donations Details Lines Replacement donations.details.lines tree,form + [('state', '=', 'replace')] - {'create': False, 'delete': False, 'search_default_filter_replace': 1} + {'create': False, 'delete': False} diff --git a/odex25_ensan/odex_takaful/views/takaful_menus_actions.xml b/odex25_ensan/odex_takaful/views/takaful_menus_actions.xml index 79ff0230d..705849407 100644 --- a/odex25_ensan/odex_takaful/views/takaful_menus_actions.xml +++ b/odex25_ensan/odex_takaful/views/takaful_menus_actions.xml @@ -13,11 +13,13 @@ - - + name="Donations Details Lines To Replace Benefit" action="donations_details_lines_replace_action" sequence="3"/> + + + + @@ -27,7 +29,7 @@ - - \ No newline at end of file + diff --git a/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml b/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml index 56a65fc41..0a48459e1 100644 --- a/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml +++ b/odex25_ensan/odex_takaful/views/takaful_sponorship_view.xml @@ -514,6 +514,7 @@ + + - + diff --git a/odex25_ensan/odex_takaful/wizards/account_payment_register.py b/odex25_ensan/odex_takaful/wizards/account_payment_register.py index ec09ec848..f3dab7a0f 100644 --- a/odex25_ensan/odex_takaful/wizards/account_payment_register.py +++ b/odex25_ensan/odex_takaful/wizards/account_payment_register.py @@ -30,11 +30,17 @@ class AccountRegisterPayment(models.TransientModel): transaction_file_attachment = fields.Binary(string='Transaction Attachment', attachment=False) transaction_attachment_file_name = fields.Char('Transaction File Name', required=False) payment_method = fields.Selection(selection=[("cash", "Cash"), ("bank", "Bank Transfer"), ("check", "Check")], string="Payment Method", required=True, default="cash") - + machine_id = fields.Many2one('geidea.terminals' , 'الماكينة') check_number = fields.Char(string='Check Number') check_due_date = fields.Date(string='Check Due Date') sponsorship_payment = fields.Boolean(string='Sponsorship Payment', default=False) + + @api.onchange("machine_id") + def onchange_machine_id(self): + for rec in self: + if rec.machine_id: + rec.journal_id = rec.machine_id.journal_id @api.onchange("takaful_payment_method_id") def onchange_takaful_payment_method_id(self): for rec in self: @@ -48,6 +54,7 @@ class AccountRegisterPayment(models.TransientModel): j_type = "bank" if j_type: return {"domain": {"journal_id": [("type", "=", j_type)]}} + @api.depends('source_amount', 'source_amount_currency', 'source_currency_id', 'company_id', 'currency_id', 'payment_date') def _compute_amount(self): @@ -66,6 +73,7 @@ class AccountRegisterPayment(models.TransientModel): rec.takaful_payment_method = "bank" else: rec.takaful_payment_method = "cash" + def _create_payments(self): sponsorship_line_ids = self.env.context.get('sponsorship_line_ids') diff --git a/odex25_ensan/odex_takaful/wizards/account_payment_register.xml b/odex25_ensan/odex_takaful/wizards/account_payment_register.xml index 8b838ea26..1c8d4870a 100644 --- a/odex25_ensan/odex_takaful/wizards/account_payment_register.xml +++ b/odex25_ensan/odex_takaful/wizards/account_payment_register.xml @@ -51,6 +51,71 @@ attrs="{'invisible': ['|', ('sponsorship_payment', '=', False), ('takaful_payment_method','not in',['bank', 'check'])], 'required': [('sponsorship_payment', '=', True), ('takaful_payment_method','=','bank')]}"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +