Bugzilla – Attachment 108105 Details for
Bug 20150
Acquisitions wizard falsely uses list price for calculating amounts spent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20150: Try to fix Acquisitions wizard
Bug-20150-Try-to-fix-Acquisitions-wizard.patch (text/plain), 1.62 KB, created by
Jonathan Druart
on 2020-08-12 13:24:18 UTC
(
hide
)
Description:
Bug 20150: Try to fix Acquisitions wizard
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-08-12 13:24:18 UTC
Size:
1.62 KB
patch
obsolete
>From a6f986eff5bd080e4a0b9e5b9ecdfd3ff6dda1c1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 12 Aug 2020 15:22:50 +0200 >Subject: [PATCH] Bug 20150: Try to fix Acquisitions wizard > >It is always using listprice when we need to do the same math as the >acq home page. >This patch is reusing the queries from GetBudgetHierarchy >--- > reports/acquisitions_stats.pl | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/reports/acquisitions_stats.pl b/reports/acquisitions_stats.pl >index eb56a05b31..ecd93bf2c9 100755 >--- a/reports/acquisitions_stats.pl >+++ b/reports/acquisitions_stats.pl >@@ -445,8 +445,12 @@ sub calculate { > $strcalc .= "COUNT(*) "; > } elsif ( $process == 2 ) { > $strcalc .= "COUNT(DISTINCT(aqorders.biblionumber)) "; >- } elsif ( $process == 3 || $process == 4 || $process == 5 ) { >- $strcalc .= "SUM(aqorders.listprice) "; >+ } elsif ( $process == 3 ) { # Amount >+ $strcalc .= q|SUM(| . C4::Acquisition::get_rounding_sql(q|ecost_tax_included|) . q| * quantity ) + SUM(| . C4::Acquisition::get_rounding_sql(q|COALESCE(unitprice_tax_included, ecost_tax_included)|) . q| * quantity ) AS budget_total |; >+ } elsif ( $process == 4 ) { # Ordered >+ $strcalc .= q|SUM(| . C4::Acquisition::get_rounding_sql(q|ecost_tax_included|) . q| * quantity ) AS budget_ordered | >+ } elsif ( $process == 5 ) { # Spent >+ $strcalc .= q|SUM(| . C4::Acquisition::get_rounding_sql(q|COALESCE(unitprice_tax_included, ecost_tax_included)|) . q| * quantity ) AS budget_spent | > } else { > $strcalc .= "NULL "; > } >-- >2.20.1
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 20150
: 108105