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

(-)a/C4/Serials.pm (-1 / +1 lines)
Lines 954-960 the sequence in string format Link Here
954
sub GetSeq {
954
sub GetSeq {
955
    my ($subscription, $pattern) = @_;
955
    my ($subscription, $pattern) = @_;
956
956
957
    if ($pattern->{numberingmethod} eq ''){
957
    if ( !defined($pattern->{numberingmethod}) ){
958
        return "pubdate";
958
        return "pubdate";
959
    }
959
    }
960
960
(-)a/t/db_dependent/Serials.t (-1 / +2 lines)
Lines 223-229 is(C4::Serials::GetLatestSerials(), undef, 'test getting lastest serials'); Link Here
223
223
224
is(C4::Serials::GetNextSeq(), undef, 'test getting next seq when you enter nothing');
224
is(C4::Serials::GetNextSeq(), undef, 'test getting next seq when you enter nothing');
225
225
226
is(C4::Serials::GetSeq(), undef, 'test getting seq when you enter nothing');
226
is(C4::Serials::GetSeq(), 'pubdate', 'test getting seq when you enter nothing');
227
# no input means assume using publication date as numbering pattern
227
228
228
is(C4::Serials::CountSubscriptionFromBiblionumber(), undef, 'test counting subscription when nothing is entered');
229
is(C4::Serials::CountSubscriptionFromBiblionumber(), undef, 'test counting subscription when nothing is entered');
229
230
(-)a/t/db_dependent/Serials_2.t (-2 / +36 lines)
Lines 1-13 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
use Modern::Perl;
2
use Modern::Perl;
3
3
4
use Test::More tests => 50;
4
use Test::More tests => 52;
5
5
6
use MARC::Record;
6
use MARC::Record;
7
7
8
use C4::Biblio qw( AddBiblio );
8
use C4::Biblio qw( AddBiblio );
9
use Koha::Database;
9
use Koha::Database;
10
use Koha::Patrons;
10
use Koha::Patrons;
11
use Koha::DateUtils qw( dt_from_string );
11
use t::lib::Mocks;
12
use t::lib::Mocks;
12
use t::lib::TestBuilder;
13
use t::lib::TestBuilder;
13
use_ok('C4::Serials');
14
use_ok('C4::Serials');
Lines 293-295 sub set_flags { Link Here
293
        );
294
        );
294
    }
295
    }
295
}
296
}
296
- 
297
298
# test publication date as numbering pattern
299
300
my $subscriptionid_pubdatenumpattern = NewSubscription(
301
    undef, $my_branch, undef, undef, $budget_id, $biblionumber,
302
    '2013-01-01', undef, undef, undef,  undef,
303
    undef, undef, undef, undef, undef,
304
    undef, 1, "notes", undef, '2013-01-01', undef,
305
    undef, undef, undef,  0, "intnotes",
306
    0, undef, undef, 0,
307
    undef, '2013-12-31', 0, undef, undef, undef,
308
    'dmy'
309
);
310
311
my $serial_pubdatenumpattern = Koha::Serials->find({ subscriptionid => $subscriptionid_pubdatenumpattern });
312
313
is( $serial_pubdatenumpattern->serialseq, '01 January 2013', 'serialseq should be set to first acuisition date in the date format specified' );
314
315
ModSubscription(
316
    undef, $my_branch, undef, undef, $budget_id, '2013-01-01',
317
    undef, '2013-01-01', undef, undef, undef,
318
    undef, undef, undef, undef, undef,
319
    undef, undef, undef, undef, 1,
320
    $biblionumber, undef, "notes", undef, 0,
321
    "intnotes",  0, undef, undef,
322
    0, undef, '2013-12-31', $subscriptionid_pubdatenumpattern, 0,
323
    undef, undef, undef, 'ydm'
324
);
325
326
my $serialid_pubdatenumpattern = NewIssue( "pubdate", $subscriptionid_pubdatenumpattern, $biblionumber, 1 );
327
328
my $serial_pubdatenumpattern_2 = Koha::Serials->find( $serialid_pubdatenumpattern );
329
330
is( $serial_pubdatenumpattern_2->serialseq, dt_from_string( $serial_pubdatenumpattern_2->publisheddate )->strftime('%Y %d %B'), 'receive new issue with new pub date num pattern format' );

Return to bug 22188