Bugzilla – Attachment 116718 Details for
Bug 26693
Add option to update dateaccessioned when receiving an order
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26693: Add option to update dateaccessioned when receiving an order
Bug-26693-Add-option-to-update-dateaccessioned-whe.patch (text/plain), 4.31 KB, created by
Tomás Cohen Arazi
on 2021-02-11 13:29:46 UTC
(
hide
)
Description:
Bug 26693: Add option to update dateaccessioned when receiving an order
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2021-02-11 13:29:46 UTC
Size:
4.31 KB
patch
obsolete
>From 5c473b0fb792bf861c395f83ee5efc2f9c217098 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 10 Feb 2021 13:34:55 -0300 >Subject: [PATCH] Bug 26693: Add option to update dateaccessioned when > receiving an order > >This patchset adds: >- A new syspref: AcqItemSetDateAccessionedsWhenReceived >- A new column on the receive page when items are created on ordering, > with a checkbox for choosing if they want the date updated >- The checkbox default value honours the global syspref. > >To test: > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > acqui/finishreceive.pl | 5 ++++- > .../prog/en/modules/acqui/orderreceive.tt | 15 ++++++++++++++- > 2 files changed, 18 insertions(+), 2 deletions(-) > >diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl >index 961e3d566f0..fabf0dc5cd2 100755 >--- a/acqui/finishreceive.pl >+++ b/acqui/finishreceive.pl >@@ -79,7 +79,8 @@ my $basket = $order_obj->basket; > if ($quantityrec > $origquantityrec ) { > my @received_items = (); > if ($basket->effective_create_items eq 'ordering') { >- @received_items = $input->param('items_to_receive'); >+ @received_items = $input->multi_param('items_to_receive'); >+ my @items_to_update_dateaccessioned = $input->multi_param('items_to_update_dateaccessioned'); > my @affects = split q{\|}, C4::Context->preference("AcqItemSetSubfieldsWhenReceived"); > if ( @affects ) { > my $frameworkcode = GetFrameworkCode($biblionumber); >@@ -93,6 +94,8 @@ if ($quantityrec > $origquantityrec ) { > } > } > C4::Items::ModItemFromMarc( $item, $biblionumber, $in ); >+ Koha::Items->find($in)->set({ dateaccessioned => \'NOW()' })->store >+ if any { $in eq $_ } @items_to_update_dateaccessioned; > } > } > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >index 185e2f835d6..f0ccb55781e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >@@ -193,6 +193,7 @@ > <thead> > <tr> > <th>Receive?</th> >+ <th>Update cataloguing date</th> > <th> </th> > <th>Barcode</th> > <th>Home library</th> >@@ -212,7 +213,14 @@ > <tbody> > [% FOREACH item IN order.items %] > <tr id="item_[% item.itemnumber | html %]"> >- <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td> >+ <td style="text-align:center"><input type="checkbox" class="items_to_receive" name="items_to_receive" value="[% item.itemnumber | html %]" /></td> >+ <td style="text-align:center"> >+ [% IF Koha.Preference('AcqItemSetDateAccessionedsWhenReceived') == 1 %] >+ <input type="checkbox" name="items_to_update_dateaccessioned" value="[% item.itemnumber | html %]" id="item_update_date_[% item.itemnumber | html %]" checked disabled/> >+ [% ELSE %] >+ <input type="checkbox" name="items_to_update_dateaccessioned" value="[% item.itemnumber | html %]" id="item_update_date_[% item.itemnumber | html %]" disabled/> >+ [% END %] >+ </td> > <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td> > <td>[% item.barcode | html %]</td> > <td>[% Branches.GetName( item.homebranch ) | html %]</td> >@@ -541,6 +549,11 @@ > $("#other_reason").hide(); > }); > >+ $('.items_to_receive').change(function() { >+ var val = $(this).val(); >+ >+ $('#item_update_date_'+val).prop('disabled', !$(this).prop('checked')); >+ }); > }); > </script> > [% END %] >-- >2.30.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 26693
:
116717
| 116718