[freeside-commits] freeside/FS/FS Conf.pm, 1.154, 1.155 agent.pm, 1.13, 1.14 cust_bill.pm, 1.148, 1.149 inventory_item.pm, 1.2, 1.3

Ivan,,, ivan at wavetail.420.am
Sat Jul 15 17:55:07 PDT 2006


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv4705/FS/FS

Modified Files:
	Conf.pm agent.pm cust_bill.pm inventory_item.pm 
Log Message:
odds and ends

Index: inventory_item.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/inventory_item.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- inventory_item.pm	8 Mar 2006 12:14:04 -0000	1.2
+++ inventory_item.pm	16 Jul 2006 00:55:05 -0000	1.3
@@ -3,10 +3,11 @@
 use strict;
 use vars qw( @ISA );
 use FS::Record qw( dbh qsearch qsearchs );
+use FS::cust_main_Mixin;
 use FS::inventory_class;
 use FS::cust_svc;
 
- at ISA = qw(FS::Record);
+ at ISA = qw( FS::cust_main_Mixin FS::Record );
 
 =head1 NAME
 

Index: agent.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/agent.pm,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- agent.pm	8 Mar 2006 08:21:37 -0000	1.13
+++ agent.pm	16 Jul 2006 00:55:05 -0000	1.14
@@ -221,7 +221,8 @@
 
 =item num_active_cust_main
 
-Returns the number of active customers for this agent.
+Returns the number of active customers for this agent (customers with active
+recurring packages).
 
 =cut
 
@@ -239,6 +240,28 @@
   shift->cust_main_sql(FS::cust_main->active_sql);
 }
 
+=item num_inactive_cust_main
+
+Returns the number of inactive customers for this agent (customers with no
+active recurring packages, but otherwise unsuspended/uncancelled).
+
+=cut
+
+sub num_inactive_cust_main {
+  shift->num_sql(FS::cust_main->inactive_sql);
+}
+
+=item inactive_cust_main
+
+Returns the inactive customers for this agent, as cust_main objects.
+
+=cut
+
+sub inactive_cust_main {
+  shift->cust_main_sql(FS::cust_main->inactive_sql);
+}
+
+
 =item num_susp_cust_main
 
 Returns the number of suspended customers for this agent.

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.154
retrieving revision 1.155
diff -u -d -r1.154 -r1.155
--- Conf.pm	19 Jun 2006 08:05:28 -0000	1.154
+++ Conf.pm	16 Jul 2006 00:55:05 -0000	1.155
@@ -1363,8 +1363,8 @@
 
   {
     'key'         => 'users-allow_comp',
-    'section'     => '',
-    'description' => 'Usernames (Freeside users, created with <a href="../docs/man/bin/freeside-adduser.html">freeside-adduser</a>) which can create complimentary customers, one per line.  If no usernames are entered, all users can create complimentary accounts.',
+    'section'     => 'deprecated',
+    'description' => '<b>DEPRECATED</b>, enable the <i>Complimentary customer</i> access right instead.  Was: Usernames (Freeside users, created with <a href="../docs/man/bin/freeside-adduser.html">freeside-adduser</a>) which can create complimentary customers, one per line.  If no usernames are entered, all users can create complimentary accounts.',
     'type'        => 'textarea',
   },
 

Index: cust_bill.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill.pm,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -d -r1.148 -r1.149
--- cust_bill.pm	16 Jun 2006 01:23:40 -0000	1.148
+++ cust_bill.pm	16 Jul 2006 00:55:05 -0000	1.149
@@ -21,6 +21,7 @@
 use FS::cust_pay;
 use FS::cust_pkg;
 use FS::cust_credit_bill;
+use FS::pay_batch;
 use FS::cust_pay_batch;
 use FS::cust_bill_event;
 use FS::part_pkg;
@@ -1282,17 +1283,19 @@
 sub batch_card {
   my $self = shift;
   my $cust_main = $self->cust_main;
+
   my $oldAutoCommit = $FS::UID::AutoCommit;
   local $FS::UID::AutoCommit = 0;
   my $dbh = dbh;
 
   my $pay_batch = qsearchs('pay_batch', {'status' => 'O'});
 
-  unless ($pay_batch) {
+  unless ( $pay_batch ) {
     $pay_batch = new FS::pay_batch;
     $pay_batch->setfield('status' => 'O');
     my $error = $pay_batch->insert;
     if ( $error ) {
+      $dbh->rollback if $oldAutoCommit;
       die "error creating new batch: $error\n";
     }
   }
@@ -1315,10 +1318,12 @@
     'amount'   => $self->owed,
   } );
   my $error = $cust_pay_batch->insert;
-  die $error if $error;
+  if ( $error ) {
+    $dbh->rollback if $oldAutoCommit;
+    die $error;
+  }
 
   $dbh->commit or die $dbh->errstr if $oldAutoCommit;
-
   '';
 }
 



More information about the freeside-commits mailing list