push @{ $form->{TEMPLATE_ARRAYS}->{longdescription} }, $form->{"longdescription_$i"};
push @{ $form->{TEMPLATE_ARRAYS}->{qty} }, $form->format_amount($myconfig, $form->{"qty_$i"});
push @{ $form->{TEMPLATE_ARRAYS}->{unit} }, $form->{"unit_$i"};
- push @{ $form->{TEMPLATE_ARRAYS}->{deliverydate_oe} }, $form->{"deliverydate_$i"};
+ push @{ $form->{TEMPLATE_ARRAYS}->{deliverydate_oe} }, $form->{"reqdate_$i"};
push @{ $form->{TEMPLATE_ARRAYS}->{sellprice} }, $form->{"sellprice_$i"};
push @{ $form->{TEMPLATE_ARRAYS}->{ordnumber_oe} }, $form->{"ordnumber_$i"};
push @{ $form->{TEMPLATE_ARRAYS}->{transdate_oe} }, $form->{"transdate_$i"};
conv_i($form->{"id"}));
do_query($form, $dbh, $query, @values);
- if($form->{"formname"} eq "credit_note") {
- for my $i (1 .. $form->{rowcount}) {
- $query = qq|UPDATE parts SET onhand = onhand - ? WHERE id = ?|;
- @values = (conv_i($form->{"qty_$i"}), conv_i($form->{"id_$i"}));
- do_query($form, $dbh, $query, @values);
- }
- }
if ($form->{storno}) {
$query =
#Es soll auch nach EAN gesucht werden, ohne Einschränkung durch Beschreibung
if ($form->{"partnumber_$i"} && !$form->{"description_$i"}) {
- $where .= qq| OR (NOT p.obsolete = '1' AND p.ean = ? )|;
- push @values, $form->{"partnumber_$i"};
+ $where .= qq| OR (NOT p.obsolete = '1' AND p.ean = ? )|;
+ push @values, $form->{"partnumber_$i"};
}
if ($form->{"description_$i"}) {
$main::lxdebug->leave_sub();
}
-##########################
-# Get data for the submitted order id
-# from database
-#
-sub get_order_data {
-
- $main::lxdebug->enter_sub();
-
- my $self = shift;
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $dbh = $form->get_standard_dbh();
-
- my @values = (conv_i($form->{ordnumber}));
-
- # We query the database for the fields we need using the submitted "ordnumber"
- my $query = <<SQL;
- SELECT o.payment_id, o.salesman_id, o.transdate AS orddate, o.taxzone_id, o.quonumber
- FROM oe o
- WHERE o.ordnumber = ?;
-SQL
-
- # Do the actual query and return the results for later processing by our "frontend"
- my ($result) = selectfirst_hashref_query($form, $dbh, $query, @values);
-
- $dbh->disconnect;
-
- $main::lxdebug->leave_sub();
-
- return $result;
-}
-
##########################
# get pricegroups from database
# build up selected pricegroup