@@ -, +, @@ actual value post receiving of the order --- acqui/addorder.pl | 27 +++++++++++++++------- acqui/neworderempty.pl | 7 ++++++ .../intranet-tmpl/prog/en/modules/acqui/basket.tt | 2 +- .../prog/en/modules/acqui/neworderempty.tt | 3 +++ 4 files changed, 30 insertions(+), 9 deletions(-) --- a/acqui/addorder.pl +++ a/acqui/addorder.pl @@ -132,7 +132,7 @@ 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,13 +268,24 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { $orderinfo->{unitprice} = $orderinfo->{ecost} if not defined $orderinfo->{unitprice} or $orderinfo->{unitprice} eq ''; - $orderinfo = C4::Acquisition::populate_order_with_prices( - { - order => $orderinfo, - booksellerid => $orderinfo->{booksellerid}, - ordering => 1, - } - ); + my $modify = $input->param('modify'); + if ($orderinfo->{ordernumber} && !$modify) { + $orderinfo = C4::Acquisition::populate_order_with_prices( + { + order => $orderinfo, + booksellerid => $orderinfo->{booksellerid}, + receiving => 1, + } + ); + } elsif ( $modify ) { + $orderinfo = C4::Acquisition::populate_order_with_prices( + { + order => $orderinfo, + booksellerid => $orderinfo->{booksellerid}, + ordering => 1, + } + ); + } # if we already have $ordernumber, then it's an ordermodif my $order = Koha::Acquisition::Order->new($orderinfo); --- a/acqui/neworderempty.pl +++ a/acqui/neworderempty.pl @@ -106,6 +106,7 @@ my $close = $input->param('close'); my $uncertainprice = $input->param('uncertainprice'); my $import_batch_id = $input->param('import_batch_id'); # if this is filled, we come from a staged file, and we will return here after saving the order ! my $subscriptionid = $input->param('subscriptionid'); +my $modify = $input->param('modifying'); my $data; my $new = 'no'; @@ -300,6 +301,12 @@ my $quantity = $input->param('rr_quantity_to_order') ? $data->{'quantity'}; $quantity //= 0; +if ($modify) { + $template->param( + modify => $modify + ); +} + $template->param( existing => $biblionumber, ordernumber => $ordernumber, --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -646,7 +646,7 @@ [% IF ( active ) %] [% UNLESS ( closedate ) %] - Modify + Modify [% UNLESS (books_loo.order_received) %]
Transfer --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -641,6 +641,9 @@ $(document).ready(function()
+ [% IF (modify) %] + + [% END %] [% IF (suggestionid) %] Cancel --