summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorivan <ivan>2005-11-22 18:29:39 +0000
committerivan <ivan>2005-11-22 18:29:39 +0000
commita8c51f52a9a13c13b17c00e8bd8bcbafd2bc6424 (patch)
tree81619580e8a51a76b5fe4044d486271c7e413882 /httemplate/edit
parentb16afdcb3d9ea99c7c125d64ee864d7dff63a384 (diff)
add backend-realtime config flag, should be more intuitive for guyananet
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-xhttemplate/edit/process/cust_main.cgi14
1 files changed, 14 insertions, 0 deletions
diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi
index d77aa2fdd..acc1ca434 100755
--- a/httemplate/edit/process/cust_main.cgi
+++ b/httemplate/edit/process/cust_main.cgi
@@ -123,7 +123,20 @@ if ( $new->custnum eq '' ) {
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 @@ if ( $new->custnum eq '' ) {
$new->paycvv($old->paycvv);
}
$error ||= $new->replace($old, \@invoicing_list);
+
}
if ( $error ) {