X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FOverdues.pm;h=ffdeaf5cf1550f334323a1bf297d340ff6c54193;hb=c0714a99f23bd61bcde14a34091b1e5c55a4ffd0;hp=23e75f56536c0e9f8a8b101dd712aae90536424e;hpb=367c4fb8815bfe4a01869a25bcd8222989c15dcd;p=koha_fer diff --git a/C4/Overdues.pm b/C4/Overdues.pm index 23e75f5653..ffdeaf5cf1 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -33,7 +33,7 @@ use vars qw($VERSION @ISA @EXPORT); BEGIN { # set the version for version checking - $VERSION = 3.01; + $VERSION = 3.07.00.049; require Exporter; @ISA = qw(Exporter); # subs to rename (and maybe merge some...) @@ -255,7 +255,8 @@ sub CalcFine { my ( $item, $bortype, $branchcode, $due_dt, $end_date ) = @_; my $start_date = $due_dt->clone(); # get issuingrules (fines part will be used) - my $data = C4::Circulation::GetIssuingRule($bortype, $item->{itemtype}, $branchcode); + my $itemtype = $item->{itemtype} || $item->{itype}; + my $data = C4::Circulation::GetIssuingRule($bortype, $itemtype, $branchcode); my $fine_unit = $data->{lengthunit}; $fine_unit ||= 'days'; @@ -300,6 +301,9 @@ sub _get_chargeable_units { } else { $charge_duration = $dt2->delta_ms( $dt1 ); } + if($charge_duration->in_units('hours') == 0 && $charge_duration->in_units('seconds') > 0){ + return 1; + } return $charge_duration->in_units('hours'); } else { # days