Revision 3462658a
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
- ID 3462658a53ad12060720ace22fd45fb508d47537
- Vorgänger 0c9bb179
SL/Controller/Part.pm | ||
---|---|---|
22 | 22 |
use SL::DB::PriceRuleItem; |
23 | 23 |
use SL::DB::Shop; |
24 | 24 |
use SL::Helper::Flash; |
25 |
use SL::Helper::CreatePDF qw(:all); |
|
26 |
use SL::Helper::PrintOptions; |
|
25 | 27 |
use SL::JSON; |
26 | 28 |
use SL::Locale::String qw(t8); |
27 | 29 |
use SL::MoreCommon qw(save_form); |
... | ... | |
35 | 37 |
customerprices |
36 | 38 |
orphaned |
37 | 39 |
assortment assortment_items assembly assembly_items |
40 |
print_options |
|
38 | 41 |
all_pricegroups all_translations all_partsgroups all_units |
39 | 42 |
all_buchungsgruppen all_payment_terms all_warehouses |
40 | 43 |
parts_classification_filter |
... | ... | |
122 | 125 |
} |
123 | 126 |
} |
124 | 127 |
|
128 |
sub action_save_and_print { |
|
129 |
my ($self) = @_; |
|
130 |
|
|
131 |
$self->save_with_render_error() or return; |
|
132 |
flash_later('info', t8('The item has been saved.')); |
|
133 |
$self->js_reset_part_after_save(); |
|
134 |
|
|
135 |
my $formname = $::form->{print_options}->{formname}; |
|
136 |
my $language = $::form->{print_options}->{language}; |
|
137 |
my $format = $::form->{print_options}->{format}; |
|
138 |
my $media = $::form->{print_options}->{media}; |
|
139 |
my $printer_id = $::form->{print_options}->{printer_id}; |
|
140 |
my $copies = $::form->{print_options}->{copies}; |
|
141 |
|
|
142 |
my %result; |
|
143 |
eval { |
|
144 |
%result = SL::Template::LaTeX->parse_and_create_pdf( |
|
145 |
$formname . ".tex", |
|
146 |
SELF => $self, |
|
147 |
part => $self->part, |
|
148 |
template_meta => { |
|
149 |
formname => 'part', |
|
150 |
language => $language, |
|
151 |
extension => 'pdf', |
|
152 |
format => $format, |
|
153 |
media => $media, |
|
154 |
today => DateTime->today, |
|
155 |
lxconfig => \%::lx_office_conf, |
|
156 |
}, |
|
157 |
); |
|
158 |
if ($result{error}) { |
|
159 |
die t8('Conversion to PDF failed: #1', $result{error}); |
|
160 |
} |
|
161 |
|
|
162 |
my $pdf = $result{file_name}; |
|
163 |
|
|
164 |
if ($media eq 'screen') { |
|
165 |
my $file_name = $formname . '.pdf'; |
|
166 |
$file_name =~ s{[^\w\.]+}{_}g; |
|
167 |
|
|
168 |
$self->send_file( |
|
169 |
$pdf, |
|
170 |
type => 'application/pdf', |
|
171 |
name => $file_name, |
|
172 |
js_no_render => 1, |
|
173 |
); |
|
174 |
unlink $result{file_name}; |
|
175 |
} elsif ($media eq 'printer') { |
|
176 |
my $printer = SL::DB::Printer->new(id => $printer_id)->load; |
|
177 |
$printer->print_document( |
|
178 |
copies => $copies, |
|
179 |
file_name => $result{file_name}, |
|
180 |
); |
|
181 |
|
|
182 |
flash_later('info', t8('The document has been sent to the printer \'#1\'.', $printer->printer_description)); |
|
183 |
unlink $result{file_name} if $result{file_name}; |
|
184 |
} else { |
|
185 |
die t8('Media \'#1\' is not supported yet/anymore.', $media); |
|
186 |
} |
|
187 |
|
|
188 |
1; |
|
189 |
} or do { |
|
190 |
unlink $result{file_name} if $result{file_name}; |
|
191 |
flash_later('error', t8("Creating the PDF failed!")); |
|
192 |
flash_later('error', $@); |
|
193 |
}; |
|
194 |
|
|
195 |
my $redirect_url = $self->url_for( |
|
196 |
'action' => 'edit', |
|
197 |
'part.id' => $self->part->id, |
|
198 |
); |
|
199 |
$self->js->redirect_to($redirect_url)->render; |
|
200 |
} |
|
201 |
|
|
125 | 202 |
sub action_save_and_purchase_order { |
126 | 203 |
my ($self) = @_; |
127 | 204 |
|
... | ... | |
1289 | 1366 |
die "no query rules for parts_classification_type " . $::form->{parts_classification_type}; |
1290 | 1367 |
} |
1291 | 1368 |
|
1369 |
sub init_print_options { |
|
1370 |
|
|
1371 |
my $print_form = Form->new(''); |
|
1372 |
$print_form->{type} = 'part'; |
|
1373 |
$print_form->{printers} = SL::DB::Manager::Printer->get_all_sorted; |
|
1374 |
$print_form->{languages} = SL::DB::Manager::Language->get_all_sorted; |
|
1375 |
|
|
1376 |
return SL::Helper::PrintOptions->get_print_options( |
|
1377 |
form => $print_form, |
|
1378 |
options => {dialog_name_prefix => 'print_options.', |
|
1379 |
show_headers => 1, |
|
1380 |
no_queue => 1, |
|
1381 |
no_postscript => 1, |
|
1382 |
no_opendocument => 1, |
|
1383 |
no_html => 1}, |
|
1384 |
); |
|
1385 |
} |
|
1386 |
|
|
1292 | 1387 |
# simple checks to run on $::form before saving |
1293 | 1388 |
|
1294 | 1389 |
sub form_check_part_description_exists { |
... | ... | |
1538 | 1633 |
combobox => [ |
1539 | 1634 |
action => [ |
1540 | 1635 |
t8('Export'), |
1541 |
only_if => $self->part->is_assembly || $self->part->is_assortment, |
|
1636 |
], |
|
1637 |
action => [ |
|
1638 |
t8('Save and print'), |
|
1639 |
call => [ 'kivi.Part.show_print_options' ], |
|
1640 |
disabled => !$may_edit ? t8('You do not have the permissions to access this function.') : undef, |
|
1641 |
checks => [ 'kivi.validate_form' ], |
|
1542 | 1642 |
], |
1543 | 1643 |
action => [ |
1544 | 1644 |
$self->part->is_assembly ? t8('Assembly items') : t8('Assortment items'), |
... | ... | |
1696 | 1796 |
|
1697 | 1797 |
Saves the current part and then reloads the edit page for the part. |
1698 | 1798 |
|
1799 |
=item C<action_save_and_print> |
|
1800 |
|
|
1801 |
Saves the current part, prints the selected template and then reloads the edit |
|
1802 |
page for the part. |
|
1803 |
|
|
1699 | 1804 |
=item C<action_use_as_new> |
1700 | 1805 |
|
1701 | 1806 |
Takes the information from the current part, plus any modifications made on the |
SL/Helper/PrintOptions.pm | ||
---|---|---|
88 | 88 |
($form->{type} =~ /_reclamation$/) ? ( |
89 | 89 |
opthash($form->{type}, $form->{PD}{$form->{type}}, $locale->text('Reclamation')), |
90 | 90 |
) : undef, |
91 |
($form->{type} =~ /^part$/) ? ( |
|
92 |
opthash('part_info', $form->{PD}{part_info}, $locale->text('Part info')), |
|
93 |
opthash('part_label', $form->{PD}{part_label}, $locale->text('Part label')), |
|
94 |
) : undef, |
|
91 | 95 |
($form->{type} =~ /^letter$/) ? ( |
92 | 96 |
opthash('letter', $form->{PD}{letter}, $locale->text('Letter')), |
93 | 97 |
) : undef; |
... | ... | |
145 | 149 |
|
146 | 150 |
my %dont_display_groupitems = ( |
147 | 151 |
'dunning' => 1, |
152 |
'part' => 1, |
|
148 | 153 |
); |
149 | 154 |
|
150 | 155 |
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 | ||
---|---|---|
22 | 22 |
$('#ic').submit(); |
23 | 23 |
}; |
24 | 24 |
|
25 |
ns.show_print_options = function() { |
|
26 |
kivi.popup_dialog({ |
|
27 |
id: 'print_options', |
|
28 |
dialog: { |
|
29 |
title: kivi.t8('Print options'), |
|
30 |
width: 800, |
|
31 |
height: 300 |
|
32 |
} |
|
33 |
}); |
|
34 |
} |
|
35 |
|
|
36 |
ns.save_and_print = function() { |
|
37 |
$('#print_options').dialog('close'); |
|
38 |
|
|
39 |
var data = $('#ic').serializeArray(); |
|
40 |
data = data.concat($('#print_options_form').serializeArray()); |
|
41 |
data.push({ name: 'action', value: 'Part/save_and_print' }); |
|
42 |
|
|
43 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
44 |
}; |
|
45 |
|
|
25 | 46 |
ns.delete = function() { |
26 | 47 |
var data = $('#ic').serializeArray(); |
27 | 48 |
data.push({ name: 'action', value: 'Part/delete' }); |
locale/de/all | ||
---|---|---|
904 | 904 |
'Creating Documents' => 'Erzeuge Dokumente', |
905 | 905 |
'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.', |
906 | 906 |
'Creating invoices' => 'Erzeuge Rechnungen', |
907 |
'Creating the PDF failed!' => 'Erstellung des PDFs fehlgeschlagen!', |
|
907 | 908 |
'Creating the PDF failed:' => 'PDF-Erzeugung fehlgeschlagen:', |
908 | 909 |
'Creation Date' => 'Erstelldatum', |
909 | 910 |
'Creation Time' => 'Erstellungszeit', |
... | ... | |
2648 | 2649 |
'Part Type' => 'Artikel-Typ', |
2649 | 2650 |
'Part Unit' => 'Einheit', |
2650 | 2651 |
'Part classifications' => 'Artikel-Klassifizierungen', |
2652 |
'Part info' => 'Artikelinfo', |
|
2653 |
'Part label' => 'Artikeletikett', |
|
2651 | 2654 |
'Part marked as "Shop part"' => 'Markiert als Shopartikel', |
2652 | 2655 |
'Part picker' => 'Artikelauswahl', |
2653 | 2656 |
'Part successful counted' => 'Der Artikel wurde gezählt', |
... | ... | |
3860 | 3863 |
'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', |
3861 | 3864 |
'The document has been created.' => 'Das Dokument wurde erzeugt.', |
3862 | 3865 |
'The document has been printed.' => 'Das Dokument wurde gedruckt.', |
3866 |
'The document has been sent to the printer \'#1\'.' => 'Das Dokument wurde zum Drucker \'#1\' gesendet.', |
|
3863 | 3867 |
'The documents have been sent to the printer \'#1\'.' => 'Die Dokumente sind zum Drucker \'#1\' geschickt', |
3864 | 3868 |
'The dunnings have been printed.' => 'Die Mahnung(en) wurden gedruckt.', |
3865 | 3869 |
'The email entry for #1 looks invalid' => 'Die eingetragene E-Mail-Adresse für #1 sieht ungültig aus.', |
locale/en/all | ||
---|---|---|
904 | 904 |
'Creating Documents' => '', |
905 | 905 |
'Creating Factur-X/ZUGFeRD invoices is not enabled for this customer.' => '', |
906 | 906 |
'Creating invoices' => '', |
907 |
'Creating the PDF failed!' => '', |
|
907 | 908 |
'Creating the PDF failed:' => '', |
908 | 909 |
'Creation Date' => '', |
909 | 910 |
'Creation Time' => '', |
... | ... | |
2647 | 2648 |
'Part Type' => '', |
2648 | 2649 |
'Part Unit' => '', |
2649 | 2650 |
'Part classifications' => '', |
2651 |
'Part info' => '', |
|
2652 |
'Part label' => '', |
|
2650 | 2653 |
'Part marked as "Shop part"' => '', |
2651 | 2654 |
'Part picker' => '', |
2652 | 2655 |
'Part successful counted' => '', |
... | ... | |
2678 | 2681 |
'Payment / Delivery Options' => '', |
2679 | 2682 |
'Payment Date' => '', |
2680 | 2683 |
'Payment Reminder' => '', |
2684 |
'Payment Term' => '', |
|
2681 | 2685 |
'Payment Terms' => '', |
2682 | 2686 |
'Payment Terms missing in row ' => '', |
2683 | 2687 |
'Payment bookings disallowed. After the booking this record may be suggested with the amount of \'#1\' or otherwise has to be choosen manually. No automatic payment booking will be done to chart \'#2\'.' => '', |
... | ... | |
3857 | 3861 |
'The document has been changed by another user. Please reopen it in another window and copy the changes to the new window' => '', |
3858 | 3862 |
'The document has been created.' => '', |
3859 | 3863 |
'The document has been printed.' => '', |
3864 |
'The document has been sent to the printer \'#1\'.' => '', |
|
3860 | 3865 |
'The documents have been sent to the printer \'#1\'.' => '', |
3861 | 3866 |
'The dunnings have been printed.' => '', |
3862 | 3867 |
'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