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

(-)a/C4/Circulation.pm (-1 / +5 lines)
Lines 1678-1684 patron who last borrowed the book. Link Here
1678
=cut
1678
=cut
1679
1679
1680
sub AddReturn {
1680
sub AddReturn {
1681
    my ( $barcode, $branch, $exemptfine, $dropbox ) = @_;
1681
    my ( $barcode, $branch, $exemptfine, $dropbox, $return_date) = @_;
1682
1682
1683
    if ($branch and not GetBranchDetail($branch)) {
1683
    if ($branch and not GetBranchDetail($branch)) {
1684
        warn "AddReturn error: branch '$branch' not found.  Reverting to " . C4::Context->userenv->{'branch'};
1684
        warn "AddReturn error: branch '$branch' not found.  Reverting to " . C4::Context->userenv->{'branch'};
Lines 1764-1769 sub AddReturn { Link Here
1764
        }
1764
        }
1765
1765
1766
        if ($borrowernumber) {
1766
        if ($borrowernumber) {
1767
<<<<<<< HEAD
1767
        if($issue->{'overdue'}){
1768
        if($issue->{'overdue'}){
1768
                my ( $amount, $type, $unitcounttotal ) = C4::Overdues::CalcFine( $item, $borrower->{categorycode},$branch, $datedue, $today );
1769
                my ( $amount, $type, $unitcounttotal ) = C4::Overdues::CalcFine( $item, $borrower->{categorycode},$branch, $datedue, $today );
1769
                $type ||= q{};
1770
                $type ||= q{};
Lines 1776-1781 sub AddReturn { Link Here
1776
        }
1777
        }
1777
            }
1778
            }
1778
            MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch, '', $borrower->{'privacy'});
1779
            MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch, '', $borrower->{'privacy'});
1780
=======
1781
            MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch, $return_date, $borrower->{'privacy'});
1782
>>>>>>> Bug 8769 - Allow SIP2 return backdating
1779
            $messages->{'WasReturned'} = 1;    # FIXME is the "= 1" right?  This could be the borrower hash.
1783
            $messages->{'WasReturned'} = 1;    # FIXME is the "= 1" right?  This could be the borrower hash.
1780
        }
1784
        }
1781
1785
(-)a/C4/ImportBatch.pm (+32 lines)
Lines 76-81 BEGIN { Link Here
76
    SetImportRecordStatus
76
    SetImportRecordStatus
77
    GetImportRecordMatches
77
    GetImportRecordMatches
78
    SetImportRecordMatches
78
    SetImportRecordMatches
79
    GetImportProfileLoop
79
	);
80
	);
80
}
81
}
81
82
Lines 1344-1350 sub SetImportRecordMatches { Link Here
1344
        $sth->execute($import_record_id, $match->{'record_id'}, $match->{'score'});
1345
        $sth->execute($import_record_id, $match->{'record_id'}, $match->{'score'});
1345
    }
1346
    }
