per-agent disable_previous_balance, #15863
authormark <mark>
Sun, 15 Jan 2012 02:18:31 +0000 (02:18 +0000)
committermark <mark>
Sun, 15 Jan 2012 02:18:31 +0000 (02:18 +0000)
FS/FS/Conf.pm
FS/FS/cust_bill.pm

index c588493..83ab891 100644 (file)
@@ -3693,6 +3693,7 @@ and customer address. Include units.',
     'section'     => 'invoicing',
     'description' => 'Disable inclusion of previous balance, payment, and credit lines on invoices',
     'type'        => 'checkbox',
     'section'     => 'invoicing',
     'description' => 'Disable inclusion of previous balance, payment, and credit lines on invoices',
     'type'        => 'checkbox',
+    'per_agent'   => 1,
   },
 
   {
   },
 
   {
index 7f6b3b9..35ce48c 100644 (file)
@@ -2993,7 +2993,7 @@ sub print_generic {
     }
   }
 
     }
   }
 
-  unless (    $conf->exists('disable_previous_balance')
+  unless (    $conf->exists('disable_previous_balance', $agentnum)
            || $conf->exists('previous_balance-summary_only')
          )
   {
            || $conf->exists('previous_balance-summary_only')
          )
   {
@@ -3027,7 +3027,8 @@ sub print_generic {
 
   }
   
 
   }
   
-  if ( @pr_cust_bill && !$conf->exists('disable_previous_balance') ) {
+  if ( @pr_cust_bill && !$conf->exists('disable_previous_balance', $agentnum) ) 
+    {
     push @buf, ['','-----------'];
     push @buf, [ $self->mt('Total Previous Balance'),
                  $money_char. sprintf("%10.2f", $pr_total) ];
     push @buf, ['','-----------'];
     push @buf, [ $self->mt('Total Previous Balance'),
                  $money_char. sprintf("%10.2f", $pr_total) ];
@@ -3143,7 +3144,7 @@ sub print_generic {
   $invoice_data{current_less_finance} =
     sprintf('%.2f', $self->charged - $invoice_data{finance_amount} );
 
   $invoice_data{current_less_finance} =
     sprintf('%.2f', $self->charged - $invoice_data{finance_amount} );
 
-  if ( $multisection && !$conf->exists('disable_previous_balance')
+  if ( $multisection && !$conf->exists('disable_previous_balance', $agentnum)
     || $conf->exists('previous_balance-summary_only') )
   {
     unshift @sections, $previous_section if $pr_total;
     || $conf->exists('previous_balance-summary_only') )
   {
     unshift @sections, $previous_section if $pr_total;
@@ -3207,7 +3208,7 @@ sub print_generic {
 
   push @buf,['','-----------'];
   push @buf,[$self->mt( 
 
   push @buf,['','-----------'];
   push @buf,[$self->mt( 
-              $conf->exists('disable_previous_balance') 
+              $conf->exists('disable_previous_balance', $agentnum
                ? 'Total Charges'
                : 'Total New Charges'
              ),
                ? 'Total Charges'
                : 'Total New Charges'
              ),
@@ -3221,7 +3222,7 @@ sub print_generic {
          || 'Total New Charges'
       if $conf->exists('previous_balance-exclude_from_total');
     my $amount = $self->charged +
          || 'Total New Charges'
       if $conf->exists('previous_balance-exclude_from_total');
     my $amount = $self->charged +
-                   ( $conf->exists('disable_previous_balance') ||
+                   ( $conf->exists('disable_previous_balance', $agentnum) ||
                      $conf->exists('previous_balance-exclude_from_total')
                      ? 0
                      : $pr_total
                      $conf->exists('previous_balance-exclude_from_total')
                      ? 0
                      : $pr_total
@@ -3248,7 +3249,7 @@ sub print_generic {
     push @buf,['',''];
   }
   
     push @buf,['',''];
   }
   
-  unless ( $conf->exists('disable_previous_balance') ) {
+  unless ( $conf->exists('disable_previous_balance', $agentnum) ) {
     #foreach my $thing ( sort { $a->_date <=> $b->_date } $self->_items_credits, $self->_items_payments
   
     # credits
     #foreach my $thing ( sort { $a->_date <=> $b->_date } $self->_items_credits, $self->_items_payments
   
     # credits