+ my ($subq_inventory, $subq_expense, $subq_income);
+ if ($form->{"item"} eq "part") {
+ $subq_inventory =
+ qq|(SELECT bg.inventory_accno_id | .
+ qq| FROM buchungsgruppen bg | .
+ qq| WHERE bg.id = | . $dbh->quote($form->{"buchungsgruppen_id"}) . qq|)|;
+ } else {
+ $subq_inventory = "NULL";
+ }
+
+ if ($form->{"item"} ne "assembly") {
+ $subq_expense =
+ qq|(SELECT bg.expense_accno_id_0 | .
+ qq| FROM buchungsgruppen bg | .
+ qq| WHERE bg.id = | . $dbh->quote($form->{"buchungsgruppen_id"}) . qq|)|;
+ } else {
+ $subq_expense = "NULL";
+ }
+
+ $subq_income =
+ qq|(SELECT bg.income_accno_id_0 | .
+ qq| FROM buchungsgruppen bg | .
+ qq| WHERE bg.id = | . $dbh->quote($form->{"buchungsgruppen_id"}) . qq|)|;
+