|
Lines 259-267
if ($op eq ""){
Link Here
|
| 259 |
# in this case, the price will be x100 when unformatted ! Replace the . by a , to get a proper price calculation |
259 |
# in this case, the price will be x100 when unformatted ! Replace the . by a , to get a proper price calculation |
| 260 |
$price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR"; |
260 |
$price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR"; |
| 261 |
$price = Koha::Number::Price->new($price)->unformat; |
261 |
$price = Koha::Number::Price->new($price)->unformat; |
| 262 |
$orderinfo{gstrate} = $bookseller->{gstrate}; |
262 |
$orderinfo{tax_rate} = $bookseller->tax_rate; |
| 263 |
my $c = $c_discount ? $c_discount : $bookseller->{discount} / 100; |
263 |
my $c = $c_discount ? $c_discount : $bookseller->discount / 100; |
| 264 |
if ( $bookseller->{listincgst} ) { |
264 |
if ( $bookseller->listincgst ) { |
| 265 |
if ( $c_discount ) { |
265 |
if ( $c_discount ) { |
| 266 |
$orderinfo{ecost} = $price; |
266 |
$orderinfo{ecost} = $price; |
| 267 |
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c ); |
267 |
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c ); |
|
Lines 271-280
if ($op eq ""){
Link Here
|
| 271 |
} |
271 |
} |
| 272 |
} else { |
272 |
} else { |
| 273 |
if ( $c_discount ) { |
273 |
if ( $c_discount ) { |
| 274 |
$orderinfo{ecost} = $price / ( 1 + $orderinfo{gstrate} ); |
274 |
$orderinfo{ecost} = $price / ( 1 + $orderinfo{tax_rate} ); |
| 275 |
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c ); |
275 |
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c ); |
| 276 |
} else { |
276 |
} else { |
| 277 |
$orderinfo{rrp} = $price / ( 1 + $orderinfo{gstrate} ); |
277 |
$orderinfo{rrp} = $price / ( 1 + $orderinfo{tax_rate} ); |
| 278 |
$orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $c ); |
278 |
$orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $c ); |
| 279 |
} |
279 |
} |
| 280 |
} |
280 |
} |
|
Lines 327-335
if ($op eq ""){
Link Here
|
| 327 |
# in this case, the price will be x100 when unformatted ! Replace the . by a , to get a proper price calculation |
327 |
# in this case, the price will be x100 when unformatted ! Replace the . by a , to get a proper price calculation |
| 328 |
$price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR"; |
328 |
$price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR"; |
| 329 |
$price = Koha::Number::Price->new($price)->unformat; |
329 |
$price = Koha::Number::Price->new($price)->unformat; |
| 330 |
$orderinfo{gstrate} = $bookseller->{gstrate}; |
330 |
$orderinfo{tax_rate} = $bookseller->tax_rate; |
| 331 |
my $c = $c_discount ? $c_discount : $bookseller->{discount} / 100; |
331 |
my $c = $c_discount ? $c_discount : $bookseller->discount / 100; |
| 332 |
if ( $bookseller->{listincgst} ) { |
332 |
if ( $bookseller->listincgst ) { |
| 333 |
if ( $c_discount ) { |
333 |
if ( $c_discount ) { |
| 334 |
$orderinfo{ecost} = $price; |
334 |
$orderinfo{ecost} = $price; |
| 335 |
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c ); |
335 |
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c ); |
|
Lines 339-348
if ($op eq ""){
Link Here
|
| 339 |
} |
339 |
} |
| 340 |
} else { |
340 |
} else { |
| 341 |
if ( $c_discount ) { |
341 |
if ( $c_discount ) { |
| 342 |
$orderinfo{ecost} = $price / ( 1 + $orderinfo{gstrate} ); |
342 |
$orderinfo{ecost} = $price / ( 1 + $orderinfo{tax_rate} ); |
| 343 |
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c ); |
343 |
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c ); |
| 344 |
} else { |
344 |
} else { |
| 345 |
$orderinfo{rrp} = $price / ( 1 + $orderinfo{gstrate} ); |
345 |
$orderinfo{rrp} = $price / ( 1 + $orderinfo{tax_rate} ); |
| 346 |
$orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $c ); |
346 |
$orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $c ); |
| 347 |
} |
347 |
} |
| 348 |
} |
348 |
} |