projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT#31594: Unapplied payment issues
[freeside.git]
/
FS
/
FS
/
cust_main
/
Billing.pm
diff --git
a/FS/FS/cust_main/Billing.pm
b/FS/FS/cust_main/Billing.pm
index
08ec6dd
..
908f486
100644
(file)
--- a/
FS/FS/cust_main/Billing.pm
+++ b/
FS/FS/cust_main/Billing.pm
@@
-1305,6
+1305,14
@@
sub _make_lines {
return "$@ running $method for $cust_pkg\n"
if ( $@ );
return "$@ running $method for $cust_pkg\n"
if ( $@ );
+ if ($recur eq 'NOTHING') {
+ # then calc_cancel (or calc_recur but that's not used) has declined to
+ # generate a recurring lineitem at all. treat this as zero, but also
+ # try not to generate a lineitem.
+ $recur = 0;
+ $lineitems--;
+ }
+
#base_cancel???
$unitrecur = $cust_pkg->base_recur( \$sdate ) || $recur; #XXX uuh, better
#base_cancel???
$unitrecur = $cust_pkg->base_recur( \$sdate ) || $recur; #XXX uuh, better
@@
-2355,6
+2363,7
@@
sub due_cust_event {
=item apply_payments_and_credits [ OPTION => VALUE ... ]
Applies unapplied payments and credits.
=item apply_payments_and_credits [ OPTION => VALUE ... ]
Applies unapplied payments and credits.
+Payments with the no_auto_apply flag set will not be applied.
In most cases, this new method should be used in place of sequential
apply_payments and apply_credits methods.
In most cases, this new method should be used in place of sequential
apply_payments and apply_credits methods.
@@
-2497,6
+2506,7
@@
sub apply_credits {
Applies (see L<FS::cust_bill_pay>) unapplied payments (see L<FS::cust_pay>)
to outstanding invoice balances in chronological order.
Applies (see L<FS::cust_bill_pay>) unapplied payments (see L<FS::cust_pay>)
to outstanding invoice balances in chronological order.
+Payments with the no_auto_apply flag set will not be applied.
#and returns the value of any remaining unapplied payments.
#and returns the value of any remaining unapplied payments.
@@
-2526,7
+2536,7
@@
sub apply_payments {
#return 0 unless
#return 0 unless
- my @payments = $self->unapplied_cust_pay;
+ my @payments =
grep { !$_->no_auto_apply }
$self->unapplied_cust_pay;
my @invoices = $self->open_cust_bill;
my @invoices = $self->open_cust_bill;