Proper if statement

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












2















I have real trouble getting an if statement to work properly....
here is a link to a zip file with all code needed: https://www.dropbox.com/s/ojsj33oe9ac4g09/latex-rechnung.zip?dl=0



My code:



documentclass[a4paper]scrlttr2 
usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]geometry
usepackagegraphicx
usepackagelmodern
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackage[ngerman]babel
usepackagecolor
usepackage[hidelinks]hyperref
usepackagelipsum
usepackagexifthen

usepackage[german]invoice

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDayPreis/Tag% <========================================

newcommandFeeDay@Title% <==========================================
\
noindenttextbfActivity&&UnitDay&Count&Amount (BC)\
hline%
%

newcommandFeeDay[3]% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@messageMissingOpening%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@messageMissingProject%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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@messageFeeSTExists%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@messageFeeBeforeExpense%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@messageFeeBeforeExpense%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@messageProjectCompletedNoFee%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@messageInvoiceCompletedNoFee%
%
%
else error@messageInternalError%
fi%
%
makeatother


renewcommandfamilydefaultsfdefault

% include meta data
include_data % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommandinvoiceDatetoday % Datum der rechnungsstellung
newcommandinvoiceReference2019_02_04_1 % Rechnungsnummer (z.B. 20150122-4) YYYYMMDD-1
newcommandinvoiceSalutation % die Anrede
newcommandinvoiceTextFolgende Positionen werden in Rechnung gestellt: % Rechnungstext
newcommandinvoiceEnclosures % encl einfügen
newcommandinvoiceClosingMit freundlichen Grüßen
% ################## invoice DATA ##################


% ##################Job DATA ####################
def performaceStart 14.01.2019
def performaceEnd 01.02.2019
% ##################Job DATA ####################


% ################## Customer DATA ##################
newcommandcustomerCompanyFirma ABC %ggf. Firma
newcommandcustomerNameMustermann % Name
newcommandcustomerStreetStraße 123 % Straße
newcommandcustomerZIP12345 % Postleitzahl
newcommandcustomerCityMusterstadt % Ort
newcommandcustomerNumber1000 % Kundennummer <==================
% ################## Customer DATA ##################

setkomavarfromnamesenderName
setkomavarfromaddresssenderStreet \ senderZIP senderCity
setkomavarplacesenderCity
setkomavardateinvoiceDate
setkomavarfromphonesenderTelephone
setkomavarfrommobilephonesenderMobilephone
setkomavarfromemailhrefmailto:senderEmailnolinkurlsenderEmail
setkomavarsubjectRechnung

def invoicenrRechnungsnummer: % <========================================
def customernrKundennummer: %
def performanceDurationLeistungszeitraum:

setkomavarlocationvspace*-1.99cm
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr invoiceReference\[5pt]
customernr\
customerNumber\[5pt]
performanceDuration\

newcommanddownow
if performanceEnd ==
performaceStart -- performaceEnd
else
performanceStart

% performaceStart -- performaceEnd



setkomavarfirstheadhfill
parbox[t][headheight][t]7.3cm
%
footnotesize
raggedright
flushright
color[gray].3%
%



begindocument
beginlettercustomerCompany \ customerName \
customerStreet \ customerZIP customerCityvspace*-3.5cm


openinginvoiceSalutation
invoiceText
begininvoiceEuro0

ProjectTitleTagesleistungen %
FeeDayFreelancing 300 1

%ProjectTitleProjekttitel %
%FeeÜberstunden 37.5 4



% Auslagen
%EBCSoftwarenutzung 150.00
%EBCiHotel, 12 Nächte 2400.00
%STExpenses

% Rabatt
DiscountRabatt 0 %
endinvoice
ps Bitte zahlen Sie den Gesamtbetrag unter Angabe der Rechnungsnummer auf das aufgeführte Konto.
ps Kleinunternehmerregelung:\
Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
enthalten.

closinginvoiceClosing
invoiceEnclosures
vspace*3.9cm
footnotesize ps textbfBankverbindung:hspace6mmaccountBankName, accountIBAN, accountBIC
footnotesize ps textbfSteuernummer:hspace8mmtaxID



endletter
enddocument


I would like to have an if statement that checks if performaceEnd is undefined or empty. If it is empty, under performanceDuration it shall only say performanceStart, if performanceEnd is defined it shall say performanceStart -- performanceEnd



Ho do I do that?










share|improve this question



















  • 4





    I won't download a zip from an external file. Also your question will get meaningless if the link no longer work. Write your question so that every needed info is here.

    – Ulrike Fischer
    Feb 4 at 16:32











  • @Ulrike Fischer How am I supposed to upload any needed files?

    – Lala_Ghost
    Feb 4 at 17:49











  • @Lala_Ghost In this you have a problem with adding some text (or not) to command location, comming from KOMA-Script class scrlttr2. You can simply reduce the code to a normal letter (deleting all stuff needed for your invoice calculation) using location and ask then how to be able to add some text depending on the definition or value of two variables. Then you need not the files from your zip file.

    – Kurt
    Feb 8 at 3:39















2















I have real trouble getting an if statement to work properly....
here is a link to a zip file with all code needed: https://www.dropbox.com/s/ojsj33oe9ac4g09/latex-rechnung.zip?dl=0



My code:



documentclass[a4paper]scrlttr2 
usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]geometry
usepackagegraphicx
usepackagelmodern
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackage[ngerman]babel
usepackagecolor
usepackage[hidelinks]hyperref
usepackagelipsum
usepackagexifthen

usepackage[german]invoice

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDayPreis/Tag% <========================================

newcommandFeeDay@Title% <==========================================
\
noindenttextbfActivity&&UnitDay&Count&Amount (BC)\
hline%
%

newcommandFeeDay[3]% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@messageMissingOpening%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@messageMissingProject%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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@messageFeeSTExists%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@messageFeeBeforeExpense%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@messageFeeBeforeExpense%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@messageProjectCompletedNoFee%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@messageInvoiceCompletedNoFee%
%
%
else error@messageInternalError%
fi%
%
makeatother


renewcommandfamilydefaultsfdefault

% include meta data
include_data % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommandinvoiceDatetoday % Datum der rechnungsstellung
newcommandinvoiceReference2019_02_04_1 % Rechnungsnummer (z.B. 20150122-4) YYYYMMDD-1
newcommandinvoiceSalutation % die Anrede
newcommandinvoiceTextFolgende Positionen werden in Rechnung gestellt: % Rechnungstext
newcommandinvoiceEnclosures % encl einfügen
newcommandinvoiceClosingMit freundlichen Grüßen
% ################## invoice DATA ##################


% ##################Job DATA ####################
def performaceStart 14.01.2019
def performaceEnd 01.02.2019
% ##################Job DATA ####################


% ################## Customer DATA ##################
newcommandcustomerCompanyFirma ABC %ggf. Firma
newcommandcustomerNameMustermann % Name
newcommandcustomerStreetStraße 123 % Straße
newcommandcustomerZIP12345 % Postleitzahl
newcommandcustomerCityMusterstadt % Ort
newcommandcustomerNumber1000 % Kundennummer <==================
% ################## Customer DATA ##################

setkomavarfromnamesenderName
setkomavarfromaddresssenderStreet \ senderZIP senderCity
setkomavarplacesenderCity
setkomavardateinvoiceDate
setkomavarfromphonesenderTelephone
setkomavarfrommobilephonesenderMobilephone
setkomavarfromemailhrefmailto:senderEmailnolinkurlsenderEmail
setkomavarsubjectRechnung

