[freeside-commits] branch master updated. 2f3fd5cbfdec082d780f79b1ff9fab07a0c832ce

Jonathan Prykop jonathan at 420.am
Thu Jan 28 13:43:02 PST 2016


The branch, master has been updated
       via  2f3fd5cbfdec082d780f79b1ff9fab07a0c832ce (commit)
      from  0cb1b7d0916777dacdfd7c7f905e0bca03a5dfd9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2f3fd5cbfdec082d780f79b1ff9fab07a0c832ce
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Thu Jan 28 15:42:43 2016 -0600

    RT#39638: VoIP Usage cost reporting [bug fixes/cleanup]

diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm
index e40b092..8ccf7af 100644
--- a/FS/FS/cdr.pm
+++ b/FS/FS/cdr.pm
@@ -469,9 +469,9 @@ Sets the status and rated price.
 
 Available options are: inbound, rated_pretty_dst, rated_regionname,
 rated_seconds, rated_minutes, rated_granularity, rated_ratedetailnum,
-rated_classnum, rated_ratename, and set_rate_cost (if true, will set
-a recalculated L</rate_cost> in the rated_cost field after the other
-fields are set; does not work with inbound.)
+rated_classnum, rated_ratename.  If rated_ratedetailnum is provided,
+will also set a recalculated L</rate_cost> in the rated_cost field 
+after the other fields are set (does not work with inbound.)
 
 If there is an error, returns the error, otherwise returns false.
 
@@ -509,7 +509,7 @@ sub set_status_and_rated_price {
         qw( pretty_dst regionname seconds minutes granularity
             ratedetailnum classnum ratename );
     $self->svcnum($svcnum) if $svcnum;
-    $self->rated_cost($self->rate_cost) if $opt{'set_rate_cost'};
+    $self->rated_cost($self->rate_cost) if $opt{'rated_ratedetailnum'};
 
     return $self->replace();
 
@@ -1010,7 +1010,6 @@ sub rate_prefix {
     'rated_ratedetailnum' => $rate_detail->ratedetailnum,
     'rated_classnum'      => $rate_detail->classnum, #rated_ratedetailnum?
     'rated_ratename'      => $ratename, #not rate_detail - Intrastate/Interstate
-    'set_rate_cost'       => 1,
   );
 
 }
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index f70c3af..ee4f174 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -291,6 +291,8 @@ $report_rating{'Call Detail Records (CDRs)'} = [ $fsurl.'search/report_cdr.html'
   if $curuser->access_right("Usage: Call Detail Records (CDRs)");
 $report_rating{'Unrateable CDRs'} = [ $fsurl.'search/cdr.html?freesidestatus=failed;cdrbatchnum=_ALL_' ]
   if $curuser->access_right("Usage: Unrateable CDRs");
+$report_rating{'Customer CDRs Profit/Loss'} = [ $fsurl.'search/report_customer_cdr_profit.html', 'Profit/loss from customer CDRs' ]
+  if $curuser->access_right('Financial reports');
 if ( $curuser->access_right("Usage: Time worked") ) {
   $report_rating{'Time worked'} = [ $fsurl.'search/report_rt_transaction.html', '' ];
   $report_rating{'Time worked summary per ticket'} = [ $fsurl.'search/report_rt_ticket.html', '' ];
@@ -390,8 +392,6 @@ if( $curuser->access_right('Financial reports') ) {
 
   $report_financial{'Customer Accounting Summary'} = [ $fsurl.'search/report_customer_accounting_summary.html', 'Customer accounting summary report' ];
 
-  $report_financial{'Customer Usage Profit/Loss'} = [ $fsurl.'search/report_customer_usage_profit.html', 'Customer usage profit/loss' ];
-
 } elsif($curuser->access_right('Receivables report')) {
 
   $report_financial{'A/R Aging'} = [ $fsurl.'search/report_receivables.html', 'Accounts Receivable Aging report' ];
diff --git a/httemplate/search/customer_usage_profit.html b/httemplate/search/customer_cdr_profit.html
similarity index 97%
rename from httemplate/search/customer_usage_profit.html
rename to httemplate/search/customer_cdr_profit.html
index 9fcc922..8dc0663 100644
--- a/httemplate/search/customer_usage_profit.html
+++ b/httemplate/search/customer_cdr_profit.html
@@ -67,7 +67,7 @@
       #warn "writing ".xl_rowcol_to_cell($r, $c)."\n";
         $worksheet->write( $r, $c, $cell->{value}, $format{$f} );
       }
-      $c++;
+      $c += $cell->{colspan} || 1;
     } #$cell
   $r++;
   } #$row
@@ -119,7 +119,8 @@ as <A HREF="<% "$myself;_type=xls" %>">Excel spreadsheet</A>
 <%init>
 
 die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
+  unless $FS::CurrentUser::CurrentUser->access_right('Financial reports')
+      && $FS::CurrentUser::CurrentUser->access_right('List rating data');
 
 my ($agentnum,$sel_agent);
 if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
@@ -129,7 +130,7 @@ if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
 }
 my $title = $sel_agent ? $sel_agent->agent.' ' : '';
 
-$title .= 'Customer Usage Profit/Loss Report';
+$title .= 'Customer CDRs Profit/Loss Report';
 
 my @items  = ('cust_bill_pkg_recur', 'cust_bill_pkg_recur', 'cust_bill_pkg_detail', 'cust_bill_pkg_detail' );
 my @params = ( [], [ 'cost' => 1 ], [], [ 'cost' => 1 ] );
diff --git a/httemplate/search/report_customer_usage_profit.html b/httemplate/search/report_customer_cdr_profit.html
similarity index 71%
rename from httemplate/search/report_customer_usage_profit.html
rename to httemplate/search/report_customer_cdr_profit.html
index f16489b..2a5efc3 100755
--- a/httemplate/search/report_customer_usage_profit.html
+++ b/httemplate/search/report_customer_cdr_profit.html
@@ -1,6 +1,6 @@
-<% include('/elements/header.html', 'Customer Usage Profit/Loss Report' ) %>
+<% include('/elements/header.html', 'Customer CDRs Profit/Loss Report' ) %>
 
-<FORM ACTION="customer_usage_profit.html" METHOD="GET">
+<FORM ACTION="customer_cdr_profit.html" METHOD="GET">
 
   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
 
@@ -24,6 +24,7 @@
 <%init>
 
 die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
+  unless $FS::CurrentUser::CurrentUser->access_right('Financial reports')
+      && $FS::CurrentUser::CurrentUser->access_right('List rating data');
 
 </%init>

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cdr.pm                                                  |    9 ++++-----
 httemplate/elements/menu.html                                 |    4 ++--
 .../{customer_usage_profit.html => customer_cdr_profit.html}  |    7 ++++---
 ...omer_usage_profit.html => report_customer_cdr_profit.html} |    7 ++++---
 4 files changed, 14 insertions(+), 13 deletions(-)
 rename httemplate/search/{customer_usage_profit.html => customer_cdr_profit.html} (97%)
 rename httemplate/search/{report_customer_usage_profit.html => report_customer_cdr_profit.html} (71%)




More information about the freeside-commits mailing list