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

(-)a/C4/Circulation.pm (-9 / +15 lines)
Lines 3078-3084 sub ReturnLostItem{ Link Here
3078
3078
3079
3079
3080
sub LostItem{
3080
sub LostItem{
3081
    my ($itemnumber, $mark_returned, $charge_fee) = @_;
3081
    my ($itemnumber, $mark_returned) = @_;
3082
3082
3083
    my $dbh = C4::Context->dbh();
3083
    my $dbh = C4::Context->dbh();
3084
    my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title 
3084
    my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title 
Lines 3091-3104 sub LostItem{ Link Here
3091
    $sth->finish;
3091
    $sth->finish;
3092
3092
3093
    # if a borrower lost the item, add a replacement cost to the their record
3093
    # if a borrower lost the item, add a replacement cost to the their record
3094
    if ( my $borrowernumber = $issues->{borrowernumber} ){
3094
	if ( my $borrowernumber = $issues->{borrowernumber} ){
3095
3095
		if (C4::Context->preference('ForgiveFineWhenLost')){
3096
        C4::Accounts::chargelostitem($borrowernumber, $itemnumber, $issues->{'replacementprice'}, "Lost Item $issues->{'title'} $issues->{'barcode'}")
3096
			my $exemptfine=1;
3097
          if $charge_fee;
3097
			my $dropbox=0;
3098
        #FIXME : Should probably have a way to distinguish this from an item that really was returned.
3098
			my $fix = _FixOverduesOnReturn($borrowernumber, $itemnumber, $exemptfine, $dropbox);
3099
        #warn " $issues->{'borrowernumber'}  /  $itemnumber ";
3099
			defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $itemnumber...) failed!";  # zero is OK, check defined
3100
        MarkIssueReturned($borrowernumber,$itemnumber) if $mark_returned;
3100
		}
3101
    }
3101
		if (C4::Context->preference('ChargeReplFeeWhenLost')){
3102
			C4::Accounts::chargelostitem($borrowernumber, $itemnumber, $issues->{'replacementprice'}, "Lost Item $issues->{'title'} $issues->{'barcode'}");
3103
			#FIXME : Should probably have a way to distinguish this from an item that really was returned.
3104
			#warn " $issues->{'borrowernumber'}  /  $itemnumber ";
3105
		}
3106
		MarkIssueReturned($borrowernumber,$itemnumber) if $mark_returned;
3107
	}
3102
}
3108
}
3103
3109
3104
sub GetOfflineOperations {
3110
sub GetOfflineOperations {
(-)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 519-524 if ($op eq "additem") { Link Here
519
        ModItemFromMarc($itemtosave,$biblionumber,$itemnumber);
520
        ModItemFromMarc($itemtosave,$biblionumber,$itemnumber);
520
        $itemnumber="";
521
        $itemnumber="";
521
    }
522
    }
523
	my $item = GetItem( $itemnumber );
524
    my $olditemlost =  $item->{'itemlost'};
525
    my $newitemlost = $itemtosave->subfield('952','1');
526
    if (($olditemlost eq '0' or $olditemlost eq '' ) and $newitemlost ge '1'){
527
	LostItem($itemnumber,'MARK RETURNED');
528
    }
522
    $nextop="additem";
529
    $nextop="additem";
523
} elsif ($op eq "delinkitem"){
530
} elsif ($op eq "delinkitem"){
524
    my $analyticfield = '773';
531
    my $analyticfield = '773';
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 34-39 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
34
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('expandedSearchOption',0,'If ON, set advanced search to be expanded by default',NULL,'YesNo');
34
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('expandedSearchOption',0,'If ON, set advanced search to be expanded by default',NULL,'YesNo');
35
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');
35
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');
36
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FinesLog',1,'If ON, log fines',NULL,'YesNo');
36
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FinesLog',1,'If ON, log fines',NULL,'YesNo');
37
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('ForgiveFineWhenLost','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo');
38
INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('ChargeReplFeeWhenLost','0',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo');
37
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hidelostitems',0,'If ON, disables display of\"lost\" items in OPAC.','','YesNo');
39
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hidelostitems',0,'If ON, disables display of\"lost\" items in OPAC.','','YesNo');
38
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');
40
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');
39
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');
41
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 5212-5217 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5212
    SetVersion($DBversion);
5212
    SetVersion($DBversion);
5213
}
5213
}
5214
5214
5215
$DBversion = "3.08.00.XXX";
5216
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5217
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('ForgiveFineWhenLost','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo')");
5218
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('ChargeReplFeeWhenLost','0',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo')");
5219
    print "Upgrade to $DBversion done (Added sysprefs ForgiveFineWhenLost and ChargeReplFeeWhenLost)\n";
5220
    SetVersion ($DBversion);
5221
}
5222
5215
=head1 FUNCTIONS
5223
=head1 FUNCTIONS
5216
5224
5217
=head2 TableExists($table)
5225
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+12 lines)
Lines 367-372 Circulation: Link Here
367
                  test: Calculate (but only for mailing to the admin)
367
                  test: Calculate (but only for mailing to the admin)
368
                  production: Calculate and charge
368
                  production: Calculate and charge
369
            - fines (when <code>misc/cronjobs/fines.pl</code> is being run).
369
            - fines (when <code>misc/cronjobs/fines.pl</code> is being run).
370
        -
371
            - pref: ForgiveFineWhenLost
372
              choices:
373
                  yes: Forgive
374
                  no: "Don't Forgive"
375
            - the fines on an item when it is lost.
376
        -
377
            - pref: ChargeReplFeeWhenLost
378
              choices:
379
                  yes: Charge
380
                  no: "Don't Charge"
381
            - the replacement price when a patron loses an item.
370
    Self Checkout:
382
    Self Checkout:
371
        -
383
        -
372
            - pref: ShowPatronImageInWebBasedSelfCheck
384
            - pref: ShowPatronImageInWebBasedSelfCheck
(-)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 188-194 if ($op eq "action") { Link Here
188
			UpdateMarcWith( $marcitem, $localmarcitem );
188
			UpdateMarcWith( $marcitem, $localmarcitem );
189
			eval{
189
			eval{
190
                            if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) {
190
                            if ( my $item = ModItemFromMarc( $localmarcitem, $itemdata->{biblionumber}, $itemnumber ) ) {
191
                                LostItem($itemnumber, 'MARK RETURNED', 'CHARGE FEE') if $item->{itemlost};
191
                                LostItem($itemnumber, 'MARK RETURNED') if $item->{itemlost};
192
                            }
192
                            }
193
                        };
193
                        };
194
		    }
194
		    }
195
- 

Return to bug 7639