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

(-)a/Koha/Acquisition/Order.pm (-1 / +2 lines)
Lines 635-641 sub to_api_mapping { Link Here
635
        uncertainprice                => 'uncertain_price',
635
        uncertainprice                => 'uncertain_price',
636
        unitprice                     => 'unit_price',
636
        unitprice                     => 'unit_price',
637
        unitprice_tax_excluded        => 'unit_price_tax_excluded',
637
        unitprice_tax_excluded        => 'unit_price_tax_excluded',
638
        unitprice_tax_included        => 'unit_price_tax_included'
638
        unitprice_tax_included        => 'unit_price_tax_included',
639
        invoice_unitprice             => 'invoice_unit_price',
639
    };
640
    };
640
}
641
}
641
642
(-)a/acqui/finishreceive.pl (-5 / +27 lines)
Lines 51-56 my $quantity = $input->param('quantity'); Link Here
51
my $unitprice        = $input->param('unitprice');
51
my $unitprice        = $input->param('unitprice');
52
my $replacementprice = $input->param('replacementprice');
52
my $replacementprice = $input->param('replacementprice');
53
my $datereceived     = $input->param('datereceived');
53
my $datereceived     = $input->param('datereceived');
54
my $invoice_unitprice = $input->param('invoice_unitprice');
55
my $invoice_currency = $input->param('invoice_currency');
54
my $invoiceid        = $input->param('invoiceid');
56
my $invoiceid        = $input->param('invoiceid');
55
my $invoice          = GetInvoice($invoiceid);
57
my $invoice          = GetInvoice($invoiceid);
56
my $invoiceno        = $invoice->{invoicenumber};
58
my $invoiceno        = $invoice->{invoicenumber};
Lines 98-107 if ($quantityrec > $origquantityrec ) { Link Here
98
        }
100
        }
99
    }
101
    }
100
102
101
    $order_obj->order_internalnote(scalar $input->param("order_internalnote"));
103
    $order_obj->set(
102
    $order_obj->tax_rate_on_receiving(scalar $input->param("tax_rate"));
104
        {
103
    $order_obj->replacementprice($replacementprice);
105
            order_internalnote    => scalar $input->param("order_internalnote"),
104
    $order_obj->unitprice($unitprice);
106
            tax_rate_on_receiving => scalar $input->param("tax_rate"),
107
            replacementprice      => $replacementprice,
108
            unitprice             => $unitprice,
109
            (
110
                defined $invoice_unitprice && $invoice_unitprice ne ''
111
                ? (
112
                    invoice_unitprice => $invoice_unitprice,
113
                    invoice_currency  => $invoice_currency,
114
                  )
115
                : ()
116
            ),
117
        }
118
    );
105
119
106
    $order_obj->populate_with_prices_for_receiving();
120
    $order_obj->populate_with_prices_for_receiving();
107
121
Lines 189-195 if (C4::Context->preference("AcquisitionLog")) { Link Here
189
        bookfund         => $bookfund || 'unchanged',
203
        bookfund         => $bookfund || 'unchanged',
190
        tax_rate         => $input->param("tax_rate"),
204
        tax_rate         => $input->param("tax_rate"),
191
        replacementprice => $replacementprice,
205
        replacementprice => $replacementprice,
192
        unitprice        => $unitprice
206
        unitprice        => $unitprice,
207
        (
208
            defined $invoice_unitprice && $invoice_unitprice ne ''
209
            ? (
210
                invoice_unitprice => $invoice_unitprice,
211
                invoice_currency  => $invoice_currency,
212
              )
213
            : ()
214
        ),
193
    };
215
    };
194
216
195
    logaction(
217
    logaction(
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-10 / +9 lines)
Lines 428-440 Link Here
428
            <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
428
            <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
429
        </li>
429
        </li>
430
        <li id="select_currency">
430
        <li id="select_currency">
431
            <label for="unitprice_currency"></label>
431
            <label for="invoice_unitprice"></label>
432
            <input type="text" size="20" name="unitprice" id="unitprice_currency" value="" />
432
            <input type="text" size="20" name="invoice_unitprice" id="invoice_unitprice" value="" />
433
            [% IF currencies.count %]
433
            [% IF currencies.count %]
434
                <select name="currency">
434
                <select name="invoice_currency">
435
                    <option value="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
435
                    <option value="[% active_currency.currency | html %]" data-rate="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
436
                    [% FOR currency IN currencies %]
436
                    [% FOR currency IN currencies %]
437
                        <option value="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option>
437
                        <option value="[% currency.currency | html%]" data-rate="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option>
438
                    [% END %]
438
                    [% END %]
439
                </select>
439
                </select>
440
            [% END %]
440
            [% END %]
Lines 608-620 Link Here
608
            }).change();
608
            }).change();
609
609
610
            function update_unitprice() {
610
            function update_unitprice() {
611
                var rate = Number($("select[name='currency'] option:selected").val());
611
                var rate = Number($("select[name='invoice_currency'] option:selected").data('rate'));
612
                var unitprice = $("#unitprice_currency").val();
612
                var unitprice = $("#invoice_unitprice").val();
613
                var new_unitprice = Number( unitprice * rate ).toFixed(2);
613
                var new_unitprice = Number( unitprice * rate ).toFixed(2);
614
                $("#unitprice").val(new_unitprice);
614
                $("#unitprice").val(new_unitprice);
615
            }
615
            }
616
            $("select[name='currency']").on("change", function(){update_unitprice()} );
616
            $("select[name='invoice_currency']").on("change", function(){update_unitprice()} );
617
            $("#unitprice_currency").on("change", function(){update_unitprice()} );
617
            $("#invoice_unitprice").on("change", function(){update_unitprice()} );
618
618
619
            [% IF other_reason %]
619
            [% IF other_reason %]
620
                $(".select-reason").hide();
620
                $(".select-reason").hide();
621
- 

Return to bug 25655