Add the ability to count items that will be available in the future when calculating holds ratios.
Created attachment 8806 [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.
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."
Kyle, i just realize that this conflict is not relevant. It should apply without errors. Have you this problem when applying the patch ?
Created attachment 11051 [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.
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)
(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.
Created attachment 11576 [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.
Small conflict, I think just textual
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.
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.
Please add a test plan.
Still valid?
(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 ***
Bug 15997 has been filed to replace the need for this bug patch.