mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[ADD] Base for New Reservation Tooltip
This commit is contained in:
@@ -30,7 +30,7 @@ class BusHotelCalendar(models.TransientModel):
|
||||
('id', '=', master_reserv),
|
||||
('splitted', '=', True),
|
||||
])
|
||||
|
||||
import wdb; wdb.set_trace()
|
||||
return {
|
||||
'type': 'reservation',
|
||||
'action': vals['action'],
|
||||
|
||||
@@ -109,12 +109,21 @@ class HotelReservation(models.Model):
|
||||
])
|
||||
json_reservation_tooltips.update({
|
||||
reserv.id: {
|
||||
'folio_name': reserv.folio_id.name,
|
||||
'name': _('Out of service') if reserv.folio_id.reservation_type == 'out' else reserv.folio_id.partner_id.name,
|
||||
'phone': reserv.folio_id.partner_id.mobile or
|
||||
reserv.folio_id.partner_id.phone or _('Undefined'),
|
||||
'phone': reserv.mobile or reserv.phone or _('Phone not provided'),
|
||||
'email': reserv.email or _('Email not provided'),
|
||||
'room_type': reserv.room_type_id.name,
|
||||
'adults': reserv.adults,
|
||||
'childrens': reserv.children,
|
||||
'checkin': reserv.checkin,
|
||||
'checkout': reserv.checkout,
|
||||
'arrival_hour': reserv.arrival_hour,
|
||||
'departure_hour': reserv.departure_hour,
|
||||
'num_split': num_split,
|
||||
'amount_total': reserv.folio_id.amount_total,
|
||||
'pending_amount': reserv.folio_id.pending_amount,
|
||||
'amount_paid': reserv.folio_id.amount_total - reserv.folio_id.pending_amount,
|
||||
'type': reserv.reservation_type or 'normal',
|
||||
'out_service_description': reserv.out_service_description or
|
||||
_('No reason given'),
|
||||
@@ -342,6 +351,7 @@ class HotelReservation(models.Model):
|
||||
@api.multi
|
||||
def generate_bus_values(self, naction, ntype, ntitle=''):
|
||||
self.ensure_one()
|
||||
import wdb; wdb.set_trace()
|
||||
return {
|
||||
'action': naction,
|
||||
'type': ntype,
|
||||
|
||||
@@ -158,3 +158,21 @@ input#bookings_search {
|
||||
line-height: 1.2;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/** TOOLTIPS **/
|
||||
.tooltip {
|
||||
|
||||
}
|
||||
.tooltip .tooltip-inner {
|
||||
border: 1px solid #5C5C5C;
|
||||
background-color: white;
|
||||
color: #5C5C5C;
|
||||
}
|
||||
|
||||
.tooltip .container {
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.tooltip .list-group-item {
|
||||
border: none;
|
||||
}
|
||||
@@ -367,6 +367,7 @@ var PMSCalendarController = AbstractController.extend({
|
||||
var tp = self._multi_calendar._reserv_tooltips[ev.detail.reservationObj.id];
|
||||
var qdict = self._generate_reservation_tooltip_dict(tp);
|
||||
$(ev.detail.reservationDiv).tooltip('destroy').tooltip({
|
||||
trigger: 'manual',
|
||||
animation: false,
|
||||
html: true,
|
||||
placement: 'bottom',
|
||||
@@ -634,11 +635,23 @@ var PMSCalendarController = AbstractController.extend({
|
||||
|
||||
_generate_reservation_tooltip_dict: function(tp) {
|
||||
return {
|
||||
'folio_name': tp['folio_name'],
|
||||
'name': tp['name'],
|
||||
'phone': tp['phone'],
|
||||
'arrival_hour': HotelCalendar.toMomentUTC(tp['checkin'], HotelConstants.ODOO_DATETIME_MOMENT_FORMAT).local().format('HH:mm'),
|
||||
'email': tp['email'],
|
||||
'room_type': tp['room_type'],
|
||||
'adults': tp['adults'],
|
||||
'children': tp['children'],
|
||||
'checkin': HotelCalendar.toMomentUTC(tp['checkin'], '').format("DD MMMM"),
|
||||
'checkin_day_of_week': HotelCalendar.toMomentUTC(tp['checkin'], '').format("dddd"),
|
||||
'checkout': HotelCalendar.toMomentUTC(tp['checkout'], '').format("DD MMMM"),
|
||||
'checkout_day_of_week': HotelCalendar.toMomentUTC(tp['checkout'], '').format("dddd"),
|
||||
'arrival_hour': tp['arrival_hour'],
|
||||
'departure_hour': tp['departure_hour'],
|
||||
'num_split': tp['num_split'],
|
||||
'amount_total': Number(tp['amount_total']).toLocaleString(),
|
||||
'pending_amount': Number(tp['pending_amount']).toLocaleString(),
|
||||
'amount_paid': Number(tp['amount_paid']).toLocaleString(),
|
||||
'reservation_type': tp['type'],
|
||||
'out_service_description': tp['out_service_description']
|
||||
};
|
||||
|
||||
@@ -69,23 +69,85 @@
|
||||
</t>
|
||||
|
||||
<t t-name="HotelCalendar.TooltipReservation">
|
||||
<div class="oe_tooltip_string"><t t-esc="name"/></div>
|
||||
<t t-if="reservation_type == 'normal'">
|
||||
<ul class="oe_tooltip_technical">
|
||||
<li><b>Phone:</b> <t t-esc="phone"/></li>
|
||||
<li><b>Arrival Hour:</b> <t t-esc="arrival_hour"/></li>
|
||||
<t t-if="num_split > 1">
|
||||
<li><b>Splitted:</b> <t t-esc="num_split"/></li>
|
||||
</t>
|
||||
<!-- FIXME: HARD CURRENCY -->
|
||||
<li><b>Total Amount:</b> <t t-esc="amount_total" t-widget="monetary"/>€</li>
|
||||
</ul>
|
||||
</t>
|
||||
<t t-elif="reservation_type == 'out'">
|
||||
<ul class="oe_tooltip_technical">
|
||||
<li><b>Reason:</b> <t t-esc="out_service_description"/></li>
|
||||
</ul>
|
||||
</t>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item fa fa-user-circle-o fa-2x">
|
||||
<t t-esc="name"/>
|
||||
</li>
|
||||
<li class="list-group-item"><t t-esc="phone"/></li>
|
||||
<li class="list-group-item"><t t-esc="email"/></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item fa fa-hotel fa-2x">
|
||||
<t t-esc="room_type"/>
|
||||
</li>
|
||||
<span class="fa fa-1x">Board Service Undefined</span>
|
||||
<span>Adults: <t t-esc="adults"/></span>
|
||||
<span>Children: <t t-esc="children"/></span>
|
||||
<li class="list-group-item fa-stack fa-2x">
|
||||
<span class="fa fa-circle fa-stack-2x"></span>
|
||||
<span class="fa fa-stack-1x fa-inverse">
|
||||
<t t-esc="amount_total" t-widget="monetary"/>€
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<!-- FIXME: HARD CURRENCY -->
|
||||
Por Pagar <t t-esc="amount_total" t-widget="monetary"/>€ <br/>
|
||||
Pagado <t t-esc="amount_paid" t-widget="monetary"/>€
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
WuBook: 1544109684
|
||||
Booking: 4253096846
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item fa fa-arrow-circle-o-right fa-2x"><t t-esc="checkin"/></li>
|
||||
<li class="list-group-item">
|
||||
<t t-esc="checkin_day_of_week"/> <t t-esc="arrival_hour"/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item fa-2x"><t t-esc="checkout"/><span class="fa fa-arrow-circle-o-right"/></li>
|
||||
<li class="list-group-item">
|
||||
<t t-esc="checkout_day_of_week"/> <t t-esc="departure_hour"/></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<span class="fa fa-file-text-o fa-2x"><t t-esc="folio_name"/></span>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<span class="fa fa-external-link fa-2x"/>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<span class="fa fa-user-plus fa-2x"/>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<span class="fa fa-envelope fa-2x"/>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<span class="fa fa-money fa-2x"/>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<span class="fa fa-window-close fa-2x"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="HotelCalendar.TooltipRoom">
|
||||
|
||||
Reference in New Issue
Block a user