Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (68 sloc) 2.02 KB
title: Order Details
<a id="back" href="javascript:history.back()">&#8592; Back</a>
{{ 'id' | importRequestParams }}
{{#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.