Bug 7887 - Add Option To Include Items That Will Be Available When Calculating Holds Ratios
Summary: Add Option To Include Items That Will Be Available When Calculating Holds Ratios
Status: RESOLVED DUPLICATE of bug 13298
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Kyle M Hall
QA Contact: Ian Walls
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-03 13:26 UTC by Kyle M Hall
Modified: 2016-03-07 14:03 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 7887 - Add Option To Include Items That Will Be Available When Calculating Holds Ratios (5.60 KB, patch)
2012-04-03 13:29 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7887 - Add Option To Include Items That Will Be Available When Calculating Holds Ratios (5.60 KB, patch)
2012-07-20 14:43 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7887 - Followup - Make use of aqorders conditional. Use COALESCE to prevent NULL addition. (1.75 KB, patch)
2012-08-13 13:09 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7887 - Add Option To Include Items That Will Be Available When Calculating Holds Ratios (5.60 KB, patch)
2013-01-17 16:50 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 7887 - Followup - Make use of aqorders conditional. Use COALESCE to prevent NULL addition. (1.92 KB, patch)
2013-01-17 16:51 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2012-04-03 13:26:30 UTC
Add the ability to count items that will be available in the future when calculating holds ratios.
Comment 1 Kyle M Hall 2012-04-03 13:29:32 UTC Comment hidden (obsolete)
Comment 2 Alex Arnaud 2012-06-11 13:29:30 UTC
This patch doesn't apply using 3-way merge.

"CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/reserveratios.tt
Failed to merge in the changes."
Comment 3 Alex Arnaud 2012-06-11 13:51:33 UTC
Kyle, i just realize that this conflict is not relevant. It should apply without errors.
Have you this problem when applying the patch ?
Comment 4 Kyle M Hall 2012-07-20 14:43:21 UTC Comment hidden (obsolete)
Comment 5 Julian Maurice 2012-08-10 11:57:33 UTC
1. from patch:
+my $not_for_loan_comparison = ( $include_will_be_available ) ? "<=" : "=";
...
+notforloan $not_for_loan_comparison 0 AND damaged = 0 AND itemlost = 0 AND wthdrawn = 0

In which case notforloan will be lesser than 0?

2. As use of aqorders table is conditional, I think the join should be conditionnal too.

3. I get "Illegal division by zero at /home/julian/koha/versions/community-master/circ/reserveratios.pl line 155." when checking "Include on order items".
It seems that x+NULL = NULL with MySQL. I think it can be fixed with (2)

Failed QA for (3)
Comment 6 Kyle M Hall 2012-08-13 13:06:12 UTC
(In reply to comment #5)
> 1. from patch:
> +my $not_for_loan_comparison = ( $include_will_be_available ) ? "<=" : "=";
> ...
> +notforloan $not_for_loan_comparison 0 AND damaged = 0 AND itemlost = 0 AND
> wthdrawn = 0
> 
> In which case notforloan will be lesser than 0?

Yes, a notforloan value of less than 0 indicates an item will eventually be available.

> 2. As use of aqorders table is conditional, I think the join should be
> conditionnal too.
> 
> 3. I get "Illegal division by zero at
> /home/julian/koha/versions/community-master/circ/reserveratios.pl line 155."
> when checking "Include on order items".
> It seems that x+NULL = NULL with MySQL. I think it can be fixed with (2)
> 
> Failed QA for (3)

Will fix.
Comment 7 Kyle M Hall 2012-08-13 13:09:10 UTC Comment hidden (obsolete)
Comment 8 Chris Cormack 2013-01-13 00:25:41 UTC
Small conflict, I think just textual
Comment 9 Kyle M Hall 2013-01-17 16:50:36 UTC
Created attachment 14678 [details] [review]
Bug 7887 - Add Option To Include Items That Will Be Available When Calculating Holds Ratios

This commit adds the ability to include items that are on order in the
aquisitions module, and items whose notforloan attribute is less than
1 ( i.e. will be available in the future ) when calculating holds ratios.
Comment 10 Kyle M Hall 2013-01-17 16:51:13 UTC
Created attachment 14679 [details] [review]
Bug 7887 - Followup - Make use of aqorders conditional. Use COALESCE to prevent NULL addition.

COALESCE is an ANSI-compliant SQL function, which returns the first
non-null value passed to it. I have verified it is available in both
MySQL and Postgres.
Comment 11 Owen Leonard 2013-03-19 01:06:16 UTC
Please add a test plan.
Comment 12 Marc Véron 2015-12-20 16:30:38 UTC
Still valid?
Comment 13 Kyle M Hall 2016-03-07 13:44:17 UTC
(In reply to Marc Véron from comment #12)
> Still valid?

Half valid. The ability to count on order items was added with another patch, but only if items are created at the time of ordering. I will close this bug out and open a new one to add just that additional functionality.

*** This bug has been marked as a duplicate of bug 13298 ***
Comment 14 Kyle M Hall 2016-03-07 14:03:56 UTC
Bug 15997 has been filed to replace the need for this bug patch.