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

(-)a/C4/Circulation.pm (-3 / +5 lines)
Lines 1708-1714 patron who last borrowed the book. Link Here
1708
=cut
1708
=cut
1709
1709
1710
sub AddReturn {
1710
sub AddReturn {
1711
    my ( $barcode, $branch, $exemptfine, $dropbox ) = @_;
1711
    my ( $barcode, $branch, $exemptfine, $dropbox, $return_date) = @_;
1712
warn "AddReturn( $barcode, $branch, $exemptfine, $dropbox, $return_date)";
1712
1713
1713
    if ($branch and not GetBranchDetail($branch)) {
1714
    if ($branch and not GetBranchDetail($branch)) {
1714
        warn "AddReturn error: branch '$branch' not found.  Reverting to " . C4::Context->userenv->{'branch'};
1715
        warn "AddReturn error: branch '$branch' not found.  Reverting to " . C4::Context->userenv->{'branch'};
Lines 1779-1785 sub AddReturn { Link Here
1779
    }
1780
    }
1780
1781
1781
    # case of a return of document (deal with issues and holdingbranch)
1782
    # case of a return of document (deal with issues and holdingbranch)
1782
    my $today = DateTime->now( time_zone => C4::Context->tz() );
1783
    my $today = dt_from_string( $return_date, 'iso' );
1784
1783
    if ($doreturn) {
1785
    if ($doreturn) {
1784
    my $datedue = $issue->{date_due};
1786
    my $datedue = $issue->{date_due};
1785
        $borrower or warn "AddReturn without current borrower";
1787
        $borrower or warn "AddReturn without current borrower";
Lines 1819-1825 sub AddReturn { Link Here
1819
            }
1821
            }
1820
1822
1821
            MarkIssueReturned( $borrowernumber, $item->{'itemnumber'},
1823
            MarkIssueReturned( $borrowernumber, $item->{'itemnumber'},
1822
                $circControlBranch, '', $borrower->{'privacy'} );
1824
                $circControlBranch, $return_date, $borrower->{'privacy'} );
1823
1825
1824
            # FIXME is the "= 1" right?  This could be the borrower hash.
1826
            # FIXME is the "= 1" right?  This could be the borrower hash.
1825
            $messages->{'WasReturned'} = 1;
1827
            $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 / +16 lines)
Lines 16-21 use C4::Circulation; Link Here
16
use C4::Reserves qw( ModReserveAffect );
16
use C4::Reserves qw( ModReserveAffect );
17
use C4::Items qw( ModItemTransfer );
17
use C4::Items qw( ModItemTransfer );
18
use C4::Debug;
18
use C4::Debug;
19
use Koha::DateUtils;
19
20
20
use parent qw(ILS::Transaction);
21
use parent qw(ILS::Transaction);
21
22
Lines 47-58 sub new { Link Here
47
sub do_checkin {
48
sub do_checkin {
48
    my $self = shift;
49
    my $self = shift;
49
    my $branch = shift;
50
    my $branch = shift;
51
    my $return_date = shift;
50
    if (!$branch) {
52
    if (!$branch) {
51
        $branch = 'SIP2';
53
        $branch = 'SIP2';
52
    }
54
    }
53
    my $barcode = $self->{item}->id;
55
    my $barcode = $self->{item}->id;
56
57
    $return_date =   substr( $return_date, 0, 4 )
58
                   . '-'
59
                   . substr( $return_date, 4, 2 )
60
                   . '-'
61
                   . substr( $return_date, 6, 2 )
62
                   . q{ }
63
                   . substr( $return_date, 12, 2 )
64
                   . ':'
65
                   . substr( $return_date, 14, 2 )
66
                   . ':'
67
                   . substr( $return_date, 16, 2 );
68
54
    $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
69
    $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
55
    my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch);
70
    my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch, undef, undef, $return_date);
56
    $self->alert(!$return);
71
    $self->alert(!$return);
57
    # ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered
72
    # ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered
58
73
59
- 

Return to bug 8769