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

(-)a/acqui/basket.pl (-8 / +6 lines)
Lines 357-370 if ( $op eq 'list' ) { Link Here
357
        push @books_loop, $line;
357
        push @books_loop, $line;
358
358
359
        $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
359
        $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
360
        $foot{$$line{tax_rate}}{tax_value} += get_rounded_price($$line{tax_value});
360
        $foot{$$line{tax_rate}}{tax_value} += $$line{tax_value};
361
        $total_tax_value += $$line{tax_value};
361
        $total_tax_value += $$line{tax_value};
362
        $foot{$$line{tax_rate}}{quantity}  += get_rounded_price($$line{quantity});
362
        $foot{$$line{tax_rate}}{quantity}  += $$line{quantity};
363
        $total_quantity += $$line{quantity};
363
        $total_quantity += $$line{quantity};
364
        $foot{$$line{tax_rate}}{total_tax_excluded} += $$line{total_tax_excluded};
364
        $foot{$$line{tax_rate}}{total_tax_excluded} += $$line{total_tax_excluded};
365
        $total_tax_excluded += $$line{total_tax_excluded};
365
        $total_tax_excluded += get_rounded_price($$line{total_tax_excluded});
366
        $foot{$$line{tax_rate}}{total_tax_included} += $$line{total_tax_included};
366
        $foot{$$line{tax_rate}}{total_tax_included} += $$line{total_tax_included};
367
        $total_tax_included += $$line{total_tax_included};
367
        $total_tax_included += get_rounded_price($$line{total_tax_included});
368
    }
368
    }
369
369
370
    push @book_foot_loop, map {$_} values %foot;
370
    push @book_foot_loop, map {$_} values %foot;
Lines 471-480 sub get_order_infos { Link Here
471
    # If we have an actual cost that should be the total, otherwise use the ecost
471
    # If we have an actual cost that should be the total, otherwise use the ecost
472
    $line{unitprice_tax_included} += 0;
472
    $line{unitprice_tax_included} += 0;
473
    $line{unitprice_tax_excluded} += 0;
473
    $line{unitprice_tax_excluded} += 0;
474
    my $cost_tax_included = $line{unitprice_tax_included} || $line{ecost_tax_included};
474
    $line{total_tax_included} = get_rounded_price($line{ecost_tax_included} * $line{quantity});
475
    my $cost_tax_excluded = $line{unitprice_tax_excluded} || $line{ecost_tax_excluded};
475
    $line{total_tax_excluded} = get_rounded_price($line{ecost_tax_excluded} * $line{quantity});
476
    $line{total_tax_included} = get_rounded_price($cost_tax_included) * $line{quantity};
477
    $line{total_tax_excluded} = get_rounded_price($cost_tax_excluded) * $line{quantity};
478
    $line{tax_value} = $line{tax_value_on_ordering};
476
    $line{tax_value} = $line{tax_value_on_ordering};
479
    $line{tax_rate} = $line{tax_rate_on_ordering};
477
    $line{tax_rate} = $line{tax_rate_on_ordering};
480
478
(-)a/acqui/basketgroup.pl (-4 / +4 lines)
Lines 75-88 sub BasketTotal { Link Here
75
    my $total = 0;
75
    my $total = 0;
76
    my @orders = GetOrders($basketno);
76
    my @orders = GetOrders($basketno);
77
    for my $order (@orders){
77
    for my $order (@orders){
78
        # FIXME The following is wrong
78
        # FIXME The following is wrong <- still true ? remove if patch 35114 fixed it
79
        if ( $bookseller->listincgst ) {
79
        if ( $bookseller->listincgst ) {
80
            $total = $total + ( get_rounded_price($order->{ecost_tax_included}) * $order->{quantity} );
80
            $total = $total + ( $order->{ecost_tax_included} * $order->{quantity} );
81
        } else {
81
        } else {
82
            $total = $total + ( get_rounded_price($order->{ecost_tax_excluded}) * $order->{quantity} );
82
            $total = $total + ( $order->{ecost_tax_excluded} * $order->{quantity} );
83
        }
83
        }
84
    }
84
    }
85
    return $total;
85
    return get_rounded_price($total);
86
}
86
}
87
87
88
#displays all basketgroups and all closed baskets (in their respective groups)
88
#displays all basketgroups and all closed baskets (in their respective groups)
(-)a/koha-tmpl/intranet-tmpl/prog/js/acq.js (-2 / +1 lines)
Lines 190-196 function updateCosts(){ Link Here
190
    var rep   = new Number(listprice*exchangerate);
190
    var rep   = new Number(listprice*exchangerate);
191
    var ecost = rrp;
191
    var ecost = rrp;
192
    if ( 100-discount != 100 ) { //Prevent rounding issues if no discount
192
    if ( 100-discount != 100 ) { //Prevent rounding issues if no discount
193
        ecost = new Number(Math.floor(rrp * (100 - discount )) / 100);
193
        ecost = new Number(Math.round(rrp * (100 - discount )) / 100);
194
    }
194
    }
195
    var total =  new Number( ecost * quantity);
195
    var total =  new Number( ecost * quantity);
196
    $("#rrp").val(rrp.toFixed(2));
196
    $("#rrp").val(rrp.toFixed(2));
197
- 

Return to bug 35114