~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to consumption_calculation/report/expiry_report.rml

  • Committer: jf
  • Date: 2012-07-31 08:28:42 UTC
  • mfrom: (1016.8.1 unifield-wm)
  • Revision ID: jf@tempo4-20120731082842-nc741jy4rtj210r0
UF-1194 [DEV] Printed Document : Expiry report
lp:~unifield-team/unifield-wm/trunk_uf-1194

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" ?>
 
2
<document filename="expiry_report.pdf">
 
3
 
 
4
    <template pageSize="(842.0,595.0)" title="Expiry Report" author="Medecins Sans Frontieres" allowSplitting="20">
 
5
        <pageTemplate id="first">
 
6
            <frame id="first" x1="30.0" y1="0.0" width="772" height="520" />
 
7
 
 
8
        <pageGraphics>
 
9
            <image x="35" y="530.0" height="53.3" width="100">[[ company.logo or removeParentNode('image') ]]</image>
 
10
            <setFont name="Helvetica-Bold" size="10"/>
 
11
            <drawString x="40" y="520.0">[[ getAddress() ]]</drawString>
 
12
        </pageGraphics>
 
13
 
 
14
    </pageTemplate>
 
15
    </template>
 
16
 
 
17
    <stylesheet>
 
18
    
 
19
        <blockTableStyle id="TitleTable">
 
20
                <blockAlignment value="CENTRE"/>
 
21
                <blockValign value="MIDDLE"/>
 
22
                        <lineStyle kind="OUTLINE" colorName="black" />
 
23
        </blockTableStyle>
 
24
        <blockTableStyle id="DocInfo">
 
25
                <blockAlignment value="LEFT"/>
 
26
                <blockValign value="MIDDLE"/>
 
27
        </blockTableStyle>
 
28
        <blockTableStyle id="LinesTable">
 
29
                <blockAlignment value="LEFT"/>
 
30
                <blockValign value="MIDDLE"/>
 
31
                <lineStyle kind="LINEABOVE" colorName="black" thickness="0.5" start="0,0" stop="-1,0" />
 
32
        </blockTableStyle>
 
33
        <blockTableStyle id="LinesTableTotal">
 
34
                <blockAlignment value="LEFT"/>
 
35
                <blockValign value="MIDDLE"/>
 
36
        </blockTableStyle>
 
37
 
 
38
        <initialize>
 
39
            <paraStyle name="all" alignment="justify"/>
 
40
        </initialize>
 
41
 
 
42
        <paraStyle name="Standard" fontName="Helvetica" fontSize="8.0" />
 
43
        
 
44
        <paraStyle name="Title" fontName="Helvetica-Bold" fontSize="12.0" leading="15.0" alignement="CENTER" />
 
45
        <paraStyle name="TextInfo" fontName="Helvetica" fontSize="8.0" leading="7.0" />
 
46
        <paraStyle name="TextInfoBold" fontName="Helvetica-Bold" fontSize="8.0" leading="7.0" />
 
47
        <paraStyle name="TextInfoBoldRight" fontName="Helvetica-Bold" fontSize="8.0" leading="7.0" alignment="RIGHT" />
 
48
        
 
49
    </stylesheet>
 
50
 
 
51
    <story>
 
52
    
 
53
        [[ setLang('en_US') ]]
 
54
    
 
55
            <blockTable colWidths="310.0,132.0,310.0" style="TitleTable">
 
56
                <tr>
 
57
                        <td>
 
58
                                <para style="Title"> </para>
 
59
                        </td>
 
60
                        <td>
 
61
                                <para style="Title">EXPIRY REPORT</para>
 
62
                        </td>
 
63
                        <td>
 
64
                                <para style="Title"> </para>
 
65
                        </td>
 
66
                </tr>
 
67
            </blockTable>
 
68
            
 
69
            <para style="Standard">
 
70
                <font color="white"> </font>
 
71
            </para>
 
72
            
 
73
            <blockTable colWidths="112.0,250.0,410.0" style="DocInfo">
 
74
                <tr>
 
75
                        <td>
 
76
                                <para style="TextInfoBold">Report date : </para>
 
77
                        </td>
 
78
                        <td>
 
79
                                <para style="TextInfo">[[ toDate() ]]</para>
 
80
                        </td>
 
81
                        <td>
 
82
                                <para style="TextInfo"> </para>
 
83
                        </td>
 
84
                </tr>
 
85
                <tr>
 
86
                        <td>
 
87
                                <para style="TextInfoBold">Location : </para>
 
