Commits

Anonymous committed 661c6f7

taxi details etc.

Comments (0)

Files changed (1)

travel_voucher.kid

 <?xml version="1.0" encoding="utf-8"?><!--*- nxml -*-->
 <!DOCTYPE html>
 
-<?python from trxtsv import isoDate, numField ?>
-
 <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:py="http://purl.org/kid/ns#"
       >
 table.mittravel tbody tr td { border: 2px solid }
 table.mittravel tbody tr th { text-align: left }
 
+th.startblock { margin-top: 1em }
 tbody.vevent tr.trx td { border-top: 1px solid }
 tbody.vevent td { padding: 3px; margin: 0}
 .amt { text-align: right }
 <table class="mittravel">
 <tbody id='${trip["id"]}' class="vevent">
 <tr>
-  <th>NAME of traveller</th>
+  <th class="startblock">NAME of traveller</th>
   <!-- factor out organizer/vcard handling -->
   <?python who = trip["organizer"] ?>
-  <td class="organizer vcard"><u class='fn'>${who["fn"]}</u></td>
+  <td class="organizer vcard" colspan="2"><u class='fn'>${who["fn"]}</u></td>
 </tr>
 <tr>
   <th>DESTINATION(S)</th>
   <!-- factor out location/vcard handling -->
   <?python where = trip["location"] ?>
-  <td class="location vcard" id="${where['id']}">
+  <td class="location vcard" id="${where['id']}" colspan="4">
     <u class="locality">${where['locality']}</u
     >, <u class="region">${where['region']}</u
     >, <u class="country-name">${where['country-name']}</u>
 </tr>
 <tr>
   <th>START—Date</th>
-  <td><abbr class="dtstart" title="${trip['dtstart']}">trip['dtstart']}</abbr></td>
-  <td><abbr class="dtend" title="${trip['dtend']}">trip['dtend']}-1@@</abbr></td>
+  <td><abbr class="dtstart" title="${trip['dtstart']}">${trip['dtstart']}</abbr></td>
+  <td><abbr class="dtend" title="${trip['dtend']}">${trip['dtend']}-1@@</abbr></td>
 </tr>
 <tr>
-  <th>PURPOSE of trip</th>
-  <td class="note">${trip["note"]}</td>
+  <th class="startblock">PURPOSE of trip</th>
+  <td class="note" colspan="4">${trip["note"]}</td>
 </tr>
 
 </tbody>
 
+<?python
+tot_adv = 0
+tot_due = 0
+?>
+
 <tbody class="vevent">
 
 <!-- TODO: multiple legs -->
 <!-- TODO: derive this from travel itinerary -->
 <tr>
-  <th>TICKETS $$Amount</th><td>${air["amt"]}</td><td>${air["note"]}</td>
+  <th class="startblock">TICKETS $$Amount</th>
+  <?python a = air["amt"]; tot_adv += a ?>
+  <td class="amt">$a</td>
+  <td>${air["note"]}</td>
 </tr>
+
+<!-- assume MIT buys tickets -->
+
 <tr>
   <th>TRANSPORTATION—Date/From/To/Mode</th>
   <td>${air["depart"]}</td>
 </tbody>
 
 <?python transactions=list(transactions) ?>
-<?python hotels = list(hotel_stays(transactions)) ?>
+<?python hotels = list(find_hotels(transactions)) ?>
 
 <tbody>
 <tr>
  <th>HOTEL— # of nights?</th>
  <td>${sum([e["duration"] for e in hotels])}</td>
  <th>total $$Amt?</th>
- <td>${sum([e["amt"] for e in hotels])}</td>
+
+ <!-- TODO: account for direct-billed hotels -->
+ <?python a = sum([e["amt"] for e in hotels]); tot_due += a ?>
+ <td class="amt">$a</td>
 </tr>
 </tbody>
 <tbody class="vevent" py:for="e in hotels">
 <tr>
   <th>HOTEL Name</th>
-  <td colspan="2" class="location">${e["location"]}</td>
-  <td class="note">${e["amt"]}</td>
+  <td class="dtstart">${e["dtstart"]}</td>
+  <td class="summary location" colspan="2">${e["location"]}</td>
+  <td class="note amt">${e["amt"]}</td>
 </tr>
 </tbody>
 
-</table>
-<table>
-<!-- @@TODO: split table every 100 transactions? -->
-
-<!-- transactions -->
-<tbody py:for="t in []" class='vevent'>
- <?python date = t["trx"]["date"] ?>
- <!-- todo grey/parity -->
- <tr class='trx'>
-  <td><abbr class='dtstart' title='${isoDate(date)}'>${date}</abbr></td>
-  <td>${t["trx"].get("payee",'')}</td> <!-- descElt hcard stuff@@ -->
-
-  <?python num, splitflag, trxty = numField(t["trx"].get('num', '')) ?>
-
-  <td>${num or trxty or ''}</td>
-  <td>${t["trx"]['acct']}</td>
- </tr>
- <tr py:for="split in t['splits']" class='split description'>
-   <td></td>
-   <td>${split.get('memo', '')}</td>
-   <td>${split.get('clr', '')}</td>
-   <td>${split.get('L', '')}</td>
-   <td class='amt'>${split.get('subtot', '')}</td>
+<?python meals = list(find_meals(transactions)) ?>
+<tbody>
+<tr>
+ <th>MEALS—# of meals?</th>
+ <td>${len(meals)}</td>
+ <th>total $$Amt?</th>
+ <?python a = sum([e["amt"] for e in meals]); tot_due += a ?>
+ <td class="amt">$a</td>
 </tr>
-
 </tbody>
 
+<?python Heading="MEALS DETAIL" ?>
+<tbody class="vevent" py:for="e in meals">
+<tr>
+  <th>$Heading</th>
+  <td class="dtstart">${e["dtstart"]}</td>
+  <td class="summary location" colspan="2">${e["location"]}</td>
+  <td class="note amt">${e["amt"]}</td>
+</tr>
+<?python Heading="" ?>
+</tbody>
+
+<?python taxis = list(find_taxis(transactions)) ?>
+<?python Heading="TAXI, BUS, ETC." ?>
+<tbody class="vevent" py:for="e in taxis">
+<tr>
+  <th>$Heading</th>
+  <td class="dtstart">${e["dtstart"]}</td>
+  <td class="summary location">${e["location"]}</td>
+  <td class="category">${e["category"]}</td>
+
+  <?python a = e["amt"]; tot_due += a ?>
+
+  <td class="note amt">$a</td>
+</tr>
+<?python Heading="" ?>
+</tbody>
+
+<?python others = list(find_others(transactions)) ?>
+<?python Heading="OTHER EXPENSES (itemize)" ?>
+<tbody class="vevent" py:for="e in others">
+<tr>
+  <th>$Heading</th>
+  <td class="dtstart">${e["dtstart"]}</td>
+  <td class="summary" colspan="2">${e["summary"]}</td>
+
+  <?python a = e["amt"]; tot_due += a ?>
+  <td class="note amt">$a</td>
+</tr>
+<?python Heading="" ?>
+</tbody>
+
+<tbody>
+<tr><th>TRAVEL ADVANCE $$AMT</th><td class="amt">${tot_adv}</td></tr>
+<tr><th>TOTAL TRIP AMOUNT</th><td class="amt">${tot_adv + tot_due}</td></tr>
+<tr><th>TOTAL DUE TO TRAVELER</th><td class="amt">${tot_due}</td></tr>
+</tbody>
 </table>
 
 </body>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.