Bug 29959 - Populate prices when creating an order with the API
Summary: Populate prices when creating an order with the API
Status: Patch doesn't apply
Alias: None
Product: Koha
Classification: Unclassified
Component: REST API (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Julian Maurice
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on: 29955
Blocks: 30875
  Show dependency treegraph
 
Reported: 2022-01-27 12:57 UTC by Julian Maurice
Modified: 2022-07-01 15:26 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 29959: Populate prices when creating an order with the API (3.61 KB, patch)
2022-01-27 12:58 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 29959: Populate prices when creating an order with the API (3.64 KB, patch)
2022-05-28 14:14 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2022-01-27 12:57:23 UTC
Price columns (aqorders.*_tax_included, aqorders.*_tax_excluded, aqorders.tax_value_*) are automatically calculated when creating an order with the staff interface. They should also be automatically calculated when the order is created with the API.
Comment 1 Julian Maurice 2022-01-27 12:58:09 UTC
Created attachment 129875 [details] [review]
Bug 29959: Populate prices when creating an order with the API

Price columns (aqorders.*_tax_included, aqorders.*_tax_excluded,
aqorders.tax_value_*) are automatically calculated when creating an
order with the staff interface. They should also be automatically
calculated when the order is created with the API.

Depends on bug 29955

Test plan:
1. Run tests in t/db_dependent/api/v1/acquisitions_orders.t
Comment 2 Joonas Kylmälä 2022-05-28 10:31:03 UTC
This sounds like a bug to me, marking it as such. Please revert if I'm wrong.
Comment 3 David Nind 2022-05-28 14:14:36 UTC
Created attachment 135437 [details] [review]
Bug 29959: Populate prices when creating an order with the API

Price columns (aqorders.*_tax_included, aqorders.*_tax_excluded,
aqorders.tax_value_*) are automatically calculated when creating an
order with the staff interface. They should also be automatically
calculated when the order is created with the API.

Depends on bug 29955

Test plan:
1. Run tests in t/db_dependent/api/v1/acquisitions_orders.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Jonathan Druart 2022-05-31 08:46:45 UTC
Shouldn't this actually be called from Koha::Acq::Order->store?
Comment 5 Tomás Cohen Arazi 2022-06-01 11:07:55 UTC
(In reply to Jonathan Druart from comment #4)
> Shouldn't this actually be called from Koha::Acq::Order->store?

We should file a follow-up bug for refactoring things (as it would imply changing the CGI controllers as well and in this case we are fixing a bug).
Comment 6 Tomás Cohen Arazi 2022-06-01 11:08:23 UTC
(In reply to Joonas Kylmälä from comment #2)
> This sounds like a bug to me, marking it as such. Please revert if I'm wrong.

+1
Comment 7 Jonathan Druart 2022-06-01 11:12:25 UTC
(In reply to Tomás Cohen Arazi from comment #5)
> (In reply to Jonathan Druart from comment #4)
> > Shouldn't this actually be called from Koha::Acq::Order->store?
> 
> We should file a follow-up bug for refactoring things (as it would imply
> changing the CGI controllers as well and in this case we are fixing a bug).

This comment was actually for bug 29955 (which this bug depends on), and it's doing refactoring already.