Revision 55e9890a
Von David Ohlbrecht vor etwa 15 Jahren hinzugefügt
SL/IS.pm | ||
---|---|---|
1954 | 1954 |
$main::lxdebug->leave_sub(); |
1955 | 1955 |
} |
1956 | 1956 |
|
1957 |
########################## |
|
1958 |
# Get data for the submitted order id |
|
1959 |
# from database |
|
1960 |
# |
|
1961 |
sub get_order_data { |
|
1962 |
|
|
1963 |
$main::lxdebug->enter_sub(); |
|
1964 |
|
|
1965 |
my $self = shift; |
|
1966 |
my $form = $main::form; |
|
1967 |
my %myconfig = %main::myconfig; |
|
1968 |
my $dbh = $form->get_standard_dbh(); |
|
1969 |
|
|
1970 |
my @values = (conv_i($form->{ordnumber})); |
|
1971 |
|
|
1972 |
# We query the database for the fields we need using the submitted "ordnumber" |
|
1973 |
my $query = <<SQL; |
|
1974 |
SELECT o.payment_id, o.salesman_id, o.transdate AS orddate, o.taxzone_id, o.quonumber |
|
1975 |
FROM oe o |
|
1976 |
WHERE o.ordnumber = ?; |
|
1977 |
SQL |
|
1978 |
|
|
1979 |
# Do the actual query and return the results for later processing by our "frontend" |
|
1980 |
my ($result) = selectfirst_hashref_query($form, $dbh, $query, @values); |
|
1981 |
|
|
1982 |
$dbh->disconnect; |
|
1983 |
|
|
1984 |
$main::lxdebug->leave_sub(); |
|
1985 |
|
|
1986 |
return $result; |
|
1987 |
} |
|
1988 |
|
|
1957 | 1989 |
########################## |
1958 | 1990 |
# get pricegroups from database |
1959 | 1991 |
# build up selected pricegroup |
bin/mozilla/is.pl | ||
---|---|---|
155 | 155 |
$ref->{name} = $form->quote($ref->{name}); |
156 | 156 |
} |
157 | 157 |
|
158 |
# Load data for a specific order and update form fields |
|
159 |
my $order_data = IS->get_order_data(); |
|
160 |
|
|
161 |
# Copy the fields we need to %form |
|
162 |
for my $key (qw(payment_id salesman_id orddate taxzone_id quonumber)) { |
|
163 |
$form->{$key} = $order_data->{$key}; |
|
164 |
} |
|
165 |
|
|
158 | 166 |
$form->restore_vars(qw(id)); |
159 | 167 |
|
160 | 168 |
IS->retrieve_invoice(\%myconfig, \%$form); |
... | ... | |
162 | 170 |
$form->restore_vars(qw(taxincluded)) if $form->{id}; |
163 | 171 |
$form->restore_vars(qw(salesman_id)) if $main::editing; |
164 | 172 |
|
173 |
|
|
165 | 174 |
# build vendor/customer drop down comatibility... don't ask |
166 | 175 |
if (@{ $form->{"all_customer"} }) { |
167 | 176 |
$form->{"selectcustomer"} = 1; |
Auch abrufbar als: Unified diff
Zusätzliche Auftragsfelder beim Laden von Rechnungen holen.