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

(-)a/t/db_dependent/Acquisition/OrderFromSubscription.t (-1 / +1 lines)
Lines 55-61 my $subscriptionid = NewSubscription( Link Here
55
    undef,        undef,   undef, undef,        undef, undef,
55
    undef,        undef,   undef, undef,        undef, undef,
56
    1,            "notes", undef, '2013-01-01', undef, undef,
56
    1,            "notes", undef, '2013-01-01', undef, undef,
57
    undef,        undef,   0,     "intnotes",   0,
57
    undef,        undef,   0,     "intnotes",   0,
58
    undef,        undef,   0,     undef,        '2013-12-31', 0
58
    undef,        undef,   0,     0,            undef, '2013-12-31', 0
59
);
59
);
60
die unless $subscriptionid;
60
die unless $subscriptionid;
61
61
(-)a/t/db_dependent/Koha/Acquisition/Booksellers.t (-2 / +2 lines)
Lines 107-113 subtest '->subscriptions() tests' => sub { Link Here
107
        undef,        1,             "subscription notes", undef,
107
        undef,        1,             "subscription notes", undef,
108
        '2013-01-01', undef,         undef,                undef,
108
        '2013-01-01', undef,         undef,                undef,
109
        'CALL ABC',   0,             "intnotes",           0,
109
        'CALL ABC',   0,             "intnotes",           0,
110
        undef,        undef,         0,                    undef,
110
        undef,        undef,         0,                    0, undef,
111
        '2013-11-30', 0
111
        '2013-11-30', 0
112
    );
112
    );
113
113
Lines 131-137 subtest '->subscriptions() tests' => sub { Link Here
131
        undef,        1,             "subscription notes", undef,
131
        undef,        1,             "subscription notes", undef,
132
        '2013-01-01', undef,         undef,                undef,
132
        '2013-01-01', undef,         undef,                undef,
133
        'CALL DEF',   0,             "intnotes",           0,
133
        'CALL DEF',   0,             "intnotes",           0,
134
        undef,        undef,         0,                    undef,
134
        undef,        undef,         0,                    0, undef,
135
        '2013-07-31', 0
135
        '2013-07-31', 0
136
    );
136
    );
137
137
(-)a/t/db_dependent/Koha/Serial.t (+26 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
use Modern::Perl;
4
5
use Test::More tests => 1;
6
7
use Koha::Database;
8
use t::lib::TestBuilder;
9
10
my $schema  = Koha::Database->schema;
11
my $builder = t::lib::TestBuilder->new;
12
13
subtest 'Koha::Serial::subscription' => sub {
14
    plan tests => 2;
15
16
    $schema->txn_begin;
17
18
    my $serial = $builder->build_object( { class => 'Koha::Serials' } );
19
20
    my $subscription = $serial->subscription;
21
22
    isa_ok( $subscription, 'Koha::Subscription' );
23
    is( $subscription->id, $serial->subscriptionid );
24
25
    $schema->txn_rollback;
26
};
(-)a/t/db_dependent/Letters.t (-2 / +2 lines)
Lines 731-737 t::lib::Mocks::mock_preference( 'KohaAdminEmailAddress', 'library@domain.com' ); Link Here
731
        undef,        undef,  undef, undef,          undef, undef,
731
        undef,        undef,  undef, undef,          undef, undef,
732
        1,            $notes, undef, '2013-01-01',   undef, $number_pattern->id,
732
        1,            $notes, undef, '2013-01-01',   undef, $number_pattern->id,
733
        undef,        undef,  0,     $internalnotes, 0,
733
        undef,        undef,  0,     $internalnotes, 0,
734
        undef,        undef,  0,     undef,          '2013-12-31', 0
734
        undef,        undef,  0,     0,              undef, '2013-12-31', 0
735
    );
735
    );
