#list all counties/states/countries
$return{'cust_main_county'} =
- [ map { $_->hashref } qsearch('cust_main_county', {}) ],
+ [ map { $_->hashref } qsearch('cust_main_county', {}) ];
#shortcut for one-country folks
my $conf = new FS::Conf;
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 {