Bugzilla – Attachment 95102 Details for
Bug 23523
Unitprice tax column values are not populated if entered upon ordering
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23523: (follow-up) Adjust tests for new expectations
Bug-23523-follow-up-Adjust-tests-for-new-expectati.patch (text/plain), 4.03 KB, created by
Nick Clemens (kidclamp)
on 2019-11-06 12:12:58 UTC
(
hide
)
Description:
Bug 23523: (follow-up) Adjust tests for new expectations
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-11-06 12:12:58 UTC
Size:
4.03 KB
patch
obsolete
>From 6bbafb5a1e9e8b0289ec28cd6c1dfa8fb7c99d46 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 6 Nov 2019 12:09:11 +0000 >Subject: [PATCH] Bug 23523: (follow-up) Adjust tests for new expectations > >--- > t/Prices.t | 47 ++++++++++++++++++++++++++++++++++++++++++----- > 1 file changed, 42 insertions(+), 5 deletions(-) > >diff --git a/t/Prices.t b/t/Prices.t >index 4039233f5d..b42ce9af6f 100644 >--- a/t/Prices.t >+++ b/t/Prices.t >@@ -253,14 +253,14 @@ for my $currency_format ( qw( US FR ) ) { > }; > > subtest 'Configuration 1: 1 0' => sub { >- plan tests => 8; >+ plan tests => 9; > > my $biblionumber_1_0 = 44; > my $order_1_0 = { > biblionumber => $biblionumber_1_0, > quantity => 2, > listprice => 82.000000, >- unitprice => 70.290000, >+ unitprice => 0, > quantityreceived => 2, > basketno => $basketno_1_1, > invoiceid => $invoiceid_1_1, >@@ -311,6 +311,8 @@ for my $currency_format ( qw( US FR ) ) { > field => 'ecost_tax_excluded' > } > ); >+ # If we order with unitprice = 0, tax is calculated from the ecost >+ # (note that in addorder.pl and addorderiso2709 the unitprice may/will be set to the ecost > compare( > { > got => $order_1_0->{tax_value_on_ordering}, >@@ -319,6 +321,23 @@ for my $currency_format ( qw( US FR ) ) { > field => 'tax_value' > } > ); >+ $order_1_0->{unitprice} = 70.29; >+ $order_1_0 = C4::Acquisition::populate_order_with_prices( >+ { >+ order => $order_1_0, >+ booksellerid => 3, >+ ordering => 1, >+ } >+ ); >+ # If a unitprice is provided at ordering, we calculate the tax from that >+ compare( >+ { >+ got => $order_1_0->{tax_value_on_ordering}, >+ expected => 6.69, >+ conf => '1 0', >+ field => 'tax_value' >+ } >+ ); > > $order_1_0 = C4::Acquisition::populate_order_with_prices( > { >@@ -355,14 +374,14 @@ for my $currency_format ( qw( US FR ) ) { > }; > > subtest 'Configuration 1: 0 1' => sub { >- plan tests => 8; >+ plan tests => 9; > > my $biblionumber_0_1 = 45; > my $order_0_1 = { > biblionumber => $biblionumber_0_1, > quantity => 2, > listprice => 82.000000, >- unitprice => 77.490000, >+ unitprice => 0, > quantityreceived => 2, > basketno => $basketno_1_1, > invoiceid => $invoiceid_1_1, >@@ -413,6 +432,8 @@ for my $currency_format ( qw( US FR ) ) { > field => 'ecost_tax_excluded' > } > ); >+ # If we order with unitprice = 0, tax is calculated from the ecost >+ # (note that in addorder.pl and addorderiso2709 the unitprice may/will be set to the ecost > compare( > { > got => $order_0_1->{tax_value_on_ordering}, >@@ -421,7 +442,23 @@ for my $currency_format ( qw( US FR ) ) { > field => 'tax_value' > } > ); >- >+ $order_0_1->{unitprice} = 77.490000; >+ $order_0_1 = C4::Acquisition::populate_order_with_prices( >+ { >+ order => $order_0_1, >+ booksellerid => 2, >+ ordering => 1, >+ } >+ ); >+ # If a unitprice is provided at ordering, we calculate the tax from that >+ compare( >+ { >+ got => $order_0_1->{tax_value_on_ordering}, >+ expected => 7.75, >+ conf => '0 1', >+ field => 'tax_value' >+ } >+ ); > $order_0_1 = C4::Acquisition::populate_order_with_prices( > { > order => $order_0_1, >-- >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 23523
:
92500
|
93950
|
95034
|
95035
|
95082
| 95102 |
95103