Revision 6f1b36cf
Von Sven Schöling vor mehr als 10 Jahren hinzugefügt
SL/IR.pm | ||
---|---|---|
1191 | 1191 |
$where .= " AND lower(${table_column}) LIKE lower(?)"; |
1192 | 1192 |
push @values, '%' . $form->{"${field}_${i}"} . '%'; |
1193 | 1193 |
} |
1194 |
#Es soll auch nach EAN gesucht werden, ohne Einschränkung durch Beschreibung |
|
1194 |
|
|
1195 |
my (%mm_by_id); |
|
1195 | 1196 |
if ($form->{"partnumber_$i"} && !$form->{"description_$i"}) { |
1196 |
$where .= qq| OR (NOT p.obsolete = '1' AND p.ean = ? )|; |
|
1197 |
push @values, $form->{"partnumber_$i"}; |
|
1198 |
} |
|
1197 |
$where .= qq| OR (NOT p.obsolete = '1' AND p.ean = ? )|; |
|
1198 |
push @values, $form->{"partnumber_$i"}; |
|
1199 |
|
|
1200 |
# also search hits in makemodels, but only cache the results by id and merge later |
|
1201 |
my $mm_query = qq| |
|
1202 |
SELECT parts_id, model FROM makemodel |
|
1203 |
LEFT JOIN parts ON parts.id = parts_id |
|
1204 |
WHERE NOT parts.obsolete AND model ILIKE ? AND (make IS NULL OR make = ?); |
|
1205 |
|; |
|
1206 |
my $mm_results = selectall_hashref_query($::form, $dbh, $mm_query, '%' . $form->{"partnumber_$i"} . '%', $::form->{vendor_id}); |
|
1207 |
my @mm_ids = map { $_->{parts_id} } @$mm_results; |
|
1208 |
push @{$mm_by_id{ $_->{parts_id} } ||= []}, $_ for @$mm_results; |
|
1209 |
|
|
1210 |
if (@mm_ids) { |
|
1211 |
$where .= qq| OR p.id IN (| . join(',', ('?') x @mm_ids) . qq|)|; |
|
1212 |
push @values, @mm_ids; |
|
1213 |
} |
|
1214 |
} |
|
1199 | 1215 |
|
1200 | 1216 |
# Search for part ID overrides all other criteria. |
1201 | 1217 |
if ($form->{"id_${i}"}) { |
... | ... | |
1227 | 1243 |
p.unit, p.assembly, p.onhand, p.formel, |
1228 | 1244 |
p.notes AS partnotes, p.notes AS longdescription, p.not_discountable, |
1229 | 1245 |
p.inventory_accno_id, p.price_factor_id, |
1246 |
p.ean, |
|
1230 | 1247 |
|
1231 | 1248 |
pfac.factor AS price_factor, |
1232 | 1249 |
|
... | ... | |
1278 | 1295 |
$form->{item_list} = []; |
1279 | 1296 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { |
1280 | 1297 |
|
1298 |
if ($mm_by_id{$ref->{id}}) { |
|
1299 |
$ref->{makemodels} = $mm_by_id{$ref->{id}}; |
|
1300 |
push @{ $ref->{matches} ||= [] }, $::locale->text('Model') . ': ' . join ', ', map { $_->{model} } @{ $mm_by_id{$ref->{id}} }; |
|
1301 |
} |
|
1302 |
|
|
1303 |
if ($ref->{ean} eq $::form->{"partnumber_$i"}) { |
|
1304 |
push @{ $ref->{matches} ||= [] }, $::locale->text('EAN') . ': ' . $ref->{ean}; |
|
1305 |
} |
|
1306 |
|
|
1281 | 1307 |
# In der Buchungsgruppe ist immer ein Bestandskonto verknuepft, auch wenn |
1282 | 1308 |
# es sich um eine Dienstleistung handelt. Bei Dienstleistungen muss das |
1283 | 1309 |
# Buchungskonto also aus dem Ergebnis rausgenommen werden. |
SL/IS.pm | ||
---|---|---|
1910 | 1910 |
push @values, '%' . $form->{"${field}_${i}"} . '%'; |
1911 | 1911 |
} |
1912 | 1912 |
|
1913 |
#Es soll auch nach EAN gesucht werden, ohne Einschränkung durch Beschreibung
|
|
1913 |
my (%mm_by_id);
|
|
1914 | 1914 |
if ($form->{"partnumber_$i"} && !$form->{"description_$i"}) { |
1915 | 1915 |
$where .= qq| OR (NOT p.obsolete = '1' AND p.ean = ? )|; |
1916 | 1916 |
push @values, $form->{"partnumber_$i"}; |
1917 |
|
|
1918 |
# also search hits in makemodels, but only cache the results by id and merge later |
|
1919 |
my $mm_query = qq| |
|
1920 |
SELECT parts_id, model FROM makemodel LEFT JOIN parts ON parts.id = parts_id WHERE NOT parts.obsolete AND model ILIKE ?; |
|
1921 |
|; |
|
1922 |
my $mm_results = selectall_hashref_query($::form, $dbh, $mm_query, '%' . $form->{"partnumber_$i"} . '%'); |
|
1923 |
my @mm_ids = map { $_->{parts_id} } @$mm_results; |
|
1924 |
push @{$mm_by_id{ $_->{parts_id} } ||= []}, $_ for @$mm_results; |
|
1925 |
|
|
1926 |
if (@mm_ids) { |
|
1927 |
$where .= qq| OR p.id IN (| . join(',', ('?') x @mm_ids) . qq|)|; |
|
1928 |
push @values, @mm_ids; |
|
1929 |
} |
|
1917 | 1930 |
} |
1918 | 1931 |
|
1919 | 1932 |
# Search for part ID overrides all other criteria. |
... | ... | |
1947 | 1960 |
qq|SELECT |
1948 | 1961 |
p.id, p.partnumber, p.description, p.sellprice, |
1949 | 1962 |
p.listprice, p.inventory_accno_id, p.lastcost, |
1963 |
p.ean, |
|
1950 | 1964 |
|
1951 | 1965 |
c1.accno AS inventory_accno, |
1952 | 1966 |
c1.new_chart_id AS inventory_new_chart, |
... | ... | |
2002 | 2016 |
|
2003 | 2017 |
while (my $ref = $sth->fetchrow_hashref('NAME_lc')) { |
2004 | 2018 |
|
2019 |
if ($mm_by_id{$ref->{id}}) { |
|
2020 |
$ref->{makemodels} = $mm_by_id{$ref->{id}}; |
|
2021 |
push @{ $ref->{matches} ||= [] }, $::locale->text('Model') . ': ' . join ', ', map { $_->{model} } @{ $mm_by_id{$ref->{id}} }; |
|
2022 |
} |
|
2023 |
|
|
2024 |
if ($ref->{ean} eq $::form->{"partnumber_$i"}) { |
|
2025 |
push @{ $ref->{matches} ||= [] }, $::locale->text('EAN') . ': ' . $ref->{ean}; |
|
2026 |
} |
|
2027 |
|
|
2005 | 2028 |
# In der Buchungsgruppe ist immer ein Bestandskonto verknuepft, auch wenn |
2006 | 2029 |
# es sich um eine Dienstleistung handelt. Bei Dienstleistungen muss das |
2007 | 2030 |
# Buchungskonto also aus dem Ergebnis rausgenommen werden. |
locale/de/all | ||
---|---|---|
1664 | 1664 |
'Orphaned' => 'Nie benutzt', |
1665 | 1665 |
'Orphaned currencies' => 'Verwaiste Währungen', |
1666 | 1666 |
'Other' => 'Sonstiges', |
1667 |
'Other Matches' => 'Andere Treffer', |
|
1667 | 1668 |
'Other users\' follow-ups' => 'Wiedervorlagen anderer Benutzer', |
1668 | 1669 |
'Other values are ignored.' => 'Andere Eingaben werden ignoriert.', |
1669 | 1670 |
'Others' => 'Andere', |
templates/webpages/io/select_item.html | ||
---|---|---|
9 | 9 |
<th> </th> |
10 | 10 |
<th>[% LxERP.t8('Number') %]</th> |
11 | 11 |
<th>[% LxERP.t8('Part Description') %]</th> |
12 |
<th>[% LxERP.t8('Other Matches') %]</th> |
|
12 | 13 |
<th>[% LxERP.t8('Price') %]</th> |
13 | 14 |
[%- IF IS_PURCHASE %] |
14 | 15 |
<th>[% LxERP.t8('ROP') %]</th> |
... | ... | |
22 | 23 |
<td><input name="select_item_id" class="radio" type="radio" value="[% HTML.escape(item.id) %]"[% IF loop.first %] checked[% END %]></td> |
23 | 24 |
<td>[% HTML.escape(item.partnumber) %]</td> |
24 | 25 |
<td>[% HTML.escape(item.description) %]</td> |
26 |
<td>[% HTML.escape(item.matches).join('<br>') %]</td> |
|
25 | 27 |
<td align="right">[% LxERP.format_amount(item.display_sellprice, 2) %]</td> |
26 | 28 |
[%- IF IS_PURCHASE %] |
27 | 29 |
<td align="right">[% LxERP.format_amount(item.rop, '') %]</td> |
Auch abrufbar als: Unified diff
select_item: Belegmasken finden jetzt auch Warennummern aus makemodels
Außerdem die Präsentation von select_item angepasst, so dass ersichtlich
wird woher die gefundenen Waren stammen.