Bugzilla – Attachment 143023 Details for
Bug 31840
Incorrect warning that order total amount exceeds allowed budget when editing existing order
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31840: Consider current cost if modifying order
Bug-31840-Consider-current-cost-if-modifying-order.patch (text/plain), 2.52 KB, created by
Katrin Fischer
on 2022-11-02 17:51:16 UTC
(
hide
)
Description:
Bug 31840: Consider current cost if modifying order
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2022-11-02 17:51:16 UTC
Size:
2.52 KB
patch
obsolete
>From 9ad67ccbee512dcd36233c7ae24613cd1e958201 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 17 Oct 2022 02:16:58 +0000 >Subject: [PATCH] Bug 31840: Consider current cost if modifying order > >This patch deducts the current cost of an order if modifying it, so that >the current cost isn't counted when checking whether the updated cost >will take the order total amount above the allowed budget. > >To test: >1. Add an active budget of $1,000 >2. Attach a fund of $1,000. Set the fund to warn at 98% and $900. >3. Add an order to a basket, give it a vendor price of $500 with no >discount or tax and Save >4. Modify the order and change the vendor price to $450 and Save >5. Notice you get a warning that this order total amount will exceed the >allowed budget - this is incorrect. >6. Apply the patch and cancel the change so you're redirected back to >the basket >7. Modify the order and change the vendor price to $450 and Save >8. You should be able to Save without requiring confirmation >9. Add another order to the basket, give it a vendor price of $100 with >no discount or tax and Save. This should save normally, confirming we >can add new orders that do not exceed the allowed budget >10. Add another order to the basket, give it a vendor price of $500 with >no discount or tax and Save. This should trigger the warning that you >will exceed the allowed budget, as expected. > >Sponsored-by: Waikato Institute of Technology > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > acqui/addorder.pl | 8 ++++++++ > 1 file changed, 8 insertions(+) > >diff --git a/acqui/addorder.pl b/acqui/addorder.pl >index 98e3acbe6d..d0ac3cbe2f 100755 >--- a/acqui/addorder.pl >+++ b/acqui/addorder.pl >@@ -155,6 +155,14 @@ unless($confirm_budget_exceeding) { > my $budget = GetBudget($budget_id); > my $budget_spent = GetBudgetSpent($budget_id); > my $budget_ordered = GetBudgetOrdered($budget_id); >+ >+ my $ordernumber = $input->param('ordernumber'); >+ 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 ); >+ } >+ > my $budget_used = $budget_spent + $budget_ordered; > my $budget_remaining = $budget->{budget_amount} - $budget_used; > my $budget_encumbrance = $budget->{budget_amount} * $budget->{budget_encumb} / 100; >-- >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 31840
:
141949
|
142129
| 143023