summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-12-05 23:57:15 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-12-05 23:57:15 +0000
commitfae60af4c1ba1aa7b5a96d82c1d09fb48a73fe44 (patch)
tree69db38ce8300cd94b6f12d24ebf945c80cdc6bee /LedgerSMB
parent0d9247df986a106e6ae869b1eed6b55c108ce932 (diff)
Fixing inability to add assembly items
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@730 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-xLedgerSMB/IC.pm16
1 files changed, 11 insertions, 5 deletions
diff --git a/LedgerSMB/IC.pm b/LedgerSMB/IC.pm
index d4eb2a6e..feb7dd7a 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"} || 0,
+ $form->{"adj_$i"}
+ ) || $form->dberror($query);
+ }
}
}
# adjust onhand for the parts