如何修改发票中的列标题

如何修改发票中的列标题

在第一个发票表中,我想将“活动”更改为“描述”,并且只显示“总计”,而没有“费用总额”行。

在第二张发票表中,我想将“费用”更改为“帐号”,另一列应为“金额(美元)”,不包含“货币”、“金额”和“因素”。

\documentclass[a4paper]{letter}
\usepackage[a4paper,left=2cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{invoice}


\begin{document}
  \begin{letter}{}
    \opening{Invoice no. 1}

    My greeting
    \begin{invoice}{Dollar}{0}{9}
      \ProjectTitle{Example Project}%
      % Description    Rate/Unit   Count    Amount ()
      \Fee{Development} {3000.00} {1}

    \end{invoice}

    \begin{invoice}{Dollar}{0}{9}
      \ProjectTitle{Account number(s)}%
      % Account #      Amount (Dollar)
      \EBC{1273645923} {1000}
      \EBC{2734745394} {2000}      
    \end{invoice}


  \end{letter}
\end{document}

答案1

如果您打算对过时的软件包进行如此重大的更改,您也可以使用tabular类似方法自己编写发票:

在此处输入图片描述

\documentclass{article}
\usepackage{tabularx,booktabs,siunitx}

\sisetup{
  round-integer-to-decimal,
  round-mode = places,
  detect-weight = true,
  detect-inline-weight = text
}
\ExplSyntaxOn
\cs_new_eq:NN \calc \fp_eval:n
\ExplSyntaxOff

\setlength{\parindent}{0pt}
\begin{document}

\begin{center}
  \large\bfseries Example Project
\end{center}

\begin{tabularx}{\textwidth}{X r r r}
  \toprule
  \bfseries Activity & Rate/Unit & Count & Amount (Dollar) \\
  \midrule
  Development              & \num{3000} & 1 & \num{3000} \\
  \bottomrule
  \bfseries Total          &            &   & \bfseries\num{3000}
\end{tabularx}

\bigskip\bigskip

\begin{center}
  \large\bfseries Account number(s)
\end{center}

\bigskip

\begin{tabularx}{\textwidth}{X r}
  \toprule
  \bfseries Expense & Amount (Dollar) \\
  \midrule
  1273645923 & \num{1000} \\
  2734745394 & \num{2000} \\
  \bottomrule
  \bfseries Total & \bfseries\num{\calc{1000+2000}}
\end{tabularx}

\end{document}

更新提供的输出invoice需要逐字更改大量宏,这会导致序言中出现大量额外代码。这些代码最好用完全符合您需求、外观整洁且易于更新的代码替换。

原始输出如下invoice

在此处输入图片描述

答案2

这是你想要的吗?

\documentclass[a4paper]{letter}
\usepackage[a4paper,left=2cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}
\usepackage{invoice}

\renewcommand{\Activity}{Description}
\renewcommand{\Expense}{Account \#}
\renewcommand{\Amount}{}
\renewcommand{\Factor}{}

\begin{document}
  \begin{letter}{}
    \opening{Invoice no. 1}

    My greeting


    \begin{invoice}{Dollar}{0}
      \ProjectTitle{Example Project}%
      % Description    Rate/Unit   Count    Amount ()
      \Fee{Development} {3000.00} {1}

    \end{invoice}


    \begin{invoice}{Dollar}{0}
      \ProjectTitle{Account number(s)}%
      % Account #      Amount (Dollar)
      \EBC{1273645923} {1000}
      \EBC{2734745394} {2000}      
    \end{invoice}


  \end{letter}
\end{document}

生成:

发票图片

请注意,invoice环境只有两个参数。我不确定你是否有意为之,但你的代码产生了一个虚假的 9

\begin{invoice}{Dollar}{0}{9} 

相关内容