View | Details | Raw Unified | Return to bug 12375
Collapse All | Expand All

(-)a/C4/Serials.pm (-18 / +19 lines)
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
(-)a/Koha/Serial.pm (+52 lines)
Line 0 Link Here
1
package Koha::Serial;
2
3
# Copyright ByWater Solutions 2015
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Carp;
23
24
use Koha::Database;
25
26
use base qw(Koha::Object);
27
28
=head1 NAME
29
30
Koha::Serial - Koha Serial Object class
31
32
=head1 API
33
34
=head2 Class Methods
35
36
=cut
37
38
=head3 type
39
40
=cut
41
42
sub type {
43
    return 'Serial';
44
}
45
46
=head1 AUTHOR
47
48
Kyle M Hall <kyle@bywatersolutions.com>
49
50
=cut
51
52
1;
(-)a/Koha/Serials.pm (+58 lines)
Line 0 Link Here
1
package Koha::Serials;
2
3
# Copyright ByWater Solutions 2015
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Carp;
23
24
use Koha::Database;
25
26
use Koha::Serial;
27
28
use base qw(Koha::Objects);
29
30
=head1 NAME
31
32
Koha::Serial - Koha Serial Object class
33
34
=head1 API
35
36
=head2 Class Methods
37
38
=cut
39
40
=head3 type
41
42
=cut
43
44
sub type {
45
    return 'Serial';
46
}
47
48
sub object_class {
49
    return 'Koha::Serial';
50
}
51
52
=head1 AUTHOR
53
54
Kyle M Hall <kyle@bywatersolutions.com>
55
56
=cut
57
58
1;
(-)a/Koha/Subscription.pm (+52 lines)
Line 0 Link Here
1
package Koha::Subscription;
2
3
# Copyright ByWater Solutions 2015
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Carp;
23
24
use Koha::Database;
25
26
use base qw(Koha::Object);
27
28
=head1 NAME
29
30
Koha::Subscription - Koha Subscription Object class
31
32
=head1 API
33
34
=head2 Class Methods
35
36
=cut
37
38
=head3 type
39
40
=cut
41
42
sub type {
43
    return 'Subscription';
44
}
45
46
=head1 AUTHOR
47
48
Kyle M Hall <kyle@bywatersolutions.com>
49
50
=cut
51
52
1;
(-)a/Koha/Subscription/Histories.pm (+58 lines)
Line 0 Link Here
1
package Koha::Subscription::Histories;
2
3
# Copyright ByWater Solutions 2015
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Carp;
23
24
use Koha::Database;
25
26
use Koha::Subscription::History;
27
28
use base qw(Koha::Objects);
29
30
=head1 NAME
31
32
Koha::Subscription::Histories - Koha Subscription Histories Object class
33
34
=head1 API
35
36
=head2 Class Methods
37
38
=cut
39
40
=head3 type
41
42
=cut
43
44
sub type {
45
    return 'Subscriptionhistory';
46
}
47
48
sub object_class {
49
    return 'Koha::Subscription::History';
50
}
51
52
=head1 AUTHOR
53
54
Kyle M Hall <kyle@bywatersolutions.com>
55
56
=cut
57
58
1;
(-)a/Koha/Subscription/History.pm (+52 lines)
Line 0 Link Here
1
package Koha::Subscription::History;
2
3
# Copyright ByWater Solutions 2015
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Carp;
23
24
use Koha::Database;
25
26
use base qw(Koha::Object);
27
28
=head1 NAME
29
30
Koha::Subscription::History - Koha Subscription History Object class
31
32
=head1 API
33
34
=head2 Class Methods
35
36
=cut
37
38
=head3 type
39
40
=cut
41
42
sub type {
43
    return 'Subscriptionhistory';
44
}
45
46
=head1 AUTHOR
47
48
Kyle M Hall <kyle@bywatersolutions.com>
49
50
=cut
51
52
1;
(-)a/Koha/Subscriptions.pm (-1 / +58 lines)
Line 0 Link Here
0
- 
1
package Koha::Subscriptions;
2
3
# Copyright ByWater Solutions 2015
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 3 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use Modern::Perl;
21
22
use Carp;
23
24
use Koha::Database;
25
26
use Koha::Subscription;
27
28
use base qw(Koha::Objects);
29
30
=head1 NAME
31
32
Koha::Subscription - Koha Subscription Object class
33
34
=head1 API
35
36
=head2 Class Methods
37
38
=cut
39
40
=head3 type
41
42
=cut
43
44
sub type {
45
    return 'Subscription';
46
}
47
48
sub object_class {
49
    return 'Koha::Subscription';
50
}
51
52
=head1 AUTHOR
53
54
Kyle M Hall <kyle@bywatersolutions.com>
55
56
=cut
57
58
1;

Return to bug 12375