odoo.define('booking.main', function (require) {
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#medical_info').hide()
|
|
|
|
$('#booking_total_price').text(
|
|
$('#booking_price_product').val()+' €'
|
|
);
|
|
|
|
});
|
|
|
|
$( "#medical_concern" ).change(function() {
|
|
|
|
if (this.value=='have medical concern')
|
|
{
|
|
|
|
$('#medical_info').show()
|
|
$("medical_info_div").addClass("s_website_form_required");
|
|
$("medical_information").prop('required',true);
|
|
}
|
|
else
|
|
{
|
|
$('#medical_info').hide()
|
|
$("medical_info_div").removeClass("s_website_form_required");
|
|
$("medical_information").prop('required',false);
|
|
}
|
|
|
|
|
|
});
|
|
|
|
$( "#back_button2" ).click(function() {
|
|
history.back()
|
|
});
|
|
|
|
$( "#back_button1" ).click(function() {
|
|
history.back()
|
|
});
|
|
|
|
$(":checkbox").change(function() {
|
|
|
|
if(this.value==$("#membership_product").val() && this.checked)
|
|
{
|
|
|
|
if ($("#status").val()=='not member') {$("#status2").val('member')}
|
|
|
|
|
|
}
|
|
if(this.value==$("#membership_product").val() && this.checked==false)
|
|
{
|
|
if ($("#status").val()=='not member'){$("#status2").val('not member')}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//recalcul du prix total
|
|
if ($("#status2").val()=='not member')
|
|
{
|
|
$("#your_status").text('not member')
|
|
|
|
$("#price_of_the_stay").text($("#booking_price").val()+' €')
|
|
$("#total_price").val($("#booking_price").val())
|
|
}
|
|
if ($("#status2").val()=='member')
|
|
{
|
|
$("#your_status").text('member')
|
|
$("#price_of_the_stay").text($("#booking_member_price").val()+' €')
|
|
$("#total_price").val($("#booking_member_price").val())
|
|
}
|
|
if ($("#status2").val()=='super member')
|
|
{
|
|
$("#your_status").text('super member')
|
|
$("#price_of_the_stay").text($("#booking_super_member_price").val()+' €')
|
|
$("#total_price").val($("#booking_super_member_price").val())
|
|
}
|
|
|
|
$( ":checkbox" ).each(function( index ) {
|
|
var l=this.name.length
|
|
var i=this.name.substring(2,l-1)
|
|
|
|
if (this.value==$("#membership_product").val())
|
|
{
|
|
var option_price_str='#o_standard'+i
|
|
}
|
|
else
|
|
{
|
|
var option_price_str='#o_'+$("#status2").val()+i
|
|
}
|
|
|
|
|
|
option_price=$(option_price_str).val()
|
|
|
|
total_price=$("#total_price").val()
|
|
|
|
if(this.checked) {
|
|
|
|
$("#total_price").val(parseInt(total_price)+parseInt(option_price))
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$("#booking_total_price").text($("#total_price").val()+' €');
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|