@values = ($form->{"sellprice_$i"}, conv_i($form->{"id_$i"}));
do_query($form, $dbh, $query, @values);
- $form->update_balance($dbh, "parts", "onhand", qq|id = ?|, $baseqty, $form->{"id_$i"}) if !$form->{shipped};
-
# check if we sold the item already and
# make an entry for the expense and inventory
$query =
next unless $ref->{inventory_accno_id};
- # update onhand
- $form->update_balance($dbh, "parts", "onhand", qq|id = $ref->{parts_id}|, $ref->{qty});
-
# if $ref->{allocated} > 0 than we sold that many items
next if ($ref->{allocated} <= 0);
my ($self, $myconfig, $form, $params) = @_;
$params = $form unless defined $params && ref $params eq "HASH";
- $main::lxdebug->message(0, Dumper($params));
# connect to database
my $dbh = $form->dbconnect($myconfig);
}
my $query =
qq|SELECT
- v.id, v.name AS vendor, v.creditlimit, v.terms, v.notes AS intnotes,
+ v.name AS vendor, v.creditlimit, v.terms, v.notes AS intnotes,
v.email, v.cc, v.bcc, v.language_id, v.payment_id,
v.street, v.zipcode, v.city, v.country, v.taxzone_id,
$duedate + COALESCE(pt.terms_netto, 0) AS duedate,
$stw->finish();
chop $ref->{taxaccounts};
+ $ref->{onhand} *= 1;
+
push @{ $form->{item_list} }, $ref;
}
map { $form->{$_} = $ref->{$_} } keys %$ref;
+ my $custom_variables = CVar->get_custom_variables('dbh' => $dbh,
+ 'module' => 'CT',
+ 'trans_id' => $form->{vendor_id});
+ map { $form->{"vc_cvar_$_->{name}"} = $_->{value} } @{ $custom_variables };
+
$dbh->disconnect();
$main::lxdebug->leave_sub();