Lines 2164-2178
sub AddReturn {
Link Here
|
2164 |
|
2164 |
|
2165 |
=head2 MarkIssueReturned |
2165 |
=head2 MarkIssueReturned |
2166 |
|
2166 |
|
2167 |
MarkIssueReturned($borrowernumber, $itemnumber, $returndate, $privacy); |
2167 |
MarkIssueReturned($borrowernumber, $itemnumber, $returndate, $privacy, $set_returndate); |
2168 |
|
2168 |
|
2169 |
Unconditionally marks an issue as being returned by |
2169 |
Unconditionally marks an issue as being returned by |
2170 |
moving the C<issues> row to C<old_issues> and |
2170 |
moving the C<issues> row to C<old_issues> |
2171 |
setting C<returndate> to the current date. |
|
|
2172 |
|
2171 |
|
2173 |
if C<$returndate> is specified (in iso format), it is used as the date |
2172 |
if C<$returndate> is specified (in iso format), it is used as the date |
2174 |
of the return. |
2173 |
of the return. |
2175 |
|
2174 |
|
|
|
2175 |
if C<$returndate> is not specified and C<$set_returndate> is not 0 then |
2176 |
the return date will be set to current_date |
2177 |
|
2176 |
C<$privacy> contains the privacy parameter. If the patron has set privacy to 2, |
2178 |
C<$privacy> contains the privacy parameter. If the patron has set privacy to 2, |
2177 |
the old_issue is immediately anonymised |
2179 |
the old_issue is immediately anonymised |
2178 |
|
2180 |
|
Lines 2183-2189
and offline_circ/process_koc.pl.
Link Here
|
2183 |
=cut |
2185 |
=cut |
2184 |
|
2186 |
|
2185 |
sub MarkIssueReturned { |
2187 |
sub MarkIssueReturned { |
2186 |
my ( $borrowernumber, $itemnumber, $returndate, $privacy ) = @_; |
2188 |
my ( $borrowernumber, $itemnumber, $returndate, $privacy, $set_returndate ) = @_; |
|
|
2189 |
|
2190 |
$set_returndate //= 1; |
2187 |
|
2191 |
|
2188 |
# Retrieve the issue |
2192 |
# Retrieve the issue |
2189 |
my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ) or return; |
2193 |
my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } ) or return; |
Lines 2212-2218
sub MarkIssueReturned {
Link Here
|
2212 |
if ( $returndate ) { |
2216 |
if ( $returndate ) { |
2213 |
$issue->returndate( $returndate )->store->discard_changes; # update and refetch |
2217 |
$issue->returndate( $returndate )->store->discard_changes; # update and refetch |
2214 |
} |
2218 |
} |
2215 |
else { |
2219 |
elsif( $set_returndate) { |
2216 |
$issue->returndate( \'NOW()' )->store->discard_changes; # update and refetch |
2220 |
$issue->returndate( \'NOW()' )->store->discard_changes; # update and refetch |
2217 |
} |
2221 |
} |
2218 |
|
2222 |
|
Lines 3767-3773
sub ReturnLostItem{
Link Here
|
3767 |
|
3771 |
|
3768 |
|
3772 |
|
3769 |
sub LostItem{ |
3773 |
sub LostItem{ |
3770 |
my ($itemnumber, $mark_lost_from, $force_mark_returned) = @_; |
3774 |
my ( $itemnumber, $mark_lost_from, $force_mark_returned, $set_returndate ) = @_; |
3771 |
|
3775 |
|
3772 |
unless ( $mark_lost_from ) { |
3776 |
unless ( $mark_lost_from ) { |
3773 |
# Temporary check to avoid regressions |
3777 |
# Temporary check to avoid regressions |
Lines 3813-3819
sub LostItem{
Link Here
|
3813 |
#warn " $issues->{'borrowernumber'} / $itemnumber "; |
3817 |
#warn " $issues->{'borrowernumber'} / $itemnumber "; |
3814 |
} |
3818 |
} |
3815 |
|
3819 |
|
3816 |
MarkIssueReturned($borrowernumber,$itemnumber,undef,$patron->privacy) if $mark_returned; |
3820 |
MarkIssueReturned($borrowernumber,$itemnumber,undef,$patron->privacy,$set_returndate) if $mark_returned; |
3817 |
} |
3821 |
} |
3818 |
|
3822 |
|
3819 |
#When item is marked lost automatically cancel its outstanding transfers and set items holdingbranch to the transfer source branch (frombranch) |
3823 |
#When item is marked lost automatically cancel its outstanding transfers and set items holdingbranch to the transfer source branch (frombranch) |