从发票中删除小计

从发票中删除小计

我正在尝试使用发票包创建发票,但遇到了问题。在某些情况下,我只有一个项目,但有多个费用。这会创建一个相当丑陋的文档,其末尾是费用的小计、项目的小计(两者完全相同)、费用总和(再次与之前相同)然后是总额。有没有办法摆脱所有这些小计?

\documentclass[11pt]{letter}
 \usepackage{invoice}
 \address{123 derp }
 \signature{D}
 \date{10-10-2012}
 \begin{document}
  \begin{letter}{ }
   \opening{Invoice no. }
    \begin{invoice}{USD}{0}
     \ProjectTitle{}
       \Fee{herp} {50} {2}
       \Fee{derp}{50}{5}
       \hline
    \end{invoice}
   \end{letter}
 \end{document}

(也对这些愚蠢的标签表示抱歉。除了发票以外,我不知道该把它归类到哪里,而且我也没有代表来为它创建标签)

答案1

虽然我对任何此类软件包都不熟悉,但我快速浏览了软件包文档和代码,invoice我相信没有“内置”机制可以做到这一点。但是,我想出了一个快速破解方法(基于当前版本,invoice.sty容易被破坏),它只是省略了打印这些小计(但仍会计算它们)。我不太确定这样的结果解决方案是否可以接受,或者您是否仍希望在小计确实有意义时获得它们?(后者是可能的,但更复杂。)

因此,这就是破解方法(我为它的丑陋而道歉),我还应该添加免责声明,虽然我认为它不会改变计算,但您也应该说服自己这一点:

\documentclass[11pt]{letter}
 \usepackage{invoice}
\makeatletter
\renewcommand{\Print@ST@Fees}{%
    \gdef\Flag{4}%
    %\SubtotalFee & &   &   &%  print the subtotal of fees
    %   \Print@Value{\theST@Fee}\\%
}%
\renewcommand{\ST@Project}{%
    \gdef\Flag{7}%
    \\
    %\SubtotalProject & &   &   & 
            \addtocounter{ST@Project}{\theST@Fee}%
            \addtocounter{ST@Project}{\theST@VAT}%
            \addtocounter{ST@Project}{\theST@Expenses}%
    %       \Print@Value{\theST@Project}\\
}
\renewcommand{\Tot@l}{%
    \\\hline
    \ifnum\theFee>0 %\SumFees&  &   &   &%
                %\Print@Value{\theFee}\\ 
        \ifVATnonzero%
            \Total@VAT@Printout%
        \fi%
    \fi%
    \ifnum\theExpenses>0 \SumExpenses&  &   &   &%
                \Print@Value{\theExpenses}\\ 
    \fi%
    \ifnum\theDiscount<0 \Discount@Contents&    &   &   &%
                \Print@Value{\theDiscount}\\ 
    \fi%
    \hline\hline
    \textbf{\Total} &   &   &   &%
        \message{^^J\Currency: \BC}%
        \message{^^J\VAT: \VAT@rate}%
        \addtocounter{Total}{\theFee}%
        \message{^^J\SumFees: }\Message@Value{\theFee}%
        \addtocounter{Total}{\theVAT}%
        \message{^^J\SumVAT: }\Message@Value{\theVAT}%
        \addtocounter{Total}{\theExpenses}%
        \message{^^J\SumExpenses: }\Message@Value{\theExpenses}%
        \ifnum\theDiscount<0 %
        \addtocounter{Total}{\theDiscount}%
        \message{^^J\Discount@Contents: }\Message@Value{\theDiscount}%
        \fi %
        \textbf{\Print@Value{\theTotal}}%
        \message{^^J\Total: }%
            \Message@Value{\theTotal}\message{^^J^^J}\\%
    \end{longtable}
    %\end{center}% Removed 20050621 by suggestion from ...
    \gdef\Flag{8}%
}
\makeatother

 \address{123 derp }
 \signature{D}
 \date{10-10-2012}
 \begin{document}
  \begin{letter}{ }
   \opening{Invoice no. }
    \begin{invoice}{USD}{0}
     \ProjectTitle{}
       \Fee{herp} {50} {2}
       \Fee{derp}{50}{5}
       \hline
    \end{invoice}
   \end{letter}
 \end{document}

如果您发现这个答案不能令人满意,请查看其他人能够提供的答案和/或考虑联系软件包维护者。

相关内容