Bug 31306: Allow to pass params and attributes to search_ordered
[srvgit] / Koha / Report.pm
index c341ed6..35d46c4 100644 (file)
@@ -17,14 +17,16 @@ package Koha::Report;
 
 use Modern::Perl;
 
-use Carp;
 
 use Koha::Database;
-use JSON;
 use Koha::Reports;
 use Koha::DateUtils qw( dt_from_string output_pref );
 
 use base qw(Koha::Object);
+#
+# FIXME We could only return an error code instead of the arrayref
+# Only 1 error is returned
+# TODO Koha::Report->store should check this before saving
 
 =head1 NAME
 
@@ -34,11 +36,6 @@ Koha::Report - Koha Report Object class
 
 =head2 Class Methods
 
-=cut
-
-# FIXME We could only return an error code instead of the arrayref
-# Only 1 error is returned
-# TODO Koha::Report->store should check this before saving
 =head3 is_sql_valid
 
 my ( $is_sql_valid, $errors ) = $report->is_sql_valid;
@@ -185,6 +182,8 @@ sub prep_report {
         }
         $sql =~ s/<<$split[$i*2+1]>>/$quoted/;
     }
+
+    $sql = "$sql /* saved_sql.id: ${\( $self->id )} */";
     return $sql, $headers;
 }