Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 1465da30

Von Sven Schöling vor fast 15 Jahren hinzugefügt

Änderungen zum vorherigen Commit, um die Funktionen rouster zu machen.

Unterschiede anzeigen:

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

  
1989 1957
##########################
1990 1958
# get pricegroups from database
1991 1959
# build up selected pricegroup
SL/OE.pm
1307 1307
  return $value;
1308 1308
}
1309 1309

  
1310
##########################
1311
# Get data for the submitted order id
1312
# from database
1313
#
1314
sub get_order_data_by_ordnumber {
1315
  $main::lxdebug->enter_sub();
1316

  
1317
  my $self      = shift;
1318
  my %params    = @_;
1319

  
1320
  Common::check_params(\%params, qw(ordnumber));
1321

  
1322
  my $form     = $main::form;
1323
  my %myconfig = %main::myconfig;
1324
  my $dbh      = $form->get_standard_dbh();
1325

  
1326
  my @values = ($params{ordnumber});
1327

  
1328
  # We query the database for the fields we need using the submitted "ordnumber"
1329
  my $query = <<SQL;
1330
    SELECT o.payment_id, o.salesman_id, o.transdate AS orddate, o.taxzone_id, o.quonumber
1331
    FROM oe o
1332
    WHERE o.ordnumber = ?;
1333
SQL
1334

  
1335
  # Do the actual query and return the results for later processing by our "frontend"
1336
  my $result = selectfirst_hashref_query($form, $dbh, $query, @values);
1337

  
1338
  $main::lxdebug->leave_sub();
1339

  
1340
  return $result;
1341
}
1342

  
1310 1343
1;
bin/mozilla/is.pl
34 34
use SL::FU;
35 35
use SL::IS;
36 36
use SL::PE;
37
use SL::OE;
37 38
use Data::Dumper;
38 39
use List::Util qw(max sum);
39 40

  
......
156 157
  }
157 158

  
158 159
  # Load data for a specific order and update form fields
159
  my $order_data = IS->get_order_data();
160
  my $order_data = OE->get_order_data_by_ordnumber(%$form);
160 161

  
161 162
  # Copy the fields we need to %form
162 163
  for my $key (qw(payment_id salesman_id orddate taxzone_id quonumber)) {

Auch abrufbar als: Unified diff