Bugzilla – Attachment 78536 Details for
Bug 15184
Ability to duplicate existing order lines to a given basket
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15184: Do not copy items for serials
Bug-15184-Do-not-copy-items-for-serials.patch (text/plain), 2.37 KB, created by
Jonathan Druart
on 2018-09-07 16:47:36 UTC
(
hide
)
Description:
Bug 15184: Do not copy items for serials
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-09-07 16:47:36 UTC
Size:
2.37 KB
patch
obsolete
>From 4b06dc4d20a3b6c11c08571b35cce987817d2390 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 7 Sep 2018 13:43:15 -0300 >Subject: [PATCH] Bug 15184: Do not copy items for serials > >--- > Koha/Acquisition/Order.pm | 33 ++++++++++++++++++++++++++------- > 1 file changed, 26 insertions(+), 7 deletions(-) > >diff --git a/Koha/Acquisition/Order.pm b/Koha/Acquisition/Order.pm >index 9c0077fd9b..a314e6dcb5 100644 >--- a/Koha/Acquisition/Order.pm >+++ b/Koha/Acquisition/Order.pm >@@ -24,6 +24,7 @@ use Koha::Acquisition::Funds; > use Koha::Acquisition::Invoices; > use Koha::Database; > use Koha::DateUtils qw( dt_from_string output_pref ); >+use Koha::Biblios; > use Koha::Items; > use Koha::Patrons; > use Koha::Subscriptions; >@@ -202,6 +203,20 @@ sub items { > return Koha::Items->search({ itemnumber => \@itemnumbers }); > } > >+=head3 biblio >+ >+ my $biblio = $order->biblio >+ >+Returns the bibliographic record associated to the order >+ >+=cut >+ >+sub biblio { >+ my ( $self ) = @_; >+ my $biblio_rs= $self->_result->biblionumber; >+ return Koha::Biblio->_new_from_dbic( $biblio_rs ); >+} >+ > =head3 users > > my $patrons = $order->users >@@ -263,13 +278,17 @@ sub duplicate_to { > $order_info->{basketno} = $basket->basketno; > > $new_order = Koha::Acquisition::Order->new($order_info)->store; >- my $items = $self->items; >- while ( my ($item) = $items->next ) { >- my $item_info = $item->unblessed; >- undef $item_info->{itemnumber}; >- undef $item_info->{barcode}; >- my $new_item = Koha::Item->new($item_info)->store; >- $new_order->add_item( $new_item->itemnumber ); >+ >+ unless ( $self->biblio->serial ) { # Do not copy items for serials >+ my $items = $self->items; >+ while ( my ($item) = $items->next ) { >+ my $item_info = $item->unblessed; >+ undef $item_info->{itemnumber}; >+ undef $item_info->{barcode}; >+ my $new_item = Koha::Item->new($item_info)->store; >+ warn "adding item $new_item->itemnumber to ..."; >+ $new_order->add_item( $new_item->itemnumber ); >+ } > } > my $users = $self->users; # Do we want ça? > while ( my ($user) = $users->next ) { >-- >2.11.0
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 15184
:
77314
|
77315
|
77316
|
77317
|
77318
|
77513
|
77514
|
77515
|
77516
|
77517
|
77966
|
77967
|
77968
|
77969
|
77970
|
78074
|
78075
|
78076
|
78077
|
78078
|
78277
|
78278
|
78279
|
78280
|
78281
|
78282
|
78283
|
78284
|
78285
|
78340
|
78535
|
78536
|
78537
|
78538
|
78539
|
78697
|
78698
|
78699
|
78700
|
78701
|
78702
|
78703
|
78704
|
78705
|
78706
|
78898
|
78911
|
78927
|
78958
|
78959
|
78960
|
78961
|
78962
|
78963
|
78964
|
78965
|
78966
|
78967
|
78968
|
78969
|
78970
|
80485
|
80486
|
80487
|
80488
|
80489
|
80490
|
80491
|
80492
|
80493
|
80494
|
80495
|
80638
|
81435
|
81436
|
81437
|
81438
|
81439
|
81440
|
81441
|
81442
|
81443
|
81444
|
81445
|
81446
|
81447
|
81448
|
82079