Bugzilla – Attachment 49219 Details for
Bug 15997
Hold Ratios for ordered items doesn't count orders where AcqCreateItem is set to 'receiving'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15997 - Hold Ratios for ordered items doesn't count orders where AcqCreateItem is set to 'receiving'
Bug-15997---Hold-Ratios-for-ordered-items-doesnt-c.patch (text/plain), 2.36 KB, created by
Jonathan Druart
on 2016-03-16 12:11:38 UTC
(
hide
)
Description:
Bug 15997 - Hold Ratios for ordered items doesn't count orders where AcqCreateItem is set to 'receiving'
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-03-16 12:11:38 UTC
Size:
2.36 KB
patch
obsolete
>From d885661300e754f779899e5d1ed7754c493832a0 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 7 Mar 2016 14:04:44 +0000 >Subject: [PATCH] Bug 15997 - Hold Ratios for ordered items doesn't count > orders where AcqCreateItem is set to 'receiving' > >Currently, the hold ratios script only counts on order items where the >record item is created at the time the order is placed, and not if the >item is created when the item is received. > >Test Plan: >1) Set AcqCreateItem to recieving >2) Run the hold ratios report with "include ordered" checked >3) From aquisitions, order some additional items for the record >4) Re-run the hold ratios report, not there is no change in the ratio > for that record >5) Apply this patch >6) Re-run the hold ratios reporat again, the ratio should now have > changed > >Signed-off-by: Srdjan <srdjan@catalyst.net.nz> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > circ/reserveratios.pl | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > >diff --git a/circ/reserveratios.pl b/circ/reserveratios.pl >index bd51b7c..550bf30 100755 >--- a/circ/reserveratios.pl >+++ b/circ/reserveratios.pl >@@ -83,6 +83,16 @@ push @query_params, output_pref({ dt => $startdate, dateformat => 'iso' }) ; > $sqldatewhere .= " AND reservedate <= ?"; > push @query_params, output_pref({ dt => $enddate, dateformat => 'iso' }); > >+my $include_aqorders_qty = >+ C4::Context->preference('AcqCreateItem') eq 'receiving' >+ ? '+ COALESCE(aqorders.quantity, 0) - COALESCE(aqorders.quantityreceived, 0)' >+ : q{}; >+ >+my $include_aqorders_qty_join = >+ C4::Context->preference('AcqCreateItem') eq 'receiving' >+ ? 'LEFT JOIN aqorders ON reserves.biblionumber=aqorders.biblionumber' >+ : q{}; >+ > my $nfl_comparison = $include_ordered ? '<=' : '='; > my $strsth = > "SELECT reservedate, >@@ -107,10 +117,11 @@ my $strsth = > biblio.title, > biblio.author, > count(DISTINCT reserves.borrowernumber) as reservecount, >- count(DISTINCT items.itemnumber) as itemcount >+ count(DISTINCT items.itemnumber) $include_aqorders_qty as itemcount > FROM reserves > LEFT JOIN items ON items.biblionumber=reserves.biblionumber > LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber >+ $include_aqorders_qty_join > WHERE > notforloan $nfl_comparison 0 AND damaged = 0 AND itemlost = 0 AND withdrawn = 0 > $sqldatewhere >-- >2.7.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 15997
:
48748
|
49090
|
49151
| 49219