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 899-904
sub GetLatestSerials {
Link Here
|
899 |
return \@serials; |
900 |
return \@serials; |
900 |
} |
901 |
} |
901 |
|
902 |
|
|
|
903 |
=head2 GetPreviousSerialid |
904 |
|
905 |
$serialid = GetPreviousSerialid($subscriptionid, $nth) |
906 |
get the $nth's previous serial for the given subscriptionid |
907 |
return : |
908 |
the serialid |
909 |
|
910 |
=cut |
911 |
|
912 |
sub GetPreviousSerialid { |
913 |
my ( $subscriptionid, $nth ) = @_; |
914 |
$nth ||= 1; |
915 |
my $dbh = C4::Context->dbh; |
916 |
my $return = undef; |
917 |
|
918 |
# Status 2: Arrived |
919 |
my $strsth = "SELECT serialid |
920 |
FROM serial |
921 |
WHERE subscriptionid = ? |
922 |
AND status = 2 |
923 |
ORDER BY serialid DESC LIMIT $nth,1 |
924 |
"; |
925 |
my $sth = $dbh->prepare($strsth); |
926 |
$sth->execute($subscriptionid); |
927 |
my @serials; |
928 |
my $line = $sth->fetchrow_hashref; |
929 |
$return = $line->{'serialid'} if ($line); |
930 |
|
931 |
return $return; |
932 |
} |
933 |
|
934 |
|
935 |
|
902 |
=head2 GetDistributedTo |
936 |
=head2 GetDistributedTo |
903 |
|
937 |
|
904 |
$distributedto=GetDistributedTo($subscriptionid) |
938 |
$distributedto=GetDistributedTo($subscriptionid) |
Lines 1389-1395
sub ModSubscription {
Link Here
|
1389 |
$lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status, |
1423 |
$lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status, |
1390 |
$biblionumber, $callnumber, $notes, $letter, $manualhistory, |
1424 |
$biblionumber, $callnumber, $notes, $letter, $manualhistory, |
1391 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1425 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1392 |
$graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq |
1426 |
$graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq, |
|
|
1427 |
$itemtype, $previousitemtype |
1393 |
) = @_; |
1428 |
) = @_; |
1394 |
|
1429 |
|
1395 |
my $dbh = C4::Context->dbh; |
1430 |
my $dbh = C4::Context->dbh; |
Lines 1402-1408
sub ModSubscription {
Link Here
|
1402 |
callnumber=?, notes=?, letter=?, manualhistory=?, |
1437 |
callnumber=?, notes=?, letter=?, manualhistory=?, |
1403 |
internalnotes=?, serialsadditems=?, staffdisplaycount=?, |
1438 |
internalnotes=?, serialsadditems=?, staffdisplaycount=?, |
1404 |
opacdisplaycount=?, graceperiod=?, location = ?, enddate=?, |
1439 |
opacdisplaycount=?, graceperiod=?, location = ?, enddate=?, |
1405 |
skip_serialseq=? |
1440 |
skip_serialseq=?, itemtype=?, previousitemtype=? |
1406 |
WHERE subscriptionid = ?"; |
1441 |
WHERE subscriptionid = ?"; |
1407 |
|
1442 |
|
1408 |
my $sth = $dbh->prepare($query); |
1443 |
my $sth = $dbh->prepare($query); |
Lines 1416-1421
sub ModSubscription {
Link Here
|
1416 |
$letter, ($manualhistory ? $manualhistory : 0), |
1451 |
$letter, ($manualhistory ? $manualhistory : 0), |
1417 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1452 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1418 |
$graceperiod, $location, $enddate, $skip_serialseq, |
1453 |
$graceperiod, $location, $enddate, $skip_serialseq, |
|
|
1454 |
$itemtype, $previousitemtype, |
1419 |
$subscriptionid |
1455 |
$subscriptionid |
1420 |
); |
1456 |
); |
1421 |
my $rows = $sth->rows; |
1457 |
my $rows = $sth->rows; |
Lines 1431-1437
$subscriptionid = &NewSubscription($auser,branchcode,$aqbooksellerid,$cost,$aqbu
Link Here
|
1431 |
$lastvalue1,$innerloop1,$lastvalue2,$innerloop2,$lastvalue3,$innerloop3, |
1467 |
$lastvalue1,$innerloop1,$lastvalue2,$innerloop2,$lastvalue3,$innerloop3, |
1432 |
$status, $notes, $letter, $firstacquidate, $irregularity, $numberpattern, |
1468 |
$status, $notes, $letter, $firstacquidate, $irregularity, $numberpattern, |
1433 |
$locale, $callnumber, $manualhistory, $internalnotes, $serialsadditems, |
1469 |
$locale, $callnumber, $manualhistory, $internalnotes, $serialsadditems, |
1434 |
$staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq); |
1470 |
$staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, |
|
|
1471 |
$skip_serialseq, $itemtype, $previousitemtype); |
1435 |
|
1472 |
|
1436 |
Create a new subscription with value given on input args. |
1473 |
Create a new subscription with value given on input args. |
1437 |
|
1474 |
|
Lines 1448-1454
sub NewSubscription {
Link Here
|
1448 |
$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, |
1485 |
$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, |
1449 |
$numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, |
1486 |
$numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, |
1450 |
$serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, |
1487 |
$serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, |
1451 |
$location, $enddate, $skip_serialseq |
1488 |
$location, $enddate, $skip_serialseq, $itemtype, $previousitemtype |
1452 |
) = @_; |
1489 |
) = @_; |
1453 |
my $dbh = C4::Context->dbh; |
1490 |
my $dbh = C4::Context->dbh; |
1454 |
|
1491 |
|
Lines 1461-1468
sub NewSubscription {
Link Here
|
1461 |
lastvalue3, innerloop3, status, notes, letter, firstacquidate, |
1498 |
lastvalue3, innerloop3, status, notes, letter, firstacquidate, |
1462 |
irregularity, numberpattern, locale, callnumber, |
1499 |
irregularity, numberpattern, locale, callnumber, |
1463 |
manualhistory, internalnotes, serialsadditems, staffdisplaycount, |
1500 |
manualhistory, internalnotes, serialsadditems, staffdisplaycount, |
1464 |
opacdisplaycount, graceperiod, location, enddate, skip_serialseq) |
1501 |
opacdisplaycount, graceperiod, location, enddate, skip_serialseq, |
1465 |
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
1502 |
itemtype, previousitemtype) |
|
|
1503 |
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
1466 |
|; |
1504 |
|; |
1467 |
my $sth = $dbh->prepare($query); |
1505 |
my $sth = $dbh->prepare($query); |
1468 |
$sth->execute( |
1506 |
$sth->execute( |
Lines 1472-1478
sub NewSubscription {
Link Here
|
1472 |
$lastvalue3, $innerloop3, $status, $notes, $letter, |
1510 |
$lastvalue3, $innerloop3, $status, $notes, $letter, |
1473 |
$firstacquidate, $irregularity, $numberpattern, $locale, $callnumber, |
1511 |
$firstacquidate, $irregularity, $numberpattern, $locale, $callnumber, |
1474 |
$manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount, |
1512 |
$manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount, |
1475 |
$opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq |
1513 |
$opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq, |
|
|
1514 |
$itemtype, $previousitemtype |
1476 |
); |
1515 |
); |
1477 |
|
1516 |
|
1478 |
my $subscriptionid = $dbh->{'mysql_insertid'}; |
1517 |
my $subscriptionid = $dbh->{'mysql_insertid'}; |