Bug 23522: Show actual price on in baskets

To test:
 1 - Create a new basket in acq, mark it as 'standing'
 2 - Add an item, leave the RRP and Vendor price as 0
 3 - Receive shipments for the vendor
 4 - Select the title from this basket
 5 - On receipt enter an actual cost
 6 - Finsih receiving
 7 - Go to the basket
 8 - Note the total for the order and the basket are 0, keep this browser tab open
 9 - Open a new browser tab and create a new non standing basket
10 - Add to basket, again with no RRP or vendor price
11 - Close the basket, receive the item
12 - Enter an actual cost on receipt
13 - Return to view the basket
14 - Total and order are $0
15 - Apply patch
16 - Refresh the basket in both tabs
17 - You now see the actual price for the orders

Signed-off-by: Rhonda Kuiper <rkuiper@roundrocktexas.gov>
Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2019-08-29 14:51:16 +00:00 committed by Martin Renvoize
parent 025f9ebe80
commit 39bc68c90b
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
2 changed files with 13 additions and 2 deletions

View file

@ -459,8 +459,11 @@ sub get_order_infos {
$line{basketno} = $basketno; $line{basketno} = $basketno;
$line{budget_name} = $budget->{budget_name}; $line{budget_name} = $budget->{budget_name};
$line{total_tax_included} = get_rounded_price($line{ecost_tax_included}) * $line{quantity}; # If we have an actual cost tht should be the total, otherwise use the ecost
$line{total_tax_excluded} = get_rounded_price($line{ecost_tax_excluded}) * $line{quantity}; 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_value} = $line{tax_value_on_ordering};
$line{tax_rate} = $line{tax_rate_on_ordering}; $line{tax_rate} = $line{tax_rate_on_ordering};

View file

@ -395,8 +395,10 @@
<th>No.</th> <th>No.</th>
<th>Order</th> <th>Order</th>
<th>RRP tax exc.</th> <th>RRP tax exc.</th>
<th>Actual cost tax exc.</th>
<th>ecost tax exc.</th> <th>ecost tax exc.</th>
<th>RRP tax inc.</th> <th>RRP tax inc.</th>
<th>Actual cost tax inc.</th>
<th>ecost tax inc.</th> <th>ecost tax inc.</th>
<th>Replacement price</th> <th>Replacement price</th>
<th>Qty.</th> <th>Qty.</th>
@ -424,6 +426,8 @@
<th>&nbsp;</th> <th>&nbsp;</th>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>[% foot_loo.quantity | html %]</th> <th>[% foot_loo.quantity | html %]</th>
<th>[% foot_loo.total_tax_excluded | $Price %]</th> <th>[% foot_loo.total_tax_excluded | $Price %]</th>
<th>[% foot_loo.total_tax_included | $Price %]</th> <th>[% foot_loo.total_tax_included | $Price %]</th>
@ -447,6 +451,8 @@
<th>&nbsp;</th> <th>&nbsp;</th>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>[% total_quantity | html %]</th> <th>[% total_quantity | html %]</th>
<th>[% total_tax_excluded | $Price %]</th> <th>[% total_tax_excluded | $Price %]</th>
<th>[% total_tax_included | $Price %]</th> <th>[% total_tax_included | $Price %]</th>
@ -519,8 +525,10 @@
[% 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 ... %] [% 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 %] [%# 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.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.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.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.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.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> <td class="number [% IF books_loo.quantity.search(zero_regex) %]error[% END %]">[% books_loo.quantity | html %]</td>