Add a specific text and variable
i would like to add this text Kundennummer: {customer specific number that I change manually}
Perfect would be right under:
newcommand{invoiceReference}{2019textunderscore01textunderscore14textunderscore1} % Rechnungsnummer (z.B. 20150122-4)
So that the customers number appears in the red rectangle:
documentclass[a4paper]{scrlttr2}
usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
usepackage{graphicx}
usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{color}
usepackage[hidelinks]{hyperref}
usepackage[german]{invoice}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDay {Preis/Tag}% <========================================
newcommand{FeeDay@Title}{% <==========================================
\
noindenttextbf{Activity}&&UnitDay&Count&Amount (BC)\
hline%
}%
newcommand{FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@message{MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@message{MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 2: Start project, print title
%
FeeDay@Title%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 3: Print remuneration item
%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 4: Print subtotal remuneration
%
warning@message{FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@message{ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@message{InvoiceCompletedNoFee}%
%
%
else error@message{InternalError}%
fi%
}%
makeatother
renewcommand{familydefault}{sfdefault}
% include meta data
include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommand{invoiceDate}{today} % Datum der rechnungsstellung, change `today' to a different date, if you do not want to use todays date
newcommand{payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
newcommand{invoiceReference}{2019textunderscore01textunderscore14textunderscore1} % Rechnungsnummer (z.B. 20150122-4)
newcommand{invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
newcommand{invoiceText}{folgende Positionen werden in Rechnung gestellt:} % Rechnungstext
newcommand{invoiceEnclosures}{} % encl{} einfügen
newcommand{invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
newcommand{customerCompany}{Firma XYZ} %ggf. Firma
newcommand{customerName}{Max Mustermann} % Name
newcommand{customerStreet}{Robert-Koch-Str. 12} % Straße
newcommand{customerZIP}{12345} % Postleitzahl
newcommand{customerCity}{Musterstadt} % Ort
% ################## Customer DATA ##################
setkomavar{fromname}{senderName}
setkomavar{fromaddress}{senderStreet \ senderZIP senderCity}
setkomavar{place}{senderCity}
setkomavar{date}{invoiceDate}
setkomavar{fromphone}{senderTelephone}
setkomavar{frommobilephone}{senderMobilephone}
setkomavar{fromemail}{href{mailto:senderEmail}{nolinkurl{senderEmail}}}
setkomavar{subject}{Rechnung}
setkomavar{location}{
\[baselineskip] \[baselineskip]
flushright small {vspace{1cm}Rechnungsnummer:
invoiceReference}
}
setkomavar{firsthead}{hfill
parbox[t][headheight][t]{7.2cm}{
footnotesize
raggedright
flushright
color[gray]{.3}%
begin{tabular}{rl}
Anschrift & usekomavar{fromname}\
& senderStreet\
& senderZIP senderCity \
\
%Telefon Telefon: ` senderTelephone \ %<=================== remove the `%' and go into `_data.tex' and add an phone number
Mobil & usekomavar{frommobilephone} \
E-Mail & usekomavar{fromemail} \
%Webseite & {normalfontttfamily senderWeb } \ %<=================== remove the `%' and go into `_data.tex' and add an URL
\
Steuernummer & taxID \
\
Institut & accountBankName \
IBAN & accountIBAN \
BIC & accountBIC
end{tabular}
}%
}
begin{document}
begin{letter}{customerCompany \ customerName \
customerStreet \ customerZIP customerCity}
opening{invoiceSalutation}
invoiceText
begin{invoice}{Euro}{0}
ProjectTitle{Tagesleistungen} % <====================================== Tagesleistungen
FeeDay{Freelance Arbeit}{300.00}{15}
ProjectTitle{Projekttitel} % <========================================= Stundenleistungen
Fee{Überstunden}{30.00}{2}
%Auslagen % <=================================================Auslagen
%EBC{Hotel, 12 Nächte} {2400.00} % EBCi{Hotel, 12 Nächte} {2400.00}
%STExpenses
% Rabatt
Discount{Rabatt} {0} % <========================================== Rabatt
end{invoice}
ps Bitte überweisen Sie den Rechnungsbetrag auf das unten aufgeführte Konto.
ps Kleinunternehmerregelung: Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer enthalten.
closing{invoiceClosing}
invoiceEnclosures
end{letter}
end{document}
koma-script invoice
add a comment |
i would like to add this text Kundennummer: {customer specific number that I change manually}
Perfect would be right under:
newcommand{invoiceReference}{2019textunderscore01textunderscore14textunderscore1} % Rechnungsnummer (z.B. 20150122-4)
So that the customers number appears in the red rectangle:
documentclass[a4paper]{scrlttr2}
usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
usepackage{graphicx}
usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{color}
usepackage[hidelinks]{hyperref}
usepackage[german]{invoice}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDay {Preis/Tag}% <========================================
newcommand{FeeDay@Title}{% <==========================================
\
noindenttextbf{Activity}&&UnitDay&Count&Amount (BC)\
hline%
}%
newcommand{FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@message{MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@message{MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 2: Start project, print title
%
FeeDay@Title%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 3: Print remuneration item
%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 4: Print subtotal remuneration
%
warning@message{FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@message{ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@message{InvoiceCompletedNoFee}%
%
%
else error@message{InternalError}%
fi%
}%
makeatother
renewcommand{familydefault}{sfdefault}
% include meta data
include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommand{invoiceDate}{today} % Datum der rechnungsstellung, change `today' to a different date, if you do not want to use todays date
newcommand{payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
newcommand{invoiceReference}{2019textunderscore01textunderscore14textunderscore1} % Rechnungsnummer (z.B. 20150122-4)
newcommand{invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
newcommand{invoiceText}{folgende Positionen werden in Rechnung gestellt:} % Rechnungstext
newcommand{invoiceEnclosures}{} % encl{} einfügen
newcommand{invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
newcommand{customerCompany}{Firma XYZ} %ggf. Firma
newcommand{customerName}{Max Mustermann} % Name
newcommand{customerStreet}{Robert-Koch-Str. 12} % Straße
newcommand{customerZIP}{12345} % Postleitzahl
newcommand{customerCity}{Musterstadt} % Ort
% ################## Customer DATA ##################
setkomavar{fromname}{senderName}
setkomavar{fromaddress}{senderStreet \ senderZIP senderCity}
setkomavar{place}{senderCity}
setkomavar{date}{invoiceDate}
setkomavar{fromphone}{senderTelephone}
setkomavar{frommobilephone}{senderMobilephone}
setkomavar{fromemail}{href{mailto:senderEmail}{nolinkurl{senderEmail}}}
setkomavar{subject}{Rechnung}
setkomavar{location}{
\[baselineskip] \[baselineskip]
flushright small {vspace{1cm}Rechnungsnummer:
invoiceReference}
}
setkomavar{firsthead}{hfill
parbox[t][headheight][t]{7.2cm}{
footnotesize
raggedright
flushright
color[gray]{.3}%
begin{tabular}{rl}
Anschrift & usekomavar{fromname}\
& senderStreet\
& senderZIP senderCity \
\
%Telefon Telefon: ` senderTelephone \ %<=================== remove the `%' and go into `_data.tex' and add an phone number
Mobil & usekomavar{frommobilephone} \
E-Mail & usekomavar{fromemail} \
%Webseite & {normalfontttfamily senderWeb } \ %<=================== remove the `%' and go into `_data.tex' and add an URL
\
Steuernummer & taxID \
\
Institut & accountBankName \
IBAN & accountIBAN \
BIC & accountBIC
end{tabular}
}%
}
begin{document}
begin{letter}{customerCompany \ customerName \
customerStreet \ customerZIP customerCity}
opening{invoiceSalutation}
invoiceText
begin{invoice}{Euro}{0}
ProjectTitle{Tagesleistungen} % <====================================== Tagesleistungen
FeeDay{Freelance Arbeit}{300.00}{15}
ProjectTitle{Projekttitel} % <========================================= Stundenleistungen
Fee{Überstunden}{30.00}{2}
%Auslagen % <=================================================Auslagen
%EBC{Hotel, 12 Nächte} {2400.00} % EBCi{Hotel, 12 Nächte} {2400.00}
%STExpenses
% Rabatt
Discount{Rabatt} {0} % <========================================== Rabatt
end{invoice}
ps Bitte überweisen Sie den Rechnungsbetrag auf das unten aufgeführte Konto.
ps Kleinunternehmerregelung: Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer enthalten.
closing{invoiceClosing}
invoiceEnclosures
end{letter}
end{document}
koma-script invoice
Would have been better if every potential answerer didn't have to add the sender's information himself.
– Skillmon
Jan 27 at 18:14
Yeah you are right!
– Lala_Ghost
Jan 27 at 19:08
add a comment |
i would like to add this text Kundennummer: {customer specific number that I change manually}
Perfect would be right under:
newcommand{invoiceReference}{2019textunderscore01textunderscore14textunderscore1} % Rechnungsnummer (z.B. 20150122-4)
So that the customers number appears in the red rectangle:
documentclass[a4paper]{scrlttr2}
usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
usepackage{graphicx}
usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{color}
usepackage[hidelinks]{hyperref}
usepackage[german]{invoice}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDay {Preis/Tag}% <========================================
newcommand{FeeDay@Title}{% <==========================================
\
noindenttextbf{Activity}&&UnitDay&Count&Amount (BC)\
hline%
}%
newcommand{FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@message{MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@message{MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 2: Start project, print title
%
FeeDay@Title%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 3: Print remuneration item
%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 4: Print subtotal remuneration
%
warning@message{FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@message{ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@message{InvoiceCompletedNoFee}%
%
%
else error@message{InternalError}%
fi%
}%
makeatother
renewcommand{familydefault}{sfdefault}
% include meta data
include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommand{invoiceDate}{today} % Datum der rechnungsstellung, change `today' to a different date, if you do not want to use todays date
newcommand{payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
newcommand{invoiceReference}{2019textunderscore01textunderscore14textunderscore1} % Rechnungsnummer (z.B. 20150122-4)
newcommand{invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
newcommand{invoiceText}{folgende Positionen werden in Rechnung gestellt:} % Rechnungstext
newcommand{invoiceEnclosures}{} % encl{} einfügen
newcommand{invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
newcommand{customerCompany}{Firma XYZ} %ggf. Firma
newcommand{customerName}{Max Mustermann} % Name
newcommand{customerStreet}{Robert-Koch-Str. 12} % Straße
newcommand{customerZIP}{12345} % Postleitzahl
newcommand{customerCity}{Musterstadt} % Ort
% ################## Customer DATA ##################
setkomavar{fromname}{senderName}
setkomavar{fromaddress}{senderStreet \ senderZIP senderCity}
setkomavar{place}{senderCity}
setkomavar{date}{invoiceDate}
setkomavar{fromphone}{senderTelephone}
setkomavar{frommobilephone}{senderMobilephone}
setkomavar{fromemail}{href{mailto:senderEmail}{nolinkurl{senderEmail}}}
setkomavar{subject}{Rechnung}
setkomavar{location}{
\[baselineskip] \[baselineskip]
flushright small {vspace{1cm}Rechnungsnummer:
invoiceReference}
}
setkomavar{firsthead}{hfill
parbox[t][headheight][t]{7.2cm}{
footnotesize
raggedright
flushright
color[gray]{.3}%
begin{tabular}{rl}
Anschrift & usekomavar{fromname}\
& senderStreet\
& senderZIP senderCity \
\
%Telefon Telefon: ` senderTelephone \ %<=================== remove the `%' and go into `_data.tex' and add an phone number
Mobil & usekomavar{frommobilephone} \
E-Mail & usekomavar{fromemail} \
%Webseite & {normalfontttfamily senderWeb } \ %<=================== remove the `%' and go into `_data.tex' and add an URL
\
Steuernummer & taxID \
\
Institut & accountBankName \
IBAN & accountIBAN \
BIC & accountBIC
end{tabular}
}%
}
begin{document}
begin{letter}{customerCompany \ customerName \
customerStreet \ customerZIP customerCity}
opening{invoiceSalutation}
invoiceText
begin{invoice}{Euro}{0}
ProjectTitle{Tagesleistungen} % <====================================== Tagesleistungen
FeeDay{Freelance Arbeit}{300.00}{15}
ProjectTitle{Projekttitel} % <========================================= Stundenleistungen
Fee{Überstunden}{30.00}{2}
%Auslagen % <=================================================Auslagen
%EBC{Hotel, 12 Nächte} {2400.00} % EBCi{Hotel, 12 Nächte} {2400.00}
%STExpenses
% Rabatt
Discount{Rabatt} {0} % <========================================== Rabatt
end{invoice}
ps Bitte überweisen Sie den Rechnungsbetrag auf das unten aufgeführte Konto.
ps Kleinunternehmerregelung: Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer enthalten.
closing{invoiceClosing}
invoiceEnclosures
end{letter}
end{document}
koma-script invoice
i would like to add this text Kundennummer: {customer specific number that I change manually}
Perfect would be right under:
newcommand{invoiceReference}{2019textunderscore01textunderscore14textunderscore1} % Rechnungsnummer (z.B. 20150122-4)
So that the customers number appears in the red rectangle:
documentclass[a4paper]{scrlttr2}
usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
usepackage{graphicx}
usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{color}
usepackage[hidelinks]{hyperref}
usepackage[german]{invoice}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDay {Preis/Tag}% <========================================
newcommand{FeeDay@Title}{% <==========================================
\
noindenttextbf{Activity}&&UnitDay&Count&Amount (BC)\
hline%
}%
newcommand{FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@message{MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@message{MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 2: Start project, print title
%
FeeDay@Title%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 3: Print remuneration item
%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 4: Print subtotal remuneration
%
warning@message{FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@message{ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@message{InvoiceCompletedNoFee}%
%
%
else error@message{InternalError}%
fi%
}%
makeatother
renewcommand{familydefault}{sfdefault}
% include meta data
include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommand{invoiceDate}{today} % Datum der rechnungsstellung, change `today' to a different date, if you do not want to use todays date
newcommand{payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
newcommand{invoiceReference}{2019textunderscore01textunderscore14textunderscore1} % Rechnungsnummer (z.B. 20150122-4)
newcommand{invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
newcommand{invoiceText}{folgende Positionen werden in Rechnung gestellt:} % Rechnungstext
newcommand{invoiceEnclosures}{} % encl{} einfügen
newcommand{invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
newcommand{customerCompany}{Firma XYZ} %ggf. Firma
newcommand{customerName}{Max Mustermann} % Name
newcommand{customerStreet}{Robert-Koch-Str. 12} % Straße
newcommand{customerZIP}{12345} % Postleitzahl
newcommand{customerCity}{Musterstadt} % Ort
% ################## Customer DATA ##################
setkomavar{fromname}{senderName}
setkomavar{fromaddress}{senderStreet \ senderZIP senderCity}
setkomavar{place}{senderCity}
setkomavar{date}{invoiceDate}
setkomavar{fromphone}{senderTelephone}
setkomavar{frommobilephone}{senderMobilephone}
setkomavar{fromemail}{href{mailto:senderEmail}{nolinkurl{senderEmail}}}
setkomavar{subject}{Rechnung}
setkomavar{location}{
\[baselineskip] \[baselineskip]
flushright small {vspace{1cm}Rechnungsnummer:
invoiceReference}
}
setkomavar{firsthead}{hfill
parbox[t][headheight][t]{7.2cm}{
footnotesize
raggedright
flushright
color[gray]{.3}%
begin{tabular}{rl}
Anschrift & usekomavar{fromname}\
& senderStreet\
& senderZIP senderCity \
\
%Telefon Telefon: ` senderTelephone \ %<=================== remove the `%' and go into `_data.tex' and add an phone number
Mobil & usekomavar{frommobilephone} \
E-Mail & usekomavar{fromemail} \
%Webseite & {normalfontttfamily senderWeb } \ %<=================== remove the `%' and go into `_data.tex' and add an URL
\
Steuernummer & taxID \
\
Institut & accountBankName \
IBAN & accountIBAN \
BIC & accountBIC
end{tabular}
}%
}
begin{document}
begin{letter}{customerCompany \ customerName \
customerStreet \ customerZIP customerCity}
opening{invoiceSalutation}
invoiceText
begin{invoice}{Euro}{0}
ProjectTitle{Tagesleistungen} % <====================================== Tagesleistungen
FeeDay{Freelance Arbeit}{300.00}{15}
ProjectTitle{Projekttitel} % <========================================= Stundenleistungen
Fee{Überstunden}{30.00}{2}
%Auslagen % <=================================================Auslagen
%EBC{Hotel, 12 Nächte} {2400.00} % EBCi{Hotel, 12 Nächte} {2400.00}
%STExpenses
% Rabatt
Discount{Rabatt} {0} % <========================================== Rabatt
end{invoice}
ps Bitte überweisen Sie den Rechnungsbetrag auf das unten aufgeführte Konto.
ps Kleinunternehmerregelung: Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer enthalten.
closing{invoiceClosing}
invoiceEnclosures
end{letter}
end{document}
koma-script invoice
koma-script invoice
edited Jan 27 at 19:51


Kurt
39.9k850164
39.9k850164
asked Jan 27 at 18:03
Lala_GhostLala_Ghost
764
764
Would have been better if every potential answerer didn't have to add the sender's information himself.
– Skillmon
Jan 27 at 18:14
Yeah you are right!
– Lala_Ghost
Jan 27 at 19:08
add a comment |
Would have been better if every potential answerer didn't have to add the sender's information himself.
– Skillmon
Jan 27 at 18:14
Yeah you are right!
– Lala_Ghost
Jan 27 at 19:08
Would have been better if every potential answerer didn't have to add the sender's information himself.
– Skillmon
Jan 27 at 18:14
Would have been better if every potential answerer didn't have to add the sender's information himself.
– Skillmon
Jan 27 at 18:14
Yeah you are right!
– Lala_Ghost
Jan 27 at 19:08
Yeah you are right!
– Lala_Ghost
Jan 27 at 19:08
add a comment |
2 Answers
2
active
oldest
votes
The trick here is to change the content of command location
to
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall Rechnungsnummer: invoiceReference\[1pt]
Kundennummer: customerNumber
}
I added the line Kundennummer: customerNumber
which means you have to add a new command customerNumber
to the datas for your customer(s). It is better to use a command that writing it each time you write an invoice new. It gives you less errors.
But now you have to define this command like:
newcommand{customerNumber}{1234567} % Kundennummer
Best solution would be to define two new commands like
definvoicenr{Rechnungsnummer:}%
defcustomernr{Kundennummer:}%
to make your invoice more language independent (off course you need then to define this words for the other languages too). Then you can use
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr invoiceReference\[1pt]
customernr customerNumber
}
To avoid the splitting of Rechnungsnummer: and current number you can use shorter Names like
definvoicenr{Rechnungsnr.:}%
defcustomernr{Kundennr.:}%
With the complete code (based on your last question with the described changings above)
documentclass[a4paper]{scrlttr2}
usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
usepackage{graphicx}
usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{color}
usepackage[hidelinks]{hyperref}
usepackage[german]{invoice}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDay {Preis/Tag}% <========================================
newcommand{FeeDay@Title}{% <==========================================
\
noindenttextbf{Activity}&&UnitDay&Count&Amount (BC)\
hline%
}%
newcommand{FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@message{MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@message{MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 2: Start project, print title
%
FeeDay@Title%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 3: Print remuneration item
%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 4: Print subtotal remuneration
%
warning@message{FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@message{ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@message{InvoiceCompletedNoFee}%
%
%
else error@message{InternalError}%
fi%
}%
makeatother
renewcommand{familydefault}{sfdefault}
% include meta data
include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommand{invoiceDate}{DD.MM.YYYY} % Datum der rechnungsstellung
newcommand{payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
newcommand{invoiceReference}{20150122-4} % Rechnungsnummer (z.B. 20150122-4) YYYYMMDD-1
newcommand{invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
newcommand{invoiceText}{Für die von mir erbrachte Leistung erhalten sie
hiermit die Rechnung. Bitte zahlen Sie den unten aufgeführten Gesamtbetrag
unter Angabe der Rechnungsnummer (invoiceReference) bis
zum payDate auf das angegebene Konto ein.} % Rechnungstext
newcommand{invoiceEnclosures}{} % encl{} einfügen
newcommand{invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
newcommand{customerCompany}{Firma XYZ} %ggf. Firma
newcommand{customerName}{Max Mustermann} % Name
newcommand{customerStreet}{Robert-Koch-Str. 12} % Straße
newcommand{customerZIP}{12345} % Postleitzahl
newcommand{customerCity}{Musterstadt} % Ort
newcommand{customerNumber}{1234567} % Kundennummer <==================
% ################## Customer DATA ##################
setkomavar{fromname}{senderName}
setkomavar{fromaddress}{senderStreet \ senderZIP senderCity}
setkomavar{place}{senderCity}
setkomavar{date}{invoiceDate}
setkomavar{fromphone}{senderTelephone}
setkomavar{frommobilephone}{senderMobilephone}
setkomavar{fromemail}{href{mailto:senderEmail}{nolinkurl{senderEmail}}}
setkomavar{subject}{Rechnung}
definvoicenr{Rechnungsnr.:}% <========================================
defcustomernr{Kundennr.:}%
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr invoiceReference\[1pt] % <=========
customernr customerNumber
}
setkomavar{firsthead}{hfill
parbox[t][headheight][t]{7cm}{%
footnotesize
raggedright
flushright
color[gray]{.3}%
begin{tabular}{rl}
Anschrift & usekomavar{fromname}\
& senderStreet\
& senderZIP senderCity \
\
%Telefon Telefon: ` senderTelephone \
Mobil & usekomavar{frommobilephone} \
E-Mail & usekomavar{fromemail} \
Webseite & {normalfontttfamily senderWeb } \
\
Steuernummer & taxID \
\
Institut & accountBankName \
IBAN & accountIBAN \
BIC & accountBIC
end{tabular}
}%
}
begin{document}
begin{letter}{customerCompany \ customerName \
customerStreet \ customerZIP customerCity}
includegraphics[width=0.15textwidth]{logo.png}
opening{invoiceSalutation}
invoiceText
begin{invoice}{Euro}{0}
ProjectTitle{Projekttitel} %
Fee{Musterdienstleistung 1}{30.00}{4}
Fee{Musterdienstleistung 2}{36.00}{7}
ProjectTitle{Tagesleistungen} %
FeeDay{Musterdienstleistung 3}{360.00}{3}
% Auslagen
%EBC{Hotel, 12 Nächte} {2400.00} % EBCi{Hotel, 12 Nächte} {2400.00}
%STExpenses
% Rabatt
Discount{Rabatt} {20} %
end{invoice}
ps Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
enthalten.
closing{invoiceClosing}
invoiceEnclosures
end{letter}
end{document}
you get the result:
If you want Kundennummer and rechnungsnummer and the relevant numbers to be one below the other simply change location
to
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr\[1pt] invoiceReference\[1pt] % <=========
customernr\[1pt] customerNumber
}
with the result:
Please see that you can use
newcommand{invoiceReference}{2019_01_14_01}
to generate an invoice reference number 2019_01_14_01
but I would not recommend that. Better use 2019-01-14-01
...
1
scrlttr2
already has a variablecustomer
. It also has a variableinvoice
and several other variable, that could be used.
– Schweinebacke
Jan 27 at 19:57
@Schweinebacke yes, you are right, but that invoice is based on styleinvoice
, so I decided to use at last the allready existing definition files there. I think it is better here ...
– Kurt
Jan 27 at 20:01
1
The customer number and the invoice number (and several other elements) here are part of the letter layout (used in KOMA-Script variables likelocation
orfirsthead
). So all these things are not related to packageinvoice
butscrlttr2
. BTW: With packagescrletter
variables can even be used with every other class.
– Schweinebacke
Jan 28 at 6:32
add a comment |
You could just use a tabular
environment with two lines for the reference:
documentclass[a4paper]{scrlttr2}
usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
usepackage{graphicx}
usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{color}
usepackage[hidelinks]{hyperref}
usepackage[german]{invoice}
newcommandsenderName{Foo Bar}
newcommandsenderStreet{Foo Street}
newcommandsenderZIP{12345}
newcommandsenderCity{Bar City}
newcommandsenderMobilephone{0123 3456789}
newcommandsenderEmail{foo@bar.de}
newcommandtaxID{4654TE132E}
newcommandaccountBankName{MyBank}
newcommandaccountIBAN{DE12 3456 7890 1234 5678 90}
newcommandaccountBIC{ABCDEFG0HIJ}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDay {Preis/Tag}% <========================================
newcommand{FeeDay@Title}{% <==========================================
\
noindenttextbf{Activity}&&UnitDay&Count&Amount (BC)\
hline%
}%
newcommand{FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@message{MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@message{MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 2: Start project, print title
%
FeeDay@Title%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 3: Print remuneration item
%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 4: Print subtotal remuneration
%
warning@message{FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@message{ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@message{InvoiceCompletedNoFee}%
%
%
else error@message{InternalError}%
fi%
}%
makeatother
renewcommand{familydefault}{sfdefault}
% include meta data
include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommand{invoiceDate}{today} % Datum der rechnungsstellung, change `today' to a different date, if you do not want to use todays date
newcommand{payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
newcommand{invoiceReference}
{%
begin{tabular}{@{}r@{}}
2019textunderscore01textunderscore14textunderscore1\
MyCustomer123%
end{tabular}%
} % Rechnungsnummer (z.B. 20150122-4)
newcommand{invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
newcommand{invoiceText}{folgende Positionen werden in Rechnung gestellt:} % Rechnungstext
newcommand{invoiceEnclosures}{} % encl{} einfügen
newcommand{invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
newcommand{customerCompany}{Firma XYZ} %ggf. Firma
newcommand{customerName}{Max Mustermann} % Name
newcommand{customerStreet}{Robert-Koch-Str. 12} % Straße
newcommand{customerZIP}{12345} % Postleitzahl
newcommand{customerCity}{Musterstadt} % Ort
% ################## Customer DATA ##################
setkomavar{fromname}{senderName}
setkomavar{fromaddress}{senderStreet \ senderZIP senderCity}
setkomavar{place}{senderCity}
setkomavar{date}{invoiceDate}
setkomavar{fromphone}{senderTelephone}
setkomavar{frommobilephone}{senderMobilephone}
setkomavar{fromemail}{href{mailto:senderEmail}{nolinkurl{senderEmail}}}
setkomavar{subject}{Rechnung}
setkomavar{location}{
\[baselineskip] \[baselineskip]
flushright small {vspace{1cm}Rechnungsnummer:
invoiceReference}
}
setkomavar{firsthead}{hfill
parbox[t][headheight][t]{7.2cm}{
footnotesize
raggedright
flushright
color[gray]{.3}%
begin{tabular}{rl}
Anschrift & usekomavar{fromname}\
& senderStreet\
& senderZIP senderCity \
\
%Telefon Telefon: ` senderTelephone \ %<=================== remove the `%' and go into `_data.tex' and add an phone number
Mobil & usekomavar{frommobilephone} \
E-Mail & usekomavar{fromemail} \
%Webseite & {normalfontttfamily senderWeb } \ %<=================== remove the `%' and go into `_data.tex' and add an URL
\
Steuernummer & taxID \
\
Institut & accountBankName \
IBAN & accountIBAN \
BIC & accountBIC
end{tabular}
}%
}
begin{document}
begin{letter}{customerCompany \ customerName \
customerStreet \ customerZIP customerCity}
opening{invoiceSalutation}
invoiceText
begin{invoice}{Euro}{0}
ProjectTitle{Tagesleistungen} % <====================================== Tagesleistungen
FeeDay{Freelance Arbeit}{300.00}{15}
ProjectTitle{Projekttitel} % <========================================= Stundenleistungen
Fee{Überstunden}{30.00}{2}
%Auslagen % <=================================================Auslagen
%EBC{Hotel, 12 Nächte} {2400.00} % EBCi{Hotel, 12 Nächte} {2400.00}
%STExpenses
% Rabatt
Discount{Rabatt} {0} % <========================================== Rabatt
end{invoice}
ps Bitte überweisen Sie den Rechnungsbetrag auf das unten aufgeführte Konto.
ps Kleinunternehmerregelung: Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer enthalten.
closing{invoiceClosing}
invoiceEnclosures
end{letter}
end{document}
but now I have the whole thing in one line "Kundennummer: 1001" But I would like to have the "1001" in the next line...
– Lala_Ghost
Jan 27 at 19:14
@Lala_Ghost then add another line to thetabular
environment.
– Skillmon
Jan 28 at 10:16
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f472129%2fadd-a-specific-text-and-variable%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The trick here is to change the content of command location
to
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall Rechnungsnummer: invoiceReference\[1pt]
Kundennummer: customerNumber
}
I added the line Kundennummer: customerNumber
which means you have to add a new command customerNumber
to the datas for your customer(s). It is better to use a command that writing it each time you write an invoice new. It gives you less errors.
But now you have to define this command like:
newcommand{customerNumber}{1234567} % Kundennummer
Best solution would be to define two new commands like
definvoicenr{Rechnungsnummer:}%
defcustomernr{Kundennummer:}%
to make your invoice more language independent (off course you need then to define this words for the other languages too). Then you can use
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr invoiceReference\[1pt]
customernr customerNumber
}
To avoid the splitting of Rechnungsnummer: and current number you can use shorter Names like
definvoicenr{Rechnungsnr.:}%
defcustomernr{Kundennr.:}%
With the complete code (based on your last question with the described changings above)
documentclass[a4paper]{scrlttr2}
usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
usepackage{graphicx}
usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{color}
usepackage[hidelinks]{hyperref}
usepackage[german]{invoice}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDay {Preis/Tag}% <========================================
newcommand{FeeDay@Title}{% <==========================================
\
noindenttextbf{Activity}&&UnitDay&Count&Amount (BC)\
hline%
}%
newcommand{FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@message{MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@message{MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 2: Start project, print title
%
FeeDay@Title%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 3: Print remuneration item
%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 4: Print subtotal remuneration
%
warning@message{FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@message{ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@message{InvoiceCompletedNoFee}%
%
%
else error@message{InternalError}%
fi%
}%
makeatother
renewcommand{familydefault}{sfdefault}
% include meta data
include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommand{invoiceDate}{DD.MM.YYYY} % Datum der rechnungsstellung
newcommand{payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
newcommand{invoiceReference}{20150122-4} % Rechnungsnummer (z.B. 20150122-4) YYYYMMDD-1
newcommand{invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
newcommand{invoiceText}{Für die von mir erbrachte Leistung erhalten sie
hiermit die Rechnung. Bitte zahlen Sie den unten aufgeführten Gesamtbetrag
unter Angabe der Rechnungsnummer (invoiceReference) bis
zum payDate auf das angegebene Konto ein.} % Rechnungstext
newcommand{invoiceEnclosures}{} % encl{} einfügen
newcommand{invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
newcommand{customerCompany}{Firma XYZ} %ggf. Firma
newcommand{customerName}{Max Mustermann} % Name
newcommand{customerStreet}{Robert-Koch-Str. 12} % Straße
newcommand{customerZIP}{12345} % Postleitzahl
newcommand{customerCity}{Musterstadt} % Ort
newcommand{customerNumber}{1234567} % Kundennummer <==================
% ################## Customer DATA ##################
setkomavar{fromname}{senderName}
setkomavar{fromaddress}{senderStreet \ senderZIP senderCity}
setkomavar{place}{senderCity}
setkomavar{date}{invoiceDate}
setkomavar{fromphone}{senderTelephone}
setkomavar{frommobilephone}{senderMobilephone}
setkomavar{fromemail}{href{mailto:senderEmail}{nolinkurl{senderEmail}}}
setkomavar{subject}{Rechnung}
definvoicenr{Rechnungsnr.:}% <========================================
defcustomernr{Kundennr.:}%
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr invoiceReference\[1pt] % <=========
customernr customerNumber
}
setkomavar{firsthead}{hfill
parbox[t][headheight][t]{7cm}{%
footnotesize
raggedright
flushright
color[gray]{.3}%
begin{tabular}{rl}
Anschrift & usekomavar{fromname}\
& senderStreet\
& senderZIP senderCity \
\
%Telefon Telefon: ` senderTelephone \
Mobil & usekomavar{frommobilephone} \
E-Mail & usekomavar{fromemail} \
Webseite & {normalfontttfamily senderWeb } \
\
Steuernummer & taxID \
\
Institut & accountBankName \
IBAN & accountIBAN \
BIC & accountBIC
end{tabular}
}%
}
begin{document}
begin{letter}{customerCompany \ customerName \
customerStreet \ customerZIP customerCity}
includegraphics[width=0.15textwidth]{logo.png}
opening{invoiceSalutation}
invoiceText
begin{invoice}{Euro}{0}
ProjectTitle{Projekttitel} %
Fee{Musterdienstleistung 1}{30.00}{4}
Fee{Musterdienstleistung 2}{36.00}{7}
ProjectTitle{Tagesleistungen} %
FeeDay{Musterdienstleistung 3}{360.00}{3}
% Auslagen
%EBC{Hotel, 12 Nächte} {2400.00} % EBCi{Hotel, 12 Nächte} {2400.00}
%STExpenses
% Rabatt
Discount{Rabatt} {20} %
end{invoice}
ps Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
enthalten.
closing{invoiceClosing}
invoiceEnclosures
end{letter}
end{document}
you get the result:
If you want Kundennummer and rechnungsnummer and the relevant numbers to be one below the other simply change location
to
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr\[1pt] invoiceReference\[1pt] % <=========
customernr\[1pt] customerNumber
}
with the result:
Please see that you can use
newcommand{invoiceReference}{2019_01_14_01}
to generate an invoice reference number 2019_01_14_01
but I would not recommend that. Better use 2019-01-14-01
...
1
scrlttr2
already has a variablecustomer
. It also has a variableinvoice
and several other variable, that could be used.
– Schweinebacke
Jan 27 at 19:57
@Schweinebacke yes, you are right, but that invoice is based on styleinvoice
, so I decided to use at last the allready existing definition files there. I think it is better here ...
– Kurt
Jan 27 at 20:01
1
The customer number and the invoice number (and several other elements) here are part of the letter layout (used in KOMA-Script variables likelocation
orfirsthead
). So all these things are not related to packageinvoice
butscrlttr2
. BTW: With packagescrletter
variables can even be used with every other class.
– Schweinebacke
Jan 28 at 6:32
add a comment |
The trick here is to change the content of command location
to
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall Rechnungsnummer: invoiceReference\[1pt]
Kundennummer: customerNumber
}
I added the line Kundennummer: customerNumber
which means you have to add a new command customerNumber
to the datas for your customer(s). It is better to use a command that writing it each time you write an invoice new. It gives you less errors.
But now you have to define this command like:
newcommand{customerNumber}{1234567} % Kundennummer
Best solution would be to define two new commands like
definvoicenr{Rechnungsnummer:}%
defcustomernr{Kundennummer:}%
to make your invoice more language independent (off course you need then to define this words for the other languages too). Then you can use
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr invoiceReference\[1pt]
customernr customerNumber
}
To avoid the splitting of Rechnungsnummer: and current number you can use shorter Names like
definvoicenr{Rechnungsnr.:}%
defcustomernr{Kundennr.:}%
With the complete code (based on your last question with the described changings above)
documentclass[a4paper]{scrlttr2}
usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
usepackage{graphicx}
usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{color}
usepackage[hidelinks]{hyperref}
usepackage[german]{invoice}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDay {Preis/Tag}% <========================================
newcommand{FeeDay@Title}{% <==========================================
\
noindenttextbf{Activity}&&UnitDay&Count&Amount (BC)\
hline%
}%
newcommand{FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@message{MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@message{MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 2: Start project, print title
%
FeeDay@Title%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 3: Print remuneration item
%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 4: Print subtotal remuneration
%
warning@message{FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@message{ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@message{InvoiceCompletedNoFee}%
%
%
else error@message{InternalError}%
fi%
}%
makeatother
renewcommand{familydefault}{sfdefault}
% include meta data
include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommand{invoiceDate}{DD.MM.YYYY} % Datum der rechnungsstellung
newcommand{payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
newcommand{invoiceReference}{20150122-4} % Rechnungsnummer (z.B. 20150122-4) YYYYMMDD-1
newcommand{invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
newcommand{invoiceText}{Für die von mir erbrachte Leistung erhalten sie
hiermit die Rechnung. Bitte zahlen Sie den unten aufgeführten Gesamtbetrag
unter Angabe der Rechnungsnummer (invoiceReference) bis
zum payDate auf das angegebene Konto ein.} % Rechnungstext
newcommand{invoiceEnclosures}{} % encl{} einfügen
newcommand{invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
newcommand{customerCompany}{Firma XYZ} %ggf. Firma
newcommand{customerName}{Max Mustermann} % Name
newcommand{customerStreet}{Robert-Koch-Str. 12} % Straße
newcommand{customerZIP}{12345} % Postleitzahl
newcommand{customerCity}{Musterstadt} % Ort
newcommand{customerNumber}{1234567} % Kundennummer <==================
% ################## Customer DATA ##################
setkomavar{fromname}{senderName}
setkomavar{fromaddress}{senderStreet \ senderZIP senderCity}
setkomavar{place}{senderCity}
setkomavar{date}{invoiceDate}
setkomavar{fromphone}{senderTelephone}
setkomavar{frommobilephone}{senderMobilephone}
setkomavar{fromemail}{href{mailto:senderEmail}{nolinkurl{senderEmail}}}
setkomavar{subject}{Rechnung}
definvoicenr{Rechnungsnr.:}% <========================================
defcustomernr{Kundennr.:}%
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr invoiceReference\[1pt] % <=========
customernr customerNumber
}
setkomavar{firsthead}{hfill
parbox[t][headheight][t]{7cm}{%
footnotesize
raggedright
flushright
color[gray]{.3}%
begin{tabular}{rl}
Anschrift & usekomavar{fromname}\
& senderStreet\
& senderZIP senderCity \
\
%Telefon Telefon: ` senderTelephone \
Mobil & usekomavar{frommobilephone} \
E-Mail & usekomavar{fromemail} \
Webseite & {normalfontttfamily senderWeb } \
\
Steuernummer & taxID \
\
Institut & accountBankName \
IBAN & accountIBAN \
BIC & accountBIC
end{tabular}
}%
}
begin{document}
begin{letter}{customerCompany \ customerName \
customerStreet \ customerZIP customerCity}
includegraphics[width=0.15textwidth]{logo.png}
opening{invoiceSalutation}
invoiceText
begin{invoice}{Euro}{0}
ProjectTitle{Projekttitel} %
Fee{Musterdienstleistung 1}{30.00}{4}
Fee{Musterdienstleistung 2}{36.00}{7}
ProjectTitle{Tagesleistungen} %
FeeDay{Musterdienstleistung 3}{360.00}{3}
% Auslagen
%EBC{Hotel, 12 Nächte} {2400.00} % EBCi{Hotel, 12 Nächte} {2400.00}
%STExpenses
% Rabatt
Discount{Rabatt} {20} %
end{invoice}
ps Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
enthalten.
closing{invoiceClosing}
invoiceEnclosures
end{letter}
end{document}
you get the result:
If you want Kundennummer and rechnungsnummer and the relevant numbers to be one below the other simply change location
to
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr\[1pt] invoiceReference\[1pt] % <=========
customernr\[1pt] customerNumber
}
with the result:
Please see that you can use
newcommand{invoiceReference}{2019_01_14_01}
to generate an invoice reference number 2019_01_14_01
but I would not recommend that. Better use 2019-01-14-01
...
1
scrlttr2
already has a variablecustomer
. It also has a variableinvoice
and several other variable, that could be used.
– Schweinebacke
Jan 27 at 19:57
@Schweinebacke yes, you are right, but that invoice is based on styleinvoice
, so I decided to use at last the allready existing definition files there. I think it is better here ...
– Kurt
Jan 27 at 20:01
1
The customer number and the invoice number (and several other elements) here are part of the letter layout (used in KOMA-Script variables likelocation
orfirsthead
). So all these things are not related to packageinvoice
butscrlttr2
. BTW: With packagescrletter
variables can even be used with every other class.
– Schweinebacke
Jan 28 at 6:32
add a comment |
The trick here is to change the content of command location
to
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall Rechnungsnummer: invoiceReference\[1pt]
Kundennummer: customerNumber
}
I added the line Kundennummer: customerNumber
which means you have to add a new command customerNumber
to the datas for your customer(s). It is better to use a command that writing it each time you write an invoice new. It gives you less errors.
But now you have to define this command like:
newcommand{customerNumber}{1234567} % Kundennummer
Best solution would be to define two new commands like
definvoicenr{Rechnungsnummer:}%
defcustomernr{Kundennummer:}%
to make your invoice more language independent (off course you need then to define this words for the other languages too). Then you can use
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr invoiceReference\[1pt]
customernr customerNumber
}
To avoid the splitting of Rechnungsnummer: and current number you can use shorter Names like
definvoicenr{Rechnungsnr.:}%
defcustomernr{Kundennr.:}%
With the complete code (based on your last question with the described changings above)
documentclass[a4paper]{scrlttr2}
usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
usepackage{graphicx}
usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{color}
usepackage[hidelinks]{hyperref}
usepackage[german]{invoice}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDay {Preis/Tag}% <========================================
newcommand{FeeDay@Title}{% <==========================================
\
noindenttextbf{Activity}&&UnitDay&Count&Amount (BC)\
hline%
}%
newcommand{FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@message{MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@message{MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 2: Start project, print title
%
FeeDay@Title%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 3: Print remuneration item
%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 4: Print subtotal remuneration
%
warning@message{FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@message{ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@message{InvoiceCompletedNoFee}%
%
%
else error@message{InternalError}%
fi%
}%
makeatother
renewcommand{familydefault}{sfdefault}
% include meta data
include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommand{invoiceDate}{DD.MM.YYYY} % Datum der rechnungsstellung
newcommand{payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
newcommand{invoiceReference}{20150122-4} % Rechnungsnummer (z.B. 20150122-4) YYYYMMDD-1
newcommand{invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
newcommand{invoiceText}{Für die von mir erbrachte Leistung erhalten sie
hiermit die Rechnung. Bitte zahlen Sie den unten aufgeführten Gesamtbetrag
unter Angabe der Rechnungsnummer (invoiceReference) bis
zum payDate auf das angegebene Konto ein.} % Rechnungstext
newcommand{invoiceEnclosures}{} % encl{} einfügen
newcommand{invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
newcommand{customerCompany}{Firma XYZ} %ggf. Firma
newcommand{customerName}{Max Mustermann} % Name
newcommand{customerStreet}{Robert-Koch-Str. 12} % Straße
newcommand{customerZIP}{12345} % Postleitzahl
newcommand{customerCity}{Musterstadt} % Ort
newcommand{customerNumber}{1234567} % Kundennummer <==================
% ################## Customer DATA ##################
setkomavar{fromname}{senderName}
setkomavar{fromaddress}{senderStreet \ senderZIP senderCity}
setkomavar{place}{senderCity}
setkomavar{date}{invoiceDate}
setkomavar{fromphone}{senderTelephone}
setkomavar{frommobilephone}{senderMobilephone}
setkomavar{fromemail}{href{mailto:senderEmail}{nolinkurl{senderEmail}}}
setkomavar{subject}{Rechnung}
definvoicenr{Rechnungsnr.:}% <========================================
defcustomernr{Kundennr.:}%
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr invoiceReference\[1pt] % <=========
customernr customerNumber
}
setkomavar{firsthead}{hfill
parbox[t][headheight][t]{7cm}{%
footnotesize
raggedright
flushright
color[gray]{.3}%
begin{tabular}{rl}
Anschrift & usekomavar{fromname}\
& senderStreet\
& senderZIP senderCity \
\
%Telefon Telefon: ` senderTelephone \
Mobil & usekomavar{frommobilephone} \
E-Mail & usekomavar{fromemail} \
Webseite & {normalfontttfamily senderWeb } \
\
Steuernummer & taxID \
\
Institut & accountBankName \
IBAN & accountIBAN \
BIC & accountBIC
end{tabular}
}%
}
begin{document}
begin{letter}{customerCompany \ customerName \
customerStreet \ customerZIP customerCity}
includegraphics[width=0.15textwidth]{logo.png}
opening{invoiceSalutation}
invoiceText
begin{invoice}{Euro}{0}
ProjectTitle{Projekttitel} %
Fee{Musterdienstleistung 1}{30.00}{4}
Fee{Musterdienstleistung 2}{36.00}{7}
ProjectTitle{Tagesleistungen} %
FeeDay{Musterdienstleistung 3}{360.00}{3}
% Auslagen
%EBC{Hotel, 12 Nächte} {2400.00} % EBCi{Hotel, 12 Nächte} {2400.00}
%STExpenses
% Rabatt
Discount{Rabatt} {20} %
end{invoice}
ps Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
enthalten.
closing{invoiceClosing}
invoiceEnclosures
end{letter}
end{document}
you get the result:
If you want Kundennummer and rechnungsnummer and the relevant numbers to be one below the other simply change location
to
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr\[1pt] invoiceReference\[1pt] % <=========
customernr\[1pt] customerNumber
}
with the result:
Please see that you can use
newcommand{invoiceReference}{2019_01_14_01}
to generate an invoice reference number 2019_01_14_01
but I would not recommend that. Better use 2019-01-14-01
...
The trick here is to change the content of command location
to
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall Rechnungsnummer: invoiceReference\[1pt]
Kundennummer: customerNumber
}
I added the line Kundennummer: customerNumber
which means you have to add a new command customerNumber
to the datas for your customer(s). It is better to use a command that writing it each time you write an invoice new. It gives you less errors.
But now you have to define this command like:
newcommand{customerNumber}{1234567} % Kundennummer
Best solution would be to define two new commands like
definvoicenr{Rechnungsnummer:}%
defcustomernr{Kundennummer:}%
to make your invoice more language independent (off course you need then to define this words for the other languages too). Then you can use
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr invoiceReference\[1pt]
customernr customerNumber
}
To avoid the splitting of Rechnungsnummer: and current number you can use shorter Names like
definvoicenr{Rechnungsnr.:}%
defcustomernr{Kundennr.:}%
With the complete code (based on your last question with the described changings above)
documentclass[a4paper]{scrlttr2}
usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
usepackage{graphicx}
usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{color}
usepackage[hidelinks]{hyperref}
usepackage[german]{invoice}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDay {Preis/Tag}% <========================================
newcommand{FeeDay@Title}{% <==========================================
\
noindenttextbf{Activity}&&UnitDay&Count&Amount (BC)\
hline%
}%
newcommand{FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@message{MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@message{MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 2: Start project, print title
%
FeeDay@Title%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 3: Print remuneration item
%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 4: Print subtotal remuneration
%
warning@message{FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@message{ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@message{InvoiceCompletedNoFee}%
%
%
else error@message{InternalError}%
fi%
}%
makeatother
renewcommand{familydefault}{sfdefault}
% include meta data
include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommand{invoiceDate}{DD.MM.YYYY} % Datum der rechnungsstellung
newcommand{payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
newcommand{invoiceReference}{20150122-4} % Rechnungsnummer (z.B. 20150122-4) YYYYMMDD-1
newcommand{invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
newcommand{invoiceText}{Für die von mir erbrachte Leistung erhalten sie
hiermit die Rechnung. Bitte zahlen Sie den unten aufgeführten Gesamtbetrag
unter Angabe der Rechnungsnummer (invoiceReference) bis
zum payDate auf das angegebene Konto ein.} % Rechnungstext
newcommand{invoiceEnclosures}{} % encl{} einfügen
newcommand{invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
newcommand{customerCompany}{Firma XYZ} %ggf. Firma
newcommand{customerName}{Max Mustermann} % Name
newcommand{customerStreet}{Robert-Koch-Str. 12} % Straße
newcommand{customerZIP}{12345} % Postleitzahl
newcommand{customerCity}{Musterstadt} % Ort
newcommand{customerNumber}{1234567} % Kundennummer <==================
% ################## Customer DATA ##################
setkomavar{fromname}{senderName}
setkomavar{fromaddress}{senderStreet \ senderZIP senderCity}
setkomavar{place}{senderCity}
setkomavar{date}{invoiceDate}
setkomavar{fromphone}{senderTelephone}
setkomavar{frommobilephone}{senderMobilephone}
setkomavar{fromemail}{href{mailto:senderEmail}{nolinkurl{senderEmail}}}
setkomavar{subject}{Rechnung}
definvoicenr{Rechnungsnr.:}% <========================================
defcustomernr{Kundennr.:}%
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr invoiceReference\[1pt] % <=========
customernr customerNumber
}
setkomavar{firsthead}{hfill
parbox[t][headheight][t]{7cm}{%
footnotesize
raggedright
flushright
color[gray]{.3}%
begin{tabular}{rl}
Anschrift & usekomavar{fromname}\
& senderStreet\
& senderZIP senderCity \
\
%Telefon Telefon: ` senderTelephone \
Mobil & usekomavar{frommobilephone} \
E-Mail & usekomavar{fromemail} \
Webseite & {normalfontttfamily senderWeb } \
\
Steuernummer & taxID \
\
Institut & accountBankName \
IBAN & accountIBAN \
BIC & accountBIC
end{tabular}
}%
}
begin{document}
begin{letter}{customerCompany \ customerName \
customerStreet \ customerZIP customerCity}
includegraphics[width=0.15textwidth]{logo.png}
opening{invoiceSalutation}
invoiceText
begin{invoice}{Euro}{0}
ProjectTitle{Projekttitel} %
Fee{Musterdienstleistung 1}{30.00}{4}
Fee{Musterdienstleistung 2}{36.00}{7}
ProjectTitle{Tagesleistungen} %
FeeDay{Musterdienstleistung 3}{360.00}{3}
% Auslagen
%EBC{Hotel, 12 Nächte} {2400.00} % EBCi{Hotel, 12 Nächte} {2400.00}
%STExpenses
% Rabatt
Discount{Rabatt} {20} %
end{invoice}
ps Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
enthalten.
closing{invoiceClosing}
invoiceEnclosures
end{letter}
end{document}
you get the result:
If you want Kundennummer and rechnungsnummer and the relevant numbers to be one below the other simply change location
to
setkomavar{location}{%
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr\[1pt] invoiceReference\[1pt] % <=========
customernr\[1pt] customerNumber
}
with the result:
Please see that you can use
newcommand{invoiceReference}{2019_01_14_01}
to generate an invoice reference number 2019_01_14_01
but I would not recommend that. Better use 2019-01-14-01
...
edited Jan 27 at 19:40
answered Jan 27 at 19:34


KurtKurt
39.9k850164
39.9k850164
1
scrlttr2
already has a variablecustomer
. It also has a variableinvoice
and several other variable, that could be used.
– Schweinebacke
Jan 27 at 19:57
@Schweinebacke yes, you are right, but that invoice is based on styleinvoice
, so I decided to use at last the allready existing definition files there. I think it is better here ...
– Kurt
Jan 27 at 20:01
1
The customer number and the invoice number (and several other elements) here are part of the letter layout (used in KOMA-Script variables likelocation
orfirsthead
). So all these things are not related to packageinvoice
butscrlttr2
. BTW: With packagescrletter
variables can even be used with every other class.
– Schweinebacke
Jan 28 at 6:32
add a comment |
1
scrlttr2
already has a variablecustomer
. It also has a variableinvoice
and several other variable, that could be used.
– Schweinebacke
Jan 27 at 19:57
@Schweinebacke yes, you are right, but that invoice is based on styleinvoice
, so I decided to use at last the allready existing definition files there. I think it is better here ...
– Kurt
Jan 27 at 20:01
1
The customer number and the invoice number (and several other elements) here are part of the letter layout (used in KOMA-Script variables likelocation
orfirsthead
). So all these things are not related to packageinvoice
butscrlttr2
. BTW: With packagescrletter
variables can even be used with every other class.
– Schweinebacke
Jan 28 at 6:32
1
1
scrlttr2
already has a variable customer
. It also has a variable invoice
and several other variable, that could be used.– Schweinebacke
Jan 27 at 19:57
scrlttr2
already has a variable customer
. It also has a variable invoice
and several other variable, that could be used.– Schweinebacke
Jan 27 at 19:57
@Schweinebacke yes, you are right, but that invoice is based on style
invoice
, so I decided to use at last the allready existing definition files there. I think it is better here ...– Kurt
Jan 27 at 20:01
@Schweinebacke yes, you are right, but that invoice is based on style
invoice
, so I decided to use at last the allready existing definition files there. I think it is better here ...– Kurt
Jan 27 at 20:01
1
1
The customer number and the invoice number (and several other elements) here are part of the letter layout (used in KOMA-Script variables like
location
or firsthead
). So all these things are not related to package invoice
but scrlttr2
. BTW: With package scrletter
variables can even be used with every other class.– Schweinebacke
Jan 28 at 6:32
The customer number and the invoice number (and several other elements) here are part of the letter layout (used in KOMA-Script variables like
location
or firsthead
). So all these things are not related to package invoice
but scrlttr2
. BTW: With package scrletter
variables can even be used with every other class.– Schweinebacke
Jan 28 at 6:32
add a comment |
You could just use a tabular
environment with two lines for the reference:
documentclass[a4paper]{scrlttr2}
usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
usepackage{graphicx}
usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{color}
usepackage[hidelinks]{hyperref}
usepackage[german]{invoice}
newcommandsenderName{Foo Bar}
newcommandsenderStreet{Foo Street}
newcommandsenderZIP{12345}
newcommandsenderCity{Bar City}
newcommandsenderMobilephone{0123 3456789}
newcommandsenderEmail{foo@bar.de}
newcommandtaxID{4654TE132E}
newcommandaccountBankName{MyBank}
newcommandaccountIBAN{DE12 3456 7890 1234 5678 90}
newcommandaccountBIC{ABCDEFG0HIJ}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDay {Preis/Tag}% <========================================
newcommand{FeeDay@Title}{% <==========================================
\
noindenttextbf{Activity}&&UnitDay&Count&Amount (BC)\
hline%
}%
newcommand{FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@message{MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@message{MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 2: Start project, print title
%
FeeDay@Title%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 3: Print remuneration item
%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 4: Print subtotal remuneration
%
warning@message{FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@message{ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@message{InvoiceCompletedNoFee}%
%
%
else error@message{InternalError}%
fi%
}%
makeatother
renewcommand{familydefault}{sfdefault}
% include meta data
include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommand{invoiceDate}{today} % Datum der rechnungsstellung, change `today' to a different date, if you do not want to use todays date
newcommand{payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
newcommand{invoiceReference}
{%
begin{tabular}{@{}r@{}}
2019textunderscore01textunderscore14textunderscore1\
MyCustomer123%
end{tabular}%
} % Rechnungsnummer (z.B. 20150122-4)
newcommand{invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
newcommand{invoiceText}{folgende Positionen werden in Rechnung gestellt:} % Rechnungstext
newcommand{invoiceEnclosures}{} % encl{} einfügen
newcommand{invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
newcommand{customerCompany}{Firma XYZ} %ggf. Firma
newcommand{customerName}{Max Mustermann} % Name
newcommand{customerStreet}{Robert-Koch-Str. 12} % Straße
newcommand{customerZIP}{12345} % Postleitzahl
newcommand{customerCity}{Musterstadt} % Ort
% ################## Customer DATA ##################
setkomavar{fromname}{senderName}
setkomavar{fromaddress}{senderStreet \ senderZIP senderCity}
setkomavar{place}{senderCity}
setkomavar{date}{invoiceDate}
setkomavar{fromphone}{senderTelephone}
setkomavar{frommobilephone}{senderMobilephone}
setkomavar{fromemail}{href{mailto:senderEmail}{nolinkurl{senderEmail}}}
setkomavar{subject}{Rechnung}
setkomavar{location}{
\[baselineskip] \[baselineskip]
flushright small {vspace{1cm}Rechnungsnummer:
invoiceReference}
}
setkomavar{firsthead}{hfill
parbox[t][headheight][t]{7.2cm}{
footnotesize
raggedright
flushright
color[gray]{.3}%
begin{tabular}{rl}
Anschrift & usekomavar{fromname}\
& senderStreet\
& senderZIP senderCity \
\
%Telefon Telefon: ` senderTelephone \ %<=================== remove the `%' and go into `_data.tex' and add an phone number
Mobil & usekomavar{frommobilephone} \
E-Mail & usekomavar{fromemail} \
%Webseite & {normalfontttfamily senderWeb } \ %<=================== remove the `%' and go into `_data.tex' and add an URL
\
Steuernummer & taxID \
\
Institut & accountBankName \
IBAN & accountIBAN \
BIC & accountBIC
end{tabular}
}%
}
begin{document}
begin{letter}{customerCompany \ customerName \
customerStreet \ customerZIP customerCity}
opening{invoiceSalutation}
invoiceText
begin{invoice}{Euro}{0}
ProjectTitle{Tagesleistungen} % <====================================== Tagesleistungen
FeeDay{Freelance Arbeit}{300.00}{15}
ProjectTitle{Projekttitel} % <========================================= Stundenleistungen
Fee{Überstunden}{30.00}{2}
%Auslagen % <=================================================Auslagen
%EBC{Hotel, 12 Nächte} {2400.00} % EBCi{Hotel, 12 Nächte} {2400.00}
%STExpenses
% Rabatt
Discount{Rabatt} {0} % <========================================== Rabatt
end{invoice}
ps Bitte überweisen Sie den Rechnungsbetrag auf das unten aufgeführte Konto.
ps Kleinunternehmerregelung: Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer enthalten.
closing{invoiceClosing}
invoiceEnclosures
end{letter}
end{document}
but now I have the whole thing in one line "Kundennummer: 1001" But I would like to have the "1001" in the next line...
– Lala_Ghost
Jan 27 at 19:14
@Lala_Ghost then add another line to thetabular
environment.
– Skillmon
Jan 28 at 10:16
add a comment |
You could just use a tabular
environment with two lines for the reference:
documentclass[a4paper]{scrlttr2}
usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
usepackage{graphicx}
usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{color}
usepackage[hidelinks]{hyperref}
usepackage[german]{invoice}
newcommandsenderName{Foo Bar}
newcommandsenderStreet{Foo Street}
newcommandsenderZIP{12345}
newcommandsenderCity{Bar City}
newcommandsenderMobilephone{0123 3456789}
newcommandsenderEmail{foo@bar.de}
newcommandtaxID{4654TE132E}
newcommandaccountBankName{MyBank}
newcommandaccountIBAN{DE12 3456 7890 1234 5678 90}
newcommandaccountBIC{ABCDEFG0HIJ}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDay {Preis/Tag}% <========================================
newcommand{FeeDay@Title}{% <==========================================
\
noindenttextbf{Activity}&&UnitDay&Count&Amount (BC)\
hline%
}%
newcommand{FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@message{MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@message{MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 2: Start project, print title
%
FeeDay@Title%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 3: Print remuneration item
%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 4: Print subtotal remuneration
%
warning@message{FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@message{ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@message{InvoiceCompletedNoFee}%
%
%
else error@message{InternalError}%
fi%
}%
makeatother
renewcommand{familydefault}{sfdefault}
% include meta data
include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommand{invoiceDate}{today} % Datum der rechnungsstellung, change `today' to a different date, if you do not want to use todays date
newcommand{payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
newcommand{invoiceReference}
{%
begin{tabular}{@{}r@{}}
2019textunderscore01textunderscore14textunderscore1\
MyCustomer123%
end{tabular}%
} % Rechnungsnummer (z.B. 20150122-4)
newcommand{invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
newcommand{invoiceText}{folgende Positionen werden in Rechnung gestellt:} % Rechnungstext
newcommand{invoiceEnclosures}{} % encl{} einfügen
newcommand{invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
newcommand{customerCompany}{Firma XYZ} %ggf. Firma
newcommand{customerName}{Max Mustermann} % Name
newcommand{customerStreet}{Robert-Koch-Str. 12} % Straße
newcommand{customerZIP}{12345} % Postleitzahl
newcommand{customerCity}{Musterstadt} % Ort
% ################## Customer DATA ##################
setkomavar{fromname}{senderName}
setkomavar{fromaddress}{senderStreet \ senderZIP senderCity}
setkomavar{place}{senderCity}
setkomavar{date}{invoiceDate}
setkomavar{fromphone}{senderTelephone}
setkomavar{frommobilephone}{senderMobilephone}
setkomavar{fromemail}{href{mailto:senderEmail}{nolinkurl{senderEmail}}}
setkomavar{subject}{Rechnung}
setkomavar{location}{
\[baselineskip] \[baselineskip]
flushright small {vspace{1cm}Rechnungsnummer:
invoiceReference}
}
setkomavar{firsthead}{hfill
parbox[t][headheight][t]{7.2cm}{
footnotesize
raggedright
flushright
color[gray]{.3}%
begin{tabular}{rl}
Anschrift & usekomavar{fromname}\
& senderStreet\
& senderZIP senderCity \
\
%Telefon Telefon: ` senderTelephone \ %<=================== remove the `%' and go into `_data.tex' and add an phone number
Mobil & usekomavar{frommobilephone} \
E-Mail & usekomavar{fromemail} \
%Webseite & {normalfontttfamily senderWeb } \ %<=================== remove the `%' and go into `_data.tex' and add an URL
\
Steuernummer & taxID \
\
Institut & accountBankName \
IBAN & accountIBAN \
BIC & accountBIC
end{tabular}
}%
}
begin{document}
begin{letter}{customerCompany \ customerName \
customerStreet \ customerZIP customerCity}
opening{invoiceSalutation}
invoiceText
begin{invoice}{Euro}{0}
ProjectTitle{Tagesleistungen} % <====================================== Tagesleistungen
FeeDay{Freelance Arbeit}{300.00}{15}
ProjectTitle{Projekttitel} % <========================================= Stundenleistungen
Fee{Überstunden}{30.00}{2}
%Auslagen % <=================================================Auslagen
%EBC{Hotel, 12 Nächte} {2400.00} % EBCi{Hotel, 12 Nächte} {2400.00}
%STExpenses
% Rabatt
Discount{Rabatt} {0} % <========================================== Rabatt
end{invoice}
ps Bitte überweisen Sie den Rechnungsbetrag auf das unten aufgeführte Konto.
ps Kleinunternehmerregelung: Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer enthalten.
closing{invoiceClosing}
invoiceEnclosures
end{letter}
end{document}
but now I have the whole thing in one line "Kundennummer: 1001" But I would like to have the "1001" in the next line...
– Lala_Ghost
Jan 27 at 19:14
@Lala_Ghost then add another line to thetabular
environment.
– Skillmon
Jan 28 at 10:16
add a comment |
You could just use a tabular
environment with two lines for the reference:
documentclass[a4paper]{scrlttr2}
usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
usepackage{graphicx}
usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{color}
usepackage[hidelinks]{hyperref}
usepackage[german]{invoice}
newcommandsenderName{Foo Bar}
newcommandsenderStreet{Foo Street}
newcommandsenderZIP{12345}
newcommandsenderCity{Bar City}
newcommandsenderMobilephone{0123 3456789}
newcommandsenderEmail{foo@bar.de}
newcommandtaxID{4654TE132E}
newcommandaccountBankName{MyBank}
newcommandaccountIBAN{DE12 3456 7890 1234 5678 90}
newcommandaccountBIC{ABCDEFG0HIJ}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDay {Preis/Tag}% <========================================
newcommand{FeeDay@Title}{% <==========================================
\
noindenttextbf{Activity}&&UnitDay&Count&Amount (BC)\
hline%
}%
newcommand{FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@message{MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@message{MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 2: Start project, print title
%
FeeDay@Title%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 3: Print remuneration item
%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 4: Print subtotal remuneration
%
warning@message{FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@message{ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@message{InvoiceCompletedNoFee}%
%
%
else error@message{InternalError}%
fi%
}%
makeatother
renewcommand{familydefault}{sfdefault}
% include meta data
include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommand{invoiceDate}{today} % Datum der rechnungsstellung, change `today' to a different date, if you do not want to use todays date
newcommand{payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
newcommand{invoiceReference}
{%
begin{tabular}{@{}r@{}}
2019textunderscore01textunderscore14textunderscore1\
MyCustomer123%
end{tabular}%
} % Rechnungsnummer (z.B. 20150122-4)
newcommand{invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
newcommand{invoiceText}{folgende Positionen werden in Rechnung gestellt:} % Rechnungstext
newcommand{invoiceEnclosures}{} % encl{} einfügen
newcommand{invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
newcommand{customerCompany}{Firma XYZ} %ggf. Firma
newcommand{customerName}{Max Mustermann} % Name
newcommand{customerStreet}{Robert-Koch-Str. 12} % Straße
newcommand{customerZIP}{12345} % Postleitzahl
newcommand{customerCity}{Musterstadt} % Ort
% ################## Customer DATA ##################
setkomavar{fromname}{senderName}
setkomavar{fromaddress}{senderStreet \ senderZIP senderCity}
setkomavar{place}{senderCity}
setkomavar{date}{invoiceDate}
setkomavar{fromphone}{senderTelephone}
setkomavar{frommobilephone}{senderMobilephone}
setkomavar{fromemail}{href{mailto:senderEmail}{nolinkurl{senderEmail}}}
setkomavar{subject}{Rechnung}
setkomavar{location}{
\[baselineskip] \[baselineskip]
flushright small {vspace{1cm}Rechnungsnummer:
invoiceReference}
}
setkomavar{firsthead}{hfill
parbox[t][headheight][t]{7.2cm}{
footnotesize
raggedright
flushright
color[gray]{.3}%
begin{tabular}{rl}
Anschrift & usekomavar{fromname}\
& senderStreet\
& senderZIP senderCity \
\
%Telefon Telefon: ` senderTelephone \ %<=================== remove the `%' and go into `_data.tex' and add an phone number
Mobil & usekomavar{frommobilephone} \
E-Mail & usekomavar{fromemail} \
%Webseite & {normalfontttfamily senderWeb } \ %<=================== remove the `%' and go into `_data.tex' and add an URL
\
Steuernummer & taxID \
\
Institut & accountBankName \
IBAN & accountIBAN \
BIC & accountBIC
end{tabular}
}%
}
begin{document}
begin{letter}{customerCompany \ customerName \
customerStreet \ customerZIP customerCity}
opening{invoiceSalutation}
invoiceText
begin{invoice}{Euro}{0}
ProjectTitle{Tagesleistungen} % <====================================== Tagesleistungen
FeeDay{Freelance Arbeit}{300.00}{15}
ProjectTitle{Projekttitel} % <========================================= Stundenleistungen
Fee{Überstunden}{30.00}{2}
%Auslagen % <=================================================Auslagen
%EBC{Hotel, 12 Nächte} {2400.00} % EBCi{Hotel, 12 Nächte} {2400.00}
%STExpenses
% Rabatt
Discount{Rabatt} {0} % <========================================== Rabatt
end{invoice}
ps Bitte überweisen Sie den Rechnungsbetrag auf das unten aufgeführte Konto.
ps Kleinunternehmerregelung: Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer enthalten.
closing{invoiceClosing}
invoiceEnclosures
end{letter}
end{document}
You could just use a tabular
environment with two lines for the reference:
documentclass[a4paper]{scrlttr2}
usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
usepackage{graphicx}
usepackage{lmodern}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage[ngerman]{babel}
usepackage{color}
usepackage[hidelinks]{hyperref}
usepackage[german]{invoice}
newcommandsenderName{Foo Bar}
newcommandsenderStreet{Foo Street}
newcommandsenderZIP{12345}
newcommandsenderCity{Bar City}
newcommandsenderMobilephone{0123 3456789}
newcommandsenderEmail{foo@bar.de}
newcommandtaxID{4654TE132E}
newcommandaccountBankName{MyBank}
newcommandaccountIBAN{DE12 3456 7890 1234 5678 90}
newcommandaccountBIC{ABCDEFG0HIJ}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDay {Preis/Tag}% <========================================
newcommand{FeeDay@Title}{% <==========================================
\
noindenttextbf{Activity}&&UnitDay&Count&Amount (BC)\
hline%
}%
newcommand{FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@message{MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@message{MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 2: Start project, print title
%
FeeDay@Title%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 3: Print remuneration item
%
Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 4: Print subtotal remuneration
%
warning@message{FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@message{FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@message{ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@message{InvoiceCompletedNoFee}%
%
%
else error@message{InternalError}%
fi%
}%
makeatother
renewcommand{familydefault}{sfdefault}
% include meta data
include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommand{invoiceDate}{today} % Datum der rechnungsstellung, change `today' to a different date, if you do not want to use todays date
newcommand{payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
newcommand{invoiceReference}
{%
begin{tabular}{@{}r@{}}
2019textunderscore01textunderscore14textunderscore1\
MyCustomer123%
end{tabular}%
} % Rechnungsnummer (z.B. 20150122-4)
newcommand{invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
newcommand{invoiceText}{folgende Positionen werden in Rechnung gestellt:} % Rechnungstext
newcommand{invoiceEnclosures}{} % encl{} einfügen
newcommand{invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
newcommand{customerCompany}{Firma XYZ} %ggf. Firma
newcommand{customerName}{Max Mustermann} % Name
newcommand{customerStreet}{Robert-Koch-Str. 12} % Straße
newcommand{customerZIP}{12345} % Postleitzahl
newcommand{customerCity}{Musterstadt} % Ort
% ################## Customer DATA ##################
setkomavar{fromname}{senderName}
setkomavar{fromaddress}{senderStreet \ senderZIP senderCity}
setkomavar{place}{senderCity}
setkomavar{date}{invoiceDate}
setkomavar{fromphone}{senderTelephone}
setkomavar{frommobilephone}{senderMobilephone}
setkomavar{fromemail}{href{mailto:senderEmail}{nolinkurl{senderEmail}}}
setkomavar{subject}{Rechnung}
setkomavar{location}{
\[baselineskip] \[baselineskip]
flushright small {vspace{1cm}Rechnungsnummer:
invoiceReference}
}
setkomavar{firsthead}{hfill
parbox[t][headheight][t]{7.2cm}{
footnotesize
raggedright
flushright
color[gray]{.3}%
begin{tabular}{rl}
Anschrift & usekomavar{fromname}\
& senderStreet\
& senderZIP senderCity \
\
%Telefon Telefon: ` senderTelephone \ %<=================== remove the `%' and go into `_data.tex' and add an phone number
Mobil & usekomavar{frommobilephone} \
E-Mail & usekomavar{fromemail} \
%Webseite & {normalfontttfamily senderWeb } \ %<=================== remove the `%' and go into `_data.tex' and add an URL
\
Steuernummer & taxID \
\
Institut & accountBankName \
IBAN & accountIBAN \
BIC & accountBIC
end{tabular}
}%
}
begin{document}
begin{letter}{customerCompany \ customerName \
customerStreet \ customerZIP customerCity}
opening{invoiceSalutation}
invoiceText
begin{invoice}{Euro}{0}
ProjectTitle{Tagesleistungen} % <====================================== Tagesleistungen
FeeDay{Freelance Arbeit}{300.00}{15}
ProjectTitle{Projekttitel} % <========================================= Stundenleistungen
Fee{Überstunden}{30.00}{2}
%Auslagen % <=================================================Auslagen
%EBC{Hotel, 12 Nächte} {2400.00} % EBCi{Hotel, 12 Nächte} {2400.00}
%STExpenses
% Rabatt
Discount{Rabatt} {0} % <========================================== Rabatt
end{invoice}
ps Bitte überweisen Sie den Rechnungsbetrag auf das unten aufgeführte Konto.
ps Kleinunternehmerregelung: Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer enthalten.
closing{invoiceClosing}
invoiceEnclosures
end{letter}
end{document}
answered Jan 27 at 18:11


SkillmonSkillmon
23.8k12248
23.8k12248
but now I have the whole thing in one line "Kundennummer: 1001" But I would like to have the "1001" in the next line...
– Lala_Ghost
Jan 27 at 19:14
@Lala_Ghost then add another line to thetabular
environment.
– Skillmon
Jan 28 at 10:16
add a comment |
but now I have the whole thing in one line "Kundennummer: 1001" But I would like to have the "1001" in the next line...
– Lala_Ghost
Jan 27 at 19:14
@Lala_Ghost then add another line to thetabular
environment.
– Skillmon
Jan 28 at 10:16
but now I have the whole thing in one line "Kundennummer: 1001" But I would like to have the "1001" in the next line...
– Lala_Ghost
Jan 27 at 19:14
but now I have the whole thing in one line "Kundennummer: 1001" But I would like to have the "1001" in the next line...
– Lala_Ghost
Jan 27 at 19:14
@Lala_Ghost then add another line to the
tabular
environment.– Skillmon
Jan 28 at 10:16
@Lala_Ghost then add another line to the
tabular
environment.– Skillmon
Jan 28 at 10:16
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f472129%2fadd-a-specific-text-and-variable%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Would have been better if every potential answerer didn't have to add the sender's information himself.
– Skillmon
Jan 27 at 18:14
Yeah you are right!
– Lala_Ghost
Jan 27 at 19:08