Bug 38303

Summary: Item's replacement price not set to defaultreplacecost if 0.00
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: AcquisitionsAssignee: Jonathan Druart <jonathan.druart>
Status: Pushed to main --- QA Contact: Aleisha Amohia <aleisha>
Severity: normal    
Priority: P5 - low CC: aleisha, tomascohen
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37943
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Attachments: Bug 38303: Set item's replacement price to defaultreplacecost if 0.00
Bug 38303: Set item's replacement price to defaultreplacecost if 0.00
Bug 38303: Set item's replacement price to defaultreplacecost if 0.00

Description Jonathan Druart 2024-10-30 15:36:54 UTC
Caught by a failing test

t/db_dependent/Circulation/CalcFine.t .. 1/7 
    #   Failed test 'Amount is calculated correctly'
    #   at t/db_dependent/Circulation/CalcFine.t line 271.
    #          got: '0'
    #     expected: '6'
    # Looks like you failed 1 test of 2.

introduced by bug 37943
Comment 1 Jonathan Druart 2024-10-30 15:39:00 UTC
Created attachment 173722 [details] [review]
Bug 38303: Set item's replacement price to defaultreplacecost if 0.00

No idea if this is a real bug. This code is fixing the following test
failure:
t/db_dependent/Circulation/CalcFine.t .. 1/7
    #   Failed test 'Amount is calculated correctly'
    #   at t/db_dependent/Circulation/CalcFine.t line 271.
    #          got: '0'
    #     expected: '6'
    # Looks like you failed 1 test of 2.
Comment 2 David Nind 2024-10-30 17:03:27 UTC
Created attachment 173730 [details] [review]
Bug 38303: Set item's replacement price to defaultreplacecost if 0.00

No idea if this is a real bug. This code is fixing the following test
failure:
t/db_dependent/Circulation/CalcFine.t .. 1/7
    #   Failed test 'Amount is calculated correctly'
    #   at t/db_dependent/Circulation/CalcFine.t line 271.
    #          got: '0'
    #     expected: '6'
    # Looks like you failed 1 test of 2.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Tomás Cohen Arazi (tcohen) 2024-10-30 19:11:38 UTC
Not sure how, but bisecting pointed to bug 37943.
Comment 4 Jonathan Druart 2024-10-30 19:50:30 UTC
Yes, because of the discard_changes call.
Comment 5 Tomás Cohen Arazi (tcohen) 2024-10-30 22:49:43 UTC
(In reply to Jonathan Druart from comment #4)
> Yes, because of the discard_changes call.

Isn't this highlighting something else?
Comment 6 Aleisha Amohia 2024-10-31 04:57:42 UTC
Created attachment 173746 [details] [review]
Bug 38303: Set item's replacement price to defaultreplacecost if 0.00

No idea if this is a real bug. This code is fixing the following test
failure:
t/db_dependent/Circulation/CalcFine.t .. 1/7
    #   Failed test 'Amount is calculated correctly'
    #   at t/db_dependent/Circulation/CalcFine.t line 271.
    #          got: '0'
    #     expected: '6'
    # Looks like you failed 1 test of 2.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Comment 7 Jonathan Druart 2024-10-31 08:27:14 UTC
(In reply to Tomás Cohen Arazi (tcohen) from comment #5)
> (In reply to Jonathan Druart from comment #4)
> > Yes, because of the discard_changes call.
> 
> Isn't this highlighting something else?

Maybe, but I didn't find anything bad. It highlighted this problem at least.
Comment 8 Katrin Fischer 2024-10-31 10:04:16 UTC
Pushed for 24.11!

Well done everyone, thank you!