Revision eb2db262
Von Tamino Steinert vor 11 Monaten hinzugefügt
| SL/Controller/Part.pm | ||
|---|---|---|
|
use SL::DB::PurchaseBasketItem;
|
||
|
use SL::DB::Shop;
|
||
|
use SL::Helper::Flash;
|
||
|
use SL::Helper::CreatePDF qw(:all);
|
||
|
use SL::Helper::PrintOptions;
|
||
|
use SL::JSON;
|
||
|
use SL::Locale::String qw(t8);
|
||
| ... | ... | |
|
customerprices
|
||
|
orphaned
|
||
|
assortment assortment_items assembly assembly_items
|
||
|
print_options
|
||
|
all_pricegroups all_translations all_partsgroups all_units
|
||
|
all_buchungsgruppen all_payment_terms all_warehouses
|
||
|
parts_classification_filter
|
||
| ... | ... | |
|
}
|
||
|
}
|
||
|
|
||
|
sub action_save_and_print {
|
||
|
my ($self) = @_;
|
||
|
|
||
|
$self->save_with_render_error() or return;
|
||
|
flash_later('info', t8('The item has been saved.'));
|
||
|
$self->js_reset_part_after_save();
|
||
|
|
||
|
my $formname = $::form->{print_options}->{formname};
|
||
|
my $language = $::form->{print_options}->{language};
|
||
|
my $format = $::form->{print_options}->{format};
|
||
|
my $media = $::form->{print_options}->{media};
|
||
|
my $printer_id = $::form->{print_options}->{printer_id};
|
||
|
my $copies = $::form->{print_options}->{copies};
|
||
|
|
||
|
my %result;
|
||
|
eval {
|
||
|
%result = SL::Template::LaTeX->parse_and_create_pdf(
|
||
|
$formname . ".tex",
|
||
|
SELF => $self,
|
||
|
part => $self->part,
|
||
|
template_meta => {
|
||
|
formname => 'part',
|
||
|
language => $language,
|
||
|
extension => 'pdf',
|
||
|
format => $format,
|
||
|
media => $media,
|
||
|
today => DateTime->today,
|
||
|
lxconfig => \%::lx_office_conf,
|
||
|
},
|
||
|
);
|
||
|
if ($result{error}) {
|
||
|
die t8('Conversion to PDF failed: #1', $result{error});
|
||
|
}
|
||
|
|
||
|
my $pdf = $result{file_name};
|
||
|
|
||
|
if ($media eq 'screen') {
|
||
|
my $file_name = $formname . '.pdf';
|
||
|
$file_name =~ s{[^\w\.]+}{_}g;
|
||
|
|
||
|
$self->send_file(
|
||
|
$pdf,
|
||
|
type => 'application/pdf',
|
||
|
name => $file_name,
|
||
|
js_no_render => 1,
|
||
|
);
|
||
|
unlink $result{file_name};
|
||
|
} elsif ($media eq 'printer') {
|
||
|
my $printer = SL::DB::Printer->new(id => $printer_id)->load;
|
||
|
$printer->print_document(
|
||
|
copies => $copies,
|
||
|
file_name => $result{file_name},
|
||
|
);
|
||
|
|
||
|
flash_later('info', t8('The document has been sent to the printer \'#1\'.', $printer->printer_description));
|
||
|
unlink $result{file_name} if $result{file_name};
|
||
|
} else {
|
||
|
die t8('Media \'#1\' is not supported yet/anymore.', $media);
|
||
|
}
|
||
|
|
||
|
1;
|
||
|
} or do {
|
||
|
unlink $result{file_name} if $result{file_name};
|
||
|
flash_later('error', t8("Creating the PDF failed!"));
|
||
|
flash_later('error', $@);
|
||
|
};
|
||
|
|
||
|
my $redirect_url = $self->url_for(
|
||
|
'action' => 'edit',
|
||
|
'part.id' => $self->part->id,
|
||
|
);
|
||
|
$self->js->redirect_to($redirect_url)->render;
|
||
|
}
|
||
|
|
||
|
sub action_save_and_purchase_order {
|
||
|
my ($self) = @_;
|
||
|
|
||
| ... | ... | |
|
die "no query rules for parts_classification_type " . $::form->{parts_classification_type};
|
||
|
}
|
||
|
|
||
|
sub init_print_options {
|
||
|
|
||
|
my $print_form = Form->new('');
|
||
|
$print_form->{type} = 'part';
|
||
|
$print_form->{printers} = SL::DB::Manager::Printer->get_all_sorted;
|
||
|
$print_form->{languages} = SL::DB::Manager::Language->get_all_sorted;
|
||
|
|
||
|
return SL::Helper::PrintOptions->get_print_options(
|
||
|
form => $print_form,
|
||
|
options => {dialog_name_prefix => 'print_options.',
|
||
|
show_headers => 1,
|
||
|
no_queue => 1,
|
||
|
no_postscript => 1,
|
||
|
no_opendocument => 1,
|
||
|
no_html => 1},
|
||
|
);
|
||
|
}
|
||
|
|
||
|
# simple checks to run on $::form before saving
|
||
|
|
||
|
sub form_check_part_description_exists {
|
||
| ... | ... | |
|
combobox => [
|
||
|
action => [
|
||
|
t8('Export'),
|
||
|
only_if => $self->part->is_assembly || $self->part->is_assortment,
|
||
|
],
|
||
|
action => [
|
||
|
t8('Save and print'),
|
||
|
call => [ 'kivi.Part.show_print_options' ],
|
||
|
disabled => !$may_edit ? t8('You do not have the permissions to access this function.') : undef,
|
||
|
checks => [ 'kivi.validate_form' ],
|
||
|
],
|
||
|
action => [
|
||
|
$self->part->is_assembly ? t8('Assembly items') : t8('Assortment items'),
|
||
| ... | ... | |
|
|
||
|
Saves the current part and then reloads the edit page for the part.
|
||
|
|
||
|
=item C<action_save_and_print>
|
||
|
|
||
|
Saves the current part, prints the selected template and then reloads the edit
|
||
|
page for the part.
|
||
|
|
||
|
=item C<action_use_as_new>
|
||
|
|
||
|
Takes the information from the current part, plus any modifications made on the
|
||
| SL/Helper/PrintOptions.pm | ||
|---|---|---|
|
($form->{type} =~ /_reclamation$/) ? (
|
||
|
opthash($form->{type}, $form->{PD}{$form->{type}}, $locale->text('Reclamation')),
|
||
|
) : undef,
|
||
|
($form->{type} =~ /^part$/) ? (
|
||
|
opthash('part_info', $form->{PD}{part_info}, $locale->text('Part info')),
|
||
|
opthash('part_label', $form->{PD}{part_label}, $locale->text('Part label')),
|
||
|
) : undef,
|
||
|
($form->{type} =~ /^letter$/) ? (
|
||
|
opthash('letter', $form->{PD}{letter}, $locale->text('Letter')),
|
||
|
) : undef;
|
||
| ... | ... | |
|
|
||
|
my %dont_display_groupitems = (
|
||
|
'dunning' => 1,
|
||
|
'part' => 1,
|
||
|
);
|
||
|
|
||
|
my %template_vars = (
|
||
| bin/mozilla/amtemplates.pl | ||
|---|---|---|
|
credit_note => $locale->text('Credit Note'),
|
||
|
income_statement => { translation => $locale->text('Income Statement'), html => 1 },
|
||
|
invoice => $locale->text('Invoice'),
|
||
|
part_info => { translation => $locale->text('Part info'), tex => 1 },
|
||
|
part_label => { translation => $locale->text('Part label'), tex => 1 },
|
||
|
pick_list => $locale->text('Pick List'),
|
||
|
proforma => $locale->text('Proforma Invoice'),
|
||
|
purchase_delivery_order => { translation => $::locale->text('Purchase delivery order'), tex => 1 },
|
||
| js/kivi.Part.js | ||
|---|---|---|
|
$.download("controller.pl", data);
|
||
|
};
|
||
|
|
||
|
ns.show_print_options = function() {
|
||
|
kivi.popup_dialog({
|
||
|
id: 'print_options',
|
||
|
dialog: {
|
||
|
title: kivi.t8('Print options'),
|
||
|
width: 800,
|
||
|
height: 300
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
ns.save_and_print = function() {
|
||
|
$('#print_options').dialog('close');
|
||
|
|
||
|
var data = $('#ic').serializeArray();
|
||
|
data = data.concat($('#print_options_form').serializeArray());
|
||
|
data.push({ name: 'action', value: 'Part/save_and_print' });
|
||
|
|
||
|
$.post("controller.pl", data, kivi.eval_json_result);
|
||
|
};
|
||
|
|
||
|
ns.delete = function() {
|
||
|
var data = $('#ic').serializeArray();
|
||
|
data.push({ name: 'action', value: 'Part/delete' });
|
||
| locale/de/all | ||
|---|---|---|
|
'Creating Documents' => 'Erzeuge Dokumente',
|
||
|
'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.',
|
||
|
'Creating invoices' => 'Erzeuge Rechnungen',
|
||
|
'Creating the PDF failed!' => 'Erstellung des PDFs fehlgeschlagen!',
|
||
|
'Creating the PDF failed:' => 'PDF-Erzeugung fehlgeschlagen:',
|
||
|
'Creation Date' => 'Erstelldatum',
|
||
|
'Creation Time' => 'Erstellungszeit',
|
||
| ... | ... | |
|
'Part already in purchasebasket or has no vendor' => 'Artikel ist schon im Bestellwarenkorb oder hat keinen Lieferanten',
|
||
|
'Part already ordered' => 'Artikel ist bestellt',
|
||
|
'Part classifications' => 'Artikel-Klassifizierungen',
|
||
|
'Part info' => 'Artikelinfo',
|
||
|
'Part label' => 'Artikeletikett',
|
||
|
'Part marked as "Shop part"' => 'Markiert als Shopartikel',
|
||
|
'Part picker' => 'Artikelauswahl',
|
||
|
'Part successful counted' => 'Der Artikel wurde gezählt',
|
||
| ... | ... | |
|
'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',
|
||
|
'The document has been created.' => 'Das Dokument wurde erzeugt.',
|
||
|
'The document has been printed.' => 'Das Dokument wurde gedruckt.',
|
||
|
'The document has been sent to the printer \'#1\'.' => 'Das Dokument wurde zum Drucker \'#1\' gesendet.',
|
||
|
'The documents have been sent to the printer \'#1\'.' => 'Die Dokumente sind zum Drucker \'#1\' geschickt',
|
||
|
'The dunnings have been printed.' => 'Die Mahnung(en) wurden gedruckt.',
|
||
|
'The email entry for #1 looks invalid' => 'Die eingetragene E-Mail-Adresse für #1 sieht ungültig aus.',
|
||
| locale/en/all | ||
|---|---|---|
|
'Creating Documents' => '',
|
||
|
'Creating Factur-X/ZUGFeRD invoices is not enabled for this customer.' => '',
|
||
|
'Creating invoices' => '',
|
||
|
'Creating the PDF failed!' => '',
|
||
|
'Creating the PDF failed:' => '',
|
||
|
'Creation Date' => '',
|
||
|
'Creation Time' => '',
|
||
| ... | ... | |
|
'Part already in purchasebasket or has no vendor' => '',
|
||
|
'Part already ordered' => '',
|
||
|
'Part classifications' => '',
|
||
|
'Part info' => '',
|
||
|
'Part label' => '',
|
||
|
'Part marked as "Shop part"' => '',
|
||
|
'Part picker' => '',
|
||
|
'Part successful counted' => '',
|
||
| ... | ... | |
|
'The document has been changed by another user. Please reopen it in another window and copy the changes to the new window' => '',
|
||
|
'The document has been created.' => '',
|
||
|
'The document has been printed.' => '',
|
||
|
'The document has been sent to the printer \'#1\'.' => '',
|
||
|
'The documents have been sent to the printer \'#1\'.' => '',
|
||
|
'The dunnings have been printed.' => '',
|
||
|
'The email entry for #1 looks invalid' => '',
|
||
| templates/print/RB/part_info.tex | ||
|---|---|---|
|
% config: use-template-toolkit=1
|
||
|
% config: tag-style=$( )$
|
||
|
$( USE KiviLatex )$
|
||
|
$( USE P )$
|
||
|
$( USE Dumper )$
|
||
|
$( USE LxERP )$
|
||
|
\input{inheaders.tex}
|
||
|
\usepackage{graphicx}
|
||
|
|
||
|
$( KiviLatex.required_packages_for_html )$
|
||
|
% Variablen, die in settings verwendet werden
|
||
|
\newcommand{\lxlangcode} {$(template_meta.language.template_code)$}
|
||
|
\newcommand{\lxmedia} {$(media)$}
|
||
|
\newcommand{\lxcurrency} {$(currency)$}
|
||
|
\newcommand{\kivicompany} {$(employee_company)$}
|
||
|
|
||
|
% settings: Einstellungen, Logo, Briefpapier, Kopfzeile, Fusszeile
|
||
|
|
||
|
% Sprachüberprüfung
|
||
|
\ifthenelse{\equal{\lxlangcode}{EN}}{\input{english.tex}}{
|
||
|
\ifthenelse{\equal{\lxlangcode}{DE}}{\input{deutsch.tex}}{\input{deutsch.tex}}
|
||
|
} % Ende EN
|
||
|
|
||
|
|
||
|
% Mandanten-/Firmenabhängigkeiten
|
||
|
|
||
|
% Pfad zu firmenspez. Angaben
|
||
|
% Hat man mehrere Mandanten muß man statt "Firma1" den Datenbanknamen seines
|
||
|
% Mandanten eingeben.
|
||
|
|
||
|
\IfSubStringInString{Firma1}{\kivicompany}{\newcommand{\identpath}{firma1}}{
|
||
|
\IfSubStringInString{Firma2}{\kivicompany}{\newcommand{\identpath}{firma2}}
|
||
|
{\newcommand{\identpath}{firma}} % sonst
|
||
|
} % Ende Firma1
|
||
|
|
||
|
% Identität
|
||
|
\input{\identpath/ident.tex}
|
||
|
|
||
|
% Währungen/Konten
|
||
|
\IfSubStringInString{USD}{\lxcurrency}{\input{\identpath/usd_account.tex}}{
|
||
|
\IfSubStringInString{CHF}{\lxcurrency}{\input{\identpath/chf_account.tex}}{
|
||
|
\IfSubStringInString{EUR}{\lxcurrency}{\input{\identpath/euro_account.tex}}{\input{\identpath/euro_account.tex}}
|
||
|
} % Ende CHF
|
||
|
} % Ende USD
|
||
|
|
||
|
% Briefkopf, Logo oder Briefpapier
|
||
|
%% \IfSubStringInString{mail}{\lxmedia}{ % nur bei Mail
|
||
|
% Grafik als Briefkopf
|
||
|
%%\setlength{\wpYoffset}{380pt} % Verschiebung von der Mitte nach oben
|
||
|
%%\setlength{\wpYoffset}{130mm} % Verschiebung von der Mitte nach oben
|
||
|
%%\CenterWallPaper{0.885}{\identpath/briefkopf.png} % mit Skalierung
|
||
|
|
||
|
% oder nur ein Logo oben rechts
|
||
|
%% \setlength{\wpXoffset}{180pt} % Verschiebung von der Mitte nach rechts
|
||
|
%% \setlength{\wpYoffset}{380pt} % Verschiebung von der Mitte nach oben
|
||
|
%% \CenterWallPaper{0.1}{\identpath/logo.png} % mit Skalierung
|
||
|
|
||
|
% oder ganzer Briefbogen als Hintergrund
|
||
|
% \CenterWallPaper{1}{\identpath/Briefpapier.pdf}
|
||
|
%% }
|
||
|
|
||
|
|
||
|
% keine Absätze nach rechts einrücken
|
||
|
\setlength\parindent{0pt}
|
||
|
|
||
|
% Papierformat, Ränder, usw.
|
||
|
\geometry{
|
||
|
a4paper, % DINA4
|
||
|
%% left=19mm, % Linker Rand
|
||
|
width=182mm, % Textbreite
|
||
|
top=35mm, % Abstand Textanfang von oben
|
||
|
head=44mm, % Höhe des Kopfes
|
||
|
headsep=4mm, % Abstand Kopf zu Textanfang
|
||
|
bottom=30mm, % Abstand von unten
|
||
|
% showframe, % Rahmen zum Debuggen anzeigen
|
||
|
}
|
||
|
|
||
|
|
||
|
% Befehl f. normale Schriftart und -größe
|
||
|
%\setmainfont{cmunrm.otf}
|
||
|
\newcommand{\ourfont}{\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont}
|
||
|
%\newcommand{\ourfont}{\setmainfont
|
||
|
% [ BoldFont={cmunsx.otf},
|
||
|
% ItalicFont={cmunsi.otf},
|
||
|
% BoldItalicFont={cmunso.otf}]{cmunss.otf}}
|
||
|
|
||
|
% Einstellungen f. Kopf und Fuss
|
||
|
\pagestyle{scrheadings}
|
||
|
\clearscrheadfoot
|
||
|
%\setheadwidth[20mm]{page} % Kopfzeile nach rechts verschieben
|
||
|
%\setfootwidth[-39mm]{page} % Fusszeile verschieben
|
||
|
|
||
|
% Befehl f. laufende Kopfzeile:
|
||
|
% 1. Text f. Kunden- oder Lieferantennummer (oder leer, wenn diese nicht ausgegeben werden soll)
|
||
|
% 2. Kunden- oder Lieferantennummer (oder leer)
|
||
|
% 3. Belegname {oder leer}
|
||
|
% 4. Belegnummer {oder leer}
|
||
|
% 5. Belegdatum {oder leer}
|
||
|
% Beispiel: \ourhead{\kundennummer}{<%customernumber%>}{\angebot}{<%quonumber%>}{<%quodate%>}
|
||
|
\newcommand{\ourhead}[5] {
|
||
|
\chead{
|
||
|
\ifthenelse{\equal{\thepage}{1}}
|
||
|
{}% then
|
||
|
{\normalfont\fontfamily{cmss}\scriptsize
|
||
|
\ifthenelse{\equal{#1}{}}{}{#1: #2 \hspace{0.7cm}}{}
|
||
|
#3
|
||
|
\ifthenelse{\equal{#4}{}}{}{~\nr: #4}
|
||
|
\ifthenelse{\equal{#5}{}}{}{\vom ~ #5}
|
||
|
\hspace{0.7cm} - \seite ~ \thepage/\pageref{LastPage} ~- }
|
||
|
}%ende chead
|
||
|
}
|
||
|
|
||
|
% Firmenfuss
|
||
|
%\cfoot{
|
||
|
% {\normalfont\fontfamily{cmss} \tiny
|
||
|
% \begin{tabular}{p{5cm}p{4.5cm}lr}
|
||
|
% \firma & \email & \textKontonummer & \kontonummer \\
|
||
|
% \strasse & \homepage & \textBank & \bank \\
|
||
|
% \ort & \textUstid\ \ustid & \textIban & \iban \\
|
||
|
% \textTelefon~\telefon & \finanzamt & \textBic & \bic \\
|
||
|
% \ifthenelse{\equal{\fax}{}}{}{\textFax~\fax} & &\textBankleitzahl & \bankleitzahl \\
|
||
|
% \end{tabular}
|
||
|
% }
|
||
|
%}
|
||
|
|
||
|
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} %Linksbündig mit eigener Breite
|
||
|
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % zentriert mit Breitenangabe
|
||
|
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} % rechtsbündig mit Breitenangabe
|
||
|
\begin{document}
|
||
|
\ourfont
|
||
|
$(# Dumper.dump_html(part.assemblies) )$
|
||
|
\large \textbf{Artikeldaten}\hfill \today
|
||
|
\vspace*{0.3cm}
|
||
|
\normalsize
|
||
|
\begin{tabular}{L{5cm}L{12cm}}
|
||
|
Art.Nr.: & $( KiviLatex.filter(part.partnumber) )$ \\
|
||
|
Artikelbeschreibung: & $( KiviLatex.filter(part.description) )$ \\
|
||
|
Langtext: & $( KiviLatex.filter_html(part.notes) )$ \\
|
||
|
Gruppe: & $( KiviLatex.filter(part.partsgroup.partsgroup) )$ \\
|
||
|
Lager - Lagerplatz: & $( KiviLatex.filter(part.warehouse.description) )$ - $( KiviLatex.filter(part.bin.description) )$ \\
|
||
|
Aktuelle Bestandsmenge: & $( KiviLatex.filter(part.onhand_as_number) )$ $( KiviLatex.filter(part.unit) )$\\
|
||
|
Buchungsgruppe: & $( KiviLatex.filter(part.buchungsgruppen.description) )$ \\
|
||
|
%$(IF part.part_type )$
|
||
|
Artikeltyp: & $( KiviLatex.filter(LxERP.t8(part.part_type)) )$ \\
|
||
|
%$(END)$
|
||
|
%$(IF part.classification )$
|
||
|
Artikelklassifizierung: & $( KiviLatex.filter(LxERP.t8(part.classification.description)) )$ \\
|
||
|
%$(END)$
|
||
|
%$(IF part.customm_tariff_number )$
|
||
|
Zolltarifnummer: & $( KiviLatex.filter(LxERP.t8(part.customm_tariff_number)) )$ \\
|
||
|
%$(END)$
|
||
|
%$(IF part.ean )$
|
||
|
EAN: & $( KiviLatex.filter(LxERP.t8(part.ean)) )$ \\
|
||
|
%$(END)$
|
||
|
%$(IF part.microfiche )$
|
||
|
Microfilm: & $( KiviLatex.filter(LxERP.t8(part.microfiche)) )$ \\
|
||
|
%$(END)$
|
||
|
%$(IF part.drawing )$
|
||
|
Zeichnung: & $( KiviLatex.filter(LxERP.t8(part.drawing)) )$ \\
|
||
|
%$(END)$
|
||
|
%$(IF part.weight )$
|
||
|
Gewicht: & $( KiviLatex.filter(LxERP.t8(part.weight)) )$ \\
|
||
|
%$(END)$
|
||
|
\end{tabular}
|
||
|
|
||
|
$(IF KiviLatex.filter(part.image))$
|
||
|
\begin{minipage}{2cm}
|
||
|
% \begin{pspicture}(-5cm,2em)(1.5in,0.5in)
|
||
|
\includegraphics[width=7cm ]{$( part.image )$}
|
||
|
% \end{pspicture}
|
||
|
\end{minipage}
|
||
|
$(END)$
|
||
|
|
||
|
\begin{tabular}{L{6cm}R{2cm}}
|
||
|
\rowcolor{gray}Preisart & Preis \\
|
||
|
Listenpreis: & $( KiviLatex.filter(part.listprice_as_number) )$ € \\
|
||
|
Einkaufspreis: & $( KiviLatex.filter(part.lastcost_as_number) )$ € \\
|
||
|
Verkaufspreis: & $( KiviLatex.filter(part.sellprice_as_number) )$ €\\
|
||
|
%$( IF part.prices.size )$
|
||
|
\rowcolor{gray}\multicolumn{2}{c}{Preisgruppen(nur Verkauf)} \\
|
||
|
%$( FOREACH price = part.prices )$
|
||
|
$( KiviLatex.filter(price.pricegroup.pricegroup) )$ & $( KiviLatex.filter(price.price_as_number) )$ €\\
|
||
|
%$(END)$
|
||
|
%$(END)$
|
||
|
%$( IF prules_sell.size )$
|
||
|
\rowcolor{gray}\multicolumn{2}{c}{Preisregel Verkauf} \\
|
||
|
%$( FOREACH pricerule_s = prules_sell )$
|
||
|
$( KiviLatex.filter(pricerule_s.price_rules.name) )$ & $( KiviLatex.filter(pricerule_s.price_rules.price_as_number) )$ €\\
|
||
|
%$(END)$
|
||
|
%$(END)$
|
||
|
%$( IF prules_buy.size )$
|
||
|
\rowcolor{gray}\multicolumn{2}{c}{Preisregel Einkauf} \\
|
||
|
%$( FOREACH pricerule_b = prules_buy )$
|
||
|
$( KiviLatex.filter(pricerule_b.price_rules.name) )$ & $( KiviLatex.filter(pricerule_b.price_rules.price_as_number) )$ €\\
|
||
|
%$(END)$
|
||
|
%$(END)$
|
||
|
\end{tabular}
|
||
|
|
||
|
%$( IF part.makemodels.size )$
|
||
|
\begin{tabularx}{\textwidth}{L{6cm}L{3cm}XR{2cm}}
|
||
|
\rowcolor{gray}Lieferant & Art.Nr. & Artikelbeschreibung & Preis \\
|
||
|
%$( FOREACH vendor = part.makemodels )$
|
||
|
$( KiviLatex.filter(vendor.maker.name) )$ & $( KiviLatex.filter(vendor.model) )$ & $( KiviLatex.filter(vendor.model_description) )$ & $( KiviLatex.filter(vendor.lastcost_as_number) )$ € \\
|
||
|
%$( END )$
|
||
|
\end{tabularx}
|
||
|
%$(END)$
|
||
|
|
||
|
%$(IF part.is_assembly)$
|
||
|
\textbf{Bestandteile}
|
||
|
|
||
|
%\begin{longtable}{\textwidth}{L{3cm}XR{2cm}}
|
||
|
\setlength\LTleft\parindent % Tabelle beginnt am linken Textrand
|
||
|
\setlength\LTright{0pt} % Tabelle endet am rechten Textrand
|
||
|
\begin{longtable}{@{}p{3cm}p{9.5cm}rp{2cm}@{}}
|
||
|
\rowcolor{gray}Typ - Art.Nr & Artikelbeschreibung & Menge & Lagerplatz \\
|
||
|
%$( FOREACH assembly = part.assemblies )$
|
||
|
$( 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) )$\\
|
||
|
%$( END )$
|
||
|
\end{longtable}
|
||
|
%$( END )$
|
||
|
\end{document}
|
||
| templates/print/RB/part_label.tex | ||
|---|---|---|
|
% config: use-template-toolkit=1
|
||
|
% config: tag-style=$( )$
|
||
|
$( USE KiviLatex )$
|
||
|
$( USE P )$
|
||
|
|
||
|
\documentclass[oneside]{scrartcl}
|
||
|
\usepackage{tabularx}
|
||
|
\usepackage{graphicx}
|
||
|
\usepackage[utf8]{inputenc}
|
||
|
%\setlength{\textwidth}{50cm}
|
||
|
%\usepackage[paperwidth=80mm, paperheight=55mm, margin=3mm]{geometry}
|
||
|
|
||
|
%\setlength{\parindent}{0pt}
|
||
|
|
||
|
\begin{document}
|
||
|
Art.Nr.:~~ $( KiviLatex.filter(part.partnumber) )$ \\[1em]
|
||
|
\end{document}
|
||
| templates/print/marei/part_info.tex | ||
|---|---|---|
|
% config: use-template-toolkit=1
|
||
|
% config: tag-style=$( )$
|
||
|
$( USE KiviLatex )$
|
||
|
$( USE P )$
|
||
|
$( USE Dumper )$
|
||
|
$( USE LxERP )$
|
||
|
\input{inheaders.tex}
|
||
|
\usepackage{graphicx}
|
||
|
|
||
|
$( KiviLatex.required_packages_for_html )$
|
||
|
% Variablen, die in settings verwendet werden
|
||
|
\newcommand{\lxlangcode} {$(template_meta.language.template_code)$}
|
||
|
\newcommand{\lxmedia} {$(media)$}
|
||
|
\newcommand{\lxcurrency} {$(currency)$}
|
||
|
\newcommand{\kivicompany} {$(employee_company)$}
|
||
|
|
||
|
% settings: Einstellungen, Logo, Briefpapier, Kopfzeile, Fusszeile
|
||
|
|
||
|
% Sprachüberprüfung
|
||
|
\ifthenelse{\equal{\lxlangcode}{EN}}{\input{english.tex}}{
|
||
|
\ifthenelse{\equal{\lxlangcode}{DE}}{\input{deutsch.tex}}{\input{deutsch.tex}}
|
||
|
} % Ende EN
|
||
|
|
||
|
|
||
|
% Mandanten-/Firmenabhängigkeiten
|
||
|
|
||
|
% Pfad zu firmenspez. Angaben
|
||
|
% Hat man mehrere Mandanten muß man statt "Firma1" den Datenbanknamen seines
|
||
|
% Mandanten eingeben.
|
||
|
|
||
|
\IfSubStringInString{Firma1}{\kivicompany}{\newcommand{\identpath}{firma1}}{
|
||
|
\IfSubStringInString{Firma2}{\kivicompany}{\newcommand{\identpath}{firma2}}
|
||
|
{\newcommand{\identpath}{firma}} % sonst
|
||
|
} % Ende Firma1
|
||
|
|
||
|
% Identität
|
||
|
\input{\identpath/ident.tex}
|
||
|
|
||
|
% Währungen/Konten
|
||
|
\IfSubStringInString{USD}{\lxcurrency}{\input{\identpath/usd_account.tex}}{
|
||
|
\IfSubStringInString{CHF}{\lxcurrency}{\input{\identpath/chf_account.tex}}{
|
||
|
\IfSubStringInString{EUR}{\lxcurrency}{\input{\identpath/euro_account.tex}}{\input{\identpath/euro_account.tex}}
|
||
|
} % Ende CHF
|
||
|
} % Ende USD
|
||
|
|
||
|
% Briefkopf, Logo oder Briefpapier
|
||
|
%% \IfSubStringInString{mail}{\lxmedia}{ % nur bei Mail
|
||
|
% Grafik als Briefkopf
|
||
|
%%\setlength{\wpYoffset}{380pt} % Verschiebung von der Mitte nach oben
|
||
|
%%\setlength{\wpYoffset}{130mm} % Verschiebung von der Mitte nach oben
|
||
|
%%\CenterWallPaper{0.885}{\identpath/briefkopf.png} % mit Skalierung
|
||
|
|
||
|
% oder nur ein Logo oben rechts
|
||
|
%% \setlength{\wpXoffset}{180pt} % Verschiebung von der Mitte nach rechts
|
||
|
%% \setlength{\wpYoffset}{380pt} % Verschiebung von der Mitte nach oben
|
||
|
%% \CenterWallPaper{0.1}{\identpath/logo.png} % mit Skalierung
|
||
|
|
||
|
% oder ganzer Briefbogen als Hintergrund
|
||
|
% \CenterWallPaper{1}{\identpath/Briefpapier.pdf}
|
||
|
%% }
|
||
|
|
||
|
|
||
|
% keine Absätze nach rechts einrücken
|
||
|
\setlength\parindent{0pt}
|
||
|
|
||
|
% Papierformat, Ränder, usw.
|
||
|
\geometry{
|
||
|
a4paper, % DINA4
|
||
|
%% left=19mm, % Linker Rand
|
||
|
width=182mm, % Textbreite
|
||
|
top=35mm, % Abstand Textanfang von oben
|
||
|
head=44mm, % Höhe des Kopfes
|
||
|
headsep=4mm, % Abstand Kopf zu Textanfang
|
||
|
bottom=30mm, % Abstand von unten
|
||
|
% showframe, % Rahmen zum Debuggen anzeigen
|
||
|
}
|
||
|
|
||
|
|
||
|
% Befehl f. normale Schriftart und -größe
|
||
|
%\setmainfont{cmunrm.otf}
|
||
|
\newcommand{\ourfont}{\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont}
|
||
|
%\newcommand{\ourfont}{\setmainfont
|
||
|
% [ BoldFont={cmunsx.otf},
|
||
|
% ItalicFont={cmunsi.otf},
|
||
|
% BoldItalicFont={cmunso.otf}]{cmunss.otf}}
|
||
|
|
||
|
% Einstellungen f. Kopf und Fuss
|
||
|
\pagestyle{scrheadings}
|
||
|
\clearscrheadfoot
|
||
|
%\setheadwidth[20mm]{page} % Kopfzeile nach rechts verschieben
|
||
|
%\setfootwidth[-39mm]{page} % Fusszeile verschieben
|
||
|
|
||
|
% Befehl f. laufende Kopfzeile:
|
||
|
% 1. Text f. Kunden- oder Lieferantennummer (oder leer, wenn diese nicht ausgegeben werden soll)
|
||
|
% 2. Kunden- oder Lieferantennummer (oder leer)
|
||
|
% 3. Belegname {oder leer}
|
||
|
% 4. Belegnummer {oder leer}
|
||
|
% 5. Belegdatum {oder leer}
|
||
|
% Beispiel: \ourhead{\kundennummer}{<%customernumber%>}{\angebot}{<%quonumber%>}{<%quodate%>}
|
||
|
\newcommand{\ourhead}[5] {
|
||
|
\chead{
|
||
|
\ifthenelse{\equal{\thepage}{1}}
|
||
|
{}% then
|
||
|
{\normalfont\fontfamily{cmss}\scriptsize
|
||
|
\ifthenelse{\equal{#1}{}}{}{#1: #2 \hspace{0.7cm}}{}
|
||
|
#3
|
||
|
\ifthenelse{\equal{#4}{}}{}{~\nr: #4}
|
||
|
\ifthenelse{\equal{#5}{}}{}{\vom ~ #5}
|
||
|
\hspace{0.7cm} - \seite ~ \thepage/\pageref{LastPage} ~- }
|
||
|
}%ende chead
|
||
|
}
|
||
|
|
||
|
% Firmenfuss
|
||
|
%\cfoot{
|
||
|
% {\normalfont\fontfamily{cmss} \tiny
|
||
|
% \begin{tabular}{p{5cm}p{4.5cm}lr}
|
||
|
% \firma & \email & \textKontonummer & \kontonummer \\
|
||
|
% \strasse & \homepage & \textBank & \bank \\
|
||
|
% \ort & \textUstid\ \ustid & \textIban & \iban \\
|
||
|
% \textTelefon~\telefon & \finanzamt & \textBic & \bic \\
|
||
|
% \ifthenelse{\equal{\fax}{}}{}{\textFax~\fax} & &\textBankleitzahl & \bankleitzahl \\
|
||
|
% \end{tabular}
|
||
|
% }
|
||
|
%}
|
||
|
|
||
|
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}} %Linksbündig mit eigener Breite
|
||
|
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}} % zentriert mit Breitenangabe
|
||
|
\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}p{#1}} % rechtsbündig mit Breitenangabe
|
||
|
\begin{document}
|
||
|
\ourfont
|
||
|
$(# Dumper.dump_html(part.assemblies) )$
|
||
|
\large \textbf{Artikeldaten}\hfill \today
|
||
|
\vspace*{0.3cm}
|
||
|
\normalsize
|
||
|
\begin{tabular}{L{5cm}L{12cm}}
|
||
|
Art.Nr.: & $( KiviLatex.filter(part.partnumber) )$ \\
|
||
|
Artikelbeschreibung: & $( KiviLatex.filter(part.description) )$ \\
|
||
|
Langtext: & $( KiviLatex.filter_html(part.notes) )$ \\
|
||
|
Gruppe: & $( KiviLatex.filter(part.partsgroup.partsgroup) )$ \\
|
||
|
Lager - Lagerplatz: & $( KiviLatex.filter(part.warehouse.description) )$ - $( KiviLatex.filter(part.bin.description) )$ \\
|
||
|
Aktuelle Bestandsmenge: & $( KiviLatex.filter(part.onhand_as_number) )$ $( KiviLatex.filter(part.unit) )$\\
|
||
|
Buchungsgruppe: & $( KiviLatex.filter(part.buchungsgruppen.description) )$ \\
|
||
|
%$(IF part.part_type )$
|
||
|
Artikeltyp: & $( KiviLatex.filter(LxERP.t8(part.part_type)) )$ \\
|
||
|
%$(END)$
|
||
|
%$(IF part.classification )$
|
||
|
Artikelklassifizierung: & $( KiviLatex.filter(LxERP.t8(part.classification.description)) )$ \\
|
||
|
%$(END)$
|
||
|
%$(IF part.customm_tariff_number )$
|
||
|
Zolltarifnummer: & $( KiviLatex.filter(LxERP.t8(part.customm_tariff_number)) )$ \\
|
||
|
%$(END)$
|
||
|
%$(IF part.ean )$
|
||
|
EAN: & $( KiviLatex.filter(LxERP.t8(part.ean)) )$ \\
|
||
|
%$(END)$
|
||
|
%$(IF part.microfiche )$
|
||
|
Microfilm: & $( KiviLatex.filter(LxERP.t8(part.microfiche)) )$ \\
|
||
|
%$(END)$
|
||
|
%$(IF part.drawing )$
|
||
|
Zeichnung: & $( KiviLatex.filter(LxERP.t8(part.drawing)) )$ \\
|
||
|
%$(END)$
|
||
|
%$(IF part.weight )$
|
||
|
Gewicht: & $( KiviLatex.filter(LxERP.t8(part.weight)) )$ \\
|
||
|
%$(END)$
|
||
|
\end{tabular}
|
||
|
|
||
|
$(IF KiviLatex.filter(part.image))$
|
||
|
\begin{minipage}{2cm}
|
||
|
% \begin{pspicture}(-5cm,2em)(1.5in,0.5in)
|
||
|
\includegraphics[width=7cm ]{$( part.image )$}
|
||
|
% \end{pspicture}
|
||
|
\end{minipage}
|
||
|
$(END)$
|
||
|
|
||
|
\begin{tabular}{L{6cm}R{2cm}}
|
||
|
\rowcolor{gray}Preisart & Preis \\
|
||
|
Listenpreis: & $( KiviLatex.filter(part.listprice_as_number) )$ € \\
|
||
|
Einkaufspreis: & $( KiviLatex.filter(part.lastcost_as_number) )$ € \\
|
||
|
Verkaufspreis: & $( KiviLatex.filter(part.sellprice_as_number) )$ €\\
|
||
|
%$( IF part.prices.size )$
|
||
|
\rowcolor{gray}\multicolumn{2}{c}{Preisgruppen(nur Verkauf)} \\
|
||
|
%$( FOREACH price = part.prices )$
|
||
|
$( KiviLatex.filter(price.pricegroup.pricegroup) )$ & $( KiviLatex.filter(price.price_as_number) )$ €\\
|
||
|
%$(END)$
|
||
|
%$(END)$
|
||
|
%$( IF prules_sell.size )$
|
||
|
\rowcolor{gray}\multicolumn{2}{c}{Preisregel Verkauf} \\
|
||
|
%$( FOREACH pricerule_s = prules_sell )$
|
||
|
$( KiviLatex.filter(pricerule_s.price_rules.name) )$ & $( KiviLatex.filter(pricerule_s.price_rules.price_as_number) )$ €\\
|
||
|
%$(END)$
|
||
|
%$(END)$
|
||
|
%$( IF prules_buy.size )$
|
||
|
\rowcolor{gray}\multicolumn{2}{c}{Preisregel Einkauf} \\
|
||
|
%$( FOREACH pricerule_b = prules_buy )$
|
||
|
$( KiviLatex.filter(pricerule_b.price_rules.name) )$ & $( KiviLatex.filter(pricerule_b.price_rules.price_as_number) )$ €\\
|
||
|
%$(END)$
|
||
|
%$(END)$
|
||
|
\end{tabular}
|
||
|
|
||
|
%$( IF part.makemodels.size )$
|
||
|
\begin{tabularx}{\textwidth}{L{6cm}L{3cm}XR{2cm}}
|
||
|
\rowcolor{gray}Lieferant & Art.Nr. & Artikelbeschreibung & Preis \\
|
||
|
%$( FOREACH vendor = part.makemodels )$
|
||
|
$( KiviLatex.filter(vendor.maker.name) )$ & $( KiviLatex.filter(vendor.model) )$ & $( KiviLatex.filter(vendor.model_description) )$ & $( KiviLatex.filter(vendor.lastcost_as_number) )$ € \\
|
||
|
%$( END )$
|
||
|
\end{tabularx}
|
||
|
%$(END)$
|
||
|
|
||
|
%$(IF part.is_assembly)$
|
||
|
\textbf{Bestandteile}
|
||
|
|
||
|
%\begin{longtable}{\textwidth}{L{3cm}XR{2cm}}
|
||
|
\setlength\LTleft\parindent % Tabelle beginnt am linken Textrand
|
||
|
\setlength\LTright{0pt} % Tabelle endet am rechten Textrand
|
||
|
\begin{longtable}{@{}p{3cm}p{9.5cm}rp{2cm}@{}}
|
||
|
\rowcolor{gray}Typ - Art.Nr & Artikelbeschreibung & Menge & Lagerplatz \\
|
||
|
%$( FOREACH assembly = part.assemblies )$
|
||
|
$( 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) )$\\
|
||
|
%$( END )$
|
||
|
\end{longtable}
|
||
|
%$( END )$
|
||
|
\end{document}
|
||
| templates/print/marei/part_label.tex | ||
|---|---|---|
|
% config: use-template-toolkit=1
|
||
|
% config: tag-style=$( )$
|
||
|
$( USE KiviLatex )$
|
||
|
$( USE P )$
|
||
|
|
||
|
\documentclass[oneside]{scrartcl}
|
||
|
\usepackage{tabularx}
|
||
|
\usepackage{graphicx}
|
||
|
\usepackage[utf8]{inputenc}
|
||
|
%\setlength{\textwidth}{50cm}
|
||
|
%\usepackage[paperwidth=80mm, paperheight=55mm, margin=3mm]{geometry}
|
||
|
|
||
|
%\setlength{\parindent}{0pt}
|
||
|
|
||
|
\begin{document}
|
||
|
Art.Nr.:~~ $( KiviLatex.filter(part.partnumber) )$ \\[1em]
|
||
|
\end{document}
|
||
| templates/webpages/part/form.html | ||
|---|---|---|
|
|
||
|
[% INCLUDE 'common/flash.html' %]
|
||
|
|
||
|
<div id="print_options" style="display:none">
|
||
|
<form method="post" action="controller.pl" id="print_options_form">
|
||
|
[% SELF.print_options %]
|
||
|
<br>
|
||
|
[% L.button_tag('kivi.Part.save_and_print()', LxERP.t8('Save and print')) %]
|
||
|
<a href="#" onclick="$('#print_options').dialog('close');">[% LxERP.t8("Cancel") %]</a>
|
||
|
</form>
|
||
|
</div>
|
||
|
|
||
|
<form method="post" id="ic" name="ic" action="controller.pl">
|
||
|
|
||
|
[% L.hidden_tag('part.part_type' , SELF.part.part_type) %]
|
||
Auch abrufbar als: Unified diff
part: Druck von Etikett und Information