|
Lines 159-169
sub chargelostitem{
Link Here
|
| 159 |
unless ($existing_charges) { |
159 |
unless ($existing_charges) { |
| 160 |
#add processing fee |
160 |
#add processing fee |
| 161 |
if ($processfee && $processfee > 0){ |
161 |
if ($processfee && $processfee > 0){ |
| 162 |
manualinvoice($borrowernumber, $itemnumber, $description, 'PF', $processfee, $processingfeenote, 1); |
162 |
my $accountline = Koha::Account::Line->new( |
|
|
163 |
{ |
| 164 |
borrowernumber => $borrowernumber, |
| 165 |
accountno => getnextacctno($borrowernumber), |
| 166 |
date => \'NOW()', |
| 167 |
amount => $processfee, |
| 168 |
description => $description, |
| 169 |
accounttype => 'PF', |
| 170 |
amountoutstanding => $processfee, |
| 171 |
itemnumber => $itemnumber, |
| 172 |
note => $processingfeenote, |
| 173 |
manager_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : 0, |
| 174 |
} |
| 175 |
)->store(); |
| 176 |
|
| 177 |
my $account_offset = Koha::Account::Offset->new( |
| 178 |
{ |
| 179 |
debit_id => $accountline->id, |
| 180 |
type => 'Processing Fee', |
| 181 |
amount => $accountline->amount, |
| 182 |
} |
| 183 |
)->store(); |
| 184 |
|
| 185 |
if ( C4::Context->preference("FinesLog") ) { |
| 186 |
logaction("FINES", 'CREATE',$borrowernumber,Dumper({ |
| 187 |
action => 'create_fee', |
| 188 |
borrowernumber => $accountline->borrowernumber,, |
| 189 |
accountno => $accountline->accountno, |
| 190 |
amount => $accountline->amount, |
| 191 |
description => $accountline->description, |
| 192 |
accounttype => $accountline->accounttype, |
| 193 |
amountoutstanding => $accountline->amountoutstanding, |
| 194 |
note => $accountline->note, |
| 195 |
itemnumber => $accountline->itemnumber, |
| 196 |
manager_id => $accountline->manager_id, |
| 197 |
})); |
| 198 |
} |
| 163 |
} |
199 |
} |
| 164 |
#add replace cost |
200 |
#add replace cost |
| 165 |
if ($replacementprice > 0){ |
201 |
if ($replacementprice > 0){ |
| 166 |
manualinvoice($borrowernumber, $itemnumber, $description, 'L', $replacementprice, undef, 1); |
202 |
my $accountline = Koha::Account::Line->new( |
|
|
203 |
{ |
| 204 |
borrowernumber => $borrowernumber, |
| 205 |
accountno => getnextacctno($borrowernumber), |
| 206 |
date => \'NOW()', |
| 207 |
amount => $replacementprice, |
| 208 |
description => $description, |
| 209 |
accounttype => 'L', |
| 210 |
amountoutstanding => $replacementprice, |
| 211 |
itemnumber => $itemnumber, |
| 212 |
manager_id => C4::Context->userenv ? C4::Context->userenv->{'number'} : 0, |
| 213 |
} |
| 214 |
)->store(); |
| 215 |
|
| 216 |
my $account_offset = Koha::Account::Offset->new( |
| 217 |
{ |
| 218 |
debit_id => $accountline->id, |
| 219 |
type => 'Lost Item', |
| 220 |
amount => $accountline->amount, |
| 221 |
} |
| 222 |
)->store(); |
| 223 |
|
| 224 |
if ( C4::Context->preference("FinesLog") ) { |
| 225 |
logaction("FINES", 'CREATE',$borrowernumber,Dumper({ |
| 226 |
action => 'create_fee', |
| 227 |
borrowernumber => $accountline->borrowernumber,, |
| 228 |
accountno => $accountline->accountno, |
| 229 |
amount => $accountline->amount, |
| 230 |
description => $accountline->description, |
| 231 |
accounttype => $accountline->accounttype, |
| 232 |
amountoutstanding => $accountline->amountoutstanding, |
| 233 |
note => $accountline->note, |
| 234 |
itemnumber => $accountline->itemnumber, |
| 235 |
manager_id => $accountline->manager_id, |
| 236 |
})); |
| 237 |
} |
| 167 |
} |
238 |
} |
| 168 |
} |
239 |
} |
| 169 |
} |
240 |
} |