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

(-)a/C4/Accounts.pm (-32 lines)
Lines 85-121 sub getnextacctno { Link Here
85
    return ($sth->fetchrow || 1);
85
    return ($sth->fetchrow || 1);
86
}
86
}
87
87
88
=head2 fixaccounts (removed)
89
90
  &fixaccounts($accountlines_id, $borrowernumber, $accountnumber, $amount);
91
92
#'
93
# FIXME - I don't understand what this function does.
94
sub fixaccounts {
95
    my ( $accountlines_id, $borrowernumber, $accountno, $amount ) = @_;
96
    my $dbh = C4::Context->dbh;
97
    my $sth = $dbh->prepare(
98
        "SELECT * FROM accountlines WHERE accountlines_id=?"
99
    );
100
    $sth->execute( $accountlines_id );
101
    my $data = $sth->fetchrow_hashref;
102
103
    # FIXME - Error-checking
104
    my $diff        = $amount - $data->{'amount'};
105
    my $outstanding = $data->{'amountoutstanding'} + $diff;
106
    $sth->finish;
107
108
    $dbh->do(<<EOT);
109
        UPDATE  accountlines
110
        SET     amount = '$amount',
111
                amountoutstanding = '$outstanding'
112
        WHERE   accountlines_id = $accountlines_id
113
EOT
114
	# FIXME: exceedingly bad form.  Use prepare with placholders ("?") in query and execute args.
115
}
116
117
=cut
118
119
=head2 chargelostitem
88
=head2 chargelostitem
120
89
121
In a default install of Koha the following lost values are set
90
In a default install of Koha the following lost values are set
122
- 

Return to bug 21680