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__
+
+ =head1 NAME
+
+ OE.pm - Order entry module
+
+ =head1 DESCRIPTION
+
+ OE.pm is part of the OE module. OE is responsible for sales and purchase orders, as well as sales quotations and purchase requests. This file abstracts the database tables C<oe> and C<orderitems>.
+
+ =head1 FUNCTIONS
+
+ =over 4
+
+ =item retrieve_simple PARAMS
+
+ simple OE retrieval by id. does not look up customer, vendor, units or any other stuff. only oe and orderitems.
+
+ my $order = retrieve_simple(id => 2);
+
+ $order => {
+ %_OE_CONTENT,
+ orderitems => [
+ %_ORDERITEM_ROW_1,
+ %_ORDERITEM_ROW_2,
+ ...
+ ]
+ }
+
+ =back
+
+ =cut