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

(-)a/C4/Circulation.pm (-6 / +14 lines)
Lines 3252-3258 sub ReturnLostItem{ Link Here
3252
3252
3253
3253
3254
sub LostItem{
3254
sub LostItem{
3255
    my ($itemnumber, $mark_returned, $charge_fee) = @_;
3255
    my ($itemnumber, $mark_returned) = @_;
3256
3256
3257
    my $dbh = C4::Context->dbh();
3257
    my $dbh = C4::Context->dbh();
3258
    my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title 
3258
    my $sth=$dbh->prepare("SELECT issues.*,items.*,biblio.title 
Lines 3264-3277 sub LostItem{ Link Here
3264
    my $issues=$sth->fetchrow_hashref();
3264
    my $issues=$sth->fetchrow_hashref();
3265
    $sth->finish;
3265
    $sth->finish;
3266
3266
3267
    # if a borrower lost the item, add a replacement cost to the their record
3267
    # If a borrower lost the item, add a replacement cost to the their record
3268
    if ( my $borrowernumber = $issues->{borrowernumber} ){
3268
    if ( my $borrowernumber = $issues->{borrowernumber} ){
3269
        my $borrower = C4::Members::GetMemberDetails( $borrowernumber );
3269
        my $borrower = C4::Members::GetMemberDetails( $borrowernumber );
3270
3270
3271
        C4::Accounts::chargelostitem($borrowernumber, $itemnumber, $issues->{'replacementprice'}, "Lost Item $issues->{'title'} $issues->{'barcode'}")
3271
        if (C4::Context->preference('ForgiveFineWhenLost')){
3272
          if $charge_fee;
3272
            my $exemptfine=1;
3273
        #FIXME : Should probably have a way to distinguish this from an item that really was returned.
3273
            my $dropbox=0;
3274
        #warn " $issues->{'borrowernumber'}  /  $itemnumber ";
3274
            my $fix = _FixOverduesOnReturn($borrowernumber, $itemnumber, $exemptfine, $dropbox);
3275
            defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $itemnumber...) failed!";  # zero is OK, check defined
3276
        }
3277
        if (C4::Context->preference('ChargeReplFeeWhenLost')){
3278
            C4::Accounts::chargelostitem($borrowernumber, $itemnumber, $issues->{'replacementprice'}, "Lost Item $issues->{'title'} $issues->{'barcode'}");
3279
            #FIXME : Should probably have a way to distinguish this from an item that really was returned.
3280
            #warn " $issues->{'borrowernumber'}  /  $itemnumber ";
3281
        }
3282
3275
        MarkIssueReturned($borrowernumber,$itemnumber,undef,undef,$borrower->{'privacy'}) if $mark_returned;
3283
        MarkIssueReturned($borrowernumber,$itemnumber,undef,undef,$borrower->{'privacy'}) if $mark_returned;
3276
    }
3284
    }
3277
}
3285
}
(-)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 596-601 if ($op eq "additem") { Link Here
596
        ModItemFromMarc($itemtosave,$biblionumber,$itemnumber);
597
        ModItemFromMarc($itemtosave,$biblionumber,$itemnumber);
597
        $itemnumber="";
598
        $itemnumber="";
598
    }
599
    }
600
	my $item = GetItem( $itemnumber );
601
    my $olditemlost =  $item->{'itemlost'};
602
    my $newitemlost = $itemtosave->subfield('952','1');
603
    if (($olditemlost eq '0' or $olditemlost eq '' ) and $newitemlost ge '1'){
604
	LostItem($itemnumber,'MARK RETURNED');
605
    }
599
    $nextop="additem";
606
    $nextop="additem";
600
} elsif ($op eq "delinkitem"){
607
} elsif ($op eq "delinkitem"){
601
    my $analyticfield = '773';
608
    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('ForgiveFineWhenLost','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('ChargeReplFeeWhenLost','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 (+9 lines)
Lines 5213-5218 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5213
    SetVersion($DBversion);
5213
    SetVersion($DBversion);
5214
}
5214
}
5215
5215
5216
<<<<<<< HEAD
5216
$DBversion = "3.09.00.001";
5217
$DBversion = "3.09.00.001";
5217
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5218
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5218
    $dbh->do("ALTER TABLE borrower_attribute_types MODIFY category_code VARCHAR( 1 ) NULL DEFAULT NULL");
5219
    $dbh->do("ALTER TABLE borrower_attribute_types MODIFY category_code VARCHAR( 1 ) NULL DEFAULT NULL");
Lines 6019-6024 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
6019
   SetVersion ($DBversion);
6020
   SetVersion ($DBversion);
6020
}
6021
}
6021
6022
6023
$DBversion = "3.09.00.XXX";
6024
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6025
    $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')");
6026
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('ChargeReplFeeWhenLost','1',NULL,'If ON, Charge the replacement price when a patron loses an item.','YesNo')");
6027
    print "Upgrade to $DBversion done (Added sysprefs ForgiveFineWhenLost and ChargeReplFeeWhenLost)\n";
6028
    SetVersion ($DBversion);
6029
}
6030
6022
=head1 FUNCTIONS
6031
=head1 FUNCTIONS
6023
6032
6024
=head2 TableExists($table)
6033
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+12 lines)
Lines 452-457 Circulation: Link Here
452
                  test: Calculate (but only for mailing to the admin)
452
                  test: Calculate (but only for mailing to the admin)
453
                  production: Calculate and charge
453
                  production: Calculate and charge
454
            - fines (when <code>misc/cronjobs/fines.pl</code> is being run).
454
            - fines (when <code>misc/cronjobs/fines.pl</code> is being run).
455
        -
456
            - pref: ForgiveFineWhenLost
457
              choices:
458
                  yes: Forgive
459
                  no: "Don't Forgive"
460
            - the fines on an item when it is lost.
461
        -
462
            - pref: ChargeReplFeeWhenLost
463
              choices:
464
                  yes: Charge
465
                  no: "Don't Charge"
466
            - the replacement price when a patron loses an item.
455
    Self Checkout:
467
    Self Checkout:
456
        -
468
        -
457
            - pref: ShowPatronImageInWebBasedSelfCheck
469
            - 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 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