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

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

Return to bug 29607