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

(-)a/C4/Circulation.pm (-6 / +14 lines)
Lines 3293-3299 sub ReturnLostItem{ Link Here
3293
3293
3294
3294
3295
sub LostItem{
3295
sub LostItem{
3296
    my ($itemnumber, $mark_returned, $charge_fee) = @_;
3296
    my ($itemnumber, $mark_returned) = @_;
3297
3297
3298
    my $dbh = C4::Context->dbh();
3298
    my $dbh = C4::Context->dbh();
3299
    my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title 
3299
    my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title 
Lines 3305-3318 sub LostItem{ Link Here
3305
    my $issues=$sth->fetchrow_hashref();
3305
    my $issues=$sth->fetchrow_hashref();
3306
    $sth->finish;
3306
    $sth->finish;
3307
3307
3308
    # if a borrower lost the item, add a replacement cost to the their record
3308
    # If a borrower lost the item, add a replacement cost to the their record
3309
    if ( my $borrowernumber = $issues->{borrowernumber} ){
3309
    if ( my $borrowernumber = $issues->{borrowernumber} ){
3310
        my $borrower = C4::Members::GetMemberDetails( $borrowernumber );
3310
        my $borrower = C4::Members::GetMemberDetails( $borrowernumber );
3311
3311
3312
        C4::Accounts::chargelostitem($borrowernumber, $itemnumber, $issues->{'replacementprice'}, "Lost Item $issues->{'title'} $issues->{'barcode'}")
3312
        if (C4::Context->preference('WhenLostForgiveFine')){
3313
          if $charge_fee;
3313
            my $exemptfine=1;
3314
        #FIXME : Should probably have a way to distinguish this from an item that really was returned.
3314
            my $dropbox=0;
3315
        #warn " $issues->{'borrowernumber'}  /  $itemnumber ";
3315
            my $fix = _FixOverduesOnReturn($borrowernumber, $itemnumber, $exemptfine, $dropbox);
3316
            defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $itemnumber...) failed!";  # zero is OK, check defined
3317
        }
3318
        if (C4::Context->preference('WhenLostChargeReplacementFee')){
3319
            C4::Accounts::chargelostitem($borrowernumber, $itemnumber, $issues->{'replacementprice'}, "Lost Item $issues->{'title'} $issues->{'barcode'}");
3320
            #FIXME : Should probably have a way to distinguish this from an item that really was returned.
3321
            #warn " $issues->{'borrowernumber'}  /  $itemnumber ";
3322
        }
3323
3316
        MarkIssueReturned($borrowernumber,$itemnumber,undef,undef,$borrower->{'privacy'}) if $mark_returned;
3324
        MarkIssueReturned($borrowernumber,$itemnumber,undef,undef,$borrower->{'privacy'}) if $mark_returned;
3317
    }
3325
    }
3318
}
3326
}
(-)a/catalogue/updateitem.pl (-1 / +1 lines)
Lines 74-79 if (defined $itemnotes) { # i.e., itemnotes parameter passed from form Link Here
74
74
75
ModItem($item_changes, $biblionumber, $itemnumber);
75
ModItem($item_changes, $biblionumber, $itemnumber);
76
76
77
LostItem($itemnumber, 'MARK RETURNED', 'CHARGE FEE') if $itemlost;
77
LostItem($itemnumber, 'MARK RETURNED') if $itemlost;
78
78
79
print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber");
79
print $cgi->redirect("moredetail.pl?biblionumber=$biblionumber&itemnumber=$itemnumber#item$itemnumber");
(-)a/cataloguing/additem.pl (+7 lines)
Lines 27-32 use C4::Output; Link Here
27
use C4::Biblio;
27
use C4::Biblio;
28
use C4::Items;
28
use C4::Items;
29
use C4::Context;
29
use C4::Context;
30
use C4::Circulation;
30
use C4::Koha; # XXX subfield_is_koha_internal_p
31
use C4::Koha; # XXX subfield_is_koha_internal_p
31
use C4::Branch; # XXX subfield_is_koha_internal_p
32
use C4::Branch; # XXX subfield_is_koha_internal_p
32
use C4::ClassSource;
33
use C4::ClassSource;
Lines 604-609 if ($op eq "additem") { Link Here
604
        ModItemFromMarc($itemtosave,$biblionumber,$itemnumber);
605
        ModItemFromMarc($itemtosave,$biblionumber,$itemnumber);
605
        $itemnumber="";
606
        $itemnumber="";
606
    }
607
    }
608
  my $item = GetItem( $itemnumber );
609
    my $olditemlost =  $item->{'itemlost'};
610
    my $newitemlost = $itemtosave->subfield('952','1');
611
    if (($olditemlost eq '0' or $olditemlost eq '' ) and $newitemlost ge '1'){
612
  LostItem($itemnumber,'MARK RETURNED');
613
    }
607
    $nextop="additem";
614
    $nextop="additem";
608
} elsif ($op eq "delinkitem"){
615
} elsif ($op eq "delinkitem"){
609
    my $analyticfield = '773';
616
    my $analyticfield = '773';
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 28-33 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
28
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('expandedSearchOption',0,'If ON, set advanced search to be expanded by default',NULL,'YesNo');
28
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('expandedSearchOption',0,'If ON, set advanced search to be expanded by default',NULL,'YesNo');
29
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FineNotifyAtCheckin',0,'If ON notify librarians of overdue fines on the items they are checking in.',NULL,'YesNo');
29
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FineNotifyAtCheckin',0,'If ON notify librarians of overdue fines on the items they are checking in.',NULL,'YesNo');
30
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FinesLog',1,'If ON, log fines',NULL,'YesNo');
30
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FinesLog',1,'If ON, log fines',NULL,'YesNo');
31
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('WhenLostForgiveFine','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo');
32
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('WhenLostChargeReplacementFee','1',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo');
31
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hidelostitems',0,'If ON, disables display of\"lost\" items in OPAC.','','YesNo');
33
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hidelostitems',0,'If ON, disables display of\"lost\" items in OPAC.','','YesNo');
32
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hide_marc',0,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)',NULL,'YesNo');
34
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hide_marc',0,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)',NULL,'YesNo');
33
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WaitingNotifyAtCheckin',0,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.',NULL,'YesNo');
35
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WaitingNotifyAtCheckin',0,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.',NULL,'YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+8 lines)
Lines 6700-6705 if ( CheckVersion($DBversion) ) { Link Here
6700
    SetVersion ($DBversion);
6700
    SetVersion ($DBversion);
6701
}
6701
}
6702
6702
6703
$DBversion = "3.11.00.XXX";
6704
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6705
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('WhenLostForgiveFine','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo')");
6706
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('WhenLostChargeReplacementFee','1',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo')");
6707
    print "Upgrade to $DBversion done (Added sysprefs WhenLostForgiveFine and WhenLostChargeReplacementFee)\n";
6708
    SetVersion ($DBversion);
6709
}
6710
6703
=head1 FUNCTIONS
6711
=head1 FUNCTIONS
6704
6712
6705
=head2 TableExists($table)
6713
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+12 lines)
Lines 488-493 Circulation: Link Here
488
                  yes: Include
