projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
credit out self-service
[freeside.git]
/
FS
/
FS
/
ClientAPI
/
MyAccount.pm
diff --git
a/FS/FS/ClientAPI/MyAccount.pm
b/FS/FS/ClientAPI/MyAccount.pm
index
e8ce6b4
..
58ab6c0
100644
(file)
--- a/
FS/FS/ClientAPI/MyAccount.pm
+++ b/
FS/FS/ClientAPI/MyAccount.pm
@@
-541,6
+541,11
@@
sub order_pkg {
if ( $cust_main->balance > $old_balance
&& $cust_main->payby !~ /^(BILL|DCRD|DCHK)$/ ) {
if ( $cust_main->balance > $old_balance
&& $cust_main->payby !~ /^(BILL|DCRD|DCHK)$/ ) {
+ #this makes sense. credit is "un-doing" the invoice
+ $cust_main->credit( sprintf("%.2f", $cust_main->balance - $old_balance ),
+ 'self-service decline' );
+ $cust_main->apply_credits( 'order' => 'newest' );
+
$cust_pkg->cancel('quiet'=>1);
return { 'error' => '_decline' };
} else {
$cust_pkg->cancel('quiet'=>1);
return { 'error' => '_decline' };
} else {