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

(-)a/misc/cronjobs/cleanup_database.pl (-22 / +17 lines)
Lines 81-108 USAGE Link Here
81
    exit $_[0];
81
    exit $_[0];
82
}
82
}
83
83
84
my (
84
my $help;
85
    $help,
85
my $sessions;
86
    $sessions,
86
my $sess_days;
87
    $sess_days,
87
my $verbose;
88
    $verbose,
88
my $zebraqueue_days;
89
    $zebraqueue_days,
89
my $mail;
90
    $mail,
90
my $purge_merged;
91
    $purge_merged,
91
my $pImport;
92
    $pImport,
92
my $pLogs;
93
    $pLogs,
93
my $pSearchhistory;
94
    $pSearchhistory,
94
my $pZ3950;
95
    $pZ3950,
95
my $pListShareInvites;
96
    $pListShareInvites,
96
my $pDebarments;
97
    $pDebarments,
97
my $allDebarments;
98
    $allDebarments,
98
my $pExpSelfReg;
99
    $pExpSelfReg,
99
my $pUnvSelfReg;
100
    $pUnvSelfReg,
100
my $fees_days;
101
    $fees_days
102
    $help,   $sessions,          $sess_days, $verbose, $zebraqueue_days,
103
    $mail,   $purge_merged,      $pImport,   $pLogs,   $pSearchhistory,
104
    $pZ3950, $pListShareInvites, $pDebarments, $allDebarments,
105
);
106
101
107
GetOptions(
102
GetOptions(
108
    'h|help'          => \$help,
103
    'h|help'          => \$help,
(-)a/t/db_dependent/Accounts.t (-7 / +7 lines)
Lines 59-65 $dbh->do(q|DELETE FROM issues|); Link Here
59
$dbh->do(q|DELETE FROM borrowers|);
59
$dbh->do(q|DELETE FROM borrowers|);
60
60
61
my $branchcode = 'CPL';
61
my $branchcode = 'CPL';
62
my $borrower_number;
63
62
64
my $context = new Test::MockModule('C4::Context');
63
my $context = new Test::MockModule('C4::Context');
65
$context->mock( 'userenv', sub {
64
$context->mock( 'userenv', sub {
Lines 77-83 $context->mock( 'userenv', sub { Link Here
77
# 1 => yesterday
76
# 1 => yesterday
78
# etc.
77
# etc.
79
78
80
$sth = $dbh->prepare(
79
my $sth = $dbh->prepare(
81
    "INSERT INTO accountlines (
80
    "INSERT INTO accountlines (
82
         borrowernumber,
81
         borrowernumber,
83
         amountoutstanding,
82
         amountoutstanding,
Lines 95-109 my @test_data = ( Link Here
95
    { amount => 0     , days_ago => $days     , description =>'purge_zero_balance_fees should not delete 0 balance fees with date on threshold day'          , delete => 0 } ,
94
    { amount => 0     , days_ago => $days     , description =>'purge_zero_balance_fees should not delete 0 balance fees with date on threshold day'          , delete => 0 } ,
96
    { amount => 0     , days_ago => $days + 1 , description =>'purge_zero_balance_fees should delete 0 balance fees with date after threshold day'           , delete => 1 } ,
95
    { amount => 0     , days_ago => $days + 1 , description =>'purge_zero_balance_fees should delete 0 balance fees with date after threshold day'           , delete => 1 } ,
97
    { amount => undef , days_ago => $days + 1 , description =>'purge_zero_balance_fees should delete NULL balance fees with date after threshold day'        , delete => 1 } ,
96
    { amount => undef , days_ago => $days + 1 , description =>'purge_zero_balance_fees should delete NULL balance fees with date after threshold day'        , delete => 1 } ,
98
    { amount => 5     , days_ago => $days - 1 , description =>'purge_zero_balance_fees should not delete fees with postive amout owed before threshold day'  , delete => 0 } ,
97
    { amount => 5     , days_ago => $days - 1 , description =>'purge_zero_balance_fees should not delete fees with positive amout owed before threshold day'  , delete => 0 } ,
99
    { amount => 5     , days_ago => $days     , description =>'purge_zero_balance_fees should not delete fees with postive amout owed on threshold day'      , delete => 0 } ,
98
    { amount => 5     , days_ago => $days     , description =>'purge_zero_balance_fees should not delete fees with positive amout owed on threshold day'      , delete => 0 } ,
100
    { amount => 5     , days_ago => $days + 1 , description =>'purge_zero_balance_fees should not delete fees with postive amout owed after threshold day'   , delete => 0 } ,
99
    { amount => 5     , days_ago => $days + 1 , description =>'purge_zero_balance_fees should not delete fees with positive amout owed after threshold day'   , delete => 0 } ,
101
    { amount => -5    , days_ago => $days - 1 , description =>'purge_zero_balance_fees should not delete fees with negative amout owed before threshold day' , delete => 0 } ,
100
    { amount => -5    , days_ago => $days - 1 , description =>'purge_zero_balance_fees should not delete fees with negative amout owed before threshold day' , delete => 0 } ,
102
    { amount => -5    , days_ago => $days     , description =>'purge_zero_balance_fees should not delete fees with negative amout owed on threshold day'     , delete => 0 } ,
101
    { amount => -5    , days_ago => $days     , description =>'purge_zero_balance_fees should not delete fees with negative amout owed on threshold day'     , delete => 0 } ,
103
    { amount => -5    , days_ago => $days + 1 , description =>'purge_zero_balance_fees should not delete fees with negative amout owed after threshold day'  , delete => 0 }
102
    { amount => -5    , days_ago => $days + 1 , description =>'purge_zero_balance_fees should not delete fees with negative amout owed after threshold day'  , delete => 0 }
104
);
103
);
105
104
106
for my $data  ( @test_data ) {
105
my $borrower = Koha::Borrower->new( { firstname => 'Test', surname => 'Patron', categorycode => 'PT', branchcode => 'MPL' } )->store();
106
107
for my $data ( @test_data ) {
107
    $sth->execute($borrower->borrowernumber, $data->{amount}, $data->{days_ago}, $data->{description});
108
    $sth->execute($borrower->borrowernumber, $data->{amount}, $data->{days_ago}, $data->{description});
108
}
109
}
109
110
110
- 

Return to bug 14402