Lines 463-489
sub get_order_infos {
Link Here
|
463 |
} |
463 |
} |
464 |
|
464 |
|
465 |
my $biblionumber = $order->{'biblionumber'}; |
465 |
my $biblionumber = $order->{'biblionumber'}; |
466 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
466 |
if ( $biblionumber ) { # The biblio still exists |
467 |
my $countbiblio = CountBiblioInOrders($biblionumber); |
467 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
468 |
my $ordernumber = $order->{'ordernumber'}; |
468 |
my $countbiblio = CountBiblioInOrders($biblionumber); |
469 |
my @subscriptions = GetSubscriptionsId ($biblionumber); |
469 |
my $ordernumber = $order->{'ordernumber'}; |
470 |
my $itemcount = $biblio->items->count; |
470 |
my @subscriptions = GetSubscriptionsId ($biblionumber); |
471 |
my $holds_count = $biblio->holds->count; |
471 |
my $itemcount = $biblio->items->count; |
472 |
my @items = GetItemnumbersFromOrder( $ordernumber ); |
472 |
my $holds_count = $biblio->holds->count; |
473 |
my $itemholds = $biblio ? $biblio->holds->search({ itemnumber => { -in => \@items } })->count : 0; |
473 |
my @items = GetItemnumbersFromOrder( $ordernumber ); |
474 |
|
474 |
my $itemholds = $biblio->holds->search({ itemnumber => { -in => \@items } })->count; |
475 |
# 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 |
475 |
|
476 |
$line{can_del_bib} = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds_count); |
476 |
# 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 |
477 |
$line{items} = ($itemcount) - (scalar @items); |
477 |
$line{can_del_bib} = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds_count); |
478 |
$line{left_item} = 1 if $line{items} >= 1; |
478 |
$line{items} = ($itemcount) - (scalar @items); |
479 |
$line{left_biblio} = 1 if $countbiblio > 1; |
479 |
$line{left_item} = 1 if $line{items} >= 1; |
480 |
$line{biblios} = $countbiblio - 1; |
480 |
$line{left_biblio} = 1 if $countbiblio > 1; |
481 |
$line{left_subscription} = 1 if scalar @subscriptions >= 1; |
481 |
$line{biblios} = $countbiblio - 1; |
482 |
$line{subscriptions} = scalar @subscriptions; |
482 |
$line{left_subscription} = 1 if scalar @subscriptions >= 1; |
483 |
($holds_count >= 1) ? $line{left_holds} = 1 : $line{left_holds} = 0; |
483 |
$line{subscriptions} = scalar @subscriptions; |
484 |
$line{left_holds_on_order} = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds ); |
484 |
($holds_count >= 1) ? $line{left_holds} = 1 : $line{left_holds} = 0; |
485 |
$line{holds} = $holds_count; |
485 |
$line{left_holds_on_order} = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds ); |
486 |
$line{holds_on_order} = $itemholds?$itemholds:$holds_count if $line{left_holds_on_order}; |
486 |
$line{holds} = $holds_count; |
|
|
487 |
$line{holds_on_order} = $itemholds?$itemholds:$holds_count if $line{left_holds_on_order}; |
488 |
} |
487 |
|
489 |
|
488 |
|
490 |
|
489 |
my $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber}); |
491 |
my $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber}); |
490 |
- |
|
|