X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Froutetrade;h=21f4711cebfe0498d72f70ec7a2e66b7b25c49b0;hb=15a33b9bcca5a2932534c7ab5952961bf278faf8;hp=9cd57122d66b8fd421fd040dc00ee45abbf66422;hpb=43454422b2df5e0dcfe144fcb871a2b6f9c1a3d0;p=ypp-sc-tools.main.git diff --git a/yarrg/web/routetrade b/yarrg/web/routetrade index 9cd5712..21f4711 100644 --- a/yarrg/web/routetrade +++ b/yarrg/web/routetrade @@ -40,6 +40,7 @@ $dbh $qa $routeparams $reset_suppressions +$quri <& query_age:pageload &> @@ -291,6 +292,8 @@ my $oppo_key= sub { return join '_', map { $f->{$_} } qw(org_id dst_id commodid); }; +my $any_previous_suppression= 0; + foreach my $f (@flows) { $f->{MaxQty}= $f->{'org_qty_agg'} < $f->{'dst_qty_agg'} @@ -389,6 +392,7 @@ foreach my $f (@flows) { } } else { if (!defined $qa->{"T$f->{UidShort}"}) { + $any_previous_suppression= 1; $f->{Suppress}= 1; } } @@ -412,13 +416,24 @@ foreach my $f (@flows) { } -% my $optimise= $specific; -% if (!$optimise) { +% my $optimise= 1; -

% if (!$specific) { +% $optimise= 0; Route contains archipelago(es), not just specific islands. +% } elsif (!@subflows) { +% $optimise= 0; +% if ($any_previous_suppression) { +All available trades deselected. +% } else { +No available trades meet the specified minimum trade value, so +all available trades deselected. +% } % } + +% if (!$optimise) { + +

Therefore, optimal voyage trade plan not calculated. % } else { # ========== OPTMISATION ========== @@ -735,6 +750,7 @@ Generated by YARRG at <% orgArbitrage => 0, dstArbitrage => 0, } unless $$todo; + $$todo->{'commodid'}= $f->{'commodid'}; $$todo->{'commodname'}= $f->{'commodname'}; $$todo->{'posinclass'}= ''; my $incl= $f->{'posinclass'}; @@ -822,9 +838,13 @@ END % $total += $t->{Total}; % my $span= 0 + keys %{ $t->{Stalls} }; % my $td= "td rowspan=$span"; +% my %linkqf= (%{ $qa->{'baseqf'} }, %{ $qa->{'queryqf'} }); +% $linkqf{'query'}= 'commod'; +% $linkqf{'commodstring'}= $t->{'commodname'}; +% $linkqf{'commodid'}= $t->{'commodid'}; % tr_datarow($m,$dline); <<% $td %>><% $collectdeliver %> -<<% $td %>><% $t->{'commodname'} |h %> +<<% $td %>><% $t->{'commodname'} |h %> <<% $td %>><% $t->{'posinclass'} %> % % my @stalls= sort keys %{ $t->{Stalls} };