Merge branch 'master' of git.freeside.biz:/home/git/freeside
authorIvan Kohler <ivan@freeside.biz>
Fri, 5 Sep 2014 18:45:48 +0000 (11:45 -0700)
committerIvan Kohler <ivan@freeside.biz>
Fri, 5 Sep 2014 18:45:48 +0000 (11:45 -0700)
FS/FS/part_export/aradial.pm
FS/FS/part_export/nena2.pm
httemplate/graph/signupdate.cgi
httemplate/view/cust_main/change_history.html

index f3de614..afb17a6 100644 (file)
@@ -118,7 +118,7 @@ sub request_user_edit {
 sub request {
   my $self = shift;
   my @params = @_;
-  my $path = '/Admin'; # I think this is always right
+  my $path = '/ArdWeb/ARDAdminIs.dll'; # I think this is always right
   my $url = URI->new('http://' . $self->host . $path);
   warn "$me request: \n".Dumper(\@params)."\n\n" if $DEBUG >= 2;
   my $response = $self->ua->post($url, \@params);
index 85576d2..e172a15 100644 (file)
@@ -15,7 +15,7 @@ my %upload_targets;
 
 tie %options, 'Tie::IxHash', (
   'company_name'    => {  label => 'Company name for header record',
-                          type  => 'text'
+                          type  => 'text',
                        },
   'company_id'      => {  label => 'NENA company ID',
                           type  => 'text',
@@ -23,6 +23,9 @@ tie %options, 'Tie::IxHash', (
   'customer_code'   => {  label => 'Customer code',
                           type  => 'text',
                        },
+  'area_code'       => {  label => 'Default area code for 7 digit numbers',
+                          type  => 'text',
+                       },
   'prefix'          => {  label => 'File name prefix',
                           type  => 'text',
                        },
@@ -222,7 +225,13 @@ sub data {
 
   $hash{function_code} = $function_code{$action};
 
-  # phone number 
+  # Add default area code if phonenum is 7 digits
+  if ($self->option('area_code') =~ /^\d{3}$/ && $svc->phonenum =~ /^\d{7}$/ ){
+  $svc->phonenum = $self->option('area_code'). $svc->phonenum;
+  }
+  # phone number
+  
   $svc->phonenum =~ /^(\d{3})(\d*)$/;
   $hash{npa} = $1;
   $hash{calling_number} = $2;
index 23e4596..011817c 100644 (file)
@@ -40,13 +40,13 @@ my $sdate = DateTime->new(
 
 my $edate = DateTime->new(
     year       => $cgi->param('end_year'),
-    month      => ($cgi->param('end_month') % 12 + 1) # first day of the next month
-)->epoch();
+    month      => $cgi->param('end_month')
+)->add( months => 1 )->epoch();
 
 my $where .= " AND signupdate >= $sdate ".
-             " AND signupdate <= $edate ";
+             " AND signupdate < $edate ";
 
-foreach my $cust (qsearch({ table   => 'cust_main', 
+foreach my $cust (qsearch({ table   => 'cust_main',
                             hashref => \%where,
                             extra_sql => $where } )) {
   next if !$cust->signupdate;
index bf32a49..217b14e 100644 (file)
@@ -42,6 +42,7 @@ tie my %tables, 'Tie::IxHash',
   'svc_broadband'     => 'Broadband',
   'svc_external'      => 'External service',
   'svc_phone'         => 'Phone',
+  'svc_cable'         => 'Cable',
   'phone_device'      => 'Phone device',
   'cust_pkg_discount' => 'Discount',
   #? it gets provisioned anyway 'phone_avail'         => 'Phone',
@@ -59,6 +60,7 @@ my %table_join = (
   'svc_broadband'    => $svc_join,
   'svc_external'     => $svc_join,
   'svc_phone'        => $svc_join,
+  'svc_cable'        => $svc_join,
   'phone_device'     => $svc_join,
   'cust_pkg_discount'=> $pkg_join,
 );