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);
tie %options, 'Tie::IxHash', (
'company_name' => { label => 'Company name for header record',
- type => 'text'
+ type => 'text',
},
'company_id' => { label => 'NENA company ID',
type => 'text',
'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',
},
$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;
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;
'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',
'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,
);