$line{basketno} = $basketno;
$line{budget_name} = $budget->{budget_name};
- $line{total_tax_included} = get_rounded_price($line{ecost_tax_included}) * $line{quantity};
- $line{total_tax_excluded} = get_rounded_price($line{ecost_tax_excluded}) * $line{quantity};
+ # If we have an actual cost tht should be the total, otherwise use the ecost
+ my $cost_tax_included = $line{unitprice_tax_included} || $line{ecost_tax_included};
+ my $cost_tax_excluded = $line{unitprice_tax_excluded} || $line{ecost_tax_excluded};
+ $line{total_tax_included} = get_rounded_price($cost_tax_included) * $line{quantity};
+ $line{total_tax_excluded} = get_rounded_price($cost_tax_excluded) * $line{quantity};
$line{tax_value} = $line{tax_value_on_ordering};
$line{tax_rate} = $line{tax_rate_on_ordering};
<th>No.</th>
<th>Order</th>
<th>RRP tax exc.</th>
+ <th>Actual cost tax exc.</th>
<th>ecost tax exc.</th>
<th>RRP tax inc.</th>
+ <th>Actual cost tax inc.</th>
<th>ecost tax inc.</th>
<th>Replacement price</th>
<th>Qty.</th>
<th> </th>
<th> </th>
<th> </th>
+ <th> </th>
+ <th> </th>
<th>[% foot_loo.quantity | html %]</th>
<th>[% foot_loo.total_tax_excluded | $Price %]</th>
<th>[% foot_loo.total_tax_included | $Price %]</th>
<th> </th>
<th> </th>
<th> </th>
+ <th> </th>
+ <th> </th>
<th>[% total_quantity | html %]</th>
<th>[% total_tax_excluded | $Price %]</th>
<th>[% total_tax_included | $Price %]</th>
[% SET zero_regex = "^0{1,}\.?0{1,}[^1-9]" %] [%# 0 or 0.0 or 0.00 or 00 or 00.0 or 00.00 or 0.000 ... %]
[%# FIXME: use of a regexp is not ideal; bugs 9410 and 10929 suggest better way of handling this %]
<td class="number [% IF books_loo.rrp_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.rrp_tax_excluded | $Price %]</td>
+ <td class="number [% IF books_loo.unitprice_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.unitprice_tax_excluded | $Price %]</td>
<td class="number [% IF books_loo.ecost_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.ecost_tax_excluded | $Price %]</td>
<td class="number [% IF books_loo.rrp_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.rrp_tax_included | $Price %]</td>
+ <td class="number [% IF books_loo.unitprice_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.unitprice_tax_included | $Price %]</td>
<td class="number [% IF books_loo.ecost_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.ecost_tax_included | $Price %]</td>
<td class="number [% IF books_loo.replacementprice.search(zero_regex) %]error[% END %]">[% books_loo.replacementprice | $Price %]</td>
<td class="number [% IF books_loo.quantity.search(zero_regex) %]error[% END %]">[% books_loo.quantity | html %]</td>