From 55c4e1df7f1b6d4298258516e6c727135470d33d Mon Sep 17 00:00:00 2001 From: Christophe Croullebois Date: Mon, 18 Mar 2013 18:46:03 +0100 Subject: [PATCH 1/1] Bug 9923 - correction of a bug due to bz 7129 See comments in the patch Signed-off-by: Mathieu Saby Signed-off-by: Paul Poulain **rebased for 3.8.x** --- acqui/orderreceive.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl index 7203d2d..a7c04b3 100755 --- a/acqui/orderreceive.pl +++ b/acqui/orderreceive.pl @@ -163,7 +163,6 @@ if ( $count == 1 ) { quantityreceived => @$results[0]->{'quantityreceived'}, rrp => @$results[0]->{'rrp'}, ecost => sprintf( "%.2f",$order->{'ecost'}), - unitprice => sprintf( "%.2f",$order->{'unitprice'}), memberfirstname => $member->{firstname} || "", membersurname => $member->{surname} || "", invoice => $invoice, @@ -174,6 +173,15 @@ if ( $count == 1 ) { surnamesuggestedby => $suggestion->{surnamesuggestedby}, firstnamesuggestedby => $suggestion->{firstnamesuggestedby}, ); + + # regardless of the content of 'unitprice' e.g 0 or '' or any string will return in these cases 0.00 + # and the 'IF' in the .tt will show 0.00 and not 'ecost' (see BZ 7129) + # So if 'unitprice' == 0 we don't create unitprice + if ( $order->{'unitprice'} != 0) { + $template->param( + unitprice => sprintf( "%.2f",$order->{'unitprice'}), + ); + } } else { my @loop; -- 1.7.9.5