[Bug 33863] New: "change currency" always checked
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Bug ID: 33863 Summary: "change currency" always checked Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Acquisitions Assignee: jonathan.druart+koha@gmail.com Reporter: jonathan.druart+koha@gmail.com QA Contact: testopia@bugs.koha-community.org Depends on: 25655 On bug 25655 we stored the invoice currency and invoice price. The "change currency" checkbox should be checked only if the previous order (in case of partial receives) had it checked. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25655 [Bug 25655] Additionally store actual cost in foreign currency and currency from the invoice -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 151796 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151796&action=edit Bug 33863: (bug 25655 follow-up) Check "Change currency" only if checked before We should not check "Change currency" if it has not modified in the original order. Test plan: Create an order with 3+ items Receive 1 item, don't check "change currency" Receive an other item => "Change currency" is not checked Check "Change currency", modify the currency and the price Receive a third item => Change currency is checked, invoice currency and price are set correctly to the previous values -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|"change currency" always |On receive "change |checked |currency" is always checked -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I tried testing, but the 'Confirm' button always remains locked/inactive, so I can't receive the first item. Could this have to do with one of the other bugs? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I set quantity received, checked the "change currency", entered price and changed currency. Order line had create items while cataloguing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |33864 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Katrin Fischer from comment #2)
I tried testing, but the 'Confirm' button always remains locked/inactive, so I can't receive the first item.
Could this have to do with one of the other bugs?
This appears to be fixed by bug 33864, making them dependent for now. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33864 [Bug 33864] Problems in order receive modal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- It almost works: Test plan: Create an order with 3+ items Receive 1 item, don't check "change currency" Receive an other item => "Change currency" is not checked Check "Change currency", modify the currency and the price Receive a third item => Change currency is checked, invoice currency and price are set correctly to the previous values This works as described, but in the last step, the "Actual cost" is 0 and it should have the calculated price from the foreign currency. You need to click into the field and add a space or so to trigger the JS. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Skipping this for 23.05.00, back later. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I think this patch is correct and what Katrin describes is an other bug (unitprice retrieved from parent order but not adjusted from already received order, when invoice_unitprice is stored in the parent order). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Talked to Jonathan about this and trying to summarize: * When we do a partial receive, the order lines are split into a parent and a child order line. The child is the one that is set to received, the parent remains. * But we do store some values in the parent order from the first receive: parent order has: unitprice: 0.000000 invoice_unitprice: 42.000000 invoice_currency: EUR Received child order line: unitprice: 36.710000 invoice_unitprice: 42.000000 invoice_currency: EUR * So we can check the checkbox and set the foreign currency and original price, but the actual cost remains empty that would be pulled from unitprice, if it was set. I think we could trigger the JS on opening the page if the actual cost was empty, filling in the actual cost with the calculated price in active currency. I am only worried about one use case: * Create a basket, create an order line, fill in "actual cost" on the order form * Receive the first item and set original price etc. * What happens to the actual cost in the parent? Does it remain the original value from ordering or is it updated? I assume it remains. * Receive the next item: original price would show as entered previously, but the actual cost would not be calculated from it, but be the one entered at order time. Could this be confusing? I can think of some ways to resolve: a) Store not only the original price (invoice_unitprice) in the parent, but also the unitprice. BUT: exchange rates might change between receives. So we'd still want to recalculate the unitprice on receive with the current exchange rate. Storing it doesn't seem to give us an advantage. b) When receiving, automatically calculate the actual cost (unitprice) from the invoice_unitprice with the current exchange rate (trigger JS). I'd do this independently if unitprice was set or not, so there is a relation between the original price (invoice_unitprice) we see and the actual cost (unitprice) c) Don't store the invoice_unitprice in the parent. People will need to enter it, calculation is triggered. An existing actual cost value might show before the value is entered. I think we can scratch a). b) or c)? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jonathan Druart from comment #7)
I think this patch is correct and what Katrin describes is an other bug (unitprice retrieved from parent order but not adjusted from already received order, when invoice_unitprice is stored in the parent order).
I disagree. The problem appears because we are trying to pre-set values that might not match up (unitprice and invoice_unitprice should depend on each other, being calculated from current exchange rate) Without this change, we don't have the problem. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- The problem here is that the checkbox is always checked. I think we should fix that for 23.05.00. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jonathan Druart from comment #10)
The problem here is that the checkbox is always checked. I think we should fix that for 23.05.00.
Ok, yes, we could uncheck it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Bug 33863 depends on bug 33864, which changed state. Bug 33864 Summary: Problems in order receive modal https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33864 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |black23@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michaela.sieber@kit.edu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #12 from Michaela Sieber <michaela.sieber@kit.edu> --- (In reply to Jonathan Druart from comment #0)
On bug 25655 we stored the invoice currency and invoice price. The "change currency" checkbox should be checked only if the previous order (in case of partial receives) had it checked.
I agree. And you fixed that with the existing patch (2023-05-30) BUT : if you uncheck the 'change currency' this does not trigger a change of the invoice_currency back to the "normally" (=active) used currency in the system. If you want to switch back to the active system currency you first have to select that currency from the drop down and THEN deactivate the checkbox 'Change currency' This behavior requires very good documenting! The use case could be a vendor change of a standing order (e.g. for serials) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #13 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 153043 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153043&action=edit Bug 33863: Reset value if checkbox is unchecked -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #14 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Thanks for you comment, Michaela. What about this patch? Will it make the behaviour less confusing? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #15 from Michaela Sieber <michaela.sieber@kit.edu> --- (In reply to Jonathan Druart from comment #14)
Thanks for you comment, Michaela. What about this patch? Will it make the behaviour less confusing?
No sorry, there is no change. invoice_currency remains the old value in the database if you do not change the currency code before deactivating the checkbox "change currency". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #16 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 153306 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153306&action=edit Bug 33863: Update values in data that will be saved We are not saving the values of the input but a representation of the form, contains in $("#order_edit").data('row'); To acchieve that it's preferable to reuse _update_unitprice and call it when #change_currency is modified. Some code cleaning slipped into the patch, for readability purpose. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #17 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Oops, sorry Michaela. It seems that I have not properly tested the second patch. I've caught several inconsistencies in the code and tried to clean them in the last patch. I think the problem is fixed now, can you retest please? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 PTFS Europe Sandboxes <sandboxes@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #151796|0 |1 is obsolete| | --- Comment #18 from PTFS Europe Sandboxes <sandboxes@ptfs-europe.com> --- Created attachment 153341 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153341&action=edit Bug 33863: (bug 25655 follow-up) Check "Change currency" only if checked before We should not check "Change currency" if it has not modified in the original order. Test plan: Create an order with 3+ items Receive 1 item, don't check "change currency" Receive an other item => "Change currency" is not checked Check "Change currency", modify the currency and the price Receive a third item => Change currency is checked, invoice currency and price are set correctly to the previous values Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 PTFS Europe Sandboxes <sandboxes@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153043|0 |1 is obsolete| | --- Comment #19 from PTFS Europe Sandboxes <sandboxes@ptfs-europe.com> --- Created attachment 153342 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153342&action=edit Bug 33863: Reset value if checkbox is unchecked Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 PTFS Europe Sandboxes <sandboxes@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153306|0 |1 is obsolete| | --- Comment #20 from PTFS Europe Sandboxes <sandboxes@ptfs-europe.com> --- Created attachment 153343 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153343&action=edit Bug 33863: Update values in data that will be saved We are not saving the values of the input but a representation of the form, contains in $("#order_edit").data('row'); To acchieve that it's preferable to reuse _update_unitprice and call it when #change_currency is modified. Some code cleaning slipped into the patch, for readability purpose. Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Michaela Sieber <michaela.sieber@kit.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #21 from Michaela Sieber <michaela.sieber@kit.edu> --- (In reply to Jonathan Druart from comment #17)
I think the problem is fixed now, can you retest please?
Thanks for fixing , Signed Off :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #153341|0 |1 is obsolete| | Attachment #153342|0 |1 is obsolete| | Attachment #153343|0 |1 is obsolete| | --- Comment #22 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 153402 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153402&action=edit Bug 33863: (bug 25655 follow-up) Check "Change currency" only if checked before We should not check "Change currency" if it has not modified in the original order. Test plan: Create an order with 3+ items Receive 1 item, don't check "change currency" Receive an other item => "Change currency" is not checked Check "Change currency", modify the currency and the price Receive a third item => Change currency is checked, invoice currency and price are set correctly to the previous values Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #23 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 153403 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153403&action=edit Bug 33863: Reset value if checkbox is unchecked Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #24 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 153404 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153404&action=edit Bug 33863: Update values in data that will be saved We are not saving the values of the input but a representation of the form, contains in $("#order_edit").data('row'); To acchieve that it's preferable to reuse _update_unitprice and call it when #change_currency is modified. Some code cleaning slipped into the patch, for readability purpose. Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #25 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.11.00 |23.11.00,23.05.02 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 --- Comment #26 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for all the hard work! Pushed to 23.05.x for the next release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33863 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED CC| |matt.blenkinsop@ptfs-europe | |.com Status|Pushed to stable |RESOLVED --- Comment #27 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Missing dependencies - not backporting to 22.11.x Nice work everyone! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org