add time to payment report, RT#21061
authorIvan Kohler <ivan@freeside.biz>
Thu, 14 Mar 2013 01:27:38 +0000 (18:27 -0700)
committerIvan Kohler <ivan@freeside.biz>
Thu, 14 Mar 2013 01:27:38 +0000 (18:27 -0700)
FS/FS/UI/Web.pm
httemplate/search/elements/report_cust_pay_or_refund.html

index c2ea0a6..3778768 100644 (file)
@@ -32,15 +32,19 @@ sub parse_beginning_ending {
   my $beginning = 0;
   if ( $cgi->param($prefix.'begin') =~ /^(\d+)$/ ) {
     $beginning = $1;
-  } elsif ( $cgi->param($prefix.'beginning') =~ /^([ 0-9\-\/]{1,64})$/ ) {
+  } elsif ( $cgi->param($prefix.'beginning') =~ /^([ 0-9\-\/\:]{1,64})$/ ) {
     $beginning = parse_datetime($1) || 0;
   }
 
   my $ending = 4294967295; #2^32-1
   if ( $cgi->param($prefix.'end') =~ /^(\d+)$/ ) {
     $ending = $1 - 1;
-  } elsif ( $cgi->param($prefix.'ending') =~ /^([ 0-9\-\/]{1,64})$/ ) {
+  } elsif ( $cgi->param($prefix.'ending') =~ /^([ 0-9\-\/\:]{1,64})$/ ) {
     #probably need an option to turn off the + 86399
+
+    #no, this should be add one day minus one second...
+    #  86399 is wrong twice a year when daylight savings time changes
+    #        and leap seconds too but only a second rather than an hour..
     $ending = parse_datetime($1) + 86399;
   }
 
index a2b90b4..0a118e9 100644 (file)
@@ -83,7 +83,8 @@ Examples:
     <TD>
       <TABLE>
         <& /elements/tr-input-beginning_ending.html,
-                      layout   => 'horiz',
+                      layout     => 'horiz',
+                      input_time => 1,
         &>
       </TABLE>
     </TD>