diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-05-07 06:02:01 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-05-07 06:02:01 +0000 |
commit | f8f327d55e2c3bb14286ca4ac796917449f8cd3f (patch) | |
tree | 1228ded4a91f756e4dda6a69924bd0b2de16c0d2 /LedgerSMB/OE.pm | |
parent | 882f13b82286fc92d15efaa0a88919bb8febee1a (diff) |
Applying patch to bugs 1699718 and 1713439
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1145 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/OE.pm')
-rwxr-xr-x | LedgerSMB/OE.pm | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/LedgerSMB/OE.pm b/LedgerSMB/OE.pm index 5c253f50..f6a1f6be 100755 --- a/LedgerSMB/OE.pm +++ b/LedgerSMB/OE.pm @@ -220,6 +220,7 @@ sub transactions { my %oid = (); while ( my $ref = $sth->fetchrow_hashref(NAME_lc) ) { + $form->db_parse_numeric(sth=>$sth, hashref=>$ref); $ref->{exchangerate} = 1 unless $ref->{exchangerate}; if ( $ref->{id} != $oid{id}{ $ref->{id} } ) { push @{ $form->{OE} }, $ref; @@ -774,6 +775,7 @@ sub retrieve { $sth->execute( $form->{id} ) || $form->dberror($query); $ref = $sth->fetchrow_hashref(NAME_lc); + $form->db_parse_numeric(sth=>$sth, hashref=>$ref); for ( keys %$ref ) { $form->{$_} = $ref->{$_} } $sth->finish; @@ -848,6 +850,7 @@ sub retrieve { my $listprice; while ( $ref = $sth->fetchrow_hashref(NAME_lc) ) { + $form->db_parse_numeric(sth=>$sth, hashref=>$ref); ($decimalplaces) = ( $ref->{sellprice} =~ /\.(\d+)/ ); $decimalplaces = length $decimalplaces; @@ -941,11 +944,16 @@ sub exchangerate_defaults { # get exchange rates for transdate or max foreach $var ( split /:/, substr( $form->{currencies}, 4 ) ) { $eth1->execute( $var, $form->{transdate} ); - ( $form->{$var} ) = $eth1->fetchrow_array; + my @exchangelist; + @exchangelist = $eth1->fetchrow_array; + $form->db_parse_numeric(sth=>$eth1, arrayref=>\@exchangelist); + $form->{$var} = shift @array; if ( !$form->{$var} ) { $eth2->execute($var); + @exchangelist = $eth2->fetchrow_array; + $form->db_parse_numeric(sth=>$eth2, arrayref=>\@exchangelist); - ( $form->{$var} ) = $eth2->fetchrow_array; + ( $form->{$var} ) = @exchangelist; ( $null, $form->{$var} ) = split / /, $form->{$var}; $form->{$var} = 1 unless $form->{$var}; $eth2->finish; @@ -1116,7 +1124,10 @@ sub order_details { $sth->execute( $form->{"id_$i"}, $form->{warehouse_id} ) || $form->dberror; - ($qty) = $sth->fetchrow_array; + my @qtylist = $sth->fetchrow_array; + $form->db_parse_numeric(sth=>$sth, arrayref=>\@qtylist); + + ($qty) = @qtylist; $sth->fetchrow_array; $sth->finish; $form->{"qty_$i"} = 0 if $qty == 0; @@ -1604,6 +1615,7 @@ sub assembly_details { $sth->execute($id) || $form->dberror($query); while ( my $ref = $sth->fetchrow_hashref(NAME_lc) ) { + $form->db_parse_numeric(sth=>$sth, hashref=>$ref); for (qw(partnumber description partsgroup)) { $form->{"a_$_"} = $ref->{$_}; @@ -1773,7 +1785,9 @@ sub save_inventory { $wth->execute( $form->{"id_$i"}, $warehouse_id ) || $form->dberror; - ($qty) = $wth->fetchrow_array; + @qtylist = $wth->fetchrow_array; + $form->db_parse_numeric(sth=>$wth, arrayref=>\@qtylist); + ($qty) = @qtylist; $wth->finish; if ( $ship > $qty ) { @@ -2065,6 +2079,7 @@ sub get_inventory { $sth->execute || $form->dberror($query); while ( $ref = $sth->fetchrow_hashref(NAME_lc) ) { + $form->db_parse_numeric(sth=>$sth, hashref=>$ref); $ref->{qty} = $ref->{onhand} - $ref->{qty}; push @{ $form->{all_inventory} }, $ref if $ref->{qty} > 0; } @@ -2152,6 +2167,7 @@ sub get_soparts { $sth->execute( $form->{"ndx_$i"} ); while ( $ref = $sth->fetchrow_hashref(NAME_lc) ) { + $form->db_parse_numeric(sth=>$sth, hashref=>$ref); &add_items_required( "", $dbh, $form, $ref->{id}, $ref->{required}, $ref->{assembly} ); } @@ -2187,6 +2203,7 @@ sub add_items_required { $sth->execute || $form->dberror($query); while ( $ref = $sth->fetchrow_hashref(NAME_lc) ) { + $form->db_parse_numeric(sth=> $sth, hashref=> $ref); &add_items_required( "", $dbh, $form, $ref->{id}, $required * $ref->{qty}, $ref->{assembly} ); @@ -2203,6 +2220,7 @@ sub add_items_required { $sth = $dbh->prepare($query); $sth->execute($parts_id) || $form->dberror($query); $ref = $sth->fetchrow_hashref(NAME_lc); + $form->db_parse_numeric(sth=>$sth, hashref=>$ref); for ( keys %$ref ) { $form->{orderitems}{$parts_id}{$_} = $ref->{$_}; } @@ -2291,6 +2309,7 @@ sub generate_orders { $sth = $dbh->prepare($query); $sth->execute($vendor_id) || $form->dberror($query); while ( $ref = $sth->fetchrow_hashref(NAME_lc) ) { + $form->db_parse_numeric(sth=>$sth, hashref=> $ref); $curr = $ref->{curr}; $taxincluded = $ref->{taxincluded}; $tax{ $ref->{accno} } = $ref->{rate}; |