Bug 23294: Show actual price when ordering
authorNick Clemens <nick@bywatersolutions.com>
Mon, 15 Jul 2019 18:29:45 +0000 (18:29 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 20 Aug 2019 14:01:13 +0000 (15:01 +0100)
To test:
1 - Have a basket
2 - Add an order
3 - Modify the order, note you cannot see the unitprice/Actual cost
4 - Apply patch
5 - Note it is there
6 - Add to IntranetUserCSS:
    .ordering_unitprice{ display:none; }
7 - Reload
8 - Note it is hidden

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

acqui/neworderempty.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt

index 29acca7..862719b 100755 (executable)
@@ -375,6 +375,7 @@ if ( defined $from_subscriptionid ) {
         $data->{replacementprice} = $lastOrderReceived->{replacementprice};
         $data->{ecost}          = $lastOrderReceived->{ecost};
         $data->{quantity}       = $lastOrderReceived->{quantity};
+        $data->{unitprice}       = $lastOrderReceived->{unitprice};
         $data->{order_internalnote} = $lastOrderReceived->{order_internalnote};
         $data->{order_vendornote}   = $lastOrderReceived->{order_vendornote};
         $data->{sort1}          = $lastOrderReceived->{sort1};
@@ -465,6 +466,7 @@ $template->param(
     listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
     total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
     ecost            => sprintf( "%.2f", $data->{ecost} || 0),
+    unitprice        => sprintf( "%.2f", $data->{unitprice} || 0),
     publishercode    => $data->{'publishercode'},
     barcode_subfield => $barcode_subfield,
     import_batch_id  => $import_batch_id,
index df96f1a..04a41a9 100644 (file)
                 <label for="total">Total: </label>
                 <input type="text" id="total" size="20" name="total" value="[% total | html %]" readonly="readonly" /> (budgeted cost * quantity)
             </li>
+            <li class="ordering_unitprice">
+                <label for="unitprice">Actual cost: </label>
+                <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice | html %]" />
+                [% IF (invoiceincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
+            </li>
             <li>
                 <label for="order_internalnote">Internal note: </label>
                 <textarea id="order_internalnote" cols="30" rows="3" name="order_internalnote" >[% IF ( order_internalnote ) %][% order_internalnote | html %][% END %]</textarea>