mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] pos_pms_link:
- Adds checkin and checkout to reservation list. - Improves reservation form format. - Shows reservation name on order receipt
This commit is contained in:
@@ -43,6 +43,7 @@
|
|||||||
"static/src/xml/Screens/ReservationListScreen/ReservationLine.xml",
|
"static/src/xml/Screens/ReservationListScreen/ReservationLine.xml",
|
||||||
"static/src/xml/Screens/ReservationListScreen/ReservationListScreen.xml",
|
"static/src/xml/Screens/ReservationListScreen/ReservationListScreen.xml",
|
||||||
"static/src/xml/Screens/PaymentScreen/PaymentScreen.xml",
|
"static/src/xml/Screens/PaymentScreen/PaymentScreen.xml",
|
||||||
|
"static/src/xml/Screens/ReceiptScreen/OrderReceipt.xml",
|
||||||
],
|
],
|
||||||
"installable": True,
|
"installable": True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
odoo.define('pos_pms_link.OrderReceipt', function (require) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
const OrderReceipt = require('point_of_sale.OrderReceipt');
|
||||||
|
const Registries = require('point_of_sale.Registries');
|
||||||
|
const session = require('web.session');
|
||||||
|
|
||||||
|
const PosPMSLinkOrderReceipt = (OrderReceipt) =>
|
||||||
|
class extends OrderReceipt {
|
||||||
|
get paid_on_reservation() {
|
||||||
|
return this.receiptEnv.receipt.paid_on_reservation;
|
||||||
|
}
|
||||||
|
get reservation_name() {
|
||||||
|
return this.env.pos.db.get_reservation_by_id(this.receiptEnv.receipt.pms_reservation_id).partner_name || "";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Registries.Component.extend(OrderReceipt, PosPMSLinkOrderReceipt);
|
||||||
|
|
||||||
|
return OrderReceipt;
|
||||||
|
});
|
||||||
@@ -156,6 +156,13 @@ odoo.define('pos_pms_link.models', function (require) {
|
|||||||
this.selected_orderline.set_pms_service_line_id(options.pms_service_line_id);
|
this.selected_orderline.set_pms_service_line_id(options.pms_service_line_id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
export_for_printing: function () {
|
||||||
|
let result = _super_order.export_for_printing.apply(this, arguments);
|
||||||
|
result.paid_on_reservation = this.paid_on_reservation;
|
||||||
|
result.pms_reservation_id = this.pms_reservation_id;
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -276,7 +283,7 @@ odoo.define('pos_pms_link.models', function (require) {
|
|||||||
|
|
||||||
models.load_models({
|
models.load_models({
|
||||||
model: 'pms.reservation',
|
model: 'pms.reservation',
|
||||||
fields: ['name', 'id', 'state', 'service_ids', 'partner_name', 'adults', 'children'],
|
fields: ['name', 'id', 'state', 'service_ids', 'partner_name', 'adults', 'children', 'checkin', 'checkout', 'folio_internal_comment'],
|
||||||
context: function(self){
|
context: function(self){
|
||||||
var ctx_copy = session.user_context
|
var ctx_copy = session.user_context
|
||||||
ctx_copy['pos_user_force'] = true;
|
ctx_copy['pos_user_force'] = true;
|
||||||
@@ -284,7 +291,7 @@ odoo.define('pos_pms_link.models', function (require) {
|
|||||||
},
|
},
|
||||||
domain: function(self){
|
domain: function(self){
|
||||||
var domain = [
|
var domain = [
|
||||||
['state', '!=', 'cancel']
|
['state', '=', 'onboard']
|
||||||
];
|
];
|
||||||
if (self.config_id && self.config.reservation_allowed_propertie_ids) domain.push(['pms_property_id', 'in', self.config.reservation_allowed_propertie_ids]);
|
if (self.config_id && self.config.reservation_allowed_propertie_ids) domain.push(['pms_property_id', 'in', self.config.reservation_allowed_propertie_ids]);
|
||||||
return domain;
|
return domain;
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<templates id="template" xml:space="preserve">
|
||||||
|
|
||||||
|
<t t-name="OrderReceipt" t-inherit="point_of_sale.OrderReceipt" t-inherit-mode="extension" owl="1">
|
||||||
|
<xpath expr="//div[hasclass('before-footer')]" position="before">
|
||||||
|
<t t-if="paid_on_reservation">
|
||||||
|
<br/><br/>
|
||||||
|
<div>
|
||||||
|
Signature: <br/><br/>
|
||||||
|
<span t-esc="reservation_name" style="font-size: 100%;"/><br/>
|
||||||
|
-------------------
|
||||||
|
</div>
|
||||||
|
</t>
|
||||||
|
</xpath>
|
||||||
|
</t>
|
||||||
|
|
||||||
|
</templates>
|
||||||
@@ -5,13 +5,17 @@
|
|||||||
<section class="client-details edit">
|
<section class="client-details edit">
|
||||||
<h3 class="detail client-name" t-esc="props.reservation.name"/>
|
<h3 class="detail client-name" t-esc="props.reservation.name"/>
|
||||||
<div class="client-details-box clearfix">
|
<div class="client-details-box clearfix">
|
||||||
<div class="client-details-left">
|
<div class="client-details-row">
|
||||||
<span class="detail client-partner-name" t-esc="props.reservation.partner_name"/><br/>
|
Name: <span class="detail client-partner-name" t-esc="props.reservation.partner_name"/><br/>
|
||||||
<span class="detail client-aduls" t-esc="props.reservation.adults"/><br/>
|
Checkin: <span class="detail client-aduls" t-esc="props.reservation.checkin"/><br/>
|
||||||
<span class="detail client-children" t-esc="props.reservation.children"/><br/>
|
Checkout: <span class="detail client-aduls" t-esc="props.reservation.checkout"/><br/>
|
||||||
|
Adults: <span class="detail client-aduls" t-esc="props.reservation.adults"/><br/>
|
||||||
|
Children: <span class="detail client-children" t-esc="props.reservation.children"/><br/>
|
||||||
|
Internal comment: <span class="detail client-aduls" t-esc="props.reservation.folio_internal_comment"/><br/>
|
||||||
</div>
|
</div>
|
||||||
<div class="client-details-right">
|
<h3 class="detail client-name">Services:</h3>
|
||||||
<table>
|
<div class="client-details-row">
|
||||||
|
<table class="content-row">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Service</th>
|
<th>Service</th>
|
||||||
@@ -19,8 +23,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<t t-foreach="props.reservation.service_ids" t-as="service" t-key="service.id">
|
||||||
<t t-foreach="props.reservation.service_ids" t-as="service" t-key="service.id">
|
<tr>
|
||||||
<td t-esc="service_value['name']"/>
|
<td t-esc="service_value['name']"/>
|
||||||
<td>
|
<td>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -31,8 +35,8 @@
|
|||||||
</t>
|
</t>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</t>
|
</tr>
|
||||||
</tr>
|
</t>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,6 +13,12 @@
|
|||||||
<td>
|
<td>
|
||||||
<t t-esc="props.reservation.partner_name" />
|
<t t-esc="props.reservation.partner_name" />
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<t t-esc="props.reservation.checkin" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<t t-esc="props.reservation.checkout" />
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<t t-esc="props.reservation.adults" />
|
<t t-esc="props.reservation.adults" />
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -43,6 +43,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Partner name</th>
|
<th>Partner name</th>
|
||||||
|
<th>Checkin</th>
|
||||||
|
<th>Checkout</th>
|
||||||
<th>Adults</th>
|
<th>Adults</th>
|
||||||
<th>Children</th>
|
<th>Children</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
<script type="text/javascript" src="/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationLine.js"></script>
|
<script type="text/javascript" src="/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationLine.js"></script>
|
||||||
<script type="text/javascript" src="/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationListScreen.js"></script>
|
<script type="text/javascript" src="/pos_pms_link/static/src/js/Screens/ReservationListScreen/ReservationListScreen.js"></script>
|
||||||
<script type="text/javascript" src="/pos_pms_link/static/src/js/Screens/PaymentScreen/PaymentScreen.js"></script>
|
<script type="text/javascript" src="/pos_pms_link/static/src/js/Screens/PaymentScreen/PaymentScreen.js"></script>
|
||||||
|
<script type="text/javascript" src="/pos_pms_link/static/src/js/Screens/ReceiptScreen/OrderReceipt.js"></script>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user