From 86acdd202e7bb1e8fafcc11ceebd780ebb8c0536 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 19 Nov 2022 13:29:21 +0100 Subject: [PATCH] 67 --- models/booking_event.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/models/booking_event.py b/models/booking_event.py index 521273d..1144981 100755 --- a/models/booking_event.py +++ b/models/booking_event.py @@ -87,7 +87,7 @@ class BookingEvent(models.Model): ) - + @api.onchange('questionnaire_id') def onchange_questionnaire(self): @@ -130,7 +130,7 @@ class BookingEvent(models.Model): payment_mode=self._compute_payment_mode(reg) amount_paid=self._compute_amount_paid(reg) - csv_lines=csv_lines+name+';'+role+';'+options+';'+booking_amount+';'+membership_amount+';'+invoice_options_amount+';'+amount_to_be_paid+';'+payment_status+';'+payment_mode+';'+amount_paid+'\n' + csv_lines=csv_lines+name+';'+gender+';'+role+';'+options+';'+booking_amount+';'+membership_amount+';'+invoice_options_amount+';'+amount_to_be_paid+';'+payment_status+';'+payment_mode+';'+amount_paid+'\n' return str.encode(header_ligne+csv_lines,'utf-8') @@ -217,10 +217,16 @@ class BookingEvent(models.Model): #si facture avec acompte: if rec.down_payment_invoice_id: + for line in rec.down_payment_invoice_id.invoice_line_ids: - if line.name==membership_product.name: - booking_amount=rec.booking_amount+line.price_subtotal + if line.name!=membership_product.name: + booking_amount=line.price_subtotal + break + for line in rec.balance_invoice_id.invoice_line_ids: + if line.name!=membership_product.name: + booking_amount=booking_amount+line.price_subtotal break + return str(booking_amount) def _compute_member_status(self,reg):