|
Lines 151-157
for my $currency_format ( qw( US FR ) ) {
Link Here
|
| 151 |
}; |
151 |
}; |
| 152 |
|
152 |
|
| 153 |
subtest 'Configuration 1: 1 1 (Vendor List prices do include tax / Invoice prices include tax)' => sub { |
153 |
subtest 'Configuration 1: 1 1 (Vendor List prices do include tax / Invoice prices include tax)' => sub { |
| 154 |
plan tests => 8; |
154 |
plan tests => 11; |
| 155 |
|
155 |
|
| 156 |
my $biblionumber_1_1 = 43; |
156 |
my $biblionumber_1_1 = 43; |
| 157 |
my $order_1_1 = { |
157 |
my $order_1_1 = { |
|
Lines 250-255
for my $currency_format ( qw( US FR ) ) {
Link Here
|
| 250 |
field => 'tax_value' |
250 |
field => 'tax_value' |
| 251 |
} |
251 |
} |
| 252 |
); |
252 |
); |
|
|
253 |
|
| 254 |
# When unitprice is 0.00 C4::Acquisition->populate_order_with_prices() falls back to using ecost_tax_included and ecost_tax_excluded |
| 255 |
$order_1_1 = { |
| 256 |
biblionumber => $biblionumber_1_1, |
| 257 |
quantity => 1, |
| 258 |
listprice => 10, |
| 259 |
unitprice => '0.00', |
| 260 |
quantityreceived => 1, |
| 261 |
basketno => $basketno_1_1, |
| 262 |
invoiceid => $invoiceid_1_1, |
| 263 |
rrp => 10.00, |
| 264 |
ecost => 10.00, |
| 265 |
tax_rate => 0.1500, |
| 266 |
discount => 0, |
| 267 |
datereceived => $today |
| 268 |
}; |
| 269 |
|
| 270 |
$order_1_1 = C4::Acquisition::populate_order_with_prices( |
| 271 |
{ |
| 272 |
order => $order_1_1, |
| 273 |
booksellerid => 4, |
| 274 |
ordering => 1, |
| 275 |
} |
| 276 |
); |
| 277 |
|
| 278 |
compare( |
| 279 |
{ |
| 280 |
got => $order_1_1->{ecost_tax_included}, |
| 281 |
expected => 10.00, |
| 282 |
conf => '1 1', |
| 283 |
field => 'ecost_tax_included' |
| 284 |
} |
| 285 |
); |
| 286 |
compare( |
| 287 |
{ |
| 288 |
got => $order_1_1->{ecost_tax_excluded}, |
| 289 |
expected => 8.70, |
| 290 |
conf => '1 1', |
| 291 |
field => 'ecost_tax_excluded' |
| 292 |
} |
| 293 |
); |
| 294 |
compare( |
| 295 |
{ |
| 296 |
got => $order_1_1->{tax_value_on_ordering}, |
| 297 |
expected => 1.30, |
| 298 |
conf => '1 1', |
| 299 |
field => 'tax_value' |
| 300 |
} |
| 301 |
); |
| 253 |
}; |
302 |
}; |
| 254 |
|
303 |
|
| 255 |
subtest 'Configuration 1: 1 0 (Vendor List prices include tax / Invoice prices do not include tax)' => sub { |
304 |
subtest 'Configuration 1: 1 0 (Vendor List prices include tax / Invoice prices do not include tax)' => sub { |
|
Lines 492-497
for my $currency_format ( qw( US FR ) ) {
Link Here
|
| 492 |
} |
541 |
} |
| 493 |
); |
542 |
); |
| 494 |
}; |
543 |
}; |
|
|
544 |
|
| 495 |
} |
545 |
} |
| 496 |
|
546 |
|
| 497 |
sub compare { |
547 |
sub compare { |
| 498 |
- |
|
|