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

(-)a/C4/Accounts.pm (-27 lines)
Lines 38-44 BEGIN { Link Here
38
    require Exporter;
38
    require Exporter;
39
    @ISA    = qw(Exporter);
39
    @ISA    = qw(Exporter);
40
    @EXPORT = qw(
40
    @EXPORT = qw(
41
      &getnextacctno
42
      &chargelostitem
41
      &chargelostitem
43
      &purge_zero_balance_fees
42
      &purge_zero_balance_fees
44
    );
43
    );
Lines 60-88 patron. Link Here
60
59
61
=head1 FUNCTIONS
60
=head1 FUNCTIONS
62
61
63
=head2 getnextacctno
64
65
  $nextacct = &getnextacctno($borrowernumber);
66
67
Returns the next unused account number for the patron with the given
68
borrower number.
69
70
=cut
71
72
#'
73
# FIXME - Okay, so what does the above actually _mean_?
74
sub getnextacctno {
75
    my ($borrowernumber) = shift or return;
76
    my $sth = C4::Context->dbh->prepare(
77
        "SELECT accountno+1 FROM accountlines
78
            WHERE    (borrowernumber = ?)
79
            ORDER BY accountno DESC
80
            LIMIT 1"
81
    );
82
    $sth->execute($borrowernumber);
83
    return ($sth->fetchrow || 1);
84
}
85
86
=head2 chargelostitem
62
=head2 chargelostitem
87
63
88
In a default install of Koha the following lost values are set
64
In a default install of Koha the following lost values are set
Lines 174-180 sub manualinvoice { Link Here
174
    $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
150
    $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
175
    my $dbh      = C4::Context->dbh;
151
    my $dbh      = C4::Context->dbh;
176
    my $insert;
152
    my $insert;
177
    my $accountno  = getnextacctno($borrowernumber);
178
    my $amountleft = $amount;
153
    my $amountleft = $amount;
179
154
180
    my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
155
    my $branchcode = C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
Lines 182-188 sub manualinvoice { Link Here
182
    my $accountline = Koha::Account::Line->new(
157
    my $accountline = Koha::Account::Line->new(
183
        {
158
        {
184
            borrowernumber    => $borrowernumber,
159
            borrowernumber    => $borrowernumber,
185
            accountno         => $accountno,
186
            date              => \'NOW()',
160
            date              => \'NOW()',
187
            amount            => $amount,
161
            amount            => $amount,
188
            description       => $desc,
162
            description       => $desc,
Lines 207-213 sub manualinvoice { Link Here
207
        logaction("FINES", 'CREATE',$borrowernumber,Dumper({
181
        logaction("FINES", 'CREATE',$borrowernumber,Dumper({
208
            action            => 'create_fee',
182
            action            => 'create_fee',
209
            borrowernumber    => $borrowernumber,
183
            borrowernumber    => $borrowernumber,
210
            accountno         => $accountno,
211
            amount            => $amount,
184
            amount            => $amount,
212
            description       => $desc,
185
            description       => $desc,
213
            accounttype       => $type,
186
            accounttype       => $type,
(-)a/C4/Circulation.pm (-1 / +1 lines)
Lines 2392-2398 sub _FixAccountForLostAndReturned { Link Here
2392
            accounttype => { -in => [ 'L', 'Rep', 'W' ] },
2392
            accounttype => { -in => [ 'L', 'Rep', 'W' ] },
2393
        },
2393
        },
2394
        {
2394
        {
2395
            order_by => { -desc => [ 'date', 'accountno' ] }
2395
            order_by => { -desc => [ 'date' ] }
2396
        }
2396
        }
2397
    );
2397
    );
2398
2398
(-)a/C4/Stats.pm (-5 / +3 lines)
Lines 64-70 C<$params> is an hashref whose expected keys are: Link Here
64
    amount             : the amount of the transaction
64
    amount             : the amount of the transaction
65
    other              : sipmode
65
    other              : sipmode
66
    itemtype           : the type of the item
66
    itemtype           : the type of the item
67
    accountno          : the count
68
    ccode              : the collection code of the item
67
    ccode              : the collection code of the item
69
68
70
type key is mandatory.
69
type key is mandatory.
Lines 83-89 sub UpdateStats { Link Here
83
# make some controls
82
# make some controls
84
    return () if ! defined $params;
83
    return () if ! defined $params;
85
# change these arrays if new types of transaction or new parameters are allowed
84
# change these arrays if new types of transaction or new parameters are allowed
86
    my @allowed_keys = qw (type branch amount other itemnumber itemtype borrowernumber accountno ccode location);
85
    my @allowed_keys = qw (type branch amount other itemnumber itemtype borrowernumber ccode location);
87
    my @allowed_circulation_types = qw (renew issue localuse return onsite_checkout);
86
    my @allowed_circulation_types = qw (renew issue localuse return onsite_checkout);
88
    my @allowed_accounts_types = qw (writeoff payment);
87
    my @allowed_accounts_types = qw (writeoff payment);
89
    my @circulation_mandatory_keys = qw (type branch borrowernumber itemnumber ccode itemtype);
88
    my @circulation_mandatory_keys = qw (type branch borrowernumber itemnumber ccode itemtype);
Lines 123-129 sub UpdateStats { Link Here
123
    my $other             = exists $params->{other}          ? $params->{other}          : '';
122
    my $other             = exists $params->{other}          ? $params->{other}          : '';
124
    my $itemtype          = exists $params->{itemtype}       ? $params->{itemtype}       : '';
123
    my $itemtype          = exists $params->{itemtype}       ? $params->{itemtype}       : '';
125
    my $location          = exists $params->{location}       ? $params->{location}       : undef;
124
    my $location          = exists $params->{location}       ? $params->{location}       : undef;
126
    my $accountno         = exists $params->{accountno}      ? $params->{accountno}      : '';
127
    my $ccode             = exists $params->{ccode}          ? $params->{ccode}          : '';
125
    my $ccode             = exists $params->{ccode}          ? $params->{ccode}          : '';
128
126
129
    my $dbh = C4::Context->dbh;
127
    my $dbh = C4::Context->dbh;
Lines 133-144 sub UpdateStats { Link Here
133
         branch,          type,        value,
131
         branch,          type,        value,
134
         other,           itemnumber,  itemtype, location,
132
         other,           itemnumber,  itemtype, location,
135
         borrowernumber,  proccode,    ccode)
133
         borrowernumber,  proccode,    ccode)
136
         VALUES (now(),?,?,?,?,?,?,?,?,?,?)"
134
         VALUES (now(),?,?,?,?,?,?,?,?,?)"
137
    );
135
    );
138
    $sth->execute(
136
    $sth->execute(
139
        $branch,     $type,     $amount,   $other,
137
        $branch,     $type,     $amount,   $other,
140
        $itemnumber, $itemtype, $location, $borrowernumber,
138
        $itemnumber, $itemtype, $location, $borrowernumber,
141
        $accountno,  $ccode
139
        $ccode
142
    );
140
    );
143
}
141
}
144
142
(-)a/Koha/Account.pm (-24 lines)
Lines 85-96 sub pay { Link Here
85
85
86
    my $patron = Koha::Patrons->find( $self->{patron_id} );
86
    my $patron = Koha::Patrons->find( $self->{patron_id} );
87
87
88
    # We should remove accountno, it is no longer needed
89
    my $last = $self->lines->search(
90
        {},
91
        { order_by => 'accountno' } )->next();
92
    my $accountno = $last ? $last->accountno + 1 : 1;
93
94
    my $manager_id = $userenv ? $userenv->{number} : 0;
88
    my $manager_id = $userenv ? $userenv->{number} : 0;
95
89
96
    my @fines_paid; # List of account lines paid on with this payment
90
    my @fines_paid; # List of account lines paid on with this payment
Lines 138-144 sub pay { Link Here
138
                        new_amountoutstanding => 0,
132
                        new_amountoutstanding => 0,
139
                        amount_paid           => $old_amountoutstanding,
133
                        amount_paid           => $old_amountoutstanding,
140
                        accountlines_id       => $fine->id,
134
                        accountlines_id       => $fine->id,
141
                        accountno             => $fine->accountno,
142
                        manager_id            => $manager_id,
135
                        manager_id            => $manager_id,
143
                        note                  => $note,
136
                        note                  => $note,
144
                    }
137
                    }
Lines 189-195 sub pay { Link Here
189
                        new_amountoutstanding => $fine->amountoutstanding,
182
                        new_amountoutstanding => $fine->amountoutstanding,
190
                        amount_paid           => $amount_to_pay,
183
                        amount_paid           => $amount_to_pay,
191
                        accountlines_id       => $fine->id,
184
                        accountlines_id       => $fine->id,
192
                        accountno             => $fine->accountno,
193
                        manager_id            => $manager_id,
185
                        manager_id            => $manager_id,
194
                        note                  => $note,
186
                        note                  => $note,
195
                    }
187
                    }
Lines 212-218 sub pay { Link Here
212
    my $payment = Koha::Account::Line->new(
204
    my $payment = Koha::Account::Line->new(
213
        {
205
        {
214
            borrowernumber    => $self->{patron_id},
206
            borrowernumber    => $self->{patron_id},
215
            accountno         => $accountno,
216
            date              => dt_from_string(),
207
            date              => dt_from_string(),
217
            amount            => 0 - $amount,
208
            amount            => 0 - $amount,
218
            description       => $description,
209
            description       => $description,
Lines 236-242 sub pay { Link Here
236
            type           => $type,
227
            type           => $type,
237
            amount         => $amount,
228
            amount         => $amount,
238
            borrowernumber => $self->{patron_id},
229
            borrowernumber => $self->{patron_id},
239
            accountno      => $accountno,
240
        }
230
        }
241
    );
231
    );
242
232
Lines 248-254 sub pay { Link Here
248
                {
238
                {
249
                    action            => "create_$type",
239
                    action            => "create_$type",
250
                    borrowernumber    => $self->{patron_id},
240
                    borrowernumber    => $self->{patron_id},
251
                    accountno         => $accountno,
252
                    amount            => 0 - $amount,
241
                    amount            => 0 - $amount,
253
                    amountoutstanding => 0 - $balance_remaining,
242
                    amountoutstanding => 0 - $balance_remaining,
254
                    accounttype       => $account_type,
243
                    accounttype       => $account_type,
Lines 343-358 sub add_credit { Link Here
343
332
344
    $schema->txn_do(
333
    $schema->txn_do(
345
        sub {
334
        sub {
346
            # We should remove accountno, it is no longer needed
347
            my $last = $self->lines->search(
348
                {},
349
                { order_by => 'accountno' } )->next();
350
            my $accountno = $last ? $last->accountno + 1 : 1;
351
335
352
            # Insert the account line
336
            # Insert the account line
353
            $line = Koha::Account::Line->new(
337
            $line = Koha::Account::Line->new(
354
                {   borrowernumber    => $self->{patron_id},
338
                {   borrowernumber    => $self->{patron_id},
355
                    accountno         => $accountno,
356
                    date              => \'NOW()',
339
                    date              => \'NOW()',
357
                    amount            => $amount,
340
                    amount            => $amount,
358
                    description       => $description,
341
                    description       => $description,
Lines 380-386 sub add_credit { Link Here
380
                    type           => $type,
363
                    type           => $type,
381
                    amount         => $amount,
364
                    amount         => $amount,
382
                    borrowernumber => $self->{patron_id},
365
                    borrowernumber => $self->{patron_id},
383
                    accountno      => $accountno,
384
                }
366
                }
385
            ) if grep { $type eq $_ } ('payment', 'writeoff') ;
367
            ) if grep { $type eq $_ } ('payment', 'writeoff') ;
386
368
Lines 391-397 sub add_credit { Link Here
391
                    Dumper(
373
                    Dumper(
392
                        {   action            => "create_$type",
374
                        {   action            => "create_$type",
393
                            borrowernumber    => $self->{patron_id},
375
                            borrowernumber    => $self->{patron_id},
394
                            accountno         => $accountno,
395
                            amount            => $amount,
376
                            amount            => $amount,
396
                            description       => $description,
377
                            description       => $description,
397
                            amountoutstanding => $amount,
378
                            amountoutstanding => $amount,
Lines 476-485 sub add_debit { Link Here
476
457
477
    $schema->txn_do(
458
    $schema->txn_do(
478
        sub {
459
        sub {
479
            # We should remove accountno, it is no longer needed
480
            my $last = Koha::Account::Lines->search( { borrowernumber => $self->{patron_id} },
481
                { order_by => 'accountno' } )->next();
482
            my $accountno = $last ? $last->accountno + 1 : 1;
483
460
484
            # Insert the account line
461
            # Insert the account line
485
            $line = Koha::Account::Line->new(
462
            $line = Koha::Account::Line->new(
Lines 514-520 sub add_debit { Link Here
514
                    Dumper(
491
                    Dumper(
515
                        {   action            => "create_$type",
492
                        {   action            => "create_$type",
516
                            borrowernumber    => $self->{patron_id},
493
                            borrowernumber    => $self->{patron_id},
517
                            accountno         => $accountno,
518
                            amount            => $amount,
494
                            amount            => $amount,
519
                            description       => $description,
495
                            description       => $description,
520
                            amountoutstanding => $amount,
496
                            amountoutstanding => $amount,
(-)a/Koha/REST/V1/Patrons/Account.pm (-1 lines)
Lines 224-230 sub _to_model { Link Here
224
224
225
our $to_api_mapping = {
225
our $to_api_mapping = {
226
    accountlines_id   => 'account_line_id',
226
    accountlines_id   => 'account_line_id',
227
    accountno         => undef,                  # removed
228
    accounttype       => 'account_type',
227
    accounttype       => 'account_type',
229
    amountoutstanding => 'amount_outstanding',
228
    amountoutstanding => 'amount_outstanding',
230
    borrowernumber    => 'patron_id',
229
    borrowernumber    => 'patron_id',
(-)a/members/printfeercpt.pl (-1 lines)
Lines 82-88 my %row = ( Link Here
82
    'description'             => $accountline->{'description'},
82
    'description'             => $accountline->{'description'},
83
    'amount'                  => $accountline->{'amount'},
83
    'amount'                  => $accountline->{'amount'},
84
    'amountoutstanding'       => $accountline->{'amountoutstanding'},
84
    'amountoutstanding'       => $accountline->{'amountoutstanding'},
85
    'accountno' => $accountline->{'accountno'},
86
    accounttype => $accountline->{accounttype},
85
    accounttype => $accountline->{accounttype},
87
    'note'      => $accountline->{'note'},
86
    'note'      => $accountline->{'note'},
88
);
87
);
(-)a/members/printinvoice.pl (-1 lines)
Lines 81-87 my %row = ( Link Here
81
    'amount'                  => sprintf( "%.2f", $accountline->{'amount'} ),
81
    'amount'                  => sprintf( "%.2f", $accountline->{'amount'} ),
82
    'amountoutstanding' =>
82
    'amountoutstanding' =>
83
      sprintf( "%.2f", $accountline->{'amountoutstanding'} ),
83
      sprintf( "%.2f", $accountline->{'amountoutstanding'} ),
84
    'accountno' => $accountline->{'accountno'},
85
    accounttype => $accountline->{accounttype},
84
    accounttype => $accountline->{accounttype},
86
    'note'      => $accountline->{'note'},
85
    'note'      => $accountline->{'note'},
87
);
86
);
(-)a/misc/cronjobs/staticfines.pl (-5 / +4 lines)
Lines 226-239 for ( my $i = 0 ; $i < scalar(@$data) ; $i++ ) { Link Here
226
            $sth4->execute($itemnumber);
226
            $sth4->execute($itemnumber);
227
            my $title = $sth4->fetchrow;
227
            my $title = $sth4->fetchrow;
228
228
229
            my $nextaccntno = C4::Accounts::getnextacctno($borrowernumber);
230
            my $desc        = "staticfine";
229
            my $desc        = "staticfine";
231
            my $query       = "INSERT INTO accountlines
230
            my $query       = "INSERT INTO accountlines
232
                        (borrowernumber,itemnumber,date,amount,description,accounttype,amountoutstanding,lastincrement,accountno)
231
                        (borrowernumber,itemnumber,date,amount,description,accounttype,amountoutstanding,lastincrement)
233
                                VALUES (?,?,now(),?,?,'F',?,?,?)";
232
                                VALUES (?,?,now(),?,?,'F',?,?)";
234
            my $sth2 = $dbh->prepare($query);
233
            my $sth2 = $dbh->prepare($query);
235
            $bigdebug and warn "query: $query\nw/ args: $borrowernumber, $itemnumber, $amount, $desc, $amount, $amount, $nextaccntno\n";
234
            $bigdebug and warn "query: $query\nw/ args: $borrowernumber, $itemnumber, $amount, $desc, $amount, $amount\n";
236
            $sth2->execute( $borrowernumber, $itemnumber, $amount, $desc, $amount, $amount, $nextaccntno );
235
            $sth2->execute( $borrowernumber, $itemnumber, $amount, $desc, $amount, $amount );
237
236
238
        }
237
        }
239
    }
238
    }
(-)a/misc/maintenance/fix_accountlines_date.pl (-3 / +3 lines)
Lines 127-133 if (not $result or $want_help or ($mode ne 'us' and $mode ne 'metric')) { Link Here
127
our $dbh = C4::Context->dbh;
127
our $dbh = C4::Context->dbh;
128
$dbh->{AutoCommit} = 0;
128
$dbh->{AutoCommit} = 0;
129
my $sth = $dbh->prepare("
129
my $sth = $dbh->prepare("
130
SELECT borrowernumber, itemnumber, accountno, description
130
SELECT accountlines_id, description
131
  FROM accountlines
131
  FROM accountlines
132
  WHERE accounttype in ('FU', 'F', 'O', 'M')
132
  WHERE accounttype in ('FU', 'F', 'O', 'M')
133
;");
133
;");
Lines 136-142 $sth->execute(); Link Here
136
my $update_sth = $dbh->prepare('
136
my $update_sth = $dbh->prepare('
137
UPDATE accountlines
137
UPDATE accountlines
138
  SET description = ?
138
  SET description = ?
139
  WHERE borrowernumber = ? AND itemnumber = ? AND accountno = ?
139
  WHERE accountlines_id = ?
140
;');
140
;');
141
141
142
142
Lines 161-167 while (my $accountline = $sth->fetchrow_hashref) { Link Here
161
    }
161
    }
162
162
163
    print "Changing description from '" . $accountline->{'description'} . "' to '" . $description . "'\n" if $DEBUG;
163
    print "Changing description from '" . $accountline->{'description'} . "' to '" . $description . "'\n" if $DEBUG;
164
    $update_sth->execute($description, $accountline->{'borrowernumber'}, $accountline->{'itemnumber'}, $accountline->{'accountno'});
164
    $update_sth->execute($description, $accountline->{'accountlines_id'});
165
165
166
    $done++;
166
    $done++;
167
167
(-)a/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl (-9 / +5 lines)
Lines 65-71 my $query = " Link Here
65
    SELECT * FROM accountlines
65
    SELECT * FROM accountlines
66
    WHERE ( accounttype =  'FU' OR accounttype =  'F' )
66
    WHERE ( accounttype =  'FU' OR accounttype =  'F' )
67
    AND description like '%23:59%'
67
    AND description like '%23:59%'
68
    ORDER BY borrowernumber, itemnumber, accountno, description
68
    ORDER BY borrowernumber, itemnumber, accountlines_id, description
69
";
69
";
70
my $sth = $dbh->prepare($query);
70
my $sth = $dbh->prepare($query);
71
$sth->execute();
71
$sth->execute();
Lines 98-117 foreach my $keeper (@$results) { Link Here
98
        }
98
        }
99
99
100
        my $sql =
100
        my $sql =
101
            "DELETE FROM accountlines WHERE borrowernumber = ? AND accountno = ? AND itemnumber = ? AND date = ? AND description = ? LIMIT 1";
101
            "DELETE FROM accountlines WHERE accountlines_id = ? LIMIT 1";
102
        $dbh->do( $sql, undef, $f->{'borrowernumber'},
102
        $dbh->do( $sql, undef, $f->{'accountlines_id'} );
103
            $f->{'accountno'}, $f->{'itemnumber'}, $f->{'date'},
104
            $f->{'description'} );
105
    }
103
    }
106
104
107
    if ($has_changed) {
105
    if ($has_changed) {
108
        my $sql =
106
        my $sql =
109
            "UPDATE accountlines SET amountoutstanding = ? WHERE borrowernumber = ? AND accountno = ? AND itemnumber = ? AND date = ? AND description = ? LIMIT 1";
107
            "UPDATE accountlines SET amountoutstanding = ? WHERE accountlines_id = ? LIMIT 1";
110
        $dbh->do(
108
        $dbh->do(
111
            $sql,                           undef,
109
            $sql,                           undef,
112
            $keeper->{'amountoutstanding'}, $keeper->{'borrowernumber'},
110
            $keeper->{'amountoutstanding'}, $keeper->{'accountlines_id'}
113
            $keeper->{'accountno'},         $keeper->{'itemnumber'},
114
            $keeper->{'date'},              $keeper->{'description'}
115
        );
111
        );
116
    }
112
    }
117
}
113
}
(-)a/t/db_dependent/Accounts.t (-4 lines)
Lines 41-47 BEGIN { Link Here
41
41
42
can_ok( 'C4::Accounts',
42
can_ok( 'C4::Accounts',
43
    qw(
43
    qw(
44
        getnextacctno
45
        chargelostitem
44
        chargelostitem
46
        manualinvoice
45
        manualinvoice
47
        purge_zero_balance_fees )
46
        purge_zero_balance_fees )
Lines 756-762 subtest "Koha::Account::non_issues_charges tests" => sub { Link Here
756
    Koha::Account::Line->new(
755
    Koha::Account::Line->new(
757
        {
756
        {
758
            borrowernumber    => $patron->borrowernumber,
757
            borrowernumber    => $patron->borrowernumber,
759
            accountno         => 1,
760
            date              => $today,
758
            date              => $today,
761
            description       => 'a Res fee',
759
            description       => 'a Res fee',
762
            accounttype       => 'Res',
760
            accounttype       => 'Res',
Lines 766-772 subtest "Koha::Account::non_issues_charges tests" => sub { Link Here
766
    Koha::Account::Line->new(
764
    Koha::Account::Line->new(
767
        {
765
        {
768
            borrowernumber    => $patron->borrowernumber,
766
            borrowernumber    => $patron->borrowernumber,
769
            accountno         => 2,
770
            date              => $today,
767
            date              => $today,
771
            description       => 'a Rental fee',
768
            description       => 'a Rental fee',
772
            accounttype       => 'Rent',
769
            accounttype       => 'Rent',
Lines 776-782 subtest "Koha::Account::non_issues_charges tests" => sub { Link Here
776
    Koha::Account::Line->new(
773
    Koha::Account::Line->new(
777
        {
774
        {
778
            borrowernumber    => $patron->borrowernumber,
775
            borrowernumber    => $patron->borrowernumber,
779
            accountno         => 3,
780
            date              => $today,
776
            date              => $today,
781
            description       => 'a Manual invoice fee',
777
            description       => 'a Manual invoice fee',
782
            accounttype       => 'Copie',
778
            accounttype       => 'Copie',
(-)a/t/db_dependent/ILSDI_Services.t (-1 lines)
Lines 197-203 subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes Link Here
197
            source => 'Accountline',
197
            source => 'Accountline',
198
            value  => {
198
            value  => {
199
                borrowernumber    => $brwr->{borrowernumber},
199
                borrowernumber    => $brwr->{borrowernumber},
200
                accountno         => 1,
201
                accounttype       => 'xxx',
200
                accounttype       => 'xxx',
202
                amountoutstanding => 10
201
                amountoutstanding => 10
203
            }
202
            }
(-)a/t/db_dependent/Stats.t (-6 / +1 lines)
Lines 4-10 use Modern::Perl; Link Here
4
use C4::Stats;
4
use C4::Stats;
5
use Koha::Database;
5
use Koha::Database;
6
6
7
use Test::More tests => 19;
7
use Test::More tests => 18;
8
8
9
BEGIN {
9
BEGIN {
10
    use_ok('C4::Stats');
10
    use_ok('C4::Stats');
Lines 32-38 my $params = { Link Here
32
              other => "bla",
32
              other => "bla",
33
              itemtype => "BK",
33
              itemtype => "BK",
34
              location => "LOC",
34
              location => "LOC",
35
              accountno => 51,
36
              ccode => "CODE",
35
              ccode => "CODE",
37
};
36
};
38
my $return_error;
37
my $return_error;
Lines 105-111 $params = { Link Here
105
              other => "bla",
104
              other => "bla",
106
              itemtype => "BK",
105
              itemtype => "BK",
107
              location => "LOC",
106
              location => "LOC",
108
              accountno => 51,
109
              ccode => "CODE",
107
              ccode => "CODE",
110
              type => "return"
108
              type => "return"
111
};
109
};
Lines 120-126 cmp_ok($params->{amount},'==', $line->{value}, "UpdateStats save amount Link Here
120
is ($params->{other},          $line->{other},          "UpdateStats save other param in other field of statistics table");
118
is ($params->{other},          $line->{other},          "UpdateStats save other param in other field of statistics table");
121
is ($params->{itemtype},       $line->{itemtype},       "UpdateStats save itemtype param in itemtype field of statistics table");
119
is ($params->{itemtype},       $line->{itemtype},       "UpdateStats save itemtype param in itemtype field of statistics table");
122
is ($params->{location},       $line->{location},       "UpdateStats save location param in location field of statistics table");
120
is ($params->{location},       $line->{location},       "UpdateStats save location param in location field of statistics table");
123
is ($params->{accountno},      $line->{proccode},       "UpdateStats save accountno param in proccode field of statistics table");
124
is ($params->{ccode},          $line->{ccode},          "UpdateStats save ccode param in ccode field of statistics table");
121
is ($params->{ccode},          $line->{ccode},          "UpdateStats save ccode param in ccode field of statistics table");
125
122
126
$dbh->do(q|DELETE FROM statistics|);
123
$dbh->do(q|DELETE FROM statistics|);
Lines 131-137 $params = { Link Here
131
    amount         => 5.1,
128
    amount         => 5.1,
132
    other          => "bla",
129
    other          => "bla",
133
    itemtype       => "BK",
130
    itemtype       => "BK",
134
    accountno      => 51,
135
    ccode          => "CODE",
131
    ccode          => "CODE",
136
    type           => "return"
132
    type           => "return"
137
};
133
};
Lines 151-157 $params = { Link Here
151
    other          => "bla",
147
    other          => "bla",
152
    itemtype       => "BK",
148
    itemtype       => "BK",
153
    location       => undef,
149
    location       => undef,
154
    accountno      => 51,
155
    ccode          => "CODE",
150
    ccode          => "CODE",
156
    type           => "return"
151
    type           => "return"
157
};
152
};
(-)a/t/lib/TestBuilder.pm (-4 lines)
Lines 556-564 sub _gen_default_values { Link Here
556
        AuthHeader => {
556
        AuthHeader => {
557
            marcxml => '',
557
            marcxml => '',
558
        },
558
        },
559
        Accountline => {
560
            accountno => 0,
561
        },
562
    };
559
    };
563
}
560
}
564
561
565
- 

Return to bug 21683