Revision 25cdb7cc
Von Tamino Steinert vor 8 Tagen hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
42 | 42 |
customerprices |
43 | 43 |
orphaned |
44 | 44 |
assortment assortment_items assembly assembly_items |
45 |
print_options |
|
45 |
print_options part_labels_for_stock_print_options
|
|
46 | 46 |
all_pricegroups all_translations all_partsgroups all_units |
47 | 47 |
all_buchungsgruppen all_payment_terms all_warehouses |
48 | 48 |
parts_classification_filter |
... | ... | |
142 | 142 |
my $format = $::form->{print_options}->{format}; |
143 | 143 |
my $media = $::form->{print_options}->{media}; |
144 | 144 |
my $printer_id = $::form->{print_options}->{printer_id}; |
145 |
my $copies = $::form->{print_options}->{copies}; |
|
146 | 145 |
my $language; |
147 | 146 |
if ($::form->{print_options}->{language_id}) { |
148 | 147 |
$language = SL::DB::Manager::Language->find_by( |
149 | 148 |
id => $::form->{print_options}->{language_id} |
150 | 149 |
); |
150 |
my $copies; |
|
151 |
if ($::form->{print_options}->{part_labels_for_stock}) { |
|
152 |
$copies = $self->part->stockqty; |
|
153 |
} else { |
|
154 |
$copies = $::form->{print_options}->{copies}; |
|
151 | 155 |
} |
152 | 156 |
|
153 | 157 |
eval { |
... | ... | |
1661 | 1665 |
); |
1662 | 1666 |
} |
1663 | 1667 |
|
1668 |
sub init_part_labels_for_stock_print_options { |
|
1669 |
|
|
1670 |
my $print_form = Form->new(''); |
|
1671 |
$print_form->{type} = 'part'; |
|
1672 |
$print_form->{printers} = SL::DB::Manager::Printer->get_all_sorted; |
|
1673 |
$print_form->{languages} = SL::DB::Manager::Language->get_all_sorted; |
|
1674 |
|
|
1675 |
return SL::Helper::PrintOptions->get_print_options( |
|
1676 |
form => $print_form, |
|
1677 |
options => { |
|
1678 |
dialog_name_prefix => 'print_options.', |
|
1679 |
show_headers => 1, |
|
1680 |
no_queue => 1, |
|
1681 |
no_postscript => 1, |
|
1682 |
no_opendocument => 1, |
|
1683 |
no_html => 1, |
|
1684 |
no_display_copies => 1, |
|
1685 |
}, |
|
1686 |
); |
|
1687 |
} |
|
1688 |
|
|
1664 | 1689 |
# simple checks to run on $::form before saving |
1665 | 1690 |
|
1666 | 1691 |
sub form_check_part_description_exists { |
... | ... | |
1931 | 1956 |
checks => [ 'kivi.validate_form' ], |
1932 | 1957 |
only_if => !$::form->{inline_create}, |
1933 | 1958 |
], |
1959 |
action => [ |
|
1960 |
t8('Save and Print Labels for Stock'), |
|
1961 |
call => [ 'kivi.Part.show_part_labels_for_stock_print_options' ], |
|
1962 |
disabled => !$self->part->id ? t8('The object has not been saved yet.') |
|
1963 |
: !$self->part->stockqty ? t8('The part has no stock.') |
|
1964 |
: !$may_edit ? t8('You do not have the permissions to access this function.') : undef, |
|
1965 |
checks => [ 'kivi.validate_form' ], |
|
1966 |
], |
|
1934 | 1967 |
action => [ |
1935 | 1968 |
$self->part->is_assembly ? t8('Assembly items') : t8('Assortment items'), |
1936 | 1969 |
submit => [ '#ic', { action => "Part/export_assembly_assortment_components" } ], |
Auch abrufbar als: Unified diff
Part: Etiketten für Bestand drucken