Revision 5067d7bd
Von Martin Helmling martin.helmling@octosoft.eu vor mehr als 7 Jahren hinzugefügt
bin/mozilla/ic.pl | ||
---|---|---|
100 | 100 |
$form->{lastsort} = ""; # memory for which table was sort at last time |
101 | 101 |
$form->{ndxs_counter} = 0; # counter for added entries to top100 |
102 | 102 |
|
103 |
my %is_xyz = map { +"is_$_" => ($form->{searchitems} eq $_) } qw(part service assembly); |
|
103 |
# for seach all possibibilities, is_service only used as UNLESS so == 0 |
|
104 |
my %is_xyz = ("is_part" => 1, "is_service" => 0, "is_assembly" =>1 ); |
|
104 | 105 |
|
105 | 106 |
$form->{title} = (ucfirst $form->{searchitems}) . "s"; |
107 |
$form->{title} =~ s/ys$/ies/; |
|
106 | 108 |
$form->{title} = $locale->text($form->{title}); |
107 |
$form->{title} = $locale->text('Assemblies') if ($is_xyz{is_assembly}); |
|
108 | 109 |
|
109 | 110 |
$form->{CUSTOM_VARIABLES} = CVar->get_configs('module' => 'IC'); |
110 | 111 |
($form->{CUSTOM_VARIABLES_FILTER_CODE}, |
... | ... | |
233 | 234 |
# searchitems=part revers=0 lastsort='' |
234 | 235 |
# |
235 | 236 |
# filter: |
236 |
# partnumber ean description partsgroup serialnumber make model drawing microfiche |
|
237 |
# partnumber ean description partsgroup classification serialnumber make model drawing microfiche
|
|
237 | 238 |
# transdatefrom transdateto |
238 | 239 |
# |
239 | 240 |
# radio: |
... | ... | |
300 | 301 |
'unit' => { 'text' => $locale->text('Unit'), }, |
301 | 302 |
'weight' => { 'text' => $locale->text('Weight'), }, |
302 | 303 |
'shop' => { 'text' => $locale->text('Shop article'), }, |
304 |
'type_and_classific' => { 'text' => $locale->text('Type'), }, |
|
303 | 305 |
'projectnumber' => { 'text' => $locale->text('Project Number'), }, |
304 | 306 |
'projectdescription' => { 'text' => $locale->text('Project Description'), }, |
305 | 307 |
); |
... | ... | |
424 | 426 |
$form->{l_linetotallastcost} = $form->{searchitems} eq 'assembly' && !$form->{bom} ? "" : 'Y' if $form->{l_lastcost}; |
425 | 427 |
$form->{l_linetotallistprice} = "Y" if $form->{l_listprice}; |
426 | 428 |
} |
429 |
$form->{"l_type_and_classific"} = "Y"; |
|
427 | 430 |
|
428 |
if ($form->{searchitems} eq 'service') {
|
|
431 |
if ($form->{l_service} && !$form->{l_assembly} && !$form->{l_part}) {
|
|
429 | 432 |
|
430 | 433 |
# remove bin, weight and rop from list |
431 | 434 |
map { $form->{"l_$_"} = "" } qw(bin weight rop); |
... | ... | |
472 | 475 |
IC->all_parts(\%myconfig, \%$form); |
473 | 476 |
|
474 | 477 |
my @columns = qw( |
475 |
partnumber description notes partsgroup bin onhand rop soldtotal unit listprice |
|
478 |
partnumber type_and_classific description notes partsgroup bin onhand rop soldtotal unit listprice
|
|
476 | 479 |
linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost |
477 | 480 |
priceupdate weight image drawing microfiche invnumber ordnumber quonumber |
478 | 481 |
transdate name serialnumber deliverydate ean projectnumber projectdescription |
... | ... | |
505 | 508 |
|
506 | 509 |
my @hidden_variables = ( |
507 | 510 |
qw(l_subtotal l_linetotal searchitems itemstatus bom l_pricegroups insertdatefrom insertdateto), |
511 |
qw(l_type_and_classific classification_id), |
|
508 | 512 |
@itemstatus_keys, |
509 | 513 |
@callback_keys, |
510 | 514 |
map({ "cvar_$_->{name}" } @searchable_custom_variables), |
... | ... | |
531 | 535 |
'part' => $locale->text('part_list'), |
532 | 536 |
'service' => $locale->text('service_list'), |
533 | 537 |
'assembly' => $locale->text('assembly_list'), |
538 |
'article' => $locale->text('article_list'), |
|
534 | 539 |
); |
535 | 540 |
|
536 | 541 |
$report->set_options('raw_top_info_text' => $form->parse_html_template('ic/generate_report_top', { options => \@options }), |
537 | 542 |
'raw_bottom_info_text' => $form->parse_html_template('ic/generate_report_bottom'), |
538 | 543 |
'output_format' => 'HTML', |
539 | 544 |
'title' => $form->{title}, |
540 |
'attachment_basename' => $attachment_basenames{$form->{searchitems}} . strftime('_%Y%m%d', localtime time),
|
|
545 |
'attachment_basename' => 'article_list' . strftime('_%Y%m%d', localtime time),
|
|
541 | 546 |
); |
542 | 547 |
$report->set_options_from_form(); |
543 | 548 |
$locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv'; |
... | ... | |
647 | 652 |
map { $row->{$_}{link} = $ref->{$_} } qw(drawing microfiche); |
648 | 653 |
|
649 | 654 |
$row->{notes}{data} = SL::HTML::Util->strip($ref->{notes}); |
655 |
$row->{type_and_classific}{data} = $::request->presenter->type_abbreviation($ref->{part_type}). |
|
656 |
$::request->presenter->classification_abbreviation($ref->{classification_id}); |
|
650 | 657 |
|
651 | 658 |
$report->add_data($row); |
652 | 659 |
|
... | ... | |
658 | 665 |
(!$next_ref->{assemblyitem} && ($same_item ne $next_ref->{ $form->{sort} })))) { |
659 | 666 |
my $row = { map { $_ => { 'class' => 'listsubtotal', } } @columns }; |
660 | 667 |
|
661 |
if (($form->{searchitems} ne 'assembly') || !$form->{bom}) {
|
|
668 |
if ( !$form->{l_assembly} || !$form->{bom}) {
|
|
662 | 669 |
$row->{soldtotal}->{data} = $form->format_amount(\%myconfig, $subtotals{soldtotal}); |
663 | 670 |
} |
664 | 671 |
|
... | ... | |
696 | 703 |
my ($column_index, $subtotalonhand, $subtotalsellprice, $subtotallastcost, $subtotallistprice) = @_; |
697 | 704 |
|
698 | 705 |
map { $column_data{$_} = "<td> </td>" } @{ $column_index }; |
699 |
$$subtotalonhand = 0 if ($form->{searchitems} eq 'assembly' && $form->{bom});
|
|
706 |
$$subtotalonhand = 0 if ($form->{l_assembly} && $form->{bom});
|
|
700 | 707 |
|
701 | 708 |
$column_data{onhand} = |
702 | 709 |
"<th class=listsubtotal align=right>" |
... | ... | |
938 | 945 |
my (@column_index); |
939 | 946 |
my ($nochange, $callback, $previousform, $linetotal, $line_purchase_price, $href); |
940 | 947 |
|
941 |
@column_index = qw(runningnumber qty unit bom partnumber description partsgroup lastcost total); |
|
948 |
@column_index = qw(runningnumber qty unit bom partnumber type_and_classific description partsgroup lastcost total);
|
|
942 | 949 |
|
943 | 950 |
if ($form->{previousform}) { |
944 | 951 |
$nochange = 1; |
945 |
@column_index = qw(qty unit bom partnumber description partsgroup total); |
|
952 |
@column_index = qw(qty unit bom partnumber type_and_classific description partsgroup total);
|
|
946 | 953 |
} else { |
947 | 954 |
|
948 | 955 |
# change callback |
... | ... | |
965 | 972 |
} |
966 | 973 |
|
967 | 974 |
my %header = ( |
968 |
runningnumber => { text => $locale->text('No.'), nowrap => 1, width => '5%', align => 'left',}, |
|
969 |
qty => { text => $locale->text('Qty'), nowrap => 1, width => '10%', align => 'left',}, |
|
970 |
unit => { text => $locale->text('Unit'), nowrap => 1, width => '5%', align => 'left',}, |
|
971 |
partnumber => { text => $locale->text('Part Number'), nowrap => 1, width => '20%', align => 'left',}, |
|
972 |
description => { text => $locale->text('Part Description'), nowrap => 1, width => '50%', align => 'left',}, |
|
973 |
lastcost => { text => $locale->text('Purchase Prices'), nowrap => 1, width => '50%', align => 'right',}, |
|
974 |
total => { text => $locale->text('Sale Prices'), nowrap => 1, align => 'right',}, |
|
975 |
bom => { text => $locale->text('BOM'), align => 'center',}, |
|
976 |
partsgroup => { text => $locale->text('Group'), align => 'left',}, |
|
975 |
runningnumber => { text => $locale->text('No.'), nowrap => 1, width => '5%', align => 'left',}, |
|
976 |
qty => { text => $locale->text('Qty'), nowrap => 1, width => '10%', align => 'left',}, |
|
977 |
unit => { text => $locale->text('Unit'), nowrap => 1, width => '5%', align => 'left',}, |
|
978 |
partnumber => { text => $locale->text('Part Number'), nowrap => 1, width => '20%', align => 'left',}, |
|
979 |
type_and_classific => { text => $locale->text('Typ'), nowrap => 1, width => '5%' , align => 'left',}, |
|
980 |
description => { text => $locale->text('Part Description'), nowrap => 1, width => '50%', align => 'left',}, |
|
981 |
lastcost => { text => $locale->text('Purchase Prices'), nowrap => 1, width => '45%', align => 'right',}, |
|
982 |
total => { text => $locale->text('Sale Prices'), nowrap => 1, align => 'right',}, |
|
983 |
bom => { text => $locale->text('BOM'), align => 'center',}, |
|
984 |
partsgroup => { text => $locale->text('Group'), align => 'left',}, |
|
977 | 985 |
); |
978 | 986 |
|
979 | 987 |
my @ROWS; |
... | ... | |
991 | 999 |
$linetotal = $form->format_amount(\%myconfig, $linetotal, 2); |
992 | 1000 |
$line_purchase_price = $form->format_amount(\%myconfig, $line_purchase_price, 2); |
993 | 1001 |
$href = build_std_url("action=edit", qq|id=$form->{"id_$i"}|, "rowcount=$numrows", "currow=$i", "previousform=$previousform"); |
994 |
map { $row{$_}{data} = "" } qw(qty unit partnumber description bom partsgroup runningnumber); |
|
1002 |
map { $row{$_}{data} = "" } qw(qty unit partnumber typ_and_class description bom partsgroup runningnumber);
|
|
995 | 1003 |
|
996 | 1004 |
# last row |
997 | 1005 |
if (($i >= 1) && ($i == $numrows)) { |
... | ... | |
1011 | 1019 |
$row{qty}{align} = 'right'; |
1012 | 1020 |
} else { |
1013 | 1021 |
$row{partnumber}{data} = qq|$form->{"partnumber_$i"}|; |
1014 |
$row{partnumber}{link} = $href;
|
|
1022 |
$row{partnumber}{link} = $href; |
|
1015 | 1023 |
$row{qty}{data} = qq|<input name="qty_$i" size=5 value="$form->{"qty_$i"}">|; |
1016 | 1024 |
$row{runningnumber}{data} = qq|<input name="runningnumber_$i" size=3 value="$i">|; |
1017 | 1025 |
$row{bom}{data} = sprintf qq|<input name="bom_$i" type=checkbox class=checkbox value=1 %s>|, |
1018 | 1026 |
$form->{"bom_$i"} ? 'checked' : ''; |
1019 | 1027 |
} |
1028 |
# type impl $row{type_and_classific}{data} = $::request->presenter->type_abbreviation($form->{"type_$i"}). |
|
1029 |
$row{type_and_classific}{data} = $::request->presenter->type_abbreviation($form->{"assembly_$i"},$form->{"inventory_accno_id_$i"}). |
|
1030 |
$::request->presenter->classification_abbreviation($form->{"classification_id_$i"}); |
|
1020 | 1031 |
push @row_hiddens, qw(unit description partnumber partsgroup); |
1021 | 1032 |
$row{unit}{data} = $form->{"unit_$i"}; |
1022 | 1033 |
#Bei der Artikelbeschreibung und Warengruppe können Sonderzeichen verwendet |
Auch abrufbar als: Unified diff
Artikel-Klassifizierung
Die ursprünglich als "Artikeltyp" bezeichnete Klassifizierung von Artikeln
Sie dient einer weiteren Gliederung um zum Beispiel den Einkauf vom Verkauf zu trennen, etc.
Gekennzeichnet durch eine Beschreibung (z.B. "Einkauf") und ein Kürzel (z.B. "E")
Flexibel änderbar und erweiterbar.
- Neue Datenbanktablle und Rose-Objekte, sowie Controller zum Bearbeiten der Tabelle
- Zwei-Zeichen Abkürzung:
Der Typ des Artikel und die Klassifizierung werden durch zwei Buchstaben dargestellt.
Der erste Buchstabe ist eine Lokalisierung des Typs des Artikel ('P','A','S') ,
deutch 'W', 'E', und 'D' für Ware Erzeugnis oder Dienstleistung, ggf. weitere Typen.
Der zweite Buchstabe ist eine Lokalisierung der Klassifizierungsabkürzung (abbreviation).
Die Abkürzungen sind aus dem Part Presenter abholbar:
- SL::Presenter::Part->type_abbreviation($part_type)
- SL::Presenter::Part->classification_abbreviation($classification_id)
Wenn im ERP-Dokument nach einer Artikelnummer oder Beschreibung gesucht wird,
diese in den Stammdaten vorhanden ist,
aber der Artikeltyp leer oder falsch ist, bzw im Typ for_purchase bzw for_sale nicht gesetzt ist,
wird die Fehlermeldung "Gesuchter Artikel ist nicht für den Einkauf bzw Verkauf" gemeldet
Anpassung des CSV Import,
nun wird alternativ zur 'type'-Spalte die 'pclass'-Spalte mit zwei Buchstaben geparsed und entsprechend
classification_id,assembly sowie inventory_accno_id gesetzt (oder type_id falls neue Implementierung eingebaut).