[freeside-commits] freeside/FS/FS cust_bill_ApplicationCommon.pm, 1.16, 1.17
Ivan,,,
ivan at wavetail.420.am
Sat Dec 19 15:52:37 PST 2009
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv5706
Modified Files:
cust_bill_ApplicationCommon.pm
Log Message:
fix more ->owed_setup/owed_recur clashing with cust_bill->open_cust_bill_pkg separating line items, RT#4729
Index: cust_bill_ApplicationCommon.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_bill_ApplicationCommon.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- cust_bill_ApplicationCommon.pm 19 Dec 2009 23:28:13 -0000 1.16
+++ cust_bill_ApplicationCommon.pm 19 Dec 2009 23:52:35 -0000 1.17
@@ -175,7 +175,8 @@
if $DEBUG;
#@apply = map { [ $_, $_->amount ]; } @open;
- @apply = map { [ $_, $_->owed_setup + 0 || $_->owed_recur + 0 ]; } @open;
+ #@apply = map { [ $_, $_->owed_setup + 0 || $_->owed_recur + 0 ]; } @open;
+ @apply = map { [ $_, $_->setup ? $_->owed_setup : $_->owed_recur ]; } @open;
} else {
@@ -183,8 +184,8 @@
# - amount exactly and uniquely matches a single open lineitem
# (you must be trying to pay or credit that item, then)
- my @same = grep { $_->owed_setup == $self->amount
- || $_->owed_recur == $self->amount
+ my @same = grep { ( $_->setup && $_->owed_setup == $self->amount )
+ || ( $_->recur && $_->owed_recur == $self->amount )
}
@open;
if ( scalar(@same) == 1 ) {
@@ -229,7 +230,10 @@
my @items = map { $_->[0] } grep { $weight == $_->[1] } @openweight;
my $itemtotal = 0;
- foreach my $item (@items) { $itemtotal += $item->owed_setup + 0 || $item->owed_recur + 0; }
+ foreach my $item (@items) {
+ $itemtotal += $item->owed_setup if $item->setup;
+ $itemtotal += $item->owed_recur if $item->recur;
+ }
my $applytotal = min( $itemtotal, $remaining_amount );
$remaining_amount -= $applytotal;
@@ -250,7 +254,7 @@
my @newitems = ();
foreach my $item ( @items ) {
- my $itemamount = $item->owed_setup + 0 || $item->owed_recur + 0;
+ my $itemamount = $item->setup ? $item->owed_setup : $item->owed_recur;
if ( $itemamount < $applyeach ) {
warn "$me applying full $itemamount".
" to small line item (cust_bill_pkg ". $item->billpkgnum. ")\n"
@@ -356,8 +360,6 @@
return '' if $skip_apply_to_lineitems_hack;
-
-
my $conf = new FS::Conf;
local $SIG{HUP} = 'IGNORE';
More information about the freeside-commits
mailing list