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

(-)a/C4/Circulation.pm (-3 / +6 lines)
Lines 1615-1621 sub GetBranchItemRule { Link Here
1615
=head2 AddReturn
1615
=head2 AddReturn
1616
1616
1617
  ($doreturn, $messages, $iteminformation, $borrower) =
1617
  ($doreturn, $messages, $iteminformation, $borrower) =
1618
      &AddReturn($barcode, $branch, $exemptfine, $dropbox);
1618
      &AddReturn($barcode, $branch, $exemptfine, $dropbox, $returndate);
1619
1619
1620
Returns a book.
1620
Returns a book.
1621
1621
Lines 1634-1639 overdue charges are applied and C<$dropbox> is true, the last charge Link Here
1634
will be removed.  This assumes that the fines accrual script has run
1634
will be removed.  This assumes that the fines accrual script has run
1635
for _today_.
1635
for _today_.
1636
1636
1637
=item C<$return_date> allows the default return date to be overridden
1638
by the given return date.
1639
1637
=back
1640
=back
1638
1641
1639
C<&AddReturn> returns a list of four items:
1642
C<&AddReturn> returns a list of four items:
Lines 1687-1693 patron who last borrowed the book. Link Here
1687
=cut
1690
=cut
1688
1691
1689
sub AddReturn {
1692
sub AddReturn {
1690
    my ( $barcode, $branch, $exemptfine, $dropbox ) = @_;
1693
    my ( $barcode, $branch, $exemptfine, $dropbox, $return_date ) = @_;
1691
1694
1692
    if ($branch and not GetBranchDetail($branch)) {
1695
    if ($branch and not GetBranchDetail($branch)) {
1693
        warn "AddReturn error: branch '$branch' not found.  Reverting to " . C4::Context->userenv->{'branch'};
1696
        warn "AddReturn error: branch '$branch' not found.  Reverting to " . C4::Context->userenv->{'branch'};
Lines 1798-1804 sub AddReturn { Link Here
1798
            }
1801
            }
1799
1802
1800
            MarkIssueReturned( $borrowernumber, $item->{'itemnumber'},
1803
            MarkIssueReturned( $borrowernumber, $item->{'itemnumber'},
1801
                $circControlBranch, '', $borrower->{'privacy'} );
1804
                $circControlBranch, $return_date, $borrower->{'privacy'} );
1802
1805
1803
            # FIXME is the "= 1" right?  This could be the borrower hash.
1806
            # FIXME is the "= 1" right?  This could be the borrower hash.
1804
            $messages->{'WasReturned'} = 1;
1807
            $messages->{'WasReturned'} = 1;
(-)a/C4/SIP/ILS.pm (-1 / +1 lines)
Lines 181-187 sub checkin { Link Here
181
    $circ->item($item = new ILS::Item $item_id);
181
    $circ->item($item = new ILS::Item $item_id);
182
182
183
    if ($item) {
183
    if ($item) {
184
        $circ->do_checkin($current_loc);
184
        $circ->do_checkin($current_loc, $return_date);
185
    } else {
185
    } else {
186
        $circ->alert(1);
186
        $circ->alert(1);
187
        $circ->alert_type(99);
187
        $circ->alert_type(99);
(-)a/C4/SIP/ILS/Transaction/Checkin.pm (-2 / +2 lines)
Lines 47-58 sub new { Link Here
47
sub do_checkin {
47
sub do_checkin {
48
    my $self = shift;
48
    my $self = shift;
49
    my $branch = shift;
49
    my $branch = shift;
50
    my $return_date = shift;
50
    if (!$branch) {
51
    if (!$branch) {
51
        $branch = 'SIP2';
52
        $branch = 'SIP2';
52
    }
53
    }
53
    my $barcode = $self->{item}->id;
54
    my $barcode = $self->{item}->id;
54
    $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
55
    $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
55
    my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch);
56
    my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch, $return_date);
56
    $self->alert(!$return);
57
    $self->alert(!$return);
57
    # ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered
58
    # ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered
58
59
59
- 

Return to bug 8769