Almost all our library consortiums have large amounts of late orders. Smallest amount is around 2000, but largest is over 25000. Even with batch of 2000 orders, lateorders.pl takes over 40 seconds to open. Handling larger batches eventually leads to a Proxy error. One (quite easy imo) way to speed up fetching late orders is to add a syspref to set default value for late order filter "Order date: [] days ago".
Created attachment 144145 [details] [review] Bug 32266: Add new syspref DefaultLateOrderFilterDaysAgo Some libraries might have large amounts of late orders that slow down opening the lateorders.pl. E.g. patch of 2000 orders takes about 40 seconds to open, larger patches lead to a proxy error. This patch adds new syspref DefaultLateOrderFilterDaysAgo. With this libraries can control how many days old late orders should be for them to show in late orders listing. To test: 1. Open browsers console (F12) and from there Network tab. 2. Navigate to Acquisitions -> Late Orders. => Take a note from browsers console how long it takes to open late orders listing. 3. Apply this patch, update you database and restart your services if needed. 4. Set some value to syspref DefaultLateOrderFilterDaysAgo (999 is max). 5. Load Late orders page again. => Loading page should now be significantly faster. => Only orders which Sponsored-by: Koha-Suomi Oy
Created attachment 144165 [details] [review] Bug 32266: Add new syspref DefaultLateOrderFilterDaysAgo To test: 1. Open browsers console (F12) and from there Network tab. 2. Navigate to Acquisitions -> Late Orders. => Take a note from browsers console how long it takes to open late orders listing. 3. Apply this patch, update you database and restart your services if needed. 4. Set some value to syspref DefaultLateOrderFilterDaysAgo (999 is max). 5. Load Late orders page again. Nice enhancement.
Created attachment 144699 [details] [review] Bug 32266: Add new syspref DefaultLateOrderFilterDaysAgo Some libraries might have large amounts of late orders that slow down opening the lateorders.pl. E.g. patch of 2000 orders takes about 40 seconds to open, larger patches lead to a proxy error. This patch adds new syspref DefaultLateOrderFilterDaysAgo. With this libraries can control how many days old late orders should be for them to show in late orders listing. To test: 1. Open browsers console (F12) and from there Network tab. 2. Navigate to Acquisitions -> Late Orders. => Take a note from browsers console how long it takes to open late orders listing. 3. Apply this patch, update you database and restart your services if needed. 4. Set some value to syspref DefaultLateOrderFilterDaysAgo (999 is max). 5. Load Late orders page again. => Loading page should now be significantly faster. => Only orders which Sponsored-by: Koha-Suomi Oy Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
I understand where this is coming from, but we should really just copy and paste the API-based paginated orders table from parcel.tt and change some query parameters to match this use case... I can help if needed.
(In reply to Tomás Cohen Arazi from comment #4) > I understand where this is coming from, but we should really just copy and > paste the API-based paginated orders table from parcel.tt and change some > query parameters to match this use case... > > I can help if needed. That is definitely a better solution in a long run. My plan was to first provide syspref as a simpler solution and then examine if we can optimize code in a different bug. I'll try adding that paginated table here and ask help if there are any problems.
I haven't been able to work with this and probably won't be a long time. Removing myself from assigned so if someone is able to take a look at this feel free to do so.