chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.web-live.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
printable trading plans
[ypp-sc-tools.web-live.git]
/
yarrg
/
web
/
routetrade
diff --git
a/yarrg/web/routetrade
b/yarrg/web/routetrade
index c6ed408d80fe9d779e54de724856c6abf02ab673..1f8df2a5afdb6eafd5215a38f71cce74ad03dce5 100644
(file)
--- a/
yarrg/web/routetrade
+++ b/
yarrg/web/routetrade
@@
-585,17
+585,23
@@
$addcols->({ Total => 0, DoReverse => 1, TotalSubflows => 1 }, qw(
% } # ========== OPTIMISATION ==========
% } # ========== OPTIMISATION ==========
+% if (!printable($m)) {
<h2>Contents</h2>
<ul>
% if ($optimise) {
<li><a href="#plan">Voyage trading plan</a>
<ul>
<li><a href="#summary">Summary statistics</a>
<h2>Contents</h2>
<ul>
% if ($optimise) {
<li><a href="#plan">Voyage trading plan</a>
<ul>
<li><a href="#summary">Summary statistics</a>
+ <li>Printable:
+ <input type=submit name=printable_pdf value="PDF">
+ <input type=submit name=printable_html value="HTML">
+ <input type=submit name=printable_ps value="PostScript">
</ul>
% }
<li><a href="#dataage">Data age summary</a>
<li><a href="#trades">Relevant trades</a>
</ul>
</ul>
% }
<li><a href="#dataage">Data age summary</a>
<li><a href="#trades">Relevant trades</a>
</ul>
+% }
% if ($optimise) { # ========== TRADING PLAN ==========
%
% if ($optimise) { # ========== TRADING PLAN ==========
%
@@
-781,7
+787,7
@@
Expected average profit:
%
% } # ========== TRADING PLAN ==========
%
% } # ========== TRADING PLAN ==========
-% {
+%
if (!printable($m))
{
<h2><a name="dataage">Data age summary</a></h2>
<%perl>
my $sth_i= $dbh->prepare(<<END);
<h2><a name="dataage">Data age summary</a></h2>
<%perl>
my $sth_i= $dbh->prepare(<<END);
@@
-825,10
+831,19
@@
END
<&| query_age:agestable, now => $now, fetchrow => $fetchrow &>
Islands shown in reverse order of visits.<br>
</&>
<&| query_age:agestable, now => $now, fetchrow => $fetchrow &>
Islands shown in reverse order of visits.<br>
</&>
+% } else {
+% my @tl= gmtime $now or die $!;
+<p>
+Generated by YARRG at <strong><%
+ sprintf "%04d-%02d-%02d %02d:%02d:%02d UTC",
+ $tl[5]+1900, @tl[4,3,2,1,0]
+ |h %></strong>.
+%#
% }
% }
-% my %ts_sortkeys;
-% {
+% if (!printable($m)) {
+% my %ts_sortkeys;
+% {
% my $cdspan= $qa->{ShowStalls} ? ' colspan=2' : '';
% my $cdstall= $qa->{ShowStalls} ? '<th>Stall</th>' : '';
<h2><a name="trades">Relevant trades</a></h2>
% my $cdspan= $qa->{ShowStalls} ? ' colspan=2' : '';
% my $cdstall= $qa->{ShowStalls} ? '<th>Stall</th>' : '';
<h2><a name="trades">Relevant trades</a></h2>
@@
-882,14
+897,14
@@
Islands shown in reverse order of visits.<br>
<th>Capital
<th>Profit
% }
<th>Capital
<th>Profit
% }
-% }
+%
}
<tr id="trades_sort">
<tr id="trades_sort">
-% foreach my $col (@cols) {
+%
foreach my $col (@cols) {
<th>
<th>
-% }
+%
}
-% foreach my $flowix (0..$#flows) {
+%
foreach my $flowix (0..$#flows) {
% my $flow= $flows[$flowix];
% my $rowid= "id_row_$flow->{UidShort}";
<tr id="<% $rowid %>" class="datarow<% $flowix & 1 %>">
% my $flow= $flows[$flowix];
% my $rowid= "id_row_$flow->{UidShort}";
<tr id="<% $rowid %>" class="datarow<% $flowix & 1 %>">
@@
-923,17
+938,17
@@
Islands shown in reverse order of visits.<br>
%>><% exists $spec->{String} ? $spec->{String} : $v |h %>
% $ci += $spec->{Span};
% }
%>><% exists $spec->{String} ? $spec->{String} : $v |h %>
% $ci += $spec->{Span};
% }
-% }
+%
}
<tr id="trades_total">
<th>
<th colspan=2>Total
<tr id="trades_total">
<th>
<th colspan=2>Total
-% foreach my $ci (3..$#cols) {
+%
foreach my $ci (3..$#cols) {
% my $col= $cols[$ci];
<td align=right>
% if (defined $col->{Total}) {
<% $col->{Total} |h %>
% }
% my $col= $cols[$ci];
<td align=right>
% if (defined $col->{Total}) {
<% $col->{Total} |h %>
% }
-% }
+%
}
</table>
<&| tabsort, cols => \@cols, table => 'trades', rowclass => 'datarow',
</table>
<&| tabsort, cols => \@cols, table => 'trades', rowclass => 'datarow',
@@
-943,6
+958,8
@@
Islands shown in reverse order of visits.<br>
<input type=submit name=update value="Update">
<input type=submit name=update value="Update">
+% } # !printable
+
<%init>
use CommodsWeb;
use Commods;
<%init>
use CommodsWeb;
use Commods;