diff --git a/acqui/parcel.pl b/acqui/parcel.pl index b2eedabdb5..1c1736de4c 100755 --- a/acqui/parcel.pl +++ b/acqui/parcel.pl @@ -142,7 +142,6 @@ for (my $i = 0 ; $i < $countlines ; $i++) { $line{gst} = $gst; $line{total} = sprintf($cfstr, $total); $line{booksellerid} = $booksellerid; - push @loop_received, \%line; $totalprice += $parcelitems[$i]->{'unitprice'}; $line{unitprice} = sprintf($cfstr, $parcelitems[$i]->{'unitprice'}); @@ -151,6 +150,15 @@ for (my $i = 0 ; $i < $countlines ; $i++) { $line{surnamesuggestedby} = $suggestion->{surnamesuggestedby}; $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby}; + if ( $line{parent_ordernumber} != $line{ordernumber} ) { + if ( grep { $_->{ordernumber} == $line{parent_ordernumber} } + @parcelitems ) + { + $line{cannot_cancel} = 1; + } + } + + push @loop_received, \%line; #double FIXME - totalfreight is redefined later. # FIXME - each order in a parcel holds the freight for the whole parcel. This means if you receive a parcel with items from multiple budgets, you'll see the freight charge in each budget.. 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 39b1140a2b..d8ff600c4a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -170,11 +170,15 @@ Cannot cancel receipt. Possible reasons : [% END %] @@ -361,7 +365,22 @@ [% loop_receive.ecost %] [% loop_receive.unitprice %] [% loop_receive.total %] - Cancel receipt + + [% IF (loop_receive.cannot_cancel) %] + [% span_title = BLOCK %] + Cannot cancel receipt of this order line because it + was created from a partial receipt of order line no. + [% loop_receive.parent_ordernumber %], which is + already received. Try cancelling this one first and + retry. + [% END %] + + Can't cancel receipt + + [% ELSE %] + Cancel receipt + [% END %] + [% END %]