From f3412733c1cc375e9413478a1df387f4d2829fdd Mon Sep 17 00:00:00 2001 From: einhverfr Date: Tue, 24 Apr 2007 21:36:14 +0000 Subject: Updating version strings following release of 1.2.4. Also adding fix for partsgroup handling. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1097 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Form.pm | 11 +++++++++-- LedgerSMB/IS.pm | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'LedgerSMB') diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index bb0a5ab7..fbf678af 100755 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -80,7 +80,7 @@ sub new { #menubar will be deprecated, replaced with below $self->{lynx} = 1 if $self->{path} =~ /lynx/i; - $self->{version} = "1.2.4"; + $self->{version} = "1.2.5"; $self->{dbversion} = "1.2.0"; bless $self, $type; @@ -515,7 +515,7 @@ sub parse_amount { my ( $self, $myconfig, $amount ) = @_; - if ( ( $amount eq '' ) or ( $amount eq undef ) ) { + if ( ( $amount eq '' ) or ( ! defined $amount ) ) { $amount = 0; } @@ -548,7 +548,14 @@ sub parse_amount { $amount = $1 * -1; } $amount =~ s/\s?CR//; + + $amount =~ /(\d*)\.(\d*)/; + + my $decimalplaces = length $1 + length $2; + $amount = new Math::BigFloat($amount); + $amount->accuracy($decimalplaces); + return ( $amount * 1 ); } diff --git a/LedgerSMB/IS.pm b/LedgerSMB/IS.pm index 7e6ed8a2..c192c255 100755 --- a/LedgerSMB/IS.pm +++ b/LedgerSMB/IS.pm @@ -1875,8 +1875,7 @@ sub retrieve_item { if ( $form->{"partsgroup_$i"} ne "" ) { ( $null, $var ) = split /--/, $form->{"partsgroup_$i"}; - $var = $dbh->quote($var); - if ( $var == 0 ) { + if ( ! $var ) { # search by partsgroup, this is for the POS $where .= @@ -1884,6 +1883,7 @@ sub retrieve_item { . $dbh->quote( $form->{"partsgroup_$i"} ); } else { + $var = $dbh->quote($var); $where .= qq| AND p.partsgroup_id = $var|; } } -- cgit v1.2.3