|
Lines 838-844
sub GetItemsForInventory {
Link Here
|
| 838 |
FROM items |
838 |
FROM items |
| 839 |
LEFT JOIN biblio ON items.biblionumber = biblio.biblionumber |
839 |
LEFT JOIN biblio ON items.biblionumber = biblio.biblionumber |
| 840 |
LEFT JOIN biblioitems on items.biblionumber = biblioitems.biblionumber |
840 |
LEFT JOIN biblioitems on items.biblionumber = biblioitems.biblionumber |
| 841 |
WHERE (items.deleted_at IS NULL AND biblio.deleted_at IS NULL AND biblioitems.deleted_at IS NULL) |
841 |
WHERE (items.deleted_on IS NULL AND biblio.deleted_on IS NULL AND biblioitems.deleted_on IS NULL) |
| 842 |
}; |
842 |
}; |
| 843 |
if ($statushash){ |
843 |
if ($statushash){ |
| 844 |
for my $authvfield (keys %$statushash){ |
844 |
for my $authvfield (keys %$statushash){ |
|
Lines 945-951
Called by C<C4::XISBN>
Link Here
|
| 945 |
sub GetItemsByBiblioitemnumber { |
945 |
sub GetItemsByBiblioitemnumber { |
| 946 |
my ( $bibitem ) = @_; |
946 |
my ( $bibitem ) = @_; |
| 947 |
my $dbh = C4::Context->dbh; |
947 |
my $dbh = C4::Context->dbh; |
| 948 |
my $sth = $dbh->prepare("SELECT * FROM items WHERE items.biblioitemnumber = ? AND items.deleted_at IS NULL") || die $dbh->errstr; |
948 |
my $sth = $dbh->prepare("SELECT * FROM items WHERE items.biblioitemnumber = ? AND items.deleted_on IS NULL") || die $dbh->errstr; |
| 949 |
# Get all items attached to a biblioitem |
949 |
# Get all items attached to a biblioitem |
| 950 |
my $i = 0; |
950 |
my $i = 0; |
| 951 |
my @results; |
951 |
my @results; |
|
Lines 1069-1075
sub GetItemsInfo {
Link Here
|
| 1069 |
FROM items |
1069 |
FROM items |
| 1070 |
LEFT JOIN branches AS holding ON items.holdingbranch = holding.branchcode |
1070 |
LEFT JOIN branches AS holding ON items.holdingbranch = holding.branchcode |
| 1071 |
LEFT JOIN branches AS home ON items.homebranch=home.branchcode |
1071 |
LEFT JOIN branches AS home ON items.homebranch=home.branchcode |
| 1072 |
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber AND biblio.deleted_at IS NULL |
1072 |
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber AND biblio.deleted_on IS NULL |
| 1073 |
LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber |
1073 |
LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber |
| 1074 |
LEFT JOIN issues USING (itemnumber) |
1074 |
LEFT JOIN issues USING (itemnumber) |
| 1075 |
LEFT JOIN borrowers USING (borrowernumber) |
1075 |
LEFT JOIN borrowers USING (borrowernumber) |
|
Lines 1083-1089
sub GetItemsInfo {
Link Here
|
| 1083 |
AND localization.lang = ? |
1083 |
AND localization.lang = ? |
| 1084 |
|; |
1084 |
|; |
| 1085 |
|
1085 |
|
| 1086 |
$query .= " WHERE items.biblionumber = ? AND items.deleted_at IS NULL ORDER BY home.branchname, items.enumchron, LPAD( items.copynumber, 8, '0' ), items.dateaccessioned DESC" ; |
1086 |
$query .= " WHERE items.biblionumber = ? AND items.deleted_on IS NULL ORDER BY home.branchname, items.enumchron, LPAD( items.copynumber, 8, '0' ), items.dateaccessioned DESC" ; |
| 1087 |
my $sth = $dbh->prepare($query); |
1087 |
my $sth = $dbh->prepare($query); |
| 1088 |
$sth->execute($language, $biblionumber); |
1088 |
$sth->execute($language, $biblionumber); |
| 1089 |
my $i = 0; |
1089 |
my $i = 0; |
|
Lines 1190-1196
sub GetItemsLocationInfo {
Link Here
|
| 1190 |
location, itemcallnumber, cn_sort |
1190 |
location, itemcallnumber, cn_sort |
| 1191 |
FROM items, branches as a, branches as b |
1191 |
FROM items, branches as a, branches as b |
| 1192 |
WHERE homebranch = a.branchcode AND holdingbranch = b.branchcode |
1192 |
WHERE homebranch = a.branchcode AND holdingbranch = b.branchcode |
| 1193 |
AND biblionumber = ? AND deleted_at IS NULL |
1193 |
AND biblionumber = ? AND deleted_on IS NULL |
| 1194 |
ORDER BY cn_sort ASC"; |
1194 |
ORDER BY cn_sort ASC"; |
| 1195 |
my $sth = $dbh->prepare($query); |
1195 |
my $sth = $dbh->prepare($query); |
| 1196 |
$sth->execute($biblionumber); |
1196 |
$sth->execute($biblionumber); |
|
Lines 1257-1263
sub GetLastAcquisitions {
Link Here
|
| 1257 |
my $number_of_branches = @{$data->{branches}}; |
1257 |
my $number_of_branches = @{$data->{branches}}; |
| 1258 |
my $number_of_itemtypes = @{$data->{itemtypes}}; |
1258 |
my $number_of_itemtypes = @{$data->{itemtypes}}; |
| 1259 |
|
1259 |
|
| 1260 |
my @where = ('WHERE (items.deleted_at IS NULL AND biblio.deleted_at IS NULL AND biblioitems.deleted_at IS NULL)'); |
1260 |
my @where = ('WHERE (items.deleted_on IS NULL AND biblio.deleted_on IS NULL AND biblioitems.deleted_on IS NULL)'); |
| 1261 |
$number_of_branches and push @where |
1261 |
$number_of_branches and push @where |
| 1262 |
, 'AND holdingbranch IN (' |
1262 |
, 'AND holdingbranch IN (' |
| 1263 |
, join(',', ('?') x $number_of_branches ) |
1263 |
, join(',', ('?') x $number_of_branches ) |
|
Lines 1304-1310
sub GetItemnumbersForBiblio {
Link Here
|
| 1304 |
my $biblionumber = shift; |
1304 |
my $biblionumber = shift; |
| 1305 |
my @items; |
1305 |
my @items; |
| 1306 |
my $dbh = C4::Context->dbh; |
1306 |
my $dbh = C4::Context->dbh; |
| 1307 |
my $sth = $dbh->prepare("SELECT itemnumber FROM items WHERE biblionumber = ? AND deleted_at IS NULL"); |
1307 |
my $sth = $dbh->prepare("SELECT itemnumber FROM items WHERE biblionumber = ? AND deleted_on IS NULL"); |
| 1308 |
$sth->execute($biblionumber); |
1308 |
$sth->execute($biblionumber); |
| 1309 |
while (my $result = $sth->fetchrow_hashref) { |
1309 |
while (my $result = $sth->fetchrow_hashref) { |
| 1310 |
push @items, $result->{'itemnumber'}; |
1310 |
push @items, $result->{'itemnumber'}; |
|
Lines 2080-2086
sub _koha_delete_item {
Link Here
|
| 2080 |
|
2080 |
|
| 2081 |
my $dbh = C4::Context->dbh; |
2081 |
my $dbh = C4::Context->dbh; |
| 2082 |
|
2082 |
|
| 2083 |
my $sth = $dbh->prepare("UPDATE items SET deleted_at = NOW() WHERE itemnumber = ?"); |
2083 |
my $sth = $dbh->prepare("UPDATE items SET deleted_on = NOW() WHERE itemnumber = ?"); |
| 2084 |
my $deleted = $sth->execute($itemnum); |
2084 |
my $deleted = $sth->execute($itemnum); |
| 2085 |
return ( $deleted == 1 ) ? 1 : 0; |
2085 |
return ( $deleted == 1 ) ? 1 : 0; |
| 2086 |
} |
2086 |
} |
|
Lines 2445-2451
sub SearchItems {
Link Here
|
| 2445 |
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber |
2445 |
LEFT JOIN biblio ON biblio.biblionumber = items.biblionumber |
| 2446 |
LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber |
2446 |
LEFT JOIN biblioitems ON biblioitems.biblioitemnumber = items.biblioitemnumber |
| 2447 |
LEFT JOIN biblio_metadata ON biblio_metadata.biblionumber = biblio.biblionumber |
2447 |
LEFT JOIN biblio_metadata ON biblio_metadata.biblionumber = biblio.biblionumber |
| 2448 |
WHERE items.deleted_at IS NULL |
2448 |
WHERE items.deleted_on IS NULL |
| 2449 |
}; |
2449 |
}; |
| 2450 |
if (defined $where_str and $where_str ne '') { |
2450 |
if (defined $where_str and $where_str ne '') { |
| 2451 |
$query .= qq{ AND $where_str }; |
2451 |
$query .= qq{ AND $where_str }; |
|
Lines 2796-2802
sub ToggleNewStatus {
Link Here
|
| 2796 |
SELECT items.biblionumber, items.itemnumber |
2796 |
SELECT items.biblionumber, items.itemnumber |
| 2797 |
FROM items |
2797 |
FROM items |
| 2798 |
LEFT JOIN biblioitems ON biblioitems.biblionumber = items.biblionumber |
2798 |
LEFT JOIN biblioitems ON biblioitems.biblionumber = items.biblionumber |
| 2799 |
WHERE items.deleted_at IS NULL |
2799 |
WHERE items.deleted_on IS NULL |
| 2800 |
|; |
2800 |
|; |
| 2801 |
for my $condition ( @$conditions ) { |
2801 |
for my $condition ( @$conditions ) { |
| 2802 |
if ( |
2802 |
if ( |