chiark / gitweb /
Do not display number available in trading plan
[ypp-sc-tools.db-test.git] / yarrg / web / routetrade
index 91ff421625fd7d4757a6def0a6e471341ac073e1..4dbe36e95c533e95cfecce13497c3baba0df66b4 100644 (file)
@@ -259,6 +259,11 @@ foreach my $f (@flows) {
        $f->{MaxProfit}= $f->{MaxQty} * $f->{'unitprofit'};
        $f->{MaxCapital}= $f->{MaxQty} * $f->{'org_price'};
 
+       $f->{MarginSortKey}= sprintf "%d",
+               $f->{'dst_price'} * 10000 / $f->{'org_price'};
+       $f->{Margin}= sprintf "%3.1f%%",
+               $f->{'dst_price'} * 100.0 / $f->{'org_price'} - 100.0;
+
        $f->{ExpectedUnitProfit}=
                $f->{'dst_price'} * (1.0 - $loss_per_league) ** $f->{'dist'}
                - $f->{'org_price'};
@@ -595,7 +600,7 @@ Sail to <% $islandname |h %>
 %              my $age= $now - (values %todo)[0]->{Timestamp};
 %              my $cellid= "da_${i}";
 %              $da_ages{$cellid}= $age;
-<td colspan=2>\
+<td colspan=3 align=right>\
 (Data age: <span id="<% $cellid %>"><% prettyprint_age($age) %></span>)
 %      }
 %      my $total= 0;
@@ -612,13 +617,11 @@ Sail to <% $islandname |h %>
 %              my @stalls= sort keys %{ $t->{Stalls} };
 %              my $pstall= sub {
 %                      my $name= $stalls[$_[0]];
-%                      my $avail= $t->{Stalls}{$name};
-<td align=right><% $avail |h %> <% $od eq 'org' ? 'avail.' : 'wanted' %>
 <td><% $name |h %>
 %              };
 %
 %              $pstall->(0);
-<<% $td %> align=right><% $t->{Price} |h %> each
+<<% $td %> align=right><% $t->{Price} |h %> poe ea.
 <<% $td %> align=right><% $t->{Qty} |h %> unit(s)
 <<% $td %> align=right><% $t->{Total} |h %> total
 %
@@ -631,7 +634,7 @@ Sail to <% $islandname |h %>
 %      }
 %      if (%todo) {
 <tr>
-<td colspan=5><td align=right><% $od eq 'org' ? 'Outlay' : 'Proceeds' %>
+<td colspan=4><td align=right><% $od eq 'org' ? 'Outlay' : 'Proceeds' %>
 <td align=right><% $total |h %> total
 %      }
 %    }