From 28d5c1c212a06d599160f96cbe0e6c88840ab367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Tue, 9 Jul 2024 10:04:00 +0200 Subject: init --- contrib/Makefile | 5 ++ contrib/invoice-01.md | 28 +++++++ contrib/metadata.yml | 13 ++++ contrib/template.html | 204 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 250 insertions(+) create mode 100644 contrib/Makefile create mode 100644 contrib/invoice-01.md create mode 100644 contrib/metadata.yml create mode 100644 contrib/template.html (limited to 'contrib') diff --git a/contrib/Makefile b/contrib/Makefile new file mode 100644 index 0000000..e04d380 --- /dev/null +++ b/contrib/Makefile @@ -0,0 +1,5 @@ +invoice-01.pdf: invoice-01.md + pandoc -s -t html --template template.html --metadata-file metadata.yml $^ | tee invoice-01.html | weasyprint - $@ + +clean: + - rm invoice-01.pdf invoice-01.html diff --git a/contrib/invoice-01.md b/contrib/invoice-01.md new file mode 100644 index 0000000..74705ae --- /dev/null +++ b/contrib/invoice-01.md @@ -0,0 +1,28 @@ +--- +number: "0001" +date: 2024-07-08 +due_date: 2024-08-01 + +notes: ":3" + +currency: EUR + +client: + name: Example + address: Ex Ample, Elpam Xe + email: hello@example.org + +services: + - name: Programming + comment: Lorem ipsum + rate: 1 + qty: 1 + sum: 1 + + - name: System administration + rate: 2.5 + qty: 10 + sum: 25 + +total: 26 +--- diff --git a/contrib/metadata.yml b/contrib/metadata.yml new file mode 100644 index 0000000..61a633c --- /dev/null +++ b/contrib/metadata.yml @@ -0,0 +1,13 @@ +--- + +author: + name: John Smith + address: 123 Sesame St, Cloud, Earth + email: john@smi.th + website: https://smi.th + phone: "+101010101" + +bank: + name: ABC + iban: 2323232323 + swift: LLLLLLXXX diff --git a/contrib/template.html b/contrib/template.html new file mode 100644 index 0000000..458af62 --- /dev/null +++ b/contrib/template.html @@ -0,0 +1,204 @@ + + + + + + + + + +
+ + +
+ + + + +

Invoice

#${ number }
issued at: ${ date }
due at: ${ due_date }
+
+
+ +
+
+

Invoice for

+
    +
  • ${ client.name }
  • +
  • ${ client.address }
  • +
  • ${ client.email }
  • +
+
+ ${ if(notes) } +
+

${ notes }

+
+ ${ endif } +
+ +
+
+ + + + + + + + + + + ${ for(services) } + + + + + + + ${ endfor } + + + + + + + +
DescriptionRateQuantityAmount
+ ${ it.name } + ${ if(it.comment) } +

${ it.comment }

+ ${ endif } +
${ it.rate }${ it.qty }${ it.sum }
Total in ${ currency }${ total }
+
+
+ + + + -- cgit v1.2.3