summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-24 21:36:14 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-24 21:36:14 +0000
commitf3412733c1cc375e9413478a1df387f4d2829fdd (patch)
tree314a5ffd3715bcc6d5ccea579ce0ee27ce0d2007 /LedgerSMB
parent365342d80e6089935d0c977936c2cd36526c8ded (diff)
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
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|;
}
}