Bugzilla – Attachment 156065 Details for
Bug 31631
Optionally choose for tax-exclusive values to be used for calculating fund values (spent, ordered)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31631: (follow-up) Use CalculateFundValuesIncludingTax when modifying existing order
Bug-31631-follow-up-Use-CalculateFundValuesIncludi.patch (text/plain), 1.78 KB, created by
Kyle M Hall (khall)
on 2023-09-22 10:57:58 UTC
(
hide
)
Description:
Bug 31631: (follow-up) Use CalculateFundValuesIncludingTax when modifying existing order
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-09-22 10:57:58 UTC
Size:
1.78 KB
patch
obsolete
>From 846799650465c085ccf1da91ef463e153a8acea4 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 25 Oct 2022 03:08:03 +0000 >Subject: [PATCH] Bug 31631: (follow-up) Use CalculateFundValuesIncludingTax > when modifying existing order > >This patch depends on Bug 31840. > >To test: >1) Edit an order and increase the price so that you would expect it to >trigger a warning that you will exceed the amount allowed for this Fund >2) Confirm the warning is triggered > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > acqui/addorder.pl | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > >diff --git a/acqui/addorder.pl b/acqui/addorder.pl >index 7297cbb4a0d..c5b9847b019 100755 >--- a/acqui/addorder.pl >+++ b/acqui/addorder.pl >@@ -129,7 +129,7 @@ use C4::Biblio qw( > TransformHtmlToXml > TransformKohaToMarc > ); >-use C4::Budgets qw( GetBudget GetBudgetSpent GetBudgetOrdered ); >+use C4::Budgets qw( GetBudget GetBudgetSpent GetBudgetOrdered FieldsForCalculatingFundValues ); > use C4::Items qw( AddItemFromMarc ); > use C4::Output qw( output_html_with_http_headers ); > use C4::Log qw( logaction ); >@@ -162,7 +162,10 @@ unless($confirm_budget_exceeding) { > if ( $ordernumber ) { > # modifying an existing order so remove order price from $budget_ordered > my $order = Koha::Acquisition::Orders->find($ordernumber); >- $budget_ordered = $budget_ordered - ( $order->ecost_tax_included * $order->quantity ); >+ >+ # get correct unitprice and ecost fields >+ my ( $unitprice_field, $ecost_field ) = FieldsForCalculatingFundValues(); >+ $budget_ordered = $budget_ordered - ( $order->$ecost_field * $order->quantity ); > } > > my $budget_used = $budget_spent + $budget_ordered; >-- >2.30.2
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 31631
:
141017
|
141018
|
141019
|
142597
|
142661
|
143156
|
143157
|
143158
|
143159
|
147011
|
147012
|
147013
|
147014
|
147015
|
147098
|
147099
|
147100
|
147101
|
147102
|
147103
|
147104
|
147105
|
150146
|
156062
|
156063
|
156064
| 156065 |
156066
|
156067
|
156068
|
156069