Bug 18639 - Separate replacement cost and retail price fields in acquisitions
Summary: Separate replacement cost and retail price fields in acquisitions
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 13321
Blocks:
  Show dependency treegraph
 
Reported: 2017-05-19 12:52 UTC by Nick Clemens
Modified: 2018-01-04 18:21 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 18639 - Add replacementprice field to aqorders (2.29 KB, patch)
2017-12-29 16:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18639 - Schema updates (DO NOT PUSH) (1.57 KB, patch)
2017-12-29 16:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18639 - Add replacementprice field to acquisitions workflow (20.64 KB, patch)
2017-12-29 16:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18639 - Unit tests (3.44 KB, patch)
2017-12-29 16:52 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2017-05-19 12:52:15 UTC
Work to be done:

1 - Add a field 'replacementprice' to the aqorders table
2 - Display this field as 'Replacement price' when ordering
3 - Rename current 'Replacement price' field for orders to 'Retail price'
3a - 'Retail price' field will only be editable during initial ordering
3b - If 'Retail price' field is update, dependent fields will also be updated (currently they are only updated on change of 'lsit price')
4 - Allow for replacementprice to be populated via ItemFieldsToOrder preferences
5 - Adjust EDI scripts to allow for use of 'replacementprice' field
6 - Pass 'replacementprice' in aqorders through as 'items.replacementprice' when creating items
7 - aqorders.replacementprice should be editable throughout entire acquisitions workflow
Comment 1 Laurence Rault 2017-05-23 07:20:37 UTC
The trouble is that now the budgeted cost (ecost) is calculated based on Replacement cost (rrp) and not (not only in fact) from vendor price (listprice) anymore. And I think it may be bug : 

When you change rrp in an order, budgeted cost does not change in the form, but after validation, values in the table for budgeted cost are re-calculated against the modified rrp.


Maybe we should consider alternatives : 

1) make the budgeted cost only calculated from vendor price ; if rrp is modified, no effect on ecost (as it is still the case in Koha 3.22). And then make the rrp editable through the whole workflow. Would it be enough ?

2) I agree with your proposition, with some questions : 
- what would be the difference between Vendor price and Retail price ?
- I am not at all familiar with EDI, but is the replacementprice sent or received to/by the vendor ? I think vendor price and/or actual cost should be (maybe the are already).
Comment 2 Jonathan Druart 2017-06-19 21:01:46 UTC
I am not sure I will have time to work on this one.
Comment 3 Nick Clemens 2017-12-29 16:52:08 UTC
Created attachment 70213 [details] [review]
Bug 18639 - Add replacementprice field to aqorders
Comment 4 Nick Clemens 2017-12-29 16:52:11 UTC
Created attachment 70214 [details] [review]
Bug 18639 - Schema updates (DO NOT PUSH)
Comment 5 Nick Clemens 2017-12-29 16:52:15 UTC
Created attachment 70215 [details] [review]
Bug 18639 - Add replacementprice field to acquisitions workflow

To test:
 0 - Apply patches and updatedatabase
 1 - Add an order to a basket
 2 - You should note new 'Retail price field'
 3 - You should have a separate 'Replacement price' field
 4 - Enter values and ensure they are saved as expected
 5 - In the basket you should see the replacement price
 6 - Modify order and ensure value is loaded and saved correctly
 7 - Add and cancle an order and esure replacement price shows/saves
 8 - Close basket
 9 - Receive an order
10 - You should be able to edit replacement price
11 - 'retail price' field is not editable
12 - Check associated item, replacement price in item should be updated
13 - Cancel receipt, check item. receive again with new replacement
price, check item
14 - Price should be correctly updated
15 - Finish receipt, value should show in table
16 - Test with receive from file
Comment 6 Nick Clemens 2017-12-29 16:52:17 UTC
Created attachment 70216 [details] [review]
Bug 18639 - Unit tests
Comment 7 Nick Clemens 2017-12-29 16:54:17 UTC
Couple things:
3b - Not so much possible - retail price is calculated from listprice and is converted. Changing this field doesn't actually save either. I think we can just make this not editable - but that is for another bug report

5 - I need an EDI person to look at the scripts and update as needed

Otherwise I think this should work as expected