Lines 328-334
sub GetFullSubscription {
Link Here
|
328 |
aqbooksellers.name as aqbooksellername, |
328 |
aqbooksellers.name as aqbooksellername, |
329 |
biblio.title as bibliotitle, |
329 |
biblio.title as bibliotitle, |
330 |
subscription.branchcode AS branchcode, |
330 |
subscription.branchcode AS branchcode, |
331 |
subscription.subscriptionid AS subscriptionid |
331 |
subscription.subscriptionid AS subscriptionid, |
|
|
332 |
subscription.preselect_issues_in_collections_table AS preselect_issues_in_collections_table |
332 |
FROM serial |
333 |
FROM serial |
333 |
LEFT JOIN subscription ON |
334 |
LEFT JOIN subscription ON |
334 |
(serial.subscriptionid=subscription.subscriptionid ) |
335 |
(serial.subscriptionid=subscription.subscriptionid ) |
Lines 373-378
sub PrepareSerialsData {
Link Here
|
373 |
|
374 |
|
374 |
foreach my $subs ( @{$lines} ) { |
375 |
foreach my $subs ( @{$lines} ) { |
375 |
$subs->{ "status" . $subs->{'status'} } = 1; |
376 |
$subs->{ "status" . $subs->{'status'} } = 1; |
|
|
377 |
if ( $subs->{preselect_issues_in_collections_table} && grep { $_ == $subs->{status} } |
378 |
( EXPECTED, LATE, MISSING_STATUSES, CLAIMED ) ) |
379 |
{ |
380 |
$subs->{"checked"} = 1; |
381 |
} |
376 |
if ($add_itemnumbers) { |
382 |
if ($add_itemnumbers) { |
377 |
my $serialitem = Koha::Serial::Items->find( { serialid => $subs->{'serialid'} } ); |
383 |
my $serialitem = Koha::Serial::Items->find( { serialid => $subs->{'serialid'} } ); |
378 |
$subs->{"itemnumber"} = $serialitem->itemnumber if $serialitem; |
384 |
$subs->{"itemnumber"} = $serialitem->itemnumber if $serialitem; |
Lines 470-476
sub GetFullSubscriptionsFromBiblionumber {
Link Here
|
470 |
biblio.title as bibliotitle, |
476 |
biblio.title as bibliotitle, |
471 |
subscription.branchcode AS branchcode, |
477 |
subscription.branchcode AS branchcode, |
472 |
subscription.subscriptionid AS subscriptionid, |
478 |
subscription.subscriptionid AS subscriptionid, |
473 |
subscription.location AS location |
479 |
subscription.location AS location, |
|
|
480 |
subscription.preselect_issues_in_collections_table AS preselect_issues_in_collections_table |
474 |
FROM serial |
481 |
FROM serial |
475 |
LEFT JOIN subscription ON |
482 |
LEFT JOIN subscription ON |
476 |
(serial.subscriptionid=subscription.subscriptionid) |
483 |
(serial.subscriptionid=subscription.subscriptionid) |
Lines 1341-1398
returns the number of rows affected
Link Here
|
1341 |
|
1348 |
|
1342 |
sub ModSubscription { |
1349 |
sub ModSubscription { |
1343 |
my ( |
1350 |
my ( |
1344 |
$auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $startdate, |
1351 |
$auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $startdate, |
1345 |
$periodicity, $firstacquidate, $irregularity, $numberpattern, $locale, |
1352 |
$periodicity, $firstacquidate, $irregularity, $numberpattern, $locale, |
1346 |
$numberlength, $weeklength, $monthlength, $lastvalue1, $innerloop1, |
1353 |
$numberlength, $weeklength, $monthlength, $lastvalue1, $innerloop1, |
1347 |
$lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status, |
1354 |
$lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status, |
1348 |
$biblionumber, $callnumber, $notes, $letter, $manualhistory, |
1355 |
$biblionumber, $callnumber, $notes, $letter, $manualhistory, |
1349 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1356 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1350 |
$graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq, |
1357 |
$graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq, |
1351 |
$itemtype, $previousitemtype, $mana_id, $ccode, $published_on_template |
1358 |
$itemtype, $previousitemtype, $mana_id, $ccode, $published_on_template, $preselect_issues_in_collections_table |
1352 |
) = @_; |
1359 |
) = @_; |
1353 |
|
1360 |
|
1354 |
my $subscription = Koha::Subscriptions->find($subscriptionid); |
1361 |
my $subscription = Koha::Subscriptions->find($subscriptionid); |
1355 |
$subscription->set( |
1362 |
$subscription->set( |
1356 |
{ |
1363 |
{ |
1357 |
librarian => $auser, |
1364 |
librarian => $auser, |
1358 |
branchcode => $branchcode, |
1365 |
branchcode => $branchcode, |
1359 |
aqbooksellerid => $aqbooksellerid, |
1366 |
aqbooksellerid => $aqbooksellerid, |
1360 |
cost => $cost, |
1367 |
cost => $cost, |
1361 |
aqbudgetid => $aqbudgetid, |
1368 |
aqbudgetid => $aqbudgetid, |
1362 |
biblionumber => $biblionumber, |
1369 |
biblionumber => $biblionumber, |
1363 |
startdate => $startdate, |
1370 |
startdate => $startdate, |
1364 |
periodicity => $periodicity, |
1371 |
periodicity => $periodicity, |
1365 |
numberlength => $numberlength, |
1372 |
numberlength => $numberlength, |
1366 |
weeklength => $weeklength, |
1373 |
weeklength => $weeklength, |
1367 |
monthlength => $monthlength, |
1374 |
monthlength => $monthlength, |
1368 |
lastvalue1 => $lastvalue1, |
1375 |
lastvalue1 => $lastvalue1, |
1369 |
innerloop1 => $innerloop1, |
1376 |
innerloop1 => $innerloop1, |
1370 |
lastvalue2 => $lastvalue2, |
1377 |
lastvalue2 => $lastvalue2, |
1371 |
innerloop2 => $innerloop2, |
1378 |
innerloop2 => $innerloop2, |
1372 |
lastvalue3 => $lastvalue3, |
1379 |
lastvalue3 => $lastvalue3, |
1373 |
innerloop3 => $innerloop3, |
1380 |
innerloop3 => $innerloop3, |
1374 |
status => $status, |
1381 |
status => $status, |
1375 |
notes => $notes, |
1382 |
notes => $notes, |
1376 |
letter => $letter, |
1383 |
letter => $letter, |
1377 |
firstacquidate => $firstacquidate, |
1384 |
firstacquidate => $firstacquidate, |
1378 |
irregularity => $irregularity, |
1385 |
irregularity => $irregularity, |
1379 |
numberpattern => $numberpattern, |
1386 |
numberpattern => $numberpattern, |
1380 |
locale => $locale, |
1387 |
locale => $locale, |
1381 |
callnumber => $callnumber, |
1388 |
callnumber => $callnumber, |
1382 |
manualhistory => $manualhistory, |
1389 |
manualhistory => $manualhistory, |
1383 |
internalnotes => $internalnotes, |
1390 |
internalnotes => $internalnotes, |
1384 |
serialsadditems => $serialsadditems, |
1391 |
serialsadditems => $serialsadditems, |
1385 |
staffdisplaycount => $staffdisplaycount, |
1392 |
staffdisplaycount => $staffdisplaycount, |
1386 |
opacdisplaycount => $opacdisplaycount, |
1393 |
opacdisplaycount => $opacdisplaycount, |
1387 |
graceperiod => $graceperiod, |
1394 |
graceperiod => $graceperiod, |
1388 |
location => $location, |
1395 |
location => $location, |
1389 |
enddate => $enddate, |
1396 |
enddate => $enddate, |
1390 |
skip_serialseq => $skip_serialseq, |
1397 |
skip_serialseq => $skip_serialseq, |
1391 |
itemtype => $itemtype, |
1398 |
itemtype => $itemtype, |
1392 |
previousitemtype => $previousitemtype, |
1399 |
previousitemtype => $previousitemtype, |
1393 |
mana_id => $mana_id, |
1400 |
mana_id => $mana_id, |
1394 |
ccode => $ccode, |
1401 |
ccode => $ccode, |
1395 |
published_on_template => $published_on_template, |
1402 |
published_on_template => $published_on_template, |
|
|
1403 |
preselect_issues_in_collections_table => $preselect_issues_in_collections_table, |
1396 |
} |
1404 |
} |
1397 |
)->store; |
1405 |
)->store; |
1398 |
|
1406 |
|
Lines 1425-1482
the id of this new subscription
Link Here
|
1425 |
|
1433 |
|
1426 |
sub NewSubscription { |
1434 |
sub NewSubscription { |
1427 |
my ( |
1435 |
my ( |
1428 |
$auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $biblionumber, |
1436 |
$auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $biblionumber, |
1429 |
$startdate, $periodicity, $numberlength, $weeklength, $monthlength, |
1437 |
$startdate, $periodicity, $numberlength, $weeklength, $monthlength, |
1430 |
$lastvalue1, $innerloop1, $lastvalue2, $innerloop2, $lastvalue3, |
1438 |
$lastvalue1, $innerloop1, $lastvalue2, $innerloop2, $lastvalue3, |
1431 |
$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, |
1439 |
$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, |
1432 |
$numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, |
1440 |
$numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, |
1433 |
$serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, |
1441 |
$serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, |
1434 |
$location, $enddate, $skip_serialseq, $itemtype, $previousitemtype, $mana_id, $ccode, |
1442 |
$location, $enddate, $skip_serialseq, $itemtype, $previousitemtype, $mana_id, $ccode, |
1435 |
$published_on_template, |
1443 |
$published_on_template, $preselect_issues_in_collections_table |
1436 |
) = @_; |
1444 |
) = @_; |
1437 |
my $dbh = C4::Context->dbh; |
1445 |
my $dbh = C4::Context->dbh; |
1438 |
|
1446 |
|
1439 |
my $subscription = Koha::Subscription->new( |
1447 |
my $subscription = Koha::Subscription->new( |
1440 |
{ |
1448 |
{ |
1441 |
librarian => $auser, |
1449 |
librarian => $auser, |
1442 |
branchcode => $branchcode, |
1450 |
branchcode => $branchcode, |
1443 |
aqbooksellerid => $aqbooksellerid, |
1451 |
aqbooksellerid => $aqbooksellerid, |
1444 |
cost => $cost, |
1452 |
cost => $cost, |
1445 |
aqbudgetid => $aqbudgetid, |
1453 |
aqbudgetid => $aqbudgetid, |
1446 |
biblionumber => $biblionumber, |
1454 |
biblionumber => $biblionumber, |
1447 |
startdate => $startdate, |
1455 |
startdate => $startdate, |
1448 |
periodicity => $periodicity, |
1456 |
periodicity => $periodicity, |
1449 |
numberlength => $numberlength, |
1457 |
numberlength => $numberlength, |
1450 |
weeklength => $weeklength, |
1458 |
weeklength => $weeklength, |
1451 |
monthlength => $monthlength, |
1459 |
monthlength => $monthlength, |
1452 |
lastvalue1 => $lastvalue1, |
1460 |
lastvalue1 => $lastvalue1, |
1453 |
innerloop1 => $innerloop1, |
1461 |
innerloop1 => $innerloop1, |
1454 |
lastvalue2 => $lastvalue2, |
1462 |
lastvalue2 => $lastvalue2, |
1455 |
innerloop2 => $innerloop2, |
1463 |
innerloop2 => $innerloop2, |
1456 |
lastvalue3 => $lastvalue3, |
1464 |
lastvalue3 => $lastvalue3, |
1457 |
innerloop3 => $innerloop3, |
1465 |
innerloop3 => $innerloop3, |
1458 |
status => $status, |
1466 |
status => $status, |
1459 |
notes => $notes, |
1467 |
notes => $notes, |
1460 |
letter => $letter, |
1468 |
letter => $letter, |
1461 |
firstacquidate => $firstacquidate, |
1469 |
firstacquidate => $firstacquidate, |
1462 |
irregularity => $irregularity, |
1470 |
irregularity => $irregularity, |
1463 |
numberpattern => $numberpattern, |
1471 |
numberpattern => $numberpattern, |
1464 |
locale => $locale, |
1472 |
locale => $locale, |
1465 |
callnumber => $callnumber, |
1473 |
callnumber => $callnumber, |
1466 |
manualhistory => $manualhistory, |
1474 |
manualhistory => $manualhistory, |
1467 |
internalnotes => $internalnotes, |
1475 |
internalnotes => $internalnotes, |
1468 |
serialsadditems => $serialsadditems, |
1476 |
serialsadditems => $serialsadditems, |
1469 |
staffdisplaycount => $staffdisplaycount, |
1477 |
staffdisplaycount => $staffdisplaycount, |
1470 |
opacdisplaycount => $opacdisplaycount, |
1478 |
opacdisplaycount => $opacdisplaycount, |
1471 |
graceperiod => $graceperiod, |
1479 |
graceperiod => $graceperiod, |
1472 |
location => $location, |
1480 |
location => $location, |
1473 |
enddate => $enddate, |
1481 |
enddate => $enddate, |
1474 |
skip_serialseq => $skip_serialseq, |
1482 |
skip_serialseq => $skip_serialseq, |
1475 |
itemtype => $itemtype, |
1483 |
itemtype => $itemtype, |
1476 |
previousitemtype => $previousitemtype, |
1484 |
previousitemtype => $previousitemtype, |
1477 |
mana_id => $mana_id, |
1485 |
mana_id => $mana_id, |
1478 |
ccode => $ccode, |
1486 |
ccode => $ccode, |
1479 |
published_on_template => $published_on_template, |
1487 |
published_on_template => $published_on_template, |
|
|
1488 |
preselect_issues_in_collections_table => $preselect_issues_in_collections_table, |
1480 |
} |
1489 |
} |
1481 |
)->store; |
1490 |
)->store; |
1482 |
$subscription->discard_changes; |
1491 |
$subscription->discard_changes; |