~account-core-editors/account-invoice-report/github-7.0

« back to all changes in this revision

Viewing changes to invoice_webkit/report/account_invoice.mako

  • Committer: unknown
  • Date: 2012-12-18 13:58:41 UTC
  • mfrom: (0.1.44)
  • Revision ID: git-v1:26a9937fc5b651fd25e23871e31d1c2400820574
[ADD] invoice_webkit for v7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
    <style type="text/css">
 
4
        ${css}
 
5
 
 
6
.list_invoice_table {
 
7
    border:thin solid #E3E4EA;
 
8
    text-align:center;
 
9
    border-collapse: collapse;
 
10
}
 
11
.list_invoice_table th {
 
12
    background-color: #EEEEEE;
 
13
    border: thin solid #000000;
 
14
    text-align:center;
 
15
    font-size:12;
 
16
    font-weight:bold;
 
17
    padding-right:3px;
 
18
    padding-left:3px;
 
19
}
 
20
.list_invoice_table td {
 
21
    border-top : thin solid #EEEEEE;
 
22
    text-align:left;
 
23
    font-size:12;
 
24
    padding-right:3px;
 
25
    padding-left:3px;
 
26
    padding-top:3px;
 
27
    padding-bottom:3px;
 
28
}
 
29
.list_invoice_table thead {
 
30
    display:table-header-group;
 
31
}
 
32
 
 
33
 
 
34
.list_bank_table {
 
35
    text-align:center;
 
36
    border-collapse: collapse;
 
37
}
 
38
.list_bank_table th {
 
39
    background-color: #EEEEEE;
 
40
    text-align:left;
 
41
    font-size:12;
 
42
    font-weight:bold;
 
43
    padding-right:3px;
 
44
    padding-left:3px;
 
45
}
 
46
.list_bank_table td {
 
47
    text-align:left;
 
48
    font-size:12;
 
49
    padding-right:3px;
 
50
    padding-left:3px;
 
51
    padding-top:3px;
 
52
    padding-bottom:3px;
 
53
}
 
54
 
 
55
 
 
56
.list_tax_table {
 
57
}
 
58
.list_tax_table td {
 
59
    text-align:left;
 
60
    font-size:12;
 
61
}
 
62
.list_tax_table th {
 
63
}
 
64
.list_tax_table thead {
 
65
    display:table-header-group;
 
66
}
 
67
 
 
68
 
 
69
.list_total_table {
 
70
    border:thin solid #E3E4EA;
 
71
    text-align:center;
 
72
    border-collapse: collapse;
 
73
}
 
74
.list_total_table td {
 
75
    border-top : thin solid #EEEEEE;
 
76
    text-align:left;
 
77
    font-size:12;
 
78
    padding-right:3px;
 
79
    padding-left:3px;
 
80
    padding-top:3px;
 
81
    padding-bottom:3px;
 
82
}
 
83
.list_total_table th {
 
84
    background-color: #EEEEEE;
 
85
    border: thin solid #000000;
 
86
    text-align:center;
 
87
    font-size:12;
 
88
    font-weight:bold;
 
89
    padding-right:3px
 
90
    padding-left:3px
 
91
}
 
92
.list_total_table thead {
 
93
    display:table-header-group;
 
94
}
 
95
 
 
96
 
 
97
.no_bloc {
 
98
    border-top: thin solid  #ffffff ;
 
99
}
 
100
 
 
101
.right_table {
 
102
    right: 4cm;
 
103
    width:"100%";
 
104
}
 
105
 
 
106
.std_text {
 
107
    font-size:12;
 
108
}
 
109
 
 
110
td.amount 
 
111
    white-space: nowrap;
 
112
    text-align: right;
 
113
}
 
114
 
 
115
tfoot.totals tr:first-child td{
 
116
    padding-top: 15px;
 
117
}
 
118
 
 
119
th.date {
 
120
    width: 90px;
 
121
}
 
122
 
 
123
td.amount, th.amount {
 
124
    text-align: right;
 
125
    white-space: nowrap;
 
126
}
 
127
.header_table {
 
128
    text-align: center;
 
129
    border: 1px solid lightGrey;
 
130
    border-collapse: collapse;
 
131
}
 
132
.header_table th {
 
133
    font-size: 12px;
 
134
    border: 1px solid lightGrey;
 
135
}
 
136
.header_table td {
 
137
    font-size: 12px;
 
138
    border: 1px solid lightGrey;
 
139
}
 
140
 
 
141
td.date {
 
142
    white-space: nowrap;
 
143
    width: 90px;
 
144
}
 
145
 
 
146
td.vat {
 
147
    white-space: nowrap;
 
148
}
 
149
 
 
150
    </style>
 
151
</head>
 
152
<body>
 
153
    <%page expression_filter="entity"/>
 
154
    <%
 
155
    def carriage_returns(text):
 
