Revision 4ffbaf73
Von Tamino Steinert vor 25 Tagen hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
25 | 25 |
use SL::DB::PurchaseBasketItem; |
26 | 26 |
use SL::DB::Shop; |
27 | 27 |
use SL::Helper::Flash; |
28 |
use SL::Helper::CreatePDF qw(:all); |
|
28 | 29 |
use SL::Helper::PrintOptions; |
29 | 30 |
use SL::Helper::UserPreferences::PartPickerSearch; |
30 | 31 |
use SL::JSON; |
... | ... | |
40 | 41 |
customerprices |
41 | 42 |
orphaned |
42 | 43 |
assortment assortment_items assembly assembly_items |
44 |
print_options |
|
43 | 45 |
all_pricegroups all_translations all_partsgroups all_units |
44 | 46 |
all_buchungsgruppen all_payment_terms all_warehouses |
45 | 47 |
parts_classification_filter |
... | ... | |
128 | 130 |
} |
129 | 131 |
} |
130 | 132 |
|
133 |
sub action_save_and_print { |
|
134 |
my ($self) = @_; |
|
135 |
|
|
136 |
$self->save_with_render_error() or return; |
|
137 |
flash_later('info', t8('The item has been saved.')); |
|
138 |
$self->js_reset_part_after_save(); |
|
139 |
|
|
140 |
my $formname = $::form->{print_options}->{formname}; |
|
141 |
my $language = $::form->{print_options}->{language}; |
|
142 |
my $format = $::form->{print_options}->{format}; |
|
143 |
my $media = $::form->{print_options}->{media}; |
|
144 |
my $printer_id = $::form->{print_options}->{printer_id}; |
|
145 |
my $copies = $::form->{print_options}->{copies}; |
|
146 |
|
|
147 |
my %result; |
|
148 |
eval { |
|
149 |
%result = SL::Template::LaTeX->parse_and_create_pdf( |
|
150 |
$formname . ".tex", |
|
151 |
SELF => $self, |
|
152 |
part => $self->part, |
|
153 |
template_meta => { |
|
154 |
formname => 'part', |
|
155 |
language => $language, |
|
156 |
extension => 'pdf', |
|
157 |
format => $format, |
|
158 |
media => $media, |
|
159 |
today => DateTime->today, |
|
160 |
lxconfig => \%::lx_office_conf, |
|
161 |
}, |
|
162 |
); |
|
163 |
if ($result{error}) { |
|
164 |
die t8('Conversion to PDF failed: #1', $result{error}); |
|
165 |
} |
|
166 |
|
|
167 |
my $pdf = $result{file_name}; |
|
168 |
|
|
169 |
if ($media eq 'screen') { |
|
170 |
my $file_name = $formname . '.pdf'; |
|
171 |
$file_name =~ s{[^\w\.]+}{_}g; |
|
172 |
|
|
173 |
$self->send_file( |
|
174 |
$pdf, |
|
175 |
type => 'application/pdf', |
|
176 |
name => $file_name, |
|
177 |
js_no_render => 1, |
|
178 |
); |
|
179 |
unlink $result{file_name}; |
|
180 |
} elsif ($media eq 'printer') { |
|
181 |
my $printer = SL::DB::Printer->new(id => $printer_id)->load; |
|
182 |
$printer->print_document( |
|
183 |
copies => $copies, |
|
184 |
file_name => $result{file_name}, |
|
185 |
); |
|
186 |
|
|
187 |
flash_later('info', t8('The document has been sent to the printer \'#1\'.', $printer->printer_description)); |
|
188 |
unlink $result{file_name} if $result{file_name}; |
|
189 |
} else { |
|
190 |
die t8('Media \'#1\' is not supported yet/anymore.', $media); |
|
191 |
} |
|
192 |
|
|
193 |
1; |
|
194 |
} or do { |
|
195 |
unlink $result{file_name} if $result{file_name}; |
|
196 |
flash_later('error', t8("Creating the PDF failed!")); |
|
197 |
flash_later('error', $@); |
|
198 |
}; |
|
199 |
|
|
200 |
my $redirect_url = $self->url_for( |
|
201 |
'action' => 'edit', |
|
202 |
'part.id' => $self->part->id, |
|
203 |
); |
|
204 |
$self->js->redirect_to($redirect_url)->render; |
|
205 |
} |
|
206 |
|
|
131 | 207 |
sub action_save_and_purchase_order { |
132 | 208 |
my ($self) = @_; |
133 | 209 |
|
... | ... | |
1542 | 1618 |
die "no query rules for parts_classification_type " . $::form->{parts_classification_type}; |
1543 | 1619 |
} |
1544 | 1620 |
|
1621 |
sub init_print_options { |
|
1622 |
|
|
1623 |
my $print_form = Form->new(''); |
|
1624 |
$print_form->{type} = 'part'; |
|
1625 |
$print_form->{printers} = SL::DB::Manager::Printer->get_all_sorted; |
|
1626 |
$print_form->{languages} = SL::DB::Manager::Language->get_all_sorted; |
|
1627 |
|
|
1628 |
return SL::Helper::PrintOptions->get_print_options( |
|
1629 |
form => $print_form, |
|
1630 |
options => {dialog_name_prefix => 'print_options.', |
|
1631 |
show_headers => 1, |
|
1632 |
no_queue => 1, |
|
1633 |
no_postscript => 1, |
|
1634 |
no_opendocument => 1, |
|
1635 |
no_html => 1}, |
|
1636 |
); |
|
1637 |
} |
|
1638 |
|
|
1545 | 1639 |
# simple checks to run on $::form before saving |
1546 | 1640 |
|
1547 | 1641 |
sub form_check_part_description_exists { |
... | ... | |
1804 | 1898 |
combobox => [ |
1805 | 1899 |
action => [ |
1806 | 1900 |
t8('Export'), |
1807 |
only_if => $self->part->is_assembly || $self->part->is_assortment, |
|
1901 |
], |
|
1902 |
action => [ |
|
1903 |
t8('Save and print'), |
|
1904 |
call => [ 'kivi.Part.show_print_options' ], |
|
1905 |
disabled => !$may_edit ? t8('You do not have the permissions to access this function.') : undef, |
|
1906 |
checks => [ 'kivi.validate_form' ], |
|
1808 | 1907 |
], |
1809 | 1908 |
action => [ |
1810 | 1909 |
$self->part->is_assembly ? t8('Assembly items') : t8('Assortment items'), |
... | ... | |
1972 | 2071 |
|
1973 | 2072 |
Saves the current part and then reloads the edit page for the part. |
1974 | 2073 |
|
2074 |
=item C<action_save_and_print> |
|
2075 |
|
|
2076 |
Saves the current part, prints the selected template and then reloads the edit |
|
2077 |
page for the part. |
|
2078 |
|
|
1975 | 2079 |
=item C<action_use_as_new> |
1976 | 2080 |
|
1977 | 2081 |
Takes the information from the current part, plus any modifications made on the |
SL/Helper/PrintOptions.pm | ||
---|---|---|
97 | 97 |
($form->{type} =~ /_reclamation$/) ? ( |
98 | 98 |
opthash($form->{type}, $form->{PD}{$form->{type}}, $locale->text('Reclamation')), |
99 | 99 |
) : undef, |
100 |
($form->{type} =~ /^part$/) ? ( |
|
101 |
opthash('part_info', $form->{PD}{part_info}, $locale->text('Part info')), |
|
102 |
opthash('part_label', $form->{PD}{part_label}, $locale->text('Part label')), |
|
103 |
) : undef, |
|
100 | 104 |
($form->{type} =~ /^letter$/) ? ( |
101 | 105 |
opthash('letter', $form->{PD}{letter}, $locale->text('Letter')), |
102 | 106 |
) : undef; |
... | ... | |
154 | 158 |
|
155 | 159 |
my %dont_display_groupitems = ( |
156 | 160 |
'dunning' => 1, |
161 |
'part' => 1, |
|
157 | 162 |
); |
158 | 163 |
|
159 | 164 |
my %template_vars = ( |
bin/mozilla/amtemplates.pl | ||
---|---|---|
156 | 156 |
credit_note => $locale->text('Credit Note'), |
157 | 157 |
income_statement => { translation => $locale->text('Income Statement'), html => 1 }, |
158 | 158 |
invoice => $locale->text('Invoice'), |
159 |
part_info => { translation => $locale->text('Part info'), tex => 1 }, |
|
160 |
part_label => { translation => $locale->text('Part label'), tex => 1 }, |
|
159 | 161 |
pick_list => $locale->text('Pick List'), |
160 | 162 |
proforma => $locale->text('Proforma Invoice'), |
161 | 163 |
purchase_delivery_order => { translation => $::locale->text('Purchase delivery order'), tex => 1 }, |
js/kivi.Part.js | ||
---|---|---|
29 | 29 |
$.download("controller.pl", data); |
30 | 30 |
}; |
31 | 31 |
|
32 |
ns.show_print_options = function() { |
|
33 |
kivi.popup_dialog({ |
|
34 |
id: 'print_options', |
|
35 |
dialog: { |
|
36 |
title: kivi.t8('Print options'), |
|
37 |
width: 800, |
|
38 |
height: 300 |
|
39 |
} |
|
40 |
}); |
|
41 |
} |
|
42 |
|
|
43 |
ns.save_and_print = function() { |
|
44 |
$('#print_options').dialog('close'); |
|
45 |
|
|
46 |
var data = $('#ic').serializeArray(); |
|
47 |
data = data.concat($('#print_options_form').serializeArray()); |
|
48 |
data.push({ name: 'action', value: 'Part/save_and_print' }); |
|
49 |
|
|
50 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
51 |
}; |
|
52 |
|
|
32 | 53 |
ns.delete = function() { |
33 | 54 |
var data = $('#ic').serializeArray(); |
34 | 55 |
data.push({ name: 'action', value: 'Part/delete' }); |
locale/de/all | ||
---|---|---|
962 | 962 |
'Creating Documents' => 'Erzeuge Dokumente', |
963 | 963 |
'Creating Factur-X/ZUGFeRD invoices is not enabled for this customer.' => 'Das Erzeugen von Factur-X/ZUGFeRD-Rechnungen ist für diesen Kunden nicht aktiviert.', |
964 | 964 |
'Creating invoices' => 'Erzeuge Rechnungen', |
965 |
'Creating the PDF failed!' => 'Erstellung des PDFs fehlgeschlagen!', |
|
965 | 966 |
'Creating the PDF failed:' => 'PDF-Erzeugung fehlgeschlagen:', |
966 | 967 |
'Creation Date' => 'Erstelldatum', |
967 | 968 |
'Creation Time' => 'Erstellungszeit', |
... | ... | |
2820 | 2821 |
'Part already in purchasebasket or has no vendor' => 'Artikel ist schon im Bestellwarenkorb oder hat keinen Lieferanten', |
2821 | 2822 |
'Part already ordered' => 'Artikel ist bestellt', |
2822 | 2823 |
'Part classifications' => 'Artikel-Klassifizierungen', |
2824 |
'Part info' => 'Artikelinfo', |
|
2825 |
'Part label' => 'Artikeletikett', |
|
2823 | 2826 |
'Part marked as "Shop part"' => 'Markiert als Shopartikel', |
2824 | 2827 |
'Part picker' => 'Artikelauswahl', |
2825 | 2828 |
'Part picker search dialog (magnifying glass): "all as list" defaults to on' => 'Artikel-Such-Dialog (Lupe): "alle als Liste" voreinstellen', |
... | ... | |
4115 | 4118 |
'The document has been changed by another user. Please reopen it in another window and copy the changes to the new window' => 'Die Daten wurden bereits von einem anderen Benutzer verändert. Deshalb ist das Dokument ungültig. Bitte öffnen Sie das Dokument erneut in einem extra Fenster und übertragen Sie die Daten', |
4116 | 4119 |
'The document has been created.' => 'Das Dokument wurde erzeugt.', |
4117 | 4120 |
'The document has been printed.' => 'Das Dokument wurde gedruckt.', |
4121 |
'The document has been sent to the printer \'#1\'.' => 'Das Dokument wurde zum Drucker \'#1\' gesendet.', |
|
4118 | 4122 |
'The documents have been sent to the printer \'#1\'.' => 'Die Dokumente sind zum Drucker \'#1\' geschickt', |
4119 | 4123 |
'The dunnings have been printed.' => 'Die Mahnung(en) wurden gedruckt.', |
4120 | 4124 |
'The email entry for #1 looks invalid' => 'Die eingetragene E-Mail-Adresse für #1 sieht ungültig aus.', |
locale/en/all | ||
---|---|---|
962 | 962 |
'Creating Documents' => '', |
963 | 963 |
'Creating Factur-X/ZUGFeRD invoices is not enabled for this customer.' => '', |
964 | 964 |
'Creating invoices' => '', |
965 |
'Creating the PDF failed!' => '', |
|
965 | 966 |
'Creating the PDF failed:' => '', |
966 | 967 |
'Creation Date' => '', |
967 | 968 |
'Creation Time' => '', |
... | ... | |
2819 | 2820 |
'Part already in purchasebasket or has no vendor' => '', |
2820 | 2821 |
'Part already ordered' => '', |
2821 | 2822 |
'Part classifications' => '', |
2823 |
'Part info' => '', |
|
2824 |
'Part label' => '', |
|
2822 | 2825 |
'Part marked as "Shop part"' => '', |
2823 | 2826 |
'Part picker' => '', |
2824 | 2827 |
'Part picker search dialog (magnifying glass): "all as list" defaults to on' => '', |
... | ... | |
4113 | 4116 |
'The document has been changed by another user. Please reopen it in another window and copy the changes to the new window' => '', |
4114 | 4117 |
'The document has been created.' => '', |
4115 | 4118 |
'The document has been printed.' => '', |
4119 |
'The document has been sent to the printer \'#1\'.' => '', |
|
4116 | 4120 |
'The documents have been sent to the printer \'#1\'.' => '', |
4117 | 4121 |
'The dunnings have been printed.' => '', |
4118 | 4122 |
'The email entry for #1 looks invalid' => '', |
templates/print/RB/part_info.tex | ||
---|---|---|
1 |
% config: use-template-toolkit=1 |
|
2 |
% config: tag-style=$( )$ |
|
3 |
$( USE KiviLatex )$ |
|
4 |
$( USE P )$ |
|
5 |
$( USE Dumper )$ |
|
6 |
$( USE LxERP )$ |
|
7 |
\input{inheaders.tex} |
|
8 |
\usepackage{graphicx} |
|
9 |
|
|
10 |
$( KiviLatex.required_packages_for_html )$ |
|
11 |
% Variablen, die in settings verwendet werden |
|
12 |
\newcommand{\lxlangcode} {$(template_meta.language.template_code)$} |
|
13 |
\newcommand{\lxmedia} {$(media)$} |
|
14 |
\newcommand{\lxcurrency} {$(currency)$} |
|
15 |
\newcommand{\kivicompany} {$(employee_company)$} |
|
16 |
|
|
17 |
% settings: Einstellungen, Logo, Briefpapier, Kopfzeile, Fusszeile |
|
18 |
|
|
19 |
% Sprachüberprüfung |
|
20 |
\ifthenelse{\equal{\lxlangcode}{EN}}{\input{english.tex}}{ |
|
21 |
\ifthenelse{\equal{\lxlangcode}{DE}}{\input{deutsch.tex}}{\input{deutsch.tex}} |
|
22 |
} % Ende EN |
|
23 |
|
|
24 |
|
|
25 |
% Mandanten-/Firmenabhängigkeiten |
|
26 |
|
|
27 |
% Pfad zu firmenspez. Angaben |
|
28 |
% Hat man mehrere Mandanten muß man statt "Firma1" den Datenbanknamen seines |
|
29 |
% Mandanten eingeben. |
|
30 |
|
|
31 |
\IfSubStringInString{Firma1}{\kivicompany}{\newcommand{\identpath}{firma1}}{ |
|
32 |
\IfSubStringInString{Firma2}{\kivicompany}{\newcommand{\identpath}{firma2}} |
|
33 |
{\newcommand{\identpath}{firma}} % sonst |
|
34 |
} % Ende Firma1 |
|
35 |
|
|
36 |
% Identität |
|
37 |
\input{\identpath/ident.tex} |
|
38 |
|
|
39 |
% Währungen/Konten |
|
40 |
\IfSubStringInString{USD}{\lxcurrency}{\input{\identpath/usd_account.tex}}{ |
|
41 |
\IfSubStringInString{CHF}{\lxcurrency}{\input{\identpath/chf_account.tex}}{ |
|
42 |
\IfSubStringInString{EUR}{\lxcurrency}{\input{\identpath/euro_account.tex}}{\input{\identpath/euro_account.tex}} |
|
43 |
} % Ende CHF |
|
44 |
} % Ende USD |
|
45 |
|
|
46 |
% Briefkopf, Logo oder Briefpapier |
|
47 |
%% \IfSubStringInString{mail}{\lxmedia}{ % nur bei Mail |
|
48 |
% Grafik als Briefkopf |
|
49 |
%%\setlength{\wpYoffset}{380pt} % Verschiebung von der Mitte nach oben |
|
50 |
%%\setlength{\wpYoffset}{130mm} % Verschiebung von der Mitte nach oben |
|
51 |
%%\CenterWallPaper{0.885}{\identpath/briefkopf.png} % mit Skalierung |
|
52 |
|
|
53 |
% oder nur ein Logo oben rechts |
|
54 |
%% \setlength{\wpXoffset}{180pt} % Verschiebung von der Mitte nach rechts |
|
55 |
%% \setlength{\wpYoffset}{380pt} % Verschiebung von der Mitte nach oben |
|
56 |
%% \CenterWallPaper{0.1}{\identpath/logo.png} % mit Skalierung |
|
57 |
|
|
58 |
% oder ganzer Briefbogen als Hintergrund |
|
59 |
% \CenterWallPaper{1}{\identpath/Briefpapier.pdf} |
|
60 |
%% } |
|
61 |
|
|
62 |
|
|
63 |
% keine Absätze nach rechts einrücken |
|
64 |
\setlength\parindent{0pt} |
|
65 |
|
|
66 |
% Papierformat, Ränder, usw. |
|
67 |
\geometry{ |
|
68 |
a4paper, % DINA4 |
|
69 |
%% left=19mm, % Linker Rand |
|
70 |
width=182mm, % Textbreite |
|
71 |
top=35mm, % Abstand Textanfang von oben |
|
72 |
head=44mm, % Höhe des Kopfes |
|
73 |
headsep=4mm, % Abstand Kopf zu Textanfang |
|
74 |
bottom=30mm, % Abstand von unten |
|
75 |
% showframe, % Rahmen zum Debuggen anzeigen |
|
76 |
} |
|
77 |
|
|
78 |
|
|
79 |
% Befehl f. normale Schriftart und -größe |
|
80 |
%\setmainfont{cmunrm.otf} |
|
81 |
\newcommand{\ourfont}{\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont} |
|
82 |
%\newcommand{\ourfont}{\setmainfont |
|
83 |
% [ BoldFont={cmunsx.otf}, |
|
84 |
% ItalicFont={cmunsi.otf}, |
|
85 |
% BoldItalicFont={cmunso.otf}]{cmunss.otf}} |
|
86 |
|
|
87 |
% Einstellungen f. Kopf und Fuss |
|
88 |
\pagestyle{scrheadings} |
|
89 |
\clearscrheadfoot |
|
90 |
%\setheadwidth[20mm]{page} % Kopfzeile nach rechts verschieben |
|
91 |
%\setfootwidth[-39mm]{page} % Fusszeile verschieben |
|
92 |
|
|
93 |
% Befehl f. laufende Kopfzeile: |
|
94 |
% 1. Text f. Kunden- oder Lieferantennummer (oder leer, wenn diese nicht ausgegeben werden soll) |
|
95 |
% 2. Kunden- oder Lieferantennummer (oder leer) |
|
96 |
% 3. Belegname {oder leer} |
|
97 |
% 4. Belegnummer {oder leer} |
|
98 |
% 5. Belegdatum {oder leer} |
|
99 |
% Beispiel: \ourhead{\kundennummer}{<%customernumber%>}{\angebot}{<%quonumber%>}{<%quodate%>} |
|
100 |
\newcommand{\ourhead}[5] { |
|
101 |
\chead{ |
|
102 |
\ifthenelse{\equal{\thepage}{1}} |
|
103 |
{}% then |
|
104 |
{\normalfont\fontfamily{cmss}\scriptsize |
|
105 |
\ifthenelse{\equal{#1}{}}{}{#1: #2 \hspace{0.7cm}}{} |
|
106 |
#3 |
|
107 |
\ifthenelse{\equal{#4}{}}{}{~\nr: #4} |
|
108 |
\ifthenelse{\equal{#5}{}}{}{\vom ~ #5} |
|
109 |
\hspace{0.7cm} - \seite ~ \thepage/\pageref{LastPage} ~- } |
|
110 |
}%ende chead |
|
111 |
} |
|
112 |
|
|
113 |
% Firmenfuss |
|
114 |
%\cfoot{ |
|
115 |
% {\normalfont\fontfamily{cmss} \tiny |
|
116 |
% \begin{tabular}{p{5cm}p{4.5cm}lr} |
|
117 |
% \firma & \email & \textKontonummer & \kontonummer \\ |
|
118 |
% \strasse & \homepage & \textBank & \bank \\ |
|
119 |
% \ort & \textUstid\ \ustid & \textIban & \iban \\ |
|
120 |
% \textTelefon~\telefon & \finanzamt & \textBic & \bic \\ |
|
121 |
% \ifthenelse{\equal{\fax}{}}{}{\textFax~\fax} & &\textBankleitzahl & \bankleitzahl \\ |
|
122 |
% \end{tabular} |
|
123 |
% } |
|
124 |
%} |
|
125 |
|
|
126 |
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} %Linksbündig mit eigener Breite |
|
127 |
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % zentriert mit Breitenangabe |
|
128 |
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} % rechtsbündig mit Breitenangabe |
|
129 |
\begin{document} |
|
130 |
\ourfont |
|
131 |
$(# Dumper.dump_html(part.assemblies) )$ |
|
132 |
\large \textbf{Artikeldaten}\hfill \today |
|
133 |
\vspace*{0.3cm} |
|
134 |
\normalsize |
|
135 |
\begin{tabular}{L{5cm}L{12cm}} |
|
136 |
Art.Nr.: & $( KiviLatex.filter(part.partnumber) )$ \\ |
|
137 |
Artikelbeschreibung: & $( KiviLatex.filter(part.description) )$ \\ |
|
138 |
Langtext: & $( KiviLatex.filter_html(part.notes) )$ \\ |
|
139 |
Gruppe: & $( KiviLatex.filter(part.partsgroup.partsgroup) )$ \\ |
|
140 |
Lager - Lagerplatz: & $( KiviLatex.filter(part.warehouse.description) )$ - $( KiviLatex.filter(part.bin.description) )$ \\ |
|
141 |
Aktuelle Bestandsmenge: & $( KiviLatex.filter(part.onhand_as_number) )$ $( KiviLatex.filter(part.unit) )$\\ |
|
142 |
Buchungsgruppe: & $( KiviLatex.filter(part.buchungsgruppen.description) )$ \\ |
|
143 |
%$(IF part.part_type )$ |
|
144 |
Artikeltyp: & $( KiviLatex.filter(LxERP.t8(part.part_type)) )$ \\ |
|
145 |
%$(END)$ |
|
146 |
%$(IF part.classification )$ |
|
147 |
Artikelklassifizierung: & $( KiviLatex.filter(LxERP.t8(part.classification.description)) )$ \\ |
|
148 |
%$(END)$ |
|
149 |
%$(IF part.customm_tariff_number )$ |
|
150 |
Zolltarifnummer: & $( KiviLatex.filter(LxERP.t8(part.customm_tariff_number)) )$ \\ |
|
151 |
%$(END)$ |
|
152 |
%$(IF part.ean )$ |
|
153 |
EAN: & $( KiviLatex.filter(LxERP.t8(part.ean)) )$ \\ |
|
154 |
%$(END)$ |
|
155 |
%$(IF part.microfiche )$ |
|
156 |
Microfilm: & $( KiviLatex.filter(LxERP.t8(part.microfiche)) )$ \\ |
|
157 |
%$(END)$ |
|
158 |
%$(IF part.drawing )$ |
|
159 |
Zeichnung: & $( KiviLatex.filter(LxERP.t8(part.drawing)) )$ \\ |
|
160 |
%$(END)$ |
|
161 |
%$(IF part.weight )$ |
|
162 |
Gewicht: & $( KiviLatex.filter(LxERP.t8(part.weight)) )$ \\ |
|
163 |
%$(END)$ |
|
164 |
\end{tabular} |
|
165 |
|
|
166 |
$(IF KiviLatex.filter(part.image))$ |
|
167 |
\begin{minipage}{2cm} |
|
168 |
% \begin{pspicture}(-5cm,2em)(1.5in,0.5in) |
|
169 |
\includegraphics[width=7cm ]{$( part.image )$} |
|
170 |
% \end{pspicture} |
|
171 |
\end{minipage} |
|
172 |
$(END)$ |
|
173 |
|
|
174 |
\begin{tabular}{L{6cm}R{2cm}} |
|
175 |
\rowcolor{gray}Preisart & Preis \\ |
|
176 |
Listenpreis: & $( KiviLatex.filter(part.listprice_as_number) )$ € \\ |
|
177 |
Einkaufspreis: & $( KiviLatex.filter(part.lastcost_as_number) )$ € \\ |
|
178 |
Verkaufspreis: & $( KiviLatex.filter(part.sellprice_as_number) )$ €\\ |
|
179 |
%$( IF part.prices.size )$ |
|
180 |
\rowcolor{gray}\multicolumn{2}{c}{Preisgruppen(nur Verkauf)} \\ |
|
181 |
%$( FOREACH price = part.prices )$ |
|
182 |
$( KiviLatex.filter(price.pricegroup.pricegroup) )$ & $( KiviLatex.filter(price.price_as_number) )$ €\\ |
|
183 |
%$(END)$ |
|
184 |
%$(END)$ |
|
185 |
%$( IF prules_sell.size )$ |
|
186 |
\rowcolor{gray}\multicolumn{2}{c}{Preisregel Verkauf} \\ |
|
187 |
%$( FOREACH pricerule_s = prules_sell )$ |
|
188 |
$( KiviLatex.filter(pricerule_s.price_rules.name) )$ & $( KiviLatex.filter(pricerule_s.price_rules.price_as_number) )$ €\\ |
|
189 |
%$(END)$ |
|
190 |
%$(END)$ |
|
191 |
%$( IF prules_buy.size )$ |
|
192 |
\rowcolor{gray}\multicolumn{2}{c}{Preisregel Einkauf} \\ |
|
193 |
%$( FOREACH pricerule_b = prules_buy )$ |
|
194 |
$( KiviLatex.filter(pricerule_b.price_rules.name) )$ & $( KiviLatex.filter(pricerule_b.price_rules.price_as_number) )$ €\\ |
|
195 |
%$(END)$ |
|
196 |
%$(END)$ |
|
197 |
\end{tabular} |
|
198 |
|
|
199 |
%$( IF part.makemodels.size )$ |
|
200 |
\begin{tabularx}{\textwidth}{L{6cm}L{3cm}XR{2cm}} |
|
201 |
\rowcolor{gray}Lieferant & Art.Nr. & Artikelbeschreibung & Preis \\ |
|
202 |
%$( FOREACH vendor = part.makemodels )$ |
|
203 |
$( KiviLatex.filter(vendor.maker.name) )$ & $( KiviLatex.filter(vendor.model) )$ & $( KiviLatex.filter(vendor.model_description) )$ & $( KiviLatex.filter(vendor.lastcost_as_number) )$ € \\ |
|
204 |
%$( END )$ |
|
205 |
\end{tabularx} |
|
206 |
%$(END)$ |
|
207 |
|
|
208 |
%$(IF part.is_assembly)$ |
|
209 |
\textbf{Bestandteile} |
|
210 |
|
|
211 |
%\begin{longtable}{\textwidth}{L{3cm}XR{2cm}} |
|
212 |
\setlength\LTleft\parindent % Tabelle beginnt am linken Textrand |
|
213 |
\setlength\LTright{0pt} % Tabelle endet am rechten Textrand |
|
214 |
\begin{longtable}{@{}p{3cm}p{9.5cm}rp{2cm}@{}} |
|
215 |
\rowcolor{gray}Typ - Art.Nr & Artikelbeschreibung & Menge & Lagerplatz \\ |
|
216 |
%$( FOREACH assembly = part.assemblies )$ |
|
217 |
$( KiviLatex.filter(assembly.part.presenter.typeclass_abbreviation) )$ $( KiviLatex.filter(assembly.part.partnumber) )$ & $( KiviLatex.filter(assembly.part.description) )$ & $( KiviLatex.filter(assembly.qty) )$ $( KiviLatex.filter(assembly.part.unit) )$ & $( KiviLatex.filter(assembly.part.bin.description) )$\\ |
|
218 |
%$( END )$ |
|
219 |
\end{longtable} |
|
220 |
%$( END )$ |
|
221 |
\end{document} |
templates/print/RB/part_label.tex | ||
---|---|---|
1 |
% config: use-template-toolkit=1 |
|
2 |
% config: tag-style=$( )$ |
|
3 |
$( USE KiviLatex )$ |
|
4 |
$( USE P )$ |
|
5 |
|
|
6 |
\documentclass[oneside]{scrartcl} |
|
7 |
\usepackage{tabularx} |
|
8 |
\usepackage{graphicx} |
|
9 |
\usepackage[utf8]{inputenc} |
|
10 |
%\setlength{\textwidth}{50cm} |
|
11 |
%\usepackage[paperwidth=80mm, paperheight=55mm, margin=3mm]{geometry} |
|
12 |
|
|
13 |
%\setlength{\parindent}{0pt} |
|
14 |
|
|
15 |
\begin{document} |
|
16 |
Art.Nr.:~~ $( KiviLatex.filter(part.partnumber) )$ \\[1em] |
|
17 |
\end{document} |
templates/print/marei/part_info.tex | ||
---|---|---|
1 |
% config: use-template-toolkit=1 |
|
2 |
% config: tag-style=$( )$ |
|
3 |
$( USE KiviLatex )$ |
|
4 |
$( USE P )$ |
|
5 |
$( USE Dumper )$ |
|
6 |
$( USE LxERP )$ |
|
7 |
\input{inheaders.tex} |
|
8 |
\usepackage{graphicx} |
|
9 |
|
|
10 |
$( KiviLatex.required_packages_for_html )$ |
|
11 |
% Variablen, die in settings verwendet werden |
|
12 |
\newcommand{\lxlangcode} {$(template_meta.language.template_code)$} |
|
13 |
\newcommand{\lxmedia} {$(media)$} |
|
14 |
\newcommand{\lxcurrency} {$(currency)$} |
|
15 |
\newcommand{\kivicompany} {$(employee_company)$} |
|
16 |
|
|
17 |
% settings: Einstellungen, Logo, Briefpapier, Kopfzeile, Fusszeile |
|
18 |
|
|
19 |
% Sprachüberprüfung |
|
20 |
\ifthenelse{\equal{\lxlangcode}{EN}}{\input{english.tex}}{ |
|
21 |
\ifthenelse{\equal{\lxlangcode}{DE}}{\input{deutsch.tex}}{\input{deutsch.tex}} |
|
22 |
} % Ende EN |
|
23 |
|
|
24 |
|
|
25 |
% Mandanten-/Firmenabhängigkeiten |
|
26 |
|
|
27 |
% Pfad zu firmenspez. Angaben |
|
28 |
% Hat man mehrere Mandanten muß man statt "Firma1" den Datenbanknamen seines |
|
29 |
% Mandanten eingeben. |
|
30 |
|
|
31 |
\IfSubStringInString{Firma1}{\kivicompany}{\newcommand{\identpath}{firma1}}{ |
|
32 |
\IfSubStringInString{Firma2}{\kivicompany}{\newcommand{\identpath}{firma2}} |
|
33 |
{\newcommand{\identpath}{firma}} % sonst |
|
34 |
} % Ende Firma1 |
|
35 |
|
|
36 |
% Identität |
|
37 |
\input{\identpath/ident.tex} |
|
38 |
|
|
39 |
% Währungen/Konten |
|
40 |
\IfSubStringInString{USD}{\lxcurrency}{\input{\identpath/usd_account.tex}}{ |
|
41 |
\IfSubStringInString{CHF}{\lxcurrency}{\input{\identpath/chf_account.tex}}{ |
|
42 |
\IfSubStringInString{EUR}{\lxcurrency}{\input{\identpath/euro_account.tex}}{\input{\identpath/euro_account.tex}} |
|
43 |
} % Ende CHF |
|
44 |
} % Ende USD |
|
45 |
|
|
46 |
% Briefkopf, Logo oder Briefpapier |
|
47 |
%% \IfSubStringInString{mail}{\lxmedia}{ % nur bei Mail |
|
48 |
% Grafik als Briefkopf |
|
49 |
%%\setlength{\wpYoffset}{380pt} % Verschiebung von der Mitte nach oben |
|
50 |
%%\setlength{\wpYoffset}{130mm} % Verschiebung von der Mitte nach oben |
|
51 |
%%\CenterWallPaper{0.885}{\identpath/briefkopf.png} % mit Skalierung |
|
52 |
|
|
53 |
% oder nur ein Logo oben rechts |
|
54 |
%% \setlength{\wpXoffset}{180pt} % Verschiebung von der Mitte nach rechts |
|
55 |
%% \setlength{\wpYoffset}{380pt} % Verschiebung von der Mitte nach oben |
|
56 |
%% \CenterWallPaper{0.1}{\identpath/logo.png} % mit Skalierung |
|
57 |
|
|
58 |
% oder ganzer Briefbogen als Hintergrund |
|
59 |
% \CenterWallPaper{1}{\identpath/Briefpapier.pdf} |
|
60 |
%% } |
|
61 |
|
|
62 |
|
|
63 |
% keine Absätze nach rechts einrücken |
|
64 |
\setlength\parindent{0pt} |
|
65 |
|
|
66 |
% Papierformat, Ränder, usw. |
|
67 |
\geometry{ |
|
68 |
a4paper, % DINA4 |
|
69 |
%% left=19mm, % Linker Rand |
|
70 |
width=182mm, % Textbreite |
|
71 |
top=35mm, % Abstand Textanfang von oben |
|
72 |
head=44mm, % Höhe des Kopfes |
|
73 |
headsep=4mm, % Abstand Kopf zu Textanfang |
|
74 |
bottom=30mm, % Abstand von unten |
|
75 |
% showframe, % Rahmen zum Debuggen anzeigen |
|
76 |
} |
|
77 |
|
|
78 |
|
|
79 |
% Befehl f. normale Schriftart und -größe |
|
80 |
%\setmainfont{cmunrm.otf} |
|
81 |
\newcommand{\ourfont}{\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont} |
|
82 |
%\newcommand{\ourfont}{\setmainfont |
|
83 |
% [ BoldFont={cmunsx.otf}, |
|
84 |
% ItalicFont={cmunsi.otf}, |
|
85 |
% BoldItalicFont={cmunso.otf}]{cmunss.otf}} |
|
86 |
|
|
87 |
% Einstellungen f. Kopf und Fuss |
|
88 |
\pagestyle{scrheadings} |
|
89 |
\clearscrheadfoot |
|
90 |
%\setheadwidth[20mm]{page} % Kopfzeile nach rechts verschieben |
|
91 |
%\setfootwidth[-39mm]{page} % Fusszeile verschieben |
|
92 |
|
|
93 |
% Befehl f. laufende Kopfzeile: |
|
94 |
% 1. Text f. Kunden- oder Lieferantennummer (oder leer, wenn diese nicht ausgegeben werden soll) |
|
95 |
% 2. Kunden- oder Lieferantennummer (oder leer) |
|
96 |
% 3. Belegname {oder leer} |
|
97 |
% 4. Belegnummer {oder leer} |
|
98 |
% 5. Belegdatum {oder leer} |
|
99 |
% Beispiel: \ourhead{\kundennummer}{<%customernumber%>}{\angebot}{<%quonumber%>}{<%quodate%>} |
|
100 |
\newcommand{\ourhead}[5] { |
|
101 |
\chead{ |
|
102 |
\ifthenelse{\equal{\thepage}{1}} |
|
103 |
{}% then |
|
104 |
{\normalfont\fontfamily{cmss}\scriptsize |
|
105 |
\ifthenelse{\equal{#1}{}}{}{#1: #2 \hspace{0.7cm}}{} |
|
106 |
#3 |
|
107 |
\ifthenelse{\equal{#4}{}}{}{~\nr: #4} |
|
108 |
\ifthenelse{\equal{#5}{}}{}{\vom ~ #5} |
|
109 |
\hspace{0.7cm} - \seite ~ \thepage/\pageref{LastPage} ~- } |
|
110 |
}%ende chead |
|
111 |
} |
|
112 |
|
|
113 |
% Firmenfuss |
|
114 |
%\cfoot{ |
|
115 |
% {\normalfont\fontfamily{cmss} \tiny |
|
116 |
% \begin{tabular}{p{5cm}p{4.5cm}lr} |
|
117 |
% \firma & \email & \textKontonummer & \kontonummer \\ |
|
118 |
% \strasse & \homepage & \textBank & \bank \\ |
|
119 |
% \ort & \textUstid\ \ustid & \textIban & \iban \\ |
|
120 |
% \textTelefon~\telefon & \finanzamt & \textBic & \bic \\ |
|
121 |
% \ifthenelse{\equal{\fax}{}}{}{\textFax~\fax} & &\textBankleitzahl & \bankleitzahl \\ |
|
122 |
% \end{tabular} |
|
123 |
% } |
|
124 |
%} |
|
125 |
|
|
126 |
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} %Linksbündig mit eigener Breite |
|
127 |
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % zentriert mit Breitenangabe |
|
128 |
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} % rechtsbündig mit Breitenangabe |
|
129 |
\begin{document} |
|
130 |
\ourfont |
|
131 |
$(# Dumper.dump_html(part.assemblies) )$ |
|
132 |
\large \textbf{Artikeldaten}\hfill \today |
|
133 |
\vspace*{0.3cm} |
|
134 |
\normalsize |
|
135 |
\begin{tabular}{L{5cm}L{12cm}} |
|
136 |
Art.Nr.: & $( KiviLatex.filter(part.partnumber) )$ \\ |
|
137 |
Artikelbeschreibung: & $( KiviLatex.filter(part.description) )$ \\ |
|
138 |
Langtext: & $( KiviLatex.filter_html(part.notes) )$ \\ |
|
139 |
Gruppe: & $( KiviLatex.filter(part.partsgroup.partsgroup) )$ \\ |
|
140 |
Lager - Lagerplatz: & $( KiviLatex.filter(part.warehouse.description) )$ - $( KiviLatex.filter(part.bin.description) )$ \\ |
|
141 |
Aktuelle Bestandsmenge: & $( KiviLatex.filter(part.onhand_as_number) )$ $( KiviLatex.filter(part.unit) )$\\ |
|
142 |
Buchungsgruppe: & $( KiviLatex.filter(part.buchungsgruppen.description) )$ \\ |
|
143 |
%$(IF part.part_type )$ |
|
144 |
Artikeltyp: & $( KiviLatex.filter(LxERP.t8(part.part_type)) )$ \\ |
|
145 |
%$(END)$ |
|
146 |
%$(IF part.classification )$ |
|
147 |
Artikelklassifizierung: & $( KiviLatex.filter(LxERP.t8(part.classification.description)) )$ \\ |
|
148 |
%$(END)$ |
|
149 |
%$(IF part.customm_tariff_number )$ |
|
150 |
Zolltarifnummer: & $( KiviLatex.filter(LxERP.t8(part.customm_tariff_number)) )$ \\ |
|
151 |
%$(END)$ |
|
152 |
%$(IF part.ean )$ |
|
153 |
EAN: & $( KiviLatex.filter(LxERP.t8(part.ean)) )$ \\ |
|
154 |
%$(END)$ |
|
155 |
%$(IF part.microfiche )$ |
|
156 |
Microfilm: & $( KiviLatex.filter(LxERP.t8(part.microfiche)) )$ \\ |
|
157 |
%$(END)$ |
|
158 |
%$(IF part.drawing )$ |
|
159 |
Zeichnung: & $( KiviLatex.filter(LxERP.t8(part.drawing)) )$ \\ |
|
160 |
%$(END)$ |
|
161 |
%$(IF part.weight )$ |
|
162 |
Gewicht: & $( KiviLatex.filter(LxERP.t8(part.weight)) )$ \\ |
|
163 |
%$(END)$ |
|
164 |
\end{tabular} |
|
165 |
|
|
166 |
$(IF KiviLatex.filter(part.image))$ |
|
167 |
\begin{minipage}{2cm} |
|
168 |
% \begin{pspicture}(-5cm,2em)(1.5in,0.5in) |
|
169 |
\includegraphics[width=7cm ]{$( part.image )$} |
|
170 |
% \end{pspicture} |
|
171 |
\end{minipage} |
|
172 |
$(END)$ |
|
173 |
|
|
174 |
\begin{tabular}{L{6cm}R{2cm}} |
|
175 |
\rowcolor{gray}Preisart & Preis \\ |
|
176 |
Listenpreis: & $( KiviLatex.filter(part.listprice_as_number) )$ € \\ |
|
177 |
Einkaufspreis: & $( KiviLatex.filter(part.lastcost_as_number) )$ € \\ |
|
178 |
Verkaufspreis: & $( KiviLatex.filter(part.sellprice_as_number) )$ €\\ |
|
179 |
%$( IF part.prices.size )$ |
|
180 |
\rowcolor{gray}\multicolumn{2}{c}{Preisgruppen(nur Verkauf)} \\ |
|
181 |
%$( FOREACH price = part.prices )$ |
|
182 |
$( KiviLatex.filter(price.pricegroup.pricegroup) )$ & $( KiviLatex.filter(price.price_as_number) )$ €\\ |
|
183 |
%$(END)$ |
|
184 |
%$(END)$ |
|
185 |
%$( IF prules_sell.size )$ |
|
186 |
\rowcolor{gray}\multicolumn{2}{c}{Preisregel Verkauf} \\ |
|
187 |
%$( FOREACH pricerule_s = prules_sell )$ |
|
188 |
$( KiviLatex.filter(pricerule_s.price_rules.name) )$ & $( KiviLatex.filter(pricerule_s.price_rules.price_as_number) )$ €\\ |
|
189 |
%$(END)$ |
|
190 |
%$(END)$ |
|
191 |
%$( IF prules_buy.size )$ |
|
192 |
\rowcolor{gray}\multicolumn{2}{c}{Preisregel Einkauf} \\ |
|
193 |
%$( FOREACH pricerule_b = prules_buy )$ |
|
194 |
$( KiviLatex.filter(pricerule_b.price_rules.name) )$ & $( KiviLatex.filter(pricerule_b.price_rules.price_as_number) )$ €\\ |
|
195 |
%$(END)$ |
|
196 |
%$(END)$ |
|
197 |
\end{tabular} |
|
198 |
|
|
199 |
%$( IF part.makemodels.size )$ |
|
200 |
\begin{tabularx}{\textwidth}{L{6cm}L{3cm}XR{2cm}} |
|
201 |
\rowcolor{gray}Lieferant & Art.Nr. & Artikelbeschreibung & Preis \\ |
|
202 |
%$( FOREACH vendor = part.makemodels )$ |
|
203 |
$( KiviLatex.filter(vendor.maker.name) )$ & $( KiviLatex.filter(vendor.model) )$ & $( KiviLatex.filter(vendor.model_description) )$ & $( KiviLatex.filter(vendor.lastcost_as_number) )$ € \\ |
|
204 |
%$( END )$ |
|
205 |
\end{tabularx} |
|
206 |
%$(END)$ |
|
207 |
|
|
208 |
%$(IF part.is_assembly)$ |
|
209 |
\textbf{Bestandteile} |
|
210 |
|
|
211 |
%\begin{longtable}{\textwidth}{L{3cm}XR{2cm}} |
|
212 |
\setlength\LTleft\parindent % Tabelle beginnt am linken Textrand |
|
213 |
\setlength\LTright{0pt} % Tabelle endet am rechten Textrand |
|
214 |
\begin{longtable}{@{}p{3cm}p{9.5cm}rp{2cm}@{}} |
|
215 |
\rowcolor{gray}Typ - Art.Nr & Artikelbeschreibung & Menge & Lagerplatz \\ |
|
216 |
%$( FOREACH assembly = part.assemblies )$ |
|
217 |
$( KiviLatex.filter(assembly.part.presenter.typeclass_abbreviation) )$ $( KiviLatex.filter(assembly.part.partnumber) )$ & $( KiviLatex.filter(assembly.part.description) )$ & $( KiviLatex.filter(assembly.qty) )$ $( KiviLatex.filter(assembly.part.unit) )$ & $( KiviLatex.filter(assembly.part.bin.description) )$\\ |
|
218 |
%$( END )$ |
|
219 |
\end{longtable} |
|
220 |
%$( END )$ |
|
221 |
\end{document} |
templates/print/marei/part_label.tex | ||
---|---|---|
1 |
% config: use-template-toolkit=1 |
|
2 |
% config: tag-style=$( )$ |
|
3 |
$( USE KiviLatex )$ |
|
4 |
$( USE P )$ |
|
5 |
|
|
6 |
\documentclass[oneside]{scrartcl} |
|
7 |
\usepackage{tabularx} |
|
8 |
\usepackage{graphicx} |
|
9 |
\usepackage[utf8]{inputenc} |
|
10 |
%\setlength{\textwidth}{50cm} |
|
11 |
%\usepackage[paperwidth=80mm, paperheight=55mm, margin=3mm]{geometry} |
|
12 |
|
|
13 |
%\setlength{\parindent}{0pt} |
|
14 |
|
|
15 |
\begin{document} |
|
16 |
Art.Nr.:~~ $( KiviLatex.filter(part.partnumber) )$ \\[1em] |
|
17 |
\end{document} |
templates/webpages/part/form.html | ||
---|---|---|
7 | 7 |
|
8 | 8 |
[% INCLUDE 'common/flash.html' %] |
9 | 9 |
|
10 |
<div id="print_options" style="display:none"> |
|
11 |
<form method="post" action="controller.pl" id="print_options_form"> |
|
12 |
[% SELF.print_options %] |
|
13 |
<br> |
|
14 |
[% L.button_tag('kivi.Part.save_and_print()', LxERP.t8('Save and print')) %] |
|
15 |
<a href="#" onclick="$('#print_options').dialog('close');">[% LxERP.t8("Cancel") %]</a> |
|
16 |
</form> |
|
17 |
</div> |
|
18 |
|
|
10 | 19 |
<form method="post" id="ic" name="ic" action="controller.pl"> |
11 | 20 |
|
12 | 21 |
[% L.hidden_tag('part.part_type' , SELF.part.part_type) %] |
Auch abrufbar als: Unified diff
part: Druck von Etikett und Information