diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl index ca50496451..79b6326bff 100755 --- a/acqui/finishreceive.pl +++ b/acqui/finishreceive.pl @@ -61,7 +61,8 @@ my $new_ordernumber = $ordernumber; $unitprice = Koha::Number::Price->new( $unitprice )->unformat(); $replacementprice = Koha::Number::Price->new( $replacementprice )->unformat(); -my $basket = Koha::Acquisition::Orders->find( $ordernumber )->basket; +my $order_obj = Koha::Acquisition::Orders->find( $ordernumber ); +my $basket = $order_obj->basket; #need old receivedate if we update the order, parcel.pl only shows the right parcel this way FIXME if ($quantityrec > $origquantityrec ) { @@ -100,6 +101,10 @@ if ($quantityrec > $origquantityrec ) { # save the quantity received. if ( $quantityrec > 0 ) { + if ( $order_obj->subscriptionid ) { + # Quantity can only be modified if linked to a subscription + $order->{quantity} = $quantity; # quantityrec will be deduced from this value in ModReceiveOrder + } ( $datereceived, $new_ordernumber ) = ModReceiveOrder( { biblionumber => $biblionumber, diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index 1db00d3e58..ebf29f703e 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -197,6 +197,18 @@ my @gst_values = map { option => $_ + 0.0 }, split( '\|', C4::Context->preference("gist") ); +if ( $order->{subscriptionid} ) { + # Order from a subscription, we will display an history of what has been received + my $orders = Koha::Acquisition::Orders->search( + { + subscriptionid => $order->{subscriptionid}, + parent_ordernumber => $order->{ordernumber}, + ordernumber => { '!=' => $order->{ordernumber} } + } + ); + $template->param( orders => $orders ); +} + $template->param( AcqCreateItem => $AcqCreateItem, count => 1, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt index 1ae2f3b666..ab07b1a89a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -303,14 +303,16 @@ [% quantity | html %] [% ELSE %] - [% IF (AcqCreateItemOrdering) %] - [% IF subscriptionid || basket.is_standing %] + [% IF subscriptionid %] + + [% ELSIF AcqCreateItemOrdering %] + [% IF basket.is_standing %] [% ELSE %] [% END %] [% ELSE %] - [% IF subscriptionid || basket.is_standing %] + [% IF basket.is_standing %] [% ELSE %] @@ -622,7 +624,7 @@ }); //We apply the fonction only for modify option - [% IF ( quantityrec ) %] + [% IF ( quantityrec and not subscriptionid ) %] [% IF ( acqcreate ) %] $('#quantity').blur(function(){ // if user decreases the quantity diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt index 9c7e702bc7..abe2d16a5f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -54,7 +54,62 @@ [% END %] - [% IF (AcqCreateItemReceiving) %] + [% IF subscriptionid and orders.count %] +
+ [% ELSIF (AcqCreateItemReceiving) %]