Bugzilla – Attachment 44928 Details for
Bug 14960
Remove C4::Dates from files in misc/cronjobs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 14960: Simplify the date management in staticfines
PASSED-QA-Bug-14960-Simplify-the-date-management-i.patch (text/plain), 3.13 KB, created by
Kyle M Hall (khall)
on 2015-11-17 17:13:54 UTC
(
hide
)
Description:
[PASSED QA] Bug 14960: Simplify the date management in staticfines
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-11-17 17:13:54 UTC
Size:
3.13 KB
patch
obsolete
>From b3ec8d413f5c4356b2a7318e11cdaeea2b0ba996 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 11 Nov 2015 12:31:12 +0000 >Subject: [PATCH] [PASSED QA] Bug 14960: Simplify the date management in > staticfines > >There is no need to create a DT objcet, then display in string/iso >then recreate a DT object from this string. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > misc/cronjobs/staticfines.pl | 19 ++++++++++--------- > 1 file changed, 10 insertions(+), 9 deletions(-) > >diff --git a/misc/cronjobs/staticfines.pl b/misc/cronjobs/staticfines.pl >index de92c65..c57e99e 100755 >--- a/misc/cronjobs/staticfines.pl >+++ b/misc/cronjobs/staticfines.pl >@@ -103,7 +103,7 @@ foreach (@pcategories) { > } > > use vars qw(@borrower_fields @item_fields @other_fields); >-use vars qw($fldir $libname $control $mode $delim $dbname $today_iso $today_days); >+use vars qw($fldir $libname $control $mode $delim $dbname $today $today_iso $today_days); > use vars qw($filename); > > CHECK { >@@ -135,23 +135,24 @@ if (defined $borrowernumberlimit) { > } > my $overdueItemsCounted = 0; > my %calendars = (); >-$today_iso = output_pref( { dt => dt_from_string, dateonly => 1, dateformat => 'iso' } ); >+$today = dt_from_string; >+$today_iso = output_pref( { dt => $today, dateonly => 1, dateformat => 'iso' } ); > my ($tyear, $tmonth, $tday) = split( /-/, $today_iso ); > $today_days = Date_to_Days( $tyear, $tmonth, $tday ); > > for ( my $i = 0 ; $i < scalar(@$data) ; $i++ ) { > next if $data->[$i]->{'itemlost'}; >- my $datedue; >- my $datedue_days; >+ my ( $datedue, $datedue_days ); > eval { >- $datedue = eval { output_pref( { dt => dt_from_string( $data->[$i]->{'date_due'} ), dateonly => 1, dateformat => 'iso' } ); }; >- $datedue_days = Date_to_Days( split( /-/, $datedue ) ); >+ $datedue = dt_from_string( $data->[$i]->{'date_due'} ); >+ my $datedue_iso = output_pref( { dt => $datedue, dateonly => 1, dateformat => 'iso' } ); >+ $datedue_days = Date_to_Days( split( /-/, $datedue_iso ) ); > }; > if ($@) { > warn "Error on date for borrower " . $data->[$i]->{'borrowernumber'} . ": $@date_due: " . $data->[$i]->{'date_due'} . "\ndatedue_days: " . $datedue_days . "\nSkipping"; > next; > } >- my $due_str = eval { output_pref( { dt => dt_from_string( $datedue ), dateonly => 1 } ); }; >+ my $due_str = output_pref( { dt => $datedue, dateonly => 1 } ); > unless ( defined $data->[$i]->{'borrowernumber'} ) { > print STDERR "ERROR in Getoverdues line $i: issues.borrowernumber IS NULL. Repair 'issues' table now! Skipping record.\n"; > next; # Note: this doesn't solve everything. After NULL borrowernumber, multiple issues w/ real borrowernumbers can pile up. >@@ -191,8 +192,8 @@ for ( my $i = 0 ; $i < scalar(@$data) ; $i++ ) { > $data->[$i], > $borrower->{'categorycode'}, > $branchcode, >- dt_from_string( $datedue ), >- dt_from_string( $today_iso ), >+ $datedue, >+ $today, > ); > > # Reassign fine's amount if specified in command-line >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14960
:
43149
|
43310
|
44440
|
44563
|
44611
|
44742
|
44743
|
44927
| 44928