Merge branch 'master' of git.freeside.biz:/home/git/freeside
authorIvan Kohler <ivan@freeside.biz>
Thu, 4 Dec 2014 18:37:16 +0000 (10:37 -0800)
committerIvan Kohler <ivan@freeside.biz>
Thu, 4 Dec 2014 18:37:16 +0000 (10:37 -0800)
1  2 
FS/FS/Template_Mixin.pm
httemplate/elements/menu.html
httemplate/misc/cancel_cust.html
httemplate/misc/suspend_cust.html

diff --combined FS/FS/Template_Mixin.pm
@@@ -2153,9 -2153,9 +2153,9 @@@ sub _items_sections 
          } else {
            $section->{'category'} = $sectionname;
            $section->{'description'} = &{ $escape }($sectionname);
 -          if ( _pkg_category($_) ) {
 -            $section->{'sort_weight'} = _pkg_category($_)->weight;
 -            if ( _pkg_category($_)->condense ) {
 +          if ( _pkg_category($sectionname) ) {
 +            $section->{'sort_weight'} = _pkg_category($sectionname)->weight;
 +            if ( _pkg_category($sectionname)->condense ) {
                $section = { %$section, $self->_condense_section($opt{format}) };
              }
            }
@@@ -2729,6 -2729,8 +2729,8 @@@ sub _items_cust_bill_pkg 
              'pkgnum'      => $cust_bill_pkg->pkgpart, #so it displays in Ref
              'description' => $description,
              'amount'      => sprintf("%.2f", $cust_bill_pkg->setup),
+             'unit_amount'   => sprintf("%.2f", $cust_bill_pkg->unitsetup),
+             'quantity'    => $cust_bill_pkg->quantity,
              'preref_html' => ( $opt{preref_callback}
                                   ? &{ $opt{preref_callback} }( $cust_bill_pkg )
                                   : ''
              'pkgnum'      => $cust_bill_pkg->pkgpart, #so it displays in Ref
              'description' => "$desc (". $cust_bill_pkg->part_pkg->freq_pretty.")",
              'amount'      => sprintf("%.2f", $cust_bill_pkg->recur),
+             'unit_amount'   => sprintf("%.2f", $cust_bill_pkg->unitrecur),
+             'quantity'    => $cust_bill_pkg->quantity,
+           'preref_html' => ( $opt{preref_callback}
+                                  ? &{ $opt{preref_callback} }( $cust_bill_pkg )
+                                  : ''
+                              ),
            };
          }
  
@@@ -89,16 -89,10 +89,16 @@@ my $curuser = $FS::CurrentUser::Current
  
  #XXX Active tickets not assigned to a customer
  
 -tie my %report_prospects, 'Tie::IxHash',
 -  'List prospects' => [ $fsurl. 'search/prospect_main.html', '' ],
 -  'Advanced prospect reports' => [ $fsurl. 'search/report_prospect_main.html', '' ],
 -;
 +tie my %report_prospects, 'Tie::IxHash';
 +if ( $curuser->access_right('List prospects') ) {
 +  $report_prospects{'List prospects'} = [ $fsurl. 'search/prospect_main.html', '' ];
 +  $report_prospects{'Advanced prospect reports'} = [ $fsurl. 'search/report_prospect_main.html', '' ];
 +}
 +$report_prospects{'separator'} = ''
 +  if $curuser->access_right('List prospects')
 +  && $curuser->access_right('List contacts');
 +$report_prospects{'Prospect contacts'} = [ $fsurl. 'search/report_contact.html?link=prospect_main', '' ]
 +  if $curuser->access_right('List contacts');
  
  tie my %report_quotations, 'Tie::IxHash',
    'List quotations' => [ $fsurl. 'search/quotation.html', '' ],
@@@ -124,10 -118,6 +124,10 @@@ $report_customers{'Customer churn repor
  $report_customers{'Signup date report'}        = [ $fsurl. 'graph/report_signupdate.html',     'Signup date report (by date of signup)' ];
  $report_customers{'Advanced customer reports'} = [ $fsurl. 'search/report_cust_main.html',     'by status, signup date, agent, etc.' ]
    if $curuser->access_right('Advanced customer search');
 +if ( $curuser->access_right('List contacts') ) {
 +  $report_customers{'separator'} = '';
 +  $report_customers{'Customer contacts'} = [ $fsurl. 'search/report_contact.html?link=cust_main' ];
 +}
  
  tie my %report_invoices_open, 'Tie::IxHash',
    'All open invoices' => [ $fsurl.'search/cust_bill.html?OPEN_date', 'All invoices with an unpaid balance' ],
@@@ -409,13 -399,11 +409,13 @@@ $report_logs{'Outgoing messages'} = [ $
  
  tie my %report_menu, 'Tie::IxHash';
  $report_menu{'Prospects'}      = [ \%report_prospects, 'Prospect reports' ]
 -  if $curuser->access_right('List prospects');
 +  if $curuser->access_right('List prospects')
 +  || $curuser->access_right('List contacts');
  $report_menu{'Quotations'}     = [ \%report_quotations, 'Quotation reports' ]
    if $curuser->access_right('List quotations');
  $report_menu{'Customers'}      = [ \%report_customers, 'Customer reports'  ]
 -  if $curuser->access_right('List customers');
 +  if $curuser->access_right('List customers')
 +  || $curuser->access_right('List contacts');
  $report_menu{'Invoices'}       =  [ \%report_invoices,  'Invoice reports'   ]
    if $curuser->access_right('List invoices');
  $report_menu{'Discounts'}      =  [ \%report_discounts, 'Discount reports'  ]
@@@ -564,6 -552,12 +564,12 @@@ tie my %config_conferencing, 'Tie::IxHa
    'Quality levels'     => [ $fsurl.'browse/conferencing_quality.html', '' ],
  ;
  
+ tie my %config_circuit, 'Tie::IxHash',
+   'Circuit types'     => [ $fsurl.'browse/circuit_type.html',         '' ],
+   'Circuit providers' => [ $fsurl.'browse/circuit_provider.html',     '' ],
+   'Termination types' => [ $fsurl.'browse/circuit_termination.html',  '' ],
+ ;
  tie my %config_export_svc, 'Tie::IxHash', ();
  if ( $curuser->access_right('Configuration') ) {
    $config_export_svc{'Service definitions'} = [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ];
@@@ -584,6 -578,8 +590,8 @@@ $config_export_svc{'Conferencing'} = [ 
    if $curuser->access_right('Configuration');
  $config_export_svc{'Alarm'} = [ \%config_alarm, '' ]
    if $curuser->access_right(['Alarm configuration', 'Alarm global configuration']);
+ $config_export_svc{'Circuits'} = [ \%config_circuit, '' ]
+   if $curuser->access_right('Configuration');
  $config_export_svc{'Hardware types'} = [ $fsurl.'browse/hardware_class.html', 'Set up hardware type catalog' ]
    if $curuser->access_right('Configuration');
  
@@@ -7,7 -7,8 +7,7 @@@
  
   <P ALIGN="center"><B><% mt('Permanently delete all services and cancel this customer?') |h %></B>
  
 -<TABLE BORDER="0" CELLSPACING="2"
 -STYLE="margin-left:auto; margin-right:auto">
 +<TABLE BORDER="0" CELLSPACING="2" STYLE="margin-left:auto; margin-right:auto">
  <TR>
    <TD ALIGN="right">
      <INPUT TYPE="radio" NAME="now_or_later" VALUE="0" onclick="toggle(false)" CHECKED />
@@@ -43,12 -44,13 +43,12 @@@ toggle(false)
           <INPUT TYPE="checkbox" NAME="ban" ID="ban" VALUE="1"><% mt($ban) |h %> 
  % }
  
 -<TABLE BGCOLOR="#cccccc", BORDER="0" CELLSPACING="2"
 -STYLE="margin-left:auto; margin-right:auto">
 +<TABLE BGCOLOR="#cccccc" BORDER="0" CELLSPACING="2" STYLE="margin-left:auto; margin-right:auto">
  <& /elements/tr-select-reason.html,
               'field'          => 'reasonnum',
               'reason_class'   => 'C',
               'cgi'            => $cgi,
-              'control_button' => "document.getElementById('confirm_cancel_cust_button')",
+              'control_button' => 'confirm_cancel_cust_button',
  &>
  
  </TABLE>
@@@ -7,7 -7,8 +7,7 @@@
  
   <P ALIGN="center"><B><% mt('Suspend this customer?') |h %></B>
  
 -<TABLE BORDER="0" CELLSPACING="2"
 -STYLE="margin-left:auto; margin-right:auto">
 +<TABLE BORDER="0" CELLSPACING="2" STYLE="margin-left:auto; margin-right:auto">
  <TR>
    <TD ALIGN="right">
      <INPUT TYPE="radio" NAME="now_or_later" VALUE="0" onclick="toggle(false)" CHECKED />
@@@ -35,12 -36,13 +35,12 @@@ function toggle(val) 
  toggle(false);
  </SCRIPT> 
  
 -<TABLE BGCOLOR="#cccccc", BORDER="0" CELLSPACING="2"
 -STYLE="margin-left:auto; margin-right:auto">
 +<TABLE BGCOLOR="#cccccc" BORDER="0" CELLSPACING="2" STYLE="margin-left:auto; margin-right:auto">
  <& /elements/tr-select-reason.html,
               'field'          => 'reasonnum',
               'reason_class'   => 'S',
               'cgi'            => $cgi,
-              'control_button' => "document.getElementById('confirm_suspend_cust_button')",
+              'control_button' => 'confirm_suspend_cust_button',
  &>
  
  </TABLE>