Bugzilla – Attachment 186555 Details for
Bug 29959
Populate prices when creating an order with the API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29959: Tidy files
Bug-29959-Tidy-files.patch (text/plain), 3.51 KB, created by
Julian Maurice
on 2025-09-18 13:07:22 UTC
(
hide
)
Description:
Bug 29959: Tidy files
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2025-09-18 13:07:22 UTC
Size:
3.51 KB
patch
obsolete
>From 5322cbdbc82950e5fca0c940ee5c9ced2fcf6b7b Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Thu, 18 Sep 2025 13:05:48 +0000 >Subject: [PATCH] Bug 29959: Tidy files > >--- > Koha/REST/V1/Acquisitions/Orders.pm | 8 +++--- > t/db_dependent/api/v1/acquisitions_orders.t | 31 +++++++++------------ > 2 files changed, 17 insertions(+), 22 deletions(-) > >diff --git a/Koha/REST/V1/Acquisitions/Orders.pm b/Koha/REST/V1/Acquisitions/Orders.pm >index dd39437a0ba..3b8f1e02abd 100644 >--- a/Koha/REST/V1/Acquisitions/Orders.pm >+++ b/Koha/REST/V1/Acquisitions/Orders.pm >@@ -129,13 +129,13 @@ sub add { > > my $bookseller = $basket->bookseller; > >- unless (defined $order->tax_rate_on_ordering) { >- $order->tax_rate_on_ordering($bookseller->tax_rate || 0); >+ unless ( defined $order->tax_rate_on_ordering ) { >+ $order->tax_rate_on_ordering( $bookseller->tax_rate || 0 ); > } > $order->populate_with_prices_for_ordering(); > >- unless (defined $order->tax_rate_on_receiving) { >- $order->tax_rate_on_receiving($bookseller->tax_rate || 0); >+ unless ( defined $order->tax_rate_on_receiving ) { >+ $order->tax_rate_on_receiving( $bookseller->tax_rate || 0 ); > } > $order->populate_with_prices_for_receiving(); > >diff --git a/t/db_dependent/api/v1/acquisitions_orders.t b/t/db_dependent/api/v1/acquisitions_orders.t >index 6d59ab119ca..4c3d975da5b 100755 >--- a/t/db_dependent/api/v1/acquisitions_orders.t >+++ b/t/db_dependent/api/v1/acquisitions_orders.t >@@ -371,28 +371,23 @@ subtest 'add() tests' => sub { > > # Check that prices are correctly populated > my $order_without_prices = { >- basket_id => $order->{basket_id}, >- biblio_id => $order->{biblio_id}, >- fund_id => $order->{fund_id}, >- quantity => 1, >- tax_rate_on_ordering => '0.5', >+ basket_id => $order->{basket_id}, >+ biblio_id => $order->{biblio_id}, >+ fund_id => $order->{fund_id}, >+ quantity => 1, >+ tax_rate_on_ordering => '0.5', > tax_rate_on_receiving => '0.5', >- unit_price => 4.20, >- rrp => 4.20, >- discount_rate => 0.10, >+ unit_price => 4.20, >+ rrp => 4.20, >+ discount_rate => 0.10, > }; > > $order_obj->basket->bookseller->listincgst(0)->invoiceincgst(0)->store(); >- $t->post_ok("//$auth_userid:$password@/api/v1/acquisitions/orders" => json => $order_without_prices) >- ->status_is(201) >- ->json_is('/tax_value_on_ordering', '2.1') >- ->json_is('/tax_value_on_receiving', '2.1') >- ->json_is('/rrp_tax_included', '6.3') >- ->json_is('/rrp_tax_excluded', '4.2') >- ->json_is('/unit_price_tax_included', '6.3') >- ->json_is('/unit_price_tax_excluded', '4.2') >- ->json_is('/ecost_tax_included', '5.67') >- ->json_is('/ecost_tax_excluded', '3.78'); >+ $t->post_ok( "//$auth_userid:$password@/api/v1/acquisitions/orders" => json => $order_without_prices ) >+ ->status_is(201)->json_is( '/tax_value_on_ordering', '2.1' )->json_is( '/tax_value_on_receiving', '2.1' ) >+ ->json_is( '/rrp_tax_included', '6.3' )->json_is( '/rrp_tax_excluded', '4.2' ) >+ ->json_is( '/unit_price_tax_included', '6.3' )->json_is( '/unit_price_tax_excluded', '4.2' ) >+ ->json_is( '/ecost_tax_included', '5.67' )->json_is( '/ecost_tax_excluded', '3.78' ); > > $schema->storage->txn_rollback; > }; >-- >2.39.5
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 29959
:
129875
|
135437
|
183184
| 186555