Lines 47-52
BEGIN {
Link Here
|
47 |
&ReNewSubscription &GetLateIssues &GetLateOrMissingIssues |
47 |
&ReNewSubscription &GetLateIssues &GetLateOrMissingIssues |
48 |
&GetSerialInformation &AddItem2Serial |
48 |
&GetSerialInformation &AddItem2Serial |
49 |
&PrepareSerialsData &GetNextExpected &ModNextExpected |
49 |
&PrepareSerialsData &GetNextExpected &ModNextExpected |
|
|
50 |
&GetPreviousSerialid |
50 |
|
51 |
|
51 |
&UpdateClaimdateIssues |
52 |
&UpdateClaimdateIssues |
52 |
&GetSuppliersWithLateIssues &getsupplierbyserialid |
53 |
&GetSuppliersWithLateIssues &getsupplierbyserialid |
Lines 824-829
sub GetLatestSerials {
Link Here
|
824 |
return \@serials; |
825 |
return \@serials; |
825 |
} |
826 |
} |
826 |
|
827 |
|
|
|
828 |
=head2 GetPreviousSerialid |
829 |
|
830 |
$serialid = GetPreviousSerialid($subscriptionid, $nth) |
831 |
get the $nth's previous serial for the given subscriptionid |
832 |
return : |
833 |
the serialid |
834 |
|
835 |
=cut |
836 |
|
837 |
sub GetPreviousSerialid { |
838 |
my ( $subscriptionid, $nth ) = @_; |
839 |
$nth ||= 1; |
840 |
my $dbh = C4::Context->dbh; |
841 |
my $return = undef; |
842 |
|
843 |
# Status 2: Arrived |
844 |
my $strsth = "SELECT serialid |
845 |
FROM serial |
846 |
WHERE subscriptionid = ? |
847 |
AND status = 2 |
848 |
ORDER BY serialid DESC LIMIT $nth,1 |
849 |
"; |
850 |
my $sth = $dbh->prepare($strsth); |
851 |
$sth->execute($subscriptionid); |
852 |
my @serials; |
853 |
my $line = $sth->fetchrow_hashref; |
854 |
$return = $line->{'serialid'} if ($line); |
855 |
|
856 |
return $return; |
857 |
} |
858 |
|
859 |
|
860 |
|
827 |
=head2 GetDistributedTo |
861 |
=head2 GetDistributedTo |
828 |
|
862 |
|
829 |
$distributedto=GetDistributedTo($subscriptionid) |
863 |
$distributedto=GetDistributedTo($subscriptionid) |
Lines 1225-1231
sub ModSubscription {
Link Here
|
1225 |
$whenmorethan1, $setto1, $lastvalue1, $innerloop1, $add2, $every2, $whenmorethan2, $setto2, |
1259 |
$whenmorethan1, $setto1, $lastvalue1, $innerloop1, $add2, $every2, $whenmorethan2, $setto2, |
1226 |
$lastvalue2, $innerloop2, $add3, $every3, $whenmorethan3, $setto3, $lastvalue3, $innerloop3, |
1260 |
$lastvalue2, $innerloop2, $add3, $every3, $whenmorethan3, $setto3, $lastvalue3, $innerloop3, |
1227 |
$numberingmethod, $status, $biblionumber, $callnumber, $notes, $letter, $hemisphere, $manualhistory, |
1261 |
$numberingmethod, $status, $biblionumber, $callnumber, $notes, $letter, $hemisphere, $manualhistory, |
1228 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $subscriptionid |
1262 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $itemtype, |
|
|
1263 |
$ccode, $origin, $domain, $previousitemtype, $subscriptionid |
1229 |
) = @_; |
1264 |
) = @_; |
1230 |
|
1265 |
|
1231 |
# warn $irregularity; |
1266 |
# warn $irregularity; |
Lines 1239-1245
sub ModSubscription {
Link Here
|
1239 |
numberingmethod=?, status=?, biblionumber=?, callnumber=?, notes=?, |
1274 |
numberingmethod=?, status=?, biblionumber=?, callnumber=?, notes=?, |
1240 |
letter=?, hemisphere=?,manualhistory=?,internalnotes=?,serialsadditems=?, |
1275 |
letter=?, hemisphere=?,manualhistory=?,internalnotes=?,serialsadditems=?, |
1241 |
staffdisplaycount = ?,opacdisplaycount = ?, graceperiod = ?, location = ? |
1276 |
staffdisplaycount = ?,opacdisplaycount = ?, graceperiod = ?, location = ? |
1242 |
,enddate=? |
1277 |
,enddate=?, itemtype=?, ccode=?, origin=?, domain=?, previousitemtype = ? |
1243 |
WHERE subscriptionid = ?"; |
1278 |
WHERE subscriptionid = ?"; |
1244 |
|
1279 |
|
1245 |
#warn "query :".$query; |
1280 |
#warn "query :".$query; |
Lines 1256-1265
sub ModSubscription {
Link Here
|
1256 |
$numberingmethod, $status, $biblionumber, $callnumber, |
1291 |
$numberingmethod, $status, $biblionumber, $callnumber, |
1257 |
$notes, $letter, $hemisphere, ( $manualhistory ? $manualhistory : 0 ), |
1292 |
$notes, $letter, $hemisphere, ( $manualhistory ? $manualhistory : 0 ), |
1258 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1293 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1259 |
$graceperiod, $location, $enddate, $subscriptionid |
1294 |
$graceperiod, $location, $enddate, $itemtype, |
|
|
1295 |
$ccode, $origin, $domain, $previousitemtype, |
1296 |
$subscriptionid |
1260 |
); |
1297 |
); |
1261 |
my $rows = $sth->rows; |
1298 |
my $rows = $sth->rows; |
1262 |
|
|
|
1263 |
logaction( "SERIAL", "MODIFY", $subscriptionid, "" ) if C4::Context->preference("SubscriptionLog"); |
1299 |
logaction( "SERIAL", "MODIFY", $subscriptionid, "" ) if C4::Context->preference("SubscriptionLog"); |
1264 |
return $rows; |
1300 |
return $rows; |
1265 |
} |
1301 |
} |
Lines 1287-1293
sub NewSubscription {
Link Here
|
1287 |
$lastvalue1, $innerloop1, $add2, $every2, $whenmorethan2, $setto2, $lastvalue2, $innerloop2, |
1323 |
$lastvalue1, $innerloop1, $add2, $every2, $whenmorethan2, $setto2, $lastvalue2, $innerloop2, |
1288 |
$add3, $every3, $whenmorethan3, $setto3, $lastvalue3, $innerloop3, $numberingmethod, $status, |
1324 |
$add3, $every3, $whenmorethan3, $setto3, $lastvalue3, $innerloop3, $numberingmethod, $status, |
1289 |
$notes, $letter, $firstacquidate, $irregularity, $numberpattern, $callnumber, $hemisphere, $manualhistory, |
1325 |
$notes, $letter, $firstacquidate, $irregularity, $numberpattern, $callnumber, $hemisphere, $manualhistory, |
1290 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate |
1326 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $itemtype, |
|
|
1327 |
$ccode, $origin, $domain, $previousitemtype |
1291 |
) = @_; |
1328 |
) = @_; |
1292 |
my $dbh = C4::Context->dbh; |
1329 |
my $dbh = C4::Context->dbh; |
1293 |
|
1330 |
|
Lines 1301-1308
sub NewSubscription {
Link Here
|
1301 |
add3,every3,whenmorethan3,setto3,lastvalue3,innerloop3, |
1338 |
add3,every3,whenmorethan3,setto3,lastvalue3,innerloop3, |
1302 |
numberingmethod, status, notes, letter,firstacquidate,irregularity, |
1339 |
numberingmethod, status, notes, letter,firstacquidate,irregularity, |
1303 |
numberpattern, callnumber, hemisphere,manualhistory,internalnotes,serialsadditems, |
1340 |
numberpattern, callnumber, hemisphere,manualhistory,internalnotes,serialsadditems, |
1304 |
staffdisplaycount,opacdisplaycount,graceperiod,location,enddate) |
1341 |
staffdisplaycount,opacdisplaycount,graceperiod,location,enddate, itemtype, ccode, origin, domain, previousitemtype) |
1305 |
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
1342 |
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
1306 |
|; |
1343 |
|; |
1307 |
my $sth = $dbh->prepare($query); |
1344 |
my $sth = $dbh->prepare($query); |
1308 |
$sth->execute( |
1345 |
$sth->execute( |
Lines 1311-1317
sub NewSubscription {
Link Here
|
1311 |
$lastvalue1, $innerloop1, $add2, $every2, $whenmorethan2, $setto2, $lastvalue2, $innerloop2, |
1348 |
$lastvalue1, $innerloop1, $add2, $every2, $whenmorethan2, $setto2, $lastvalue2, $innerloop2, |
1312 |
$add3, $every3, $whenmorethan3, $setto3, $lastvalue3, $innerloop3, $numberingmethod, "$status", |
1349 |
$add3, $every3, $whenmorethan3, $setto3, $lastvalue3, $innerloop3, $numberingmethod, "$status", |
1313 |
$notes, $letter, $firstacquidate, $irregularity, $numberpattern, $callnumber, $hemisphere, $manualhistory, |
1350 |
$notes, $letter, $firstacquidate, $irregularity, $numberpattern, $callnumber, $hemisphere, $manualhistory, |
1314 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate |
1351 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, $location, $enddate, $itemtype, |
|
|
1352 |
$ccode, $origin, $domain, $previousitemtype |
1315 |
); |
1353 |
); |
1316 |
|
1354 |
|
1317 |
my $subscriptionid = $dbh->{'mysql_insertid'}; |
1355 |
my $subscriptionid = $dbh->{'mysql_insertid'}; |