chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.main.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement constraint on available capital
[ypp-sc-tools.main.git]
/
yarrg
/
web
/
query_route
diff --git
a/yarrg/web/query_route
b/yarrg/web/query_route
index 9a6ca0829114c622552209991c1fb6e1901094f4..81e91bcca2334c023edefb73060f544ebb77c08c 100644
(file)
--- a/
yarrg/web/query_route
+++ b/
yarrg/web/query_route
@@
-40,6
+40,7
@@
$prselector
$routestring => '';
$capacitystring => '';
$lossperleague => '';
$routestring => '';
$capacitystring => '';
$lossperleague => '';
+$capitalstring => '';
$someresults
$emsgokorprint
</%args>
$someresults
$emsgokorprint
</%args>
@@
-51,6
+52,7
@@
my @islandids;
my %islandid2;
my ($max_volume, $max_mass);
my $lossperleaguepct;
my %islandid2;
my ($max_volume, $max_mass);
my $lossperleaguepct;
+my $capital;
my $qa= \%ARGS;
my $qa= \%ARGS;
@@
-119,7
+121,20
@@
Expected losses:
&>
size=9
</&>
&>
size=9
</&>
+</tr>
+<tr>
+<td>Available capital:
+
+<&| qtextstring, qa => $qa, dbh => $dbh, prefix => 'ac',
+ thingstring => 'capitalstring', emsgstore => \$emsg,
+ helpref => 'capital',
+ perresult => sub { ($capital)= @_; }
+ &>
+ size=9
+</&>
+</td>
+</tr>
</table>
% } else { #---------- dropdowns, user selects from menus ----------
</table>
% } else { #---------- dropdowns, user selects from menus ----------
@@
-220,7
+235,7
@@
function ms_Setarch(dd) {
<input type=submit name=submit value="<% $goupdate->() %>">
% my $ours= sub { $_[0] =~
<input type=submit name=submit value="<% $goupdate->() %>">
% my $ours= sub { $_[0] =~
-% m/^island|^archipelago|^routestring|^capacitystring|^lossperleague|^[RT]/;
+% m/^island|^archipelago|^routestring|^capacitystring|^lossperleague|^
capitalstring|^
[RT]/;
% };
<& "lookup:formhidden", ours => $ours &>
% };
<& "lookup:formhidden", ours => $ours &>
@@
-268,7
+283,8
@@
for my $dd (0..$qa->{Dropdowns}-1) {
qa => $qa,
max_mass => $max_mass,
max_volume => $max_volume,
qa => $qa,
max_mass => $max_mass,
max_volume => $max_volume,
- lossperleaguepct => $lossperleaguepct
+ lossperleaguepct => $lossperleaguepct,
+ max_capital => $capital
&>
</form>
% }
&>
</form>
% }