Skip to content
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
76 lines (67 sloc) 1.99 KB
title: Order Details
<a id="back" href="javascript:history.back()">&#8592; Back</a>
{{#if 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 ${sqlQuote("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" }) }}
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.