Bugzilla – Attachment 105329 Details for
Bug 25266
Not all vendors are listed in the filters on the late order claims page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25266: Build the vendor list from the order list
Bug-25266-Build-the-vendor-list-from-the-order-lis.patch (text/plain), 6.13 KB, created by
Katrin Fischer
on 2020-05-25 21:11:22 UTC
(
hide
)
Description:
Bug 25266: Build the vendor list from the order list
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-05-25 21:11:22 UTC
Size:
6.13 KB
patch
obsolete
>From 8e6540c848f0e285859a7e6a0a5324a55b0a6342 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 4 May 2020 13:13:56 +0200 >Subject: [PATCH] Bug 25266: Build the vendor list from the order list > >This patch is removing the use of GetBooksellersWithLateOrders and use >the late order list to generate the vendors. > >Test plan: >Create several vendors, several orders, close the baskets >Also create vendors that do not have orders (or basket not closed) >Go to the late orders page and confirm that the list of vendors is >correctly filled, select one, you can see the "select all" link in the >header of the table > >QA: that would be good to test this with production data and compare >execution time. > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > acqui/lateorders.pl | 32 ++++++++++------------ > .../prog/en/modules/acqui/lateorders.tt | 25 +++++++++-------- > 2 files changed, 29 insertions(+), 28 deletions(-) > >diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl >index 66ac704405..ff3ce70274 100755 >--- a/acqui/lateorders.pl >+++ b/acqui/lateorders.pl >@@ -68,7 +68,7 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user( > } > ); > >-my $booksellerid = $input->param('booksellerid') || undef; # we don't want "" or 0 >+my $booksellerid = $input->param('booksellerid'); > my $delay = $input->param('delay') // 0; > > # Get the "date from" param if !defined is today >@@ -133,23 +133,9 @@ push @parameters, $estimateddeliverydateto_dt > ? $estimateddeliverydateto_dt->ymd() > : undef; > >-my %supplierlist = GetBooksellersWithLateOrders(@parameters); >- >-my (@sloopy); # supplier loop >-foreach( sort { $supplierlist{$a} cmp $supplierlist{$b} } keys %supplierlist ) { >- push @sloopy, (($booksellerid and $booksellerid eq $_ ) ? >- {id=>$_, name=>$supplierlist{$_}, selected=>1} : >- {id=>$_, name=>$supplierlist{$_}} ) ; >-} >-$template->param(SUPPLIER_LOOP => \@sloopy); >- >-$template->param(Supplier=>$supplierlist{$booksellerid}) if ($booksellerid); >-$template->param(booksellerid=>$booksellerid) if ($booksellerid); >- >-my $lateorders = Koha::Acquisition::Orders->filter_by_lates( >+my @lateorders = Koha::Acquisition::Orders->filter_by_lates( > { > delay => $delay, >- booksellerid => $booksellerid, > ( > $estimateddeliverydatefrom_dt > ? ( estimated_from => $estimateddeliverydatefrom_dt ) >@@ -160,14 +146,26 @@ my $lateorders = Koha::Acquisition::Orders->filter_by_lates( > ? ( estimated_to => $estimateddeliverydateto_dt ) > : () > ) >+ }, >+)->as_list; >+ >+my $booksellers = Koha::Acquisition::Booksellers->search( >+ { >+ id => { >+ -in => map { $_->basket->booksellerid } @lateorders >+ }, > } > ); > >+@lateorders = grep { $_->basket->booksellerid eq $booksellerid } @lateorders if $booksellerid; >+ > my $letters = GetLetters({ module => "claimacquisition" }); > > $template->param(ERROR_LOOP => \@errors) if (@errors); > $template->param( >- lateorders => $lateorders, >+ lateorders => \@lateorders, >+ booksellers => $booksellers, >+ bookseller_filter => ( $booksellerid ? $booksellers->find($booksellerid) : undef), > delay => $delay, > letters => $letters, > estimateddeliverydatefrom => $estimateddeliverydatefrom, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >index 0851b2dc37..525016e305 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >@@ -21,7 +21,7 @@ > <div class="col-sm-10 col-sm-push-2"> > <main> > >-<h1>[% IF ( Supplier ) %][% Supplier | html %] : [% END %]Late orders</h1> >+<h1>[% IF bookseller_filter %][% bookseller_filter.name | html %] : [% END %]Late orders</h1> > <div id="acqui_lateorders"> > > [% IF error_claim %] >@@ -36,11 +36,11 @@ > [% IF info_claim %] > <div class="dialog message">Email has been sent.</div> > [% END %] >-[% IF lateorders.count %] >+[% IF lateorders.size %] > <form action="lateorders.pl" name="claim" method="post"> > <input type="hidden" name="op" value="send_alert" /> > <input type="hidden" name="delay" value="[% delay | html %]" /> >- <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" /> >+ <input type="hidden" name="booksellerid" value="[% bookseller_filter.id | html %]" /> > [% IF ( letters ) %] > <p><label for="letter_code">Claim using notice: </label><select name="letter_code" id="letter_code"> > [% FOREACH letter IN letters %] >@@ -53,7 +53,7 @@ > <table id="late_orders"> > <thead> > <tr> >- [% IF Supplier %] >+ [% IF bookseller_filter %] > <th><a id="CheckAll" href="#">Check all</a><br /><a id="CheckNone" href="#">Uncheck all</a></th> > [% ELSE %] > <th></th> >@@ -225,14 +225,17 @@ > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > >- <li><label for="booksellerid">Vendor:</label> >- <select id="booksellerid" size="1" tabindex="" name="booksellerid"> >+ <li><label for="booksellerid">Vendor:</label> >+ <select id="booksellerid" tabindex="" name="booksellerid"> > <option value=""></option> >- [% FOREACH SUPPLIER_LOO IN SUPPLIER_LOOP %] >- [% IF ( SUPPLIER_LOO.selected ) %]<option value="[% SUPPLIER_LOO.id | html %]" selected="selected">[% SUPPLIER_LOO.name | html %]</option> >- [% ELSE %]<option value="[% SUPPLIER_LOO.id | html %]">[% SUPPLIER_LOO.name | html %]</option>[% END %] >- [% END %] >- </select> >+ [% FOREACH bookseller IN booksellers %] >+ [% IF bookseller.id == bookseller_filter.id %] >+ <option value="[% bookseller.id | html %]" selected="selected">[% bookseller.name | html %]</option> >+ [% ELSE %] >+ <option value="[% bookseller.id | html %]">[% bookseller.name | html %]</option> >+ [% END %] >+ [% END %] >+ </select> > </ol> > <fieldset class="action"><input type="submit" value="Filter" /></fieldset> > </fieldset> >-- >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 25266
:
103596
|
104254
|
104255
|
104257
|
105321
|
105329
|
105330
|
105331
|
105592
|
105621
|
105622
|
105623
|
105624