projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add cust_credit, cust_pay and cust_refund subs
[freeside.git]
/
FS
/
FS
/
cust_bill.pm
diff --git
a/FS/FS/cust_bill.pm
b/FS/FS/cust_bill.pm
index
353ab49
..
88f40da
100644
(file)
--- a/
FS/FS/cust_bill.pm
+++ b/
FS/FS/cust_bill.pm
@@
-594,7
+594,10
@@
sub realtime_bop {
my( $self, $method ) = @_;
my $cust_main = $self->cust_main;
my( $self, $method ) = @_;
my $cust_main = $self->cust_main;
- my $amount = $self->owed;
+ my $balance = $cust_main->balance;
+ my $amount = ( $balance < $self->owed ) ? $balance : $self->owed;
+ $amount = sprintf("%.2f", $amount);
+ return "not run (balance $balance)" unless $amount > 0;
my $description = 'Internet Services';
if ( $conf->exists('business-onlinepayment-description') ) {
my $description = 'Internet Services';
if ( $conf->exists('business-onlinepayment-description') ) {