Lines 51-56
BEGIN {
Link Here
|
51 |
&ReNewSubscription &GetLateIssues &GetLateOrMissingIssues |
51 |
&ReNewSubscription &GetLateIssues &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 895-900
sub GetLatestSerials {
Link Here
|
895 |
return \@serials; |
896 |
return \@serials; |
896 |
} |
897 |
} |
897 |
|
898 |
|
|
|
899 |
=head2 GetPreviousSerialid |
900 |
|
901 |
$serialid = GetPreviousSerialid($subscriptionid, $nth) |
902 |
get the $nth's previous serial for the given subscriptionid |
903 |
return : |
904 |
the serialid |
905 |
|
906 |
=cut |
907 |
|
908 |
sub GetPreviousSerialid { |
909 |
my ( $subscriptionid, $nth ) = @_; |
910 |
$nth ||= 1; |
911 |
my $dbh = C4::Context->dbh; |
912 |
my $return = undef; |
913 |
|
914 |
# Status 2: Arrived |
915 |
my $strsth = "SELECT serialid |
916 |
FROM serial |
917 |
WHERE subscriptionid = ? |
918 |
AND status = 2 |
919 |
ORDER BY serialid DESC LIMIT $nth,1 |
920 |
"; |
921 |
my $sth = $dbh->prepare($strsth); |
922 |
$sth->execute($subscriptionid); |
923 |
my @serials; |
924 |
my $line = $sth->fetchrow_hashref; |
925 |
$return = $line->{'serialid'} if ($line); |
926 |
|
927 |
return $return; |
928 |
} |
929 |
|
930 |
|
931 |
|
898 |
=head2 GetDistributedTo |
932 |
=head2 GetDistributedTo |
899 |
|
933 |
|
900 |
$distributedto=GetDistributedTo($subscriptionid) |
934 |
$distributedto=GetDistributedTo($subscriptionid) |
Lines 1385-1391
sub ModSubscription {
Link Here
|
1385 |
$lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status, |
1419 |
$lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status, |
1386 |
$biblionumber, $callnumber, $notes, $letter, $manualhistory, |
1420 |
$biblionumber, $callnumber, $notes, $letter, $manualhistory, |
1387 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1421 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1388 |
$graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq |
1422 |
$graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq, |
|
|
1423 |
$itemtype, $previousitemtype |
1389 |
) = @_; |
1424 |
) = @_; |
1390 |
|
1425 |
|
1391 |
my $dbh = C4::Context->dbh; |
1426 |
my $dbh = C4::Context->dbh; |
Lines 1398-1404
sub ModSubscription {
Link Here
|
1398 |
callnumber=?, notes=?, letter=?, manualhistory=?, |
1433 |
callnumber=?, notes=?, letter=?, manualhistory=?, |
1399 |
internalnotes=?, serialsadditems=?, staffdisplaycount=?, |
1434 |
internalnotes=?, serialsadditems=?, staffdisplaycount=?, |
1400 |
opacdisplaycount=?, graceperiod=?, location = ?, enddate=?, |
1435 |
opacdisplaycount=?, graceperiod=?, location = ?, enddate=?, |
1401 |
skip_serialseq=? |
1436 |
skip_serialseq=?, itemtype=?, previousitemtype=? |
1402 |
WHERE subscriptionid = ?"; |
1437 |
WHERE subscriptionid = ?"; |
1403 |
|
1438 |
|
1404 |
my $sth = $dbh->prepare($query); |
1439 |
my $sth = $dbh->prepare($query); |
Lines 1412-1417
sub ModSubscription {
Link Here
|
1412 |
$letter, ($manualhistory ? $manualhistory : 0), |
1447 |
$letter, ($manualhistory ? $manualhistory : 0), |
1413 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1448 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1414 |
$graceperiod, $location, $enddate, $skip_serialseq, |
1449 |
$graceperiod, $location, $enddate, $skip_serialseq, |
|
|
1450 |
$itemtype, $previousitemtype, |
1415 |
$subscriptionid |
1451 |
$subscriptionid |
1416 |
); |
1452 |
); |
1417 |
my $rows = $sth->rows; |
1453 |
my $rows = $sth->rows; |
Lines 1427-1433
$subscriptionid = &NewSubscription($auser,branchcode,$aqbooksellerid,$cost,$aqbu
Link Here
|
1427 |
$lastvalue1,$innerloop1,$lastvalue2,$innerloop2,$lastvalue3,$innerloop3, |
1463 |
$lastvalue1,$innerloop1,$lastvalue2,$innerloop2,$lastvalue3,$innerloop3, |
1428 |
$status, $notes, $letter, $firstacquidate, $irregularity, $numberpattern, |
1464 |
$status, $notes, $letter, $firstacquidate, $irregularity, $numberpattern, |
1429 |
$locale, $callnumber, $manualhistory, $internalnotes, $serialsadditems, |
1465 |
$locale, $callnumber, $manualhistory, $internalnotes, $serialsadditems, |
1430 |
$staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq); |
1466 |
$staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, |
|
|
1467 |
$skip_serialseq, $itemtype, $previousitemtype); |
1431 |
|
1468 |
|
1432 |
Create a new subscription with value given on input args. |
1469 |
Create a new subscription with value given on input args. |
1433 |
|
1470 |
|
Lines 1444-1450
sub NewSubscription {
Link Here
|
1444 |
$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, |
1481 |
$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, |
1445 |
$numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, |
1482 |
$numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, |
1446 |
$serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, |
1483 |
$serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, |
1447 |
$location, $enddate, $skip_serialseq |
1484 |
$location, $enddate, $skip_serialseq, $itemtype, $previousitemtype |
1448 |
) = @_; |
1485 |
) = @_; |
1449 |
my $dbh = C4::Context->dbh; |
1486 |
my $dbh = C4::Context->dbh; |
1450 |
|
1487 |
|
Lines 1457-1464
sub NewSubscription {
Link Here
|
1457 |
lastvalue3, innerloop3, status, notes, letter, firstacquidate, |
1494 |
lastvalue3, innerloop3, status, notes, letter, firstacquidate, |
1458 |
irregularity, numberpattern, locale, callnumber, |
1495 |
irregularity, numberpattern, locale, callnumber, |
1459 |
manualhistory, internalnotes, serialsadditems, staffdisplaycount, |
1496 |
manualhistory, internalnotes, serialsadditems, staffdisplaycount, |
1460 |
opacdisplaycount, graceperiod, location, enddate, skip_serialseq) |
1497 |
opacdisplaycount, graceperiod, location, enddate, skip_serialseq, |
1461 |
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
1498 |
itemtype, previousitemtype) |
|
|
1499 |
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
1462 |
|; |
1500 |
|; |
1463 |
my $sth = $dbh->prepare($query); |
1501 |
my $sth = $dbh->prepare($query); |
1464 |
$sth->execute( |
1502 |
$sth->execute( |
Lines 1468-1474
sub NewSubscription {
Link Here
|
1468 |
$lastvalue3, $innerloop3, $status, $notes, $letter, |
1506 |
$lastvalue3, $innerloop3, $status, $notes, $letter, |
1469 |
$firstacquidate, $irregularity, $numberpattern, $locale, $callnumber, |
1507 |
$firstacquidate, $irregularity, $numberpattern, $locale, $callnumber, |
1470 |
$manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount, |
1508 |
$manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount, |
1471 |
$opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq |
1509 |
$opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq, |
|
|
1510 |
$itemtype, $previousitemtype |
1472 |
); |
1511 |
); |
1473 |
|
1512 |
|
1474 |
my $subscriptionid = $dbh->{'mysql_insertid'}; |
1513 |
my $subscriptionid = $dbh->{'mysql_insertid'}; |