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

(-)a/C4/Circulation.pm (-6 / +14 lines)
Lines 3288-3294 sub ReturnLostItem{ Link Here
3288
3288
3289
3289
3290
sub LostItem{
3290
sub LostItem{
3291
    my ($itemnumber, $mark_returned, $charge_fee) = @_;
3291
    my ($itemnumber, $mark_returned) = @_;
3292
3292
3293
    my $dbh = C4::Context->dbh();
3293
    my $dbh = C4::Context->dbh();
3294
    my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title 
3294
    my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title 
Lines 3300-3313 sub LostItem{ Link Here
3300
    my $issues=$sth->fetchrow_hashref();
3300
    my $issues=$sth->fetchrow_hashref();
3301
    $sth->finish;
3301
    $sth->finish;
3302
3302
3303
    # if a borrower lost the item, add a replacement cost to the their record
3303
    # If a borrower lost the item, add a replacement cost to the their record
3304
    if ( my $borrowernumber = $issues->{borrowernumber} ){
3304
    if ( my $borrowernumber = $issues->{borrowernumber} ){
3305
        my $borrower = C4::Members::GetMemberDetails( $borrowernumber );
3305
        my $borrower = C4::Members::GetMemberDetails( $borrowernumber );
3306
3306
3307
        C4::Accounts::chargelostitem($borrowernumber, $itemnumber, $issues->{'replacementprice'}, "Lost Item $issues->{'title'} $issues->{'barcode'}")
3307
        if (C4::Context->preference('WhenLostForgiveFine')){
3308
          if $charge_fee;
3308
            my $exemptfine=1;
3309
        #FIXME : Should probably have a way to distinguish this from an item that really was returned.
3309
            my $dropbox=0;
3310
        #warn " $issues->{'borrowernumber'}  /  $itemnumber ";
3310
            my $fix = _FixOverduesOnReturn($borrowernumber, $itemnumber, $exemptfine, $dropbox);
3311
            defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $itemnumber...) failed!";  # zero is OK, check defined
3312
        }
3313
        if (C4::Context->preference('WhenLostChargeReplacementFee')){
3314
            C4::Accounts::chargelostitem($borrowernumber, $itemnumber, $issues->{'replacementprice'}, "Lost Item $issues->{'title'} $issues->{'barcode'}");
3315
            #FIXME : Should probably have a way to distinguish this from an item that really was returned.
3316
            #warn " $issues->{'borrowernumber'}  /  $itemnumber ";
3317
        }
3318
3311
        MarkIssueReturned($borrowernumber,$itemnumber,undef,undef,$borrower->{'privacy'}) if $mark_returned;
3319
        MarkIssueReturned($borrowernumber,$itemnumber,undef,undef,$borrower->{'privacy'}) if $mark_returned;
3312
    }
3320
    }
3313
}
3321
}
(-)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 606-611 if ($op eq "additem") { Link Here
606
        ModItemFromMarc($itemtosave,$biblionumber,$itemnumber);
607
        ModItemFromMarc($itemtosave,$biblionumber,$itemnumber);
607
        $itemnumber="";
608
        $itemnumber="";
608
    }
609
    }
610
  my $item = GetItem( $itemnumber );
611
    my $olditemlost =  $item->{'itemlost'};
612
    my $newitemlost = $itemtosave->subfield('952','1');
613
    if (($olditemlost eq '0' or $olditemlost eq '' ) and $newitemlost ge '1'){
614
  LostItem($itemnumber,'MARK RETURNED');
615
    }
609
    $nextop="additem";
616
    $nextop="additem";
610
} elsif ($op eq "delinkitem"){
617
} elsif ($op eq "delinkitem"){
611
    my $analyticfield = '773';
618
    my $analyticfield = '773';
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 406-411 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
406
('virtualshelves','1','','If ON, enables Lists management','YesNo'),
406
('virtualshelves','1','','If ON, enables Lists management','YesNo'),
407
('WaitingNotifyAtCheckin','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.','YesNo'),
407
('WaitingNotifyAtCheckin','0',NULL,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.','YesNo'),
408
('WebBasedSelfCheck','0',NULL,'If ON, enables the web-based self-check system','YesNo'),
408
('WebBasedSelfCheck','0',NULL,'If ON, enables the web-based self-check system','YesNo'),
409
('WhenLostChargeReplacementFee','1',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo'),
410
('WhenLostForgiveFine','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo'),
409
('XISBN','0','','Use with FRBRizeEditions. If ON, Koha will use the OCLC xISBN web service in the Editions tab on the detail pages. See: http://www.worldcat.org/affiliate/webservices/xisbn/app.jsp','YesNo'),
411
('XISBN','0','','Use with FRBRizeEditions. If ON, Koha will use the OCLC xISBN web service in the Editions tab on the detail pages. See: http://www.worldcat.org/affiliate/webservices/xisbn/app.jsp','YesNo'),
410
('XISBNDailyLimit','999','','The xISBN Web service is free for non-commercial use when usage does not exceed 1000 requests per day','Integer'),
412
('XISBNDailyLimit','999','','The xISBN Web service is free for non-commercial use when usage does not exceed 1000 requests per day','Integer'),
411
('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'),
413
('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'),
(-)a/installer/data/mysql/updatedatabase.pl (+9 lines)
Lines 7067-7072 if ( CheckVersion($DBversion) ) { Link Here
7067
    SetVersion($DBversion);
7067
    SetVersion($DBversion);
7068
}
7068
}
7069
7069
7070
7071
$DBversion = "3.13.00.XXX";
7072
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
7073
    $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')");
7074
    $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')");
7075
    print "Upgrade to $DBversion done (Bug 7639: Added sysprefs WhenLostForgiveFine and WhenLostChargeReplacementFee)\n";
7076
    SetVersion ($DBversion);
7077
}
7078
7070
=head1 FUNCTIONS
7079
=head1 FUNCTIONS
7071
7080
7072
=head2 TableExists($table)
7081
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+12 lines)
Lines 507-512 Circulation: Link Here
507
                  yes: Include
507
                  yes: Include
508
                  no: "Don't include"
508
                  no: "Don't include"
509
            - the grace period when calculating the fine for an overdue item.
509
            - the grace period when calculating the fine for an overdue item.
510
        -
511
            - pref: WhenLostForgiveFine
512
              choices:
513
                  yes: Forgive
514
                  no: "Don't Forgive"
515
            - the fines on an item when it is lost.
516
        -
517
            - pref: WhenLostChargeReplacementFee
518
              choices:
519
                  yes: Charge
520
                  no: "Don't Charge"
521
            - the replacement price when a patron loses an item.
510
    Self Checkout:
522
    Self Checkout:
511
        -
523
        -
512
            - "Include the following JavaScript on all pages in the web-based self checkout:"
524
            - "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 189-195 if ($op eq "action") { Link Here
189
			UpdateMarcWith( $marcitem, $localmarcitem );
189
			UpdateMarcWith( $marcitem, $localmarcitem );
190
			eval{
190
			eval{
191
                            if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) {
191
                            if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) {
192
                                LostItem($itemnumber, 'MARK RETURNED', 'CHARGE FEE') if $item->{itemlost};
192
                                LostItem($itemnumber, 'MARK RETURNED') if $item->{itemlost};
193
                            }
193
                            }
194
                        };
194
                        };
195
		    }
195
		    }
196
- 

Return to bug 7639