[freeside-commits] freeside/FS/FS cdr.pm,1.67,1.68
Erik Levinson
levinse at wavetail.420.am
Mon Jan 24 15:06:51 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv17305/FS/FS
Modified Files:
cdr.pm
Log Message:
CDR reprocess with termination, RT8763
Index: cdr.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cdr.pm,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -w -d -r1.67 -r1.68
--- cdr.pm 25 Nov 2010 01:06:29 -0000 1.67
+++ cdr.pm 24 Jan 2011 23:06:49 -0000 1.68
@@ -678,6 +678,50 @@
$export_names{$format}->{'invoice_header'};
}
+=item clear_status
+
+Clears cdr and any associated cdr_termination statuses - used for
+CDR reprocessing.
+
+=cut
+
+sub clear_status {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ $self->freesidestatus('');
+ my $error = $self->replace;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ my @cdr_termination = qsearch('cdr_termination',
+ { 'acctid' => $self->acctid } );
+ foreach my $cdr_termination ( @cdr_termination ) {
+ $cdr_termination->status('');
+ $error = $cdr_termination->replace;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+}
+
=item import_formats
Returns an ordered list of key value pairs containing import format names
More information about the freeside-commits
mailing list