Skip to content

Commit 17fa240

Browse files
committed
Add 'Total m3' column to BPCalc output
1 parent 9be869b commit 17fa240

2 files changed

Lines changed: 23 additions & 18 deletions

File tree

templates/thing/bpcalc.html

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@
8686

8787
{% block content %}
8888
<div class="row-fluid">
89-
<div class="span1">&nbsp;</div>
90-
<div class="span10">
89+
<div class="span12">
9190
<h2>Building</h2>
9291
<p>
9392
<a href="#" onclick="filter_profit();">filter profit &lt;</a> <input id="profit" type="text" value="5" class="input-mini">
@@ -106,11 +105,13 @@ <h2>Building</h2>
106105
<td colspan="3" class="head">From Sells</td>
107106
<td colspan="3" class="head">Sell</td>
108107
<td colspan="2" class="head">Volume</td>
108+
<td></td>
109109
</tr>
110110
<tr class="c">
111111
<th class="l">Name</th>
112112
<th>Runs</th>
113113
<th>Time</th>
114+
<th>Total m3</th>
114115
<th>Build</th>
115116
<th>Profit</th>
116117
<th>P%</th>
@@ -122,26 +123,28 @@ <h2>Building</h2>
122123
<th>Total</th>
123124
<th>Week</th>
124125
<th>%</th>
126+
<th></th>
125127
</tr>
126128
</thead>
127129
<tbody>
128130
{% for bpi in bpis %}
129-
<tr data_bpi="{{ bpi.id }}">
130-
<td>{{ bpi.blueprint.item }}</td>
131-
<td class="r">{{ bpi.z_runs|commas }}</td>
132-
<td class="r">{{ bpi.z_total_time|duration }}</td>
133-
<td class="r" class="alt">{{ bpi.z_buy_build|humanize }}</td>
134-
<td class="r" class="alt">{{ bpi.z_buy_profit|humanize|balance }}</td>
135-
<td class="r" class="alt">{{ bpi.z_buy_profit_per|spanif:"neg < 7" }}%</td>
136-
<td class="r">{{ bpi.z_sell_build|humanize }}</td>
137-
<td class="r">{{ bpi.z_sell_profit|humanize|balance }}</td>
138-
<td class="r">{{ bpi.z_sell_profit_per|spanif:"neg < 7" }}%</td>
139-
<td class="r" class="alt">{{ bpi.z_built|commas }}</td>
140-
<td class="r" class="alt">{{ bpi.blueprint.item.sell_price|humanize }}</td>
141-
<td class="r" class="alt">{{ bpi.z_total_sell|humanize }}</td>
142-
<td class="r">{{ bpi.z_volume_week|humanize }}</td>
143-
<td class="r">{{ bpi.z_volume_percent|spanif:"neg > 10" }}%</td>
144-
<td class="r"><input type="checkbox"></td>
131+
<tr class="r" data_bpi="{{ bpi.id }}">
132+
<td class="l">{{ bpi.blueprint.item }}</td>
133+
<td>{{ bpi.z_runs|commas }}</td>
134+
<td>{{ bpi.z_total_time|duration }}</td>
135+
<td>{{ bpi.z_total_m3|commas }} m<sup>3</sup></td>
136+
<td>{{ bpi.z_buy_build|humanize }}</td>
137+
<td>{{ bpi.z_buy_profit|humanize|balance }}</td>
138+
<td>{{ bpi.z_buy_profit_per|spanif:"neg < 7" }}%</td>
139+
<td>{{ bpi.z_sell_build|humanize }}</td>
140+
<td>{{ bpi.z_sell_profit|humanize|balance }}</td>
141+
<td>{{ bpi.z_sell_profit_per|spanif:"neg < 7" }}%</td>
142+
<td>{{ bpi.z_built|commas }}</td>
143+
<td>{{ bpi.blueprint.item.sell_price|humanize }}</td>
144+
<td>{{ bpi.z_total_sell|humanize }}</td>
145+
<td>{{ bpi.z_volume_week|humanize }}</td>
146+
<td>{{ bpi.z_volume_percent|spanif:"neg > 10" }}%</td>
147+
<td><input type="checkbox"></td>
145148
</tr>
146149
{% empty %}
147150
<tr>

thing/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ def bpcalc(request):
335335
if bpi.z_volume_week:
336336
bpi.z_volume_percent = (bpi.z_built / bpi.z_volume_week * 100).quantize(Decimal('.1'))
337337

338+
bpi.z_total_m3 = bpi.blueprint.item.volume * built
339+
338340
# Update totals
339341
bpi_totals['total_sell'] += bpi.z_total_sell
340342
bpi_totals['buy_build'] += bpi.z_buy_build

0 commit comments

Comments
 (0)