Lines 1846-1853
sub _FixFineDaysOnReturn {
Link Here
|
1846 |
# grace period is measured in the same units as the loan |
1846 |
# grace period is measured in the same units as the loan |
1847 |
my $grace = DateTime::Duration->new( $unit => $issuingrule->{firstremind} ); |
1847 |
my $grace = DateTime::Duration->new( $unit => $issuingrule->{firstremind} ); |
1848 |
|
1848 |
|
1849 |
if ( ( $deltadays - $grace )->is_positive ) { # you can't compare DateTime::Durations with logical operators |
1849 |
if ( $deltadays - $grace->in_units('days') { |
1850 |
my $new_debar_dt = $dt_today->clone()->add_duration( $deltadays * $finedays ); |
1850 |
my $new_debar_dt = $dt_today->clone()->add_duration( DateTime::Duration->new( days => $deltadays * $finedays ) ); |
1851 |
my $borrower_debar_dt = dt_from_string( $borrower->{debarred} ); |
1851 |
my $borrower_debar_dt = dt_from_string( $borrower->{debarred} ); |
1852 |
# check to see if the current debar date is a valid date |
1852 |
# check to see if the current debar date is a valid date |
1853 |
if ( $borrower->{debarred} && $borrower_debar_dt ) { |
1853 |
if ( $borrower->{debarred} && $borrower_debar_dt ) { |