88
                        </td>
 
89
                        <td>
 
90
                                <para style="TextInfo">[[ objects[0].location_id.name ]]</para>
 
91
                        </td>
 
92
                        <td>
 
93
                                <para style="TextInfo"> </para>
 
94
                        </td>
 
95
                </tr>
 
96
                <tr>
 
97
                        <td>
 
98
                                <para style="TextInfoBold">Period of calculation : </para>
 
99
                        </td>
 
100
                        <td>
 
101
                                <para style="TextInfo">[[ objects[0].week_nb ]] week[[ objects[0].week_nb > 1 and 's' or '' ]]</para>
 
102
                        </td>
 
103
                        <td>
 
104
                                <para style="TextInfo"> </para>
 
105
                        </td>
 
106
                </tr>
 
107
                <tr>
 
108
                        <td>
 
109
                                <para style="TextInfoBold">Limit date : </para>
 
110
                        </td>
 
111
                        <td>
 
112
                                <para style="TextInfo">[[ toDate(objects[0].date_to) ]]</para>
 
113
                        </td>
 
114
                        <td>
 
115
                                <para style="TextInfo"> </para>
 
116
                        </td>
 
117
                </tr>
 
118
                <tr>
 
119
                        <td>
 
120
                                <para style="TextInfoBold">Currency : </para>
 
121
                        </td>
 
122
                        <td>
 
123
                                <para style="TextInfo">[[ getCurrency() ]]</para>
 
124
                        </td>
 
125
                        <td>
 
126
                                <para style="TextInfo"> </para>
 
127
                        </td>
 
128
                </tr>
 
129
                <tr>
 
130
                        <td>
 
131
                                <para style="TextInfo"> </para>
 
132
                        </td>
 
133
                        <td>
 
134
                                <para style="TextInfo"> </para>
 
135
                        </td>
 
136
                        <td>
 
137
                                <para style="TextInfo"> </para>
 
138
                        </td>
 
139
                </tr>
 
140
            </blockTable>
 
141
 
 
142
            <para style="Standard">
 
143
                <font color="white"> </font>
 
144
            </para>
 
145
            
 
146
            <blockTable colWidths="772.0" style="LinesTableTotal">
 
147
                <tr>
 
148
                        <td>
 
149
                                <para style="TextInfoBold">Products/batches already expired</para>
 
150
                        </td>
 
151
                </tr>
 
152
            </blockTable>
 
153
            
 
154
            <blockTable colWidths="77.0,298.0,70.0,45.0,33.0,70.0,55.0,42.0,40.0,42.0" style="LinesTable" repeatRows="1">
 
155
                <tr>
 
156
                        <td>
 
157
                                <para style="TextInfoBold">CODE</para>
 
158
                        </td>
 
159
                        <td>
 
160
                                <para style="TextInfoBold">DESCRIPTION</para>
 
161
                        </td>
 
162
                        <td>
 
163
                                <para style="TextInfoBold">Location</para>
 
164
                        </td>
 
165
                        <td>
 
166
                                <para style="TextInfoBold">Stock</para>
 
167
                        </td>
 
168
                        <td>
 
169
                                <para style="TextInfoBold">UoM</para>
 
170
                        </td>
 
171
                        <td>
 
172
                                <para style="TextInfoBold">Batch #</para>
 
173
                        </td>
 
174
                        <td>
 
175
                                <para style="TextInfoBold">Expiry Date</para>
 
176
                        </td>
 
177
                        <td>
 
178
                                <para style="TextInfoBold">Exp. Qty</para>
 
179
                        </td>
 
180
                        <td>
 
181
                                <para style="TextInfoBold">Unit Cost</para>
 
182
                        </td>
 
183
                        <td>
 
184
                                <para style="TextInfoBold">Exp. Value</para>
 
185
                        </td>
 
186
                </tr>
 
187
                <tr>
 
188
                        [[ repeatIn(objects[0].line_ids, 'l') ]]
 
189
                        <td>
 
190
                                <para style="TextInfo">[[ l.expiry_date &lt; time.strftime('%Y-%m-%d') and l.product_code or removeParentNode('tr') ]]</para>
 
191
                        </td>
 
192
                        <td>
 
193
                                <para style="TextInfo">[[ l.product_name ]]</para>
 
194
                        </td>
 
195
                        <td>
 
196
                                <para style="TextInfo">[[ l.location_id and l.location_id.name ]]</para>
 
197
                        </td>
 
198
                        <td>
 
