X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Froutetrade;h=9a6824e97ced58bb08b3e84b11e43f975fe8505f;hb=099cd920655c1db6da4a1a57ec3baa30d16321d7;hp=4885782e58a440b7a773510a049daf363e5e0838;hpb=59bee7afb77216585b904bd20f17e71005e9778c;p=ypp-sc-tools.db-live.git diff --git a/yarrg/web/routetrade b/yarrg/web/routetrade index 4885782..9a6824e 100644 --- a/yarrg/web/routetrade +++ b/yarrg/web/routetrade @@ -38,11 +38,24 @@ $dbh @islandids @archipelagoes $qa +$max_mass +$max_volume +$lossperleaguepct %args> <&| script &> da_pageload= Date.now(); &script> +% if (defined $max_mass || defined $max_volume) { +WARNING - VESSEL CAPACITY LIMIT NOT YET IMPLEMENTED +
+% } +% if (defined $lossperleaguepct) { +WARNING - DEFINED LOSS PER LEAGUE NOT YET IMPLEMENTED +<% $lossperleaguepct |h %> +
+% } + <%perl> my $now= time; @@ -205,9 +218,12 @@ $addcols->({ DoReverse => 1, SortColKey => 'MarginSortKey' }, qw( Margin )); $addcols->({ DoReverse => 1 }, - qw( unitprofit dist MaxQty - MaxCapital MaxProfit + qw( unitprofit MaxQty MaxCapital MaxProfit dist )); +foreach my $v (qw(MaxMass MaxVolume)) { + $addcols->({ + DoReverse => 1, Total => 0, SortColKey => "${v}SortKey" }, $v); +} %perl> @@ -269,6 +285,12 @@ foreach my $f (@flows) { $f->{MaxProfit}= $f->{MaxQty} * $f->{'unitprofit'}; $f->{MaxCapital}= $f->{MaxQty} * $f->{'org_price'}; + $f->{MaxMassSortKey}= $f->{MaxQty} * $f->{'unitmass'}; + $f->{MaxVolumeSortKey}= $f->{MaxQty} * $f->{'unitvolume'}; + foreach my $v (qw(Mass Volume)) { + $f->{"Max$v"}= sprintf "%.1f", $f->{"Max${v}SortKey"} * 1e-6; + } + $f->{MarginSortKey}= sprintf "%d", $f->{'dst_price'} * 10000 / $f->{'org_price'}; $f->{Margin}= sprintf "%3.1f%%", @@ -486,7 +508,7 @@ $addcols->({ Total => 0, DoReverse => 1 }, qw(