|
Lines 1301-1337
sub ModNextExpected {
Link Here
|
| 1301 |
|
1301 |
|
| 1302 |
} |
1302 |
} |
| 1303 |
|
1303 |
|
| 1304 |
=head2 GetSubscriptionIrregularities |
|
|
| 1305 |
|
| 1306 |
=over 4 |
| 1307 |
|
| 1308 |
=item @irreg = &GetSubscriptionIrregularities($subscriptionid); |
| 1309 |
get the list of irregularities for a subscription |
| 1310 |
|
| 1311 |
=back |
| 1312 |
|
| 1313 |
=cut |
| 1314 |
|
| 1315 |
sub GetSubscriptionIrregularities { |
| 1316 |
my $subscriptionid = shift; |
| 1317 |
|
| 1318 |
return unless $subscriptionid; |
| 1319 |
|
| 1320 |
my $dbh = C4::Context->dbh; |
| 1321 |
my $query = qq{ |
| 1322 |
SELECT irregularity |
| 1323 |
FROM subscription |
| 1324 |
WHERE subscriptionid = ? |
| 1325 |
}; |
| 1326 |
my $sth = $dbh->prepare($query); |
| 1327 |
$sth->execute($subscriptionid); |
| 1328 |
|
| 1329 |
my ($result) = $sth->fetchrow_array; |
| 1330 |
my @irreg = split /;/, $result; |
| 1331 |
|
| 1332 |
return @irreg; |
| 1333 |
} |
| 1334 |
|
| 1335 |
=head2 ModSubscription |
1304 |
=head2 ModSubscription |
| 1336 |
|
1305 |
|
| 1337 |
this function modifies a subscription. Put all new values on input args. |
1306 |
this function modifies a subscription. Put all new values on input args. |
|
Lines 1342-1364
returns the number of rows affected
Link Here
|
| 1342 |
sub ModSubscription { |
1311 |
sub ModSubscription { |
| 1343 |
my ( |
1312 |
my ( |
| 1344 |
$auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $startdate, |
1313 |
$auser, $branchcode, $aqbooksellerid, $cost, $aqbudgetid, $startdate, |
| 1345 |
$periodicity, $firstacquidate, $irregularity, $numberpattern, $locale, |
1314 |
$periodicity, $firstacquidate, $irregularity, $permanent_irregularity, |
| 1346 |
$numberlength, $weeklength, $monthlength, $lastvalue1, $innerloop1, |
1315 |
$numberpattern, $locale, $numberlength, $weeklength, $monthlength, |
| 1347 |
$lastvalue2, $innerloop2, $lastvalue3, $innerloop3, $status, |
1316 |
$lastvalue1, $innerloop1, $lastvalue2, $innerloop2, $lastvalue3, |
| 1348 |
$biblionumber, $callnumber, $notes, $letter, $manualhistory, |
1317 |
$innerloop3, $status, $biblionumber, $callnumber, $notes, $letter, |
| 1349 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1318 |
$manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount, |
| 1350 |
$graceperiod, $location, $enddate, $subscriptionid, $skip_serialseq, |
1319 |
$opacdisplaycount, $graceperiod, $location, $enddate, $subscriptionid, |
| 1351 |
$itemtype, $previousitemtype |
1320 |
$skip_serialseq, $itemtype, $previousitemtype |
| 1352 |
) = @_; |
1321 |
) = @_; |
| 1353 |
|
1322 |
|
| 1354 |
my $dbh = C4::Context->dbh; |
1323 |
my $dbh = C4::Context->dbh; |
| 1355 |
my $query = "UPDATE subscription |
1324 |
my $query = "UPDATE subscription |
| 1356 |
SET librarian=?, branchcode=?, aqbooksellerid=?, cost=?, aqbudgetid=?, |
1325 |
SET librarian=?, branchcode=?, aqbooksellerid=?, cost=?, aqbudgetid=?, |
| 1357 |
startdate=?, periodicity=?, firstacquidate=?, irregularity=?, |
1326 |
startdate=?, periodicity=?, firstacquidate=?, irregularity=?, |
| 1358 |
numberpattern=?, locale=?, numberlength=?, weeklength=?, monthlength=?, |
1327 |
permanent_irregularity=?, numberpattern=?, locale=?, numberlength=?, |
| 1359 |
lastvalue1=?, innerloop1=?, lastvalue2=?, innerloop2=?, |
1328 |
weeklength=?, monthlength=?, lastvalue1=?, innerloop1=?, |
| 1360 |
lastvalue3=?, innerloop3=?, status=?, biblionumber=?, |
1329 |
lastvalue2=?, innerloop2=?, lastvalue3=?, innerloop3=?, status=?, |
| 1361 |
callnumber=?, notes=?, letter=?, manualhistory=?, |
1330 |
biblionumber=?, callnumber=?, notes=?, letter=?, manualhistory=?, |
| 1362 |
internalnotes=?, serialsadditems=?, staffdisplaycount=?, |
1331 |
internalnotes=?, serialsadditems=?, staffdisplaycount=?, |
| 1363 |
opacdisplaycount=?, graceperiod=?, location = ?, enddate=?, |
1332 |
opacdisplaycount=?, graceperiod=?, location = ?, enddate=?, |
| 1364 |
skip_serialseq=?, itemtype=?, previousitemtype=? |
1333 |
skip_serialseq=?, itemtype=?, previousitemtype=? |
|
Lines 1366-1382
sub ModSubscription {
Link Here
|
| 1366 |
|
1335 |
|
| 1367 |
my $sth = $dbh->prepare($query); |
1336 |
my $sth = $dbh->prepare($query); |
| 1368 |
$sth->execute( |
1337 |
$sth->execute( |
| 1369 |
$auser, $branchcode, $aqbooksellerid, $cost, |
1338 |
$auser, $branchcode, $aqbooksellerid, |
| 1370 |
$aqbudgetid, $startdate, $periodicity, $firstacquidate, |
1339 |
$cost, $aqbudgetid, $startdate, |
| 1371 |
$irregularity, $numberpattern, $locale, $numberlength, |
1340 |
$periodicity, $firstacquidate, $irregularity, |
| 1372 |
$weeklength, $monthlength, $lastvalue1, $innerloop1, |
1341 |
$permanent_irregularity, $numberpattern, $locale, |
| 1373 |
$lastvalue2, $innerloop2, $lastvalue3, $innerloop3, |
1342 |
$numberlength, $weeklength, $monthlength, |
| 1374 |
$status, $biblionumber, $callnumber, $notes, |
1343 |
$lastvalue1, $innerloop1, $lastvalue2, |
| 1375 |
$letter, ($manualhistory ? $manualhistory : 0), |
1344 |
$innerloop2, $lastvalue3, $innerloop3, |
| 1376 |
$internalnotes, $serialsadditems, $staffdisplaycount, $opacdisplaycount, |
1345 |
$status, $biblionumber, $callnumber, |
| 1377 |
$graceperiod, $location, $enddate, $skip_serialseq, |
1346 |
$notes, $letter, ($manualhistory ? $manualhistory : 0), |
| 1378 |
$itemtype, $previousitemtype, |
1347 |
$internalnotes, $serialsadditems, $staffdisplaycount, |
| 1379 |
$subscriptionid |
1348 |
$opacdisplaycount, $graceperiod, $location, |
|
|
1349 |
$enddate, $skip_serialseq, $itemtype, |
| 1350 |
$previousitemtype, $subscriptionid |
| 1380 |
); |
1351 |
); |
| 1381 |
my $rows = $sth->rows; |
1352 |
my $rows = $sth->rows; |
| 1382 |
|
1353 |
|
|
Lines 1407-1415
sub NewSubscription {
Link Here
|
| 1407 |
$startdate, $periodicity, $numberlength, $weeklength, $monthlength, |
1378 |
$startdate, $periodicity, $numberlength, $weeklength, $monthlength, |
| 1408 |
$lastvalue1, $innerloop1, $lastvalue2, $innerloop2, $lastvalue3, |
1379 |
$lastvalue1, $innerloop1, $lastvalue2, $innerloop2, $lastvalue3, |
| 1409 |
$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, |
1380 |
$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, |
| 1410 |
$numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, |
1381 |
$permanent_irregularity, $numberpattern, $locale, $callnumber, |
| 1411 |
$serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, |
1382 |
$manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount, |
| 1412 |
$location, $enddate, $skip_serialseq, $itemtype, $previousitemtype |
1383 |
$opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq, |
|
|
1384 |
$itemtype, $previousitemtype |
| 1413 |
) = @_; |
1385 |
) = @_; |
| 1414 |
my $dbh = C4::Context->dbh; |
1386 |
my $dbh = C4::Context->dbh; |
| 1415 |
|
1387 |
|
|
Lines 1420-1430
sub NewSubscription {
Link Here
|
| 1420 |
biblionumber, startdate, periodicity, numberlength, weeklength, |
1392 |
biblionumber, startdate, periodicity, numberlength, weeklength, |
| 1421 |
monthlength, lastvalue1, innerloop1, lastvalue2, innerloop2, |
1393 |
monthlength, lastvalue1, innerloop1, lastvalue2, innerloop2, |
| 1422 |
lastvalue3, innerloop3, status, notes, letter, firstacquidate, |
1394 |
lastvalue3, innerloop3, status, notes, letter, firstacquidate, |
| 1423 |
irregularity, numberpattern, locale, callnumber, |
1395 |
irregularity, permanent_irregularity, numberpattern, locale, |
| 1424 |
manualhistory, internalnotes, serialsadditems, staffdisplaycount, |
1396 |
callnumber, manualhistory, internalnotes, serialsadditems, |
| 1425 |
opacdisplaycount, graceperiod, location, enddate, skip_serialseq, |
1397 |
staffdisplaycount, opacdisplaycount, graceperiod, location, |
| 1426 |
itemtype, previousitemtype) |
1398 |
enddate, skip_serialseq, itemtype, previousitemtype) |
| 1427 |
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
1399 |
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
| 1428 |
|; |
1400 |
|; |
| 1429 |
my $sth = $dbh->prepare($query); |
1401 |
my $sth = $dbh->prepare($query); |
| 1430 |
$sth->execute( |
1402 |
$sth->execute( |
|
Lines 1432-1441
sub NewSubscription {
Link Here
|
| 1432 |
$startdate, $periodicity, $numberlength, $weeklength, |
1404 |
$startdate, $periodicity, $numberlength, $weeklength, |
| 1433 |
$monthlength, $lastvalue1, $innerloop1, $lastvalue2, $innerloop2, |
1405 |
$monthlength, $lastvalue1, $innerloop1, $lastvalue2, $innerloop2, |
| 1434 |
$lastvalue3, $innerloop3, $status, $notes, $letter, |
1406 |
$lastvalue3, $innerloop3, $status, $notes, $letter, |
| 1435 |
$firstacquidate, $irregularity, $numberpattern, $locale, $callnumber, |
1407 |
$firstacquidate, $irregularity, $permanent_irregularity, |
| 1436 |
$manualhistory, $internalnotes, $serialsadditems, $staffdisplaycount, |
1408 |
$numberpattern, $locale, $callnumber, $manualhistory, $internalnotes, |
| 1437 |
$opacdisplaycount, $graceperiod, $location, $enddate, $skip_serialseq, |
1409 |
$serialsadditems, $staffdisplaycount, $opacdisplaycount, $graceperiod, |
| 1438 |
$itemtype, $previousitemtype |
1410 |
$location, $enddate, $skip_serialseq, $itemtype, $previousitemtype |
| 1439 |
); |
1411 |
); |
| 1440 |
|
1412 |
|
| 1441 |
my $subscriptionid = $dbh->{'mysql_insertid'}; |
1413 |
my $subscriptionid = $dbh->{'mysql_insertid'}; |