ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henning Hraban Ramm <texml@fiee.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Invoice Forms
Date: Thu, 14 Jun 2018 16:00:06 +0200	[thread overview]
Message-ID: <552F67D2-3012-42BD-8507-1CF1011167FE@fiee.net> (raw)
In-Reply-To: <32399723-4C93-479A-8591-675753D2FE88@fiee.net>

[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]

Am 2018-06-14 um 12:48 schrieb Henning Hraban Ramm <texml@fiee.net>:

> Am 2018-06-13 um 19:50 schrieb jdh <dhenman@gmail.com>:
> 
>> Is there a source of context document forms for invoices, (and other documents), that have been contributed for open modifications and use?   If not it would be very beneficial to people to have such a depository. Please let me know.
> 
> Dear unknown,
> there’s nothing out there, AFAIK.
> 
> But I’m writing my invoices with ConTeXt, using a mixture of Shell, Python, Lua and ConTeXt, also mixed German/English:
> * A bunch of Shell scripts call the main Python script with the right parameters.
> * Python script/library manages customers and catalogue and fills a ConTeXt/Lua invoice template
> * Python or Shell script calls ConTeXt, invoice calculations in Lua
> 
> I can provide you with the ConTeXt & Lua part, the Python stuff contains too much private information.
> There’s no documentation and I don’t claim the code to be good.
> 
> <classy.lua><invoicelib.lua><classy.lua><invoicelib.lua>

Sorry, didn’t check what I attached. Here are the missing tex files.

Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

[-- Attachment #2: environment.tex --]
[-- Type: application/octet-stream, Size: 3356 bytes --]

\mainlanguage[de]
\usemodule[letter]
\startluacode
require("invoicelib")
\stopluacode

\setuplanguage [en] [date={year, –, mm, –, dd}] % Datum nach ISO 8601
\setupinterlinespace[3.0ex] % default: 2.8ex
\setbreakpoints[compound] % break at / and -
\setupletteroptions[language=german, whitespace=1.5ex]

\setuptabulate[distance=0pt]

\usetypescriptfile	[type-computer-modern-unicode,]
\usetypescript	[computer-modern-unicode-concrete]
\setupbodyfont	[computer-modern-unicode-concrete,rm,10pt]
\setupletteroptions[bodyfont={computer-modern-unicode-concrete,rm,10pt}]

\setupletter[
	% Sender address in envelope window
	backaddress={}
]

\startnotmode[nologo]
% Define logo for the first page
\defineletterelement[layer][head][fiee]%
	{\externalfigure[briefbogen]}

% Other logo for subsequent (right) pages
\defineletterelement[layer][nexthead][fiee]%
	{\externalfigure[briefbogen][height=2cm,width=6cm]}

% We put our logo in the head
\setupletterlayer[head,nexthead]
	[preset=lefttop,
	alternative=fiee,
	x=0mm,y=0mm,
]

\setupletterlayer[nexthead][state=right]
\stopnotmode

\setupletter[
  company={},
	name={},
	street={},
	city={},
	phone={},
	mobile={},
	email={},
	web={}
]

% center around the :
\defineletterelement[layer][location][fiee]%
	{\hskip5em \fieevis
    \setuptabulate[bodyfont=small]
	\starttabulate[|Irw(5em)|Ip|]%[distance=0pt,bodyfont=small]
    %\NC \strut      \NC{\definedfont[SerifItalic at 10pt]\correspondenceparameter{company}}\NC\NR
	\NC Who 	\NC\correspondenceparameter{name} \NC\NR
	\NC Where 		\NC\correspondenceparameter{street}\\\correspondenceparameter{city}\NC\NR
	\NC Phone 	\NC\correspondenceparameter{phone}\\\correspondenceparameter{mobile} \NC\NR
	\NC Internet 	\NC\correspondenceparameter{email}\\\correspondenceparameter{web} \NC\NR
\stoptabulate}

\setupletterlayer[location]
	[alternative=fiee,
    x=147mm,y=45mm
	]

% Our own recipient setup without too much space before the address
\defineletterelement[layer][address][fiee]%
	{\correspondenceparameter{toname}\\
	\correspondenceparameter{toaddress}
	\par}

\setupletterlayer[address][alternative=fiee]

% Subject and date on the same line, date below logo
\startsetups[letter:section:subject]
  \bTABLE[frame=off]
    \bTR % ex 169mm
      \bTD[width=\dimexpr164mm-\backspace\relax]\correspondenceparameter{subject}\eTD
     \bTD{\tf\correspondenceparameter{date}}\eTD
    \eTR
  \eTABLE
\stopsetups

\setuplettersection[subject][alternative=setups]

% account information at the foot, below the logo
\defineletterelement[layer][foot][fiee]%
  {\setuptabulate[bodyfont=small]
  \starttabulate[|Irw(39mm)|Ip|]%[distance=0pt,bodyfont=small]
		\NC Accounts \NC \NC\NR
		\NC Tax No. \NC ... \NC\NR
		\NC UStID \NC ... \NC\NR
		\NC IBAN \NC ... \NC\NR
		\NC BIC \NC ... \NC\NR
	\stoptabulate}

\setupletterlayer[foot][
	preset=leftbottom,
	x=122mm, %x=127mm,
	y=24mm, %y=34mm,
	alternative=fiee]

% switch off reference line
\setupletterlayer[reference][state=stop]

% Move the text a bit up
\setupletterlayout[firstpage][topspace=10cm]

% Adjust text start on subsequent pages
\setupletterlayout[secondpage][topspace=3cm]

% Move marks to the paper rim (won't print on most printers)
\setupletterlayer[topmark,botmark,cutmark][x=-2mm]

[-- Attachment #3: rechnung_tpl.tex --]
[-- Type: application/octet-stream, Size: 667 bytes --]

%%
\input environment.tex

\setupletter[
  toname={},
  toaddress={},
  subject={},
  date={}
]

\startletter
\strut

{
\setuptabulate[distance=.25em]
\startluacode

local rg = Invoice{
    printtitle = true,
    tax = 19,
    declaretax = true,
    taxmode = "netto",
    perhour = 50
}

-- rg:addItem{count=1, unit="x", text="Sample", tax=19, amount=12.3}
-- rg:addItem{count=0.25, unit="h", text="Work", typ="time"}
-- rg:addItem{text="Project ConTeXt", typ="text"}
-- rg:addItem{text="Something", amount=500, typ="lump"}

rg:output()

\stopluacode
}

Payable...

\blank[2*big]

Best regards,
\blank[small]

\externalfigure[signature]%%
Your Provider

\stopletter

[-- Attachment #4: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2018-06-14 14:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-13 17:50 jdh
2018-06-14 10:48 ` Henning Hraban Ramm
2018-06-14 14:00   ` Henning Hraban Ramm [this message]
2018-06-14 14:17     ` Floris van Manen
2018-06-14 14:50       ` Henning Hraban Ramm
2018-06-14 13:29 ` Peter Münster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=552F67D2-3012-42BD-8507-1CF1011167FE@fiee.net \
    --to=texml@fiee.net \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).