我不知道在哪里,但是下面的代码总是按小时计费,有时我按天付费,而不是按小时付费,有没有办法改变这种情况?
这是存储库的链接: https://github.com/d-koppenhagen/latex-rechnung我在用着。
有人能提供解决方案吗?当我一天的工作获得报酬,但需要加班并想向他们收费。
% koma_env.tex
\documentclass[a4paper]{scrlttr2}
\usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{color}
\usepackage[hidelinks]{hyperref}
\usepackage[german]{invoice}
\renewcommand{\familydefault}{\sfdefault}
% include meta data
\include{_data}
% ################## invoice DATA ##################
\newcommand{\invoiceDate}{\today} % Datum der rechnungsstellung, change `\today' to a different date, if you do not want to use todays date
\newcommand{\payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
\newcommand{\invoiceReference}{YYYYMMDD-1} % Rechnungsnummer (z.B. 20150122-4)
\newcommand{\invoiceSalutation}{} % die Anrede
\newcommand{\invoiceText}{Folgende Positionen werden in Rechnung gestellt:} % Rechnungstext
\newcommand{\invoiceEnclosures}{} % \encl{} einfügen
\newcommand{\invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
\newcommand{\customerCompany}{Firma XYZ} %ggf. Firma
\newcommand{\customerName}{Max Mustermann} % Name
\newcommand{\customerStreet}{Robert-Koch-Str. 12} % Straße
\newcommand{\customerZIP}{12345} % Postleitzahl
\newcommand{\customerCity}{Musterstadt} % Ort
% ################## Customer DATA ##################
\setkomavar{fromname}{\senderName}
\setkomavar{fromaddress}{\senderStreet \\ \senderZIP \ \senderCity}
\setkomavar{place}{\senderCity}
\setkomavar{date}{\invoiceDate}
\setkomavar{fromphone}{\senderTelephone}
\setkomavar{frommobilephone}{\senderMobilephone}
\setkomavar{fromemail}{\href{mailto:\senderEmail}{\nolinkurl{\senderEmail}}}
\setkomavar{subject}{Rechnung}
\setkomavar{location}{
\\[\baselineskip] \\[\baselineskip]
\flushright \small {\vspace{1cm}Rechnungsnummer:
\invoiceReference}
}
\setkomavar{firsthead}{\hfill
\parbox[t][\headheight][t]{7.2cm}{% <================================== 6cm
\footnotesize
\raggedright
\flushright
\color[gray]{.3}%
\begin{tabular}{rl}
Anschrift & \usekomavar{fromname}\\
& \senderStreet\\
& \senderZIP \ \senderCity \\
\\
%\Telefon \ Telefon: \` \senderTelephone \\
Mobil & \usekomavar{frommobilephone} \\
E-Mail & \usekomavar{fromemail} \\
Webseite & {\normalfont\ttfamily \senderWeb } \\
\\
Steuernummer & \taxID \\
\\
Institut & \accountBankName \\
IBAN & \accountIBAN \\
BIC & \accountBIC
\end{tabular}
}%
}
\begin{document}
\begin{letter}{\customerCompany \\ \customerName \\
\customerStreet \\ \customerZIP \ \customerCity}
\includegraphics[width=0.15\textwidth]{logo.png}
\opening{\invoiceSalutation}
\invoiceText
\begin{invoice}{Euro}{0}
\ProjectTitle{Projekttitel} % <=========================================
\Fee{Musterdienstleistung 1}{30.00}{4}
\Fee{Musterdienstleistung 2}{36.00}{7}
% Auslagen
%\EBCi{Hotel, 12 Nächte} {2400.00}
%\STExpenses
% Rabatt
\Discount{Rabatt} {20} % <==============================================
\end{invoice}
\ps Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
enthalten.
\closing{\invoiceClosing}
\invoiceEnclosures
\end{letter}
\end{document}
答案1
invoice
那么您需要使用以下代码来扩展文档序言中的样式:
\makeatletter
\def\UnitDay {Preis/Tag}% <========================================
\newcommand{\FeeDay@Title}{% <==========================================
\\
\noindent\textbf{\Activity}&&\UnitDay&\Count&\Amount\ (\BC)\\
\hline%
}%
\newcommand{\FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
\ifcase\Flag % 0: Invoice not started yet
\error@message{\MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 1: Start invoice
%
\error@message{\MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 2: Start project, print title
%
\FeeDay@Title%
\Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 3: Print remuneration item
%
\Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 4: Print subtotal remuneration
%
\warning@message{\FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 5: Expense item
%
\error@message{\FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 6: Print subtotal expenses
%
\error@message{\FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 7: Print subtotal project
%
\error@message{\ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 8: Print total, close invoice
%
\error@message{\InvoiceCompletedNoFee}%
%
%
\else \error@message{\InternalError}%
\fi%
}%
\makeatother
请注意,您必须定义新的命令\def\UnitDay
(我只针对德语!),\FeeDay@Title
打印带有“Preis/Tag”的标题并\FeeDay
打印在 x 天内完成的一项工作的一次计算。
因此您可以按照以下方式使用这些命令:
\ProjectTitle{Tagesleistungen} % <=========================================
\FeeDay{Musterdienstleistung 3}{360.00}{3}
在下面的 MWE 中,我保留了旧发票并添加了上面显示的新命令和代码:
\documentclass[a4paper]{scrlttr2}
\usepackage[top=2cm, bottom=1cm, left=2cm, right=2cm]{geometry}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{color}
\usepackage[hidelinks]{hyperref}
\usepackage[german]{invoice}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\def\UnitDay {Preis/Tag}% <========================================
\newcommand{\FeeDay@Title}{% <==========================================
\\
\noindent\textbf{\Activity}&&\UnitDay&\Count&\Amount\ (\BC)\\
\hline%
}%
\newcommand{\FeeDay}[3]{% Yields state 3, Print Fee Item <==============
%
% #1 Contents
% #2 Fee per Day
% #3 Unit Count
%
\ifcase\Flag % 0: Invoice not started yet
\error@message{\MissingOpening}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 1: Start invoice
%
\error@message{\MissingProject}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 2: Start project, print title
%
\FeeDay@Title%
\Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 3: Print remuneration item
%
\Fee@Line{#1}{#2}{#3}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 4: Print subtotal remuneration
%
\warning@message{\FeeSTExists}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 5: Expense item
%
\error@message{\FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 6: Print subtotal expenses
%
\error@message{\FeeBeforeExpense}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 7: Print subtotal project
%
\error@message{\ProjectCompletedNoFee}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\or % 8: Print total, close invoice
%
\error@message{\InvoiceCompletedNoFee}%
%
%
\else \error@message{\InternalError}%
\fi%
}%
\makeatother
\renewcommand{\familydefault}{\sfdefault}
% include meta data
\include{_data} % <============== delete in this file the following data!
% ################## invoice DATA ##################
\newcommand{\invoiceDate}{DD.MM.YYYY} % Datum der rechnungsstellung
\newcommand{\payDate}{DD.MM.YYYY} % Datum der Zahlungsfrist
\newcommand{\invoiceReference}{YYYYMMDD-1} % Rechnungsnummer (z.B. 20150122-4)
\newcommand{\invoiceSalutation}{Sehr geehrte Damen und Herren,} % die Anrede
\newcommand{\invoiceText}{Für die von mir erbrachte Leistung erhalten sie
hiermit die Rechnung. Bitte zahlen Sie den unten aufgeführten Gesamtbetrag
unter Angabe der Rechnungsnummer (\invoiceReference) bis
zum \payDate \ auf das angegebene Konto ein.} % Rechnungstext
\newcommand{\invoiceEnclosures}{} % \encl{} einfügen
\newcommand{\invoiceClosing}{Mit freundlichen Grüßen}
% ################## invoice DATA ##################
% ################## Customer DATA ##################
\newcommand{\customerCompany}{Firma XYZ} %ggf. Firma
\newcommand{\customerName}{Max Mustermann} % Name
\newcommand{\customerStreet}{Robert-Koch-Str. 12} % Straße
\newcommand{\customerZIP}{12345} % Postleitzahl
\newcommand{\customerCity}{Musterstadt} % Ort
% ################## Customer DATA ##################
\setkomavar{fromname}{\senderName}
\setkomavar{fromaddress}{\senderStreet \\ \senderZIP \ \senderCity}
\setkomavar{place}{\senderCity}
\setkomavar{date}{\invoiceDate}
\setkomavar{fromphone}{\senderTelephone}
\setkomavar{frommobilephone}{\senderMobilephone}
\setkomavar{fromemail}{\href{mailto:\senderEmail}{\nolinkurl{\senderEmail}}}
\setkomavar{subject}{Rechnung}
\setkomavar{location}{
\\[\baselineskip] \\[\baselineskip]
\flushright \small {\vspace{1cm}Rechnungsnummer:
\invoiceReference}
}
\setkomavar{firsthead}{\hfill
\parbox[t][\headheight][t]{7cm}{% <================================== 6cm
\footnotesize
\raggedright
\flushright
\color[gray]{.3}%
\begin{tabular}{rl}
Anschrift & \usekomavar{fromname}\\
& \senderStreet\\
& \senderZIP \ \senderCity \\
\\
%\Telefon \ Telefon: \` \senderTelephone \\
Mobil & \usekomavar{frommobilephone} \\
E-Mail & \usekomavar{fromemail} \\
Webseite & {\normalfont\ttfamily \senderWeb } \\
\\
Steuernummer & \taxID \\
\\
Institut & \accountBankName \\
IBAN & \accountIBAN \\
BIC & \accountBIC
\end{tabular}
}%
}
\begin{document}
\begin{letter}{\customerCompany \\ \customerName \\
\customerStreet \\ \customerZIP \ \customerCity}
\includegraphics[width=0.15\textwidth]{logo.png}
\opening{\invoiceSalutation}
\invoiceText
\begin{invoice}{Euro}{0}
\ProjectTitle{Projekttitel} % <=========================================
\Fee{Musterdienstleistung 1}{30.00}{4}
\Fee{Musterdienstleistung 2}{36.00}{7}
\ProjectTitle{Tagesleistungen} % <=========================================
\FeeDay{Musterdienstleistung 3}{360.00}{3}
% Auslagen
%\EBC{Hotel, 12 Nächte} {2400.00} % \EBCi{Hotel, 12 Nächte} {2400.00}
%\STExpenses
% Rabatt
\Discount{Rabatt} {20} % <==============================================
\end{invoice}
\ps Im ausgewiesenen Betrag ist gemäß § 19 UStG keine Umsatzsteuer
enthalten.
\closing{\invoiceClosing}
\invoiceEnclosures
\end{letter}
\end{document}
结果如下: