Fix use of 'gstrate' for 'tax_rate'
Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
# in this case, the price will be x100 when unformatted ! Replace the . by a , to get a proper price calculation
$price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR";
$price = Koha::Number::Price->new($price)->unformat;
# in this case, the price will be x100 when unformatted ! Replace the . by a , to get a proper price calculation
$price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR";
$price = Koha::Number::Price->new($price)->unformat;
- $orderinfo{gstrate} = $bookseller->{gstrate};
- my $c = $c_discount ? $c_discount : $bookseller->{discount} / 100;
- if ( $bookseller->{listincgst} ) {
+ $orderinfo{tax_rate} = $bookseller->tax_rate;
+ my $c = $c_discount ? $c_discount : $bookseller->discount / 100;
+ if ( $bookseller->listincgst ) {
if ( $c_discount ) {
$orderinfo{ecost} = $price;
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c );
if ( $c_discount ) {
$orderinfo{ecost} = $price;
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c );
}
} else {
if ( $c_discount ) {
}
} else {
if ( $c_discount ) {
- $orderinfo{ecost} = $price / ( 1 + $orderinfo{gstrate} );
+ $orderinfo{ecost} = $price / ( 1 + $orderinfo{tax_rate} );
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c );
} else {
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c );
} else {
- $orderinfo{rrp} = $price / ( 1 + $orderinfo{gstrate} );
+ $orderinfo{rrp} = $price / ( 1 + $orderinfo{tax_rate} );
$orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $c );
}
}
$orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $c );
}
}
# in this case, the price will be x100 when unformatted ! Replace the . by a , to get a proper price calculation
$price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR";
$price = Koha::Number::Price->new($price)->unformat;
# in this case, the price will be x100 when unformatted ! Replace the . by a , to get a proper price calculation
$price =~ s/\./,/ if C4::Context->preference("CurrencyFormat") eq "FR";
$price = Koha::Number::Price->new($price)->unformat;
- $orderinfo{gstrate} = $bookseller->{gstrate};
- my $c = $c_discount ? $c_discount : $bookseller->{discount} / 100;
- if ( $bookseller->{listincgst} ) {
+ $orderinfo{tax_rate} = $bookseller->tax_rate;
+ my $c = $c_discount ? $c_discount : $bookseller->discount / 100;
+ if ( $bookseller->listincgst ) {
if ( $c_discount ) {
$orderinfo{ecost} = $price;
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c );
if ( $c_discount ) {
$orderinfo{ecost} = $price;
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c );
}
} else {
if ( $c_discount ) {
}
} else {
if ( $c_discount ) {
- $orderinfo{ecost} = $price / ( 1 + $orderinfo{gstrate} );
+ $orderinfo{ecost} = $price / ( 1 + $orderinfo{tax_rate} );
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c );
} else {
$orderinfo{rrp} = $orderinfo{ecost} / ( 1 - $c );
} else {
- $orderinfo{rrp} = $price / ( 1 + $orderinfo{gstrate} );
+ $orderinfo{rrp} = $price / ( 1 + $orderinfo{tax_rate} );
$orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $c );
}
}
$orderinfo{ecost} = $orderinfo{rrp} * ( 1 - $c );
}
}
entrydate => '01-01-2014',
currency => 'EUR',
notes => "This is a note1",
entrydate => '01-01-2014',
currency => 'EUR',
notes => "This is a note1",
orderstatus => 1,
quantityreceived => 0,
rrp => 10,
orderstatus => 1,
quantityreceived => 0,
rrp => 10,