~camptocamp/sale-reports/typo_groups_id-rde

« back to all changes in this revision

Viewing changes to sale_order_webkit/report/sale_order.mako

  • Committer: Maxime Chambreuil
  • Author(s): Yannick Vaucher
  • Date: 2013-12-27 17:16:59 UTC
  • mfrom: (21.3.1 7.0-sync-webkit-reports-20130926)
  • Revision ID: maxime.chambreuil@savoirfairelinux.com-20131227171659-zpvn6bvtxmzlr7oh
[MRG] Syncing with changes in https://code.launchpad.net/~camptocamp/account-invoice-report/7.0-fix-1231329/+merge/187697

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
    <style type="text/css">
5
5
        ${css}
6
6
 
7
 
.list_sale_table {
 
7
.list_main_table {
8
8
    border:thin solid #E3E4EA;
9
9
    text-align:center;
10
10
    border-collapse: collapse;
11
11
}
12
 
.list_sale_table th {
 
12
table.list_main_table {
 
13
    margin-top: 20px;
 
14
}
 
15
.list_main_headers {
 
16
    padding: 0;
 
17
}
 
18
.list_main_headers th {
 
19
    border: thin solid #000000;
 
20
    padding-right:3px;
 
21
    padding-left:3px;
13
22
    background-color: #EEEEEE;
14
 
    border: thin solid #000000;
15
23
    text-align:center;
16
24
    font-size:12;
17
25
    font-weight:bold;
18
 
    padding-right:3px;
19
 
    padding-left:3px;
20
26
}
21
 
.list_sale_table td {
22
 
    border-top: thin solid #EEEEEE;
23
 
    text-align:left;
24
 
    font-size:12;
 
27
.list_main_table td {
25
28
    padding-right:3px;
26
29
    padding-left:3px;
27
30
    padding-top:3px;
28
31
    padding-bottom:3px;
29
32
}
30
 
.list_sale_table thead {
31
 
    display:table-header-group;
32
 
}
33
 
 
34
 
td.formatted_note {
 
33
.list_main_lines,
 
34
.list_main_footers {
 
35
    padding: 0;
 
36
}
 
37
.list_main_footers {
 
38
    padding-top: 15px;
 
39
}
 
40
.list_main_lines td,
 
41
.list_main_footers td,
 
42
.list_main_footers th {
 
43
    border-style: none;
 
44
    text-align:left;
 
45
    font-size:12;
 
46
    padding:0;
 
47
}
 
48
.list_main_footers th {
 
49
    text-align:right;
 
50
}
 
51
 
 
52
td .total_empty_cell {
 
53
    width: 77%;
 
54
}
 
55
td .total_sum_cell {
 
56
    width: 13%;
 
57
}
 
58
 
 
59
.nobreak {
 
60
    page-break-inside: avoid;
 
61
}
 
62
caption.formatted_note {
35
63
    text-align:left;
36
64
    border-right:thin solid #EEEEEE;
37
65
    border-left:thin solid #EEEEEE;
38
66
    border-top:thin solid #EEEEEE;
39
67
    padding-left:10px;
40
68
    font-size:11;
41
 
}
42
 
 
43
 
 
44
 
 
45
 
.no_bloc {
46
 
    border-top: thin solid  #ffffff ;
 
69
    caption-side: bottom;
 
70
}
 
71
caption.formatted_note p {
 
72
    margin: 0;
 
73
}
 
74
 
 
75
.main_col1 {
 
76
    width: 40%;
 
77
}
 
78
td.main_col1 {
 
79
    text-align:left;
 
80
}
 
81
.main_col2,
 
82
.main_col3,
 
83
.main_col4,
 
84
.main_col6 {
 
85
    width: 10%;
 
86
}
 
87
.main_col5 {
 
88
    width: 7%;
 
89
}
 
90
td.main_col5 {
 
91
    text-align: center;
 
92
    font-style:italic;
 
93
    font-size: 10;
 
94
}
 
95
.main_col7 {
 
96
    width: 13%;
47
97
}
48
98
 
49
99
.right_table {
55
105
    font-size:12;
56
106
}
57
107
 
58
 
tfoot.totals tr:first-child td{
59
 
    padding-top: 15px;
 
108
th.date {
 
109
    width: 90px;
60
110
}
61
111
 
62
 
 
63
112
td.amount, th.amount {
64
113
    text-align: right;
65
114
    white-space: nowrap;
66
115
}
67
116
 
 
117
td.date {
 
118
    white-space: nowrap;
 
119
    width: 90px;
 
120
}
68
121
 
69
122
.address .recipient .shipping .invoice {
70
123
    font-size: 12px;
77
130
    <%
78
131
    def carriage_returns(text):
79
132
        return text.replace('\n', '<br />')
80
 
 
81
133
    %>
 
134
 
 
135
    <%def name="address(partner)">
 
136
        <%doc>
 
137
            XXX add a helper for address in report_webkit module as this won't be suported in v8.0
 
138
        </%doc>
 
139
        %if partner.parent_id:
 
140
            <tr><td class="name">${partner.parent_id.name or ''}</td></tr>
 
141
            <tr><td>${partner.title and partner.title.name or ''} ${partner.name}</td></tr>
 
142
            <% address_lines = partner.contact_address.split("\n")[1:] %>
 
143
        %else:
 
144
            <tr><td class="name">${partner.title and partner.title.name or ''} ${partner.name}</td></tr>
 
145
            <% address_lines = partner.contact_address.split("\n") %>
 
146
        %endif
 
147
        %for part in address_lines:
 
148
            % if part:
 
149
                <tr><td>${part}</td></tr>
 
150
            % endif
 
151
        %endfor
 
152
    </%def>
 
153
 
82
154
    %for order in objects:
83
155
    <% setLang(order.partner_id.lang) %>
84
156
    <%
86
158
    %>
87
159
    <div class="address">
88
160
        <table class="recipient">
89
 
            %if order.partner_id.parent_id:
90
 
            <tr><td class="name">${order.partner_id.parent_id.name or ''}</td></tr>
91
 
            <tr><td>${order.partner_id.title and order.partner_id.title.name or ''} ${order.partner_id.name }</td></tr>
92
 
            <% address_lines = order.partner_id.contact_address.split("\n")[1:] %>
93
 
            %else:
94
 
            <tr><td class="name">${order.partner_id.title and order.partner_id.title.name or ''} ${order.partner_id.name }</td></tr>
95
 
            <% address_lines = order.partner_id.contact_address.split("\n") %>
96
 
            %endif
97
 
            %for part in address_lines:
98
 
                %if part:
99
 
                <tr><td>${part}</td></tr>
100
 
                %endif
101
 
            %endfor
 
161
          ${address(partner=order.partner_id)}
102
162
        </table>
103
163
 
104
164
        <table class="shipping">
105
 
            <tr><td class="address_title">${_("Shipping address:")}</td></tr>
106
 
            %if order.partner_shipping_id.parent_id:
107
 
            <tr><td>${order.partner_shipping_id.parent_id.name or ''}</td></tr>
108
 
            <tr><td>${order.partner_shipping_id.title and order.partner_shipping_id.title.name or ''} ${order.partner_shipping_id.name }</td></tr>
109
 
            <% address_lines = order.partner_shipping_id.contact_address.split("\n")[1:] %>
110
 
            %else:
111
 
            <tr><td>${order.partner_shipping_id.title and order.partner_shipping_id.title.name or ''} ${order.partner_shipping_id.name }</td></tr>
112
 
            <% address_lines = order.partner_shipping_id.contact_address.split("\n") %>
113
 
            %endif
114
 
            %for part in address_lines:
115
 
                %if part:
116
 
                <tr><td>${part}</td></tr>
117
 
                %endif
118
 
            %endfor
 
165
          <tr><td class="address_title">${_("Shipping address:")}</td></tr>
 
166
          ${address(partner=order.partner_shipping_id)}
119
167
        </table>
120
168
 
121
169
        <table class="invoice">
122
 
            <tr><td class="address_title">${_("Invoice address:")}</td></tr>
123
 
            %if order.partner_invoice_id.parent_id:
124
 
            <tr><td>${order.partner_invoice_id.parent_id.name or ''}</td></tr>
125
 
            <tr><td>${order.partner_invoice_id.title and order.partner_invoice_id.title.name or ''} ${order.partner_invoice_id.name }</td></tr>
126
 
            <% address_lines = order.partner_invoice_id.contact_address.split("\n")[1:] %>
127
 
            %else:
128
 
            <tr><td>${order.partner_invoice_id.title and order.partner_invoice_id.title.name or ''} ${order.partner_invoice_id.name }</td></tr>
129
 
            <% address_lines = order.partner_invoice_id.contact_address.split("\n") %>
130
 
            %endif
131
 
            %for part in address_lines:
132
 
                %if part:
133
 
                <tr><td>${part}</td></tr>
134
 
                %endif
135
 
            %endfor
 
170
          <tr><td class="address_title">${_("Invoice address:")}</td></tr>
 
171
          ${address(partner=order.partner_invoice_id)}
136
172
        </table>
137
173
    </div>
138
174
 
140
176
 
141
177
    <table class="basic_table" width="100%">
142
178
        <tr>
143
 
            <td style="font-weight:bold;">${quotation and _("Date Ordered") or _("Quotation Date")}</td>
144
 
            <td style="font-weight:bold;">${_("Your Reference")}</td>
145
 
            <td style="font-weight:bold;">${_("Salesman")}</td>
146
 
            <td style="font-weight:bold;">${_('Payment Term')}</td>
 
179
            <th class="date">${quotation and _("Date Ordered") or _("Quotation Date")}</td>
 
180
            <th>${_("Your Reference")}</td>
 
181
            <th>${_("Salesman")}</td>
 
182
            <th>${_('Payment Term')}</td>
147
183
        </tr>
148
184
        <tr>
149
 
            <td>${formatLang(order.date_order, date=True)}</td>
 
185
            <td class="date">${formatLang(order.date_order, date=True)}</td>
150
186
            <td>${order.client_order_ref or ''}</td>
151
187
            <td>${order.user_id and order.user_id.name or ''}</td>
152
188
            <td>${order.payment_term and order.payment_term.note or ''}</td>
155
191
 
156
192
    <div>
157
193
    %if order.note1:
158
 
        <p class="std_text"> ${order.note1| n} </p>
 
194
        <p class="std_text"> ${order.note1 | n} </p>
159
195
    %endif
160
196
    </div>
161
197
 
162
 
    <table class="list_sale_table" width="100%" style="margin-top: 20px;">
163
 
        <thead>
164
 
            <tr>
165
 
                <th>${_("Description")}</th>
166
 
                <th class="amount">${_("Quantity")}</th>
167
 
                <th class="amount">${_("UoM")}</th>
168
 
                <th class="amount">${_("Unit Price")}</th>
169
 
                <th>${_("VAT")}</th>
170
 
                <th class="amount">${_("Disc.(%)")}</th>
171
 
                <th class="amount">${_("Price")}</th>
172
 
            </tr>
173
 
        </thead>
174
 
        <tbody>
 
198
    <table class="list_main_table" width="100%">
 
199
      <thead>
 
200
        <tr>
 
201
          <th class="list_main_headers" style="width: 100%">
 
202
            <table style="width:100%">
 
203
              <tr>
 
204
                <th class="main_col1">${_("Description")}</th>
 
205
                <th class="amount main_col2">${_("Quantity")}</th>
 
206
                <th class="amount main_col3">${_("UoM")}</th>
 
207
                <th class="amount main_col4">${_("Unit Price")}</th>
 
208
                <th class="main_col5">${_("VAT")}</th>
 
209
                <th class="amount main_col6">${_("Disc.(%)")}</th>
 
210
                <th class="amount main_col7">${_("Price")}</th>
 
211
              </tr>
 
212
            </table>
 
213
          </th>
 
214
        </tr>
 
215
      </thead>
 
216
      <tbody>
175
217
        %for line in order.order_line:
176
 
            <tr class="line">
177
 
                <td style="text-align:left; " >${ line.name }</td>
178
 
                <td class="amount" width="7.5%">${ formatLang(line.product_uos and line.product_uos_qty or line.product_uom_qty) }</td>
179
 
                <td style="text-align:center;">${ line.product_uos and line.product_uos.name or line.product_uom.name }</td>
180
 
                <td class="amount" width="8%">${formatLang(line.price_unit)}</td>
181
 
                <td style="font-style:italic; font-size: 10;">${ ', '.join([tax.description or tax.name for tax in line.tax_id]) }</td>
182
 
                <td class="amount" width="10%">${line.discount and formatLang(line.discount, digits=get_digits(dp='Sale Price')) or ''} ${line.discount and '%' or ''}</td>
183
 
                <td class="amount" width="13%">${formatLang(line.price_subtotal, digits=get_digits(dp='Sale Price'))}&nbsp;${order.pricelist_id.currency_id.symbol}</td>
184
 
            </tr>
185
 
            %if line.formatted_note:
186
 
            <tr>
187
 
              <td class="formatted_note" colspan="7">
188
 
                ${line.formatted_note| n}
189
 
              </td>
190
 
            </tr>
191
 
            %endif
 
218
          <tr>
 
219
            <td class="list_main_lines" style="width: 100%">
 
220
              <div class="nobreak">
 
221
                <table style="width:100%">
 
222
                  <tr>
 
223
                    <td class="main_col1">${ line.name }</td>
 
224
                    <td class="amount main_col2">${ formatLang(line.product_uos and line.product_uos_qty or line.product_uom_qty) }</td>
 
225
                    <td class="amount main_col3">${ line.product_uos and line.product_uos.name or line.product_uom.name }</td>
 
226
                    <td class="amount main_col4">${formatLang(line.price_unit)}</td>
 
227
                    <td class="main_col5">${ ', '.join([tax.description or tax.name for tax in line.tax_id]) }</td>
 
228
                    <td class="amount main_col6">${line.discount and formatLang(line.discount, digits=get_digits(dp='Sale Price')) or ''} ${line.discount and '%' or ''}</td>
 
229
                    <td class="amount main_col7">${formatLang(line.price_subtotal, digits=get_digits(dp='Sale Price'))}&nbsp;${order.pricelist_id.currency_id.symbol}</td>
 
230
                  </tr>
 
231
                  %if line.formatted_note:
 
232
                    <caption class="formatted_note">
 
233
                      ${line.formatted_note| n}
 
234
                    </caption>
 
235
                  %endif
 
236
                </table>
 
237
              </div>
 
238
            </td>
 
239
          </tr>
192
240
        %endfor
193
 
        </tbody>
194
 
        <tfoot class="totals">
195
 
            <tr>
196
 
                <td colspan="5" style="border-style:none"/>
197
 
                <td style="border-style:none"><b>${_("Net Total:")}</b></td>
198
 
                <td class="amount" style="border-style:none">${formatLang(order.amount_untaxed, get_digits(dp='Sale Price'))} ${order.pricelist_id.currency_id.symbol}</td>
199
 
            </tr>
200
 
            <tr>
201
 
                <td colspan="5" style="border-style:none"/>
202
 
                <td style="border-style:none" ><b>${_("Taxes:")}</b></td>
203
 
                <td class="amount"style="border-style:none" >${formatLang(order.amount_tax, get_digits(dp='Sale Price'))} ${order.pricelist_id.currency_id.symbol}</td>
204
 
            </tr>
205
 
            <tr>
206
 
                <td colspan="5" style="border-style:none"/>
207
 
                <td style="border-style:none"><b>${_("Total:")}</b></td>
208
 
                <td class="amount" style="border-style:none">${formatLang(order.amount_total, get_digits(dp='Sale Price'))} ${order.pricelist_id.currency_id.symbol}</td>
209
 
            </tr>
210
 
        </tfoot>
 
241
      </tbody>
 
242
      <tfoot class="totals">
 
243
        <tr>
 
244
          <td class="list_main_footers" style="width: 100%">
 
245
            <div class="nobreak">
 
246
              <table style="width:100%">
 
247
                <tr>
 
248
                  <td class="total_empty_cell"/>
 
249
                  <th>
 
250
                    ${_("Net Total:")}
 
251
                  </th>
 
252
                  <td class="amount total_sum_cell">
 
253
                    ${formatLang(order.amount_untaxed, get_digits(dp='Sale Price'))} ${order.pricelist_id.currency_id.symbol}
 
254
                  </td>
 
255
                </tr>
 
256
                <tr>
 
257
                  <td class="total_empty_cell"/>
 
258
                  <th>
 
259
                    ${_("Taxes:")}
 
260
                  </th>
 
261
                  <td class="amount total_sum_cell">
 
262
                    ${formatLang(order.amount_tax, get_digits(dp='Sale Price'))} ${order.pricelist_id.currency_id.symbol}
 
263
                  </td>
 
264
                </tr>
 
265
                <tr>
 
266
                  <td class="total_empty_cell"/>
 
267
                  <th>
 
268
                    ${_("Total:")}
 
269
                  </th>
 
270
                  <td class="amount total_sum_cell">
 
271
                    <b>${formatLang(order.amount_total, get_digits(dp='Sale Price'))} ${order.pricelist_id.currency_id.symbol}</b>
 
272
                  </td>
 
273
                </tr>
 
274
              </table>
 
275
            </div>
 
276
          </td>
 
277
        </tr>
 
278
      </tfoot>
211
279
    </table>
212
280
 
213
281
    %if order.note :
216
284
    %if order.note2:
217
285
        <p class="std_text">${order.note2 | n}</p>
218
286
    %endif
219
 
 
220
 
    <p style="page-break-after: always"/>
221
 
    <br/>
 
287
    <p style="page-break-after:always"/>
222
288
    %endfor
223
289
</body>
224
290
</html>