def invoicenrRechnungsnummer: % <========================================
def customernrKundennummer: %
def performanceDurationLeistungszeitraum:

setkomavarlocationvspace*-1.99cm
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr invoiceReference\[5pt]
customernr\
customerNumber\[5pt]
performanceDuration\

newcommanddownow
if performanceEnd ==
performaceStart -- performaceEnd
else
performanceStart

% performaceStart -- performaceEnd



setkomavarfirstheadhfill
parbox[t][headheight][t]7.3cm
%
footnotesize
raggedright
flushright
color[gray].3%
%



begindocument
beginlettercustomerCompany \ customerName \
customerStreet \ customerZIP customerCityvspace*-3.5cm


openinginvoiceSalutation
invoiceText
begininvoiceEuro0

ProjectTitleTagesleistungen %
FeeDayFreelancing 300 1

%ProjectTitleProjekttitel %
%FeeÜberstunden 37.5 4



% Auslagen
%EBCSoftwarenutzung 150.00
%EBCiHotel, 12 Nächte 2400.00
%STExpenses

% Rabatt
DiscountRabatt 0 %
endinvoice
ps Bitte zahlen Sie den Gesamtbetrag unter Angabe der Rechnungsnummer auf das aufgeführte Konto.
ps Kleinunternehmerregelung:\
Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
enthalten.

closinginvoiceClosing
invoiceEnclosures
vspace*3.9cm
footnotesize ps textbfBankverbindung:hspace6mmaccountBankName, accountIBAN, accountBIC
footnotesize ps textbfSteuernummer:hspace8mmtaxID



endletter
enddocument


I would like to have an if statement that checks if performaceEnd is undefined or empty. If it is empty, under performanceDuration it shall only say performanceStart, if performanceEnd is defined it shall say performanceStart -- performanceEnd



Ho do I do that?










share|improve this question



















  • 4





    I won't download a zip from an external file. Also your question will get meaningless if the link no longer work. Write your question so that every needed info is here.

    – Ulrike Fischer
    Feb 4 at 16:32











  • @Ulrike Fischer How am I supposed to upload any needed files?

    – Lala_Ghost
    Feb 4 at 17:49











  • @Lala_Ghost In this you have a problem with adding some text (or not) to command location, comming from KOMA-Script class scrlttr2. You can simply reduce the code to a normal letter (deleting all stuff needed for your invoice calculation) using location and ask then how to be able to add some text depending on the definition or value of two variables. Then you need not the files from your zip file.

    – Kurt
    Feb 8 at 3:39













2












2








2








I have real trouble getting an if statement to work properly....
here is a link to a zip file with all code needed: https://www.dropbox.com/s/ojsj33oe9ac4g09/latex-rechnung.zip?dl=0



My code:



documentclass[a4paper]scrlttr2 
usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]geometry
usepackagegraphicx
usepackagelmodern
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackage[ngerman]babel
usepackagecolor
usepackage[hidelinks]hyperref
usepackagelipsum
usepackagexifthen

usepackage[german]invoice

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDayPreis/Tag% <========================================

newcommandFeeDay@Title% <==========================================
\
noindenttextbfActivity&&UnitDay&Count&Amount (BC)\
hline%
%

newcommandFeeDay[3]% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@messageMissingOpening%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@messageMissingProject%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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@messageFeeSTExists%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@messageFeeBeforeExpense%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@messageFeeBeforeExpense%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@messageProjectCompletedNoFee%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@messageInvoiceCompletedNoFee%
%
%
else error@messageInternalError%
fi%
%
makeatother


renewcommandfamilydefaultsfdefault

% include meta data
include_data % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommandinvoiceDatetoday % Datum der rechnungsstellung
newcommandinvoiceReference2019_02_04_1 % Rechnungsnummer (z.B. 20150122-4) YYYYMMDD-1
newcommandinvoiceSalutation % die Anrede
newcommandinvoiceTextFolgende Positionen werden in Rechnung gestellt: % Rechnungstext
newcommandinvoiceEnclosures % encl einfügen
newcommandinvoiceClosingMit freundlichen Grüßen
% ################## invoice DATA ##################


% ##################Job DATA ####################
def performaceStart 14.01.2019
def performaceEnd 01.02.2019
% ##################Job DATA ####################


% ################## Customer DATA ##################
newcommandcustomerCompanyFirma ABC %ggf. Firma
newcommandcustomerNameMustermann % Name
newcommandcustomerStreetStraße 123 % Straße
newcommandcustomerZIP12345 % Postleitzahl
newcommandcustomerCityMusterstadt % Ort
newcommandcustomerNumber1000 % Kundennummer <==================
% ################## Customer DATA ##################

setkomavarfromnamesenderName
setkomavarfromaddresssenderStreet \ senderZIP senderCity
setkomavarplacesenderCity
setkomavardateinvoiceDate
setkomavarfromphonesenderTelephone
setkomavarfrommobilephonesenderMobilephone
setkomavarfromemailhrefmailto:senderEmailnolinkurlsenderEmail
setkomavarsubjectRechnung

def invoicenrRechnungsnummer: % <========================================
def customernrKundennummer: %
def performanceDurationLeistungszeitraum:

setkomavarlocationvspace*-1.99cm
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr invoiceReference\[5pt]
customernr\
customerNumber\[5pt]
performanceDuration\

newcommanddownow
if performanceEnd ==
performaceStart -- performaceEnd
else
performanceStart

% performaceStart -- performaceEnd



setkomavarfirstheadhfill
parbox[t][headheight][t]7.3cm
%
footnotesize
raggedright
flushright
color[gray].3%
%



begindocument
beginlettercustomerCompany \ customerName \
customerStreet \ customerZIP customerCityvspace*-3.5cm


openinginvoiceSalutation
invoiceText
begininvoiceEuro0

ProjectTitleTagesleistungen %
FeeDayFreelancing 300 1

%ProjectTitleProjekttitel %
%FeeÜberstunden 37.5 4



% Auslagen
%EBCSoftwarenutzung 150.00
%EBCiHotel, 12 Nächte 2400.00
%STExpenses

% Rabatt
DiscountRabatt 0 %
endinvoice
ps Bitte zahlen Sie den Gesamtbetrag unter Angabe der Rechnungsnummer auf das aufgeführte Konto.
ps Kleinunternehmerregelung:\
Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
enthalten.

closinginvoiceClosing
invoiceEnclosures
vspace*3.9cm
footnotesize ps textbfBankverbindung:hspace6mmaccountBankName, accountIBAN, accountBIC
footnotesize ps textbfSteuernummer:hspace8mmtaxID



endletter
enddocument


I would like to have an if statement that checks if performaceEnd is undefined or empty. If it is empty, under performanceDuration it shall only say performanceStart, if performanceEnd is defined it shall say performanceStart -- performanceEnd



Ho do I do that?










share|improve this question
















I have real trouble getting an if statement to work properly....
here is a link to a zip file with all code needed: https://www.dropbox.com/s/ojsj33oe9ac4g09/latex-rechnung.zip?dl=0



My code:



documentclass[a4paper]scrlttr2 
usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]geometry
usepackagegraphicx
usepackagelmodern
usepackage[utf8]inputenc
usepackage[T1]fontenc
usepackage[ngerman]babel
usepackagecolor
usepackage[hidelinks]hyperref
usepackagelipsum
usepackagexifthen

usepackage[german]invoice

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
makeatletter
defUnitDayPreis/Tag% <========================================