1346
}
1347
}
1348
#added sub GetImportProfileLoop
1347
1349
1350
sub GetImportProfileLoop {
1351
    my $dbh = C4::Context->dbh;
1352
1353
    my $results = $dbh->selectall_arrayref( "
1354
        SELECT
1355
          import_profiles.profile_id, description, matcher_id, template_id, overlay_action, nomatch_action, parse_items, item_action, COUNT( marcxml ) AS added_items, ip_actions.tag, ip_actions.subfield
1356
          FROM import_profiles
1357
            LEFT JOIN import_profile_added_items AS ip_items ON ( import_profiles.profile_id = ip_items.profile_id )
1358
            LEFT JOIN import_profile_subfield_actions AS ip_actions ON ( import_profiles.profile_id = ip_actions.profile_id )
1359
          GROUP BY import_profiles.profile_id, ip_actions.tag, ip_actions.subfield
1360
    ", { Slice => {} } );
1361
    return [] unless ( @$results );
1362
1363
    my @profiles;
1364
    my $current_profile;
1365
1366
    foreach my $result ( @$results ) {
1367
        if ( $current_profile && $current_profile->{'profile_id'} == $result->{'profile_id'} ) {
1368
            push @{ $current_profile->{'modified_subfields'} }, { tag => $result->{'tag'}, subfield => $result->{'subfield'} }
1369
        } else {
1370
            push @profiles, $result;
1371
            $current_profile = $result;
1372
            $current_profile->{'modified_subfields'} = $result->{'tag'} ? [ { tag => $result->{'tag'}, subfield => $result->{'subfield'} } ] : [];
1373
        }
1374
        delete $result->{'tag'};
1375
        delete $result->{'subfield'};
1376
    }
1377
1378
    return \@profiles;
1379
}
1348
1380
1349
# internal functions
1381
# internal functions
1350
1382
(-)a/C4/SIP/ILS/Transaction/Checkin.pm (-5 / +4 lines)
Lines 46-58 sub new { Link Here
46
46
47
sub do_checkin {
47
sub do_checkin {
48
    my $self = shift;
48
    my $self = shift;
49
    my $branch = shift;
49
    my $branch = shift || 'SIP2';
50
    if (!$branch) {
50
    my $return_date = shift;
51
        $branch = 'SIP2';
51
52
    }
53
    my $barcode = $self->{item}->id;
52
    my $barcode = $self->{item}->id;
54
    $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
53
    $debug and warn "do_checkin() calling AddReturn($barcode, $branch)";
55
    my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch);
54
    my ($return, $messages, $iteminformation, $borrower) = AddReturn($barcode, $branch, undef, undef, $return_date);
56
    $self->alert(!$return);
55
    $self->alert(!$return);
57
    # ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered
56
    # ignoring messages: NotIssued, IsPermanent, WasLost, WasTransfered
58
57
(-)a/etc/SIPconfig.xml (-6 / +5 lines)
Lines 36-44 Link Here
36
  </listeners>
36
  </listeners>
37
37
38
  <accounts>
38
  <accounts>
39
      <login id="term1"  password="term1" delimiter="|" error-detect="enabled" institution="CPL" />
39
      <login id="sipuser"  password="sipchkacs" delimiter="|" error-detect="enabled" institution="MID" />
40
      <login id="koha"   password="koha"  delimiter="|" error-detect="enabled" institution="kohalibrary" />
40
      <login id="sipuser3"   password="sipuser3"  delimiter="|" error-detect="enabled" institution="mid" />
41
      <login id="koha2"  password="koha" institution="kohalibrary2" />
41
      <login id="sipuser2"  password="sipuser2" institution="MID" />
42
      <login id="lpl-sc" password="1234" institution="LPL" />
42
      <login id="lpl-sc" password="1234" institution="LPL" />
43
      <login id="lpl-sc-beacock" password="xyzzy"
43
      <login id="lpl-sc-beacock" password="xyzzy"
44
             delimiter="|" error-detect="enabled" institution="LPL" />
44
             delimiter="|" error-detect="enabled" institution="LPL" />
Lines 52-64 in our case "ILS". Link Here
52
-->
52
-->
53
53
54
<institutions>
54
<institutions>
55
    <institution id="MAIN" implementation="ILS" parms="">
55
    <institution id="MID" implementation="ILS" parms="">
56
          <policy checkin="true" renewal="true" checkout="true"
56
          <policy checkin="true" renewal="true" checkout="true"
57
	  	  status_update="false" offline="false"
57
	  	  status_update="false" offline="false"
58
		  timeout="100"
58
		  timeout="100"
59
	  	  retries="5" />
59
	  	  retries="5" />
60
    </institution>
60
    </institution>
61
    <institution id="CPL" implementation="ILS" parms="">
61
    <institution id="mid" implementation="ILS" parms="">
62
          <policy checkin="true" renewal="true" checkout="true"
62
          <policy checkin="true" renewal="true" checkout="true"
63
	  	  status_update="false" offline="false"
63
	  	  status_update="false" offline="false"
64
		  timeout="25"
64
		  timeout="25"
65
- 

Return to bug 8769