[% # INCLUDE dumper.tt dump = data.packs; USE today = DateTime(today = 1); # INCLUDE dumper.tt dump = today; USE format; USE year_as_yy = format('%02d'); %]
| Pack | Received | Lab number | Action | Pack sent |
|---|---|---|---|---|
| #[% loop.count %] | [% entry.registered.strftime('%d.%b.%Y') %] | [% entry.request_number %]/[%# use String(entry.year - 2000); # gives .t error!! String.format('%02d') %][% year_as_yy(entry.year - 2000) %] | [% IF entry.option.match('month'); 'next pack '; IF loop.last AND entry.pack_due AND NOT entry.pack_sent; entry.outcome = ' due out ' _ entry.pack_due.strftime('%d.%b.%Y'); ELSIF NOT entry.outcome.match('immediate'); 'in '; END; END; entry.outcome; %] | [% # INCLUDE dumper.tt name = loop.count dump = entry.pack_due >= date; IF entry.option.match('clinic_return'); '[not required]'; ELSIF entry.pack_due AND entry.pack_due >= today; '[ due '; entry.pack_due.strftime('%d.%b.%Y'); ' ]'; ELSIF entry.pack_sent; entry.pack_sent.strftime('%d.%b.%Y'); END; %] |