2

I would like to change the custom description in the invoice class with custom description in greek.

Problems:

  1. I could change some english descriptions that are in english but I can't change the table description.
  2. Change the $ to euro.

Is there any way to change all that? Thank you for your answers in advance.

\documentclass{invoice} 

\usepackage[english,greek]{babel}

\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}

\def \tab {\hspace*{3ex}} 

\begin{document}

\hfil{\Huge\bf Οδοντιατρείο Πέτρου Μουρούζη}\hfil 
\bigskip\break
\hrule 

Κ.Καραμανλή 77 \hfill (2310) 911-890 \\ 
Θεσσαλονίκη, 54642 \hfill \selectlanguage{english}{mr.mourouzis@gmail.com}
\\ \\
\selectlanguage{greek}
{\bf Οικονομική ανάλυση εργασιών:} \\
\tab Αθανάσιος \\ 
\tab  \\ 
{\bf Ημερομηνία:} \\
\tab \today \\ 
\selectlanguage{english}

\begin{invoiceTable}

\selectlanguage{greek}

\feetype{Οδοντιατρικές εργασίες} 

\selectlanguage{greek}

\hourrow{Ολοκεραμική γέφυρα, 25-26-27}{1}{750}

\selectlanguage{greek}

\hourrow{Ολοκεραμική γέφυρα, 16-15-14}{1}{750}

\selectlanguage{greek}

\hourrow{Ολοκεραμικές στεφάνες, 36-37-47}{3}{250}

\selectlanguage{greek}

\hourrow{Ολοκεραμική στεφάνη σε εμφύτευμα, 46}{1}{350}


\selectlanguage{greek}

\feetype{Προσωρινές αποκαταστάσεις} 

\selectlanguage{greek}

\hourrow{Ολοκεραμική γέφυρα, 25-26-27}{1}{80}

\selectlanguage{greek}

\hourrow{Ολοκεραμική γέφυρα, 16-15-14}{1}{80}

\selectlanguage{greek}

\hourrow{Ολοκεραμικές στεφάνες, 36-37-47}{3}{50}

\selectlanguage{greek}

\hourrow{Ολοκεραμική στεφάνη σε εμφύτευμα 46}{1}{80}

\subtotal 



\feetype{Expenses} 

\feerow{Web Hosting: October, 2012}{60} 

\end{invoiceTable}



\end{document}
1

Because I do not speak greek I can only show you where to change the english words to greek. The translation please do yourselve.

Please have a look into the following MWe. I added there an Greek: where you have to translate the following english text, for example:

        {\bf Greek:Subtotal} & {\bf \total{subhours} hours} &  & {\bf \$\total{subcost}}
%            ^^^^^^^^^^^^^^

shows you to translate Subtotal.

To get the euro symbol into the the invoice add the two lines

\usepackage{eurosym} % <================================================
\renewcommand{\$}{\euro} % <============================================

to the code.

With the complete MWE

\documentclass{invoice} 

\usepackage[english,greek]{babel}

\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}
\usepackage{eurosym} % <================================================

\def \tab {\hspace*{3ex}} 
\renewcommand{\$}{\euro} % <============================================


