summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2006-03-20 19:13:27 +0000
committerivan <ivan>2006-03-20 19:13:27 +0000
commitff24bc786a5fd479f2252260e0da580a736f97be (patch)
tree6d3496500bebd4f17f754ab79478c53dea1b5daf /httemplate
parent96fde39e747fdc5c618b5a92ec354384931cf317 (diff)
add price plan to bill on internal or external CDRs directly, add option to export CDRs to a per-customer downstream file
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/edit/cust_main/billing.html10
-rwxr-xr-xhttemplate/edit/part_pkg.cgi39
-rw-r--r--httemplate/edit/rate.cgi7
-rw-r--r--httemplate/search/cdr.html21
-rw-r--r--httemplate/search/report_cdr.html5
-rw-r--r--httemplate/view/cust_main/billing.html6
6 files changed, 72 insertions, 16 deletions
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html
index 96f777baa..790f41f00 100644
--- a/httemplate/edit/cust_main/billing.html
+++ b/httemplate/edit/cust_main/billing.html
@@ -348,7 +348,7 @@ if ( $payby_default eq 'HIDE' ) {
);
-
+ #this should use FS::payby
my %allopt = (
'CARD' => 'Credit card',
'CHEK' => 'Electronic check',
@@ -433,6 +433,14 @@ if ( $payby_default eq 'HIDE' ) {
<TD WIDTH="408"><INPUT TYPE="text" NAME="invoicing_list" VALUE="<%= join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) %>"></TD>
</TR>
+ <% if ( $conf->exists('voip-cust_cdr_spools') ) { %>
+ <TR>
+ <TD COLSPAN="2"><INPUT TYPE="checkbox" NAME="spool_cdr" VALUE="Y" <%= $cust_main->spool_cdr eq "Y" ? 'CHECKED' : '' %>> Spool CDRs</TD>
+ </TR>
+ <% } else { %>
+ <INPUT TYPE="hidden" NAME="spool_cdr" VALUE="<%= $cust_main->spool_cdr %>">
+ <% } %>
+
</TABLE>
</FORM>
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index 61e4086be..158c6e2ff 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -297,16 +297,35 @@ my $widget = new HTML::Widgets::SelectLayers(
$html .= ' MULTIPLE'
if $href->{$field}{'type'} eq 'select_multiple';
$html .= qq! NAME="$field" onChange="fchanged(this)">!;
- foreach my $record (
- qsearch( $href->{$field}{'select_table'},
- $href->{$field}{'select_hash'} )
- ) {
- my $value = $record->getfield($href->{$field}{'select_key'});
- $html .= qq!<OPTION VALUE="$value"!.
- ( $plandata{$field} =~ /(^|, *)$value *(,|$)/
- ? ' SELECTED'
- : '' ).
- '>'. $record->getfield($href->{$field}{'select_label'})
+
+ if ( $href->{$field}{'select_table'} ) {
+ foreach my $record (
+ qsearch( $href->{$field}{'select_table'},
+ $href->{$field}{'select_hash'} )
+ ) {
+ my $value = $record->getfield($href->{$field}{'select_key'});
+ $html .= qq!<OPTION VALUE="$value"!.
+ ( $plandata{$field} =~ /(^|, *)$value *(,|$)/
+ ? ' SELECTED'
+ : ''
+ ).
+ '>'. $record->getfield($href->{$field}{'select_label'});
+ }
+ } elsif ( $href->{$field}{'select_options'} ) {
+ foreach my $key ( keys %{ $href->{$field}{'select_options'} } ) {
+ my $value = $href->{$field}{'select_options'}{$key};
+ $html .= qq!<OPTION VALUE="$key"!.
+ ( $plandata{$field} =~ /(^|, *)$value *(,|$)/
+ ? ' SELECTED'
+ : ''
+ ).
+ '>'. $value;
+ }
+
+ } else {
+ $html .= '<font color="#ff0000">warning: '.
+ "don't know how to retreive options for $field select field".
+ '</font>';
}
$html .= '</SELECT>';
}
diff --git a/httemplate/edit/rate.cgi b/httemplate/edit/rate.cgi
index f8f67f6c4..9aa4e7291 100644
--- a/httemplate/edit/rate.cgi
+++ b/httemplate/edit/rate.cgi
@@ -13,7 +13,9 @@ my $action = $rate->ratenum ? 'Edit' : 'Add';
my $p1 = popurl(1);
my %granularity = (
+ '1', => '1 second',
'6' => '6 second',
+ '30' => '30 second', # '1/2 minute',
'60' => 'minute',
);
@@ -60,9 +62,10 @@ Rate plan
qsearch({
'select' => 'DISTINCT ON ( regionnum ) rate_region.*',
'table' => 'rate_region',
- 'addl_from' => 'INNER JOIN rate_prefix USING ( regionnum )',
'hashref' => {},
- 'extra_sql' => "WHERE countrycode != '1'",
+ #'addl_from' => 'INNER JOIN rate_prefix USING ( regionnum )',
+ #'extra_sql' => "WHERE countrycode != '1'",
+
# 'ORDER BY regionname'
# ERROR: SELECT DISTINCT ON expressions must
# match initial ORDER BY expressions
diff --git a/httemplate/search/cdr.html b/httemplate/search/cdr.html
index 75049b443..ec847e41f 100644
--- a/httemplate/search/cdr.html
+++ b/httemplate/search/cdr.html
@@ -1,13 +1,28 @@
<%
+my $title = 'Call Detail Records';
my $hashref = {};
-#process params for CDR search, populate $hashref...
-
my $count_query = 'SELECT COUNT(*) FROM cdr';
+
+#process params for CDR search, populate $hashref...
# and fixup $count_query
+if ( $cgi->param('freesidestatus') eq 'NULL' ) {
+
+ my $title = "Unprocessed $title";
+ $hashref->{'freesidestatus'} = ''; # Record.pm will take care of it
+ $count_query .= " AND ( freesidestatus IS NULL OR freesidestatus = '' )";
+
+} elsif ( $cgi->param('freesidestatus') =~ /^([\w ]+)$/ ) {
+
+ my $title = "Processed $title";
+ $hashref->{'freesidestatus'} = $1;
+ $count_query .= " AND freesidestatus = '$1'";
+
+}
+
%><%= include( 'elements/search.html',
- 'title' => 'Call Detail Records',
+ 'title' => $title,
'name' => 'call detail records',
'query' => { 'table' => 'cdr',
'hashref' => $hashref
diff --git a/httemplate/search/report_cdr.html b/httemplate/search/report_cdr.html
index b9ad55e10..924e28bd7 100644
--- a/httemplate/search/report_cdr.html
+++ b/httemplate/search/report_cdr.html
@@ -1,6 +1,11 @@
<%= include('/elements/header.html', 'Call Detail Record Search' ) %>
<FORM ACTION="cdr.html" METHOD="GET">
+Status: <SELECT NAME="freesidestatus">
+ <OPTION VALUE="">(all)
+ <OPTION VALUE="NULL">unprocessed
+ <OPTION VALUE="done"">processed
+</SELECT><BR>
<INPUT TYPE="submit" VALUE="Search Call Detail Records">
<%= include('/elements/footer.html') %>
diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html
index 5786a0711..895814cc2 100644
--- a/httemplate/view/cust_main/billing.html
+++ b/httemplate/view/cust_main/billing.html
@@ -159,6 +159,12 @@ if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
<%= join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) || 'no' %>
</TD>
</TR>
+<% my $conf = new FS::Conf; if ( $conf->exists('voip-cust_cdr_spools') ) { %>
+ <TR>
+ <TD ALIGN="right">Spool&nbsp;CDRs</TD>
+ <TD BGCOLOR="#ffffff"><%= $cust_main->spool_cdr ? 'yes' : 'no' %></TD>
+ </TR>
+<% } %>
</TABLE></TD></TR></TABLE>