[freeside-commits] freeside/httemplate/edit/process cust_main.cgi,
1.18, 1.19
Ivan,,,
ivan at wavetail.420.am
Tue Nov 22 10:29:41 PST 2005
Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail:/tmp/cvs-serv28739/httemplate/edit/process
Modified Files:
cust_main.cgi
Log Message:
add backend-realtime config flag, should be more intuitive for guyananet
Index: cust_main.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_main.cgi,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- cust_main.cgi 21 Oct 2005 15:21:37 -0000 1.18
+++ cust_main.cgi 22 Nov 2005 18:29:39 -0000 1.19
@@ -123,7 +123,20 @@
tie my %hash, 'Tie::RefHash';
%hash = ( $cust_pkg => [ $svc_acct ] ) if $cust_pkg;
$error ||= $new->insert( \%hash, \@invoicing_list );
+
+ my $conf = new FS::Conf;
+ if ( $conf->exists('backend-realtime') && ! $error ) {
+
+ my $berror = $new->bill;
+ $new->apply_payments;
+ $new->apply_credits;
+ $berror ||= $new->collect;
+ warn "Warning, error billing during backend-realtime: $berror" if $berror;
+
+ }
+
} else { #create old record object
+
my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } );
$error ||= "Old record not found!" unless $old;
if ( defined dbdef->table('cust_main')->column('paycvv')
@@ -132,6 +145,7 @@
$new->paycvv($old->paycvv);
}
$error ||= $new->replace($old, \@invoicing_list);
+
}
if ( $error ) {
More information about the freeside-commits
mailing list