From 3fdf03421f7051f57f232646be4788e4234a8a62 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 18 Jan 2019 22:37:26 +0000 Subject: invoice-class (18jan19) git-svn-id: svn://tug.org/texlive/trunk@49749 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/latex/invoice-class/README.md | 6 + .../doc/latex/invoice-class/doc/duck-invoice.cfg | 10 ++ .../doc/latex/invoice-class/doc/duck-invoice.csv | 31 +++++ .../doc/latex/invoice-class/doc/duck-invoice.pdf | Bin 0 -> 37543 bytes .../doc/latex/invoice-class/doc/duck-invoice.tex | 16 +++ .../doc/latex/invoice-class/doc/ducks.csv | 6 + .../doc/latex/invoice-class/doc/ducks.pdf | Bin 0 -> 34447 bytes .../doc/latex/invoice-class/doc/ducks.tex | 15 +++ .../doc/latex/invoice-class/doc/invoice-class.pdf | Bin 0 -> 76876 bytes .../doc/latex/invoice-class/doc/invoice-class.tex | 132 +++++++++++++++++++++ 10 files changed, 216 insertions(+) create mode 100644 Master/texmf-dist/doc/latex/invoice-class/README.md create mode 100644 Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.cfg create mode 100644 Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.csv create mode 100644 Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.pdf create mode 100644 Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.tex create mode 100644 Master/texmf-dist/doc/latex/invoice-class/doc/ducks.csv create mode 100644 Master/texmf-dist/doc/latex/invoice-class/doc/ducks.pdf create mode 100644 Master/texmf-dist/doc/latex/invoice-class/doc/ducks.tex create mode 100644 Master/texmf-dist/doc/latex/invoice-class/doc/invoice-class.pdf create mode 100644 Master/texmf-dist/doc/latex/invoice-class/doc/invoice-class.tex (limited to 'Master/texmf-dist/doc') diff --git a/Master/texmf-dist/doc/latex/invoice-class/README.md b/Master/texmf-dist/doc/latex/invoice-class/README.md new file mode 100644 index 00000000000..1a948430721 --- /dev/null +++ b/Master/texmf-dist/doc/latex/invoice-class/README.md @@ -0,0 +1,6 @@ +# invoice-class +The `invoice-class` produces a standard US commercial invoice using data from a CSV file. Invoices can span multiple pages. The class is configurable for different shipping addresses. + +The class is released under the LPPL 1.3 licence. + + diff --git a/Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.cfg b/Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.cfg new file mode 100644 index 00000000000..05acf7197b0 --- /dev/null +++ b/Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.cfg @@ -0,0 +1,10 @@ +% Sample configuration file +\fromaddress{% +The Duck Company\\ +Some Avenue\\ +Somewhere MI 48823\\ +USA\\ +Tel. 555-555-5555\\ +} +\shipper{Prof. van Duck} +\location{Somewhere, MI} diff --git a/Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.csv b/Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.csv new file mode 100644 index 00000000000..d5acc1bf448 --- /dev/null +++ b/Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.csv @@ -0,0 +1,31 @@ +Description, Country, Quantity, UnitValue, Amount +Yellow Ducks, USA,5,2.00,10.00 +Pink Ducks, USA,4,15.00,60.00 +Blue Ducks, USA,6,5.00,30.00 +Orange Ducks, USA,1,4.00,4.00 +Red Ducks, USA,30,2.00,60.00 +Yellow Ducks, USA,5,2.00,10.00 +Pink Ducks, USA,4,15.00,60.00 +Blue Ducks, USA,6,5.00,30.00 +Orange Ducks, USA,1,4.00,4.00 +Red Ducks, USA,30,2.00,60.00 +Yellow Ducks, USA,5,2.00,10.00 +Pink Ducks, USA,4,15.00,60.00 +Blue Ducks, USA,6,5.00,30.00 +Orange Ducks, USA,1,4.00,4.00 +Red Ducks, USA,30,2.00,60.00 +Yellow Ducks, USA,5,2.00,10.00 +Pink Ducks, USA,4,15.00,60.00 +Blue Ducks, USA,6,5.00,30.00 +Orange Ducks, USA,1,4.00,4.00 +Red Ducks, USA,30,2.00,60.00 +Yellow Ducks, USA,5,2.00,10.00 +Pink Ducks, USA,4,15.00,60.00 +Blue Ducks, USA,6,5.00,30.00 +Orange Ducks, USA,1,4.00,4.00 +Red Ducks, USA,30,2.00,60.00 +Yellow Ducks, USA,5,2.00,10.00 +Pink Ducks, USA,4,15.00,60.00 +Blue Ducks, USA,6,5.00,30.00 +Orange Ducks, USA,1,4.00,4.00 +Red Ducks, USA,30,2.00,60.00 \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.pdf b/Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.pdf new file mode 100644 index 00000000000..49a247b270b Binary files /dev/null and b/Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.pdf differ diff --git a/Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.tex b/Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.tex new file mode 100644 index 00000000000..01d54398d67 --- /dev/null +++ b/Master/texmf-dist/doc/latex/invoice-class/doc/duck-invoice.tex @@ -0,0 +1,16 @@ +\documentclass{invoice-class} +\ConfigPrefix{duck-} +\InputFile{duck-invoice.csv} +\waybill{8273205776} +\carrier{FedEx} +\destination{Brazil} +\toaddress{Paulo Cereda\\Rua Bonita\\Cidade de Patos\\SP\\Brazil} +\weight{1}{1} +\packages{1} +\shippingcost{40.00} +\packingcost{0.00} +\insurancecost{10.00} +\begin{document} +\printinvoice +\end{document} + diff --git a/Master/texmf-dist/doc/latex/invoice-class/doc/ducks.csv b/Master/texmf-dist/doc/latex/invoice-class/doc/ducks.csv new file mode 100644 index 00000000000..6139c455937 --- /dev/null +++ b/Master/texmf-dist/doc/latex/invoice-class/doc/ducks.csv @@ -0,0 +1,6 @@ +Description, Country, Quantity, UnitValue, Amount +Yellow Ducks, USA,5,2.00,10.00 +Pink Ducks, USA,4,15.00,60.00 +Blue Ducks, USA,6,5.00,30.00 +Orange Ducks, USA,1,4.00,4.00 +Red Ducks, USA,30,2.00,60.00 \ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/invoice-class/doc/ducks.pdf b/Master/texmf-dist/doc/latex/invoice-class/doc/ducks.pdf new file mode 100644 index 00000000000..c837f2eaee2 Binary files /dev/null and b/Master/texmf-dist/doc/latex/invoice-class/doc/ducks.pdf differ diff --git a/Master/texmf-dist/doc/latex/invoice-class/doc/ducks.tex b/Master/texmf-dist/doc/latex/invoice-class/doc/ducks.tex new file mode 100644 index 00000000000..eb938fca2bf --- /dev/null +++ b/Master/texmf-dist/doc/latex/invoice-class/doc/ducks.tex @@ -0,0 +1,15 @@ +\documentclass{invoice-class} +\InputFile{ducks.csv} +\waybill{8273205776} +\carrier{FedEx} +\destination{Brazil} +\toaddress{Paulo Cereda\\Rua Bonita\\Cidade de Patos\\SP\\Brazil} +\weight{1}{1} +\packages{1} +\shippingcost{40.00} +\packingcost{0.00} +\insurancecost{10.00} +\begin{document} +\printinvoice +\end{document} + diff --git a/Master/texmf-dist/doc/latex/invoice-class/doc/invoice-class.pdf b/Master/texmf-dist/doc/latex/invoice-class/doc/invoice-class.pdf new file mode 100644 index 00000000000..40271306b30 Binary files /dev/null and b/Master/texmf-dist/doc/latex/invoice-class/doc/invoice-class.pdf differ diff --git a/Master/texmf-dist/doc/latex/invoice-class/doc/invoice-class.tex b/Master/texmf-dist/doc/latex/invoice-class/doc/invoice-class.tex new file mode 100644 index 00000000000..4e1e09ad7b4 --- /dev/null +++ b/Master/texmf-dist/doc/latex/invoice-class/doc/invoice-class.tex @@ -0,0 +1,132 @@ +\documentclass[11pt]{article} +\title{\textbf{Using the Invoice Class}} +\author{\textbf{Alan Munn}\\Department of Linguistics and Languages\\\texttt{\href{mailto:amunn@msu.edu}{amunn@msu.edu}}} +\date{Version 1.0\\January 17, 2019} +\usepackage{fontspec} +\setmainfont[]{Linux Libertine O} +\setsansfont[]{Linux Biolinum O} +\setmonofont[Scale=MatchLowercase]{Linux Libertine Mono O} +\usepackage[lmargin=1in,rmargin=1in,tmargin=1.25in,bmargin=1in]{geometry} +\usepackage{titling} +\usepackage{array, booktabs, multicol, xspace,tabularx} +\usepackage{enumitem} +\usepackage{caption} +\usepackage{fancyvrb,listings,url} +\usepackage{pdfpages} +\usepackage[sf]{titlesec} +\usepackage{titleps} +\newpagestyle{main}{% +\setfoot{\itshape Invoice Class}{}{\thepage}} +\pagestyle{main} + +\usepackage[colorlinks=true]{hyperref} + +\DefineShortVerb{\|} +\newcommand*\bs{\textbackslash} + +\lstset{% + basicstyle=\ttfamily\small, + commentstyle=\itshape\ttfamily\small, + showspaces=false, + showstringspaces=false, + breaklines=true, + breakautoindent=true, + frame=single + captionpos=t + language=TeX +} + +\newcommand*{\pkg}[1]{\texttt{#1}\xspace} +\setitemize[1]{label={}} +\setitemize[2]{label={}} +\setdescription{font={\normalfont}} +\setlength{\droptitle}{-1in} + + + +\begin{document} +\maketitle +\thispagestyle{empty} +\section{Introduction} +The \pkg{invoice-class} class allows printing of a standard US commercial invoice using invoice data from a CSV spreadsheet. Invoices can span multiple pages. + +\section{Class document commands} +The main class commands specify the parts of the form that need to be filled in. Each command except |\weight| takes a single argument. + +\begin{center} +\begin{tabularx}{.8\textwidth}{>{\ttfamily\bs}l<{\{\}}X} +\toprule +\multicolumn{1}{c}{Command name} & \multicolumn{1}{l}{Description}\\ +\midrule +{waybill}& waybill number\\ +{shippingdate}& shipping date (default is \texttt{\bs today})\\ +{carrier}& name of the freight carrier\\ +{destination}& destination country\\ +{toaddress}& Destination address\\ +\multicolumn{1}{>{\ttfamily\bs}l}{weight\{\}\{\}} & weight in pounds and ounces\\ +{packages}{1} & number of packages in the shipment\\ +{shippingcost}& total cost of shipping (default = 0.00)\\ +{packingcost} & total cost of packing (default = 0.00)\\ +{insurancecost} & total cost of insurance (default is 0.00)\\ +{InputFile} & name of the CSV file for item date\\ +\bottomrule +\end{tabularx} +\captionof{table}{Invoice document commands}\label{commands} +\end{center} + +\subsection{Producing the invoice} +Once all the required elements are specified (which can be done in the preamble), there is a single command to produce the invoice: +\begin{center} +\begin{tabularx}{.8\textwidth}{>{\ttfamily\bs}lX} +{printinvoice} & Prints the invoice\\ +\end{tabularx} +\end{center} + +\section{Class configuration commands} +Since an invoice will generally have a fixed From address, shipper and location, these values are best set in a separate configuration file (although they can also be set within the document.) The class will look for the file |invoice.cfg| or, |invoice.cfg| where || is specified using the document command |\ConfigPrefix|. This allows multiple configuration files with different information within them. +Each configuration file should contain an instance of |\fromaddress|, |\shipper|, and |\location|. +\begin{center} +\begin{tabularx}{.8\textwidth}{>{\ttfamily\bs}l<{\{\}}X} +\toprule +\multicolumn{1}{c}{Command name} & \multicolumn{1}{l}{Description}\\ +\midrule +{fromaddresss}& shipper's address\\ +{shipper}& name of shipper\\ +{location}& location\\ +{ConfigPrefix} & configuration file prefix (default is none)\\ +\bottomrule +\end{tabularx} +\captionof{table}{Invoice configuration commands}\label{config-commands} +\end{center} + + +\section{\pkg{datatool} details} +The uses the \pkg{datatool} package to produce the invoice using a CSV file. The CSV file requires the following column headings to be present. All other columns are ignored. (Heading names are case-sensitive.) +\begin{center} +\begin{tabularx}{.8\textwidth}{>{\ttfamily}lX} +\toprule +\multicolumn{1}{c}{Column name} & \multicolumn{1}{l}{Description}\\ +\midrule +{Description} & Item description\\ +{Country} & Country of origin\\ +{Quantity} & unit quantity\\ +{UnitValue} & per unit value\\ +{Amount} & total value for item\\ +\bottomrule +\end{tabularx} +\captionof{table}{Required CSV Column labels}\label{CSV} +\end{center} +\subsection{Sample CSV file} +\lstinputlisting{ducks.csv} +\clearpage +\section{Sample Configuration file} +\lstinputlisting{duck-invoice.cfg} + +\section{Sample document} +\lstinputlisting{ducks.tex} +\section{Bugs and support} +This package is released as is, and although I will accept bug reports, fixing them may not be a priority. You're free to fork the project to modify it as you wish. + + +\includepdf[]{ducks.pdf} +\end{document} -- cgit v1.2.3