From 43c504c8a05e014fa0eb45a163eeeac59c3038c4 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Sat, 24 Mar 2018 00:35:55 +0000 Subject: [PATCH] Bug 19780 - Updating the invoice costs after updating the actual cost of an order following the receival of the order This patch builds on the previous patch attached to the bug report 19780. The purpose of this patch is to fix the current bug in Koha which is if you have accidently written in the incorrect value into an order receival form then try to correct the value by clicking on the order line link and writing in a new value into the actual value input field of the order and then save the form and go and view the invoice you notice that the invoice amount has not been updated to match the newly entered actual value of the order. This bug was reported by Horowhenua District Library Now with this patch after clicking on the order line link and writing in a new actual value for a received order the database is correctly updated with the new actual value and if you now view the appropriate invoice for that order you will notice that the invoice amount has been updated. To make the testing of this patch easier I have made a before and after screencast video to compliment the test plan. Updated test plan: 1. Create an order with the vendor price: 10.00 and actual price of 12.00 2. Close the order and receive the shipment. Change the actual price in the receival page to 14.00 3. Open a new tab and view the invoice for the newly received order and notice that 14.00 is the value displayed 4. In your first tab now click on the order line link to modify the order. Change the actual price to 15.00 5. View the invoice now and notice that 14.00 is still the value being displayed 6. Apply patch 7. Repeat steps 1,2,3,4 and 5 and notice that 15.00 is the value displayed in the invoice Sponsored-By: Catalyst IT --- acqui/addorder.pl | 7 +++---- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/acqui/addorder.pl b/acqui/addorder.pl index 6fa0e01..ef34c07 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -131,7 +131,6 @@ use C4::Output; use Koha::Acquisition::Currencies; use Koha::Acquisition::Orders; use C4::Barcodes; -use Data::Dumper; ### "-------------------- addorder.pl ----------" # FIXME: This needs to do actual error checking and possibly return user to the same form, @@ -268,12 +267,12 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { $orderinfo->{unitprice} = $orderinfo->{ecost} if not defined $orderinfo->{unitprice} or $orderinfo->{unitprice} eq ''; my $modify = $input->param('modify'); - if ($orderinfo->{ordernumber} && !$modify) { + if (!$modify) { $orderinfo = C4::Acquisition::populate_order_with_prices( { order => $orderinfo, booksellerid => $orderinfo->{booksellerid}, - receiving => 1, + ordering => 1, } ); } elsif ( $modify ) { @@ -281,7 +280,7 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { { order => $orderinfo, booksellerid => $orderinfo->{booksellerid}, - ordering => 1, + receiving => 1, } ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt index c74070f..19030de 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -487,7 +487,7 @@ [% IF ( active ) %] [% UNLESS ( closedate ) %] - Modify + Modify [% UNLESS (books_loo.order_received) %]
Transfer diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt index 2790d5a..b472a8f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -275,7 +275,7 @@ [% END %] - [% order.ordernumber %] + [% order.ordernumber %] [% IF (order.parent_ordernumber && (order.parent_ordernumber != order.ordernumber)) %] ([% order.parent_ordernumber %]) [% END %] -- 2.1.4