199
                                <para style="TextInfo">[[ formatLang(l.real_stock or 0.00) ]]</para>
 
200
                        </td>
 
201
                        <td>
 
202
                                <para style="TextInfo">[[ l.uom_id and l.uom_id.name ]]</para>
 
203
                        </td>
 
204
                        <td>
 
205
                                <para style="TextInfo">[[ l.batch_number ]]</para>
 
206
                        </td>
 
207
                        <td>
 
208
                                <para style="TextInfo">[[ l.expiry_date ]]</para>
 
209
                        </td>
 
210
                        <td>
 
211
                                <para style="TextInfo">[[ formatLang(l.expired_qty or 0.00) ]]</para>
 
212
                        </td>
 
213
                        <td>
 
214
                                <para style="TextInfo">[[ formatLang(l.product_id and l.product_id.standard_price or 0.00) ]]</para>
 
215
                        </td>
 
216
                        <td>
 
217
                                <para style="TextInfo">[[ formatLang(l.product_id and l.product_id.standard_price*l.expired_qty or 0.00) ]]</para>
 
218
                        </td>
 
219
                </tr>
 
220
            </blockTable>
 
221
            <blockTable colWidths="77.0,298.0,70.0,45.0,33.0,70.0,55.0,42.0,40.0,42.0" style="LinesTableTotal">
 
222
                <tr>
 
223
                        <td>
 
224
                                <para style="TextInfo"> </para>
 
225
                        </td>
 
226
                        <td>
 
227
                                <para style="TextInfo"> </para>
 
228
                        </td>
 
229
                        <td>
 
230
                                <para style="TextInfo"> </para>
 
231
                        </td>
 
232
                        <td>
 
233
                                <para style="TextInfo"> </para>
 
234
                        </td>
 
235
                        <td>
 
236
                                <para style="TextInfo"> </para>
 
237
                        </td>
 
238
                        <td>
 
239
                                <para style="TextInfo"> </para>
 
240
                        </td>
 
241
                        <td>
 
242
                                <para style="TextInfo"> </para>
 
243
                        </td>
 
244
                        <td>
 
245
                                <para style="TextInfo"> </para>
 
246
                        </td>
 
247
                        <td>
 
248
                                <para style="TextInfoBold">TOTAL</para>
 
249
                        </td>
 
250
                        <td>
 
251
                                <para style="TextInfoBold">[[ formatLang(getTotal(objects[0], 'expired')) ]]</para>
 
252
                        </td>
 
253
                </tr>
 
254
            </blockTable>
 
255
 
 
256
            <para style="Standard">
 
257
                <font color="white"> </font>
 
258
            </para>
 
259
            
 
260
            <blockTable colWidths="772.0" style="LinesTableTotal">
 
261
                <tr>
 
262
                        <td>
 
263
                                <para style="TextInfoBold">Products/batches to expire</para>
 
264
                        </td>
 
265
                </tr>
 
266
            </blockTable>
 
267
            
 
268
            <blockTable colWidths="77.0,298.0,70.0,45.0,33.0,70.0,55.0,42.0,40.0,42.0" style="LinesTable" repeatRows="1">
 
269
                <tr>
 
270
                        <td>
 
271
                                <para style="TextInfoBold">CODE</para>
 
272
                        </td>
 
273
                        <td>
 
274
                                <para style="TextInfoBold">DESCRIPTION</para>
 
275
                        </td>
 
276
                        <td>
 
277
                                <para style="TextInfoBold">Location</para>
 
278
                        </td>
 
279
                        <td>
 
280
                                <para style="TextInfoBold">Stock</para>
 
281
                        </td>
 
282
                        <td>
 
283
                                <para style="TextInfoBold">UoM</para>
 
284
                        </td>
 
285
                        <td>
 
286
                                <para style="TextInfoBold">Batch #</para>
 
287
                        </td>
 
288
                        <td>
 
289
                                <para style="TextInfoBold">Expiry Date</para>
 
290
                        </td>
 
291
                        <td>
 
292
                                <para style="TextInfoBold">Exp. Qty</para>
 
293
                        </td>
 
294
                        <td>
 
295
                                <para style="TextInfoBold">Unit Cost</para>
 
296
                        </td>
 
297
                        <td>
 
298
                                <para style="TextInfoBold">Exp. Value</para>
 
299
                        </td>
 
300
                </tr>
 
301
                <tr>
 
302
                        [[ repeatIn(objects[0].line_ids, 'l') ]]
 
303
                        <td>
 
