return $value;
}
-##########################
-# Get data for the submitted order id
-# from database
-#
-sub get_order_data_by_ordnumber {
- $main::lxdebug->enter_sub();
-
- my $self = shift;
- my %params = @_;
-
- Common::check_params(\%params, qw(ordnumber));
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $dbh = $form->get_standard_dbh();
-
- my @values = ($params{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);
-
- $main::lxdebug->leave_sub();
-
- return $result;
-}
-
1;
__END__
$ref->{name} = $form->quote($ref->{name});
}
- # Load data for a specific order and update form fields
- my $order_data = OE->get_order_data_by_ordnumber(%$form) if $form->{ordnumber};
-
- # Copy the fields we need to %form
- for my $key (qw(payment_id salesman_id orddate taxzone_id quonumber)) {
- $form->{$key} = $order_data->{$key};
- }
-
$form->restore_vars(qw(id));
IS->retrieve_invoice(\%myconfig, \%$form);