[Koha-bugs] [Bug 17168] Add a command line script for updating patron category based on status

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri May 10 12:09:57 CEST 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17168

--- Comment #48 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
+                      au     => $au,
+                      ao    => $ao,

You mean age under and age over. Not very clear names.
Saw adjustments later..

Patch 1
+        my ($y,$m,$d) = Today();
+        if( $cat_from->dateofbirthrequired && $params->{au} ) {
+            my ($dy,$dm,$dd)
=Add_Delta_YMD($y,$m,$d,-$cat_from->dateofbirthrequired,0,0);
+            $search_params->{dateofbirth}{'>'} =
$dy."-".sprintf("%02d",$dm)."-".sprintf("%02d",$dd);
+        }
Patch 2
+            my $date_after = output_pref({
+                dt         => dt_from_string()->subtract( years =>
$cat_from->dateofbirthrequired),
+                dateonly   => 1,
+                dateformat => 'sql'
+            });
+            $search_params->{dateofbirth}{'>'} = $date_after;

Instead of constructions like above, we normally use datetime_parser?
    my $dtf = Koha::Database->new->schema->storage->datetime_parser;
    my $rs = $class->_resultset->search(
        {   returndate                  => { '<'   => 
$dtf->format_datetime($older_than_date), },

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list