3
0
mirror of https://git.coop/cotech/fund.git synced 2025-10-04 03:54:33 +00:00

Generate invocies from the members.csv

This commit updates the previous template to inline the two images as
data URIs and embed ERB template markers for the data. The ruby script
added in this commit interpolates the data from the members.csv file
into the template and generates PDFs using wkhtmltopdf.
This commit is contained in:
Chris Lowis
2022-05-03 11:44:36 +01:00
parent 08dd95f3a2
commit 455306a0a6
7 changed files with 174 additions and 169 deletions

View File

@ -4,24 +4,20 @@ Records and documentation for the CoTech fund
## Generating receipts
Install `pandoc` and `wkhtmltopdf` using, for example homebrew on OS X
Install `wkhtmltopdf` using, for example homebrew on OS X
```
brew install pandoc
brew install Caskroom/cask/wkhtmltopdf
```
Then in `receipts/` create a markdown file from an existing one, and run, for example
Then in the root of the project run
```
pandoc -t html5 agile_collective_2019-2020.md -o agile_collective_2019-2020.pdf --css style.css
ruby scripts/generate_invoices.rb
```
The invoices should be generated in `invoices/sent/2022/`.
The ruby script can be edited to change the start of the range of invoice numbers and to generate the output in a different directory.
---
---
Alternatively, to make PDF invoices/receipts with markdown files [markdown themes](https://support.typora.io/About-Themes/) can be used. `theme/cotech.css` can be used as a CSS stylesheet and `invoice_template_themed.md` as template. Images path has to point to `img/` directory at the root of the repository. Invoices in `invoices/sent/2020` were created that way.
The data used to generate the invoices is in `members.csv`.