From dc81ef86f78ca6bab4d64cd8ef5719edca24d256 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 23 Aug 2009 16:03:05 +0100 Subject: [PATCH] Improve presentation --- yarrg/web/routetrade | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/yarrg/web/routetrade b/yarrg/web/routetrade index e200aa5..45e0f81 100644 --- a/yarrg/web/routetrade +++ b/yarrg/web/routetrade @@ -148,9 +148,10 @@ if ($qa->{ShowStalls}) { } else { push @columns, qw(org_name dst_name); } +my $ntextcolumns= @columns+1; push @columns, qw(commodname - org_price org_qty dst_price dst_qty - unitprofit PctProfit + org_qty org_price dst_qty dst_price + Margin unitprofit MaxQty MaxCapital MaxProfit); @@ -176,7 +177,7 @@ push @columns, qw(commodname $f->{MaxProfit}= $f->{MaxQty} * $f->{'unitprofit'}; $f->{MaxCapital}= $f->{MaxQty} * $f->{'org_price'}; - $f->{PctProfit}= sprintf "%3.1f%%", + $f->{Margin}= sprintf "%3.1f%%", $f->{'dst_price'} * 100.0 / $f->{'org_price'} - 100.0; $f->{"org_stallid"}= $f->{"dst_stallid"}= 'all' @@ -373,7 +374,18 @@ push @columns, qw(OptQty OptCapital OptProfit); % { % my $cdspan= $qa->{ShowStalls} ? ' colspan=2' : ''; % my $cdstall= $qa->{ShowStalls} ? 'Stall' : ''; - +
+++<% $qa->{ShowStalls} ? '' : '' %> ++++++% if ($optimise) { ++% }
>Collect @@ -392,12 +404,12 @@ push @columns, qw(OptQty OptCapital OptProfit); Island <% $cdstall %> Island <% $cdstall %> Commodity -Price Qty Price Qty -Unit +Price Margin +Unit Qty Capital Profit @@ -413,8 +425,12 @@ push @columns, qw(OptQty OptCapital OptProfit); {UidShort} %> value=""> {UidShort} %> value="" <% $flow->{Suppress} ? '' : 'checked' %> > -% foreach my $col (@columns) { -<% $flow->{$col} |h %> +% foreach my $ci (0..$#columns) { +% my $col= $columns[$ci]; +% my $v= $flow->{$col}; +% my $isnum= $ci >= $ntextcolumns; +% $v='' if $isnum && !$v; +><% $v |h %> % } % }
-- 2.30.2