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

(-)a/members/pay.pl (-4 / +5 lines)
Lines 111-116 output_html_with_http_headers $input, $cookie, $template->output; Link Here
111
111
112
sub writeoff {
112
sub writeoff {
113
    my ( $accountnum, $itemnum, $accounttype, $amount ) = @_;
113
    my ( $accountnum, $itemnum, $accounttype, $amount ) = @_;
114
    my $manager_id = 0;
115
    $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
114
116
115
    # if no item is attached to fine, make sure to store it as a NULL
117
    # if no item is attached to fine, make sure to store it as a NULL
116
    $itemnum ||= undef;
118
    $itemnum ||= undef;
Lines 118-124 sub writeoff { Link Here
118
    $writeoff_sth->execute( $accountnum, $borrowernumber );
120
    $writeoff_sth->execute( $accountnum, $borrowernumber );
119
121
120
    my $acct = getnextacctno($borrowernumber);
122
    my $acct = getnextacctno($borrowernumber);
121
    $add_writeoff_sth->execute( $borrowernumber, $acct, $itemnum, $amount );
123
    $add_writeoff_sth->execute( $borrowernumber, $acct, $itemnum, $amount, $manager_id );
122
124
123
    UpdateStats( $branch, 'writeoff', $amount, q{}, q{}, q{}, $borrowernumber );
125
    UpdateStats( $branch, 'writeoff', $amount, q{}, q{}, q{}, $borrowernumber );
124
126
Lines 282-289 sub get_writeoff_sth { Link Here
282
          . 'WHERE accountno=? and borrowernumber=?';
284
          . 'WHERE accountno=? and borrowernumber=?';
283
        $writeoff_sth = $dbh->prepare($sql);
285
        $writeoff_sth = $dbh->prepare($sql);
284
        my $insert =
286
        my $insert =
285
q{insert into accountlines (borrowernumber,accountno,itemnumber,date,amount,description,accounttype)}
287
q{insert into accountlines (borrowernumber,accountno,itemnumber,date,amount,description,accounttype,manager_id)}
286
          . q{values (?,?,?,now(),?,'Writeoff','W')};
288
          . q{values (?,?,?,now(),?,'Writeoff','W',?)};
287
        $add_writeoff_sth = $dbh->prepare($insert);
289
        $add_writeoff_sth = $dbh->prepare($insert);
288
    }
290
    }
289
    return;
291
    return;
290
- 

Return to bug 6718