@@ -, +, @@ can't --- acqui/parcel.pl | 10 ++++++- .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 29 ++++++++++++++++---- 2 files changed, 33 insertions(+), 6 deletions(-) --- a/acqui/parcel.pl +++ a/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.. --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt @@ -166,11 +166,15 @@ Cannot cancel receipt. Possible reasons : [% END %] @@ -357,7 +361,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 %] --