From 01b9e377763caf74b7c309d2f5e42c335e671b99 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Tue, 7 Jan 2014 21:11:22 -0500 Subject: [PATCH] Fix Publisher/money.pm for billing changes. Signed-off-by: Jason Stephenson --- .../lib/OpenILS/Application/Storage/Publisher/action.pm | 12 ++++++------ .../lib/OpenILS/Application/Storage/Publisher/money.pm | 7 ------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm index 0bbc869684..234ab41737 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm @@ -1113,8 +1113,8 @@ sub generate_fines { my $bill_payment_map = $CC->bill_payment_map_for_xact(undef, $c); # Pull out those entries for overdue bills in reverse date order. - my @fine_map = sort { $b->bill->billing_ts() <=> $a->bill->billing_ts() } - grep { $_->bill->btype() == 1 && $_->bill->billing_ts() > $c->$due_date_method } + my @fine_map = sort { $b->{bill}->billing_ts() <=> $a->{bill}->billing_ts() } + grep { $_->{bill}->btype() == 1 && $_->{bill}->billing_ts() > $c->$due_date_method } @{$bill_payment_map}; my $f_idx = 0; @@ -1122,15 +1122,15 @@ sub generate_fines { my $fine; if (@fine_map) { if ($overbill) { - while ($fine_map[$f_idx] and $fine_map[$f_idx]->void_amount() >= $fine_map[$f_idx]->bill_amount()) { + while ($fine_map[$f_idx] and $fine_map[$f_idx]->{void_amount} >= $fine_map[$f_idx]->{bill_amount}) { $f_idx++; } } # Set the $fine to be used for $last_fine below. - $fine = $fine_map[$f_idx]->bill() if ($fine_map[$f_idx]); + $fine = $fine_map[$f_idx]->{bill} if ($fine_map[$f_idx]); # Calculate the current fine total using the modified bill amounts from the bill payment map. - map { $current_fine_total += int($_->bill->amount() * 100) } - grep { $_->bill_amount() < $_->void_amount() } @fine_map; + map { $current_fine_total += int($_->{bill}->amount() * 100) } + grep { $_->{bill_amount} < $_->{void_amount} } @fine_map; } my $last_fine; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/money.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/money.pm index 877ffd7578..315c7bd05c 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/money.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/money.pm @@ -18,7 +18,6 @@ sub _make_mbts { my $to = 0; my $lb = undef; for my $b ($x->billings) { - next if ($b->voided); #$log->debug( "billing is ".$b->amount, DEBUG ); $to += ($b->amount * 100); $lb ||= $b->billing_ts; @@ -144,7 +143,6 @@ select and c.id is null and x.circ_lib in (XX) and b.billing_ts < current_timestamp - ? * '1 day'::interval - and not b.voided and set.id IS NULL group by 1,2 @@ -163,7 +161,6 @@ select and c.id is null and x.billing_location in (XX) and b.billing_ts < current_timestamp - ? * '1 day'::interval - and not b.voided and set.id IS NULL group by 1,2 @@ -182,7 +179,6 @@ select and c.id is null and x.pickup_lib in (XX) and b.billing_ts < current_timestamp - ? * '1 day'::interval - and not b.voided and set.id IS NULL group by 1,2 ) full_list @@ -249,7 +245,6 @@ select where x.xact_finish is null and x.circ_lib in (XX) and b.billing_ts between ? and ? - and not b.voided group by 1,2 union all @@ -263,7 +258,6 @@ select where x.xact_finish is null and x.billing_location in (XX) and b.billing_ts between ? and ? - and not b.voided group by 1,2 union all @@ -277,7 +271,6 @@ select where x.xact_finish is null and x.pickup_lib in (XX) and b.billing_ts between ? and ? - and not b.voided group by 1,2 ) full_list left join money.payment p on (full_list.id = p.xact) -- 2.11.0