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

(-)a/acqui/addorderiso2709.pl (-7 / +6 lines)
Lines 163-169 if ($op eq ""){ Link Here
163
        my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1;
163
        my $c_quantity = shift( @quantities ) || GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour') ) || 1;
164
        my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id;
164
        my $c_budget_id = shift( @budgets_id ) || $input->param('all_budget_id') || $budget_id;
165
        my $c_discount = shift ( @discount);
165
        my $c_discount = shift ( @discount);
166
        $c_discount = $c_discount / 100 if $c_discount > 1;
167
        my $c_sort1 = shift( @sort1 ) || $input->param('all_sort1') || '';
166
        my $c_sort1 = shift( @sort1 ) || $input->param('all_sort1') || '';
168
        my $c_sort2 = shift( @sort2 ) || $input->param('all_sort2') || '';
167
        my $c_sort2 = shift( @sort2 ) || $input->param('all_sort2') || '';
169
        my $c_replacement_price = shift( @orderreplacementprices );
168
        my $c_replacement_price = shift( @orderreplacementprices );
Lines 276-288 if ($op eq ""){ Link Here
276
                        $price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR";
275
                        $price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR";
277
                        $price = Koha::Number::Price->new($price)->unformat;
276
                        $price = Koha::Number::Price->new($price)->unformat;
278
                        $orderinfo{tax_rate} = $bookseller->tax_rate;
277
                        $orderinfo{tax_rate} = $bookseller->tax_rate;
279
                        my $c = $c_discount ? $c_discount : $bookseller->discount / 100;
278
                        my $c = $c_discount ? $c_discount : $bookseller->discount;
280
                        $orderinfo{discount} = $c;
279
                        $orderinfo{discount} = $c;
281
                        if ( $c_discount ) {
280
                        if ( $c_discount ) {
282
                            $orderinfo{ecost} = $price;
281
                            $orderinfo{ecost} = $price;
283
                            $orderinfo{rrp}   = $orderinfo{ecost} / ( 1 - $c );
282
                            $orderinfo{rrp}   = $orderinfo{ecost} / ( 1 - $c / 100 );
284
                        } else {
283
                        } else {
285
                            $orderinfo{ecost} = $price * ( 1 - $c );
284
                            $orderinfo{ecost} = $price * ( 1 - $c / 100 );
286
                            $orderinfo{rrp}   = $price;
285
                            $orderinfo{rrp}   = $price;
287
                        }
286
                        }
288
                        $orderinfo{listprice} = $orderinfo{rrp} / $active_currency->rate;
287
                        $orderinfo{listprice} = $orderinfo{rrp} / $active_currency->rate;
Lines 337-349 if ($op eq ""){ Link Here
337
                $c_price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR";
336
                $c_price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR";
338
                $c_price = Koha::Number::Price->new($c_price)->unformat;
337
                $c_price = Koha::Number::Price->new($c_price)->unformat;
339
                $orderinfo{tax_rate} = $bookseller->tax_rate;
338
                $orderinfo{tax_rate} = $bookseller->tax_rate;
340
                my $c = $c_discount ? $c_discount : $bookseller->discount / 100;
339
                my $c = $c_discount ? $c_discount : $bookseller->discount;
341
                $orderinfo{discount} = $c;
340
                $orderinfo{discount} = $c;
342
                if ( $c_discount ) {
341
                if ( $c_discount ) {
343
                    $orderinfo{ecost} = $c_price;
342
                    $orderinfo{ecost} = $c_price;
344
                    $orderinfo{rrp}   = $orderinfo{ecost} / ( 1 - $c );
343
                    $orderinfo{rrp}   = $orderinfo{ecost} / ( 1 - $c / 100 );
345
                } else {
344
                } else {
346
                    $orderinfo{ecost} = $c_price * ( 1 - $c );
345
                    $orderinfo{ecost} = $c_price * ( 1 - $c / 100 );
347
                    $orderinfo{rrp}   = $c_price;
346
                    $orderinfo{rrp}   = $c_price;
348
                }
347
                }
349
                $orderinfo{listprice} = $orderinfo{rrp} / $active_currency->rate;
348
                $orderinfo{listprice} = $orderinfo{rrp} / $active_currency->rate;

Return to bug 29607