Bug 26524

Summary: Add Koha::Acquisition::Basket->orders
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: lucas
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26515
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00
Attachments: Bug 26524: Unit tests
Bug 26524: Add Koha::Acquisition::Basket->orders
Bug 26524: Unit tests
Bug 26524: Add Koha::Acquisition::Basket->orders
Bug 26524: Unit tests
Bug 26524: Add Koha::Acquisition::Basket->orders
Bug 26524: Save some processor cycles

Description Tomás Cohen Arazi 2020-09-23 18:55:00 UTC
It would be great to have this accessor so developers can access the basket's orderlines in the basket context.
Comment 1 Tomás Cohen Arazi 2020-09-23 18:59:45 UTC
Created attachment 110616 [details] [review]
Bug 26524: Unit tests
Comment 2 Tomás Cohen Arazi 2020-09-23 18:59:52 UTC
Created attachment 110617 [details] [review]
Bug 26524: Add Koha::Acquisition::Basket->orders

This patch adds a handy accessor for a basket's orders. It can be used
to embed orders on an API call or be used in controller scripts to
replace C4::* methods.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Basket.t
=> SUCCESS: Tests pass!
3. Sign off :-D
Comment 3 David Nind 2020-09-23 20:01:36 UTC
Created attachment 110622 [details] [review]
Bug 26524: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2020-09-23 20:01:40 UTC
Created attachment 110623 [details] [review]
Bug 26524: Add Koha::Acquisition::Basket->orders

This patch adds a handy accessor for a basket's orders. It can be used
to embed orders on an API call or be used in controller scripts to
replace C4::* methods.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Basket.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Katrin Fischer 2020-09-26 19:33:08 UTC
Created attachment 110797 [details] [review]
Bug 26524: Unit tests

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2020-09-26 19:33:13 UTC
Created attachment 110798 [details] [review]
Bug 26524: Add Koha::Acquisition::Basket->orders

This patch adds a handy accessor for a basket's orders. It can be used
to embed orders on an API call or be used in controller scripts to
replace C4::* methods.

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Acquisition/Basket.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Katrin Fischer 2020-09-26 19:33:53 UTC
Would love to see some code using this new method.
Comment 8 Jonathan Druart 2020-09-29 14:06:57 UTC
Created attachment 110914 [details] [review]
Bug 26524: Save some processor cycles
Comment 9 Tomás Cohen Arazi 2020-09-29 18:38:28 UTC
(In reply to Jonathan Druart from comment #8)
> Created attachment 110914 [details] [review] [review]
> Bug 26524: Save some processor cycles

XD
Comment 10 Jonathan Druart 2020-10-01 09:46:20 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 11 Lucas Gass 2020-10-20 17:28:15 UTC
enhancement will not be backported to 20.05.x