newcommandFeeDay@Title% <==========================================
\
noindenttextbfActivity&&UnitDay&Count&Amount (BC)\
hline%
%

newcommandFeeDay[3]% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
ifcaseFlag % 0: Invoice not started yet
error@messageMissingOpening%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 1: Start invoice
%
error@messageMissingProject%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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@messageFeeSTExists%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 5: Expense item
%
error@messageFeeBeforeExpense%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 6: Print subtotal expenses
%
error@messageFeeBeforeExpense%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 7: Print subtotal project
%
error@messageProjectCompletedNoFee%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
or % 8: Print total, close invoice
%
error@messageInvoiceCompletedNoFee%
%
%
else error@messageInternalError%
fi%
%
makeatother


renewcommandfamilydefaultsfdefault

% include meta data
include_data % <============== delete in this file the following data!
% ################## invoice DATA ##################
newcommandinvoiceDatetoday % Datum der rechnungsstellung
newcommandinvoiceReference2019_02_04_1 % Rechnungsnummer (z.B. 20150122-4) YYYYMMDD-1
newcommandinvoiceSalutation % die Anrede
newcommandinvoiceTextFolgende Positionen werden in Rechnung gestellt: % Rechnungstext
newcommandinvoiceEnclosures % encl einfügen
newcommandinvoiceClosingMit freundlichen Grüßen
% ################## invoice DATA ##################


% ##################Job DATA ####################
def performaceStart 14.01.2019
def performaceEnd 01.02.2019
% ##################Job DATA ####################


% ################## Customer DATA ##################
newcommandcustomerCompanyFirma ABC %ggf. Firma
newcommandcustomerNameMustermann % Name
newcommandcustomerStreetStraße 123 % Straße
newcommandcustomerZIP12345 % Postleitzahl
newcommandcustomerCityMusterstadt % Ort
newcommandcustomerNumber1000 % Kundennummer <==================
% ################## Customer DATA ##################

setkomavarfromnamesenderName
setkomavarfromaddresssenderStreet \ senderZIP senderCity
setkomavarplacesenderCity
setkomavardateinvoiceDate
setkomavarfromphonesenderTelephone
setkomavarfrommobilephonesenderMobilephone
setkomavarfromemailhrefmailto:senderEmailnolinkurlsenderEmail
setkomavarsubjectRechnung

def invoicenrRechnungsnummer: % <========================================
def customernrKundennummer: %
def performanceDurationLeistungszeitraum:

setkomavarlocationvspace*-1.99cm
\[baselineskip] \[baselineskip]
flushrightsmall invoicenr invoiceReference\[5pt]
customernr\
customerNumber\[5pt]
performanceDuration\

newcommanddownow
if performanceEnd ==
performaceStart -- performaceEnd
else
performanceStart

% performaceStart -- performaceEnd



setkomavarfirstheadhfill
parbox[t][headheight][t]7.3cm
%
footnotesize
raggedright
flushright
color[gray].3%
%



begindocument
beginlettercustomerCompany \ customerName \
customerStreet \ customerZIP customerCityvspace*-3.5cm


openinginvoiceSalutation
invoiceText
begininvoiceEuro0

ProjectTitleTagesleistungen %
FeeDayFreelancing 300 1

%ProjectTitleProjekttitel %
%FeeÜberstunden 37.5 4



% Auslagen
%EBCSoftwarenutzung 150.00
%EBCiHotel, 12 Nächte 2400.00
%STExpenses

% Rabatt
DiscountRabatt 0 %
endinvoice
ps Bitte zahlen Sie den Gesamtbetrag unter Angabe der Rechnungsnummer auf das aufgeführte Konto.
ps Kleinunternehmerregelung:\
Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
enthalten.

closinginvoiceClosing
invoiceEnclosures
vspace*3.9cm
footnotesize ps textbfBankverbindung:hspace6mmaccountBankName, accountIBAN, accountBIC
footnotesize ps textbfSteuernummer:hspace8mmtaxID



endletter
enddocument


I would like to have an if statement that checks if performaceEnd is undefined or empty. If it is empty, under performanceDuration it shall only say performanceStart, if performanceEnd is defined it shall say performanceStart -- performanceEnd



Ho do I do that?







ifthenelse condition






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 4 at 17:39









Kurt

38.2k848162




38.2k848162










asked Feb 4 at 16:24









Lala_GhostLala_Ghost

764




764







  • 4





    I won't download a zip from an external file. Also your question will get meaningless if the link no longer work. Write your question so that every needed info is here.

    – Ulrike Fischer
    Feb 4 at 16:32











  • @Ulrike Fischer How am I supposed to upload any needed files?

    – Lala_Ghost
    Feb 4 at 17:49











  • @Lala_Ghost In this you have a problem with adding some text (or not) to command location, comming from KOMA-Script class scrlttr2. You can simply reduce the code to a normal letter (deleting all stuff needed for your invoice calculation) using location and ask then how to be able to add some text depending on the definition or value of two variables. Then you need not the files from your zip file.

    – Kurt
    Feb 8 at 3:39












  • 4





    I won't download a zip from an external file. Also your question will get meaningless if the link no longer work. Write your question so that every needed info is here.

    – Ulrike Fischer
    Feb 4 at 16:32











  • @Ulrike Fischer How am I supposed to upload any needed files?

    – Lala_Ghost
    Feb 4 at 17:49











  • @Lala_Ghost In this you have a problem with adding some text (or not) to command location, comming from KOMA-Script class scrlttr2. You can simply reduce the code to a normal letter (deleting all stuff needed for your invoice calculation) using location and ask then how to be able to add some text depending on the definition or value of two variables. Then you need not the files from your zip file.

    – Kurt
    Feb 8 at 3:39







4




4





I won't download a zip from an external file. Also your question will get meaningless if the link no longer work. Write your question so that every needed info is here.

– Ulrike Fischer
Feb 4 at 16:32





I won't download a zip from an external file. Also your question will get meaningless if the link no longer work. Write your question so that every needed info is here.

– Ulrike Fischer
Feb 4 at 16:32













@Ulrike Fischer How am I supposed to upload any needed files?

– Lala_Ghost
Feb 4 at 17:49





@Ulrike Fischer How am I supposed to upload any needed files?

– Lala_Ghost
Feb 4 at 17:49













@Lala_Ghost In this you have a problem with adding some text (or not) to command location, comming from KOMA-Script class scrlttr2. You can simply reduce the code to a normal letter (deleting all stuff needed for your invoice calculation) using location and ask then how to be able to add some text depending on the definition or value of two variables. Then you need not the files from your zip file.

– Kurt
Feb 8 at 3:39





@Lala_Ghost In this you have a problem with adding some text (or not) to command location, comming from KOMA-Script class scrlttr2. You can simply reduce the code to a normal letter (deleting all stuff needed for your invoice calculation) using location and ask then how to be able to add some text depending on the definition or value of two variables. Then you need not the files from your zip file.

– Kurt
Feb 8 at 3:39










2 Answers
2






active

oldest

votes


















4














The correct way to write your test is



ifxperformanceEndundefined
performanceStart
elseifxperformanceEndempty
performanceStart
else
performanceStart -- performanceEnd
fifi


You can also declare a boolean ifperformanceEnd by



newififperformanceEnd


anywhere in the preamble and check performanceEnd with



performanceEndfalse
ifxperformanceEndundefinedelse
ifxperformanceEndemptyelse
performanceEndtrue
fifi


