-my $gist = $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
-my $discount =
- $bookseller->{'discount'} ? ( $bookseller->{discount} / 100 ) : 0;
-my $total_est_gste;
-my $total_est_gsti;
-my $total_rrp_gsti; # RRP Total, GST included
-my $total_rrp_gste; # RRP Total, GST excluded
-my $gist_est;
-my $gist_rrp;
-if ($gist) {
-
- # if we have GST
- if ( $bookseller->{'listincgst'} ) {
-
- # if prices already includes GST
-
- # we know $total_rrp_gsti
- $total_rrp_gsti = $total_rrp;
-
- # and can reverse compute other values
- $total_rrp_gste = $total_rrp_gsti / ( $gist + 1 );
-
- $gist_rrp = $total_rrp_gsti - $total_rrp_gste;
- $total_est_gste = $total_rrp_gste - ( $total_rrp_gste * $discount );
- $total_est_gsti = $total_est;
- }
- else {
- # if prices does not include GST
-
- # then we use the common way to compute other values
- $total_rrp_gste = $total_rrp;
- $gist_rrp = $total_rrp_gste * $gist;
- $total_rrp_gsti = $total_rrp_gste + $gist_rrp;
- $total_est_gste = $total_est;
- $total_est_gsti = $total_rrp_gsti - ( $total_rrp_gsti * $discount );
- }
- $gist_est = $gist_rrp - ( $gist_rrp * $discount );
-}
-else {
- $total_rrp_gste = $total_rrp_gsti = $total_rrp;
- $total_est_gste = $total_est_gsti = $total_est;
- $gist_rrp = $gist_est = 0;
-}
-my $total_gsti_shipment = $total_est_gsti + $details->{shipmentcost};