Lines 88-97
sub GetSuppliersWithLateIssues {
Link Here
|
88 |
my $dbh = C4::Context->dbh; |
88 |
my $dbh = C4::Context->dbh; |
89 |
my $query = qq| |
89 |
my $query = qq| |
90 |
SELECT DISTINCT id, name |
90 |
SELECT DISTINCT id, name |
91 |
FROM subscription |
91 |
FROM subscription |
92 |
LEFT JOIN serial ON serial.subscriptionid=subscription.subscriptionid |
92 |
LEFT JOIN serial ON serial.subscriptionid=subscription.subscriptionid |
93 |
LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id |
93 |
LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id |
94 |
WHERE id > 0 AND ((planneddate < now() AND serial.status=1) OR serial.STATUS = 3 OR serial.STATUS = 4) ORDER BY name|; |
94 |
WHERE id > 0 AND ((planneddate < now() AND serial.status=1) OR serial.STATUS = 3 OR serial.STATUS = 4 OR serial.STATUS = 7) |
|
|
95 |
ORDER BY name |
96 |
|; |
95 |
return $dbh->selectall_arrayref($query, { Slice => {} }); |
97 |
return $dbh->selectall_arrayref($query, { Slice => {} }); |
96 |
} |
98 |
} |
97 |
|
99 |
|
Lines 284-291
sub UpdateClaimdateIssues {
Link Here
|
284 |
my $dbh = C4::Context->dbh; |
286 |
my $dbh = C4::Context->dbh; |
285 |
$date = strftime( "%Y-%m-%d", localtime ) unless ($date); |
287 |
$date = strftime( "%Y-%m-%d", localtime ) unless ($date); |
286 |
my $query = " |
288 |
my $query = " |
287 |
UPDATE serial SET claimdate = ?, status = 7 |
289 |
UPDATE serial |
288 |
WHERE serialid in (" . join( ",", map { '?' } @$serialids ) . ")"; |
290 |
SET claimdate = ?, |
|
|
291 |
status = 7, |
292 |
claims_count = claims_count + 1 |
293 |
WHERE serialid in (" . join( ",", map { '?' } @$serialids ) . ") |
294 |
"; |
289 |
my $rq = $dbh->prepare($query); |
295 |
my $rq = $dbh->prepare($query); |
290 |
$rq->execute($date, @$serialids); |
296 |
$rq->execute($date, @$serialids); |
291 |
return $rq->rows; |
297 |
return $rq->rows; |
Lines 1756-1762
sub GetLateOrMissingIssues {
Link Here
|
1756 |
"SELECT |
1762 |
"SELECT |
1757 |
serialid, aqbooksellerid, name, |
1763 |
serialid, aqbooksellerid, name, |
1758 |
biblio.title, planneddate, serialseq, |
1764 |
biblio.title, planneddate, serialseq, |
1759 |
serial.status, serial.subscriptionid, claimdate, |
1765 |
serial.status, serial.subscriptionid, claimdate, claims_count, |
1760 |
subscription.branchcode |
1766 |
subscription.branchcode |
1761 |
FROM serial |
1767 |
FROM serial |
1762 |
LEFT JOIN subscription ON serial.subscriptionid=subscription.subscriptionid |
1768 |
LEFT JOIN subscription ON serial.subscriptionid=subscription.subscriptionid |
Lines 1773-1779
sub GetLateOrMissingIssues {
Link Here
|
1773 |
"SELECT |
1779 |
"SELECT |
1774 |
serialid, aqbooksellerid, name, |
1780 |
serialid, aqbooksellerid, name, |
1775 |
biblio.title, planneddate, serialseq, |
1781 |
biblio.title, planneddate, serialseq, |
1776 |
serial.status, serial.subscriptionid, claimdate, |
1782 |
serial.status, serial.subscriptionid, claimdate, claims_count, |
1777 |
subscription.branchcode |
1783 |
subscription.branchcode |
1778 |
FROM serial |
1784 |
FROM serial |
1779 |
LEFT JOIN subscription ON serial.subscriptionid=subscription.subscriptionid |
1785 |
LEFT JOIN subscription ON serial.subscriptionid=subscription.subscriptionid |
Lines 1853-1859
sub updateClaim {
Link Here
|
1853 |
my ($serialid) = @_; |
1859 |
my ($serialid) = @_; |
1854 |
my $dbh = C4::Context->dbh; |
1860 |
my $dbh = C4::Context->dbh; |
1855 |
my $sth = $dbh->prepare( |
1861 |
my $sth = $dbh->prepare( |
1856 |
"UPDATE serial SET claimdate = now() |
1862 |
"UPDATE serial |
|
|
1863 |
SET claimdate = now(), |
1864 |
claims_count = claims_count + 1 |
1857 |
WHERE serialid = ? |
1865 |
WHERE serialid = ? |
1858 |
" |
1866 |
" |
1859 |
); |
1867 |
); |