Lots of stuff, I got too tired to keep perfect revision history
[cs356-p2-videostore.git] / app / views / purchase / receipt.rhtml
1 <h1>Receipt</h1>
2
3 <p><b>Customer ID: </b><%= @customer.id.to_s %></p>
4 <p><b>Customer Name: </b><%= @customer.name.to_s %></p>
5 <br/>
6 <p><b>Transaction Date: </b><%= @time %></p>
7 <br/>
8
9 <p><b>Purchases:</b></p>
10 <table border="1">
11   <!-- Header -->
12   <tr>
13     <th>Item</th>
14     <th>Due Date</th>
15     <th>Price</th>
16   </tr>
17
18   <!-- Debt -->
19   <% if not @debt.zero? %>
20   <tr>
21     <td><b>Overdue Item Fees</b></td>
22     <td></td>
23     <td><%= number_to_currency(@debt) %></td>
24   </tr>
25   <% end %>
26 <% for item in @items %>
27   <tr>
28     <td><%=h item.title %></td>
29   <% if item.class == Video or item.class == Game %>
30     <td><%=h item.due_date %></td>
31     <td><%=h number_to_currency(item.calculated_price) %></td>
32   <% else %>
33     <td></td>
34     <td><%=h number_to_currency(item.price) %></td>
35   <% end %>
36   </tr>
37 <% end %>
38 <% if @bonus %>
39   <tr>
40     <td><b>Bonus: </b><%=h @bonus.title %></td>
41     <td></td>
42     <td>- <%= number_to_currency(@bonus.calculated_price) %></td>
43   </tr>
44 <% end %>
45   <tr>
46     <td><b>Total</b></td>
47     <td></td>
48     <td><b><%= number_to_currency(@total) %></b></td>
49   </tr>
50 </table>
51
52 <br/>
53
54 <%= link_to 'Start a new Purchase', :action => 'begin' %>
55
56