736
    $dbh->do(
736
    $dbh->do(
737
        q{INSERT INTO letter (module, code, name, title, content) VALUES ('serial','RLIST','Serial issue notification','Serial issue notification','<<biblio.title>>,<<subscription.subscriptionid>>,<<serial.serialseq>>');}
737
        q{INSERT INTO letter (module, code, name, title, content) VALUES ('serial','RLIST','Serial issue notification','Serial issue notification','<<biblio.title>>,<<subscription.subscriptionid>>,<<serial.serialseq>>');}
Lines 864-870 subtest 'SendAlerts - claimissue' => sub { Link Here
864
        undef,        undef,    undef,         undef,        undef, undef,
864
        undef,        undef,    undef,         undef,        undef, undef,
865
        1,            'public', undef,         '2013-01-01', undef, $number_pattern->id,
865
        1,            'public', undef,         '2013-01-01', undef, $number_pattern->id,
866
        undef,        undef,    0,             'internal',   0,
866
        undef,        undef,    0,             'internal',   0,
867
        undef,        undef,    0,             undef,        '2013-12-31', 0
867
        undef,        undef,    0,             0,            undef, '2013-12-31', 0
868
    );
868
    );
869
869
870
    my ( $serials_count, @serials ) = GetSerials($subscriptionid);
870
    my ( $serials_count, @serials ) = GetSerials($subscriptionid);
(-)a/t/db_dependent/Serials.t (-5 / +7 lines)
Lines 127-132 my $subscriptionid = NewSubscription( Link Here
127
    undef,
127
    undef,
128
    undef,
128
    undef,
129
    0,
129
    0,
130
    0,
130
    undef,
131
    undef,
131
    '2013-12-31', 0,
132
    '2013-12-31', 0,
132
    undef,
133
    undef,
Lines 167-172 NewSubscription( Link Here
167
    undef,
168
    undef,
168
    undef,
169
    undef,
169
    0,
170
    0,
171
    0,
170
    undef,
172
    undef,
171
    '2013-12-31',
173
    '2013-12-31',
172
    0,
174
    0,
Lines 222-228 my $subscriptionwithroutinglistid = NewSubscription( Link Here
222
    undef,        undef,         undef, undef,          undef, undef,
224
    undef,        undef,         undef, undef,          undef, undef,
223
    1,            $notes,        undef, '2013-01-01',   undef, $pattern_id,
225
    1,            $notes,        undef, '2013-01-01',   undef, $pattern_id,
224
    undef,        undef,         0,     $internalnotes, 0,
226
    undef,        undef,         0,     $internalnotes, 0,
225
    undef,        undef,         0,     undef,          '2013-12-31', 0
227
    undef,        undef,         0,     0,              undef, '2013-12-31', 0
226
);
228
);
227
229
228
#creating fake patrons
230
#creating fake patrons
Lines 290-296 if ( not $frequency->{unit} ) { Link Here
290
                numberlength weeklength monthlength lastvalue1 innerloop1 lastvalue2
292
                numberlength weeklength monthlength lastvalue1 innerloop1 lastvalue2
291
                innerloop2 lastvalue3 innerloop3 status biblionumber callnumber notes
293
                innerloop2 lastvalue3 innerloop3 status biblionumber callnumber notes
292
                letter manualhistory internalnotes serialsadditems staffdisplaycount
294
                letter manualhistory internalnotes serialsadditems staffdisplaycount
293
                opacdisplaycount graceperiod location enddate subscriptionid
295
                opacdisplaycount graceperiod warn_when_late location enddate subscriptionid
294
                skip_serialseq itemtype previousitemtype mana_id ccode
296
                skip_serialseq itemtype previousitemtype mana_id ccode
295
            )
297
            )
296
        }
298
        }
Lines 358-364 if ($old_frequency) { Link Here
358
                numberlength weeklength monthlength lastvalue1 innerloop1 lastvalue2
360
                numberlength weeklength monthlength lastvalue1 innerloop1 lastvalue2
359
                innerloop2 lastvalue3 innerloop3 status biblionumber callnumber notes
361
                innerloop2 lastvalue3 innerloop3 status biblionumber callnumber notes
360
                letter manualhistory internalnotes serialsadditems staffdisplaycount
362
                letter manualhistory internalnotes serialsadditems staffdisplaycount
361
                opacdisplaycount graceperiod location enddate subscriptionid
363
                opacdisplaycount graceperiod warn_when_late location enddate subscriptionid
362
                skip_serialseq
364
                skip_serialseq
363
            )
365
            )
364
        }
366
        }
