bug hunting and a (small) new set of widget code
[Evergreen.git] / Open-ILS / src / reporter / widgets.example.xml
index fe46568..fccc717 100644 (file)
@@ -70,7 +70,7 @@
                        </description>
                        <filter-code type="perl">
                                $full_col = "DATE_TRUNC($full_col, 'day')";
-                               $where_clause = "$full_col = CAST(? AS DATE)"
+                               $where_clause = "$full_col = CAST(? AS DATE)";
                                push @$bind_list, sprintf('%d/%02d/%02d', @$val{qw/year month day/});
                        </filter-code>
                </widget>
@@ -83,7 +83,7 @@
                        </description>
                        <filter-code type="perl">
                                $full_col = "EXTRACT('week' FROM $full_col)";
-                               $where_clause = "$full_col = ?"
+                               $where_clause = "$full_col = ?";
                                push @$bind_list, $val;
                        </filter-code>
                </widget>
                                on which to report.
                        </description>
                        <filter-code type="perl">
-                               $full_col = "EXTRACT('week' FROM $full_col)";
-                               $where_clause = "$full_col = ?"
-                               push @$bind_list, $val;
+                               $where_clause =
+                                       "EXTRACT('year' FROM $full_col) = ? ".
+                                       "AND EXTRACT('month' FROM $full_col) = ?";
+                               push @$bind_list, $$val{'start-year'}, $$val{'start-month'};
                        </filter-code>
                </widget>
                
                                This widget allows the user to pick a month relative to the
                                report runtime on which to report.
                        </description>
+                       <filter-code type="perl">
+                               $where_clause = 
+                                       "DATE_TRUNC($full_col, 'month') = ".
+                                               "DATE_TRUNC(now(), 'month') - CAST(? || ' months' AS INTERVAL);
+                               push @$bind_list, $val;
+                       </filter-code>
                </widget>
                
                <widget name="quarter">