Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
77 lines (69 sloc) 2.05 KB
title: Order Details
<a id="back" href="javascript:history.back()">&#8592; Back</a>
{{#if id}}
{{ id | toInt | assignTo: id }}
{{ `select o."Id", "OrderDate", "CustomerId", "Freight",
${sqlConcat(['e."FirstName"', "' '", 'e."LastName"'])} as "Employee",
e."Id" as "EmployeeId",
s."CompanyName" as "ShipVia",
"ShipAddress", "ShipCity", "ShipPostalCode", "ShipCountry"
from "Order" o
inner join
"Employee" e on o."EmployeeId" = e."Id"
left join
"Shipper" s on o."ShipVia" = s."Id"
where o."Id" = @id`
| dbSingle({ id })
| assignTo: order
{{ `select p."ProductName",
${sqlCurrency('od."UnitPrice"')} "UnitPrice",
"Quantity", "Discount"
from "OrderDetail" od
inner join
"Product" p on od."ProductId" = p."Id"
where "OrderId" = @id`
| dbSelect({ id })
| assignTo: orderDetails
{{#with order}}
<table class="table table-bordered auto-width">
<td>{{ Id }}</td>
<td>{{ OrderDate | dateFormat }}</td>
<th>Customer Id</th>
<td><a href="customer?id={{ CustomerId }}">{{ CustomerId }}</a></td>
<td><a href="employee?id={{ EmployeeId }}">{{ Employee }}</a></td>
<th>Shipped by</th>
<td><a href="shippers">{{ ShipVia }}</a></td>
<th>Shipping Cost</th>
<td>{{ Freight | currency }}</td>
<th>Shipped to</th>
<p>{{ ShipAddress }}</p>
<p>{{ ShipCity }}, {{ ShipPostalCode }}, {{ ShipCountry }}</p>
{{ `There is no Order with id: ${id}` }}
{{ orderDetails | htmlDump({ className: "table table-striped", caption: "Line Items" }) }}