Lines 669-675 subtest "NewSubscription|ModSubscription" => sub { Link Here
669
        "",           "",            "", "",             "", "",
671
        "",           "",            "", "",             "", "",
670
        1,            $notes,        "", '2013-01-01',   "", $pattern_id,
672
        1,            $notes,        "", '2013-01-01',   "", $pattern_id,
671
        "",           "",            0,  $internalnotes, 0,
673
        "",           "",            0,  $internalnotes, 0,
672
        "",           "",            0,  "",             '2013-12-31', 0
674
        "",           "",            0,  0,              "", '2013-12-31', 0
673
    );
675
    );
674
    ok( $subscriptionid, "Sending empty string instead of undef to reflect use of the interface" );
676
    ok( $subscriptionid, "Sending empty string instead of undef to reflect use of the interface" );
675
677
Lines 688-694 subtest "NewSubscription|ModSubscription" => sub { Link Here
688
                numberlength weeklength monthlength lastvalue1 innerloop1 lastvalue2
690
                numberlength weeklength monthlength lastvalue1 innerloop1 lastvalue2
689
                innerloop2 lastvalue3 innerloop3 status biblionumber callnumber notes
691
                innerloop2 lastvalue3 innerloop3 status biblionumber callnumber notes
690
                letter manualhistory internalnotes serialsadditems staffdisplaycount
692
                letter manualhistory internalnotes serialsadditems staffdisplaycount
691
                opacdisplaycount graceperiod location enddate subscriptionid
693
                opacdisplaycount graceperiod warn_when_late location enddate subscriptionid
692
                skip_serialseq
694
                skip_serialseq
693
            )
695
            )
694
        }
696
        }
