2
<document filename="expiry_report.pdf">
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" />
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>
19
<blockTableStyle id="TitleTable">
20
<blockAlignment value="CENTRE"/>
21
<blockValign value="MIDDLE"/>
22
<lineStyle kind="OUTLINE" colorName="black" />
24
<blockTableStyle id="DocInfo">
25
<blockAlignment value="LEFT"/>
26
<blockValign value="MIDDLE"/>
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" />
33
<blockTableStyle id="LinesTableTotal">
34
<blockAlignment value="LEFT"/>
35
<blockValign value="MIDDLE"/>
39
<paraStyle name="all" alignment="justify"/>
42
<paraStyle name="Standard" fontName="Helvetica" fontSize="8.0" />
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" />
53
[[ setLang('en_US') ]]
55
<blockTable colWidths="310.0,132.0,310.0" style="TitleTable">
58
<para style="Title"> </para>
61
<para style="Title">EXPIRY REPORT</para>
64
<para style="Title"> </para>
69
<para style="Standard">
70
<font color="white"> </font>
73
<blockTable colWidths="112.0,250.0,410.0" style="DocInfo">
76
<para style="TextInfoBold">Report date : </para>
79
<para style="TextInfo">[[ toDate() ]]</para>
82
<para style="TextInfo"> </para>
87
<para style="TextInfoBold">Location : </para>
90
<para style="TextInfo">[[ objects[0].location_id.name ]]</para>
93
<para style="TextInfo"> </para>
98
<para style="TextInfoBold">Period of calculation : </para>
101
<para style="TextInfo">[[ objects[0].week_nb ]] week[[ objects[0].week_nb > 1 and 's' or '' ]]</para>
104
<para style="TextInfo"> </para>
109
<para style="TextInfoBold">Limit date : </para>
112
<para style="TextInfo">[[ toDate(objects[0].date_to) ]]</para>
115
<para style="TextInfo"> </para>
120
<para style="TextInfoBold">Currency : </para>
123
<para style="TextInfo">[[ getCurrency() ]]</para>
126
<para style="TextInfo"> </para>
131
<para style="TextInfo"> </para>
134
<para style="TextInfo"> </para>
137
<para style="TextInfo"> </para>
142
<para style="Standard">
143
<font color="white"> </font>
146
<blockTable colWidths="772.0" style="LinesTableTotal">
149
<para style="TextInfoBold">Products/batches already expired</para>
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">
157
<para style="TextInfoBold">CODE</para>
160
<para style="TextInfoBold">DESCRIPTION</para>
163
<para style="TextInfoBold">Location</para>
166
<para style="TextInfoBold">Stock</para>
169
<para style="TextInfoBold">UoM</para>
172
<para style="TextInfoBold">Batch #</para>
175
<para style="TextInfoBold">Expiry Date</para>
178
<para style="TextInfoBold">Exp. Qty</para>
181
<para style="TextInfoBold">Unit Cost</para>
184
<para style="TextInfoBold">Exp. Value</para>
188
[[ repeatIn(objects[0].line_ids, 'l') ]]
190
<para style="TextInfo">[[ l.expiry_date < time.strftime('%Y-%m-%d') and l.product_code or removeParentNode('tr') ]]</para>
193
<para style="TextInfo">[[ l.product_name ]]</para>
196
<para style="TextInfo">[[ l.location_id and l.location_id.name ]]</para>
199
<para style="TextInfo">[[ formatLang(l.real_stock or 0.00) ]]</para>
202
<para style="TextInfo">[[ l.uom_id and l.uom_id.name ]]</para>
205
<para style="TextInfo">[[ l.batch_number ]]</para>
208
<para style="TextInfo">[[ l.expiry_date ]]</para>
211
<para style="TextInfo">[[ formatLang(l.expired_qty or 0.00) ]]</para>
214
<para style="TextInfo">[[ formatLang(l.product_id and l.product_id.standard_price or 0.00) ]]</para>
217
<para style="TextInfo">[[ formatLang(l.product_id and l.product_id.standard_price*l.expired_qty or 0.00) ]]</para>
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">
224
<para style="TextInfo"> </para>
227
<para style="TextInfo"> </para>
230
<para style="TextInfo"> </para>
233
<para style="TextInfo"> </para>
236
<para style="TextInfo"> </para>
239
<para style="TextInfo"> </para>
242
<para style="TextInfo"> </para>
245
<para style="TextInfo"> </para>
248
<para style="TextInfoBold">TOTAL</para>
251
<para style="TextInfoBold">[[ formatLang(getTotal(objects[0], 'expired')) ]]</para>
256
<para style="Standard">
257
<font color="white"> </font>
260
<blockTable colWidths="772.0" style="LinesTableTotal">
263
<para style="TextInfoBold">Products/batches to expire</para>
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">
271
<para style="TextInfoBold">CODE</para>
274
<para style="TextInfoBold">DESCRIPTION</para>
277
<para style="TextInfoBold">Location</para>
280
<para style="TextInfoBold">Stock</para>
283
<para style="TextInfoBold">UoM</para>
286
<para style="TextInfoBold">Batch #</para>
289
<para style="TextInfoBold">Expiry Date</para>
292
<para style="TextInfoBold">Exp. Qty</para>
295
<para style="TextInfoBold">Unit Cost</para>
298
<para style="TextInfoBold">Exp. Value</para>
302
[[ repeatIn(objects[0].line_ids, 'l') ]]
304
<para style="TextInfo">[[ l.expiry_date >= time.strftime('%Y-%m-%d') and l.product_code or removeParentNode('tr') ]]</para>
307
<para style="TextInfo">[[ l.product_name ]]</para>
310
<para style="TextInfo">[[ l.location_id and l.location_id.name ]]</para>
313
<para style="TextInfo">[[ formatLang(l.real_stock or 0.00) ]]</para>
316
<para style="TextInfo">[[ l.uom_id and l.uom_id.name ]]</para>
319
<para style="TextInfo">[[ l.batch_number ]]</para>
322
<para style="TextInfo">[[ l.expiry_date ]]</para>
325
<para style="TextInfo">[[ formatLang(l.expired_qty or 0.00) ]]</para>
328
<para style="TextInfo">[[ formatLang(l.product_id and l.product_id.standard_price or 0.00) ]]</para>
331
<para style="TextInfo">[[ formatLang(l.product_id and l.product_id.standard_price*l.expired_qty or 0.00) ]]</para>
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">
339
<para style="TextInfo"> </para>
342
<para style="TextInfo"> </para>
345
<para style="TextInfo"> </para>
348
<para style="TextInfo"> </para>
351
<para style="TextInfo"> </para>
354
<para style="TextInfo"> </para>
357
<para style="TextInfo"> </para>
360
<para style="TextInfo"> </para>
363
<para style="TextInfoBold">TOTAL</para>
366
<para style="TextInfoBold">[[ formatLang(getTotal(objects[0], 'expiry')) ]]</para>
371
<para style="Standard">
372
<font color="white"> </font>
375
<blockTable colWidths="78.0,340.0,60.0,40.0,33.0,50.0,55.0,74.0,42.0" style="LinesTableTotal">
378
<para style="TextInfo"> </para>
381
<para style="TextInfo"> </para>
384
<para style="TextInfo"> </para>
387
<para style="TextInfo"> </para>
390
<para style="TextInfo"> </para>
393
<para style="TextInfo"> </para>
396
<para style="TextInfo"> </para>
399
<para style="TextInfoBoldRight">ALL TOTAL</para>
402
<para style="TextInfoBold">[[ formatLang(getTotal(objects[0], 'all')) ]]</para>