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

(-)a/acqui/neworderempty.pl (-1 / +1 lines)
Lines 360-366 $template->param( Link Here
360
    authorisedbyname     => $borrower->{'firstname'} . " " . $borrower->{'surname'},
360
    authorisedbyname     => $borrower->{'firstname'} . " " . $borrower->{'surname'},
361
    biblioitemnumber     => $data->{'biblioitemnumber'},
361
    biblioitemnumber     => $data->{'biblioitemnumber'},
362
    discount_2dp         => sprintf( "%.2f",  $bookseller->{'discount'} ) ,   # for display
362
    discount_2dp         => sprintf( "%.2f",  $bookseller->{'discount'} ) ,   # for display
363
    discount             => $bookseller->{'discount'},
363
    discount             => defined($data->{'discount'}) ? $data->{'discount'} : $bookseller->{'discount'},
364
    orderdiscount_2dp    => sprintf( "%.2f", $data->{'discount'} || 0 ),
364
    orderdiscount_2dp    => sprintf( "%.2f", $data->{'discount'} || 0 ),
365
    orderdiscount        => $data->{'discount'},
365
    orderdiscount        => $data->{'discount'},
366
    listincgst       => $bookseller->{'listincgst'},
366
    listincgst       => $bookseller->{'listincgst'},
(-)a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js (-2 / +7 lines)
Lines 646-657 function updateCosts(){ Link Here
646
    var listprice   =  new Number($("#listprice").val());
646
    var listprice   =  new Number($("#listprice").val());
647
    var currcode = new String($("#currency").val());
647
    var currcode = new String($("#currency").val());
648
    var exchangerate =  new Number($("#currency_rate_"+currcode).val());
648
    var exchangerate =  new Number($("#currency_rate_"+currcode).val());
649
    var miscellaneous = new Number($("#miscellaneous").val());
649
    var gst_on=false;
650
    var gst_on=false;
650
651
651
    var rrp   = new Number(listprice*exchangerate);
652
    var rrp   = new Number(listprice*exchangerate);
652
    var ecost = rrp;
653
    var ecost = rrp + miscellaneous;
653
    if ( 100-discount != 100 ) { //Prevent rounding issues if no discount
654
    if ( 100-discount != 100 ) { //Prevent rounding issues if no discount
654
        ecost = new Number(Math.floor(rrp * (100 - discount )) / 100);
655
        ecost = new Number(Math.floor(rrp * (100 - discount )) / 100) + miscellaneous;
655
    }
656
    }
656
    var total =  new Number( ecost * quantity);
657
    var total =  new Number( ecost * quantity);
657
    $("#rrp").val(rrp.toFixed(2));
658
    $("#rrp").val(rrp.toFixed(2));
Lines 659-664 function updateCosts(){ Link Here
659
    $("#total").val(total.toFixed(2));
660
    $("#total").val(total.toFixed(2));
660
    $("listprice").val(listprice.toFixed(2));
661
    $("listprice").val(listprice.toFixed(2));
661
662
663
    // In case the discount changed, we should update the message
664
    var discount_2dp = discount.toFixed(2);
665
    $('#discount_value').html(discount_2dp);
666
662
    return true;
667
    return true;
663
}
668
}
664
669
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt (-1 / +19 lines)
Lines 503-514 $(document).ready(function() Link Here
503
            </li>
503
            </li>
504
            <li>
504
            <li>
505
                [% IF ( close ) %]
505
                [% IF ( close ) %]
506
                    <span class="label">Discount percentage: </span>
507
                    <input type="text" size="20" name="discount" id="discount" value="[% discount %]" />
508
                [% ELSE %]
509
                    <label for="discount">Discount percentage: </label>
510
                    <input type="text" size="20" name="discount" id="discount" value="[% discount %]" onchange="calcNeworderTotal()"/>
511
                [% END %]
512
            </li>
513
            <li>
514
                [% IF ( close ) %]
515
                    <span class="label">Miscellaneous cost: </span>
516
                    <input type="text" size="20" name="miscellaneous" id="miscellaneous" />
517
                [% ELSE %]
518
                    <label for="miscellaneous">Miscellaneous cost: </label>
519
                    <input type="text" size="20" name="miscellaneous" id="miscellaneous" onchange="calcNeworderTotal()"/>
520
                [% END %]
521
            </li>
522
            <li>
523
                [% IF ( close ) %]
506
                    <label for="ecost">Budgeted cost: </label>
524
                    <label for="ecost">Budgeted cost: </label>
507
                    <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly"  />
525
                    <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly"  />
508
                [% ELSE %]
526
                [% ELSE %]
509
                    <label for="ecost">Budgeted cost: </label>
527
                    <label for="ecost">Budgeted cost: </label>
510
                    <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" />
528
                    <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" />
511
                [% END %]
529
                [% END %]
530
                [% IF ( discount_2dp ) %]  (adjusted for <span id="discount_value">[% discount_2dp %]</span>% discount)  [% END %]
512
            </li>
531
            </li>
513
            <li>
532
            <li>
514
                [% IF ( close ) %]
533
                [% IF ( close ) %]
515
- 

Return to bug 8343