summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-xLedgerSMB/Form.pm11
-rwxr-xr-xLedgerSMB/IS.pm4
2 files changed, 11 insertions, 4 deletions
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|;
}
}