Revision 75957fe8
Von Bernd Bleßmann vor etwa 10 Jahren hinzugefügt
SL/DO.pm | ||
---|---|---|
750 | 750 |
my $position = 0; |
751 | 751 |
my $subtotal_header = 0; |
752 | 752 |
my $subposition = 0; |
753 |
my $si_position = 0; |
|
753 | 754 |
|
754 | 755 |
my (@project_ids); |
755 | 756 |
|
... | ... | |
806 | 807 |
my @arrays = |
807 | 808 |
qw(runningnumber number description longdescription qty unit |
808 | 809 |
partnotes serialnumber reqdate projectnumber projectdescription |
810 |
weight lineweight |
|
809 | 811 |
si_runningnumber si_number si_description |
810 |
si_warehouse si_bin si_chargenumber si_bestbefore si_qty si_unit weight lineweight); |
|
812 |
si_warehouse si_bin si_chargenumber si_bestbefore |
|
813 |
si_qty si_qty_nofmt si_unit); |
|
811 | 814 |
|
812 | 815 |
map { $form->{TEMPLATE_ARRAYS}->{$_} = [] } (@arrays); |
813 | 816 |
|
... | ... | |
848 | 851 |
$position++; |
849 | 852 |
} |
850 | 853 |
|
854 |
$si_position++; |
|
855 |
|
|
851 | 856 |
my $price_factor = $price_factors{$form->{"price_factor_id_$i"}} || { 'factor' => 1 }; |
852 | 857 |
my $project = $projects_by_id{$form->{"project_id_$i"}} || SL::DB::Project->new; |
853 | 858 |
|
... | ... | |
875 | 880 |
push @{ $form->{TEMPLATE_ARRAYS}->{lineweight} }, $form->format_amount($myconfig, $lineweight, 3); |
876 | 881 |
push @{ $form->{TEMPLATE_ARRAYS}->{lineweight_nofmt} }, $lineweight; |
877 | 882 |
|
883 |
my $stock_info = DO->unpack_stock_information('packed' => $form->{"stock_${in_out}_$i"}); |
|
884 |
|
|
885 |
foreach my $si (@{ $stock_info }) { |
|
886 |
$num_si++; |
|
887 |
|
|
888 |
do_statement($form, $h_bin_wh, $q_bin_wh, conv_i($si->{bin_id}), conv_i($si->{warehouse_id})); |
|
889 |
my $bin_wh = $h_bin_wh->fetchrow_hashref(); |
|
890 |
|
|
891 |
push @{ $form->{TEMPLATE_ARRAYS}{si_runningnumber}[$si_position-1] }, $num_si; |
|
892 |
push @{ $form->{TEMPLATE_ARRAYS}{si_number}[$si_position-1] }, $form->{"partnumber_$i"}; |
|
893 |
push @{ $form->{TEMPLATE_ARRAYS}{si_description}[$si_position-1] }, $form->{"description_$i"}; |
|
894 |
push @{ $form->{TEMPLATE_ARRAYS}{si_warehouse}[$si_position-1] }, $bin_wh->{warehouse}; |
|
895 |
push @{ $form->{TEMPLATE_ARRAYS}{si_bin}[$si_position-1] }, $bin_wh->{bin}; |
|
896 |
push @{ $form->{TEMPLATE_ARRAYS}{si_chargenumber}[$si_position-1] }, $si->{chargenumber}; |
|
897 |
push @{ $form->{TEMPLATE_ARRAYS}{si_bestbefore}[$si_position-1] }, $si->{bestbefore}; |
|
898 |
push @{ $form->{TEMPLATE_ARRAYS}{si_qty}[$si_position-1] }, $form->format_amount($myconfig, $si->{qty} * 1); |
|
899 |
push @{ $form->{TEMPLATE_ARRAYS}{si_qty_nofmt}[$si_position-1] }, $si->{qty} * 1; |
|
900 |
push @{ $form->{TEMPLATE_ARRAYS}{si_unit}[$si_position-1] }, $si->{unit}; |
|
901 |
} |
|
902 |
|
|
878 | 903 |
if ($form->{"assembly_$i"}) { |
879 | 904 |
$sameitem = ""; |
880 | 905 |
|
... | ... | |
891 | 916 |
|
892 | 917 |
while (my $ref = $h_pg->fetchrow_hashref("NAME_lc")) { |
893 | 918 |
if ($form->{groupitems} && $ref->{partsgroup} ne $sameitem) { |
894 |
map({ push(@{ $form->{TEMPLATE_ARRAYS}->{$_} }, "") } grep({ $_ ne "description" } @arrays)); |
|
919 |
map({ push(@{ $form->{TEMPLATE_ARRAYS}->{$_} }, "") } grep({ $_ ne "description" && $_ !~ /^si_/} @arrays)); |
|
920 |
map({ push(@{ $form->{TEMPLATE_ARRAYS}->{$_} }, []) } grep({ $_ =~ /^si_/} @arrays)); |
|
895 | 921 |
$sameitem = ($ref->{partsgroup}) ? $ref->{partsgroup} : "--"; |
896 | 922 |
push(@{ $form->{TEMPLATE_ARRAYS}->{description} }, $sameitem); |
923 |
$si_position++; |
|
897 | 924 |
} |
898 |
push(@{ $form->{TEMPLATE_ARRAYS}->{"description"} }, $form->format_amount($myconfig, $ref->{qty} * $form->{"qty_$i"}) . qq| -- $ref->{partnumber}, $ref->{description}|); |
|
899 | 925 |
|
900 |
map({ push(@{ $form->{TEMPLATE_ARRAYS}->{$_} }, "") } grep({ $_ ne "description" } @arrays)); |
|
901 |
} |
|
902 |
} |
|
903 |
|
|
904 |
if ($form->{"inventory_accno_$i"} && !$form->{"assembly_$i"}) { |
|
905 |
my $stock_info = DO->unpack_stock_information('packed' => $form->{"stock_${in_out}_$i"}); |
|
906 |
|
|
907 |
foreach my $si (@{ $stock_info }) { |
|
908 |
$num_si++; |
|
909 |
|
|
910 |
do_statement($form, $h_bin_wh, $q_bin_wh, conv_i($si->{bin_id}), conv_i($si->{warehouse_id})); |
|
911 |
my $bin_wh = $h_bin_wh->fetchrow_hashref(); |
|
912 |
|
|
913 |
push @{ $form->{TEMPLATE_ARRAYS}{si_runningnumber}[$position-1] }, $num_si; |
|
914 |
push @{ $form->{TEMPLATE_ARRAYS}{si_number}[$position-1] }, $form->{"partnumber_$i"}; |
|
915 |
push @{ $form->{TEMPLATE_ARRAYS}{si_description}[$position-1] }, $form->{"description_$i"}; |
|
916 |
push @{ $form->{TEMPLATE_ARRAYS}{si_warehouse}[$position-1] }, $bin_wh->{warehouse}; |
|
917 |
push @{ $form->{TEMPLATE_ARRAYS}{si_bin}[$position-1] }, $bin_wh->{bin}; |
|
918 |
push @{ $form->{TEMPLATE_ARRAYS}{si_chargenumber}[$position-1] }, $si->{chargenumber}; |
|
919 |
push @{ $form->{TEMPLATE_ARRAYS}{si_bestbefore}[$position-1] }, $si->{bestbefore}; |
|
920 |
push @{ $form->{TEMPLATE_ARRAYS}{si_qty}[$position-1] }, $form->format_amount($myconfig, $si->{qty} * 1); |
|
921 |
push @{ $form->{TEMPLATE_ARRAYS}{si_qty_nofmt}[$position-1] }, $si->{qty} * 1; |
|
922 |
push @{ $form->{TEMPLATE_ARRAYS}{si_unit}[$position-1] }, $si->{unit}; |
|
926 |
push(@{ $form->{TEMPLATE_ARRAYS}->{"description"} }, $form->format_amount($myconfig, $ref->{qty} * $form->{"qty_$i"}) . qq| -- $ref->{partnumber}, $ref->{description}|); |
|
927 |
map({ push(@{ $form->{TEMPLATE_ARRAYS}->{$_} }, "") } grep({ $_ ne "description" && $_ !~ /^si_/} @arrays)); |
|
928 |
map({ push(@{ $form->{TEMPLATE_ARRAYS}->{$_} }, []) } grep({ $_ =~ /^si_/} @arrays)); |
|
929 |
$si_position++; |
|
923 | 930 |
} |
924 | 931 |
} |
925 | 932 |
|
Auch abrufbar als: Unified diff
Lieferschein: Ausdruck Erzeugnisse mit Stückliste und Lagerausgang repariert.
Wenn bei einem Erzeugnis Stückliste angehakt war und das Erzeugnis auf dem
Lieferschein auch einen Lagerausgang hatte, so gab es eine Fehlermeldung, da
die Lagerausgangs-Infos Arrays sind, aber mit einem leeren String ("") gefüllt
wurden.
Zudem stimmten die Array-Postionen der Lagerausgänge nicht mit den
Artikelpositionen überein.
Ausserdem Lagerausgänge jetzt für alle Artikel zulassen, da inzwischen auch
Erzeugnisse und Dienstleistungen gelagert werden können.