Bugzilla – Attachment 66556 Details for
Bug 14850
Funds from inactive budgets appear in 'Funds' dropdown on acqui/invoice.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14850 - Use optgroups for active and inactive budgets on invoice.pl
Bug-14850---Use-optgroups-for-active-and-inactive-.patch (text/plain), 4.04 KB, created by
Nick Clemens
on 2017-08-28 16:03:49 UTC
(
hide
)
Description:
Bug 14850 - Use optgroups for active and inactive budgets on invoice.pl
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2017-08-28 16:03:49 UTC
Size:
4.04 KB
patch
obsolete
>From 410c01c3b0682f55bec5b3053588ec13e5ee28c4 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 28 Aug 2017 16:01:31 +0000 >Subject: [PATCH] Bug 14850 - Use optgroups for active and inactive budgets on > invoice.pl > >To test: >1 - Have some inactive and active budgets >2 - View an invoice in acquisitions >3 - Select the shipping fund dropdown >4 - Note you see all the budgets >5 - Apply patch >6 - View invoice and select shipping fund dropdown >7 - Note you see active budgets followed by inactive budgets >--- > acqui/invoice.pl | 24 +++++++++++++++------- > .../intranet-tmpl/prog/en/modules/acqui/invoice.tt | 15 +++++++++++++- > 2 files changed, 31 insertions(+), 8 deletions(-) > >diff --git a/acqui/invoice.pl b/acqui/invoice.pl >index 3ab2d9f..e20633d 100755 >--- a/acqui/invoice.pl >+++ b/acqui/invoice.pl >@@ -37,6 +37,8 @@ use C4::Budgets; > > use Koha::Acquisition::Booksellers; > use Koha::Acquisition::Currencies; >+use Koha::Acquisition::Budgets; >+use Koha::Acquisition::Budget; > use Koha::DateUtils; > use Koha::Misc::Files; > >@@ -146,18 +148,25 @@ foreach my $order (@$orders) { > > push @foot_loop, map {$_} values %foot; > >-my $budgets = GetBudgets(); >+my $budgets = Koha::Acquisition::Budgets->search(); > my @budgets_loop; >+my @inactive_budgets_loop; > my $shipmentcost_budgetid = $details->{shipmentcost_budgetid}; >-foreach my $budget (@$budgets) { >- next unless CanUserUseBudget( $loggedinuser, $budget, $flags ); >- my %line = %{$budget}; >+while ( my $budget = $budgets->next ) { >+ next unless CanUserUseBudget( $loggedinuser, $budget->budget_id, $flags ); >+ my $line = $budget->unblessed; > if ( $shipmentcost_budgetid >- and $budget->{budget_id} == $shipmentcost_budgetid ) >+ and $budget->budget_id == $shipmentcost_budgetid ) > { >- $line{selected} = 1; >+ $line->{selected} = 1; > } >- push @budgets_loop, \%line; >+ if ( $budget->active ) { >+ push @budgets_loop, \%$line; >+ } >+ else { >+ push @inactive_budgets_loop, \%$line; >+ } >+ > } > > $template->param( >@@ -180,6 +189,7 @@ $template->param( > invoiceincgst => $bookseller->invoiceincgst, > currency => Koha::Acquisition::Currencies->get_active, > budgets_loop => \@budgets_loop, >+ inactive_budgets_loop => \@inactive_budgets_loop, > ); > > defined( $invoice_files ) && $template->param( files => $invoice_files->GetFilesInfo() ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >index ba56547..54a1d1c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >@@ -93,6 +93,7 @@ > <li><label for="shipment_budget_id">Shipping fund:</label> > <select id="shipment_budget_id" name="shipment_budget_id"> > <option value="">No fund</option> >+ <optgroup label="Active Budgets"> > [% FOREACH budget IN budgets_loop %] > [% IF ( budget.selected ) %] > <option selected="selected" value="[% budget.budget_id %]"> >@@ -101,7 +102,19 @@ > [% END %] > [% budget.budget_name %] > </option> >- [% END %] >+ [% END %]i >+ </optgroup> >+ <optgroup label="Inactive Budgets"> >+ [% FOREACH budget IN inactive_budgets_loop %] >+ [% IF ( budget.selected ) %] >+ <option selected="selected" value="[% budget.budget_id %]"> >+ [% ELSE %] >+ <option value="[% budget.budget_id %]"> >+ [% END %] >+ [% budget.budget_name %] >+ </option> >+ [% END %]i >+ </optgroup> > </select></li> > > [% IF ( invoiceclosedate ) %] >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14850
:
66555
|
66556
|
77522
|
85521
|
85522
|
85600
|
85601
|
85602