Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9bc40390

Von Sven Schöling vor mehr als 15 Jahren hinzugefügt

  • ID 9bc403900c57c9bc3afd5a1a429d2e1f71dd8aa6
  • Vorgänger d370f2a1
  • Nachfolger 879070c7

sub retrieve_simple. (ersatz für OE->retrieve)

Unterschiede anzeigen:

SL/OE.pm
41 41
use SL::DBUtils;
42 42
use SL::IC;
43 43

  
44
=head1 NAME
45

  
46
OE.pm - Order entry module
47

  
48
=head1 DESCRIPTION
49

  
50
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>.
51

  
52
=head1 FUNCTIONS
53

  
54
=over 4
55

  
56
=cut
57

  
44 58
sub transactions {
45 59
  $main::lxdebug->enter_sub();
46 60

  
......
736 750
                                         "quonumber" : "ordnumber"};
737 751

  
738 752
    # set all entries for multiple ids blank that yield different information
739
    while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
753
    while ($ref = $sth->fetchrow_hashref("NAME_lc")) {
740 754
      map { $form->{$_} = '' if ($ref->{$_} ne $form->{$_}) } keys %$ref;
741 755
    }
742 756

  
......
930 944
  return $rc;
931 945
}
932 946

  
947
=item retrieve_simple PARAMS
948

  
949
simple OE retrieval by id. does not look up customer, vendor, units or any other stuff. only oe and orderitems.
950

  
951
  my $order = retrieve_simple(id => 2);
952

  
953
  $order => {
954
    %_OE_CONTENT,
955
    orderitems => [
956
      %_ORDERITEM_ROW_1,
957
      %_ORDERITEM_ROW_2,
958
      ...
959
    ]
960
  }
961

  
962
=cut
963
sub retrieve_simple {
964
  $main::lxdebug->enter_sub();
965

  
966
  my $self     = shift;
967
  my %params   = @_;
968

  
969
  Common::check_params(\%params, qw(id));
970

  
971
  my $myconfig    = \%main::myconfig;
972
  my $form        = $main::form;
973

  
974
  my $dbh         = $params{dbh} || $form->get_standard_dbh($myconfig);
975

  
976
  my $oe_query    = qq|SELECT * FROM oe         WHERE id = ?|;
977
  my $oi_query    = qq|SELECT * FROM orderitems WHERE trans_id = ?|;
978

  
979
  my ($order)          = selectall_array_query($form, $dbh, $oe_query, conv_i($params{id}));
980
  $order->{orderitems} = selectall_array_query($form, $dbh, $oi_query, conv_i($params{id}));
981

  
982
  $main::lxdebug->leave_sub();
983

  
984
  return $order;
985
}
986

  
933 987
sub order_details {
934 988
  $main::lxdebug->enter_sub();
935 989

  

Auch abrufbar als: Unified diff