Revision 8c7e4493
Von Moritz Bunkus vor fast 17 Jahren hinzugefügt
SL/IC.pm | ||
---|---|---|
33 | 33 |
#====================================================================== |
34 | 34 |
|
35 | 35 |
package IC; |
36 |
|
|
36 | 37 |
use Data::Dumper; |
38 |
use YAML; |
|
39 |
|
|
37 | 40 |
use SL::DBUtils; |
38 | 41 |
|
39 | 42 |
sub get_part { |
... | ... | |
63 | 66 |
# copy to $form variables |
64 | 67 |
map { $form->{$_} = $ref->{$_} } (keys %{$ref}); |
65 | 68 |
|
69 |
$form->{onhand} *= 1; |
|
70 |
|
|
66 | 71 |
my %oid = ('Pg' => 'a.oid', |
67 | 72 |
'Oracle' => 'a.rowid'); |
68 | 73 |
|
... | ... | |
1829 | 1834 |
$main::lxdebug->leave_sub(2); |
1830 | 1835 |
} |
1831 | 1836 |
|
1837 |
sub get_basic_part_info { |
|
1838 |
$main::lxdebug->enter_sub(); |
|
1839 |
|
|
1840 |
my $self = shift; |
|
1841 |
my %params = @_; |
|
1842 |
|
|
1843 |
Common::check_params(\%params, qw(id)); |
|
1844 |
|
|
1845 |
my @ids = 'ARRAY' eq ref $params{id} ? @{ $params{id} } : ($params{id}); |
|
1846 |
|
|
1847 |
if (!scalar @ids) { |
|
1848 |
$main::lxdebug->leave_sub(); |
|
1849 |
return (); |
|
1850 |
} |
|
1851 |
|
|
1852 |
my $myconfig = \%main::myconfig; |
|
1853 |
my $form = $main::form; |
|
1854 |
|
|
1855 |
my $dbh = $form->get_standard_dbh($myconfig); |
|
1856 |
|
|
1857 |
my $query = qq|SELECT id, partnumber, description, unit FROM parts WHERE id IN (| . join(', ', ('?') x scalar(@ids)) . qq|)|; |
|
1858 |
|
|
1859 |
my $info = selectall_hashref_query($form, $dbh, $query, map { conv_i($_) } @ids); |
|
1860 |
|
|
1861 |
if ($params{vendor_id}) { |
|
1862 |
$query = qq|SELECT * FROM parts_vendor WHERE (parts_id = ?) AND (vendor_id = ?)|; |
|
1863 |
my $sth = prepare_query($form, $dbh, $query); |
|
1864 |
|
|
1865 |
foreach my $part (@{ $info }) { |
|
1866 |
do_statement($form, $sth, $query, $part->{id}, conv_i($params{vendor_id})); |
|
1867 |
$part->{vendor_info} = $sth->fetchrow_hashref(); |
|
1868 |
} |
|
1869 |
|
|
1870 |
$sth->finish(); |
|
1871 |
} |
|
1872 |
|
|
1873 |
if ('' eq ref $params{id}) { |
|
1874 |
$info = $info->[0] || { }; |
|
1875 |
|
|
1876 |
$main::lxdebug->leave_sub(); |
|
1877 |
return $info; |
|
1878 |
} |
|
1879 |
|
|
1880 |
my %info_map = map { $_->{id} => $_ } @{ $info }; |
|
1881 |
|
|
1882 |
$main::lxdebug->leave_sub(); |
|
1883 |
|
|
1884 |
return %info_map; |
|
1885 |
} |
|
1886 |
|
|
1887 |
|
|
1832 | 1888 |
1; |
Auch abrufbar als: Unified diff
Umstellung der Benutzerverwaltung von Dateien im Verzeichnis "users" auf die Verwendung einer Authentifizierungsdatenbank.
Es ist erforderlich, die Dateien doc/UPGRADE und doc/INSTALL/index.html zu lesen und die angesprochenen Punkte auszuführen, um nach einem Upgrade weiter arbeiten zu können.