return scalar(@{ $self->{name_list} });
}
-# the selection sub is used in the AR, AP, IS, IR, DO and OE module
-#
-sub all_vc {
- $main::lxdebug->enter_sub();
-
- my ($self, $myconfig, $table, $module) = @_;
-
- my $ref;
- my $dbh = $self->get_standard_dbh;
-
- $table = $table eq "customer" ? "customer" : "vendor";
-
- # build selection list
- # Hotfix für Bug 1837 - Besser wäre es alte Buchungsbelege
- # OHNE Auswahlliste (reines Textfeld) zu laden. Hilft aber auch
- # nicht für veränderbare Belege (oe, do, ...)
- my $obsolete = $self->{id} ? '' : "WHERE NOT obsolete";
- my $query = qq|SELECT count(*) FROM $table $obsolete|;
- my ($count) = selectrow_query($self, $dbh, $query);
-
- if ($count <= $myconfig->{vclimit}) {
- $query = qq|SELECT id, name, salesman_id
- FROM $table $obsolete
- ORDER BY name|;
- $self->{"all_$table"} = selectall_hashref_query($self, $dbh, $query);
- }
-
- # get self
- $self->get_employee($dbh);
-
- # setup sales contacts
- $query = qq|SELECT e.id, e.name
- FROM employee e
- WHERE (e.sales = '1') AND (NOT e.id = ?)
- ORDER BY name|;
- $self->{all_employees} = selectall_hashref_query($self, $dbh, $query, $self->{employee_id});
-
- # this is for self
- push(@{ $self->{all_employees} },
- { id => $self->{employee_id},
- name => $self->{employee} });
-
- # prepare query for departments
- $query = qq|SELECT id, description
- FROM department
- ORDER BY description|;
-
- $self->{all_departments} = selectall_hashref_query($self, $dbh, $query);
-
- # get languages
- $query = qq|SELECT id, description
- FROM language
- ORDER BY id|;
-
- $self->{languages} = selectall_hashref_query($self, $dbh, $query);
-
- # get printer
- $query = qq|SELECT printer_description, id
- FROM printers
- ORDER BY printer_description|;
-
- $self->{printers} = selectall_hashref_query($self, $dbh, $query);
-
- # get payment terms
- $query = qq|SELECT id, description
- FROM payment_terms
- WHERE ( obsolete IS FALSE OR id = ? )
- ORDER BY sortkey |;
- $self->{payment_terms} = selectall_hashref_query($self, $dbh, $query, $self->{payment_id} || undef);
-
- $main::lxdebug->leave_sub();
-}
-
sub new_lastmtime {
$main::lxdebug->enter_sub();