Bug 21650: Remove the subroutine C4::Items::GetLastAcquisitions

C4::Items::GetLastAcquisitions has been added by
  commit 7753bbad4f
  Adding Some new functions

(?)

Apparently it has never been used, we should remove it to avoid unnecessary maintenance.

Test plan:
  git grep GetLastAcquisitions
must not return any results

NOTE: POD Coverage test failure is expected on removal

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2018-10-24 15:31:02 -03:00 committed by Nick Clemens
parent fef32fac36
commit f683c181ac
1 changed files with 0 additions and 52 deletions

View File

@ -47,7 +47,6 @@ BEGIN {
ItemSafeToDelete
DelItemCheck
MoveItemFromBiblio
GetLastAcquisitions
CartToShelf
ShelfToCart
GetAnalyticsCount
@ -1177,57 +1176,6 @@ sub GetHostItemsInfo {
return @returnitemsInfo;
}
=head2 GetLastAcquisitions
my $lastacq = GetLastAcquisitions({'branches' => ('branch1','branch2'),
'itemtypes' => ('BK','BD')}, 10);
=cut
sub GetLastAcquisitions {
my ($data,$max) = @_;
my $itemtype = C4::Context->preference('item-level_itypes') ? 'itype' : 'itemtype';
my $number_of_branches = @{$data->{branches}};
my $number_of_itemtypes = @{$data->{itemtypes}};
my @where = ('WHERE 1 ');
$number_of_branches and push @where
, 'AND holdingbranch IN ('
, join(',', ('?') x $number_of_branches )
, ')'
;
$number_of_itemtypes and push @where
, "AND $itemtype IN ("
, join(',', ('?') x $number_of_itemtypes )
, ')'
;
my $query = "SELECT biblio.biblionumber as biblionumber, title, dateaccessioned
FROM items RIGHT JOIN biblio ON (items.biblionumber=biblio.biblionumber)
RIGHT JOIN biblioitems ON (items.biblioitemnumber=biblioitems.biblioitemnumber)
@where
GROUP BY biblio.biblionumber
ORDER BY dateaccessioned DESC LIMIT $max";
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare($query);
$sth->execute((@{$data->{branches}}, @{$data->{itemtypes}}));
my @results;
while( my $row = $sth->fetchrow_hashref){
push @results, {date => $row->{dateaccessioned}
, biblionumber => $row->{biblionumber}
, title => $row->{title}};
}
return @results;
}
=head2 get_hostitemnumbers_of
my @itemnumbers_of = get_hostitemnumbers_of($biblionumber);