|
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', qw( NewSubscription GetSubscription NewIssue GetPreviousSerialid )); |
14 |
use_ok('C4::Serials', qw( NewSubscription GetSubscription NewIssue GetPreviousSerialid )); |
|
Lines 291-293
sub set_flags {
Link Here
|
| 291 |
); |
292 |
); |
| 292 |
} |
293 |
} |
| 293 |
} |
294 |
} |
| 294 |
- |
295 |
|
|
|
296 |
# test publication date as numbering pattern |
| 297 |
|
| 298 |
my $subscriptionid_pubdatenumpattern = NewSubscription( |
| 299 |
undef, $my_branch, undef, undef, $budget_id, $biblionumber, |
| 300 |
'2013-01-01', undef, undef, undef, undef, |
| 301 |
undef, undef, undef, undef, undef, |
| 302 |
undef, 1, "notes", undef, '2013-01-01', undef, |
| 303 |
undef, undef, undef, 0, "intnotes", |
| 304 |
0, undef, undef, 0, |
| 305 |
undef, '2013-12-31', 0, undef, undef, undef, |
| 306 |
'dmy' |
| 307 |
); |
| 308 |
|
| 309 |
my $serial_pubdatenumpattern = Koha::Serials->find({ subscriptionid => $subscriptionid_pubdatenumpattern }); |
| 310 |
|
| 311 |
is( $serial_pubdatenumpattern->serialseq, '01 January 2013', 'serialseq should be set to first acuisition date in the date format specified' ); |
| 312 |
|
| 313 |
ModSubscription( |
| 314 |
undef, $my_branch, undef, undef, $budget_id, '2013-01-01', |
| 315 |
undef, '2013-01-01', undef, undef, undef, |
| 316 |
undef, undef, undef, undef, undef, |
| 317 |
undef, undef, undef, undef, 1, |
| 318 |
$biblionumber, undef, "notes", undef, 0, |
| 319 |
"intnotes", 0, undef, undef, |
| 320 |
0, undef, '2013-12-31', $subscriptionid_pubdatenumpattern, 0, |
| 321 |
undef, undef, undef, 'ydm' |
| 322 |
); |
| 323 |
|
| 324 |
my $serialid_pubdatenumpattern = NewIssue( "pubdate", $subscriptionid_pubdatenumpattern, $biblionumber, 1 ); |
| 325 |
|
| 326 |
my $serial_pubdatenumpattern_2 = Koha::Serials->find( $serialid_pubdatenumpattern ); |
| 327 |
|
| 328 |
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' ); |