Bugzilla – Attachment 115420 Details for
Bug 22773
Bulk close invoices and filter invoice view (open/closed)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22773: Bulk Close invoices and Filter invoice view (open/closed)
Bug-22773-Bulk-Close-invoices-and-Filter-invoice-v.patch (text/plain), 11.66 KB, created by
Nick Clemens (kidclamp)
on 2021-01-20 12:18:25 UTC
(
hide
)
Description:
Bug 22773: Bulk Close invoices and Filter invoice view (open/closed)
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-01-20 12:18:25 UTC
Size:
11.66 KB
patch
obsolete
>From cbb3fbf142a7f7f12c00056938a37283183d8ed5 Mon Sep 17 00:00:00 2001 >From: Devinim <kohadevinim@devinim.com.tr> >Date: Tue, 1 Oct 2019 09:38:24 +0000 >Subject: [PATCH] Bug 22773: Bulk Close invoices and Filter invoice view > (open/closed) > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> > >Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Bug 22773: The deprecated plugin is removed > >Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> > >Signed-off-by: Christopher Kellermeyer <ckellermeyer@altadenalibrary.org> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Remove asset for removed js >--- > acqui/invoice.pl | 11 ++- > acqui/invoices.pl | 11 +++ > .../prog/en/modules/acqui/invoices.tt | 102 ++++++++++++++++----- > 3 files changed, 96 insertions(+), 28 deletions(-) > >diff --git a/acqui/invoice.pl b/acqui/invoice.pl >index 38577469c1..669dd26a96 100755 >--- a/acqui/invoice.pl >+++ b/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); >diff --git a/acqui/invoices.pl b/acqui/invoices.pl >index 076e26733b..85e066094d 100755 >--- a/acqui/invoices.pl >+++ b/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, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >index 4536842f41..859a242039 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt >@@ -25,11 +25,17 @@ > <h1>Invoices</h1> > [% IF ( do_search ) %] > [% IF invoices %] >+ [% BLOCK invoices_table %] >+ [% IF closed %] >+ [% SET tab = 'closed' %] >+ [% ELSE %] >+ [% SET tab = 'opened' %] >+ [% END %] > <label for="show_only_subscription"> >- <input type="checkbox" style="vertical-align: middle;" id="show_only_subscription" /> >+ <input type="checkbox" style="vertical-align: middle;" class="show_only_subscription" data-tableid="[% tab %]resultst"/> > Show only subscriptions > </label> >- <table id="resultst"> >+ <table id="[% tab %]resultst" class="result"> > <thead> > <tr> > [% IF CAN_user_acquisition_merge_invoices %] >@@ -108,23 +114,56 @@ > </tbody> > </table> > [% IF CAN_user_acquisition_merge_invoices %] >- <a class="submit" id="merge" href="#merge_invoices">Merge selected invoices</a> >- <div id="merge_invoices"> >- <form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post"> >- <fieldset class="rows"> >- <ol> >- <li><h2>Merge invoices</h2></li> >- <li><table id="merge_table"> >- <thead><tr><th>Invoice no.</th><th>Shipment date</th><th>Billing date</th><th>Shipment cost</th></tr></thead> >- <tbody> >- </tbody> >- </table></li> >- <li><label for="merge_invoicenumber" class="required">Invoice number:</label> >- <input type="text" size="10" id="merge_invoicenumber" name="invoicenumber" value="" class="required" required="required" /> >- <span class="required">Required</span> >- </li> >- <li><label for="merge_shipmentdate">Shipment date:</label> >- <input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" class="datepicker" /></li> >+ <a class="submit merge" id="merge" href="#merge_invoices">Merge selected invoices</a> >+ [% IF tab == 'closed' %] >+ <a class="submit" id="open_sel" href="#reopen_selected" data-op="reopen" data-referer="referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber | uri %]%26supplier=[% booksellerid | uri %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn | uri %]%26title=[% title | uri %]%26author=[% author | uri %]%26publisher=[% publisher | uri %]%26publicationyear=[% publicationyear | uri %]%26branch=[% branch | uri %]"><i class="fa fa-refresh"></i> Reopen Selected Invoices</a> >+ [% ELSE %] >+ <a class="submit" id="close_sel" href="#close_selected" data-op="close" data-referer="referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber | uri %]%26supplier=[% booksellerid | uri %]%26shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]%26shipmentdateto=[% shipmentdateto | $KohaDates %]%26billingdatefrom=[% billingdatefrom | $KohaDates %]%26billingdateto=[% billingdateto | $KohaDates %]%26isbneanissn=[% isbneanissn | uri %]%26title=[% title | uri %]%26author=[% author | uri %]%26publisher=[% publisher | uri %]%26publicationyear=[% publicationyear | uri %]%26branch=[% branch | uri %]"><i class="fa fa-times-circle"></i> Close Selected Invoices</a> >+ [% END %] >+ >+ [% END %] <!-- invoices_table --> >+ <div id="invoicestabs" class="toptabs" style="clear:both;"> >+ <ul class="ui-tabs-nav"> >+ <li><a href="#opened">Open Invoices ([% openedinvoices.size || 0 | html %])</a></li> >+ <li><a href="#closed">Closed Invoices ([% closedinvoices.size || 0 | html %]) </a></li> >+ </ul> >+ <div id="opened"> >+ [% IF openedinvoices %] >+ [% INCLUDE invoices_table invoices = openedinvoices %] >+ [% ELSE %] >+ <div class="dialog message"> >+ <p>Your search returned no open invoices.</p> >+ </div> >+ [% END %] >+ </div> <!-- opened --> >+ <div id="closed"> >+ [% IF closedinvoices %] >+ [% INCLUDE invoices_table invoices = closedinvoices closed = 1 %] >+ [% ELSE %] >+ <div class="dialog message"> >+ <p>Your search returned no closed invoices.</p> >+ </div> >+ [% END %] >+ </div> <!-- closed --> >+ </div> <!-- invoicestabs --> >+ >+ >+ <div id="merge_invoices"> >+ <form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post"> >+ <fieldset class="rows"> >+ <ol> >+ <li><h2>Merge invoices</h2></li> >+ <li><table id="merge_table"> >+ <thead><tr><th>Invoice no.</th><th>Shipment date</th><th>Billing date</th><th>Shipment cost</th></tr></thead> >+ <tbody> >+ </tbody> >+ </table></li> >+ <li><label for="merge_invoicenumber" class="required">Invoice number:</label> >+ <input type="text" size="10" id="merge_invoicenumber" name="invoicenumber" value="" class="required" required="required" /> >+ <span class="required">Required</span> >+ </li> >+ <li><label for="merge_shipmentdate">Shipment date:</label> >+ <input type="text" size="10" id="merge_shipmentdate" name="shipmentdate" value="" class="datepicker" /></li> > > <li><label for="merge_billingdate">Billing date:</label> > <input type="text" size="10" id="merge_billingdate" name="billingdate" value="" class="datepicker" /></li> >@@ -317,10 +356,11 @@ > [% INCLUDE 'calendar.inc' %] > <script> > $(document).ready(function() { >+ $('#invoicestabs').tabs(); > $(".delete_invoice").click(function(){ > return confirmDelete(_("Are you sure you want to delete this invoice?")); > }); >- var resultst = $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, { >+ var resultst = $("table.result").dataTable($.extend(true, {}, dataTablesDefaults, { > bPaginate: false, > aoColumnDefs: [ > { "bSortable": false, "aTargets": [1, -1] }, >@@ -329,17 +369,29 @@ > ] > })); > >- $("#show_only_subscription").prop("checked", false); >+ $(".show_only_subscription").prop("checked", false); > >- $("#show_only_subscription").click(function(){ >+ $(".show_only_subscription").click(function(){ >+ var table_id = $(this).attr("data-tableid"); > if ( $(this).prop("checked") ) { >- resultst.fnFilter( "1", 0, true ); >+ $('#'+table_id).dataTable().fnFilter( "1", 0, true ); > } else { >- resultst.fnFilter( '', 0 ); >+ $('#'+table_id).dataTable().fnFilter( '', 0 ); > } > }); > >- $('#merge').click(function (ev) { >+ $('#open_sel,#close_sel').click(function () { >+ var referer = $(this).attr("data-referer"); >+ var op = $(this).attr("data-op"); >+ var invoice_link = "invoice.pl?op="+op; >+ $('.select-invoice:checked').each(function () { >+ var row = $(this).parents('tr'); >+ invoice_link = invoice_link + "&invoiceid="+$(row).attr('data-invoiceid'); >+ }); >+ window.location.href =invoice_link +"&"+referer; >+ }); >+ >+ $('.merge').click(function (ev) { > var booksellerid; > var mismatch; > var invoices = [ ]; >-- >2.11.0
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 22773
:
93357
|
93375
|
93448
|
93660
|
94411
|
95290
|
96906
|
96907
|
96908
|
96909
|
96910
|
98729
|
98730
|
98731
|
98732
|
98733
|
106538
|
106539
|
106540
|
106541
|
106542
|
106543
|
106544
|
115420
|
115421
|
115422
|
115423
|
115424
|
115425
|
115426
|
116010
|
119282
|
119283
|
119284
|
119285
|
119286
|
119287
|
119288
|
119289
|
119290