\makeatletter
\renewenvironment{invoiceTable}{
    % Create a new row from title, unit quantity, unit rate, and unit name
    \newcommand*{\unitrow}[4]{%
         \addtocounter{cost}{1000 * \real{##2} * \real{##3}}%
         \addtocounter{subcost}{1000 * \real{##2} * \real{##3}}%
         ##1 & \formatNumber{##2} ##4 & \$\formatNumber{##3} & \$\FPmul{\cost}{##2}{##3}\formatNumber{\cost}%
         \\
    }
    % Create a new row from title and expense amount
    \newcommand*{\feerow}[2]{%
         \addtocounter{cost}{1000 * \real{##2}}%
         \addtocounter{subcost}{1000 * \real{##2}}%
         ##1 & & \$\formatNumber{##2} & \$\FPmul{\cost}{##2}{1}\formatNumber{\cost}%
         \\
    }

    \newcommand{\subtotalNoStar}{
        {\bf Greek:Subtotal} & {\bf \total{subhours} hours} &  & {\bf \$\total{subcost}}  % <================================================
        \setcounter{subcost}{0}
        \setcounter{subhours}{0}
        \\*[1.5ex]
    }
    \newcommand{\subtotalStar}{
        {\bf Greek:Subtotal} & & & {\bf \$\total{subcost}} % <================================================
        \setcounter{subcost}{0}
        \\*[1.5ex]
    }
    \newcommand{\subtotal}{
         \hline
         \@ifstar
         \subtotalStar%
         \subtotalNoStar%
    }

    % Create a new row from date and hours worked (use stored fee type and hourly rate)
    \newcommand*{\hourrow}[3]{%
        \addtocounter{hours}{1000 * \real{##2}}%
        \addtocounter{subhours}{1000 * \real{##2}}%
        \unitrow{##1}{##2}{##3}{hours}%
    }
    \renewcommand{\tabcolsep}{0.8ex}
    \setlength\LTleft{0pt}
    \setlength\LTright{0pt}
    \begin{longtable}{@{\extracolsep{\fill}\hspace{\tabcolsep}} l r r r }
    \hline
    {\bf Greek:Description of Services} & \multicolumn{1}{c}{\bf Greek:Quantity} & \multicolumn{1}{c}{\bf Greek:Unit Price} & \multicolumn{1}{c}{\bf Greek:Amount} \\*  % <================================================
    \hline\hline
    \endhead
}{
    \hline\hline\hline
    {\bf Greek:Balance Due} & & & {\bf \$\total{cost}} \\ % <================================================
    \end{longtable}
}
\makeatother



\begin{document}

\hfil{\Huge\bf Οδοντιατρείο Πέτρου Μουρούζη}\hfil 
\bigskip\break
\hrule 

Κ.Καραμανλή 77 \hfill (2310) 911-890 \\ 
Θεσσαλονίκη, 54642 \hfill \selectlanguage{english}{mr.mourouzis@gmail.com}
\\ \\
\selectlanguage{greek}
{\bf Οικονομική ανάλυση εργασιών:} \\
\tab Αθανάσιος \\ 
\tab  \\ 
{\bf Ημερομηνία:} \\
\tab \today \\ 

\selectlanguage{english}
\begin{invoiceTable}

\selectlanguage{greek}

\feetype{Οδοντιατρικές εργασίες} 

\selectlanguage{greek}

\hourrow{Ολοκεραμική γέφυρα, 25-26-27}{1}{750}

\selectlanguage{greek}

\hourrow{Ολοκεραμική γέφυρα, 16-15-14}{1}{750}

\selectlanguage{greek}

\hourrow{Ολοκεραμικές στεφάνες, 36-37-47}{3}{250}

\selectlanguage{greek}

\hourrow{Ολοκεραμική στεφάνη σε εμφύτευμα, 46}{1}{350}


\selectlanguage{greek}

\feetype{Προσωρινές αποκαταστάσεις} 

\selectlanguage{greek}

\hourrow{Ολοκεραμική γέφυρα, 25-26-27}{1}{80}

\selectlanguage{greek}

\hourrow{Ολοκεραμική γέφυρα, 16-15-14}{1}{80}

\selectlanguage{greek}

\hourrow{Ολοκεραμικές στεφάνες, 36-37-47}{3}{50}

\selectlanguage{greek}

\hourrow{Ολοκεραμική στεφάνη σε εμφύτευμα 46}{1}{80}

\subtotal 



\feetype{Greek:Expenses}  % <================================================

\feerow{Greek:Web Hosting: October, 2012}{60}  % <================================================

\end{invoiceTable}



\end{document}

you get the result:

resulting pdf

With the changings mentioned in the comments you get the code:

\documentclass{invoice} 

\usepackage[english,greek]{babel}

\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}
\usepackage{eurosym} % <================================================

\def \tab {\hspace*{3ex}} 
\renewcommand{\$}{\euro} % <============================================


\makeatletter
\renewenvironment{invoiceTable}{
    % Create a new row from title, unit quantity, unit rate, and unit name
    \newcommand*{\unitrow}[4]{%
         \addtocounter{cost}{1000 * \real{##2} * \real{##3}}%
         \addtocounter{subcost}{1000 * \real{##2} * \real{##3}}%
         ##1 & \formatNumber{##2} ##4 & \$\formatNumber{##3} & \$\FPmul{\cost}{##2}{##3}\formatNumber{\cost}%
         \\
    }
    % Create a new row from title and expense amount
    \newcommand*{\feerow}[2]{%
         \addtocounter{cost}{1000 * \real{##2}}%
         \addtocounter{subcost}{1000 * \real{##2}}%
         ##1 & & \$\formatNumber{##2} & \$\FPmul{\cost}{##2}{1}\formatNumber{\cost}%
         \\
    }

    \newcommand{\subtotalNoStar}{%
        {\selectlanguage{greek}\textbf{ΤΕΛΙΚΟ ΠΟΣΟ}} & {\textbf{\total{subhours}}\selectlanguage{greek} \textbf{Greek:hours}} &  & {\bf \$\total{subcost}}% <================================================
        \setcounter{subcost}{0}%
        \setcounter{subhours}{0}%
        \\*[1.5ex]
    }
    \newcommand{\subtotalStar}{%
        {\bf Greek:Subtotal} & & & {\bf \$\total{subcost}}% <================================================
        \setcounter{subcost}{0}
        \\*[1.5ex]
    }
    \newcommand{\subtotal}{%
         \hline
         \@ifstar
         \subtotalStar%
         \subtotalNoStar%
    }

    % Create a new row from date and hours worked (use stored fee type and hourly rate)
    \newcommand*{\hourrow}[3]{%
        \addtocounter{hours}{1000 * \real{##2}}%
        \addtocounter{subhours}{1000 * \real{##2}}%
        \unitrow{##1}{##2}{##3}{\selectlanguage{greek} Greek:hours}%
    }
    \renewcommand{\tabcolsep}{0.8ex}
    \setlength\LTleft{0pt}
    \setlength\LTright{0pt}
    \begin{longtable}{@{\extracolsep{\fill}\hspace{\tabcolsep}} l r r r }
    \hline
    {\bf Greek:Description of Services} & \multicolumn{1}{c}{\bf Greek:Quantity} & \multicolumn{1}{c}{\bf Greek:Unit Price} & \multicolumn{1}{c}{\bf Greek:Amount} \\*  % <================================================
    \hline\hline
    \endhead
}{
    \hline\hline\hline
    {\bf Greek:Balance Due} & & & {\bf \$\total{cost}} \\ % <================================================
    \end{longtable}
}
\makeatother



\begin{document}

\hfil{\Huge\bf Οδοντιατρείο Πέτρου Μουρούζη}\hfil 
\bigskip\break
\hrule 

Κ.Καραμανλή 77 \hfill (2310) 911-890 \\ 
Θεσσαλονίκη, 54642 \hfill \selectlanguage{english}{mr.mourouzis@gmail.com}
\\ \\
\selectlanguage{greek}
{\bf Οικονομική ανάλυση εργασιών:} \\
\tab Αθανάσιος \\ 
\tab  \\ 
{\bf Ημερομηνία:} \\
\tab \today \\ 

\selectlanguage{english}
\begin{invoiceTable}

\selectlanguage{greek}

\feetype{Οδοντιατρικές εργασίες} 

\selectlanguage{greek}

\hourrow{Ολοκεραμική γέφυρα, 25-26-27}{1}{750}

\selectlanguage{greek}

\hourrow{Ολοκεραμική γέφυρα, 16-15-14}{1}{750}

\selectlanguage{greek}

\hourrow{Ολοκεραμικές στεφάνες, 36-37-47}{3}{250}

\selectlanguage{greek}

\hourrow{Ολοκεραμική στεφάνη σε εμφύτευμα, 46}{1}{350}


\selectlanguage{greek}

\feetype{Προσωρινές αποκαταστάσεις} 

\selectlanguage{greek}

\hourrow{Ολοκεραμική γέφυρα, 25-26-27}{1}{80}

\selectlanguage{greek}

\hourrow{Ολοκεραμική γέφυρα, 16-15-14}{1}{80}

\selectlanguage{greek}

\hourrow{Ολοκεραμικές στεφάνες, 36-37-47}{3}{50}

\selectlanguage{greek}

\hourrow{Ολοκεραμική στεφάνη σε εμφύτευμα 46}{1}{80}

\subtotal 



\feetype{Greek:Expenses}  % <================================================

\feerow{Greek:Web Hosting: October, 2012}{60}  % <================================================

\end{invoiceTable}



\end{document}

and the result:

enter image description here

Of course you have to translate to greek, then the table gets smaller again ...

  • Thank yo for your answer, I did what you told me but I get errors when I write in Greek. For example } \newcommand{\subtotalNoStar}{ {\textbf ΤΕΛΙΚΟ ΠΟΣΟ} & {\bf \total{subhours} hours} & & {\bf \$\total{subcost}} % <================================================ \setcounter{subcost}{0} \setcounter{subhours}{0} \*[1.5ex] } – Petros Mourouzis Mar 9 at 8:38
  • ΟΚ.that work fine. One final question, could you tell me how to remove "hours" under "Quantity"? Thank you – Petros Mourouzis Mar 9 at 11:22
0

To change the currency you could adapt this answer and add the following:

\renewcommand{\$}{\euro}.

Why do you do \selectlanguage{english} all the time, for example before \begin{invoiceTable}?

  • thank you, I tried to use \foreignlanguage but there were a lot of issues. When i tried \selectlanguage{english} I didn't have any errors. I put the \renewcommand{\$}{\euro} in the preamble and i got errors with the default table of the invoice. If i use \renewcommand{\$}{\pounds} the $ changes to pounds – Petros Mourouzis Mar 8 at 12:23
  • I put \usepackage{eurosym} and everything is alright, but I can't change the default titles from the default invoice template to greek titles. – Petros Mourouzis Mar 8 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.