Bug 29202

Summary: replacementprice changes should trigger replacementpricedate updates
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: AcquisitionsAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: m.de.rooy, nick
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29177
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 29177    
Bug Blocks:    
Attachments: Bug 29202: Trigger replacementpricedate on replacementprice change

Description Martin Renvoize (ashimema) 2021-10-11 09:31:53 UTC
Currently, we aren't entirely consistent with setting the replacementpricedate field whenever replacementprice is updated.. we should add it to the list of fields handled in the Koha::Item store triggers.
Comment 1 Martin Renvoize (ashimema) 2021-10-11 09:39:54 UTC
Created attachment 126037 [details] [review]
Bug 29202: Trigger replacementpricedate on replacementprice change
Comment 2 Marcel de Rooy 2021-10-11 12:55:24 UTC
        my @fields = qw( itemlost withdrawn damaged replacementprice );
        for my $field (@fields) {

[...]
                my $field_on = "${field}_on";
                $self->$field_on(undef);

This will not work for replacementprice ;)
No _on there

Btw I have my doubts here if the code does exactly what we want here. We only want a updated timestamp if the value actually changes.

Is the finishreceive script the only passing this value?

We need some tests !
Comment 3 Martin Renvoize (ashimema) 2021-10-22 15:36:25 UTC
I've decided this is invalid.. :-)