Bugzilla – Attachment 56893 Details for
Bug 13324
[DEPENDS_ON_13321] The fund values must be based on tax included values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13324: The fund values should be based on tax included values
Bug-13324-The-fund-values-should-be-based-on-tax-i.patch (text/plain), 3.65 KB, created by
Nick Clemens (kidclamp)
on 2016-10-27 00:55:11 UTC
(
hide
)
Description:
Bug 13324: The fund values should be based on tax included values
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2016-10-27 00:55:11 UTC
Size:
3.65 KB
patch
obsolete
>From 75d5bd43a3564385ce2db3fff027e17ff21dbc2b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 18 Nov 2014 17:07:45 +0100 >Subject: [PATCH] Bug 13324: The fund values should be based on tax included > values > >Now we have a column in DB to easily retrieve the tax included values. >So the sum must be done this the _tax_included DB field and not on the >"old" field. >The old field can be tax excluded or tax included depending the supplier >configuration. > >Test plan: >Verify that the values in the acqui home and budgets page are the tax >included values. > >Signed-off-by: Laurence Rault <laurence.rault@biblibre.com> > >Signed-off-by: Francois Charbonnier <francois.charbonnier@inlibro.com> > >Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr> >Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Budgets.pm | 20 +++++++++++--------- > 1 file changed, 11 insertions(+), 9 deletions(-) > >diff --git a/C4/Budgets.pm b/C4/Budgets.pm >index d0c4400..b7b1233 100644 >--- a/C4/Budgets.pm >+++ b/C4/Budgets.pm >@@ -212,7 +212,7 @@ sub GetBudgetsPlanCell { > # get the actual amount > $sth = $dbh->prepare( qq| > >- SELECT SUM(ecost) AS actual FROM aqorders >+ SELECT SUM(ecost_tax_included) AS actual FROM aqorders > WHERE budget_id = ? AND > entrydate like "$cell->{'authvalue'}%" | > ); >@@ -221,7 +221,7 @@ sub GetBudgetsPlanCell { > # get the actual amount > $sth = $dbh->prepare( qq| > >- SELECT SUM(ecost) FROM aqorders >+ SELECT SUM(ecost_tax_included) FROM aqorders > LEFT JOIN aqorders_items > ON (aqorders.ordernumber = aqorders_items.ordernumber) > LEFT JOIN items >@@ -233,7 +233,7 @@ sub GetBudgetsPlanCell { > # get the actual amount > $sth = $dbh->prepare( qq| > >- SELECT SUM( ecost * quantity) AS actual >+ SELECT SUM( ecost_tax_included * quantity) AS actual > FROM aqorders JOIN biblioitems > ON (biblioitems.biblionumber = aqorders.biblionumber ) > WHERE aqorders.budget_id = ? and itemtype = ? | >@@ -246,7 +246,7 @@ sub GetBudgetsPlanCell { > # get the actual amount > $sth = $dbh->prepare( qq| > >- SELECT SUM(ecost * quantity) AS actual >+ SELECT SUM(ecost_tax_included * quantity) AS actual > FROM aqorders > JOIN aqbudgets ON (aqbudgets.budget_id = aqorders.budget_id ) > WHERE aqorders.budget_id = ? AND >@@ -325,10 +325,12 @@ sub ModBudgetPlan { > > # ------------------------------------------------------------------- > sub GetBudgetSpent { >- my ($budget_id) = @_; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare(qq| >- SELECT SUM( COALESCE(unitprice, ecost) * quantity ) AS sum FROM aqorders >+ my ($budget_id) = @_; >+ my $dbh = C4::Context->dbh; >+ # unitprice_tax_included should always been set here >+ # we should not need to retrieve ecost_tax_included >+ my $sth = $dbh->prepare(qq| >+ SELECT SUM( COALESCE(unitprice_tax_included, ecost_tax_included) * quantity ) AS sum FROM aqorders > WHERE budget_id = ? AND > quantityreceived > 0 AND > datecancellationprinted IS NULL >@@ -354,7 +356,7 @@ sub GetBudgetOrdered { > my ($budget_id) = @_; > my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare(qq| >- SELECT SUM(ecost * quantity) AS sum FROM aqorders >+ SELECT SUM(ecost_tax_included * quantity) AS sum FROM aqorders > WHERE budget_id = ? AND > quantityreceived = 0 AND > datecancellationprinted IS NULL >-- >2.1.4
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 13324
:
33795
|
47497
|
48873
|
56437
| 56893