488
                  yes: Include
489
                  no: "Don't include"
489
                  no: "Don't include"
490
            - the grace period when calculating the fine for an overdue item.
490
            - the grace period when calculating the fine for an overdue item.
491
        -
492
            - pref: WhenLostForgiveFine
493
              choices:
494
                  yes: Forgive
495
                  no: "Don't Forgive"
496
            - the fines on an item when it is lost.
497
        -
498
            - pref: WhenLostChargeReplacementFee
499
              choices:
500
                  yes: Charge
501
                  no: "Don't Charge"
502
            - the replacement price when a patron loses an item.
491
    Self Checkout:
503
    Self Checkout:
492
        -
504
        -
493
            - "Include the following JavaScript on all pages in the web-based self checkout:"
505
            - "Include the following JavaScript on all pages in the web-based self checkout:"
(-)a/misc/cronjobs/longoverdue.pl (-1 / +1 lines)
Lines 165-171 foreach my $startrange (sort keys %$lost) { Link Here
165
            printf ("Due %s: item %5s from borrower %5s to lost: %s\n", $row->{date_due}, $row->{itemnumber}, $row->{borrowernumber}, $lostvalue) if($verbose);
165
            printf ("Due %s: item %5s from borrower %5s to lost: %s\n", $row->{date_due}, $row->{itemnumber}, $row->{borrowernumber}, $lostvalue) if($verbose);
166
            if($confirm) {
166
            if($confirm) {
167
                ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'});
167
                ModItem({ itemlost => $lostvalue }, $row->{'biblionumber'}, $row->{'itemnumber'});
168
                LostItem($row->{'itemnumber'}, $mark_returned, 'CHARGE FEE') if( $charge && $charge eq $lostvalue);
168
                LostItem($row->{'itemnumber'}, $mark_returned) if( $charge && $charge eq $lostvalue);
169
            }
169
            }
170
            $count++;
170
            $count++;
171
        }
171
        }
(-)a/tools/batchMod.pl (-2 / +1 lines)
Lines 190-196 if ($op eq "action") { Link Here
190
			UpdateMarcWith( $marcitem, $localmarcitem );
190
			UpdateMarcWith( $marcitem, $localmarcitem );
191
			eval{
191
			eval{
192
                            if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) {
192
                            if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) {
193
                                LostItem($itemnumber, 'MARK RETURNED', 'CHARGE FEE') if $item->{itemlost};
193
                                LostItem($itemnumber, 'MARK RETURNED') if $item->{itemlost};
194
                            }
194
                            }
195
                        };
195
                        };
196
		    }
196
		    }
197
- 

Return to bug 7639