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 1755-1761
sub GetLateOrMissingIssues {
Link Here
|
1755 |
"SELECT |
1761 |
"SELECT |
1756 |
serialid, aqbooksellerid, name, |
1762 |
serialid, aqbooksellerid, name, |
1757 |
biblio.title, planneddate, serialseq, |
1763 |
biblio.title, planneddate, serialseq, |
1758 |
serial.status, serial.subscriptionid, claimdate, |
1764 |
serial.status, serial.subscriptionid, claimdate, claims_count, |
1759 |
subscription.branchcode |
1765 |
subscription.branchcode |
1760 |
FROM serial |
1766 |
FROM serial |
1761 |
LEFT JOIN subscription ON serial.subscriptionid=subscription.subscriptionid |
1767 |
LEFT JOIN subscription ON serial.subscriptionid=subscription.subscriptionid |
Lines 1772-1778
sub GetLateOrMissingIssues {
Link Here
|
1772 |
"SELECT |
1778 |
"SELECT |
1773 |
serialid, aqbooksellerid, name, |
1779 |
serialid, aqbooksellerid, name, |
1774 |
biblio.title, planneddate, serialseq, |
1780 |
biblio.title, planneddate, serialseq, |
1775 |
serial.status, serial.subscriptionid, claimdate, |
1781 |
serial.status, serial.subscriptionid, claimdate, claims_count, |
1776 |
subscription.branchcode |
1782 |
subscription.branchcode |
1777 |
FROM serial |
1783 |
FROM serial |
1778 |
LEFT JOIN subscription ON serial.subscriptionid=subscription.subscriptionid |
1784 |
LEFT JOIN subscription ON serial.subscriptionid=subscription.subscriptionid |
Lines 1852-1858
sub updateClaim {
Link Here
|
1852 |
my ($serialid) = @_; |
1858 |
my ($serialid) = @_; |
1853 |
my $dbh = C4::Context->dbh; |
1859 |
my $dbh = C4::Context->dbh; |
1854 |
my $sth = $dbh->prepare( |
1860 |
my $sth = $dbh->prepare( |
1855 |
"UPDATE serial SET claimdate = now() |
1861 |
"UPDATE serial |
|
|
1862 |
SET claimdate = now(), |
1863 |
claims_count = claims_count + 1 |
1856 |
WHERE serialid = ? |
1864 |
WHERE serialid = ? |
1857 |
" |
1865 |
" |
1858 |
); |
1866 |
); |