304
                                <para style="TextInfo">[[ l.expiry_date &gt;= time.strftime('%Y-%m-%d') and l.product_code or removeParentNode('tr') ]]</para>
 
305
                        </td>
 
306
                        <td>
 
307
                                <para style="TextInfo">[[ l.product_name ]]</para>
 
308
                        </td>
 
309
                        <td>
 
310
                                <para style="TextInfo">[[ l.location_id and l.location_id.name ]]</para>
 
311
                        </td>
 
312
                        <td>
 
313
                                <para style="TextInfo">[[ formatLang(l.real_stock or 0.00) ]]</para>
 
314
                        </td>
 
315
                        <td>
 
316
                                <para style="TextInfo">[[ l.uom_id and l.uom_id.name ]]</para>
 
317
                        </td>
 
318
                        <td>
 
319
                                <para style="TextInfo">[[ l.batch_number ]]</para>
 
320
                        </td>
 
321
                        <td>
 
322
                                <para style="TextInfo">[[ l.expiry_date ]]</para>
 
323
                        </td>
 
324
                        <td>
 
325
                                <para style="TextInfo">[[ formatLang(l.expired_qty or 0.00) ]]</para>
 
326
                        </td>
 
327
                        <td>
 
328
                                <para style="TextInfo">[[ formatLang(l.product_id and l.product_id.standard_price or 0.00) ]]</para>
 
329
                        </td>
 
330
                        <td>
 
331
                                <para style="TextInfo">[[ formatLang(l.product_id and l.product_id.standard_price*l.expired_qty or 0.00) ]]</para>
 
332
                        </td>
 
333
                </tr>
 
334
            </blockTable>
 
335
            
 
336
            <blockTable colWidths="77.0,298.0,70.0,45.0,33.0,70.0,55.0,42.0,40.0,42.0" style="LinesTableTotal">
 
337
                <tr>
 
338
                        <td>
 
339
                                <para style="TextInfo"> </para>
 
340
                        </td>
 
341
                        <td>
 
342
                                <para style="TextInfo"> </para>
 
343
                        </td>
 
344
                        <td>
 
345
                                <para style="TextInfo"> </para>
 
346
                        </td>
 
347
                        <td>
 
348
                                <para style="TextInfo"> </para>
 
349
                        </td>
 
350
                        <td>
 
351
                                <para style="TextInfo"> </para>
 
352
                        </td>
 
353
                        <td>
 
354
                                <para style="TextInfo"> </para>
 
355
                        </td>
 
356
                        <td>
 
357
                                <para style="TextInfo"> </para>
 
358
                        </td>
 
359
                        <td>
 
360
                                <para style="TextInfo"> </para>
 
361
                        </td>
 
362
                        <td>
 
363
                                <para style="TextInfoBold">TOTAL</para>
 
364
                        </td>
 
365
                        <td>
 
366
                                <para style="TextInfoBold">[[ formatLang(getTotal(objects[0], 'expiry')) ]]</para>
 
367
                        </td>
 
368
                </tr>
 
369
            </blockTable>
 
370
 
 
371
            <para style="Standard">
 
372
                <font color="white"> </font>
 
373
            </para>
 
374
            
 
375
            <blockTable colWidths="78.0,340.0,60.0,40.0,33.0,50.0,55.0,74.0,42.0" style="LinesTableTotal">
 
376
                <tr>
 
377
                        <td>
 
378
                                <para style="TextInfo"> </para>
 
379
                        </td>
 
380
                        <td>
 
381
                                <para style="TextInfo"> </para>
 
382
                        </td>
 
383
                        <td>
 
384
                                <para style="TextInfo"> </para>
 
385
                        </td>
 
386
                        <td>
 
387
                                <para style="TextInfo"> </para>
 
388
                        </td>
 
389
                        <td>
 
390
                                <para style="TextInfo"> </para>
 
391
                        </td>
 
392
                        <td>
 
393
                                <para style="TextInfo"> </para>
 
394
                        </td>
 
395
                        <td>
 
396
                                <para style="TextInfo"> </para>
 
397
                        </td>
 
398
                        <td>
 
399
                                <para style="TextInfoBoldRight">ALL TOTAL</para>
 
400
                        </td>
 
401
                        <td>
 
402
                                <para style="TextInfoBold">[[ formatLang(getTotal(objects[0], 'all')) ]]</para>
 
403
                        </td>
 
404
                </tr>
 
405
            </blockTable>
 
406
            
 
407
    </story>
 
408
    
 
409
</document>