Revision 25cdb7cc
Von Tamino Steinert vor etwa 1 Monat 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" } ], |
SL/Helper/PrintOptions.pm | ||
---|---|---|
164 | 164 |
my %template_vars = ( |
165 | 165 |
name_prefix => $prefix || '', |
166 | 166 |
show_headers => $options->{show_headers}, |
167 |
display_copies => scalar @{ $form->{printers} || [] } && $::lx_office_conf{print_templates}->{latex} && $form->{media} ne 'email', |
|
167 |
display_copies => !$options->{no_display_copies} |
|
168 |
&& scalar @{ $form->{printers} || [] } |
|
169 |
&& $::lx_office_conf{print_templates}->{latex} |
|
170 |
&& $form->{media} ne 'email', |
|
168 | 171 |
display_remove_draft => (!$form->{id} && $form->{draft_id}), |
169 | 172 |
display_groupitems => !$dont_display_groupitems{$form->{type}}, |
170 | 173 |
display_bothsided => $options->{show_bothsided}, |
js/kivi.Part.js | ||
---|---|---|
26 | 26 |
var data = $('#print_options_form').serializeArray(); |
27 | 27 |
data.push({ name: 'action', value: 'Part/print_label' }); |
28 | 28 |
data.push({ name: 'part.id', value: part_id }); |
29 |
$.download("controller.pl", data); |
|
29 |
$.download("controller.pl", data);
|
|
30 | 30 |
}; |
31 | 31 |
|
32 |
ns.show_print_options = function() { |
|
32 |
ns.show_print_options = function() {
|
|
33 | 33 |
kivi.popup_dialog({ |
34 | 34 |
id: 'print_options', |
35 | 35 |
dialog: { |
... | ... | |
50 | 50 |
$.post("controller.pl", data, kivi.eval_json_result); |
51 | 51 |
}; |
52 | 52 |
|
53 |
ns.show_part_labels_for_stock_print_options = function() { |
|
54 |
kivi.popup_dialog({ |
|
55 |
id: 'print_part_labels_for_stock_print_options', |
|
56 |
dialog: { |
|
57 |
title: kivi.t8('Part Labels for Stock Print options'), |
|
58 |
width: 800, |
|
59 |
height: 300 |
|
60 |
} |
|
61 |
}); |
|
62 |
} |
|
63 |
|
|
64 |
ns.save_and_print_part_labels_for_stock = function() { |
|
65 |
$('#print_part_labels_for_stock_print_options').dialog('close'); |
|
66 |
|
|
67 |
var data = $('#ic').serializeArray(); |
|
68 |
data = data.concat($('#print_part_labels_for_stock_print_options_form').serializeArray()); |
|
69 |
data.push({ name: 'action', value: 'Part/save_and_print' }); |
|
70 |
|
|
71 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
72 |
}; |
|
73 |
|
|
53 | 74 |
ns.delete = function() { |
54 | 75 |
var data = $('#ic').serializeArray(); |
55 | 76 |
data.push({ name: 'action', value: 'Part/delete' }); |
templates/design40_webpages/part/form.html | ||
---|---|---|
15 | 15 |
</form> |
16 | 16 |
</div> |
17 | 17 |
|
18 |
<div id="print_part_labels_for_stock_print_options" style="display:none"> |
|
19 |
<form method="post" action="controller.pl" id="print_part_labels_for_stock_print_options_form"> |
|
20 |
[% SELF.part_labels_for_stock_print_options %] |
|
21 |
[% L.hidden_tag('print_options.part_labels_for_stock', 1) %] |
|
22 |
<br> |
|
23 |
[% L.button_tag('kivi.Part.save_and_print_part_labels_for_stock()', LxERP.t8('Print')) %] |
|
24 |
<a href="#" onclick="$('#print_part_labels_for_stock_print_options').dialog('close');" class="button neutral">[% LxERP.t8("Cancel") %]</a> |
|
25 |
</form> |
|
26 |
</div> |
|
27 |
|
|
18 | 28 |
<form method="post" id="ic" name="ic" action="controller.pl"> |
19 | 29 |
|
20 | 30 |
[% INCLUDE 'common/flash.html' %] |
Auch abrufbar als: Unified diff
Part: Etiketten für Bestand drucken