Merge branch 'FREESIDE_3_BRANCH' of git.freeside.biz:/home/git/freeside into 3.x
authorMark Wells <mark@freeside.biz>
Wed, 14 Dec 2016 20:55:27 +0000 (12:55 -0800)
committerMark Wells <mark@freeside.biz>
Wed, 14 Dec 2016 20:55:27 +0000 (12:55 -0800)
FS/FS/ConfDefaults.pm
FS/FS/UI/Web.pm
FS/FS/contact.pm
FS/FS/part_pkg/voip_cdr.pm
fs_selfservice/FS-SelfService/cgi/view_cdr_details.html
httemplate/edit/cust_pkg_discount.html

index 4c37175..987225f 100644 (file)
@@ -33,6 +33,9 @@ sub cust_fields_avail { (
   'Cust# | Cust. Status | Customer' =>
     'custnum | Status | Last, First or Company (Last, First)',
 
+  'Agent | Agent Cust# or Cust# | Cust. Status | Customer' =>
+    'Agent | Agent Cust# | Status | Last, First or Company (Last, First)',
+
   'Customer | Day phone | Night phone | Mobile phone | Fax number' =>
     'Customer | (all phones)',
   'Cust# | Customer | Day phone | Night phone | Mobile phone | Fax number' =>
index 81c4c7b..6d6f7fb 100644 (file)
@@ -346,6 +346,8 @@ sub cust_header {
     'Payment Type'             => 'cust_payby',
     'Current Balance'          => 'current_balance',
     'Agent Cust#'              => 'agent_custid',
+    'Agent'                    => 'agent_name',
+    'Agent Cust# or Cust#'     => 'display_custnum',
     'Advertising Source'       => 'referral',
   );
   $header2method{'Cust#'} = 'display_custnum'
@@ -451,6 +453,8 @@ sub cust_sql_fields {
     if grep { $_ eq 'cust_payby' } @cust_fields;
   push @fields, 'agent_custid';
 
+  push @fields, 'agentnum' if grep { $_ eq 'agent_name' } @cust_fields;
+
   my @extra_fields = ();
   if (grep { $_ eq 'current_balance' } @cust_fields) {
     push @extra_fields, FS::cust_main->balance_sql . " AS current_balance";
index 148fa61..ad0de6e 100644 (file)
@@ -690,8 +690,6 @@ sub send_reset_email {
 
   #email it
 
-  my $conf = new FS::Conf;
-
   my $cust_main = $self->cust_main
     or die "no customer"; #reset a password for a prospect contact?  someday
 
index 039690b..2d8c359 100644 (file)
@@ -198,6 +198,9 @@ tie my %accountcode_tollfree_field, 'Tie::IxHash',
     'skip_dcontext' => { 'name' => 'Do not charge for CDRs where dcontext is set to any of these (comma-separated) values: ',
                        },
 
+    'skip_dcontext_prefix' => { 'name' => 'Do not charge for CDRs where dcontext starts with: ',
+                       },
+
     'skip_dcontext_suffix' => { 'name' => 'Do not charge for CDRs where dcontext ends with: ',
                        },
 
@@ -347,7 +350,8 @@ tie my %accountcode_tollfree_field, 'Tie::IxHash',
                        use_cdrtypenum ignore_cdrtypenum
                        use_calltypenum ignore_calltypenum
                        ignore_disposition disposition_in disposition_prefix
-                       skip_dcontext skip_dcontext_suffix skip_dst_prefix 
+                       skip_dcontext skip_dcontext_prefix skip_dcontext_suffix
+                       skip_dst_prefix 
                        skip_dstchannel_prefix skip_src_length_more 
                        noskip_src_length_accountcode_tollfree
                        accountcode_tollfree_ratenum accountcode_tollfree_field
@@ -620,6 +624,12 @@ sub check_chargable {
     if $self->option_cacheable('skip_dcontext') =~ /\S/
     && grep { $cdr->dcontext eq $_ } split(/\s*,\s*/, $self->option_cacheable('skip_dcontext'));
 
+  my $len_dcontext_prefix =
+    length($self->option_cacheable('skip_dcontext_prefix'));
+  return "dcontext starts with ". $self->option_cacheable('skip_dcontext_prefix')
+    if $len_dcontext_prefix
+    && substr($cdr->dcontext,0,$len_dcontext_prefix) eq $self->option_cacheable('skip_dcontext_prefix');
+
   my $len_suffix = length($self->option_cacheable('skip_dcontext_suffix'));
   return "dcontext ends with ". $self->option_cacheable('skip_dcontext_suffix')
     if $len_suffix
index f396682..d2be287 100644 (file)
   <TR>
     <TD WIDTH="50%">
 <%= if ($previous < $beginning) {
-    $OUT .= qq!<A HREF="${url}view_cdr_details;svcnum=$svcnum;beginning=!;
-    $OUT .= qq!$previous;ending=$beginning">Previous period</A>!;
+    $OUT .= qq!<A HREF="${url}view_cdr_details;svcnum=$svcnum;!;
+    $OUT .= qq!inbound=1;! if $inbound;
+    $OUT .= qq!beginning=$previous;ending=$beginning">Previous period</A>!;
     }else{
       '';
     } %>
     </TD>
     <TD  WIDTH="50%" ALIGN="right">
 <%= if ($next > $ending) {
-    $OUT .= qq!<A HREF="${url}view_cdr_details;svcnum=$svcnum;beginning=!;
-    $OUT .= qq!$ending;ending=$next">Next period</A>!;
+    $OUT .= qq!<A HREF="${url}view_cdr_details;svcnum=$svcnum;!;
+    $OUT .= qq!inbound=1;! if $inbound;
+    $OUT .= qq!beginning=$ending;ending=$next">Next period</A>!;
     }else{
       '';
     }%>
index e814c96..e65c613 100755 (executable)
 
 <% include('/elements/error.html') %>
 
-<FORM NAME="DiscountPkgForm" ACTION="<% $p %>edit/process/cust_pkg_discount.html" METHOD=POST>
+<FORM NAME     = "DiscountPkgForm"
+      ACTION   = "<% $p %>edit/process/cust_pkg_discount.html"
+      METHOD   = POST
+      onSubmit = "document.DiscountPkgForm.submit.disabled=true;"
+>
 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
 
 <% ntable('#cccccc') %>
 
   <TR>
-    <TH ALIGN="right">Current package&nbsp;</TH>
+    <TH ALIGN="right">Package&nbsp;</TH>
     <TD COLSPAN=7>
       <% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><B><% $part_pkg->pkg |h %></B> - <% $part_pkg->comment |h %>
     </TD>