then you can write



ifperformanceEnd
performanceStart -- performanceEnd
else
performanceStart
fi


or even



performanceStartifperformanceEnd -- performanceEndfi





share|improve this answer
































    3














    Okay, here we go: as already pointed out by @eric-domenjoud you can use ifx to build the variations of text you need. BTW think about adding an "seit " to make clear that the performance time is not over.



    I corrected in the following code the wrong written variables performaceStart and performaceEnd to the correct one performanceStart and performanceEnd in the complete following code.



    As we did in your last question we once again have to change the code for command location like:



    setkomavarlocation%
    \[baselineskip] \[baselineskip]
    flushrightsmall invoicenr invoiceReference\[5pt]
    customernr\
    customerNumber\[5pt]
    performanceDuration\
    ifxperformanceEndundefined % <=======================================
    performanceStart
    elseifxperformanceEndempty
    performanceStart
    else
    performanceStart -- performanceEnd
    fifi % <==============================================================



    Then we get with the following code (you need to use all files in the question linked zip file to be able to compile it!)



     documentclass[a4paper]scrlttr2

    usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]geometry
    usepackagegraphicx
    usepackagelmodern
    usepackage[utf8]inputenc
    usepackage[T1]fontenc
    usepackage[ngerman]babel
    usepackagecolor
    usepackage[hidelinks]hyperref
    %usepackage ifthen

    usepackage[german]invoice

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    makeatletter
    defUnitDayPreis/Tag% <========================================

    newcommandFeeDay@Title% <==========================================
    \
    noindenttextbfActivity&&UnitDay&Count&Amount (BC)\
    hline%
    %

    newcommandFeeDay[3]% Yields state 3, Print Fee Item <==============
    %
    % #1 Contents
    % #2 Fee per Day
    % #3 Unit Count
    %
    ifcaseFlag % 0: Invoice not started yet
    error@messageMissingOpening%
    %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    or % 1: Start invoice
    %
    error@messageMissingProject%
    %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    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@messageFeeSTExists%
    %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    or % 5: Expense item
    %
    error@messageFeeBeforeExpense%
    %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    or % 6: Print subtotal expenses
    %
    error@messageFeeBeforeExpense%
    %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    or % 7: Print subtotal project
    %
    error@messageProjectCompletedNoFee%
    %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    or % 8: Print total, close invoice
    %
    error@messageInvoiceCompletedNoFee%
    %
    %
    else error@messageInternalError%
    fi%
    %
    makeatother


    renewcommandfamilydefaultsfdefault

    % include meta data
    include_data % <============== delete in this file the following data!
    % ################## invoice DATA ##################
    newcommandinvoiceDatetoday % Datum der rechnungsstellung
    newcommandinvoiceReference2019_01_01_1 % Rechnungsnummer (z.B. 20150122-4) YYYYMMDD-1
    newcommandinvoiceSalutationSehr geehrte Damen und Herren, % die Anrede
    newcommandinvoiceTextFolgende Positionen werden in Rechnung gestellt: % Rechnungstext
    newcommandinvoiceEnclosures % encl einfügen
    newcommandinvoiceClosingMit freundlichen Grüßen
    % ################## invoice DATA ##################


    % ##################Job DATA ####################
    def performanceStart 01.01.2019
    %def performanceEnd 02.01.2019
    % ##################Job DATA ####################


    % ################## Customer DATA ##################
    newcommandcustomerCompanyFirma ABC %ggf. Firma
    newcommandcustomerNameMax Mustermann % Name
    newcommandcustomerStreetMusterstraße 10 % Straße
    newcommandcustomerZIP12345 % Postleitzahl
    newcommandcustomerCityMusterort % Ort
    newcommandcustomerNumber1000 % Kundennummer <==================
    % ################## Customer DATA ##################

    setkomavarfromnamesenderName
    setkomavarfromaddresssenderStreet \ senderZIP senderCity
    setkomavarplacesenderCity
    setkomavardateinvoiceDate
    setkomavarfromphonesenderTelephone
    setkomavarfrommobilephonesenderMobilephone
    setkomavarfromemailhrefmailto:senderEmailnolinkurlsenderEmail
    setkomavarsubjectRechnung

    def invoicenrRechnungsnummer: % <========================================
    def customernrKundennummer: %
    def performanceDurationLeistungszeitraum:

    setkomavarlocation%
    \[baselineskip] \[baselineskip]
    flushrightsmall invoicenr invoiceReference\[5pt]
    customernr\
    customerNumber\[5pt]
    performanceDuration\
    ifxperformanceEndundefined % <=======================================
    performanceStart
    elseifxperformanceEndempty
    performanceStart
    else
    performanceStart -- performanceEnd
    fifi % <==============================================================



    setkomavarfirstheadhfill
    parbox[t][headheight][t]7.3cm%
    footnotesize
    raggedright
    flushright
    color[gray].3%
    begintabularrl
    Anschrift & usekomavarfromname\
    & senderStreet\
    & senderZIP senderCity \
    \
    %Telefon Telefon: ` senderTelephone \
    Mobil & usekomavarfrommobilephone \
    E-Mail & usekomavarfromemail \
    %Webseite & normalfontttfamily senderWeb \
    \
    Steuernummer & taxID \
    \
    Institut & accountBankName \
    IBAN & accountIBAN \
    BIC & accountBIC
    endtabular
    %



    begindocument
    beginlettercustomerCompany \ customerName \
    customerStreet \ customerZIP customerCity


    openinginvoiceSalutation
    invoiceText
    begininvoiceEuro0

    ProjectTitleTagesleistungen %
    FeeDayFreelance Arbeit 10 1

    ProjectTitleProjekttitel %
    FeeÜberstunden 20 1



    % Auslagen
    %EBCHotel, 12 Nächte 2400.00 % EBCiHotel, 12 Nächte 2400.00
    %STExpenses

    % Rabatt
    DiscountRabatt 0 %
    endinvoice
    ps Bitte zahlen Sie den Gesamtbetrag unter Angabe der Rechnungsnummer auf das aufgeführte Konto.
    ps Kleinunternehmerregelung:\
    Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
    enthalten.

    closinginvoiceClosing
    invoiceEnclosures



    endletter
    enddocument


    the following result (see that I commented definition of performanceEnd):



    resulting pdf



    If you want to add "seit " as remarked at the beginning of this answer you can use



    setkomavarlocation%
    \[baselineskip] \[baselineskip]
    flushrightsmall invoicenr invoiceReference\[5pt]
    customernr\
    customerNumber\[5pt]
    performanceDuration\
    ifxperformanceEndundefined % <=======================================
    seit performanceStart
    elseifxperformanceEndempty
    seit performanceStart
    else
    performanceStart -- performanceEnd
    fifi % <==============================================================



    with the result:



    enter image description here






    share|improve this answer






















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



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f473330%2fproper-if-statement%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









      4














      The correct way to write your test is



      ifxperformanceEndundefined
      performanceStart
      elseifxperformanceEndempty
      performanceStart
      else
      performanceStart -- performanceEnd
      fifi


      You can also declare a boolean ifperformanceEnd by



      newififperformanceEnd


      anywhere in the preamble and check performanceEnd with



      performanceEndfalse
      ifxperformanceEndundefinedelse
      ifxperformanceEndemptyelse
      performanceEndtrue
      fifi


      then you can write



      ifperformanceEnd
      performanceStart -- performanceEnd
      else
      performanceStart
      fi


      or even



      performanceStartifperformanceEnd -- performanceEndfi





      share|improve this answer





























        4














        The correct way to write your test is



        ifxperformanceEndundefined
        performanceStart
        elseifxperformanceEndempty
        performanceStart
        else
        performanceStart -- performanceEnd
        fifi


        You can also declare a boolean ifperformanceEnd by



        newififperformanceEnd


        anywhere in the preamble and check performanceEnd with



        performanceEndfalse
        ifxperformanceEndundefinedelse
        ifxperformanceEndemptyelse
        performanceEndtrue
        fifi


        then you can write



        ifperformanceEnd
        performanceStart -- performanceEnd
        else
        performanceStart
        fi


        or even



        performanceStartifperformanceEnd -- performanceEndfi





        share|improve this answer



























          4












          4








          4







          The correct way to write your test is



          ifxperformanceEndundefined
          performanceStart
          elseifxperformanceEndempty
          performanceStart
          else
          performanceStart -- performanceEnd
          fifi


          You can also declare a boolean ifperformanceEnd by



          newififperformanceEnd


          anywhere in the preamble and check performanceEnd with



          performanceEndfalse
          ifxperformanceEndundefinedelse
          ifxperformanceEndemptyelse
          performanceEndtrue
          fifi


          then you can write



          ifperformanceEnd
          performanceStart -- performanceEnd
          else
          performanceStart
          fi


          or even



          performanceStartifperformanceEnd -- performanceEndfi





          share|improve this answer















          The correct way to write your test is



          ifxperformanceEndundefined
          performanceStart
          elseifxperformanceEndempty
          performanceStart
          else
          performanceStart -- performanceEnd
          fifi


          You can also declare a boolean ifperformanceEnd by



          newififperformanceEnd


          anywhere in the preamble and check performanceEnd with



          performanceEndfalse
          ifxperformanceEndundefinedelse
          ifxperformanceEndemptyelse
          performanceEndtrue
          fifi


          then you can write



          ifperformanceEnd
          performanceStart -- performanceEnd
          else
          performanceStart
          fi


          or even



          performanceStartifperformanceEnd -- performanceEndfi






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 4 at 17:39

























          answered Feb 4 at 16:49









          Eric DomenjoudEric Domenjoud

          94329




          94329





















              3














              Okay, here we go: as already pointed out by @eric-domenjoud you can use ifx to build the variations of text you need. BTW think about adding an "seit " to make clear that the performance time is not over.



              I corrected in the following code the wrong written variables performaceStart and performaceEnd to the correct one performanceStart and performanceEnd in the complete following code.



              As we did in your last question we once again have to change the code for command location like:



              setkomavarlocation%
              \[baselineskip] \[baselineskip]
              flushrightsmall invoicenr invoiceReference\[5pt]
              customernr\
              customerNumber\[5pt]
              performanceDuration\
              ifxperformanceEndundefined % <=======================================
              performanceStart
              elseifxperformanceEndempty
              performanceStart
              else
              performanceStart -- performanceEnd
              fifi % <==============================================================



              Then we get with the following code (you need to use all files in the question linked zip file to be able to compile it!)



               documentclass[a4paper]scrlttr2

              usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]geometry
              usepackagegraphicx
              usepackagelmodern
              usepackage[utf8]inputenc
              usepackage[T1]fontenc
              usepackage[ngerman]babel
              usepackagecolor
              usepackage[hidelinks]hyperref
              %usepackage ifthen

              usepackage[german]invoice

              %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
              makeatletter
              defUnitDayPreis/Tag% <========================================

              newcommandFeeDay@Title% <==========================================
              \
              noindenttextbfActivity&&UnitDay&Count&Amount (BC)\
              hline%
              %

              newcommandFeeDay[3]% Yields state 3, Print Fee Item <==============
              %
              % #1 Contents
              % #2 Fee per Day
              % #3 Unit Count
              %
              ifcaseFlag % 0: Invoice not started yet
              error@messageMissingOpening%
              %
              %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
              or % 1: Start invoice
              %
              error@messageMissingProject%
              %
              %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
              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@messageFeeSTExists%
              %
              %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
              or % 5: Expense item
              %
              error@messageFeeBeforeExpense%
              %
              %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
              or % 6: Print subtotal expenses
              %
              error@messageFeeBeforeExpense%
              %
              %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
              or % 7: Print subtotal project
              %
              error@messageProjectCompletedNoFee%
              %
              %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
              or % 8: Print total, close invoice
              %
              error@messageInvoiceCompletedNoFee%
              %
              %
              else error@messageInternalError%
              fi%
              %
              makeatother


              renewcommandfamilydefaultsfdefault

              % include meta data
              include_data % <============== delete in this file the following data!
              % ################## invoice DATA ##################
              newcommandinvoiceDatetoday % Datum der rechnungsstellung
              newcommandinvoiceReference2019_01_01_1 % Rechnungsnummer (z.B. 20150122-4) YYYYMMDD-1
              newcommandinvoiceSalutationSehr geehrte Damen und Herren, % die Anrede
              newcommandinvoiceTextFolgende Positionen werden in Rechnung gestellt: % Rechnungstext
              newcommandinvoiceEnclosures % encl einfügen
              newcommandinvoiceClosingMit freundlichen Grüßen
              % ################## invoice DATA ##################


              % ##################Job DATA ####################
              def performanceStart 01.01.2019
              %def performanceEnd 02.01.2019
              % ##################Job DATA ####################


              % ################## Customer DATA ##################
              newcommandcustomerCompanyFirma ABC %ggf. Firma
              newcommandcustomerNameMax Mustermann % Name
              newcommandcustomerStreetMusterstraße 10 % Straße
              newcommandcustomerZIP12345 % Postleitzahl
              newcommandcustomerCityMusterort % Ort
              newcommandcustomerNumber1000 % Kundennummer <==================
              % ################## Customer DATA ##################

              setkomavarfromnamesenderName
              setkomavarfromaddresssenderStreet \ senderZIP senderCity
              setkomavarplacesenderCity
              setkomavardateinvoiceDate
              setkomavarfromphonesenderTelephone
              setkomavarfrommobilephonesenderMobilephone
              setkomavarfromemailhrefmailto:senderEmailnolinkurlsenderEmail
              setkomavarsubjectRechnung

              def invoicenrRechnungsnummer: % <========================================
              def customernrKundennummer: %
              def performanceDurationLeistungszeitraum:

              setkomavarlocation%
              \[baselineskip] \[baselineskip]
              flushrightsmall invoicenr invoiceReference\[5pt]
              customernr\
              customerNumber\[5pt]
              performanceDuration\
              ifxperformanceEndundefined % <=======================================
              performanceStart
              elseifxperformanceEndempty
              performanceStart
              else
              performanceStart -- performanceEnd
              fifi % <==============================================================



              setkomavarfirstheadhfill
              parbox[t][headheight][t]7.3cm%
              footnotesize
              raggedright
              flushright
              color[gray].3%
              begintabularrl
              Anschrift & usekomavarfromname\
              & senderStreet\
              & senderZIP senderCity \
              \
              %Telefon Telefon: ` senderTelephone \
              Mobil & usekomavarfrommobilephone \
              E-Mail & usekomavarfromemail \
              %Webseite & normalfontttfamily senderWeb \
              \
              Steuernummer & taxID \
              \
              Institut & accountBankName \
              IBAN & accountIBAN \
              BIC & accountBIC
              endtabular
              %



              begindocument
              beginlettercustomerCompany \ customerName \
              customerStreet \ customerZIP customerCity


              openinginvoiceSalutation
              invoiceText
              begininvoiceEuro0

              ProjectTitleTagesleistungen %
              FeeDayFreelance Arbeit 10 1

              ProjectTitleProjekttitel %
              FeeÜberstunden 20 1



              % Auslagen
              %EBCHotel, 12 Nächte 2400.00 % EBCiHotel, 12 Nächte 2400.00
              %STExpenses

              % Rabatt
              DiscountRabatt 0 %
              endinvoice
              ps Bitte zahlen Sie den Gesamtbetrag unter Angabe der Rechnungsnummer auf das aufgeführte Konto.
              ps Kleinunternehmerregelung:\
              Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
              enthalten.

              closinginvoiceClosing
              invoiceEnclosures



              endletter
              enddocument


              the following result (see that I commented definition of performanceEnd):



              resulting pdf



              If you want to add "seit " as remarked at the beginning of this answer you can use



              setkomavarlocation%
              \[baselineskip] \[baselineskip]
              flushrightsmall invoicenr invoiceReference\[5pt]
              customernr\
              customerNumber\[5pt]
              performanceDuration\
              ifxperformanceEndundefined % <=======================================
              seit performanceStart
              elseifxperformanceEndempty
              seit performanceStart
              else
              performanceStart -- performanceEnd
              fifi % <==============================================================



              with the result:



              enter image description here






              share|improve this answer



























                3














                Okay, here we go: as already pointed out by @eric-domenjoud you can use ifx to build the variations of text you need. BTW think about adding an "seit " to make clear that the performance time is not over.



                I corrected in the following code the wrong written variables performaceStart and performaceEnd to the correct one performanceStart and performanceEnd in the complete following code.



                As we did in your last question we once again have to change the code for command location like:



                setkomavarlocation%
                \[baselineskip] \[baselineskip]
                flushrightsmall invoicenr invoiceReference\[5pt]
                customernr\
                customerNumber\[5pt]
                performanceDuration\
                ifxperformanceEndundefined % <=======================================
                performanceStart
                elseifxperformanceEndempty
                performanceStart
                else
                performanceStart -- performanceEnd
                fifi % <==============================================================



                Then we get with the following code (you need to use all files in the question linked zip file to be able to compile it!)



                 documentclass[a4paper]scrlttr2

                usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]geometry
                usepackagegraphicx
                usepackagelmodern
                usepackage[utf8]inputenc
                usepackage[T1]fontenc
                usepackage[ngerman]babel
                usepackagecolor
                usepackage[hidelinks]hyperref
                %usepackage ifthen

                usepackage[german]invoice

                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                makeatletter
                defUnitDayPreis/Tag% <========================================

                newcommandFeeDay@Title% <==========================================
                \
                noindenttextbfActivity&&UnitDay&Count&Amount (BC)\
                hline%
                %

                newcommandFeeDay[3]% Yields state 3, Print Fee Item <==============
                %
                % #1 Contents
                % #2 Fee per Day
                % #3 Unit Count
                %
                ifcaseFlag % 0: Invoice not started yet
                error@messageMissingOpening%
                %
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                or % 1: Start invoice
                %
                error@messageMissingProject%
                %
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                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@messageFeeSTExists%
                %
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                or % 5: Expense item
                %
                error@messageFeeBeforeExpense%
                %
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                or % 6: Print subtotal expenses
                %
                error@messageFeeBeforeExpense%
                %
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                or % 7: Print subtotal project
                %
                error@messageProjectCompletedNoFee%
                %
                %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                or % 8: Print total, close invoice
                %
                error@messageInvoiceCompletedNoFee%
                %
                %
                else error@messageInternalError%
                fi%
                %
                makeatother


                renewcommandfamilydefaultsfdefault

                % include meta data
                include_data % <============== delete in this file the following data!
                % ################## invoice DATA ##################
                newcommandinvoiceDatetoday % Datum der rechnungsstellung
                newcommandinvoiceReference2019_01_01_1 % Rechnungsnummer (z.B. 20150122-4) YYYYMMDD-1
                newcommandinvoiceSalutationSehr geehrte Damen und Herren, % die Anrede
                newcommandinvoiceTextFolgende Positionen werden in Rechnung gestellt: % Rechnungstext
                newcommandinvoiceEnclosures % encl einfügen
                newcommandinvoiceClosingMit freundlichen Grüßen
                % ################## invoice DATA ##################


                % ##################Job DATA ####################
                def performanceStart 01.01.2019
                %def performanceEnd 02.01.2019
                % ##################Job DATA ####################


                % ################## Customer DATA ##################
                newcommandcustomerCompanyFirma ABC %ggf. Firma
                newcommandcustomerNameMax Mustermann % Name
                newcommandcustomerStreetMusterstraße 10 % Straße
                newcommandcustomerZIP12345 % Postleitzahl
                newcommandcustomerCityMusterort % Ort
                newcommandcustomerNumber1000 % Kundennummer <==================
                % ################## Customer DATA ##################

                setkomavarfromnamesenderName
                setkomavarfromaddresssenderStreet \ senderZIP senderCity
                setkomavarplacesenderCity
                setkomavardateinvoiceDate
                setkomavarfromphonesenderTelephone
                setkomavarfrommobilephonesenderMobilephone
                setkomavarfromemailhrefmailto:senderEmailnolinkurlsenderEmail
                setkomavarsubjectRechnung

                def invoicenrRechnungsnummer: % <========================================
                def customernrKundennummer: %
                def performanceDurationLeistungszeitraum:

                setkomavarlocation%
                \[baselineskip] \[baselineskip]
                flushrightsmall invoicenr invoiceReference\[5pt]
                customernr\
                customerNumber\[5pt]
                performanceDuration\
                ifxperformanceEndundefined % <=======================================
                performanceStart
                elseifxperformanceEndempty
                performanceStart
                else
                performanceStart -- performanceEnd
                fifi % <==============================================================



                setkomavarfirstheadhfill
                parbox[t][headheight][t]7.3cm%
                footnotesize
                raggedright
                flushright
                color[gray].3%
                begintabularrl
                Anschrift & usekomavarfromname\
                & senderStreet\
                & senderZIP senderCity \
                \
                %Telefon Telefon: ` senderTelephone \
                Mobil & usekomavarfrommobilephone \
                E-Mail & usekomavarfromemail \
                %Webseite & normalfontttfamily senderWeb \
                \
                Steuernummer & taxID \
                \
                Institut & accountBankName \
                IBAN & accountIBAN \
                BIC & accountBIC
                endtabular
                %



                begindocument
                beginlettercustomerCompany \ customerName \
                customerStreet \ customerZIP customerCity


                openinginvoiceSalutation
                invoiceText
                begininvoiceEuro0

                ProjectTitleTagesleistungen %
                FeeDayFreelance Arbeit 10 1

                ProjectTitleProjekttitel %
                FeeÜberstunden 20 1



                % Auslagen
                %EBCHotel, 12 Nächte 2400.00 % EBCiHotel, 12 Nächte 2400.00
                %STExpenses

                % Rabatt
                DiscountRabatt 0 %
                endinvoice
                ps Bitte zahlen Sie den Gesamtbetrag unter Angabe der Rechnungsnummer auf das aufgeführte Konto.
                ps Kleinunternehmerregelung:\
                Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
                enthalten.

                closinginvoiceClosing
                invoiceEnclosures



                endletter
                enddocument


                the following result (see that I commented definition of performanceEnd):



                resulting pdf



                If you want to add "seit " as remarked at the beginning of this answer you can use



                setkomavarlocation%
                \[baselineskip] \[baselineskip]
                flushrightsmall invoicenr invoiceReference\[5pt]
                customernr\
                customerNumber\[5pt]
                performanceDuration\
                ifxperformanceEndundefined % <=======================================
                seit performanceStart
                elseifxperformanceEndempty
                seit performanceStart
                else
                performanceStart -- performanceEnd
                fifi % <==============================================================



                with the result:



                enter image description here






                share|improve this answer

























                  3












                  3








                  3







                  Okay, here we go: as already pointed out by @eric-domenjoud you can use ifx to build the variations of text you need. BTW think about adding an "seit " to make clear that the performance time is not over.



                  I corrected in the following code the wrong written variables performaceStart and performaceEnd to the correct one performanceStart and performanceEnd in the complete following code.



                  As we did in your last question we once again have to change the code for command location like:



                  setkomavarlocation%
                  \[baselineskip] \[baselineskip]
                  flushrightsmall invoicenr invoiceReference\[5pt]
                  customernr\
                  customerNumber\[5pt]
                  performanceDuration\
                  ifxperformanceEndundefined % <=======================================
                  performanceStart
                  elseifxperformanceEndempty
                  performanceStart
                  else
                  performanceStart -- performanceEnd
                  fifi % <==============================================================



                  Then we get with the following code (you need to use all files in the question linked zip file to be able to compile it!)



                   documentclass[a4paper]scrlttr2

                  usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]geometry
                  usepackagegraphicx
                  usepackagelmodern
                  usepackage[utf8]inputenc
                  usepackage[T1]fontenc
                  usepackage[ngerman]babel
                  usepackagecolor
                  usepackage[hidelinks]hyperref
                  %usepackage ifthen

                  usepackage[german]invoice

                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  makeatletter
                  defUnitDayPreis/Tag% <========================================

                  newcommandFeeDay@Title% <==========================================
                  \
                  noindenttextbfActivity&&UnitDay&Count&Amount (BC)\
                  hline%
                  %

                  newcommandFeeDay[3]% Yields state 3, Print Fee Item <==============
                  %
                  % #1 Contents
                  % #2 Fee per Day
                  % #3 Unit Count
                  %
                  ifcaseFlag % 0: Invoice not started yet
                  error@messageMissingOpening%
                  %
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  or % 1: Start invoice
                  %
                  error@messageMissingProject%
                  %
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  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@messageFeeSTExists%
                  %
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  or % 5: Expense item
                  %
                  error@messageFeeBeforeExpense%
                  %
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  or % 6: Print subtotal expenses
                  %
                  error@messageFeeBeforeExpense%
                  %
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  or % 7: Print subtotal project
                  %
                  error@messageProjectCompletedNoFee%
                  %
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  or % 8: Print total, close invoice
                  %
                  error@messageInvoiceCompletedNoFee%
                  %
                  %
                  else error@messageInternalError%
                  fi%
                  %
                  makeatother


                  renewcommandfamilydefaultsfdefault

                  % include meta data
                  include_data % <============== delete in this file the following data!
                  % ################## invoice DATA ##################
                  newcommandinvoiceDatetoday % Datum der rechnungsstellung
                  newcommandinvoiceReference2019_01_01_1 % Rechnungsnummer (z.B. 20150122-4) YYYYMMDD-1
                  newcommandinvoiceSalutationSehr geehrte Damen und Herren, % die Anrede
                  newcommandinvoiceTextFolgende Positionen werden in Rechnung gestellt: % Rechnungstext
                  newcommandinvoiceEnclosures % encl einfügen
                  newcommandinvoiceClosingMit freundlichen Grüßen
                  % ################## invoice DATA ##################


                  % ##################Job DATA ####################
                  def performanceStart 01.01.2019
                  %def performanceEnd 02.01.2019
                  % ##################Job DATA ####################


                  % ################## Customer DATA ##################
                  newcommandcustomerCompanyFirma ABC %ggf. Firma
                  newcommandcustomerNameMax Mustermann % Name
                  newcommandcustomerStreetMusterstraße 10 % Straße
                  newcommandcustomerZIP12345 % Postleitzahl
                  newcommandcustomerCityMusterort % Ort
                  newcommandcustomerNumber1000 % Kundennummer <==================
                  % ################## Customer DATA ##################

                  setkomavarfromnamesenderName
                  setkomavarfromaddresssenderStreet \ senderZIP senderCity
                  setkomavarplacesenderCity
                  setkomavardateinvoiceDate
                  setkomavarfromphonesenderTelephone
                  setkomavarfrommobilephonesenderMobilephone
                  setkomavarfromemailhrefmailto:senderEmailnolinkurlsenderEmail
                  setkomavarsubjectRechnung

                  def invoicenrRechnungsnummer: % <========================================
                  def customernrKundennummer: %
                  def performanceDurationLeistungszeitraum:

                  setkomavarlocation%
                  \[baselineskip] \[baselineskip]
                  flushrightsmall invoicenr invoiceReference\[5pt]
                  customernr\
                  customerNumber\[5pt]
                  performanceDuration\
                  ifxperformanceEndundefined % <=======================================
                  performanceStart
                  elseifxperformanceEndempty
                  performanceStart
                  else
                  performanceStart -- performanceEnd
                  fifi % <==============================================================



                  setkomavarfirstheadhfill
                  parbox[t][headheight][t]7.3cm%
                  footnotesize
                  raggedright
                  flushright
                  color[gray].3%
                  begintabularrl
                  Anschrift & usekomavarfromname\
                  & senderStreet\
                  & senderZIP senderCity \
                  \
                  %Telefon Telefon: ` senderTelephone \
                  Mobil & usekomavarfrommobilephone \
                  E-Mail & usekomavarfromemail \
                  %Webseite & normalfontttfamily senderWeb \
                  \
                  Steuernummer & taxID \
                  \
                  Institut & accountBankName \
                  IBAN & accountIBAN \
                  BIC & accountBIC
                  endtabular
                  %



                  begindocument
                  beginlettercustomerCompany \ customerName \
                  customerStreet \ customerZIP customerCity


                  openinginvoiceSalutation
                  invoiceText
                  begininvoiceEuro0

                  ProjectTitleTagesleistungen %
                  FeeDayFreelance Arbeit 10 1

                  ProjectTitleProjekttitel %
                  FeeÜberstunden 20 1



                  % Auslagen
                  %EBCHotel, 12 Nächte 2400.00 % EBCiHotel, 12 Nächte 2400.00
                  %STExpenses

                  % Rabatt
                  DiscountRabatt 0 %
                  endinvoice
                  ps Bitte zahlen Sie den Gesamtbetrag unter Angabe der Rechnungsnummer auf das aufgeführte Konto.
                  ps Kleinunternehmerregelung:\
                  Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
                  enthalten.

                  closinginvoiceClosing
                  invoiceEnclosures



                  endletter
                  enddocument


                  the following result (see that I commented definition of performanceEnd):



                  resulting pdf



                  If you want to add "seit " as remarked at the beginning of this answer you can use



                  setkomavarlocation%
                  \[baselineskip] \[baselineskip]
                  flushrightsmall invoicenr invoiceReference\[5pt]
                  customernr\
                  customerNumber\[5pt]
                  performanceDuration\
                  ifxperformanceEndundefined % <=======================================
                  seit performanceStart
                  elseifxperformanceEndempty
                  seit performanceStart
                  else
                  performanceStart -- performanceEnd
                  fifi % <==============================================================



                  with the result:



                  enter image description here






                  share|improve this answer













                  Okay, here we go: as already pointed out by @eric-domenjoud you can use ifx to build the variations of text you need. BTW think about adding an "seit " to make clear that the performance time is not over.



                  I corrected in the following code the wrong written variables performaceStart and performaceEnd to the correct one performanceStart and performanceEnd in the complete following code.



                  As we did in your last question we once again have to change the code for command location like:



                  setkomavarlocation%
                  \[baselineskip] \[baselineskip]
                  flushrightsmall invoicenr invoiceReference\[5pt]
                  customernr\
                  customerNumber\[5pt]
                  performanceDuration\
                  ifxperformanceEndundefined % <=======================================
                  performanceStart
                  elseifxperformanceEndempty
                  performanceStart
                  else
                  performanceStart -- performanceEnd
                  fifi % <==============================================================



                  Then we get with the following code (you need to use all files in the question linked zip file to be able to compile it!)



                   documentclass[a4paper]scrlttr2

                  usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]geometry
                  usepackagegraphicx
                  usepackagelmodern
                  usepackage[utf8]inputenc
                  usepackage[T1]fontenc
                  usepackage[ngerman]babel
                  usepackagecolor
                  usepackage[hidelinks]hyperref
                  %usepackage ifthen

                  usepackage[german]invoice

                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  makeatletter
                  defUnitDayPreis/Tag% <========================================

                  newcommandFeeDay@Title% <==========================================
                  \
                  noindenttextbfActivity&&UnitDay&Count&Amount (BC)\
                  hline%
                  %

                  newcommandFeeDay[3]% Yields state 3, Print Fee Item <==============
                  %
                  % #1 Contents
                  % #2 Fee per Day
                  % #3 Unit Count
                  %
                  ifcaseFlag % 0: Invoice not started yet
                  error@messageMissingOpening%
                  %
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  or % 1: Start invoice
                  %
                  error@messageMissingProject%
                  %
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  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@messageFeeSTExists%
                  %
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  or % 5: Expense item
                  %
                  error@messageFeeBeforeExpense%
                  %
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  or % 6: Print subtotal expenses
                  %
                  error@messageFeeBeforeExpense%
                  %
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  or % 7: Print subtotal project
                  %
                  error@messageProjectCompletedNoFee%
                  %
                  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
                  or % 8: Print total, close invoice
                  %
                  error@messageInvoiceCompletedNoFee%
                  %
                  %
                  else error@messageInternalError%
                  fi%
                  %
                  makeatother


                  renewcommandfamilydefaultsfdefault

                  % include meta data
                  include_data % <============== delete in this file the following data!
                  % ################## invoice DATA ##################
                  newcommandinvoiceDatetoday % Datum der rechnungsstellung
                  newcommandinvoiceReference2019_01_01_1 % Rechnungsnummer (z.B. 20150122-4) YYYYMMDD-1
                  newcommandinvoiceSalutationSehr geehrte Damen und Herren, % die Anrede
                  newcommandinvoiceTextFolgende Positionen werden in Rechnung gestellt: % Rechnungstext
                  newcommandinvoiceEnclosures % encl einfügen
                  newcommandinvoiceClosingMit freundlichen Grüßen
                  % ################## invoice DATA ##################


                  % ##################Job DATA ####################
                  def performanceStart 01.01.2019
                  %def performanceEnd 02.01.2019
                  % ##################Job DATA ####################


                  % ################## Customer DATA ##################
                  newcommandcustomerCompanyFirma ABC %ggf. Firma
                  newcommandcustomerNameMax Mustermann % Name
                  newcommandcustomerStreetMusterstraße 10 % Straße
                  newcommandcustomerZIP12345 % Postleitzahl
                  newcommandcustomerCityMusterort % Ort
                  newcommandcustomerNumber1000 % Kundennummer <==================
                  % ################## Customer DATA ##################

                  setkomavarfromnamesenderName
                  setkomavarfromaddresssenderStreet \ senderZIP senderCity
                  setkomavarplacesenderCity
                  setkomavardateinvoiceDate
                  setkomavarfromphonesenderTelephone
                  setkomavarfrommobilephonesenderMobilephone
                  setkomavarfromemailhrefmailto:senderEmailnolinkurlsenderEmail
                  setkomavarsubjectRechnung

                  def invoicenrRechnungsnummer: % <========================================
                  def customernrKundennummer: %
                  def performanceDurationLeistungszeitraum:

                  setkomavarlocation%
                  \[baselineskip] \[baselineskip]
                  flushrightsmall invoicenr invoiceReference\[5pt]
                  customernr\
                  customerNumber\[5pt]
                  performanceDuration\
                  ifxperformanceEndundefined % <=======================================
                  performanceStart
                  elseifxperformanceEndempty
                  performanceStart
                  else
                  performanceStart -- performanceEnd
                  fifi % <==============================================================



                  setkomavarfirstheadhfill
                  parbox[t][headheight][t]7.3cm%
                  footnotesize
                  raggedright
                  flushright
                  color[gray].3%
                  begintabularrl
                  Anschrift & usekomavarfromname\
                  & senderStreet\
                  & senderZIP senderCity \
                  \
                  %Telefon Telefon: ` senderTelephone \
                  Mobil & usekomavarfrommobilephone \
                  E-Mail & usekomavarfromemail \
                  %Webseite & normalfontttfamily senderWeb \
                  \
                  Steuernummer & taxID \
                  \
                  Institut & accountBankName \
                  IBAN & accountIBAN \
                  BIC & accountBIC
                  endtabular
                  %



                  begindocument
                  beginlettercustomerCompany \ customerName \
                  customerStreet \ customerZIP customerCity


                  openinginvoiceSalutation
                  invoiceText
                  begininvoiceEuro0

                  ProjectTitleTagesleistungen %
                  FeeDayFreelance Arbeit 10 1

                  ProjectTitleProjekttitel %
                  FeeÜberstunden 20 1



                  % Auslagen
                  %EBCHotel, 12 Nächte 2400.00 % EBCiHotel, 12 Nächte 2400.00
                  %STExpenses

                  % Rabatt
                  DiscountRabatt 0 %
                  endinvoice
                  ps Bitte zahlen Sie den Gesamtbetrag unter Angabe der Rechnungsnummer auf das aufgeführte Konto.
                  ps Kleinunternehmerregelung:\
                  Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
                  enthalten.

                  closinginvoiceClosing
                  invoiceEnclosures



                  endletter
                  enddocument


                  the following result (see that I commented definition of performanceEnd):



                  resulting pdf



                  If you want to add "seit " as remarked at the beginning of this answer you can use



                  setkomavarlocation%
                  \[baselineskip] \[baselineskip]
                  flushrightsmall invoicenr invoiceReference\[5pt]
                  customernr\
                  customerNumber\[5pt]
                  performanceDuration\
                  ifxperformanceEndundefined % <=======================================
                  seit performanceStart
                  elseifxperformanceEndempty
                  seit performanceStart
                  else
                  performanceStart -- performanceEnd
                  fifi % <==============================================================



                  with the result:



                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 4 at 17:37









                  KurtKurt

                  38.2k848162




                  38.2k848162



























                      draft saved

                      draft discarded
















































                      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%2f473330%2fproper-if-statement%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

                      Peggy Mitchell

                      Palaiologos

                      The Forum (Inglewood, California)