@@ -, +, @@ (open/closed) --- acqui/invoice.pl | 11 ++- acqui/invoices.pl | 11 +++ .../prog/en/modules/acqui/invoices.tt | 102 ++++++++++++++++----- 3 files changed, 96 insertions(+), 28 deletions(-) --- a/acqui/invoice.pl +++ a/acqui/invoice.pl @@ -71,7 +71,10 @@ if ( C4::Context->preference('AcqEnableFiles') ) { if ( $op && $op eq 'close' ) { output_and_exit( $input, $cookie, $template, 'insufficient_permission' ) unless $logged_in_patron->has_permission( { acquisition => 'edit_invoices' } ); - CloseInvoice($invoiceid); + my @invoiceid = $input->multi_param('invoiceid'); + foreach my $invoiceid ( @invoiceid ) { + CloseInvoice($invoiceid); + } my $referer = $input->param('referer'); if ($referer) { print $input->redirect($referer); @@ -81,8 +84,10 @@ if ( $op && $op eq 'close' ) { elsif ( $op && $op eq 'reopen' ) { output_and_exit( $input, $cookie, $template, 'insufficient_permission' ) unless $logged_in_patron->has_permission( { acquisition => 'reopen_closed_invoices' } ); - - ReopenInvoice($invoiceid); + my @invoiceid = $input->multi_param('invoiceid'); + foreach my $invoiceid ( @invoiceid ) { + ReopenInvoice($invoiceid); + } my $referer = $input->param('referer'); if ($referer) { print $input->redirect($referer); --- a/acqui/invoices.pl +++ a/acqui/invoices.pl @@ -111,9 +111,20 @@ foreach my $budget (@$budgets) { push @budgets_loop, $budget if CanUserUseBudget( $loggedinuser, $budget, $flags ); } +my (@openedinvoices, @closedinvoices); +for my $sub ( @{$invoices} ) { + unless ( $sub->{closedate} ) { + push @openedinvoices, $sub + } else { + push @closedinvoices, $sub + } +} + $template->{'VARS'}->{'budgets_loop'} = \@budgets_loop; $template->param( + openedinvoices => \@openedinvoices, + closedinvoices => \@closedinvoices, do_search => ( $op and $op eq 'do_search' ) ? 1 : 0, invoices => $invoices, invoicenumber => $invoicenumber, --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt @@ -25,11 +25,17 @@

Invoices

[% IF ( do_search ) %] [% IF invoices %] + [% BLOCK invoices_table %] + [% IF closed %] + [% SET tab = 'closed' %] + [% ELSE %] + [% SET tab = 'opened' %] + [% END %] - +
[% IF CAN_user_acquisition_merge_invoices %] @@ -108,23 +114,56 @@
[% IF CAN_user_acquisition_merge_invoices %] - Merge selected invoices -
-
-
-
    -
  1. Merge invoices

  2. -
  3. - - - -
    Invoice no.Shipment dateBilling dateShipment cost
  4. -
  5. - - Required -
  6. -
  7. -
  8. + Merge selected invoices + [% IF tab == 'closed' %] + Reopen Selected Invoices + [% ELSE %] + Close Selected Invoices + [% END %] + + [% END %] +
    + +
    + [% IF openedinvoices %] + [% INCLUDE invoices_table invoices = openedinvoices %] + [% ELSE %] +
    +

    Your search returned no open invoices.

    +
    + [% END %] +
    +
    + [% IF closedinvoices %] + [% INCLUDE invoices_table invoices = closedinvoices closed = 1 %] + [% ELSE %] +
    +

    Your search returned no closed invoices.

    +
    + [% END %] +
    +
    + + +
    + +
    +
      +
    1. Merge invoices

    2. +
    3. + + + +
      Invoice no.Shipment dateBilling dateShipment cost
    4. +
    5. + + Required +
    6. +
    7. +
    8. @@ -317,10 +356,11 @@ [% INCLUDE 'calendar.inc' %]