From: Galen Charlton Date: Tue, 8 Jun 2021 14:41:34 +0000 (-0400) Subject: LP#1406424: display total of rolled over encumbrances during FPC X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c5b7340bde65c6668b17be0720c48a01e8989f54;p=Evergreen.git LP#1406424: display total of rolled over encumbrances during FPC Signed-off-by: Galen Charlton Signed-off-by: Ruth Frasur Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-rollover-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-rollover-dialog.component.html index 8734f55adb..00f60f2206 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-rollover-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-rollover-dialog.component.html @@ -73,6 +73,7 @@
  • DRY RUN: these changes have not been committed yet.
  • {{count}} funds propagated for fiscal year {{year + 1}} for the selected locations
  • {{amount_rolled}} unspent money rolled over to fiscal year {{year + 1}} for the selected locations
  • +
  • {{encumb_rolled}} in encumbrances rolled over to fiscal year {{year + 1}} for the selected locations
  • diff --git a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-rollover-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-rollover-dialog.component.ts index c7f995d8a2..24ab41fa4d 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-rollover-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/acq/funds/fund-rollover-dialog.component.ts @@ -48,6 +48,7 @@ export class FundRolloverDialogComponent count: number; amount_rolled: number; + encumb_rolled: number; constructor( private idl: IdlService, @@ -114,6 +115,7 @@ export class FundRolloverDialogComponent this.count = 0; this.amount_rolled = 0; + this.encumb_rolled = 0; this.net.request( 'open-ils.acq', @@ -128,6 +130,7 @@ export class FundRolloverDialogComponent rolloverResponses.push(r.fund); this.count++; this.amount_rolled += Number(r.rollover_amount); + this.encumb_rolled += Number(r.encumb_amount); }, err => {}, () => { diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Financials.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Financials.pm index f4007248c5..bc273386c6 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Financials.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Financials.pm @@ -1426,7 +1426,8 @@ sub process_fiscal_rollover { my $fund = $e->retrieve_acq_fund($_) or return $e->die_event; $fund->summary(retrieve_fund_summary_impl($e, $fund)); - my $amount = 0; + my $rollover_amount = 0; + my $encumb_amount = 0; if($combined and $U->is_true($fund->rollover)) { # see how much money was rolled over @@ -1436,10 +1437,18 @@ sub process_fiscal_rollover { where => {dest_fund => $fund->id, note => { like => 'Rollover%' } } })->[0]; - $amount = $sum->{dest_amount} if $sum; + $rollover_amount = $sum->{dest_amount} if $sum; + + $sum = $e->json_query({ + select => {acqfdeb => [{column => 'amount', transform => 'sum'}]}, + from => 'acqfdeb', + where => {fund => $fund->id, encumbrance => 't' } + })->[0]; + + $encumb_amount = $sum->{amount} if $sum; } - $conn->respond({fund => $fund, rollover_amount => $amount}); + $conn->respond({fund => $fund, rollover_amount => $rollover_amount, encumb_amount => $encumb_amount}); } $self->api_name =~ /dry_run/ and $e->rollback or $e->commit;