Bug 21205

Summary: C4::Acquisition - Remove GetOrderFromItemnumber
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: enhancement    
Priority: P5 - low CC: m.de.rooy, martin.renvoize, nick
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 15184, 21202    
Bug Blocks: 21204, 21206, 22360    
Attachments: Bug 21205: Replace C4::Items::GetOrderFromItemnumber calls
Bug 21205: Replace C4::Items::GetOrderFromItemnumber calls
Bug 21205: (follow-up) Fix column name - itemnumbers -> itemnumber
Bug 21205: Replace C4::Items::GetOrderFromItemnumber calls
Bug 21205: (follow-up) Fix column name - itemnumbers -> itemnumber

Description Jonathan Druart 2018-08-10 15:26:40 UTC
This is done to ease the move of C4::Items (bug 18252) to Koha::Items

  my @itemnumbers = GetItemnumbersFromOrder($order->{ordernumber});
will become
  my @itemnumbers = $order_object->items->get_column('itemnumbers');
Comment 1 Jonathan Druart 2018-08-10 15:59:35 UTC
Koha::Acquisition::Order->items comes from bug 15184
Comment 2 Jonathan Druart 2018-08-10 16:01:27 UTC
Created attachment 77698 [details] [review]
Bug 21205: Replace C4::Items::GetOrderFromItemnumber calls

This is done to ease the move of C4::Items (bug 18252) to Koha::Items

  my @itemnumbers = GetItemnumbersFromOrder($order->{ordernumber});
will become
  my @itemnumbers = $order_object->items->get_column('itemnumbers');

Test plan:
- Create an order with several items
- Receive some items
Comment 3 Josef Moravec 2018-08-21 13:17:20 UTC
Created attachment 78042 [details] [review]
Bug 21205: Replace C4::Items::GetOrderFromItemnumber calls

This is done to ease the move of C4::Items (bug 18252) to Koha::Items

  my @itemnumbers = GetItemnumbersFromOrder($order->{ordernumber});
will become
  my @itemnumbers = $order_object->items->get_column('itemnumbers');

Test plan:
- Create an order with several items
- Receive some items

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 4 Josef Moravec 2018-08-21 13:17:23 UTC
Created attachment 78043 [details] [review]
Bug 21205: (follow-up) Fix column name - itemnumbers -> itemnumber

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 5 Marcel de Rooy 2018-08-24 08:37:54 UTC
perl t/db_dependent/Acquisition/CancelReceipt.t
1..12
The method Koha::Acquisition::Order->items is not covered by tests!

 perl t/db_dependent/Acquisition/TransferOrder.t
1..13
ok 1 - 1 order in basket1
The method Koha::Acquisition::Order->items is not covered by tests!
Comment 6 Jonathan Druart 2018-08-24 20:06:47 UTC
Koha::Acquisition::Order->items is added by bug 15184
Comment 7 Marcel de Rooy 2018-08-31 05:26:08 UTC
QA: Looking here
Comment 8 Marcel de Rooy 2018-08-31 05:46:27 UTC
Created attachment 78319 [details] [review]
Bug 21205: Replace C4::Items::GetOrderFromItemnumber calls

This is done to ease the move of C4::Items (bug 18252) to Koha::Items

  my @itemnumbers = GetItemnumbersFromOrder($order->{ordernumber});
will become
  my @itemnumbers = $order_object->items->get_column('itemnumbers');

Test plan:
- Create an order with several items
- Receive some items

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 9 Marcel de Rooy 2018-08-31 05:46:32 UTC
Created attachment 78320 [details] [review]
Bug 21205: (follow-up) Fix column name - itemnumbers -> itemnumber

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 10 Marcel de Rooy 2018-08-31 05:47:53 UTC
Passed QA but note that 15184 is in FQA now. Please wait, RM. Added a temporary flag in the title.
Comment 11 Nick Clemens 2018-11-08 21:10:22 UTC
Awesome work all!

Pushed to master for 18.11
Comment 12 Martin Renvoize 2018-11-16 14:01:04 UTC
Enhancement, will not be backported to 18.05.x series.