Lines 76-81
BEGIN {
Link Here
|
76 |
&ReNewSubscription &GetLateOrMissingIssues |
76 |
&ReNewSubscription &GetLateOrMissingIssues |
77 |
&GetSerialInformation &AddItem2Serial |
77 |
&GetSerialInformation &AddItem2Serial |
78 |
&PrepareSerialsData &GetNextExpected &ModNextExpected |
78 |
&PrepareSerialsData &GetNextExpected &ModNextExpected |
|
|
79 |
&GetPreviousSerialid |
79 |
|
80 |
|
80 |
&GetSuppliersWithLateIssues &getsupplierbyserialid |
81 |
&GetSuppliersWithLateIssues &getsupplierbyserialid |
81 |
&GetDistributedTo &SetDistributedTo |
82 |
&GetDistributedTo &SetDistributedTo |
Lines 805-810
sub GetLatestSerials {
Link Here
|
805 |
return \@serials; |
806 |
return \@serials; |
806 |
} |
807 |
} |
807 |
|
808 |
|
|
|
809 |
=head2 GetPreviousSerialid |
810 |
|
811 |
$serialid = GetPreviousSerialid($subscriptionid, $nth) |
812 |
get the $nth's previous serial for the given subscriptionid |
813 |
return : |
814 |
the serialid |
815 |
|
816 |
=cut |
817 |
|
818 |
sub GetPreviousSerialid { |
819 |
my ( $subscriptionid, $nth ) = @_; |
820 |
$nth ||= 1; |
821 |
my $dbh = C4::Context->dbh; |
822 |
my $return = undef; |
823 |
|
824 |
# Status 2: Arrived |
825 |
my $strsth = "SELECT serialid |
826 |
FROM serial |
827 |
WHERE subscriptionid = ? |
828 |
AND status = 2 |
829 |
ORDER BY serialid DESC LIMIT $nth,1 |
830 |
"; |
831 |
my $sth = $dbh->prepare($strsth); |
832 |
$sth->execute($subscriptionid); |
833 |
my @serials; |
834 |
my $line = $sth->fetchrow_hashref; |
835 |
$return = $line->{'serialid'} if ($line); |
836 |
|
837 |
return $return; |
838 |
} |
839 |
|
840 |
|
841 |
|
808 |
=head2 GetDistributedTo |
842 |
=head2 GetDistributedTo |
809 |
|
843 |
|
810 |
$distributedto=GetDistributedTo($subscriptionid) |
844 |
$distributedto=GetDistributedTo($subscriptionid) |
Lines 1306-1312
sub ModSubscription {
Link Here
|
1306 |
$lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status, |
1340 |
$lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status, |
1307 |
$biblionumber, $callnumber, $notes, $letter, $manualhistory, |
1341 |
$biblionumber, $callnumber, $notes, $letter, $manualhistory, |
1308 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1342 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1309 |
$graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq |
1343 |
$graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq, |
|
|
1344 |
$itemtype, $previousitemtype |
1310 |
) = @_; |
1345 |
) = @_; |
1311 |
|
1346 |
|
1312 |
my $dbh = C4::Context->dbh; |
1347 |
my $dbh = C4::Context->dbh; |
Lines 1319-1325
sub ModSubscription {
Link Here
|
1319 |
callnumber=?, notes=?, letter=?, manualhistory=?, |
1354 |
callnumber=?, notes=?, letter=?, manualhistory=?, |
1320 |
internalnotes=?, serialsadditems=?, staffdisplaycount=?, |
1355 |
internalnotes=?, serialsadditems=?, staffdisplaycount=?, |
1321 |
opacdisplaycount=?, graceperiod=?, location = ?, enddate=?, |
1356 |
opacdisplaycount=?, graceperiod=?, location = ?, enddate=?, |
1322 |
skip_serialseq=? |
1357 |
skip_serialseq=?, itemtype=?, previousitemtype=? |
1323 |
WHERE subscriptionid = ?"; |
1358 |
WHERE subscriptionid = ?"; |
1324 |
|
1359 |
|
1325 |
my $sth = $dbh->prepare($query); |
1360 |
my $sth = $dbh->prepare($query); |
Lines 1333-1338
sub ModSubscription {
Link Here
|
1333 |
$letter, ($manualhistory ? $manualhistory : 0), |
1368 |
$letter, ($manualhistory ? $manualhistory : 0), |
1334 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1369 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1335 |
$graceperiod, $location, $enddate, $skip_serialseq, |
1370 |
$graceperiod, $location, $enddate, $skip_serialseq, |
|
|
1371 |
$itemtype, $previousitemtype, |
1336 |
$subscriptionid |
1372 |
$subscriptionid |
1337 |
); |
1373 |
); |
1338 |
my $rows = $sth->rows; |
1374 |
my $rows = $sth->rows; |
Lines 1348-1354
$subscriptionid = &NewSubscription($auser,branchcode,$aqbooksellerid,$cost,$aqbu
Link Here
|
1348 |
$lastvalue1,$innerloop1,$lastvalue2,$innerloop2,$lastvalue3,$innerloop3, |
1384 |
$lastvalue1,$innerloop1,$lastvalue2,$innerloop2,$lastvalue3,$innerloop3, |
1349 |
$status, $notes, $letter, $firstacquidate, $irregularity, $numberpattern, |
1385 |
$status, $notes, $letter, $firstacquidate, $irregularity, $numberpattern, |
1350 |
$locale, $callnumber, $manualhistory, $internalnotes, $serialsadditems, |
1386 |
$locale, $callnumber, $manualhistory, $internalnotes, $serialsadditems, |
1351 |
$staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq); |
1387 |
$staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, |
|
|
1388 |
$skip_serialseq, $itemtype, $previousitemtype); |
1352 |
|
1389 |
|
1353 |
Create a new subscription with value given on input args. |
1390 |
Create a new subscription with value given on input args. |
1354 |
|
1391 |
|
Lines 1365-1371
sub NewSubscription {
Link Here
|
1365 |
$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, |
1402 |
$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, |
1366 |
$numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, |
1403 |
$numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, |
1367 |
$serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, |
1404 |
$serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, |
1368 |
$location, $enddate, $skip_serialseq |
1405 |
$location, $enddate, $skip_serialseq, $itemtype, $previousitemtype |
1369 |
) = @_; |
1406 |
) = @_; |
1370 |
my $dbh = C4::Context->dbh; |
1407 |
my $dbh = C4::Context->dbh; |
1371 |
|
1408 |
|
Lines 1378-1385
sub NewSubscription {
Link Here
|
1378 |
lastvalue3, innerloop3, status, notes, letter, firstacquidate, |
1415 |
lastvalue3, innerloop3, status, notes, letter, firstacquidate, |
1379 |
irregularity, numberpattern, locale, callnumber, |
1416 |
irregularity, numberpattern, locale, callnumber, |
1380 |
manualhistory, internalnotes, serialsadditems, staffdisplaycount, |
1417 |
manualhistory, internalnotes, serialsadditems, staffdisplaycount, |
1381 |
opacdisplaycount, graceperiod, location, enddate, skip_serialseq) |
1418 |
opacdisplaycount, graceperiod, location, enddate, skip_serialseq, |
1382 |
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
1419 |
itemtype, previousitemtype) |
|
|
1420 |
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
1383 |
|; |
1421 |
|; |
1384 |
my $sth = $dbh->prepare($query); |
1422 |
my $sth = $dbh->prepare($query); |
1385 |
$sth->execute( |
1423 |
$sth->execute( |
Lines 1389-1395
sub NewSubscription {
Link Here
|
1389 |
$lastvalue3, $innerloop3, $status, $notes, $letter, |
1427 |
$lastvalue3, $innerloop3, $status, $notes, $letter, |
1390 |
$firstacquidate, $irregularity, $numberpattern, $locale, $callnumber, |
1428 |
$firstacquidate, $irregularity, $numberpattern, $locale, $callnumber, |
1391 |
$manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount, |
1429 |
$manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount, |
1392 |
$opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq |
1430 |
$opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq, |
|
|
1431 |
$itemtype, $previousitemtype |
1393 |
); |
1432 |
); |
1394 |
|
1433 |
|
1395 |
my $subscriptionid = $dbh->{'mysql_insertid'}; |
1434 |
my $subscriptionid = $dbh->{'mysql_insertid'}; |