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

(-)a/generate_checkouts.pl (+35 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
use Modern::Perl;
4
use Koha::DateUtils qw ( dt_from_string );
5
use C4::Circulation qw( AddIssue );
6
use Koha::Patrons;
7
8
C4::Context->set_userenv(42, 51, 42, 'koha', '', 'CPL', 'Centerville');
9
10
my $datedue = dt_from_string->add( days => 2 );
11
my $p1 = Koha::Patrons->find(18);
12
my $p2 = Koha::Patrons->find(22);
13
my $p3 = Koha::Patrons->find(49);
14
my $p4 = Koha::Patrons->find(5);
15
16
AddIssue( $p1, 39999000002034, $datedue, undef, undef, { auto_renew => 1 } );
17
AddIssue( $p1, 39999000005417, $datedue, undef, undef, { auto_renew => 1 } );
18
AddIssue( $p2, 39999000010138, $datedue, undef, undef, { auto_renew => 1 } );
19
AddIssue( $p3, 39999000018653, $datedue, undef, undef, { auto_renew => 1 } );
20
AddIssue( $p3, 39999000006452, $datedue, undef, undef, { auto_renew => 1 } );
21
AddIssue( $p3, 39999000006773, $datedue, undef, undef, { auto_renew => 1 } );
22
AddIssue( $p1, 39999000010114, $datedue, undef, undef, { auto_renew => 1 } );
23
AddIssue( $p4, 39999000012897, $datedue, undef, undef, { auto_renew => 1 } ); 
24
AddIssue( $p2, 39999000008111, $datedue, undef, undef, { auto_renew => 1 } );
25
AddIssue( $p1, 39999000002331, $datedue, undef, undef, { auto_renew => 1 } );
26
AddIssue( $p1, 39999000008074, $datedue, undef, undef, { auto_renew => 1 } );
27
AddIssue( $p3, 39999000012958, $datedue, undef, undef, { auto_renew => 1 } );
28
AddIssue( $p3, 39999000014891, $datedue, undef, undef, { auto_renew => 1 } );
29
AddIssue( $p1, 39999000001358, $datedue, undef, undef, { auto_renew => 1 } );
30
AddIssue( $p1, 39999000014419, $datedue, undef, undef, { auto_renew => 1 } );
31
AddIssue( $p2, 39999000006759, $datedue, undef, undef, { auto_renew => 1 } );
32
AddIssue( $p2, 39999000001679, $datedue, undef, undef, { auto_renew => 1 } );
33
AddIssue( $p4, 39999000005455, $datedue, undef, undef, { auto_renew => 1 } ); 
34
AddIssue( $p4, 39999000001594, $datedue, undef, undef, { auto_renew => 1 } ); 
35
AddIssue( $p4, 39999000015331, $datedue, undef, undef, { auto_renew => 1 } );
(-)a/misc/cronjobs/automatic_renewals.pl (-1 / +3 lines)
Lines 161-168 if ( $loops > 1 ) { Link Here
161
        }
161
        }
162
        $i = 0 if $i >= $loops;
162
        $i = 0 if $i >= $loops;
163
        push( @{ $chunks[$i] }, $auto_renew );
163
        push( @{ $chunks[$i] }, $auto_renew );
164
165
        warn("Chunk $i - Borrowernumber:" . $auto_renew->borrowernumber . " Item " . $auto_renew->itemnumber);
164
    }
166
    }
165
    my $pm = Parallel::ForkManager->new($loops);
167
    my $pm = Parallel::ForkManager->new($loops);
168
166
DATA_LOOP:
169
DATA_LOOP:
167
    foreach my $chunk (@chunks) {
170
    foreach my $chunk (@chunks) {
168
        my $pid = $pm->start and next DATA_LOOP;
171
        my $pid = $pm->start and next DATA_LOOP;
169
- 

Return to bug 38156