Koha-clms/acqui
Christophe TORIN 9a1f544ca3
Bug 29607: Store the discount amount correctly when importing and order from a file
This bug fixes how the discount amount for an order is stored, when an order is added to a basket using "From staged MARC records".

Test plan:
1. Export a record (without the items) (Tools > Catalog > Export data).
2. Delete the record from the catalog (including any items).
3. Stage the record for import (Tools > Catalog > Stage MARC records for import).
4. Create a new vendor with a discount of 25%. (Or select and existing vendor that has a discount). (Acquisitions > New vendor)
5. Create a new basket for the vendor. (Acquisitions > Manage orders > search for vendors > New > Basket).
6. Add to the basket using "From a staged file":
   . select "Add orders" next to the staged file
   . select the record to add to the order
   . enter a price
   . leave the discount field blank
   . select a fund
   . select "Save"
   ==> The order is created!
7. Modify the order - note that the discount is showing on the form as .25% instead of 25%, also note that the discount amount is calculated correctly.
8. Check what is recorded in the database:
   . koha-mysql kohadev
   . select * from aqorders;
   ==> discount field for the basket item shows as 0.2500
9. Change the discount to 25%. Run step 8 again - discount amount will be correctly shown as 25.0000
10. Apply the patch.
11. Repeat steps 1-9 - discount amount is shown and calculated correctly.
12. Test modifying the discount amount - should be calculated and shown correctly.
13. Sign off!

See additional comments in the bug description.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f72b8cbd3e)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit a5f31c6e2e)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
2023-04-05 12:06:03 +02:00
..
acqui-home.pl Bug 29287: Add child funds to display of parent funds on acqui home 2022-03-04 08:12:35 -05:00
add_user_search.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
addorder.pl Bug 32457: Fix CGI vulnerability in addorder.pl 2023-01-26 11:31:19 +01:00
addorderiso2709.pl Bug 29607: Store the discount amount correctly when importing and order from a file 2023-04-05 12:06:03 +02:00
ajax-getauthvaluedropbox.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
basket.pl Bug 31001: Fix "CGI::param called in list context" warning in basket.pl 2022-08-16 11:49:42 +02:00
basketgroup.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
basketheader.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
booksellers.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
cancelorder.pl Bug 29658: Fix crash on cancelling cancelled order 2022-11-14 15:11:42 +01:00
check_budget_total.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
check_uniqueness.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
duplicate_orders.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
edi_ean.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
edifactmsgs.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
edimsg.pl Bug 17600: Fix tests 2021-07-16 09:47:01 +02:00
finishreceive.pl Bug 29771: Remove trivial cases 2022-03-11 06:35:45 -05:00
histsearch.pl Bug 32377: Set param skiptotals on call of GetBudgetHierarchy in acqui/histsearch.pl 2023-02-17 13:08:30 +01:00
invoice-files.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
invoice.pl Bug 24190: (QA follow-up) record unchanged bookfund and fix typo 2021-09-21 20:22:57 +02:00
invoices.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
lateorders-export.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
lateorders.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
modordernotes.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
neworderempty.pl Bug 29554: Do not hide display of itemtypes on neworderempty 2022-12-16 09:18:49 +01:00
newordersubscription.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
newordersuggestion.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ordered.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
orderreceive.pl Bug 31459: (follow-up) Preserve budget period display 2022-12-16 16:50:44 +01:00
parcel.pl Bug 17600: Fix tests 2021-07-16 09:47:01 +02:00
parcels.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
showorder.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
spent.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
supplier.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
transferorder.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
uncertainprice.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
updatesupplier.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
z3950_search.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00