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

(-)a/circ/circulation.pl (+26 lines)
Lines 43-48 use Koha::Holds; Link Here
43
use C4::Context;
43
use C4::Context;
44
use CGI::Session;
44
use CGI::Session;
45
use Koha::AuthorisedValues;
45
use Koha::AuthorisedValues;
46
use Koha::Checkouts::ReturnClaims;
46
use Koha::CsvProfiles;
47
use Koha::CsvProfiles;
47
use Koha::Patrons;
48
use Koha::Patrons;
48
use Koha::DateUtils qw( dt_from_string );
49
use Koha::DateUtils qw( dt_from_string );
Lines 468-473 if (@$barcodes && $op eq 'cud-checkout') { Link Here
468
        }
469
        }
469
    }
470
    }
470
471
472
    if (C4::Context->preference('ClaimReturnedLostValue')) {
473
        my $autoClaimReturnCheckout = C4::Context->preference('AutoClaimReturnStatusOnCheckout');
474
475
        my $claims = Koha::Checkouts::ReturnClaims->search(
476
                {
477
                itemnumber => $item->id,
478
                }
479
            );
480
    if ($claims->count) {
481
        if ($autoClaimReturnCheckout) {
482
            my $claim = $claims->next;
483
484
            my $patron_id = $patron->borrowernumber;
485
            my $resolution = $autoClaimReturnCheckout;
486
487
            $claim->resolve(
488
                    {
489
                    resolution  => $resolution,
490
                    resolved_by => $patron_id,
491
                    }
492
                );
493
            $template_params->{CLAIM_RESOLUTION} = $claim;
494
        }
495
    }
496
}
471
    if ($needsconfirmation->{RESERVE_WAITING} or $needsconfirmation->{RESERVED} or $needsconfirmation->{TRANSFERRED} or $needsconfirmation->{PROCESSING}){
497
    if ($needsconfirmation->{RESERVE_WAITING} or $needsconfirmation->{RESERVED} or $needsconfirmation->{TRANSFERRED} or $needsconfirmation->{PROCESSING}){
472
        $template->param(
498
        $template->param(
473
            reserveborrowernumber => $needsconfirmation->{'resborrowernumber'},
499
            reserveborrowernumber => $needsconfirmation->{'resborrowernumber'},
(-)a/circ/returns.pl (+3 lines)
Lines 739-744 foreach my $code ( keys %$messages ) { Link Here
739
    }
739
    }
740
    elsif ( $code eq 'ReturnClaims' ) {
740
    elsif ( $code eq 'ReturnClaims' ) {
741
        $template->param( ReturnClaims => $messages->{ReturnClaims} );
741
        $template->param( ReturnClaims => $messages->{ReturnClaims} );
742
    }
743
      elsif ( $code eq 'ClaimAutoResolved' ) {
744
          $template->param( ClaimAutoResolved => $messages->{ClaimAutoResolved} );
742
    } elsif ( $code eq 'RecallFound' ) {
745
    } elsif ( $code eq 'RecallFound' ) {
743
        ;
746
        ;
744
    } elsif ( $code eq 'RecallNeedsTransfer' ) {
747
    } elsif ( $code eq 'RecallNeedsTransfer' ) {
(-)a/installer/data/mysql/atomicupdate/bug_27753.pl (+20 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "BUG_27753",
5
    description => "Automate resolution of return claim when checking in an item",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
11
                ('AutoClaimReturnStatusOnCheckin','','NULL','When in use this syspref will automatically resolve the claim return and will update the lost authorized value upon check in.','Free')});
12
13
        say $out "Added new system preference 'AutoClaimReturnStatusOnCheckin'";
14
15
        $dbh->do(q{INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
16
                ('AutoClaimReturnStatusOnCheckout','','NULL','When in use this syspref will automatically resolve the claim return and will update the lost authorized value upon check out.','Free')});
17
18
        say $out "Added new system preference 'AutoClaimReturnStatusOnCheckout'";
19
    },
20
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+2 lines)
Lines 82-87 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
82
('AuthSuccessLog','0',NULL,'If enabled, log successful authentications','YesNo'),
82
('AuthSuccessLog','0',NULL,'If enabled, log successful authentications','YesNo'),
83
('AutoApprovePatronProfileSettings', '0', '', 'Automatically approve patron profile changes from the OPAC.', 'YesNo'),
83
('AutoApprovePatronProfileSettings', '0', '', 'Automatically approve patron profile changes from the OPAC.', 'YesNo'),
84
('autoBarcode','OFF','incremental|annual|hbyymmincr|EAN13|OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','Choice'),
84
('autoBarcode','OFF','incremental|annual|hbyymmincr|EAN13|OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','Choice'),
85
('AutoClaimReturnStatusOnCheckin','','NULL','When in use this syspref will automatically resolve the claim return and will update the lost authorized value upon check in.','Free'),
86
('AutoClaimReturnStatusOnCheckout','','NULL','When in use this syspref will automatically resolve the claim return and will update the lost authorized value upon check out.','Free'),
85
('autoControlNumber','OFF','biblionumber|OFF','Used to autogenerate a Control Number: biblionumber will be as biblionumber, OFF will leave the field as it is;','Choice'),
87
('autoControlNumber','OFF','biblionumber|OFF','Used to autogenerate a Control Number: biblionumber will be as biblionumber, OFF will leave the field as it is;','Choice'),
86
('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'),
88
('AutoCreateAuthorities','0',NULL,'Automatically create authorities that do not exist when cataloging records.','YesNo'),
87
('AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice'),
89
('AutoCreditNumber', '', '', 'Automatically generate a number for account credits', 'Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+12 lines)
Lines 1334-1339 Circulation: Link Here
1334
                  charge: charge a lost fee
1334
                  charge: charge a lost fee
1335
                  no_charge: don't charge a lost fee
1335
                  no_charge: don't charge a lost fee
1336
            - .
1336
            - .
1337
        -
1338
            - Automatically resolve the claim and change the status to the <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=RETURN_CLAIM_RESOLUTION">Return claim resolution</a> authorized value
1339
            - pref: AutoClaimReturnStatusOnCheckin
1340
              choices: authval
1341
              source: RETURN_CLAIM_RESOLUTION
1342
            - upon check in.
1343
        -
1344
            - Automatically resolve the claim and change the status to the <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=RETURN_CLAIM_RESOLUTION">Return claim resolution</a> authorized value
1345
            - pref: AutoClaimReturnStatusOnCheckout
1346
              choices: authval
1347
              source: RETURN_CLAIM_RESOLUTION
1348
            - upon check out.
1337
        -
1349
        -
1338
            - Use the <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=LOST">LOST</a> authorized value
1350
            - Use the <a href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=LOST">LOST</a> authorized value
1339
            - pref: ClaimReturnedLostValue
1351
            - pref: ClaimReturnedLostValue
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+3 lines)
Lines 79-84 Link Here
79
                        </div>
79
                        </div>
80
                    [% END %]
80
                    [% END %]
81
81
82
                    [% IF CLAIM_RESOLUTION %]
83
                        <div class="dialog message">The previously claimed returned item has been located, automatically resolving the associated claim.</div>
84
                    [% END %]
82
                    [% IF ( alert.ITEM_LOST ) %]
85
                    [% IF ( alert.ITEM_LOST ) %]
83
                        <div class="dialog message">This item has been lost with a status of "[% alert.ITEM_LOST | html %]".</div>
86
                        <div class="dialog message">This item has been lost with a status of "[% alert.ITEM_LOST | html %]".</div>
84
                    [% END %]
87
                    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (-2 / +5 lines)
Lines 191-197 Link Here
191
                            [% END %]
191
                            [% END %]
192
192
193
                            <!-- Item has return claim(s) -->
193
                            <!-- Item has return claim(s) -->
194
                            [% IF ( ReturnClaims ) %]
194
                            [% IF ( ClaimAutoResolved ) %]
195
                            <div class="dialog alert return-claim">
196
                            <p><strong>The previously claimed returned item has been found, automatically resolving the associated claim.</strong></p>
197
                            </div>
198
                            [% ELSIF( ReturnClaims ) %]
195
                                <div class="dialog alert return-claim">
199
                                <div class="dialog alert return-claim">
196
                                    <h3>This item has been claimed as returned by:</h3>
200
                                    <h3>This item has been claimed as returned by:</h3>
197
                                    <ul>
201
                                    <ul>
198
- 

Return to bug 27753