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

(-)a/acqui/orderreceive.pl (-3 / +4 lines)
Lines 114-120 unless ( $results and @$results) { Link Here
114
my $order = $results->[0];
114
my $order = $results->[0];
115
my $order_object = Koha::Acquisition::Orders->find( $ordernumber );
115
my $order_object = Koha::Acquisition::Orders->find( $ordernumber );
116
my $basket = $order_object->basket;
116
my $basket = $order_object->basket;
117
my $active_currency = Koha::Acquisition::Currencies->get_active;
117
my $currencies = Koha::Acquisition::Currencies->search;
118
my $active_currency = $currencies->get_active;
118
119
119
# Check if ACQ framework exists
120
# Check if ACQ framework exists
120
my $acq_fw = GetMarcStructure( 1, 'ACQ', { unsafe => 1 } );
121
my $acq_fw = GetMarcStructure( 1, 'ACQ', { unsafe => 1 } );
Lines 228-235 $template->param( Link Here
228
    booksellerid          => $order->{'booksellerid'},
229
    booksellerid          => $order->{'booksellerid'},
229
    freight               => $freight,
230
    freight               => $freight,
230
    name                  => $bookseller->name,
231
    name                  => $bookseller->name,
231
    cur_active_sym        => $active_currency->symbol,
232
    active_currency       => $active_currency,
232
    cur_active            => $active_currency->currency,
233
    currencies            => scalar $currencies->search({ rate => { '!=' => 1 } }),
233
    invoiceincgst         => $bookseller->invoiceincgst,
234
    invoiceincgst         => $bookseller->invoiceincgst,
234
    title                 => $order->{'title'},
235
    title                 => $order->{'title'},
235
    author                => $order->{'author'},
236
    author                => $order->{'author'},
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-3 / +35 lines)
Lines 288-294 Link Here
288
            <input type="hidden" name="tax_rate" value="0" />
288
            <input type="hidden" name="tax_rate" value="0" />
289
        [% END %]
289
        [% END %]
290
290
291
        <li><label for="rrp">Retail price: </label>[% rrp | $Price %] <span class="hint">(adjusted for [% cur_active | html %], [% IF (invoiceincgst == 1) %]tax inclusive[% ELSE %]tax exclusive[% END %])</span></li>
291
        <li><label for="rrp">Retail price: </label>[% rrp | $Price %] <span class="hint">(adjusted for [% active_currency.currency | html %], [% IF (invoiceincgst == 1) %]tax inclusive[% ELSE %]tax exclusive[% END %])</span></li>
292
        <li>
292
        <li>
293
            <label for="replacementprice">Replacement price:</label>
293
            <label for="replacementprice">Replacement price:</label>
294
            <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% replacementprice | $Price on_editing => 1 %]" />
294
            <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% replacementprice | $Price on_editing => 1 %]" />
Lines 296-302 Link Here
296
        <li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %] <span class="hint">[% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span></li>
296
        <li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %] <span class="hint">[% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span></li>
297
        <li>
297
        <li>
298
            <label for="unitprice">Actual cost:</label>
298
            <label for="unitprice">Actual cost:</label>
299
            <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 %]" /> <span class="hint">[% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span>
299
            <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 %]" />
300
            <span class="hint">[% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span>
301
            <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
302
        </li>
303
        <li id="select_currency">
304
            <label for="unitprice_currency"></label>
305
            <input type="text" size="20" name="unitprice" id="unitprice_currency" value="" />
306
            [% IF currencies.count %]
307
                <select name="currency">
308
                    <option value="[% active_currency.rate %]" selected="selected">[% active_currency.currency %] ([% active_currency.symbol %])</option>
309
                    [% FOR currency IN currencies %]
310
                        <option value="[% currency.rate %]">[% currency.currency %] ([% currency.symbol %])</option>
311
                    [% END %]
312
                </select>
313
            [% END %]
300
        </li>
314
        </li>
301
        <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li>
315
        <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li>
302
        [% IF order_vendornote %]
316
        [% IF order_vendornote %]
Lines 436-441 Link Here
436
                    CheckNItems($(this).val());
450
                    CheckNItems($(this).val());
437
                });
451
                });
438
            [% END %]
452
            [% END %]
453
454
            $("input[name='change_currency']").on("change", function(){
455
                if ( $(this).is(":checked") ) {
456
                    $("#select_currency").show();
457
                    $("#unitprice").prop("readonly", "true");
458
                } else {
459
                    $("#select_currency").hide();
460
                    $("#unitprice").prop("readonly", "");
461
                }
462
            }).change();
463
464
            function update_unitprice() {
465
                var rate = Number($("select[name='currency'] option:selected").val());
466
                var unitprice = $("#unitprice_currency").val();
467
                var new_unitprice = Number( unitprice * rate ).toFixed(2);
468
                $("#unitprice").val(new_unitprice);
469
            }
470
            $("select[name='currency']").on("change", function(){update_unitprice()} );
471
            $("#unitprice_currency").on("change", function(){update_unitprice()} );
439
        });
472
        });
440
    </script>
473
    </script>
441
[% END %]
474
[% END %]
442
- 

Return to bug 24158