156
        return text.replace('\n', '<br />')
 
157
    %>
 
158
 
 
159
    %for inv in objects:
 
160
    <% setLang(inv.partner_id.lang) %>
 
161
    <div class="address">
 
162
        <table class="recipient">
 
163
            <tr><td class="name">${inv.partner_id.title and inv.partner_id.title.name or ''} ${inv.partner_id.name }</td></tr>
 
164
            <tr><td>${inv.partner_id.street or ''}</td></tr>
 
165
            <tr><td>${inv.partner_id.street2 or ''}</td></tr>
 
166
            <tr><td>${inv.partner_id.zip or ''} ${inv.partner_id.city or ''}</td></tr>
 
167
            %if inv.partner_id.country_id:
 
168
            <tr><td>${inv.partner_id.country_id.name or ''} </td></tr>
 
169
            %endif
 
170
        </table>
 
171
    </div>
 
172
    <div>
 
173
 
 
174
    %if inv.note1_webkit :
 
175
        <p class="std_text"> ${inv.note1_webkit | carriage_returns} </p>
 
176
    %endif
 
177
    </div>
 
178
    <h1 style="clear: both; padding-top: 20px;">
 
179
        %if inv.type == 'out_invoice' and inv.state == 'proforma2':
 
180
            ${_("PRO-FORMA")}
 
181
        %elif inv.type == 'out_invoice' and inv.state == 'draft':
 
182
            ${_("Draft Invoice")}
 
183
        %elif inv.type == 'out_invoice' and inv.state == 'cancel':
 
184
            ${_("Cancelled Invoice")} ${inv.number or ''}
 
185
        %elif inv.type == 'out_invoice':
 
186
            ${_("Invoice")} ${inv.number or ''}
 
187
        %elif inv.type == 'in_invoice':
 
188
            ${_("Supplier Invoice")} ${inv.number or ''}
 
189
        %elif inv.type == 'out_refund':
 
190
            ${_("Refund")} ${inv.number or ''}
 
191
        %elif inv.type == 'in_refund':
 
192
            ${_("Supplier Refund")} ${inv.number or ''}
 
193
        %endif
 
194
    </h1>
 
195
    <h3  style="clear: both; padding-top: 20px;">
 
196
        ${_("Subject : ")} ${inv.name or ''}
 
197
    </h3>
 
198
 
 
199
    <table class="basic_table" width="100%">
 
200
        <tr>
 
201
            <th class="date">${_("Invoice Date")}</td>
 
202
            <th class="date">${_("Due Date")}</td>
 
203
            <th style="text-align:left;">${_("Our Ref.")}</td>
 
204
        </tr>
 
205
        <tr>
 
206
            <td class="date">${formatLang(inv.date_invoice, date=True)}</td>
 
207
            <td class="date">${formatLang(inv.date_due, date=True)}</td>
 
208
            <td style="text-align:left;">${inv.origin or ''}</td>
 
209
        </tr>
 
210
    </table>
 
211
 
 
212
    <table class="list_invoice_table" width="100%" style="margin-top: 20px;">
 
213
        <thead>
 
214
            <tr>
 
215
                <th>${_("Description")}</th>
 
216
                <th>${_("Qty")}</th>
 
217
                <th>${_("UoM")}</th>
 
218
                <th>${_("Unit Price")}</th>
 
219
                <th>${_("Taxes")}</th>
 
220
                <th>${_("Disc.(%)")}</th>
 
221
                <th>${_("Net Sub Total")}</th>
 
222
            </tr>
 
223
        </thead>
 
224
        <tbody>
 
225
        %for line in inv.invoice_line :
 
226
            <tr >
 
227
                <td>${line.product_id and line.product_id.code or ''} ${line.product_id and line.product_id.name or ''}</td>
 
228
                <td class="amount">${formatLang(line.quantity or 0.0,digits=get_digits(dp='Account'))}</td>
 
229
                <td class="amount">${line.uos_id and line.uos_id.name or ''}</td>
 
230
                <td class="amount">${formatLang(line.price_unit)}</td>
 
231
                <td style="font-style:italic; font-size: 10;text-align:center;" >${ ', '.join([ tax.name or '' for tax in line.invoice_line_tax_id ])}</td>
 
232
                <td class="amount" width="10%">${line.discount and formatLang(line.discount, digits=get_digits(dp='Account')) or ''} ${line.discount and '%' or ''}</td>
 
