1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
<odoo>
<template id="portal_my_home_menu_invoice" name="Portal layout : invoice menu entries" inherit_id="portal.portal_breadcrumbs" priority="30">
<xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside">
<li t-if="page_name == 'invoice'" t-attf-class="breadcrumb-item #{'active ' if not invoice else ''}">
<a t-if="invoice" t-attf-href="/my/invoices?{{ keep_query() }}">Invoices & Bills</a>
<t t-else="">Invoices & Bills</t>
</li>
<li t-if="invoice" class="breadcrumb-item active">
<t t-esc="invoice.name" t-if="invoice.name != '/'"/>
<t t-else=""><em>Draft Invoice</em></t>
</li>
</xpath>
</template>
<template id="portal_my_home_invoice" name="Show Invoices & Bills" inherit_id="portal.portal_my_home" customize_show="True" priority="30">
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-call="portal.portal_docs_entry">
<t t-set="title">Invoices & Bills</t>
<t t-set="url" t-value="'/my/invoices'"/>
<t t-set="placeholder_count" t-value="'invoice_count'"/>
</t>
</xpath>
</template>
<template id="portal_my_invoices" name="My Invoices and Payments">
<t t-call="portal.portal_layout">
<t t-set="breadcrumbs_searchbar" t-value="True"/>
<t t-call="portal.portal_searchbar">
<t t-set="title">Invoices</t>
</t>
<t t-if="not invoices">
<p>There are currently no invoices and payments for your account.</p>
</t>
<t t-if="invoices" t-call="portal.portal_table">
<thead>
<tr class="active">
<th>Invoice #</th>
<th>Invoice Date</th>
<th class='d-none d-md-table-cell'>Due Date</th>
<th/>
<th class="text-right">Amount Due</th>
</tr>
</thead>
<tbody>
<t t-foreach="invoices" t-as="invoice">
<tr>
<td>
<a t-att-href="invoice.get_portal_url()" t-att-title="invoice.name">
<t t-esc="invoice.name" t-if="invoice.name != '/'"/>
<em t-else="">Draft Invoice</em>
</a>
</td>
<td><span t-field="invoice.invoice_date"/></td>
<td class='d-none d-md-table-cell'><span t-field="invoice.invoice_date_due"/></td>
<td class="tx_status">
<t t-if="invoice.state == 'posted' and invoice.payment_state not in ('in_payment', 'paid', 'reversed')">
<span class="badge badge-pill badge-info"><i class="fa fa-fw fa-clock-o" aria-label="Opened" title="Opened" role="img"></i><span class="d-none d-md-inline"> Waiting for Payment</span></span>
</t>
<t t-if="invoice.state == 'posted' and invoice.payment_state in ('paid', 'in_payment')">
<span class="badge badge-pill badge-success"><i class="fa fa-fw fa-check" aria-label="Paid" title="Paid" role="img"></i><span class="d-none d-md-inline"> Paid</span></span>
</t>
<t t-if="invoice.state == 'posted' and invoice.payment_state == 'reversed'">
<span class="badge badge-pill badge-success"><i class="fa fa-fw fa-check" aria-label="Reversed" title="Reversed" role="img"></i><span class="d-none d-md-inline"> Reversed</span></span>
</t>
<t t-if="invoice.state == 'cancel'">
<span class="badge badge-pill badge-warning"><i class="fa fa-fw fa-remove" aria-label="Cancelled" title="Cancelled" role="img"></i><span class="d-none d-md-inline"> Cancelled</span></span>
</t>
</td>
<td class="text-right"><span t-esc="-invoice.amount_residual if invoice.move_type == 'out_refund' else invoice.amount_residual" t-options='{"widget": "monetary", "display_currency": invoice.currency_id}'/></td>
</tr>
</t>
</tbody>
</t>
</t>
</template>
<template id="portal_invoice_page" name="Invoice Portal Template" inherit_id="portal.portal_sidebar" primary="True">
<xpath expr="//div[hasclass('o_portal_sidebar')]" position="inside">
<t t-set="o_portal_fullwidth_alert" groups="sales_team.group_sale_salesman,account.group_account_invoice,account.group_account_readonly">
<t t-call="portal.portal_back_in_edit_mode">
<t t-set="backend_url" t-value="'/web#model=%s&id=%s&action=%s&view_type=form' % (invoice._name, invoice.id, invoice.env.ref('account.action_move_out_invoice_type').id)"/>
</t>
</t>
<div class="row mt16 o_portal_invoice_sidebar">
<!-- Sidebar -->
<t t-call="portal.portal_record_sidebar">
<t t-set="classes" t-value="'col-lg-auto d-print-none'"/>
<t t-set="title">
<h2 class="mb-0">
<b t-if="invoice.amount_residual > 0" t-field="invoice.amount_residual"/>
<b t-else="1" t-field="invoice.amount_total"/>
</h2>
<div class="small" t-if="invoice.payment_state not in ('paid', 'in_payment') and invoice.move_type == 'out_invoice'"><i class="fa fa-clock-o"/><span class="o_portal_sidebar_timeago ml4" t-att-datetime="invoice.invoice_date_due"/></div>
</t>
<t t-set="entries">
<ul class="list-group list-group-flush flex-wrap flex-row flex-lg-column">
<li class="list-group-item flex-grow-1">
<div class="o_download_pdf btn-toolbar flex-sm-nowrap">
<div class="btn-group flex-grow-1 mr-1 mb-1">
<a class="btn btn-secondary btn-block o_download_btn" t-att-href="invoice.get_portal_url(report_type='pdf', download=True)" title="Download"><i class="fa fa-download"/> Download</a>
</div>
<div class="btn-group flex-grow-1 mb-1">
<a class="btn btn-secondary btn-block o_print_btn o_portal_invoice_print" t-att-href="invoice.get_portal_url(report_type='pdf')" id="print_invoice_report" title="Print" target="_blank"><i class="fa fa-print"/> Print</a>
</div>
</div>
</li>
<li t-if="invoice.invoice_user_id" class="list-group-item flex-grow-1">
<div class="small mb-1"><strong class="text-muted">
<t t-if="invoice.move_type == 'out_invoice'">
Salesperson
</t>
<t t-if="invoice.move_type == 'in_invoice'">
Purchase Representative
</t>
</strong></div>
<div class="row">
<div class="col flex-grow-0 pr-2">
<img t-if="invoice.invoice_user_id.image_1024" class="rounded-circle mt-1 o_portal_contact_img" t-att-src="image_data_uri(invoice.invoice_user_id.image_1024)" alt="Contact"/>
<img t-else="" class="rounded-circle mt-1 o_portal_contact_img" src="/web/static/src/img/user_menu_avatar.png" alt="Contact"/>
</div>
<div class="col pl-0">
<span t-field="invoice.invoice_user_id" t-options='{"widget": "contact", "fields": ["name", "phone"], "no_marker": True}'/>
<a href="#discussion" class="small"><i class="fa fa-fw fa-comments"/><b>Send message</b></a>
</div>
</div>
</li>
</ul>
</t>
</t>
<!-- Page Content -->
<div id="invoice_content" class="col-12 col-lg">
<t t-if="error or warning" t-call="account.portal_invoice_error"/>
<t t-if="success and (not error and not warning)" t-call="account.portal_invoice_success"/>
<div class="o_portal_html_view shadow p-3">
<div class="o_portal_html_loader text-center">
<i class="fa fa-circle-o-notch fa-spin fa-2x fa-fw text-black-50"></i>
</div>
<iframe id="invoice_html" class="mt8 mb8" width="100%" height="100%" frameborder="0" scrolling="no" t-att-src="invoice.get_portal_url(report_type='html')"/>
</div>
<!-- chatter -->
<div id="invoice_communication" class="mt-4">
<h2>History</h2>
<t t-call="portal.message_thread">
<t t-set="object" t-value="invoice"/>
</t>
</div>
</div>
</div>
</xpath>
</template>
<template id="portal_invoice_error" name="Invoice error/warning display">
<div class="row mr16">
<div t-attf-class="'col-lg-12 mr16 ml16 alert alert-dismissable' #{'alert-danger' if error else 'alert-warning'}" role="alert">
<a href="#" class="close" data-dismiss="alert" aria-label="close" title="close">×</a>
<t t-if="error == 'generic'" name="generic">
There was an error processing this page.
</t>
</div>
</div>
</template>
<template id="portal_invoice_success" name="Invoice success display">
<div class="row mr16">
<div class="col-lg-12 mr16 ml16 alert alert-dismissable alert-success" role="status">
<a href="#" class="close" data-dismiss="alert" aria-label="close" title="close">×</a>
</div>
</div>
</template>
</odoo>
|