diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-12-05 23:56:56 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2006-12-05 23:56:56 +0000 |
commit | 2e36152c2063373a4d6518f4802209993bb9f929 (patch) | |
tree | 0186ed456a31311251aeb9114458aa7b4d57efee /LedgerSMB | |
parent | bb0c715f055e7dde799e65cbbf70be93eb0322e9 (diff) |
Fixing inability to add assembly items
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@729 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-x | LedgerSMB/IC.pm | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/LedgerSMB/IC.pm b/LedgerSMB/IC.pm index cae04679..9af025f0 100755 --- a/LedgerSMB/IC.pm +++ b/LedgerSMB/IC.pm @@ -479,11 +479,17 @@ sub save { for $i (1 .. $form->{assembly_rows}) { $form->{"qty_$i"} = $form->parse_amount( $myconfig, $form->{"qty_$i"}); - $sth->execute( - $form->{id}, $form->{"id_$i"}, - $form->{"qty_$i"}, $form->{"bom_$i"}, - $form->{"adj_$i"} - ) || $form->dberror($query); + if(!$form->{"bom_$i"}){ + $form->{"bom_$i"} = undef; + } + + if ($form->{"id_$i"} && $form->{"qty_$i"}){ + $sth->execute( + $form->{id}, $form->{"id_$i"}, + $form->{"qty_$i"}, $form->{"bom_$i"}, + $form->{"adj_$i"} + ) || $form->dberror($query); + } } } # adjust onhand for the parts |