Merge branch 'master' of git.freeside.biz:/home/git/freeside
authorMark Wells <mark@freeside.biz>
Thu, 27 Aug 2015 21:47:03 +0000 (14:47 -0700)
committerMark Wells <mark@freeside.biz>
Thu, 27 Aug 2015 21:47:43 +0000 (14:47 -0700)
FS/FS/cdr/aapt.pm
httemplate/elements/tr-pkg_svc.html
httemplate/misc/process/void-cust_bill.html
httemplate/misc/void-cust_bill.html

index 600a192..3c49643 100644 (file)
@@ -77,7 +77,7 @@ my %UNIT_SCALE = ( #Table 2.1.4
     'calltypenum',          # usage ID (CUSG)
     sub {                   # ID type
       my ($cdr, $data, $conf, $param) = @_;
-      if ($data != 1) {
+      if ($data !~ /(1|50)/) {
         warn "AAPT: service ID type is not telephone number.\n";
         $param->{skiprow} = 1;
       }
index 1e9c0a3..de3f95a 100644 (file)
@@ -1,15 +1,14 @@
 <TR>
   <TD CLASS="background" COLSPAN=99>
 
-<% itable('', 4, 1) %><TR><TD VALIGN="top">
-<% $thead %>
-
 <SCRIPT>
 var provision_hold_td = [];
 var provision_hold_input = [];
-provision_hold_td.push(document.getElementById('th_provision_hold'));
 </SCRIPT>
 
+<% itable('', 4, 1) %><TR><TD VALIGN="top">
+<% pkg_svc_thead() %>
+
 %foreach my $part_svc ( @part_svc ) {
 %  my $svcpart = $part_svc->svcpart;
 %  my $pkg_svc = $pkg_svc{$svcpart}
@@ -97,7 +96,7 @@ provision_hold_input.push(document.getElementById('input_provision_hold<% $svcpa
 %       if ( $count == int( $_ * scalar(@part_svc) / $columns ) ) { 
 %  
 
-         </TABLE></TD><TD VALIGN="top"><% $thead %>
+         </TABLE></TD><TD VALIGN="top"><% pkg_svc_thead() %>
 %   }
 %     }
 %     $count++;
@@ -115,6 +114,9 @@ function provision_hold_check () {
     for (i = 0; i < provision_hold_td.length; i++) {
       provision_hold_td[i].style.display = start_on_hold.checked ? '' : 'none';
     }
+    for (i = 0; i < provision_hold_input.length; i++) {
+      provision_hold_input[i].disabled = start_on_hold.checked ? false : true;
+    }
   }
 }
 function provision_hold_init () {
@@ -161,15 +163,21 @@ provision_hold_init();
 my %opt = @_;
 my $cgi = $opt{'cgi'};
 
-my $thead =  "\n\n". ntable('#cccccc', 2).
-             '<TR>'.
-             '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Quan.</FONT></TH>'.
-             '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Primary</FONT></TH>'.
-             '<TH BGCOLOR="#dcdcdc">Service</TH>'.
-             '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Hide<BR>from<BR>Invoices</FONT></TH>'.
-             '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Bulk<BR>Charge</FONT></TH>'.
-             '<TH BGCOLOR="#dcdcdc" ID="th_provision_hold"><FONT SIZE=-1>Remove Hold After Provisioning</FONT></TH>'.
-             '</TR>';
+my $thead_count = 0;
+sub pkg_svc_thead {
+  $thead_count += 1;
+  return "\n\n". ntable('#cccccc', 2).
+         '<TR>'.
+         '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Quan.</FONT></TH>'.
+         '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Primary</FONT></TH>'.
+         '<TH BGCOLOR="#dcdcdc">Service</TH>'.
+         '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Hide<BR>from<BR>Invoices</FONT></TH>'.
+         '<TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Bulk<BR>Charge</FONT></TH>'.
+         '<TH BGCOLOR="#dcdcdc" ID="th_provision_hold' . $thead_count . '"><FONT SIZE=-1>Remove Hold After Provisioning</FONT></TH>'.
+         '</TR>'.
+         qq!<SCRIPT>provision_hold_td.push(document.getElementById('th_provision_hold$thead_count'))</SCRIPT>!;
+;
+}
 
 my $part_pkg = $opt{'object'};
 my $pkgpart = $part_pkg->pkgpart;
index accee27..7773b0b 100755 (executable)
@@ -21,6 +21,6 @@ my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
 
 my $custnum = $cust_bill->custnum;
 
-my $error = $cust_bill->void( $cgi->param('reason') );
+my $error = $cust_bill->void( scalar($cgi->param('reason')) );
 
 </%init>
index 1608fd0..39b0712 100644 (file)
@@ -14,7 +14,7 @@
 <% ntable("#cccccc", 2) %>
 <TR>
   <TD ALIGN="right">Reason</TD>
-  <TD><INPUT TYPE="text" NAME="reason" VALUE="<% $cgi->param('reason') |h %>"></TD>
+  <TD><INPUT TYPE="text" NAME="reason" VALUE="<% scalar($cgi->param('reason')) |h %>"></TD>
 </TR>
 
 </TABLE>