Browse Source

payment link , accounting export, pre_registration required (in progress)

master
root 2 years ago
parent
commit
df7268d06d
6 changed files with 54 additions and 17 deletions
  1. +1
    -0
      models/event.py
  2. +1
    -1
      models/payment_transaction.py
  3. +26
    -0
      static/js/booking.js
  4. +8
    -1
      views/booking_website_registration.xml
  5. +3
    -0
      views/event.xml
  6. +15
    -15
      wizard/accounting_file_wizard.py

+ 1
- 0
models/event.py View File

@ -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):


+ 1
- 1
models/payment_transaction.py View File

@ -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)


+ 26
- 0
static/js/booking.js View File

@ -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()+"]")


+ 8
- 1
views/booking_website_registration.xml View File

@ -49,7 +49,13 @@
<h7>(standard price : <span t-esc="str(int(int(event.booking_price)))+ ' €'"></span>
, member price : <span t-esc="str(int(int(event.booking_member_price)))+ ' €'"></span>
, super member price : <span t-esc="str(int(int(event.booking_super_member_price)))+ ' €'"></span>)</h7> -->
<br></br>
<t t-if="event.pre_registration_required">
<table>
<td><span style="color:red">J'ai bien reçu le mail de confirmation suite à ma pré-inscription :</span></td>
<td><input type="checkbox" name="pre_registration_required" id="pre_registration_required" style="width: 30px; height: 30px;" /></td>
</table>
</t>
<br></br>
<t t-if="not options">
<input type="hidden" name="nb_o" value="0"/>
@ -229,6 +235,7 @@
</t>
<section class="s_website_form pt16 pb16 o_colored_level">
<h6>Participant :</h6>
<div class="form-group s_website_form_field s_website_form_custom s_website_form_required" data-type="char" data-name="Field">


+ 3
- 0
views/event.xml View File

@ -65,6 +65,8 @@
<field name="online_link" invisible="context.get('booking_event_view')"/>
<field name="online_id" invisible="context.get('booking_event_view')"/>
<field name="online_password" invisible="context.get('booking_event_view')"/>
</xpath>
<xpath expr="//field[@name='date_begin']" position="replace">
<field name="date_begin"/>
@ -162,6 +164,7 @@
<field name="no_onthespot_payment" invisible="context.get('booking_event_view')"/>
<field name="payment_required" invisible="context.get('booking_event_view')"/>
<field name="display_invoice" invisible="context.get('booking_event_view')"/>
<field name="pre_registration_required" attrs="{'invisible':[('booking_event','=',False)]}"/>
<field name="online_only" attrs="{'invisible':[('booking_event','=',True)]}"/>
<field name="free_participation" attrs="{'invisible':[('booking_event','=',True)]}"/>
<field name="recurring_event" attrs="{'invisible':[('booking_event','=',True)]}"/>


+ 15
- 15
wizard/accounting_file_wizard.py View File

@ -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:


Loading…
Cancel
Save