search by change date on advanced package report, #17113
authorMark Wells <mark@freeside.biz>
Fri, 6 Apr 2012 19:33:20 +0000 (12:33 -0700)
committerMark Wells <mark@freeside.biz>
Fri, 6 Apr 2012 19:33:20 +0000 (12:33 -0700)
FS/FS/cust_pkg.pm
httemplate/search/cust_pkg.cgi
httemplate/search/report_cust_pkg.html

index 855accc..bee1b82 100644 (file)
@@ -3300,7 +3300,7 @@ sub search {
       "NOT (".FS::cust_pkg->onetime_sql . ")";
   }
   else {
-    foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end cancel )) {
+    foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel )) {
 
       next unless exists($params->{$field});
 
index 297edee..887ec60 100755 (executable)
@@ -20,6 +20,7 @@
                                      emt('Susp. delay'),
                                      emt('Expire'),
                                      emt('Contract end'),
+                                     emt('Changed'),
                                      emt('Cancel'),
                                      emt('Reason'),
                                      FS::UI::Web::cust_header(
@@ -45,7 +46,7 @@
                     sub { FS::part_pkg::freq_pretty(shift); },
 
                     ( map { time_or_blank($_) }
-          qw( setup last_bill bill adjourn susp dundate expire contract_end cancel ) ),
+          qw( setup last_bill bill adjourn susp dundate expire contract_end change_date cancel ) ),
 
                     sub { my $self = shift;
                           my $return = '';
                     '',
                     '',
                     '',
+                    '',
                     FS::UI::Web::cust_colors(),
                     '',
                   ],
-                  'style' => [ '', '', '', '', 'b', '', '', '', '', '', '', '', '', '', '', '', '', '',
+                  'style' => [ '', '', '', '', 'b', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
                                FS::UI::Web::cust_styles() ],
                   'size'  => [ '', '', '', '', '-1' ],
-                  'align' => 'rrlccrrlrrrrrrrrrl'. FS::UI::Web::cust_aligns(). 'r',
+                  'align' => 'rrlccrrlrrrrrrrrrrl'. FS::UI::Web::cust_aligns(). 'r',
                   'links' => [
                     $link,
                     $link,
                     '',
                     '',
                     '',
+                    '', # link to changed-from package?
                     '',
                     '',
                     '',
@@ -182,7 +185,7 @@ my %disable = (
   ''                => {},
 );
 
-foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end cancel active )) {
+foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel active )) {
 
   my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field);
 
index 3da59c2..e47bbb1 100755 (executable)
     %>
 
 %   }
-
+    <TR>
+      <TD COLSPAN=2>
+        <TABLE>
+          <TR>
+            <TD></TD>
+            <TD>From date <i>(m/d/y)</i></TD>
+            <TD>To date <i>(m/d/y)</i></TD>
+          </TR>
+%   my $noinit = 0;
 %   foreach my $field (@date_fields) {
 
-      <TR>
-        <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD>
-        <TD>
-          <TABLE>
-            <% include( '/elements/tr-input-beginning_ending.html',
-                          prefix   => $field,
-                          layout   => 'horiz',
-                      )
-            %>
-          </TABLE>
-        </TD>
-      </TR>
-
-%   }
+          <TR>
+            <TD ALIGN="right" VALIGN="center"><% $label{$field} %></TD>
+%     foreach (qw(beginning ending)) {
+            <TD>
+              <& /elements/input-date-field.html, {
+                'name'    => $field.'_'.$_,
+                'value'   => '',
+                'noinit'  => $noinit,
+                'format'  => '%m/%d/%Y',
+              } &>
+            </TD>
+%     $noinit = 1;
+%     }
+          </TR>
+%   } #foreach $field
+        </TABLE>
+      </TD>
+    </TR>
     
     <SCRIPT TYPE="text/javascript">
   
@@ -186,6 +198,7 @@ tie my %label, 'Tie::IxHash',
   'dundate'      => 'Suspension delayed until',
   'expire'       => 'Expires',
   'contract_end' => 'Contract ends',
+  'change_date'  => 'Changed from other package',
   'cancel'       => 'Cancelled',
 ;
 my @date_fields = keys %label;