[open-ils-commits] r18590 - branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq (senator)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Nov 3 10:46:54 EDT 2010
Author: senator
Date: 2010-11-03 10:46:51 -0400 (Wed, 03 Nov 2010)
New Revision: 18590
Modified:
branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Invoice.pm
Log:
Backport r18589 from trunk: acq invoice voucher fix
Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Invoice.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Invoice.pm 2010-11-03 14:46:24 UTC (rev 18589)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Invoice.pm 2010-11-03 14:46:51 UTC (rev 18590)
@@ -251,6 +251,9 @@
my $entries = $e->search_acq_invoice_entry({"invoice" => $inv_id}) or
return 0;
+ my $items = $e->search_acq_invoice_item({"invoice" => $inv_id}) or
+ return 0;
+
my %totals_by_fund;
foreach my $entry (@$entries) {
my $debits = find_entry_debits($e, $entry, "f") or return 0;
@@ -260,6 +263,12 @@
}
}
+ foreach my $item (@$items) {
+ next unless $item->fund and $item->amount_paid;
+ $totals_by_fund{$item->fund} ||= 0.0;
+ $totals_by_fund{$item->fund} += $item->amount_paid;
+ }
+
my @totals;
foreach my $fund_id (keys %totals_by_fund) {
my $fund = $e->retrieve_acq_fund($fund_id) or return 0;
More information about the open-ils-commits
mailing list