projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2c0d767
)
allow_negative_charges config option
author
ivan
<ivan>
Tue, 23 Dec 2003 00:41:15 +0000
(
00:41
+0000)
committer
ivan
<ivan>
Tue, 23 Dec 2003 00:41:15 +0000
(
00:41
+0000)
FS/FS/Conf.pm
patch
|
blob
|
history
FS/FS/cust_main.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Conf.pm
b/FS/FS/Conf.pm
index
d911480
..
b391fe4
100644
(file)
--- a/
FS/FS/Conf.pm
+++ b/
FS/FS/Conf.pm
@@
-1144,6
+1144,13
@@
httemplate/docs/config.html
],
},
],
},
+ {
+ 'key' => 'allow_negative_charges',
+ 'section' => 'billing',
+ 'description' => 'Allow negative charges. Normally not used unless importing data from a legacy system that requires this.',
+ 'type' => 'checkbox',
+ },
+
);
1;
);
1;
diff --git
a/FS/FS/cust_main.pm
b/FS/FS/cust_main.pm
index
8695ae0
..
3e40cc1
100644
(file)
--- a/
FS/FS/cust_main.pm
+++ b/
FS/FS/cust_main.pm
@@
-1201,15
+1201,15
@@
sub bill {
}
$setup = sprintf( "%.2f", $setup );
$recur = sprintf( "%.2f", $recur );
}
$setup = sprintf( "%.2f", $setup );
$recur = sprintf( "%.2f", $recur );
- if ( $setup < 0 ) {
+ if ( $setup < 0
&& ! $conf->exists('allow_negative_charges')
) {
$dbh->rollback if $oldAutoCommit;
return "negative setup $setup for pkgnum ". $cust_pkg->pkgnum;
}
$dbh->rollback if $oldAutoCommit;
return "negative setup $setup for pkgnum ". $cust_pkg->pkgnum;
}
- if ( $recur < 0 ) {
+ if ( $recur < 0
&& ! $conf->exists('allow_negative_charges')
) {
$dbh->rollback if $oldAutoCommit;
return "negative recur $recur for pkgnum ". $cust_pkg->pkgnum;
}
$dbh->rollback if $oldAutoCommit;
return "negative recur $recur for pkgnum ". $cust_pkg->pkgnum;
}
- if ( $setup
> 0 || $recur >
0 ) {
+ if ( $setup
!= 0 || $recur !=
0 ) {
my $cust_bill_pkg = new FS::cust_bill_pkg ({
'pkgnum' => $cust_pkg->pkgnum,
'setup' => $setup,
my $cust_bill_pkg = new FS::cust_bill_pkg ({
'pkgnum' => $cust_pkg->pkgnum,
'setup' => $setup,
@@
-1327,7
+1327,7
@@
sub bill {
} #unless $self->tax =~ /Y/i || $self->payby eq 'COMP'
} #unless $self->tax =~ /Y/i || $self->payby eq 'COMP'
- } #if $setup
> 0 || $recur >
0
+ } #if $setup
!= 0 || $recur !=
0
} #if $cust_pkg_mod_flag
} #if $cust_pkg_mod_flag