diff --git a/models/event.py b/models/event.py index 7fd3d2a..32ff2b3 100755 --- a/models/event.py +++ b/models/event.py @@ -79,6 +79,7 @@ class KalachakraEvent(models.Model): payment_required=fields.Boolean('payment required to valid a registering') display_invoice=fields.Boolean('display invoice') teacher_picto=fields.Binary('Teacher picto') + pre_registration_required=fields.Boolean('pre registration required') @api.depends('seats_unconfirmed', 'seats_reserved', 'seats_used') def _compute_seats_expected(self): diff --git a/models/payment_transaction.py b/models/payment_transaction.py index 720c1c7..3217f00 100755 --- a/models/payment_transaction.py +++ b/models/payment_transaction.py @@ -134,7 +134,7 @@ class AcquirerSystempay(models.Model): delta=str(delta) delta=delta[:-1] prefix=values['reference'][2:3] - if prefix not in ('D','A','P','R'): prefix='' + if prefix not in ('D','A','P','R'): prefix='L' trans_id = prefix+delta.rjust(5) diff --git a/static/js/booking.js b/static/js/booking.js index 9ebaa02..832139d 100755 --- a/static/js/booking.js +++ b/static/js/booking.js @@ -4,11 +4,19 @@ odoo.define('booking.main', function (require) { var _t = core._t; $(document).ready(function() { + console.log($("#pre_registration_required").length) if ($("#individual_booking_event").val()=='True') { $("#continue_button").hide() } + // if ($("#pre_registration_required").length>0) + // { + + // $("#continue_button").hide() + // } + + $('#datetimepickerstart_day').datetimepicker({ format: 'DD/MM/YYYY', @@ -345,6 +353,11 @@ odoo.define('booking.main', function (require) { } + // else if ($("#pre_registration_required").length>0 && !$('input[name=pre_registration_required]').is(':checked') ) + // { + // $('#validation_message').text("Vous n'avez pas cocher la case 'J'ai bien reçu le mail de confirmation suite à ma pré-inscription'") + // $('#validation_message').show() + // } else { $('#form1').submit() @@ -406,6 +419,19 @@ odoo.define('booking.main', function (require) { //console.log($("#id_opt_reduction1200").val()) //console.log('status:'+$("#status").val()) //si coche adhésion alors le statut devient membre + + + // if ($('input[name=pre_registration_required]').is(':checked')) + // { + + // $("#continue_button").show() + // } + // else + // { + // $("#continue_button").hide() + // } + + if (this.value==$("#id_opt_individual_room").val() && this.checked) { //console.log('fff'+"#o["+$("#i_opt_reduction1200").val()+"]") diff --git a/views/booking_website_registration.xml b/views/booking_website_registration.xml index 04c1c92..ab3dee8 100755 --- a/views/booking_website_registration.xml +++ b/views/booking_website_registration.xml @@ -49,7 +49,13 @@ (standard price : , member price : , super member price : ) --> - +

+ + + + +
J'ai bien reçu le mail de confirmation suite à ma pré-inscription :
+


@@ -229,6 +235,7 @@
+
Participant :
diff --git a/views/event.xml b/views/event.xml index 2fd8f34..90f14f6 100755 --- a/views/event.xml +++ b/views/event.xml @@ -65,6 +65,8 @@ + + @@ -162,6 +164,7 @@ + diff --git a/wizard/accounting_file_wizard.py b/wizard/accounting_file_wizard.py index f3acf4a..21702f3 100644 --- a/wizard/accounting_file_wizard.py +++ b/wizard/accounting_file_wizard.py @@ -49,8 +49,8 @@ class AccountingFileWizard(models.TransientModel): #car traité avec les retraites if d.invoice_id: continue d.date_compta=date_compta - if not d.payment_mode_id: raise UserError(_("no payment mode found for donation %r ",donation.number)) - if not d.payment_mode_id.fixed_journal_id: raise UserError(_("no account found for payment mode %r",d.payment_mode_id.name)) + #if not d.payment_mode_id: raise UserError(_("no payment mode found for donation %r ",donation.number)) + #if not d.payment_mode_id.fixed_journal_id: raise UserError(_("no account found for payment mode %r",d.payment_mode_id.name)) account_debit_number=self._file_format(str(d.payment_mode_id.fixed_journal_id.default_account_id.code),6) firstname=d.partner_id.firstname name=d.partner_id.name @@ -69,7 +69,7 @@ class AccountingFileWizard(models.TransientModel): for line in d.line_ids: affectation=line.product_id.name amount=str(line.amount) - if not line.product_id.property_account_income_id: raise UserError(_("no credit account found for product %r",line.product_id)) + #if not line.product_id.property_account_income_id: raise UserError(_("no credit account found for product %r",line.product_id.name)) account_credit_number=self._file_format(line.product_id.property_account_income_id.code,6) break @@ -100,7 +100,7 @@ class AccountingFileWizard(models.TransientModel): #si l'adhésion est liée à une facture, alors on récupère la facture pour trouver le mode de paiement if m.invoice_id: - if not m.invoice_id.payment_id.fixed_journal_id: raise UserError(_("no account found for payment mode %r",m.invoice_id.payment_id.name)) + #if not m.invoice_id.payment_id.fixed_journal_id: raise UserError(_("no account found for payment mode %r",m.invoice_id.payment_id.name)) account_debit_number=self._file_format(str(m.invoice_id.payment_id.fixed_journal_id.default_account_id.code),6) #si l'adhésion est liée à une transaction,le mode de paiement est CB elif m.transaction_id: @@ -113,7 +113,7 @@ class AccountingFileWizard(models.TransientModel): #sinon on prend le mode de paiement au niveau de la fiche d'adhésion else: if m.payment_mode_id: - if not m.payment_mode_id: raise UserError(_("no payment mode found for membership %r",m.partner_id.name)) + #if not m.payment_mode_id: raise UserError(_("no payment mode found for membership %r",m.partner_id.name)) account_debit_number=self._file_format(str(m.payment_mode_id.fixed_journal_id.default_account_id.code),6) firstname=m.partner_id.firstname @@ -123,7 +123,7 @@ class AccountingFileWizard(models.TransientModel): lib1=self._file_format(lib1,12) date_line=self._date_format(str(m.start_date)) amount=str(m.amount) - if not m.product_id.property_account_income_id: raise UserError(_("no credit account found for product %r",m.product_id.name)) + #if not m.product_id.property_account_income_id: raise UserError(_("no credit account found for product %r",m.product_id.name)) account_credit_number=self._file_format(m.product_id.property_account_income_id.code,6) affectation=m.product_id.name @@ -159,7 +159,7 @@ class AccountingFileWizard(models.TransientModel): if registration: for reg in registration: reg.date_compta=date_compta - if not reg.invoice_id.payment_mode_id.fixed_journal_id: raise UserError(_("no account found for payment mode %r",reg.invoice_id.payment_mode_id)) + #if not reg.invoice_id.payment_mode_id.fixed_journal_id: raise UserError(_("no account found for payment mode %r",reg.invoice_id.payment_mode_id)) account_debit_number=self._file_format(str(reg.invoice_id.payment_mode_id.fixed_journal_id.default_account_id.code),6) firstname=m.partner_id.firstname name=m.partner_id.name @@ -167,11 +167,11 @@ class AccountingFileWizard(models.TransientModel): lib1=firstname[0]+' '+name lib1=self._file_format(lib1,12) #date du paiement - date_line=m.write_date.year+'-'+m.write_date.month+'-'+m.write_date.day + date_line=str(m.write_date.year)+'-'+str(m.write_date.month)+'-'+str(m.write_date.day) date_line=self._date_format(date_line) amount=str(m.amount) - if not reg.event_id.participation_product_id: raise UserError(_("no credit account found for product %r",reg.event_id.participation_product_id.name)) + #if not reg.event_id.participation_product_id: raise UserError(_("no credit account found for product %r",reg.event_id.participation_product_id.name)) account_credit_number=self._file_format(reg.event_id.participation_product_id.property_account_income_id.code,6) affectation=reg.event_id.participation_product_id.name @@ -207,7 +207,7 @@ class AccountingFileWizard(models.TransientModel): membership_credit_line=False donation_credit_line=False reg.date_compta=date_compta - if not reg.event_id.participation_product_id.property_account_income_id: raise UserError(_("no credit account found for product %r",reg.event_id.participation_product_id.name)) + #if not reg.event_id.participation_product_id.property_account_income_id: raise UserError(_("no credit account found for product %r",reg.event_id.participation_product_id.name)) account_credit_number=self._file_format(reg.event_id.participation_product_id.property_account_income_id.code,6) firstname=reg.firstname @@ -223,7 +223,7 @@ class AccountingFileWizard(models.TransientModel): down_payment=False balance_payment=False - if not reg.invoice_id.payment_mode_id.fixed_journal_id: raise UserError(_("no account found payment mode %r",reg.invoice_id.payment_mode_id.name)) + #if not reg.invoice_id.payment_mode_id.fixed_journal_id: raise UserError(_("no account found payment mode %r",reg.invoice_id.payment_mode_id.name)) account_debit_number=self._file_format(str(reg.invoice_id.payment_mode_id.fixed_journal_id.default_account_id.code),6) amount=reg.invoice_id.amount_total #recherche de l'adhésion @@ -250,7 +250,7 @@ class AccountingFileWizard(models.TransientModel): donation_amount=0 membership_credit_line=False donation_credit_line=False - if not reg.down_payment_invoice_id.payment_mode_id.fixed_journal_id: raise UserError(_("no account found payment mode %r",reg.down_payment_invoice_id.payment_mode_id.name)) + #if not reg.down_payment_invoice_id.payment_mode_id.fixed_journal_id: raise UserError(_("no account found payment mode %r",reg.down_payment_invoice_id.payment_mode_id.name)) account_debit_number=self._file_format(str(reg.down_payment_invoice_id.payment_mode_id.fixed_journal_id.default_account_id.code),6) amount=reg.down_payment_invoice_id.amount_total+reg.balance_invoice_id.amount_total date_line=self._date_format(str(reg.balance_invoice_id.write_date)) @@ -279,7 +279,7 @@ class AccountingFileWizard(models.TransientModel): balance_payment=False donation_credit_line=False membership_credit_line=False - if not reg.down_payment_invoice_id.payment_mode_id.fixed_journal_id: raise UserError(_("no account found payment mode %r",reg.down_payment_invoice_id.payment_mode_id.name)) + #if not reg.down_payment_invoice_id.payment_mode_id.fixed_journal_id: raise UserError(_("no account found payment mode %r",reg.down_payment_invoice_id.payment_mode_id.name)) account_debit_number=self._file_format(str(reg.down_payment_invoice_id.payment_mode_id.fixed_journal_id.default_account_id.code),6) amount=reg.down_payment_invoice_id.amount_total date_line=self._date_format(str(reg.down_payment_invoice_id.write_date)) @@ -289,7 +289,7 @@ class AccountingFileWizard(models.TransientModel): reg.date_compta=date_compta down_payment=False balance_payment=True - if not reg.balance_invoice_id.payment_mode_id.fixed_journal_id: raise UserError(_("no account found payment mode %r",reg.balance_invoice_id.payment_mode_id.name)) + #if not reg.balance_invoice_id.payment_mode_id.fixed_journal_id: raise UserError(_("no account found payment mode %r",reg.balance_invoice_id.payment_mode_id.name)) account_debit_number=self._file_format(str(reg.down_payment_invoice_id.payment_mode_id.fixed_journal_id.default_account_id.code),6) date_line=self._date_format(str(reg.balance_invoice_id.write_date)) #recherche de l'adhésion @@ -420,7 +420,7 @@ class AccountingFileWizard(models.TransientModel): def _file_format(self,data,nbcars): if data: if len(data)>nbcars: - return data[nbcars] + return data[0:nbcars] else: return data else: