View | Details | Raw Unified | Return to bug 18259
Collapse All | Expand All

(-)a/acqui/basket.pl (-7 / +7 lines)
Lines 134-143 if ( $op eq 'delete_confirm' ) { Link Here
134
            my $biblio = Koha::Biblios->find( $biblionumber );
134
            my $biblio = Koha::Biblios->find( $biblionumber );
135
            my $countbiblio = CountBiblioInOrders($biblionumber);
135
            my $countbiblio = CountBiblioInOrders($biblionumber);
136
            my $ordernumber = $myorder->{'ordernumber'};
136
            my $ordernumber = $myorder->{'ordernumber'};
137
            my $has_subscriptions = $biblio->subscriptions->count;
137
            my $cnt_subscriptions = $biblio->subscriptions->count;
138
            my $itemcount = $biblio->items->count;
138
            my $itemcount = $biblio->items->count;
139
            my $error;
139
            my $error;
140
            if ($countbiblio == 0 && $itemcount == 0 && not $has_subscriptions ) {
140
            if ($countbiblio == 0 && $itemcount == 0 && not $cnt_subscriptions ) {
141
                $error = DelBiblio($myorder->{biblionumber}) }
141
                $error = DelBiblio($myorder->{biblionumber}) }
142
            else {
142
            else {
143
                push @cannotdelbiblios, {biblionumber=> ($myorder->{biblionumber}),
143
                push @cannotdelbiblios, {biblionumber=> ($myorder->{biblionumber}),
Lines 145-151 if ( $op eq 'delete_confirm' ) { Link Here
145
                                         author=> $myorder->{'author'},
145
                                         author=> $myorder->{'author'},
146
                                         countbiblio=> $countbiblio,
146
                                         countbiblio=> $countbiblio,
147
                                         itemcount=>$itemcount,
147
                                         itemcount=>$itemcount,
148
                                         subscriptions => $has_subscriptions};
148
                                         subscriptions => $cnt_subscriptions};
149
            }
149
            }
150
            if ($error) {
150
            if ($error) {
151
                push @cannotdelbiblios, {biblionumber=> ($myorder->{biblionumber}),
151
                push @cannotdelbiblios, {biblionumber=> ($myorder->{biblionumber}),
Lines 474-493 sub get_order_infos { Link Here
474
        my $biblio = Koha::Biblios->find( $biblionumber );
474
        my $biblio = Koha::Biblios->find( $biblionumber );
475
        my $countbiblio = CountBiblioInOrders($biblionumber);
475
        my $countbiblio = CountBiblioInOrders($biblionumber);
476
        my $ordernumber = $order->{'ordernumber'};
476
        my $ordernumber = $order->{'ordernumber'};
477
        my $has_subscriptions = $biblio->subscriptions->count;
477
        my $cnt_subscriptions = $biblio->subscriptions->count;
478
        my $itemcount   = $biblio->items->count;
478
        my $itemcount   = $biblio->items->count;
479
        my $holds_count = $biblio->holds->count;
479
        my $holds_count = $biblio->holds->count;
480
        my @items = GetItemnumbersFromOrder( $ordernumber );
480
        my @items = GetItemnumbersFromOrder( $ordernumber );
481
        my $itemholds  = $biblio->holds->search({ itemnumber => { -in => \@items } })->count;
481
        my $itemholds  = $biblio->holds->search({ itemnumber => { -in => \@items } })->count;
482
482
483
        # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
483
        # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
484
        $line{can_del_bib}          = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !($has_subscriptions) && !($holds_count);
484
        $line{can_del_bib}          = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !($cnt_subscriptions) && !($holds_count);
485
        $line{items}                = ($itemcount) - (scalar @items);
485
        $line{items}                = ($itemcount) - (scalar @items);
486
        $line{left_item}            = 1 if $line{items} >= 1;
486
        $line{left_item}            = 1 if $line{items} >= 1;
487
        $line{left_biblio}          = 1 if $countbiblio > 1;
487
        $line{left_biblio}          = 1 if $countbiblio > 1;
488
        $line{biblios}              = $countbiblio - 1;
488
        $line{biblios}              = $countbiblio - 1;
489
        $line{left_subscription}    = 1 if $has_subscriptions;
489
        $line{left_subscription}    = 1 if $cnt_subscriptions;
490
        $line{subscriptions}        = $has_subscriptions;
490
        $line{subscriptions}        = $cnt_subscriptions;
491
        ($holds_count >= 1) ? $line{left_holds} = 1 : $line{left_holds} = 0;
491
        ($holds_count >= 1) ? $line{left_holds} = 1 : $line{left_holds} = 0;
492
        $line{left_holds_on_order}  = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
492
        $line{left_holds_on_order}  = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
493
        $line{holds}                = $holds_count;
493
        $line{holds}                = $holds_count;
(-)a/acqui/parcel.pl (-5 / +4 lines)
Lines 241-247 unless( defined $invoice->{closedate} ) { Link Here
241
        my $biblio = Koha::Biblios->find( $biblionumber );
241
        my $biblio = Koha::Biblios->find( $biblionumber );
242
        my $countbiblio = CountBiblioInOrders($biblionumber);
242
        my $countbiblio = CountBiblioInOrders($biblionumber);
243
        my $ordernumber = $line{'ordernumber'};
243
        my $ordernumber = $line{'ordernumber'};
244
        my $has_subscriptions = $biblio->subscriptions->count;
244
        my $cnt_subscriptions = $biblio->subscriptions->count;
245
        my $itemcount   = $biblio->items->count;
245
        my $itemcount   = $biblio->items->count;
246
        my $holds_count = $biblio->holds->count;
246
        my $holds_count = $biblio->holds->count;
247
        my @items = GetItemnumbersFromOrder( $ordernumber );
247
        my @items = GetItemnumbersFromOrder( $ordernumber );
Lines 253-265 unless( defined $invoice->{closedate} ) { Link Here
253
        $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby};
253
        $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby};
254
254
255
        # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
255
        # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
256
        $line{can_del_bib}          = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !($has_subscriptions) && !($holds_count);
256
        $line{can_del_bib}          = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !($cnt_subscriptions) && !($holds_count);
257
        $line{items}                = ($itemcount) - (scalar @items);
257
        $line{items}                = ($itemcount) - (scalar @items);
258
        $line{left_item}            = 1 if $line{items} >= 1;
258
        $line{left_item}            = 1 if $line{items} >= 1;
259
        $line{left_biblio}          = 1 if $countbiblio > 1;
259
        $line{left_biblio}          = 1 if $countbiblio > 1;
260
        $line{biblios}              = $countbiblio - 1;
260
        $line{biblios}              = $countbiblio - 1;
261
        $line{left_subscription}    = 1 if $has_subscriptions;
261
        $line{left_subscription}    = 1 if $cnt_subscriptions;
262
        $line{subscriptions}        = $has_subscriptions;
262
        $line{subscriptions}        = $cnt_subscriptions;
263
        $line{left_holds}           = ($holds_count >= 1) ? 1 : 0;
263
        $line{left_holds}           = ($holds_count >= 1) ? 1 : 0;
264
        $line{left_holds_on_order}  = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
264
        $line{left_holds_on_order}  = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
265
        $line{holds}                = $holds_count;
265
        $line{holds}                = $holds_count;
266
- 

Return to bug 18259