Add a specific text and variable












2















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:



removed my names and stuff



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}









share|improve this question









New contributor




Lala_Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Would have been better if every potential answerer didn't have to add the sender's information himself.

    – Skillmon
    2 hours ago











  • Yeah you are right!

    – Lala_Ghost
    1 hour ago
















2















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:



removed my names and stuff



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}









share|improve this question









New contributor




Lala_Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Would have been better if every potential answerer didn't have to add the sender's information himself.

    – Skillmon
    2 hours ago











  • Yeah you are right!

    – Lala_Ghost
    1 hour ago














2












2








2








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:



removed my names and stuff



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}









share|improve this question









New contributor




Lala_Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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:



removed my names and stuff



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






share|improve this question









New contributor




Lala_Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Lala_Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 53 mins ago









Kurt

36.4k847162




36.4k847162






New contributor




Lala_Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 hours ago









Lala_GhostLala_Ghost

373




373




New contributor




Lala_Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Lala_Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Lala_Ghost is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • Would have been better if every potential answerer didn't have to add the sender's information himself.

    – Skillmon
    2 hours ago











  • Yeah you are right!

    – Lala_Ghost
    1 hour ago



















  • Would have been better if every potential answerer didn't have to add the sender's information himself.

    – Skillmon
    2 hours ago











  • Yeah you are right!

    – Lala_Ghost
    1 hour ago

















Would have been better if every potential answerer didn't have to add the sender's information himself.

– Skillmon
2 hours ago





Would have been better if every potential answerer didn't have to add the sender's information himself.

– Skillmon
2 hours ago













Yeah you are right!

– Lala_Ghost
1 hour ago





Yeah you are right!

– Lala_Ghost
1 hour ago










2 Answers
2






active

oldest

votes


















2














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:



enter image description here



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:



enter image description here



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 ...






share|improve this answer


























  • scrlttr2 already has a variable customer. It also has a variable invoice and several other variable, that could be used.

    – Schweinebacke
    47 mins ago











  • @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
    43 mins ago





















1














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}


enter image description here






share|improve this answer
























  • 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
    1 hour ago













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
});


}
});






Lala_Ghost is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















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









2














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:



enter image description here



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:



enter image description here



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 ...






share|improve this answer


























  • scrlttr2 already has a variable customer. It also has a variable invoice and several other variable, that could be used.

    – Schweinebacke
    47 mins ago











  • @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
    43 mins ago


















2














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:



enter image description here



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:



enter image description here



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 ...






share|improve this answer


























  • scrlttr2 already has a variable customer. It also has a variable invoice and several other variable, that could be used.

    – Schweinebacke
    47 mins ago











  • @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
    43 mins ago
















2












2








2







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:



enter image description here



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:



enter image description here



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 ...






share|improve this answer















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:



enter image description here



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:



enter image description here



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 ...







share|improve this answer














share|improve this answer



share|improve this answer








edited 1 hour ago

























answered 1 hour ago









KurtKurt

36.4k847162




36.4k847162













  • scrlttr2 already has a variable customer. It also has a variable invoice and several other variable, that could be used.

    – Schweinebacke
    47 mins ago











  • @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
    43 mins ago





















  • scrlttr2 already has a variable customer. It also has a variable invoice and several other variable, that could be used.

    – Schweinebacke
    47 mins ago











  • @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
    43 mins ago



















scrlttr2 already has a variable customer. It also has a variable invoice and several other variable, that could be used.

– Schweinebacke
47 mins ago





scrlttr2 already has a variable customer. It also has a variable invoice and several other variable, that could be used.

– Schweinebacke
47 mins ago













@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
43 mins ago







@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
43 mins ago













1














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}


enter image description here






share|improve this answer
























  • 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
    1 hour ago


















1














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}


enter image description here






share|improve this answer
























  • 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
    1 hour ago
















1












1








1







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}


enter image description here






share|improve this answer













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}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered 2 hours ago









SkillmonSkillmon

22k11942




22k11942













  • 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
    1 hour ago





















  • 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
    1 hour ago



















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
1 hour ago







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
1 hour ago












Lala_Ghost is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Lala_Ghost is a new contributor. Be nice, and check out our Code of Conduct.













Lala_Ghost is a new contributor. Be nice, and check out our Code of Conduct.












Lala_Ghost is a new contributor. Be nice, and check out our Code of Conduct.
















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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

GameSpot

日野市

Tu-95轟炸機