| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<odoo> |
| 3 |
|
| 4 |
<!-- This is the "validation" screen. Recap the ticket info, warn the user to check/set his address and eventually set localization fields if needed. --> |
| 5 |
<template id="ticket_validation_screen"> |
| 6 |
<t t-call="portal.portal_layout"> |
| 7 |
<t t-set="no_breadcrumbs" t-value="True"/> |
| 8 |
<div class="row justify-content-md-center o_customer_address_fill"> |
| 9 |
<form method="post" target="_self" t-att-action="'/pos/ticket/validate'" onsubmit="$('button:submit').attr('disabled', 'disabled')" class="address_autoformat"> |
| 10 |
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/> |
| 11 |
<input type="hidden" name="access_token" t-att-value="access_token"/> |
| 12 |
<div class="col-12 col-md-6 mt-4 offset-md-3"> |
| 13 |
<div class="row"> |
| 14 |
<h2>Invoicing confirmation</h2> |
| 15 |
<hr class="mt-1 mb-0"/> |
| 16 |
</div> |
| 17 |
<div class="row"> |
| 18 |
<h4 class="mt-2"><t t-out="pos_order.pos_reference"/></h4> |
| 19 |
</div> |
| 20 |
<div class="row"> |
| 21 |
<div class="col-12 fw-bold"> |
| 22 |
Products: |
| 23 |
</div> |
| 24 |
</div> |
| 25 |
<div class="row"> |
| 26 |
<div class="col-12"> |
| 27 |
<ul> |
| 28 |
<t t-foreach="pos_order.lines" t-as="order_line"> |
| 29 |
<li><t t-out="int(order_line.qty)"/> <t t-out="order_line.full_product_name"/> for <t t-out="format_amount(env, order_line.price_subtotal_incl, order_line.currency_id)"/></li> |
| 30 |
</t> |
| 31 |
</ul> |
| 32 |
</div> |
| 33 |
</div> |
| 34 |
<div class="row"> |
| 35 |
<div class="col-12"> |
| 36 |
<strong>Amounting to:</strong> <t t-out="format_amount(env, pos_order.amount_total, pos_order.currency_id)"/> |
| 37 |
</div> |
| 38 |
</div> |
| 39 |
<t t-if="user_is_connected"> |
| 40 |
<div class="row mt-4"> |
| 41 |
<div class="col-12"> |
| 42 |
<h4>Billing address:</h4> |
| 43 |
</div> |
| 44 |
</div> |
| 45 |
<div t-if="error_message" class="alert alert-danger" role="alert"> |
| 46 |
<div class="col-lg-12"> |
| 47 |
<t t-foreach="error_message" t-as="err"><t t-esc="err"/><br /></t> |
| 48 |
</div> |
| 49 |
</div> |
| 50 |
<t t-if="not partner_address"> |
| 51 |
Your address is missing or incomplete. <br/> |
| 52 |
Please make sure to <a t-att-href="address_url">fill all relevant information</a> before continuing. |
| 53 |
</t> |
| 54 |
<t t-else=""> |
| 55 |
<div class="row"> |
| 56 |
<div class="col-12"> |
| 57 |
<t t-out="partner.name"/> |
| 58 |
<t t-if="partner.company_name"> |
| 59 |
, <t t-out="partner.company_name"/> |
| 60 |
</t><br /> |
| 61 |
<t id="partner_vat" t-if="partner.vat"> |
| 62 |
<t t-out="partner.vat" /><br /> |
| 63 |
</t> |
| 64 |
<t t-out="partner_address"/> <a role="button" t-att-href="address_url" class="btn btn-sm btn-link"><i class="fa fa-pencil"/> Edit</a> |
| 65 |
</div> |
| 66 |
</div> |
| 67 |
</t> |
| 68 |
<t t-if="partner_required_fields"> |
| 69 |
<div class="row mt-4"> |
| 70 |
<div class="col-12"> |
| 71 |
<h4>Additional required user information:</h4> |
| 72 |
<t t-set="required_fields" t-value="partner_required_fields"/> |
| 73 |
<t t-set="field_prefix" t-value="'partner_'"/> |
| 74 |
<t t-call="account.portal_invoice_required_fields_form"/> |
| 75 |
</div> |
| 76 |
</div> |
| 77 |
</t> |
| 78 |
<t t-if="invoice_required_fields"> |
| 79 |
<div class="row mt-4"> |
| 80 |
<div class="col-12"> |
| 81 |
<h4>Additional required invoicing information:</h4> |
| 82 |
<t t-set="required_fields" t-value="invoice_required_fields"/> |
| 83 |
<t t-set="field_prefix" t-value="'invoice_'"/> |
| 84 |
<t t-call="account.portal_invoice_required_fields_form"/> |
| 85 |
</div> |
| 86 |
</div> |
| 87 |
</t> |
| 88 |
</t> |
| 89 |
<t t-else=""> |
| 90 |
<div class="row mt-4"> |
| 91 |
<div class="col-12" id="get_info_div"> |
| 92 |
<h4>Please enter your billing information <small class="text-muted">or</small> <a role="button" t-att-href="'/web/login?redirect=/pos/ticket/validate?access_token=%s' % access_token" style="margin-top: -11px"> Sign in</a>:</h4> |
| 93 |
</div> |
| 94 |
</div> |
| 95 |
<div class="row portal_details"> |
| 96 |
<div class="col-lg-12"> |
| 97 |
<div class="row"> |
| 98 |
<t t-call="portal.address_form_fields"/> |
| 99 |
<t t-if="partner_required_fields"> |
| 100 |
<t t-set="required_fields" t-value="partner_required_fields"/> |
| 101 |
<t t-set="field_prefix" t-value="'partner_'"/> |
| 102 |
<t t-call="account.portal_invoice_required_fields_form"/> |
| 103 |
</t> |
| 104 |
</div> |
| 105 |
</div> |
| 106 |
</div> |
| 107 |
<t t-if="invoice_required_fields"> |
| 108 |
<div class="row mt-4"> |
| 109 |
<div class="col-12"> |
| 110 |
<div class="row"> |
| 111 |
<h4>Additional required information:</h4> |
| 112 |
<t t-set="required_fields" t-value="invoice_required_fields"/> |
| 113 |
<t t-set="field_prefix" t-value="'invoice_'"/> |
| 114 |
<t t-call="account.portal_invoice_required_fields_form"/> |
| 115 |
</div> |
| 116 |
</div> |
| 117 |
</div> |
| 118 |
</t> |
| 119 |
</t> |
| 120 |
<div class="row mt-4"> |
| 121 |
<div class="col-12 col-md-4" id="get_my_invoice"> |
| 122 |
<t t-if="user_is_connected and not partner_address"> |
| 123 |
<button class="btn btn-primary btn-lg lh-lg w-100" disabled="True">Get my invoice</button> |
| 124 |
</t> |
| 125 |
<t t-else=""> |
| 126 |
<button class="btn btn-primary btn-lg lh-lg w-100">Get my invoice</button> |
| 127 |
</t> |
| 128 |
</div> |
| 129 |
</div> |
| 130 |
</div> |
| 131 |
</form> |
| 132 |
</div> |
| 133 |
</t> |
| 134 |
</template> |
| 135 |
|
| 136 |
<template id="ticket_request_with_code" name="Invoice Request"> |
| 137 |
<t t-call="portal.portal_layout"> |
| 138 |
<t t-set="no_breadcrumbs" t-value="True"/> |
| 139 |
<div class="row justify-content-md-center"> |
| 140 |
<form method="post" target="_self" t-att-action="'/pos/ticket'"> |
| 141 |
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/> |
| 142 |
<div class="col-12 col-md-6 mt-4 offset-md-3"> |
| 143 |
<div class="row"> |
| 144 |
<div t-if="banner_error" class="alert alert-danger" role="alert"> |
| 145 |
<div class="col-lg-12"> |
| 146 |
<t t-esc="banner_error"/> |
| 147 |
</div> |
| 148 |
</div> |
| 149 |
<h2>Invoice Request</h2> |
| 150 |
<hr class="mt-1 mb-0"/> |
| 151 |
<div class="row"> |
| 152 |
<div class="col-lg-12"> |
| 153 |
<div class="row"> |
| 154 |
<div t-attf-class="col-12 mb-6 col-xl-8"> |
| 155 |
<label class="col-form-label" for="pos_reference">Ticket Nr</label> |
| 156 |
<input type="text" name="pos_reference" placeholder="0014-001-00001" |
| 157 |
t-attf-class="form-control #{errors.get('pos_reference') and 'is-invalid' or ''}" |
| 158 |
t-att-value="form_values.get('pos_reference')"/> |
| 159 |
<label class="col-form-label" for="date_order">Date</label> |
| 160 |
<input type="date" name="date_order" |
| 161 |
t-attf-class="form-control #{errors.get('date_order') and 'is-invalid' or ''}" |
| 162 |
t-att-value="form_values.get('date_order')"/> |
| 163 |
<label class="col-form-label" for="ticket_code">Unique code</label> |
| 164 |
<input type="text" name="ticket_code" placeholder="qx9h1" |
| 165 |
t-attf-class="form-control #{errors.get('ticket_code') and 'is-invalid' or ''}" |
| 166 |
t-att-value="form_values.get('ticket_code')"/> |
| 167 |
</div> |
| 168 |
</div> |
| 169 |
</div> |
| 170 |
</div> |
| 171 |
<div class="row mt-4"> |
| 172 |
<div class="col-12"> |
| 173 |
<button class="btn btn-primary">Request Invoice</button> |
| 174 |
</div> |
| 175 |
</div> |
| 176 |
</div> |
| 177 |
</div> |
| 178 |
</form> |
| 179 |
</div> |
| 180 |
</t> |
| 181 |
</template> |
| 182 |
</odoo> |