From 40378d4a13e9d89bd84da90e9b6c0c5a237af1ef Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Sun, 20 Apr 2014 21:13:26 -0400 Subject: [PATCH] Bug 12115: follow-up fix for tools/inventory's output_pref issues This should correct issues with the output_prefs in the compareinv2bar logic section of tools/inventory.pl It is a follow up to bug 11253. TEST PLAN --------- NOTE: There should be no distinguishable difference before and after the patch. This corrects a works by accident bug. Back up DB. Create a small barcode file from books in a given branch. Set I18N/L10N system preference of dateformat to mm/dd/yyyy. Go to inventory/stocktaking tool. Browse for the barcode file. Click submit just below the 'Use a barcode file' section. All looks fine in mm/dd/yyyy format. Set I18N/L10N system preference of dateformat to yyyy-mm-dd. Go to inventory/stocktaking tool. Browse for the barcode file. Click submit just below the 'Use a barcode file' section. All looks fine in yyyy-mm-dd format. Set I18N/L10N system preference of dateformat to dd/mm/yyyy. Go to inventory/stocktaking tool. Browse for the barcode file. Click submit just below the 'Use a barcode file' section. All looks fine in dd/mm/yyyy format. Apply patch Restore DB (so results should be comparable to the first result) Repeat the three testing blocks above. There should be no visible difference. Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall Signed-off-by: Galen Charlton --- tools/inventory.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/inventory.pl b/tools/inventory.pl index 3db63afbc8..f79f9d6f34 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -204,9 +204,11 @@ if ( $markseen or $op ) { # If "compare barcodes list to results" has been checked, we want to alert for missing items if ( $compareinv2barcd ) { # set "missing" flags for all items with a datelastseen (dls) before the choosen datelastseen (cdls) - my $dls = output_pref( dt_from_string( $datelastseen ), 'iso' ); + my $dls = output_pref( { dt => dt_from_string( $datelastseen ), + dateformat => 'iso' } ); foreach my $item ( @$inventorylist ) { - my $cdls = output_pref( dt_from_string( $_->{datelastseen} ), 'iso' ); + my $cdls = output_pref( { dt => dt_from_string( $_->{datelastseen} ), + dateformat => 'iso' } ); if ( $cdls lt $dls ) { $item->{problem} = 'missingitem'; # We have to push a copy of the item, not the reference -- 2.39.5