+% {
+% my $cdspan= $qa->{ShowStalls} ? ' colspan=2' : '';
+% my $cdstall= $qa->{ShowStalls} ? '<th>Stall</th>' : '';
+<table>
+<tr>
+<th<% $cdspan %>>Collect
+<th<% $cdspan %>>Deliver
+<th>
+<th colspan=2>Collect
+<th colspan=2>Deliver
+<th colspan=2>Profit
+<th colspan=3>Max
+% if ($optimise) {
+<th colspan=3>Suggested
+% }
+
+<tr>
+<th>Island <% $cdstall %>
+<th>Island <% $cdstall %>
+<th>Commodity
+<th>Price
+<th>Qty
+<th>Price
+<th>Qty
+<th>Unit
+<th>Margin
+<th>Qty
+<th>Capital
+<th>Profit
+% if ($optimise) {
+<th>Qty
+<th>Capital
+<th>Profit
+% }
+% }
+
+% foreach my $flow (@flows) {
+<tr>
+% foreach my $col (@columns) {
+% $flow->{MaxQty}= $flow->{'org_qty'} < $flow->{'dst_qty'}
+% ? $flow->{'org_qty'} : $flow->{'dst_qty'};
+% $flow->{MaxProfit}= $flow->{MaxQty} * $flow->{'unitprofit'};
+% $flow->{PctProfit}= sprintf "%3.1f%%",
+% $flow->{'dst_price'} * 100.0 / $flow->{'org_price'}
+% - 100.0;
+% $flow->{MaxCapital}= $flow->{MaxQty} * $flow->{'org_price'};
+<td><% $flow->{$col} |h %>
+% }
+% }
+</table>
+