Lines 30-36
use C4::Items;
Link Here
|
30 |
use C4::Members; |
30 |
use C4::Members; |
31 |
use C4::Dates; |
31 |
use C4::Dates; |
32 |
use C4::Dates qw(format_date); |
32 |
use C4::Dates qw(format_date); |
33 |
use C4::Accounts; |
33 |
use Koha::Accounts; |
34 |
use C4::ItemCirculationAlertPreference; |
34 |
use C4::ItemCirculationAlertPreference; |
35 |
use C4::Message; |
35 |
use C4::Message; |
36 |
use C4::Debug; |
36 |
use C4::Debug; |
Lines 48-53
use Data::Dumper;
Link Here
|
48 |
use Koha::DateUtils; |
48 |
use Koha::DateUtils; |
49 |
use Koha::Calendar; |
49 |
use Koha::Calendar; |
50 |
use Koha::Borrower::Debarments; |
50 |
use Koha::Borrower::Debarments; |
|
|
51 |
use Koha::Database; |
51 |
use Carp; |
52 |
use Carp; |
52 |
use Date::Calc qw( |
53 |
use Date::Calc qw( |
53 |
Today |
54 |
Today |
Lines 1275-1281
sub AddIssue {
Link Here
|
1275 |
## If item was lost, it has now been found, reverse any list item charges if neccessary. |
1276 |
## If item was lost, it has now been found, reverse any list item charges if neccessary. |
1276 |
if ( $item->{'itemlost'} ) { |
1277 |
if ( $item->{'itemlost'} ) { |
1277 |
if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) { |
1278 |
if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) { |
1278 |
_FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} ); |
1279 |
_FixAccountForLostAndReturned( $item->{'itemnumber'} ); |
1279 |
} |
1280 |
} |
1280 |
} |
1281 |
} |
1281 |
|
1282 |
|
Lines 1812-1820
sub AddReturn {
Link Here
|
1812 |
if ( $amount > 0 |
1813 |
if ( $amount > 0 |
1813 |
&& C4::Context->preference('finesMode') eq 'production' ) |
1814 |
&& C4::Context->preference('finesMode') eq 'production' ) |
1814 |
{ |
1815 |
{ |
1815 |
C4::Overdues::UpdateFine( $issue->{itemnumber}, |
1816 |
C4::Overdues::UpdateFine( |
1816 |
$issue->{borrowernumber}, |
1817 |
{ |
1817 |
$amount, $type, output_pref($datedue) ); |
1818 |
itemnumber => $issue->{itemnumber}, |
|
|
1819 |
borrowernumber => $issue->{borrowernumber}, |
1820 |
amount => $amount, |
1821 |
due => output_pref($datedue), |
1822 |
issue_id => $issue->{issue_id} |
1823 |
} |
1824 |
); |
1818 |
} |
1825 |
} |
1819 |
} |
1826 |
} |
1820 |
|
1827 |
|
Lines 1864-1881
sub AddReturn {
Link Here
|
1864 |
$messages->{'WasLost'} = 1; |
1871 |
$messages->{'WasLost'} = 1; |
1865 |
|
1872 |
|
1866 |
if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) { |
1873 |
if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) { |
1867 |
_FixAccountForLostAndReturned($item->{'itemnumber'}, $borrowernumber, $barcode); # can tolerate undef $borrowernumber |
1874 |
_FixAccountForLostAndReturned( $item->{'itemnumber'} ); |
1868 |
$messages->{'LostItemFeeRefunded'} = 1; |
1875 |
$messages->{'LostItemFeeRefunded'} = 1; |
1869 |
} |
1876 |
} |
1870 |
} |
1877 |
} |
1871 |
|
1878 |
|
1872 |
# fix up the overdues in accounts... |
1879 |
# fix up the overdues in accounts... |
1873 |
if ($borrowernumber) { |
1880 |
if ($borrowernumber) { |
1874 |
my $fix = _FixOverduesOnReturn($borrowernumber, $item->{itemnumber}, $exemptfine, $dropbox); |
1881 |
_FixOverduesOnReturn( |
1875 |
defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $item->{itemnumber}...) failed!"; # zero is OK, check defined |
1882 |
{ |
|
|
1883 |
exempt_fine => $exemptfine, |
1884 |
dropbox => $dropbox, |
1885 |
issue => $issue, |
1886 |
} |
1887 |
); |
1876 |
|
1888 |
|
1877 |
if ( $issue->{overdue} && $issue->{date_due} ) { |
1889 |
if ( $issue->{overdue} && $issue->{date_due} ) { |
1878 |
# fix fine days |
1890 |
# fix fine days |
1879 |
my $debardate = |
1891 |
my $debardate = |
1880 |
_debar_user_on_return( $borrower, $item, $issue->{date_due}, $today ); |
1892 |
_debar_user_on_return( $borrower, $item, $issue->{date_due}, $today ); |
1881 |
$messages->{Debarred} = $debardate if ($debardate); |
1893 |
$messages->{Debarred} = $debardate if ($debardate); |
Lines 2093-2231
Internal function, called only by AddReturn
Link Here
|
2093 |
=cut |
2105 |
=cut |
2094 |
|
2106 |
|
2095 |
sub _FixOverduesOnReturn { |
2107 |
sub _FixOverduesOnReturn { |
2096 |
my ($borrowernumber, $item); |
2108 |
my ( $params ) = @_; |
2097 |
unless ($borrowernumber = shift) { |
2109 |
|
2098 |
warn "_FixOverduesOnReturn() not supplied valid borrowernumber"; |
2110 |
my $exemptfine = $params->{exempt_fine}; |
2099 |
return; |
2111 |
my $dropbox = $params->{dropbox}; |
2100 |
} |
2112 |
my $issue = $params->{issue}; |
2101 |
unless ($item = shift) { |
2113 |
|
2102 |
warn "_FixOverduesOnReturn() not supplied valid itemnumber"; |
|
|
2103 |
return; |
2104 |
} |
2105 |
my ($exemptfine, $dropbox) = @_; |
2106 |
my $dbh = C4::Context->dbh; |
2114 |
my $dbh = C4::Context->dbh; |
2107 |
|
2115 |
|
2108 |
# check for overdue fine |
2116 |
my $schema = Koha::Database->new()->schema; |
2109 |
my $sth = $dbh->prepare( |
2117 |
my $fine = |
2110 |
"SELECT * FROM accountlines WHERE (borrowernumber = ?) AND (itemnumber = ?) AND (accounttype='FU' OR accounttype='O')" |
2118 |
$schema->resultset('AccountDebit') |
2111 |
); |
2119 |
->single( { issue_id => $issue->{issue_id}, type => Koha::Accounts::DebitTypes::Fine() } ); |
2112 |
$sth->execute( $borrowernumber, $item ); |
|
|
2113 |
|
2120 |
|
2114 |
# alter fine to show that the book has been returned |
2121 |
return unless ( $fine ); |
2115 |
my $data = $sth->fetchrow_hashref; |
2122 |
|
2116 |
return 0 unless $data; # no warning, there's just nothing to fix |
2123 |
$fine->accruing(0); |
2117 |
|
2124 |
|
2118 |
my $uquery; |
|
|
2119 |
my @bind = ($data->{'accountlines_id'}); |
2120 |
if ($exemptfine) { |
2125 |
if ($exemptfine) { |
2121 |
$uquery = "update accountlines set accounttype='FFOR', amountoutstanding=0"; |
2126 |
AddCredit( |
2122 |
if (C4::Context->preference("FinesLog")) { |
2127 |
{ |
2123 |
&logaction("FINES", 'MODIFY',$borrowernumber,"Overdue forgiven: item $item"); |
2128 |
borrower => $fine->borrowernumber(), |
2124 |
} |
2129 |
amount => $fine->amount_original(), |
2125 |
} elsif ($dropbox && $data->{lastincrement}) { |
2130 |
debit_id => $fine->debit_id(), |
2126 |
my $outstanding = $data->{amountoutstanding} - $data->{lastincrement} ; |
2131 |
type => Koha::Accounts::CreditTypes::Forgiven(), |
2127 |
my $amt = $data->{amount} - $data->{lastincrement} ; |
2132 |
} |
|
|
2133 |
); |
2128 |
if (C4::Context->preference("FinesLog")) { |
2134 |
if (C4::Context->preference("FinesLog")) { |
2129 |
&logaction("FINES", 'MODIFY',$borrowernumber,"Dropbox adjustment $amt, item $item"); |
2135 |
&logaction( |
|
|
2136 |
"FINES", 'MODIFY', |
2137 |
$issue->{borrowernumber}, |
2138 |
"Overdue forgiven: item " . $issue->{itemnumber} |
2139 |
); |
2130 |
} |
2140 |
} |
2131 |
$uquery = "update accountlines set accounttype='F' "; |
2141 |
} elsif ($dropbox && $fine->amount_last_increment() != $fine->amount_original() ) { |
2132 |
if($outstanding >= 0 && $amt >=0) { |
2142 |
if ( C4::Context->preference("FinesLog") ) { |
2133 |
$uquery .= ", amount = ? , amountoutstanding=? "; |
2143 |
&logaction( "FINES", 'MODIFY', $issue->{borrowernumber}, |
2134 |
unshift @bind, ($amt, $outstanding) ; |
2144 |
"Dropbox adjustment " |
|
|
2145 |
. $fine->amount_last_increment() |
2146 |
. ", item " . $issue->{itemnumber} ); |
2135 |
} |
2147 |
} |
2136 |
} else { |
2148 |
$fine->amount_original( |
2137 |
$uquery = "update accountlines set accounttype='F' "; |
2149 |
$fine->amount_original() - $fine->amount_last_increment() ); |
|
|
2150 |
$fine->amount_outstanding( |
2151 |
$fine->amount_outstanding - $fine->amount_last_increment() ); |
2152 |
$schema->resultset('AccountOffset')->create( |
2153 |
{ |
2154 |
debit_id => $fine->debit_id(), |
2155 |
type => Koha::Accounts::OffsetTypes::Dropbox(), |
2156 |
amount => $fine->amount_last_increment() * -1, |
2157 |
} |
2158 |
); |
2138 |
} |
2159 |
} |
2139 |
$uquery .= " where (accountlines_id = ?)"; |
2160 |
|
2140 |
my $usth = $dbh->prepare($uquery); |
2161 |
return $fine->update(); |
2141 |
return $usth->execute(@bind); |
|
|
2142 |
} |
2162 |
} |
2143 |
|
2163 |
|
2144 |
=head2 _FixAccountForLostAndReturned |
2164 |
=head2 _FixAccountForLostAndReturned |
2145 |
|
2165 |
|
2146 |
&_FixAccountForLostAndReturned($itemnumber, [$borrowernumber, $barcode]); |
2166 |
&_FixAccountForLostAndReturned($itemnumber); |
2147 |
|
|
|
2148 |
Calculates the charge for a book lost and returned. |
2149 |
|
2167 |
|
2150 |
Internal function, not exported, called only by AddReturn. |
2168 |
Refunds a lost item fee in necessary |
2151 |
|
|
|
2152 |
FIXME: This function reflects how inscrutable fines logic is. Fix both. |
2153 |
FIXME: Give a positive return value on success. It might be the $borrowernumber who received credit, or the amount forgiven. |
2154 |
|
2169 |
|
2155 |
=cut |
2170 |
=cut |
2156 |
|
2171 |
|
2157 |
sub _FixAccountForLostAndReturned { |
2172 |
sub _FixAccountForLostAndReturned { |
2158 |
my $itemnumber = shift or return; |
2173 |
my ( $itemnumber ) = @_; |
2159 |
my $borrowernumber = @_ ? shift : undef; |
2174 |
|
2160 |
my $item_id = @_ ? shift : $itemnumber; # Send the barcode if you want that logged in the description |
2175 |
my $schema = Koha::Database->new()->schema; |
2161 |
my $dbh = C4::Context->dbh; |
2176 |
|
2162 |
# check for charge made for lost book |
2177 |
# Find the last issue for this item |
2163 |
my $sth = $dbh->prepare("SELECT * FROM accountlines WHERE itemnumber = ? AND accounttype IN ('L', 'Rep', 'W') ORDER BY date DESC, accountno DESC"); |
2178 |
my $issue = |
2164 |
$sth->execute($itemnumber); |
2179 |
$schema->resultset('Issue')->single( { itemnumber => $itemnumber } ); |
2165 |
my $data = $sth->fetchrow_hashref; |
2180 |
$issue ||= |
2166 |
$data or return; # bail if there is nothing to do |
2181 |
$schema->resultset('OldIssue')->single( { itemnumber => $itemnumber } ); |
2167 |
$data->{accounttype} eq 'W' and return; # Written off |
2182 |
|
2168 |
|
2183 |
return unless $issue; |
2169 |
# writeoff this amount |
2184 |
|
2170 |
my $offset; |
2185 |
# Find a lost fee for this issue |
2171 |
my $amount = $data->{'amount'}; |
2186 |
my $debit = $schema->resultset('AccountDebit')->single( |
2172 |
my $acctno = $data->{'accountno'}; |
2187 |
{ |
2173 |
my $amountleft; # Starts off undef/zero. |
2188 |
issue_id => $issue->issue_id(), |
2174 |
if ($data->{'amountoutstanding'} == $amount) { |
2189 |
type => Koha::Accounts::DebitTypes::Lost() |
2175 |
$offset = $data->{'amount'}; |
|
|
2176 |
$amountleft = 0; # Hey, it's zero here, too. |
2177 |
} else { |
2178 |
$offset = $amount - $data->{'amountoutstanding'}; # Um, isn't this the same as ZERO? We just tested those two things are == |
2179 |
$amountleft = $data->{'amountoutstanding'} - $amount; # Um, isn't this the same as ZERO? We just tested those two things are == |
2180 |
} |
2181 |
my $usth = $dbh->prepare("UPDATE accountlines SET accounttype = 'LR',amountoutstanding='0' |
2182 |
WHERE (accountlines_id = ?)"); |
2183 |
$usth->execute($data->{'accountlines_id'}); # We might be adjusting an account for some OTHER borrowernumber now. Not the one we passed in. |
2184 |
#check if any credit is left if so writeoff other accounts |
2185 |
my $nextaccntno = getnextacctno($data->{'borrowernumber'}); |
2186 |
$amountleft *= -1 if ($amountleft < 0); |
2187 |
if ($amountleft > 0) { |
2188 |
my $msth = $dbh->prepare("SELECT * FROM accountlines WHERE (borrowernumber = ?) |
2189 |
AND (amountoutstanding >0) ORDER BY date"); # might want to order by amountoustanding ASC (pay smallest first) |
2190 |
$msth->execute($data->{'borrowernumber'}); |
2191 |
# offset transactions |
2192 |
my $newamtos; |
2193 |
my $accdata; |
2194 |
while (($accdata=$msth->fetchrow_hashref) and ($amountleft>0)){ |
2195 |
if ($accdata->{'amountoutstanding'} < $amountleft) { |
2196 |
$newamtos = 0; |
2197 |
$amountleft -= $accdata->{'amountoutstanding'}; |
2198 |
} else { |
2199 |
$newamtos = $accdata->{'amountoutstanding'} - $amountleft; |
2200 |
$amountleft = 0; |
2201 |
} |
2202 |
my $thisacct = $accdata->{'accountlines_id'}; |
2203 |
# FIXME: move prepares outside while loop! |
2204 |
my $usth = $dbh->prepare("UPDATE accountlines SET amountoutstanding= ? |
2205 |
WHERE (accountlines_id = ?)"); |
2206 |
$usth->execute($newamtos,$thisacct); |
2207 |
$usth = $dbh->prepare("INSERT INTO accountoffsets |
2208 |
(borrowernumber, accountno, offsetaccount, offsetamount) |
2209 |
VALUES |
2210 |
(?,?,?,?)"); |
2211 |
$usth->execute($data->{'borrowernumber'},$accdata->{'accountno'},$nextaccntno,$newamtos); |
2212 |
} |
2190 |
} |
2213 |
} |
2191 |
); |
2214 |
$amountleft *= -1 if ($amountleft > 0); |
2192 |
|
2215 |
my $desc = "Item Returned " . $item_id; |
2193 |
return unless $debit; |
2216 |
$usth = $dbh->prepare("INSERT INTO accountlines |
2194 |
|
2217 |
(borrowernumber,accountno,date,amount,description,accounttype,amountoutstanding) |
2195 |
# Check for an existing found credit for this debit, if there is one, the fee has already been refunded and we do nothing |
2218 |
VALUES (?,?,now(),?,?,'CR',?)"); |
2196 |
my @credits = $debit->account_offsets->search_related('credit', { 'credit.type' => Koha::Accounts::CreditTypes::Found() }); |
2219 |
$usth->execute($data->{'borrowernumber'},$nextaccntno,0-$amount,$desc,$amountleft); |
2197 |
|
2220 |
if ($borrowernumber) { |
2198 |
return if @credits; |
2221 |
# FIXME: same as query above. use 1 sth for both |
2199 |
|
2222 |
$usth = $dbh->prepare("INSERT INTO accountoffsets |
2200 |
# Ok, so we know we have an unrefunded lost item fee, let's refund it |
2223 |
(borrowernumber, accountno, offsetaccount, offsetamount) |
2201 |
CreditLostItem( |
2224 |
VALUES (?,?,?,?)"); |
2202 |
{ |
2225 |
$usth->execute($borrowernumber, $data->{'accountno'}, $nextaccntno, $offset); |
2203 |
borrower => $issue->borrower(), |
2226 |
} |
2204 |
debit => $debit |
|
|
2205 |
} |
2206 |
); |
2207 |
|
2227 |
ModItem({ paidfor => '' }, undef, $itemnumber); |
2208 |
ModItem({ paidfor => '' }, undef, $itemnumber); |
2228 |
return; |
|
|
2229 |
} |
2209 |
} |
2230 |
|
2210 |
|
2231 |
=head2 _GetCircControlBranch |
2211 |
=head2 _GetCircControlBranch |
Lines 2584-2602
sub AddRenewal {
Link Here
|
2584 |
# Charge a new rental fee, if applicable? |
2564 |
# Charge a new rental fee, if applicable? |
2585 |
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); |
2565 |
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber ); |
2586 |
if ( $charge > 0 ) { |
2566 |
if ( $charge > 0 ) { |
2587 |
my $accountno = getnextacctno( $borrowernumber ); |
|
|
2588 |
my $item = GetBiblioFromItemNumber($itemnumber); |
2567 |
my $item = GetBiblioFromItemNumber($itemnumber); |
2589 |
my $manager_id = 0; |
2568 |
|
2590 |
$manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; |
2569 |
my $borrower = |
2591 |
$sth = $dbh->prepare( |
2570 |
Koha::Database->new()->schema->resultset('Borrower') |
2592 |
"INSERT INTO accountlines |
2571 |
->find($borrowernumber); |
2593 |
(date, borrowernumber, accountno, amount, manager_id, |
2572 |
|
2594 |
description,accounttype, amountoutstanding, itemnumber) |
2573 |
AddDebit( |
2595 |
VALUES (now(),?,?,?,?,?,?,?,?)" |
2574 |
{ |
|
|
2575 |
borrower => $borrower, |
2576 |
itemnumber => $itemnumber, |
2577 |
amount => $charge, |
2578 |
type => Koha::Accounts::DebitTypes::Rental(), |
2579 |
description => |
2580 |
"Renewal of Rental Item $item->{'title'} $item->{'barcode'}" |
2581 |
} |
2596 |
); |
2582 |
); |
2597 |
$sth->execute( $borrowernumber, $accountno, $charge, $manager_id, |
|
|
2598 |
"Renewal of Rental Item $item->{'title'} $item->{'barcode'}", |
2599 |
'Rent', $charge, $itemnumber ); |
2600 |
} |
2583 |
} |
2601 |
|
2584 |
|
2602 |
# Send a renewal slip according to checkout alert preferencei |
2585 |
# Send a renewal slip according to checkout alert preferencei |
Lines 2767-2791
sub _get_discount_from_rule {
Link Here
|
2767 |
|
2750 |
|
2768 |
=head2 AddIssuingCharge |
2751 |
=head2 AddIssuingCharge |
2769 |
|
2752 |
|
2770 |
&AddIssuingCharge( $itemno, $borrowernumber, $charge ) |
2753 |
&AddIssuingCharge( $itemnumber, $borrowernumber, $amount ) |
2771 |
|
2754 |
|
2772 |
=cut |
2755 |
=cut |
2773 |
|
2756 |
|
2774 |
sub AddIssuingCharge { |
2757 |
sub AddIssuingCharge { |
2775 |
my ( $itemnumber, $borrowernumber, $charge ) = @_; |
2758 |
my ( $itemnumber, $borrowernumber, $amount ) = @_; |
2776 |
my $dbh = C4::Context->dbh; |
2759 |
|
2777 |
my $nextaccntno = getnextacctno( $borrowernumber ); |
2760 |
return AddDebit( |
2778 |
my $manager_id = 0; |
2761 |
{ |
2779 |
$manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv; |
2762 |
borrower => Koha::Database->new()->schema->resultset('Borrower')->find($borrowernumber), |
2780 |
my $query =" |
2763 |
itemnumber => $itemnumber, |
2781 |
INSERT INTO accountlines |
2764 |
amount => $amount, |
2782 |
(borrowernumber, itemnumber, accountno, |
2765 |
type => Koha::Accounts::DebitTypes::Rental(), |
2783 |
date, amount, description, accounttype, |
2766 |
} |
2784 |
amountoutstanding, manager_id) |
2767 |
); |
2785 |
VALUES (?, ?, ?,now(), ?, 'Rental', 'Rent',?,?) |
|
|
2786 |
"; |
2787 |
my $sth = $dbh->prepare($query); |
2788 |
$sth->execute( $borrowernumber, $itemnumber, $nextaccntno, $charge, $charge, $manager_id ); |
2789 |
} |
2768 |
} |
2790 |
|
2769 |
|
2791 |
=head2 GetTransfers |
2770 |
=head2 GetTransfers |
Lines 3304-3333
sub ReturnLostItem{
Link Here
|
3304 |
sub LostItem{ |
3283 |
sub LostItem{ |
3305 |
my ($itemnumber, $mark_returned) = @_; |
3284 |
my ($itemnumber, $mark_returned) = @_; |
3306 |
|
3285 |
|
3307 |
my $dbh = C4::Context->dbh(); |
3286 |
my $schema = Koha::Database->new()->schema; |
3308 |
my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title |
|
|
3309 |
FROM issues |
3310 |
JOIN items USING (itemnumber) |
3311 |
JOIN biblio USING (biblionumber) |
3312 |
WHERE issues.itemnumber=?"); |
3313 |
$sth->execute($itemnumber); |
3314 |
my $issues=$sth->fetchrow_hashref(); |
3315 |
|
3287 |
|
3316 |
# If a borrower lost the item, add a replacement cost to the their record |
3288 |
my $issue = |
3317 |
if ( my $borrowernumber = $issues->{borrowernumber} ){ |
3289 |
$schema->resultset('Issue')->single( { itemnumber => $itemnumber } ); |
3318 |
my $borrower = C4::Members::GetMemberDetails( $borrowernumber ); |
|
|
3319 |
|
3290 |
|
|
|
3291 |
my ( $borrower, $item ); |
3292 |
|
3293 |
if ( $issue ) { |
3294 |
$borrower = $issue->borrower(); |
3295 |
$item = $issue->item(); |
3296 |
} |
3297 |
|
3298 |
# If a borrower lost the item, add a replacement cost to the their record |
3299 |
if ( $borrower ){ |
3320 |
if (C4::Context->preference('WhenLostForgiveFine')){ |
3300 |
if (C4::Context->preference('WhenLostForgiveFine')){ |
3321 |
my $fix = _FixOverduesOnReturn($borrowernumber, $itemnumber, 1, 0); # 1, 0 = exemptfine, no-dropbox |
3301 |
_FixOverduesOnReturn( |
3322 |
defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $itemnumber...) failed!"; # zero is OK, check defined |
3302 |
{ |
|
|
3303 |
exempt_fine => 1, |
3304 |
dropbox => 0, |
3305 |
issue => $issue, |
3306 |
} |
3307 |
); |
3323 |
} |
3308 |
} |
3324 |
if (C4::Context->preference('WhenLostChargeReplacementFee')){ |
3309 |
if ( C4::Context->preference('WhenLostChargeReplacementFee') ) { |
3325 |
C4::Accounts::chargelostitem($borrowernumber, $itemnumber, $issues->{'replacementprice'}, "Lost Item $issues->{'title'} $issues->{'barcode'}"); |
3310 |
DebitLostItem( { borrower => $borrower, issue => $issue } ); |
3326 |
#FIXME : Should probably have a way to distinguish this from an item that really was returned. |
|
|
3327 |
#warn " $issues->{'borrowernumber'} / $itemnumber "; |
3328 |
} |
3311 |
} |
3329 |
|
3312 |
|
3330 |
MarkIssueReturned($borrowernumber,$itemnumber,undef,undef,$borrower->{'privacy'}) if $mark_returned; |
3313 |
MarkIssueReturned( $borrower->borrowernumber(), $item->itemnumber(), undef, undef, $borrower->privacy() ) if $mark_returned; |
3331 |
} |
3314 |
} |
3332 |
} |
3315 |
} |
3333 |
|
3316 |
|