Bug 34305 - If actual cost is negative, wrong price will display in the acq details tab
Summary: If actual cost is negative, wrong price will display in the acq details tab
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Katrin Fischer
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-18 14:30 UTC by Katrin Fischer
Modified: 2023-12-28 20:47 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.03,22.11.09


Attachments
Bug 34305: Account for negative prices on acq details tab (1.90 KB, patch)
2023-07-18 14:52 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 34305: Account for negative prices on acq details tab (1.97 KB, patch)
2023-07-18 19:12 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 34305: Account for negative prices on acq details tab (2.07 KB, patch)
2023-08-04 09:57 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2023-07-18 14:30:01 UTC
The acq detail tab shows either the unitprice (actual price) or the ecost (estimated price) depending on if one or the other is set. The check for this is wrong when the actual price is a negative value (see bug 34170).
Comment 1 Katrin Fischer 2023-07-18 14:52:27 UTC
Created attachment 153610 [details] [review]
Bug 34305: Account for negative prices on acq details tab

The acquisition detail tab shows the estimated cost while
the order is still pending and the actual price, once received.
At least the tool tip on the table header row says so. This
was not working correctly.

To test:
* Create a basket
* Create a new order line with a negative list price (credit)
* Close the basket
* Verify that the price shows correctly in the acquisition details
  tab on the record
* Receive the order and enter a different negative actual price.
* Reload detail view, verify it still shows the estimcated price
* Apply patch, restart_all
* Verify now the correct actual price displays
* Create another basket and order line
* Verify while not yet received, it still shows the estimaed price
Comment 2 Caroline Cyr La Rose 2023-07-18 19:12:20 UTC
Created attachment 153621 [details] [review]
Bug 34305: Account for negative prices on acq details tab

The acquisition detail tab shows the estimated cost while
the order is still pending and the actual price, once received.
At least the tool tip on the table header row says so. This
was not working correctly.

To test:
* Create a basket
* Create a new order line with a negative list price (credit)
* Close the basket
* Verify that the price shows correctly in the acquisition details
  tab on the record
* Receive the order and enter a different negative actual price.
* Reload detail view, verify it still shows the estimated price
* Apply patch, restart_all
* Verify now the correct actual price displays
* Create another basket and order line
* Verify while not yet received, it still shows the estimated price

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 3 Caroline Cyr La Rose 2023-07-18 19:14:23 UTC
For testing, it's easier if either the AcqCreateItem is on cataloguing the record, or when creating the basket, you choose to create items when cataloguing the record... It's just easier not to have to create the item at all for credits :)
Comment 4 Marcel de Rooy 2023-08-04 09:57:38 UTC
Created attachment 154257 [details] [review]
Bug 34305: Account for negative prices on acq details tab

The acquisition detail tab shows the estimated cost while
the order is still pending and the actual price, once received.
At least the tool tip on the table header row says so. This
was not working correctly.

To test:
* Create a basket
* Create a new order line with a negative list price (credit)
* Close the basket
* Verify that the price shows correctly in the acquisition details
  tab on the record
* Receive the order and enter a different negative actual price.
* Reload detail view, verify it still shows the estimated price
* Apply patch, restart_all
* Verify now the correct actual price displays
* Create another basket and order line
* Verify while not yet received, it still shows the estimated price

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Tomás Cohen Arazi 2023-08-15 12:20:10 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 6 Fridolin Somers 2023-08-17 20:17:48 UTC
Pushed to 23.05.x for 23.05.03
Comment 7 Pedro Amorim 2023-08-18 13:51:07 UTC
Nice work everyone!

Pushed to 22.11.x for next release