Lines 32-38
use C4::Serials::Frequency;
Link Here
|
32 |
use C4::Serials::Numberpattern; |
32 |
use C4::Serials::Numberpattern; |
33 |
use Koha::AdditionalField; |
33 |
use Koha::AdditionalField; |
34 |
use Koha::DateUtils; |
34 |
use Koha::DateUtils; |
35 |
use Koha::Database; |
35 |
use Koha::Serial; |
|
|
36 |
use Koha::Subscriptions; |
37 |
use Koha::Subscription::Histories; |
36 |
|
38 |
|
37 |
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
39 |
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); |
38 |
|
40 |
|
Lines 1447-1454
sub NewSubscription {
Link Here
|
1447 |
# calculate issue number |
1449 |
# calculate issue number |
1448 |
my $serialseq = GetSeq($subscription, $pattern) || q{}; |
1450 |
my $serialseq = GetSeq($subscription, $pattern) || q{}; |
1449 |
|
1451 |
|
1450 |
my $serial_rs = Koha::Database->new()->schema()->resultset('Serial'); |
1452 |
Koha::Serial->new( |
1451 |
$serial_rs->create( |
|
|
1452 |
{ |
1453 |
{ |
1453 |
serialseq => $serialseq, |
1454 |
serialseq => $serialseq, |
1454 |
serialseq_x => $subscription->{'lastvalue1'}, |
1455 |
serialseq_x => $subscription->{'lastvalue1'}, |
Lines 1460-1466
sub NewSubscription {
Link Here
|
1460 |
planneddate => $firstacquidate, |
1461 |
planneddate => $firstacquidate, |
1461 |
publisheddate => $firstacquidate, |
1462 |
publisheddate => $firstacquidate, |
1462 |
} |
1463 |
} |
1463 |
); |
1464 |
)->store(); |
1464 |
|
1465 |
|
1465 |
logaction( "SERIAL", "ADD", $subscriptionid, "" ) if C4::Context->preference("SubscriptionLog"); |
1466 |
logaction( "SERIAL", "ADD", $subscriptionid, "" ) if C4::Context->preference("SubscriptionLog"); |
1466 |
|
1467 |
|
Lines 1560-1586
sub NewIssue {
Link Here
|
1560 |
|
1561 |
|
1561 |
my $schema = Koha::Database->new()->schema(); |
1562 |
my $schema = Koha::Database->new()->schema(); |
1562 |
|
1563 |
|
1563 |
my $subscription = $schema->resultset('Subscription')->find( $subscriptionid ); |
1564 |
my $subscription = Koha::Subscriptions->find( $subscriptionid ); |
1564 |
|
1565 |
|
1565 |
my $serial = $schema->resultset('Serial')->create( |
1566 |
my $serial = Koha::Serial->new( |
1566 |
{ |
1567 |
{ |
1567 |
serialseq => $serialseq, |
1568 |
serialseq => $serialseq, |
1568 |
serialseq_x => $subscription->lastvalue1(), |
1569 |
serialseq_x => $subscription->lastvalue1(), |
1569 |
serialseq_y => $subscription->lastvalue2(), |
1570 |
serialseq_y => $subscription->lastvalue2(), |
1570 |
serialseq_z => $subscription->lastvalue3(), |
1571 |
serialseq_z => $subscription->lastvalue3(), |
1571 |
subscriptionid => $subscriptionid, |
1572 |
subscriptionid => $subscriptionid, |
1572 |
biblionumber => $biblionumber, |
1573 |
biblionumber => $biblionumber, |
1573 |
status => $status, |
1574 |
status => $status, |
1574 |
planneddate => $planneddate, |
1575 |
planneddate => $planneddate, |
1575 |
publisheddate => $publisheddate, |
1576 |
publisheddate => $publisheddate, |
1576 |
publisheddatetext => $publisheddatetext, |
1577 |
publisheddatetext => $publisheddatetext, |
1577 |
notes => $notes, |
1578 |
notes => $notes, |
1578 |
} |
1579 |
} |
1579 |
); |
1580 |
)->store(); |
1580 |
|
1581 |
|
1581 |
my $serialid = $serial->id(); |
1582 |
my $serialid = $serial->id(); |
1582 |
|
1583 |
|
1583 |
my $subscription_history = $schema->resultset('Subscriptionhistory')->find($subscriptionid); |
1584 |
my $subscription_history = Koha::Subscription::Histories->find($subscriptionid); |
1584 |
my $missinglist = $subscription_history->missinglist(); |
1585 |
my $missinglist = $subscription_history->missinglist(); |
1585 |
my $recievedlist = $subscription_history->recievedlist(); |
1586 |
my $recievedlist = $subscription_history->recievedlist(); |
1586 |
|
1587 |
|