Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision eb2db262

Von Tamino Steinert vor etwa 2 Monaten hinzugefügt

  • ID eb2db262468c0c77d9f2fa7a38fc5f9891b75b84
  • Vorgänger 9de3ed1d
  • Nachfolger 65dc6239

part: Druck von Etikett und Information

Unterschiede anzeigen:

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::JSON;
30 31
use SL::Locale::String qw(t8);
......
39 40
                                  customerprices
40 41
                                  orphaned
41 42
                                  assortment assortment_items assembly assembly_items
43
                                  print_options
42 44
                                  all_pricegroups all_translations all_partsgroups all_units
43 45
                                  all_buchungsgruppen all_payment_terms all_warehouses
44 46
                                  parts_classification_filter
......
127 129
  }
128 130
}
129 131

  
132
sub action_save_and_print {
133
  my ($self) = @_;
134

  
135
  $self->save_with_render_error() or return;
136
  flash_later('info', t8('The item has been saved.'));
137
  $self->js_reset_part_after_save();
138

  
139
  my $formname    = $::form->{print_options}->{formname};
140
  my $language    = $::form->{print_options}->{language};
141
  my $format      = $::form->{print_options}->{format};
142
  my $media       = $::form->{print_options}->{media};
143
  my $printer_id  = $::form->{print_options}->{printer_id};
144
  my $copies      = $::form->{print_options}->{copies};
145

  
146
  my %result;
147
  eval {
148
    %result = SL::Template::LaTeX->parse_and_create_pdf(
149
       $formname . ".tex",
150
       SELF        => $self,
151
       part        => $self->part,
152
       template_meta => {
153
          formname   => 'part',
154
          language   => $language,
155
          extension  => 'pdf',
156
          format     => $format,
157
          media      => $media,
158
          today      => DateTime->today,
159
          lxconfig   => \%::lx_office_conf,
160
        },
161
      );
162
    if ($result{error}) {
163
      die t8('Conversion to PDF failed: #1', $result{error});
164
    }
165

  
166
    my $pdf = $result{file_name};
167

  
168
    if ($media eq 'screen') {
169
      my $file_name =  $formname . '.pdf';
170
      $file_name    =~ s{[^\w\.]+}{_}g;
171

  
172
      $self->send_file(
173
        $pdf,
174
        type => 'application/pdf',
175
        name => $file_name,
176
        js_no_render => 1,
177
      );
178
      unlink $result{file_name};
179
    } elsif ($media eq 'printer') {
180
      my $printer = SL::DB::Printer->new(id => $printer_id)->load;
181
      $printer->print_document(
182
        copies  => $copies,
183
        file_name => $result{file_name},
184
      );
185

  
186
      flash_later('info', t8('The document has been sent to the printer \'#1\'.', $printer->printer_description));
187
      unlink $result{file_name} if $result{file_name};
188
    } else {
189
      die t8('Media \'#1\' is not supported yet/anymore.', $media);
190
    }
191

  
192
    1;
193
  } or do {
194
    unlink $result{file_name} if $result{file_name};
195
    flash_later('error', t8("Creating the PDF failed!"));
196
    flash_later('error', $@);
197
  };
198

  
199
  my $redirect_url = $self->url_for(
200
    'action'  => 'edit',
201
    'part.id' => $self->part->id,
202
  );
203
  $self->js->redirect_to($redirect_url)->render;
204
}
205

  
130 206
sub action_save_and_purchase_order {
131 207
  my ($self) = @_;
132 208

  
......
1508 1584
  die "no query rules for parts_classification_type " . $::form->{parts_classification_type};
1509 1585
}
1510 1586

  
1587
sub init_print_options {
1588

  
1589
  my $print_form = Form->new('');
1590
  $print_form->{type}      = 'part';
1591
  $print_form->{printers}  = SL::DB::Manager::Printer->get_all_sorted;
1592
  $print_form->{languages} = SL::DB::Manager::Language->get_all_sorted;
1593

  
1594
  return SL::Helper::PrintOptions->get_print_options(
1595
      form => $print_form,
1596
      options => {dialog_name_prefix => 'print_options.',
1597
                  show_headers       => 1,
1598
                  no_queue           => 1,
1599
                  no_postscript      => 1,
1600
                  no_opendocument    => 1,
1601
                  no_html            => 1},
1602
    );
1603
}
1604

  
1511 1605
# simple checks to run on $::form before saving
1512 1606

  
1513 1607
sub form_check_part_description_exists {
......
1770 1864
      combobox => [
1771 1865
        action => [
1772 1866
          t8('Export'),
1773
          only_if => $self->part->is_assembly || $self->part->is_assortment,
1867
        ],
1868
        action => [
1869
          t8('Save and print'),
1870
          call     => [ 'kivi.Part.show_print_options' ],
1871
          disabled => !$may_edit ? t8('You do not have the permissions to access this function.') : undef,
1872
          checks   => [ 'kivi.validate_form' ],
1774 1873
        ],
1775 1874
        action => [
1776 1875
          $self->part->is_assembly ? t8('Assembly items') : t8('Assortment items'),
......
1938 2037

  
1939 2038
Saves the current part and then reloads the edit page for the part.
1940 2039

  
2040
=item C<action_save_and_print>
2041

  
2042
Saves the current part, prints the selected template and then reloads the edit
2043
page for the part.
2044

  
1941 2045
=item C<action_use_as_new>
1942 2046

  
1943 2047
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
957 957
  'Creating Documents'          => 'Erzeuge Dokumente',
958 958
  '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.',
959 959
  'Creating invoices'           => 'Erzeuge Rechnungen',
960
  'Creating the PDF failed!'    => 'Erstellung des PDFs fehlgeschlagen!',
960 961
  'Creating the PDF failed:'    => 'PDF-Erzeugung fehlgeschlagen:',
961 962
  'Creation Date'               => 'Erstelldatum',
962 963
  'Creation Time'               => 'Erstellungszeit',
......
2802 2803
  'Part already in purchasebasket or has no vendor' => 'Artikel ist schon im Bestellwarenkorb oder hat keinen Lieferanten',
2803 2804
  'Part already ordered'        => 'Artikel ist bestellt',
2804 2805
  'Part classifications'        => 'Artikel-Klassifizierungen',
2806
  'Part info'                   => 'Artikelinfo',
2807
  'Part label'                  => 'Artikeletikett',
2805 2808
  'Part marked as "Shop part"'  => 'Markiert als Shopartikel',
2806 2809
  'Part picker'                 => 'Artikelauswahl',
2807 2810
  'Part successful counted'     => 'Der Artikel wurde gezählt',
......
4078 4081
  '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',
4079 4082
  'The document has been created.' => 'Das Dokument wurde erzeugt.',
4080 4083
  'The document has been printed.' => 'Das Dokument wurde gedruckt.',
4084
  'The document has been sent to the printer \'#1\'.' => 'Das Dokument wurde zum Drucker \'#1\' gesendet.',
4081 4085
  'The documents have been sent to the printer \'#1\'.' => 'Die Dokumente sind zum Drucker \'#1\' geschickt',
4082 4086
  'The dunnings have been printed.' => 'Die Mahnung(en) wurden gedruckt.',
4083 4087
  'The email entry for #1 looks invalid' => 'Die eingetragene E-Mail-Adresse für #1 sieht ungültig aus.',
locale/en/all
957 957
  'Creating Documents'          => '',
958 958
  'Creating Factur-X/ZUGFeRD invoices is not enabled for this customer.' => '',
959 959
  'Creating invoices'           => '',
960
  'Creating the PDF failed!'    => '',
960 961
  'Creating the PDF failed:'    => '',
961 962
  'Creation Date'               => '',
962 963
  'Creation Time'               => '',
......
2801 2802
  'Part already in purchasebasket or has no vendor' => '',
2802 2803
  'Part already ordered'        => '',
2803 2804
  'Part classifications'        => '',
2805
  'Part info'                   => '',
2806
  'Part label'                  => '',
2804 2807
  'Part marked as "Shop part"'  => '',
2805 2808
  'Part picker'                 => '',
2806 2809
  'Part successful counted'     => '',
......
4076 4079
  'The document has been changed by another user. Please reopen it in another window and copy the changes to the new window' => '',
4077 4080
  'The document has been created.' => '',
4078 4081
  'The document has been printed.' => '',
4082
  'The document has been sent to the printer \'#1\'.' => '',
4079 4083
  'The documents have been sent to the printer \'#1\'.' => '',
4080 4084
  'The dunnings have been printed.' => '',
4081 4085
  '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