Revision c364e43e
Von Peter Schulgin vor mehr als 7 Jahren hinzugefügt
SL/IC.pm | ||
---|---|---|
85 | 85 |
# retrieve assembly items |
86 | 86 |
$query = |
87 | 87 |
qq|SELECT p.id, p.partnumber, p.description, |
88 |
p.classification_id, |
|
89 | 88 |
p.sellprice, p.lastcost, p.weight, a.qty, a.bom, p.unit, |
90 | 89 |
pg.partsgroup, p.price_factor_id, pfac.factor AS price_factor |
91 | 90 |
FROM parts p |
... | ... | |
102 | 101 |
foreach my $key (keys %{$ref}) { |
103 | 102 |
$form->{"${key}_$form->{assembly_rows}"} = $ref->{$key}; |
104 | 103 |
} |
105 |
$form->{"type_and_classific_$form->{assembly_rows}"} = $::request->presenter->type_abbreviation($ref->{part_type}). |
|
106 |
$::request->presenter->classification_abbreviation($ref->{classification_id}); |
|
107 | 104 |
} |
108 | 105 |
$sth->finish; |
109 | 106 |
|
... | ... | |
337 | 334 |
partnumber = ?, |
338 | 335 |
description = ?, |
339 | 336 |
makemodel = ?, |
340 |
classification_id = ?, |
|
341 | 337 |
listprice = ?, |
342 | 338 |
sellprice = ?, |
343 | 339 |
lastcost = ?, |
... | ... | |
371 | 367 |
@values = ($form->{partnumber}, |
372 | 368 |
$form->{description}, |
373 | 369 |
$makemodel ? 't' : 'f', |
374 |
$form->{classification_id}, |
|
375 | 370 |
$form->{listprice}, |
376 | 371 |
$form->{sellprice}, |
377 | 372 |
$form->{lastcost}, |
... | ... | |
647 | 642 |
|
648 | 643 |
my $query = |
649 | 644 |
qq|SELECT p.id, p.partnumber, p.description, p.sellprice, |
650 |
p.classification_id, |
|
651 | 645 |
p.weight, p.onhand, p.unit, pg.partsgroup, p.lastcost, |
652 | 646 |
p.price_factor_id, pfac.factor AS price_factor, p.notes as longdescription |
653 | 647 |
FROM parts p |
... | ... | |
729 | 723 |
# my @other_flags = qw(onhand); # ToDO: implement these |
730 | 724 |
# my @inactive_flags = qw(l_subtotal short l_linetotal); |
731 | 725 |
|
732 |
my @select_tokens = qw(id factor part_type classification_id);
|
|
726 |
my @select_tokens = qw(id factor); |
|
733 | 727 |
my @where_tokens = qw(1=1); |
734 | 728 |
my @group_tokens = (); |
735 | 729 |
my @bind_vars = (); |
... | ... | |
806 | 800 |
insertdate => 'itime::DATE', |
807 | 801 |
); |
808 | 802 |
|
809 |
if ($form->{l_assembly} && $form->{l_lastcost}) {
|
|
803 |
if (($form->{searchitems} eq 'assembly') && $form->{l_lastcost}) {
|
|
810 | 804 |
@simple_l_switches = grep { $_ ne 'lastcost' } @simple_l_switches; |
811 | 805 |
} |
812 | 806 |
|
... | ... | |
896 | 890 |
push @select_tokens, $_; |
897 | 891 |
} |
898 | 892 |
|
899 |
# Oder Bedingungen fuer Ware Dienstleistung Erzeugnis: |
|
900 |
if ($form->{l_part} || $form->{l_assembly} || $form->{l_service} || $form->{l_assortment}) { |
|
901 |
my @or_tokens = (); |
|
902 |
push @or_tokens, "p.part_type = 'service'" if $form->{l_service}; |
|
903 |
push @or_tokens, "p.part_type = 'assembly'" if $form->{l_assembly}; |
|
904 |
push @or_tokens, "p.part_type = 'part'" if $form->{l_part}; |
|
905 |
push @or_tokens, "p.part_type = 'assortment'" if $form->{l_assortment}; |
|
906 |
push @where_tokens, join ' OR ', map { "($_)" } @or_tokens; |
|
907 |
} |
|
908 |
else { |
|
909 |
# gar keine Teile |
|
910 |
push @where_tokens, q|'F' = 'T'|; |
|
911 |
} |
|
912 |
|
|
913 |
if ( $form->{classification_id} > 0 ) { |
|
914 |
push @where_tokens, "p.classification_id = ?"; |
|
915 |
push @bind_vars, $form->{classification_id}; |
|
893 |
for ($form->{searchitems}) { |
|
894 |
push @where_tokens, "p.part_type = 'part'" if /part/; |
|
895 |
push @where_tokens, "p.part_type = 'service'" if /service/; |
|
896 |
push @where_tokens, "p.part_type = 'assembly'" if /assembly/; |
|
916 | 897 |
} |
917 | 898 |
|
918 | 899 |
for ($form->{itemstatus}) { |
... | ... | |
970 | 951 |
|
971 | 952 |
push @select_tokens, @qsooqr_flags, 'quotation', 'cv', 'ioi.id', 'ioi.ioi' if $bsooqr; |
972 | 953 |
push @select_tokens, @deliverydate_flags if $bsooqr && $form->{l_deliverydate}; |
973 |
push @select_tokens, $q_assembly_lastcost if $form->{l_assembly} && $form->{l_lastcost};
|
|
954 |
push @select_tokens, $q_assembly_lastcost if ($form->{searchitems} eq 'assembly') && $form->{l_lastcost};
|
|
974 | 955 |
push @bsooqr_tokens, q|module = 'ir' AND NOT ioi.assemblyitem| if $form->{bought}; |
975 | 956 |
push @bsooqr_tokens, q|module = 'is' AND NOT ioi.assemblyitem| if $form->{sold}; |
976 | 957 |
push @bsooqr_tokens, q|module = 'oe' AND NOT quotation AND cv = 'customer'| if $form->{ordered}; |
... | ... | |
1068 | 1049 |
# post processing for assembly parts lists (bom) |
1069 | 1050 |
# for each part get the assembly parts and add them into the partlist. |
1070 | 1051 |
my @assemblies; |
1071 |
if ($form->{l_assembly} && $form->{bom}) {
|
|
1052 |
if ($form->{searchitems} eq 'assembly' && $form->{bom}) {
|
|
1072 | 1053 |
$query = |
1073 | 1054 |
qq|SELECT p.id, p.partnumber, p.description, a.qty AS onhand, |
1074 | 1055 |
p.unit, p.notes, p.itime::DATE as insertdate, |
... | ... | |
1098 | 1079 |
$form->{parts} = \@assemblies; |
1099 | 1080 |
} |
1100 | 1081 |
|
1101 |
if ($form->{l_pricegroups} && SL::DB::Manager::Price->get_all_count() > 0 ) {
|
|
1082 |
if ($form->{l_pricegroups} ) { |
|
1102 | 1083 |
my $query = <<SQL; |
1103 | 1084 |
SELECT parts_id, price, pricegroup_id |
1104 | 1085 |
FROM prices |
... | ... | |
1115 | 1096 |
} |
1116 | 1097 |
$sth->finish; |
1117 | 1098 |
} |
1118 |
} |
|
1099 |
}; |
|
1100 |
|
|
1119 | 1101 |
|
1120 | 1102 |
$main::lxdebug->leave_sub(); |
1121 | 1103 |
|
... | ... | |
1411 | 1393 |
} |
1412 | 1394 |
|
1413 | 1395 |
my $query = |
1414 |
qq|SELECT id, partnumber, description, unit, sellprice, |
|
1415 |
classification_id |
|
1396 |
qq|SELECT id, partnumber, description, unit, sellprice |
|
1416 | 1397 |
FROM parts |
1417 | 1398 |
WHERE $where ORDER BY $order|; |
1418 | 1399 |
|
... | ... | |
1425 | 1406 |
} |
1426 | 1407 |
|
1427 | 1408 |
$j++; |
1428 |
$form->{"type_and_classific_$j"} = $::request->presenter->type_abbreviation($ref->{part_type}). |
|
1429 |
$::request->presenter->classification_abbreviation($ref->{classification_id}); |
|
1430 | 1409 |
$form->{"id_$j"} = $ref->{id}; |
1431 | 1410 |
$form->{"partnumber_$j"} = $ref->{partnumber}; |
1432 | 1411 |
$form->{"description_$j"} = $ref->{description}; |
... | ... | |
1754 | 1733 |
for my $i (1..$rowcount) { |
1755 | 1734 |
my $id = $form->{"${prefix}${i}"}; |
1756 | 1735 |
next unless $id; |
1757 |
my $prt = $parts_by_id{$id}; |
|
1758 |
my $type_abbr = $::request->presenter->type_abbreviation($prt->part_type); |
|
1759 |
push @{ $template_arrays{part_type} }, $type_abbr; |
|
1760 |
push @{ $template_arrays{type_and_classific}}, $type_abbr.$::request->presenter->classification_abbreviation($prt->classification_id); |
|
1736 |
|
|
1737 |
push @{ $template_arrays{part_type} }, $parts_by_id{$id}->type; |
|
1761 | 1738 |
} |
1762 | 1739 |
|
1763 |
$main::lxdebug->leave_sub(); |
|
1764 | 1740 |
return %template_arrays; |
1741 |
$main::lxdebug->leave_sub(); |
|
1765 | 1742 |
} |
1766 | 1743 |
|
1767 | 1744 |
sub normalize_text_blocks { |
... | ... | |
1783 | 1760 |
$main::lxdebug->leave_sub(); |
1784 | 1761 |
} |
1785 | 1762 |
|
1763 |
|
|
1786 | 1764 |
1; |
Auch abrufbar als: Unified diff
Revert "Artikel-Klassifizierung"
This reverts commit 5067d7bd31514962af9730b33323b831d87164f8.