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

(-)a/acqui/basket.pl (-5 / +3 lines)
Lines 343-349 if ( $op eq 'list' ) { Link Here
343
        $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
343
        $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
344
        $foot{$$line{tax_rate}}{tax_value} += get_rounded_price($$line{tax_value});
344
        $foot{$$line{tax_rate}}{tax_value} += get_rounded_price($$line{tax_value});
345
        $total_tax_value += $$line{tax_value};
345
        $total_tax_value += $$line{tax_value};
346
        $foot{$$line{tax_rate}}{quantity}  += get_rounded_price($$line{quantity});
346
        $foot{$$line{tax_rate}}{quantity}  += $$line{quantity};
347
        $total_quantity += $$line{quantity};
347
        $total_quantity += $$line{quantity};
348
        $foot{$$line{tax_rate}}{total_tax_excluded} += $$line{total_tax_excluded};
348
        $foot{$$line{tax_rate}}{total_tax_excluded} += $$line{total_tax_excluded};
349
        $total_tax_excluded += $$line{total_tax_excluded};
349
        $total_tax_excluded += $$line{total_tax_excluded};
Lines 456-465 sub get_order_infos { Link Here
456
    # If we have an actual cost that should be the total, otherwise use the ecost
456
    # If we have an actual cost that should be the total, otherwise use the ecost
457
    $line{unitprice_tax_included} += 0;
457
    $line{unitprice_tax_included} += 0;
458
    $line{unitprice_tax_excluded} += 0;
458
    $line{unitprice_tax_excluded} += 0;
459
    my $cost_tax_included = $line{unitprice_tax_included} || $line{ecost_tax_included};
459
    $line{total_tax_included} = get_rounded_price($line{ecost_tax_included} * $line{quantity});
460
    my $cost_tax_excluded = $line{unitprice_tax_excluded} || $line{ecost_tax_excluded};
460
    $line{total_tax_excluded} = get_rounded_price($line{ecost_tax_excluded} * $line{quantity});
461
    $line{total_tax_included} = get_rounded_price($cost_tax_included) * $line{quantity};
462
    $line{total_tax_excluded} = get_rounded_price($cost_tax_excluded) * $line{quantity};
463
    $line{tax_value} = $line{tax_value_on_ordering};
461
    $line{tax_value} = $line{tax_value_on_ordering};
464
    $line{tax_rate} = $line{tax_rate_on_ordering};
462
    $line{tax_rate} = $line{tax_rate_on_ordering};
465
463
(-)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