projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b16afdc
)
add backend-realtime config flag, should be more intuitive for guyananet
author
ivan
<ivan>
Tue, 22 Nov 2005 18:29:39 +0000
(18:29 +0000)
committer
ivan
<ivan>
Tue, 22 Nov 2005 18:29:39 +0000
(18:29 +0000)
FS/FS/Conf.pm
patch
|
blob
|
history
httemplate/edit/process/cust_main.cgi
patch
|
blob
|
history
diff --git
a/FS/FS/Conf.pm
b/FS/FS/Conf.pm
index
7fed1a4
..
4090a90
100644
(file)
--- a/
FS/FS/Conf.pm
+++ b/
FS/FS/Conf.pm
@@
-1202,6
+1202,13
@@
httemplate/docs/config.html
},
{
},
{
+ 'key' => 'backend-realtime',
+ 'section' => '',
+ 'description' => 'Run billing for backend signups immediately.',
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'declinetemplate',
'section' => 'billing',
'description' => 'Template file for credit card decline emails.',
'key' => 'declinetemplate',
'section' => 'billing',
'description' => 'Template file for credit card decline emails.',
diff --git
a/httemplate/edit/process/cust_main.cgi
b/httemplate/edit/process/cust_main.cgi
index
d77aa2f
..
acc1ca4
100755
(executable)
--- 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 );
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
} 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')
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);
$new->paycvv($old->paycvv);
}
$error ||= $new->replace($old, \@invoicing_list);
+
}
if ( $error ) {
}
if ( $error ) {