Lines 51-56
BEGIN {
Link Here
|
51 |
&ReNewSubscription &GetLateOrMissingIssues |
51 |
&ReNewSubscription &GetLateOrMissingIssues |
52 |
&GetSerialInformation &AddItem2Serial |
52 |
&GetSerialInformation &AddItem2Serial |
53 |
&PrepareSerialsData &GetNextExpected &ModNextExpected |
53 |
&PrepareSerialsData &GetNextExpected &ModNextExpected |
|
|
54 |
&GetPreviousSerialid |
54 |
|
55 |
|
55 |
&UpdateClaimdateIssues |
56 |
&UpdateClaimdateIssues |
56 |
&GetSuppliersWithLateIssues &getsupplierbyserialid |
57 |
&GetSuppliersWithLateIssues &getsupplierbyserialid |
Lines 841-846
sub GetLatestSerials {
Link Here
|
841 |
return \@serials; |
842 |
return \@serials; |
842 |
} |
843 |
} |
843 |
|
844 |
|
|
|
845 |
=head2 GetPreviousSerialid |
846 |
|
847 |
$serialid = GetPreviousSerialid($subscriptionid, $nth) |
848 |
get the $nth's previous serial for the given subscriptionid |
849 |
return : |
850 |
the serialid |
851 |
|
852 |
=cut |
853 |
|
854 |
sub GetPreviousSerialid { |
855 |
my ( $subscriptionid, $nth ) = @_; |
856 |
$nth ||= 1; |
857 |
my $dbh = C4::Context->dbh; |
858 |
my $return = undef; |
859 |
|
860 |
# Status 2: Arrived |
861 |
my $strsth = "SELECT serialid |
862 |
FROM serial |
863 |
WHERE subscriptionid = ? |
864 |
AND status = 2 |
865 |
ORDER BY serialid DESC LIMIT $nth,1 |
866 |
"; |
867 |
my $sth = $dbh->prepare($strsth); |
868 |
$sth->execute($subscriptionid); |
869 |
my @serials; |
870 |
my $line = $sth->fetchrow_hashref; |
871 |
$return = $line->{'serialid'} if ($line); |
872 |
|
873 |
return $return; |
874 |
} |
875 |
|
876 |
|
877 |
|
844 |
=head2 GetDistributedTo |
878 |
=head2 GetDistributedTo |
845 |
|
879 |
|
846 |
$distributedto=GetDistributedTo($subscriptionid) |
880 |
$distributedto=GetDistributedTo($subscriptionid) |
Lines 1331-1337
sub ModSubscription {
Link Here
|
1331 |
$lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status, |
1365 |
$lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status, |
1332 |
$biblionumber, $callnumber, $notes, $letter, $manualhistory, |
1366 |
$biblionumber, $callnumber, $notes, $letter, $manualhistory, |
1333 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1367 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1334 |
$graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq |
1368 |
$graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq, |
|
|
1369 |
$itemtype, $previousitemtype |
1335 |
) = @_; |
1370 |
) = @_; |
1336 |
|
1371 |
|
1337 |
my $dbh = C4::Context->dbh; |
1372 |
my $dbh = C4::Context->dbh; |
Lines 1344-1350
sub ModSubscription {
Link Here
|
1344 |
callnumber=?, notes=?, letter=?, manualhistory=?, |
1379 |
callnumber=?, notes=?, letter=?, manualhistory=?, |
1345 |
internalnotes=?, serialsadditems=?, staffdisplaycount=?, |
1380 |
internalnotes=?, serialsadditems=?, staffdisplaycount=?, |
1346 |
opacdisplaycount=?, graceperiod=?, location = ?, enddate=?, |
1381 |
opacdisplaycount=?, graceperiod=?, location = ?, enddate=?, |
1347 |
skip_serialseq=? |
1382 |
skip_serialseq=?, itemtype=?, previousitemtype=? |
1348 |
WHERE subscriptionid = ?"; |
1383 |
WHERE subscriptionid = ?"; |
1349 |
|
1384 |
|
1350 |
my $sth = $dbh->prepare($query); |
1385 |
my $sth = $dbh->prepare($query); |
Lines 1358-1363
sub ModSubscription {
Link Here
|
1358 |
$letter, ($manualhistory ? $manualhistory : 0), |
1393 |
$letter, ($manualhistory ? $manualhistory : 0), |
1359 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1394 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1360 |
$graceperiod, $location, $enddate, $skip_serialseq, |
1395 |
$graceperiod, $location, $enddate, $skip_serialseq, |
|
|
1396 |
$itemtype, $previousitemtype, |
1361 |
$subscriptionid |
1397 |
$subscriptionid |
1362 |
); |
1398 |
); |
1363 |
my $rows = $sth->rows; |
1399 |
my $rows = $sth->rows; |
Lines 1373-1379
$subscriptionid = &NewSubscription($auser,branchcode,$aqbooksellerid,$cost,$aqbu
Link Here
|
1373 |
$lastvalue1,$innerloop1,$lastvalue2,$innerloop2,$lastvalue3,$innerloop3, |
1409 |
$lastvalue1,$innerloop1,$lastvalue2,$innerloop2,$lastvalue3,$innerloop3, |
1374 |
$status, $notes, $letter, $firstacquidate, $irregularity, $numberpattern, |
1410 |
$status, $notes, $letter, $firstacquidate, $irregularity, $numberpattern, |
1375 |
$locale, $callnumber, $manualhistory, $internalnotes, $serialsadditems, |
1411 |
$locale, $callnumber, $manualhistory, $internalnotes, $serialsadditems, |
1376 |
$staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq); |
1412 |
$staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, |
|
|
1413 |
$skip_serialseq, $itemtype, $previousitemtype); |
1377 |
|
1414 |
|
1378 |
Create a new subscription with value given on input args. |
1415 |
Create a new subscription with value given on input args. |
1379 |
|
1416 |
|
Lines 1390-1396
sub NewSubscription {
Link Here
|
1390 |
$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, |
1427 |
$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, |
1391 |
$numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, |
1428 |
$numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, |
1392 |
$serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, |
1429 |
$serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, |
1393 |
$location, $enddate, $skip_serialseq |
1430 |
$location, $enddate, $skip_serialseq, $itemtype, $previousitemtype |
1394 |
) = @_; |
1431 |
) = @_; |
1395 |
my $dbh = C4::Context->dbh; |
1432 |
my $dbh = C4::Context->dbh; |
1396 |
|
1433 |
|
Lines 1403-1410
sub NewSubscription {
Link Here
|
1403 |
lastvalue3, innerloop3, status, notes, letter, firstacquidate, |
1440 |
lastvalue3, innerloop3, status, notes, letter, firstacquidate, |
1404 |
irregularity, numberpattern, locale, callnumber, |
1441 |
irregularity, numberpattern, locale, callnumber, |
1405 |
manualhistory, internalnotes, serialsadditems, staffdisplaycount, |
1442 |
manualhistory, internalnotes, serialsadditems, staffdisplaycount, |
1406 |
opacdisplaycount, graceperiod, location, enddate, skip_serialseq) |
1443 |
opacdisplaycount, graceperiod, location, enddate, skip_serialseq, |
1407 |
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
1444 |
itemtype, previousitemtype) |
|
|
1445 |
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
1408 |
|; |
1446 |
|; |
1409 |
my $sth = $dbh->prepare($query); |
1447 |
my $sth = $dbh->prepare($query); |
1410 |
$sth->execute( |
1448 |
$sth->execute( |
Lines 1414-1420
sub NewSubscription {
Link Here
|
1414 |
$lastvalue3, $innerloop3, $status, $notes, $letter, |
1452 |
$lastvalue3, $innerloop3, $status, $notes, $letter, |
1415 |
$firstacquidate, $irregularity, $numberpattern, $locale, $callnumber, |
1453 |
$firstacquidate, $irregularity, $numberpattern, $locale, $callnumber, |
1416 |
$manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount, |
1454 |
$manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount, |
1417 |
$opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq |
1455 |
$opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq, |
|
|
1456 |
$itemtype, $previousitemtype |
1418 |
); |
1457 |
); |
1419 |
|
1458 |
|
1420 |
my $subscriptionid = $dbh->{'mysql_insertid'}; |
1459 |
my $subscriptionid = $dbh->{'mysql_insertid'}; |