(-)a/t/db_dependent/Serials/Claims.t (-4 / +4 lines)
Lines 97-103 my $subscriptionid_not_late = NewSubscription( Link Here
97
    undef,        undef,       undef,         undef,        undef, undef,
97
    undef,        undef,       undef,         undef,        undef, undef,
98
    1,            "notes",     undef,         '9999-01-01', undef, undef,
98
    1,            "notes",     undef,         '9999-01-01', undef, undef,
99
    undef,        undef,       0,             "intnotes",   0,
99
    undef,        undef,       0,             "intnotes",   0,
100
    undef,        undef,       0,             undef,        '2013-12-31', 0
100
    undef,        undef,       0,             0,            undef, '2013-12-31', 0
101
);
101
);
102
$supplierlist = GetSuppliersWithLateIssues();
102
$supplierlist = GetSuppliersWithLateIssues();
103
is( scalar(@$supplierlist), 0, 'There is still no late issues yet' );
103
is( scalar(@$supplierlist), 0, 'There is still no late issues yet' );
Lines 108-114 my $subscriptionid_inlate1 = NewSubscription( Link Here
108
    undef,        undef,       undef,         undef,        undef, undef,
108
    undef,        undef,       undef,         undef,        undef, undef,
109
    1,            "notes",     undef,         '2013-01-01', undef, undef,
109
    1,            "notes",     undef,         '2013-01-01', undef, undef,
110
    undef,        undef,       0,             "intnotes",   0,
110
    undef,        undef,       0,             "intnotes",   0,
111
    undef,        undef,       0,             undef,        '2013-12-31', 0
111
    undef,        undef,       0,             0,            undef, '2013-12-31', 0
112
);
112
);
113
113
114
my $subscriptionid_inlate2 = NewSubscription(
114
my $subscriptionid_inlate2 = NewSubscription(
Lines 117-123 my $subscriptionid_inlate2 = NewSubscription( Link Here
117
    undef,        undef,       undef,         undef,        undef, undef,
117
    undef,        undef,       undef,         undef,        undef, undef,
118
    1,            "notes",     undef,         '2013-01-01', undef, undef,
118
    1,            "notes",     undef,         '2013-01-01', undef, undef,
119
    undef,        undef,       0,             "intnotes",   0,
119
    undef,        undef,       0,             "intnotes",   0,
120
    undef,        undef,       0,             undef,        '2013-12-31', 0
120
    undef,        undef,       0,             0,            undef, '2013-12-31', 0
121
);
121
);
122
122
123
my $subscriptionid_inlate3 = NewSubscription(
123
my $subscriptionid_inlate3 = NewSubscription(
Lines 126-132 my $subscriptionid_inlate3 = NewSubscription( Link Here
126
    undef,        undef,       undef,         undef,        undef, undef,
126
    undef,        undef,       undef,         undef,        undef, undef,
127
    1,            "notes",     undef,         '2013-01-02', undef, undef,
127
    1,            "notes",     undef,         '2013-01-02', undef, undef,
128
    undef,        undef,       0,             "intnotes",   0,
128
    undef,        undef,       0,             "intnotes",   0,
129
    undef,        undef,       0,             undef,        '2013-12-31', 0
129
    undef,        undef,       0,             0,            undef, '2013-12-31', 0
130
);
130
);
131
131
132
$supplierlist = GetSuppliersWithLateIssues();
132
$supplierlist = GetSuppliersWithLateIssues();
(-)a/t/db_dependent/Serials/ReNewSubscription.t (-1 / +1 lines)
Lines 28-34 use Test::MockModule; Link Here
28
use t::lib::TestBuilder;
28
use t::lib::TestBuilder;
29
use t::lib::Mocks;
29
use t::lib::Mocks;
30
30
31
use C4::Serials qw( NewSubscription ReNewSubscription GetSubscription GetSubscriptionLength );
31
use C4::Serials qw( ReNewSubscription GetSubscription GetSubscriptionLength );
32
32
33
use Koha::Database;
33
use Koha::Database;
34
use Koha::Subscription::Histories;
34
use Koha::Subscription::Histories;
(-)a/t/db_dependent/Serials/updateClaim.t (-1 / +1 lines)
Lines 24-30 my $subscriptionid_claims = C4::Serials::NewSubscription( Link Here
24
    undef,        undef,       undef, undef,        undef, undef,
24
    undef,        undef,       undef, undef,        undef, undef,
25
    1,            "notes",     undef, '9999-01-01', undef, undef,
25
    1,            "notes",     undef, '9999-01-01', undef, undef,
26
    undef,        undef,       0,     "intnotes",   0,
26
    undef,        undef,       0,     "intnotes",   0,
27
    undef,        undef,       0,     undef,        '2013-12-31', 0
27
    undef,        undef,       0,     0,            undef, '2013-12-31', 0
28
);
28
);
29
29
30
# Verify and get the serial ID of the subscription
30
# Verify and get the serial ID of the subscription
(-)a/t/db_dependent/Serials_2.t (-3 / +2 lines)
Lines 66-72 my $subscriptionid_from_my_branch = NewSubscription( Link Here
66
    undef,        undef,      undef, undef,        undef, undef,
66
    undef,        undef,      undef, undef,        undef, undef,
67
    1,            "notes",    undef, '2013-01-01', undef, undef,
67
    1,            "notes",    undef, '2013-01-01', undef, undef,
68
    undef,        undef,      0,     "intnotes",   0,
68
    undef,        undef,      0,     "intnotes",   0,
69
    undef,        undef,      0,     undef,        '2013-12-31', 0
69
    undef,        undef,      0,     0,            undef, '2013-12-31', 0
70
);
70
);
71
die unless $subscriptionid_from_my_branch;
71
die unless $subscriptionid_from_my_branch;
72
72
Lines 76-82 my $subscriptionid_from_another_branch = NewSubscription( Link Here
76
    undef,        undef,           undef, undef,        undef, undef,
76
    undef,        undef,           undef, undef,        undef, undef,
77
    1,            "notes",         undef, '2013-01-01', undef, undef,
77
    1,            "notes",         undef, '2013-01-01', undef, undef,
78
    undef,        undef,           0,     "intnotes",   0,
78
    undef,        undef,           0,     "intnotes",   0,
79
    undef,        undef,           0,     undef,        '2013-12-31', 0
79
    undef,        undef,           0,     0,            undef, '2013-12-31', 0
80
);
80
);
81
81
82
my $subscription_from_my_branch = GetSubscription($subscriptionid_from_my_branch);
82
my $subscription_from_my_branch = GetSubscription($subscriptionid_from_my_branch);
83
- 

Return to bug 29996