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