Bugzilla – Attachment 126037 Details for
Bug 29202
replacementprice changes should trigger replacementpricedate updates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29202: Trigger replacementpricedate on replacementprice change
Bug-29202-Trigger-replacementpricedate-on-replacem.patch (text/plain), 2.09 KB, created by
Martin Renvoize (ashimema)
on 2021-10-11 09:39:54 UTC
(
hide
)
Description:
Bug 29202: Trigger replacementpricedate on replacementprice change
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-10-11 09:39:54 UTC
Size:
2.09 KB
patch
obsolete
>From 19cd8b6f433dd8028483a4b17117da2d898a17cd Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 11 Oct 2021 10:39:11 +0100 >Subject: [PATCH] Bug 29202: Trigger replacementpricedate on replacementprice > change > >--- > Koha/Item.pm | 3 ++- > acqui/finishreceive.pl | 17 +++++++++-------- > 2 files changed, 11 insertions(+), 9 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 08e527df10..1ae6d45d8c 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -137,11 +137,12 @@ sub store { > exists $updated_columns{itemlost} > or exists $updated_columns{withdrawn} > or exists $updated_columns{damaged} >+ or exists $updated_columns{replacementprice} > ) ? $self->get_from_storage : undef; > > # Update *_on fields if needed > # FIXME: Why not for AddItem as well? >- my @fields = qw( itemlost withdrawn damaged ); >+ my @fields = qw( itemlost withdrawn damaged replacementprice ); > for my $field (@fields) { > > # If the field is defined but empty or 0, we are >diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl >index 93391e8fad..4d3e02ae84 100755 >--- a/acqui/finishreceive.pl >+++ b/acqui/finishreceive.pl >@@ -174,14 +174,15 @@ if ($quantityrec > $origquantityrec ) { > my $new_order_object = Koha::Acquisition::Orders->find( $new_ordernumber ); # FIXME we should not need to refetch it > my $items = $new_order_object->items; > while ( my $item = $items->next ) { >- $item->update({ >- booksellerid => $booksellerid, >- dateaccessioned => $datereceived, >- datelastseen => $datereceived, >- price => $unitprice, >- replacementprice => $replacementprice, >- replacementpricedate => $datereceived, >- }); >+ $item->update( >+ { >+ booksellerid => $booksellerid, >+ dateaccessioned => $datereceived, >+ datelastseen => $datereceived, >+ price => $unitprice, >+ replacementprice => $replacementprice, >+ } >+ ); > } > > if ($suggestion_id) { >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29202
: 126037