Bugzilla – Attachment 4005 Details for
Bug 6268
Bad Total in basket.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
0001-MT-6408-Bad-Total-in-basket.pl.patch (text/plain), 4.11 KB, created by
Christophe Croullebois
on 2011-04-26 08:53:42 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Christophe Croullebois
Created:
2011-04-26 08:53:42 UTC
Size:
4.11 KB
patch
obsolete
>From c4d4bc398b77d705f9750da3dd5cef3f2c3032ad Mon Sep 17 00:00:00 2001 >From: Christophe Croullebois <christophe.croullebois@biblibre.com> >Date: Tue, 26 Apr 2011 09:52:09 +0200 >Subject: [PATCH 1/1] (MT #6408) Bad Total in basket.pl > >The total_est_gste or gsti is computed on the total_rrp_gste or gsti. >But in the budget this amount is the summ of discounts computed for each line. >Due to the rounding to 2 decimal places this produces a difference in Funds view with Total sublevels spent. >--- > acqui/basket.pl | 41 ++++++++++++++++++++++++++--------------- > 1 files changed, 26 insertions(+), 15 deletions(-) > >diff --git a/acqui/basket.pl b/acqui/basket.pl >index d04cf18..9168a1e 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -238,11 +238,13 @@ if ( $op eq 'delete_confirm' ) { > my $count = scalar @results; > > my $gist = $bookseller->{gstrate} || C4::Context->preference("gist") || 0; >+ $gist = 0 if $gist == 0.0000; > my $discount = $bookseller->{'discount'} / 100; > my $total_rrp; # RRP Total, its value will be assigned to $total_rrp_gsti or $total_rrp_gste depending of $bookseller->{'listincgst'} > my $total_rrp_gsti; # RRP Total, GST included > my $total_rrp_gste; # RRP Total, GST excluded > my $gist_rrp; >+ my $total_rrp_est; > > my $qty_total; > my @books_loop; >@@ -259,6 +261,7 @@ if ( $op eq 'delete_confirm' ) { > > $total_rrp += $qty * $results[$i]->{'rrp'}; > my $line_total = $qty * $results[$i]->{'ecost'}; >+ $total_rrp_est += $qty * $results[$i]->{'ecost'}; > > # FIXME: what about the "actual cost" field? > $qty_total += $qty; >@@ -288,21 +291,29 @@ if ( $op eq 'delete_confirm' ) { > push @books_loop, \%line; > } > >- if ( $bookseller->{'listincgst'} ) { # if prices already includes GST >- $total_rrp_gsti = $total_rrp; # we know $total_rrp_gsti >- $total_rrp_gste = $total_rrp_gsti / ( $gist + 1 ); # and can reverse compute other values >- $gist_rrp = $total_rrp_gsti - $total_rrp_gste; # >- } else { # if prices does not include GST >- $total_rrp_gste = $total_rrp; # then we use the common way to compute other values >- $gist_rrp = $total_rrp_gste * $gist; # >- $total_rrp_gsti = $total_rrp_gste + $gist_rrp; # >- } >- >- # These vars are estimated totals and GST, taking in account the booksellet discount >- my $total_est_gsti = $total_rrp_gsti - ( $total_rrp_gsti * $discount ); >- my $gist_est = $gist_rrp - ( $gist_rrp * $discount ); >- my $total_est_gste = $total_rrp_gste - ( $total_rrp_gste * $discount ); >- >+ my $total_est_gste; >+ my $total_est_gsti; >+ my $gist_est; >+ if ($gist){ # if we have GST >+ if ( $bookseller->{'listincgst'} ) { # if prices already includes GST >+ $total_rrp_gsti = $total_rrp; # we know $total_rrp_gsti >+ $total_rrp_gste = $total_rrp_gsti / ( $gist + 1 ); # and can reverse compute other values >+ $gist_rrp = $total_rrp_gsti - $total_rrp_gste; # >+ $total_est_gste = $total_rrp_gste - ( $total_rrp_gste * $discount ); >+ $total_est_gsti = $total_rrp_est; >+ } else { # if prices does not include GST >+ $total_rrp_gste = $total_rrp; # then we use the common way to compute other values >+ $gist_rrp = $total_rrp_gste * $gist; # >+ $total_rrp_gsti = $total_rrp_gste + $gist_rrp; # >+ $total_est_gste = $total_rrp_est; >+ $total_est_gsti = $total_rrp_gsti - ( $total_rrp_gsti * $discount ); >+ } >+ $gist_est = $gist_rrp - ( $gist_rrp * $discount ); >+ } else { >+ $total_rrp_gsti = $total_rrp; >+ $total_est_gsti = $total_rrp_est; >+} >+ > my $contract = &GetContract( $basket->{contractnumber} ); > my @orders = GetOrders($basketno); > $template->param( >-- >1.7.0.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6268
:
4005
|
4124
|
4223
|
4240
|
4241
|
4469
|
4470
|
4532
|
4555