View | Details | Raw Unified | Return to bug 25750
Collapse All | Expand All

(-)a/C4/Acquisition.pm (+1 lines)
Lines 2883-2888 sub populate_order_with_prices { Link Here
2883
        if ( $bookseller->listincgst ) {
2883
        if ( $bookseller->listincgst ) {
2884
2884
2885
            # The user entered the prices tax included
2885
            # The user entered the prices tax included
2886
            $order->{unitprice} += 0;
2886
            $order->{unitprice_tax_included} = $order->{unitprice};
2887
            $order->{unitprice_tax_included} = $order->{unitprice};
2887
            $order->{rrp_tax_included} = $order->{rrp};
2888
            $order->{rrp_tax_included} = $order->{rrp};
2888
2889
(-)a/acqui/basket.pl (+2 lines)
Lines 459-464 sub get_order_infos { Link Here
459
    $line{budget_name}    = $budget->{budget_name};
459
    $line{budget_name}    = $budget->{budget_name};
460
460
461
    # If we have an actual cost that should be the total, otherwise use the ecost
461
    # If we have an actual cost that should be the total, otherwise use the ecost
462
    $line{unitprice_tax_included} += 0;
463
    $line{unitprice_tax_excluded} += 0;
462
    my $cost_tax_included = $line{unitprice_tax_included} || $line{ecost_tax_included};
464
    my $cost_tax_included = $line{unitprice_tax_included} || $line{ecost_tax_included};
463
    my $cost_tax_excluded = $line{unitprice_tax_excluded} || $line{ecost_tax_excluded};
465
    my $cost_tax_excluded = $line{unitprice_tax_excluded} || $line{ecost_tax_excluded};
464
    $line{total_tax_included} = get_rounded_price($cost_tax_included) * $line{quantity};
466
    $line{total_tax_included} = get_rounded_price($cost_tax_included) * $line{quantity};
(-)a/t/Prices.t (-2 / +51 lines)
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
- 

Return to bug 25750