233
                <td class="amount" width="13%">${formatLang(line.price_subtotal, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</td>
 
234
            </tr>
 
235
            %if line.name :
 
236
                <tr>
 
237
                    <td colspan="7" class="note" style="font-style:italic; font-size: 10; border-top: thin solid  #ffffff ; border-right:  thin solid #E3E4EA;  padding:20;">${line.name | carriage_returns}</td>
 
238
                </tr>
 
239
            %endif
 
240
        %endfor
 
241
        </tbody>
 
242
        <tfoot class="totals">
 
243
            <tr>
 
244
                <td colspan="6" style="text-align:right;border-right: thin solid  #ffffff ;border-left: thin solid  #ffffff ;">
 
245
                    <b>${_("Net :")}</b>
 
246
                </td>
 
247
                <td class="amount" style="border-right: thin solid  #ffffff ;border-left: thin solid  #ffffff ;">
 
248
                    ${formatLang(inv.amount_untaxed, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}
 
249
                </td>
 
250
            </tr>
 
251
            <tr class="no_bloc">
 
252
                <td colspan="6" style="text-align:right; border-top: thin solid  #ffffff ; border-right: thin solid  #ffffff ;border-left: thin solid  #ffffff ;">
 
253
                    <b>${_("Taxes:")}</b>
 
254
                </td>
 
255
                <td class="amount" style="border-right: thin solid  #ffffff ;border-top: thin solid  #ffffff ;border-left: thin solid  #ffffff ;">
 
256
                        ${formatLang(inv.amount_tax, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}
 
257
                </td>
 
258
            </tr>
 
259
            <tr>
 
260
                <td colspan="6" style="border-right: thin solid  #ffffff ;border-top: thin solid  #ffffff ;border-left: thin solid  #ffffff ;border-bottom: thin solid  #ffffff ;text-align:right;">
 
261
                    <b>${_("Total:")}</b>
 
262
                </td>
 
263
                <td class="amount" style="border-right: thin solid  #ffffff ;border-top: thin solid  #ffffff ;border-left: thin solid  #ffffff ;border-bottom: thin solid  #ffffff ;">
 
264
                        <b>${formatLang(inv.amount_total, digits=get_digits(dp='Account'))} ${inv.currency_id.symbol}</b>
 
265
                </td>
 
266
            </tr>
 
267
        </tfoot>
 
268
    </table>
 
269
        <br/>
 
270
    <table class="list_total_table" width="40%" >
 
271
        <tr>
 
272
            <th style="text-align:left;">${_("Rate")}</th>
 
273
            <th>${_("Base")}</th>
 
274
            <th>${_("Tax")}</th>
 
275
        </tr>
 
276
        %if inv.tax_line :
 
277
        %for t in inv.tax_line :
 
278
            <tr>
 
279
                <td style="text-align:left;">${ t.name } </td>
 
280
                <td class="amount">${ formatLang(t.base, digits=get_digits(dp='Account')) }</td>
 
281
                <td class="amount">${ formatLang(t.amount, digits=get_digits(dp='Account')) }</td>
 
282
            </tr>
 
283
        %endfor
 
284
        %endif
 
285
    </table>
 
286
        <br/>
 
287
        <br/>
 
288
        <h4>
 
289
                ${_("Thank you for your prompt payment")}
 
290
        </h4>
 
291
        <br/>
 
292
    <%
 
293
      inv_bank = inv.partner_bank_id
 
294
      bank_institution = inv_bank and inv_bank.bank
 
295
    %>
 
296
    <table class="list_bank_table" width="100%" >
 
297
        <tr>
 
298
            <th style="width:20%;">${_("Bank")}</th>
 
299
            <td style="width:30%;text-align:left;">${ bank_institution and bank_institution.name or '-' } </td>
 
300
            %if inv.partner_id and inv.partner_id.vat :
 
301
            <th style="width:20%;">${_("Customer VAT No")}</th>
 
302
            <td style="width:30%;">${inv.partner_id.vat or '-'}</td>
 
303
            %else:
 
304
            <!-- conserve table's cells widths -->
 
305
            <td style="width:20%;"></td>
 
306
            <td style="width:30%;"></td>
 
307
            %endif
 
308
        </tr>
 
309
        <tr>
 
310
            <th style="width:20%;">${_("IBAN")}</th>
 
311
            <td style="width:30%;text-align:left;">${ inv_bank and inv_bank.iban or '-' }</td>
 
312
            <th style="width:20%;">${_("Our VAT No")}</th>
 
313
            <td style="width:30%;" class="vat">''</td>
 
314
        </tr>
 
315
        <tr>
 
316
            <th width="20%">${_("BIC")}</th>
 
317
            <td style="width:30%;">${ inv.partner_bank_id and inv.partner_bank_id.bank and inv.partner_bank_id.bank.bic or '-' }</td>
 
318
        </tr>
 
319
    </table>
 
320
    <br/>
 
321
    %if inv.comment :
 
322
        <p class="std_text">${inv.comment | carriage_returns}</p>
 
323
    %endif
 
324
    %if inv.note2_webkit :
 
325
        <p class="std_text">${inv.note2_webkit | carriage_returns}</p>
 
326
    %endif
 
327
    <p style="page-break-after:always"></p>
 
328
    %endfor
 
329
</body>
 
330
</html>