diff --git a/3d-druck-agb.typ b/3d-druck-agb.typ index 2db75f2..5e2e75a 100644 --- a/3d-druck-agb.typ +++ b/3d-druck-agb.typ @@ -1,6 +1,6 @@ -#import "templates/doc.typ": tmpl +#import "templates/tmpl_doc.typ": tmpl_doc -#show: doc => tmpl( +#show: doc => tmpl_doc( title: "3D Druck Service - AGB", changes: ( [v1.0], [29.07.2021], [erste Fassung], diff --git a/beitragsordnung.typ b/beitragsordnung.typ index a7eacd6..2933223 100644 --- a/beitragsordnung.typ +++ b/beitragsordnung.typ @@ -1,6 +1,6 @@ -#import "templates/doc.typ": tmpl +#import "templates/tmpl_doc.typ": tmpl_doc -#show: doc => tmpl( +#show: doc => tmpl_doc( title: "Beitragsordnung", changes: ( [v1.0], [19.10.2020], [erste Fassung], diff --git a/beitrittserklärung.typ b/beitrittserklärung.typ index 4334be2..ea510a7 100644 --- a/beitrittserklärung.typ +++ b/beitrittserklärung.typ @@ -1,6 +1,7 @@ -#import "templates/form.typ": tmpl, form, form_field, form_inline +#import "templates/tmpl_page.typ": tmpl_page +#import "templates/form.typ": form, form_field, form_inline -#show: doc => tmpl( +#show: doc => tmpl_page( title: "Beitrittserklärung", version: "v1.6", change_date: "09.09.2023", diff --git a/datenschutz-einwilligung.typ b/datenschutz-einwilligung.typ index 3c8b8c8..374021f 100644 --- a/datenschutz-einwilligung.typ +++ b/datenschutz-einwilligung.typ @@ -1,10 +1,10 @@ -#import "templates/form.typ": tmpl, form, form_field +#import "templates/tmpl_page.typ": tmpl_page +#import "templates/form.typ": form, form_field -#show: doc => tmpl( +#show: doc => tmpl_page( title: "Datenschutzrechtliche Hinweise", version: "v1.2", change_date: "24.06.2023", - text_size: 11.25pt, doc, ) diff --git a/haftungsausschluss.typ b/haftungsausschluss.typ index 8e454c4..5bd24c5 100644 --- a/haftungsausschluss.typ +++ b/haftungsausschluss.typ @@ -1,6 +1,7 @@ -#import "templates/form.typ": tmpl, form, form_field, form_inline +#import "templates/tmpl_page.typ": tmpl_page +#import "templates/form.typ": form, form_field, form_inline -#show: doc => tmpl( +#show: doc => tmpl_page( title: "Haftungsausschluss", version: "v1.0", change_date: "23.06.2023", diff --git a/rechnung.typ b/rechnung.typ index 0be0d38..484b3e1 100644 --- a/rechnung.typ +++ b/rechnung.typ @@ -1,158 +1,76 @@ -#import "templates/form.typ": tmpl, colors +#import "templates/tmpl_letter.typ": tmpl_letter +#import "templates/common.typ": colors, money #let config = yaml("rechnung.yml") -#show: doc => tmpl( +#show: doc => tmpl_letter( title: ( invoice: "Rechnung", offer: "Angebot", estimate: "Kostenvoranschlag", internal: "Eigenbeleg" ).at(config.type), - version: "", - change_date: config.date, - text_size: 11.25pt, + address: config.address, + info: [ + Datum: #config.date \ + #if config.type != "internal" [ + Kunden-Nr.: #config.customer_no \ + ] + #if config.type == "invoice" [ + Rechnungs-Nr.: #config.invoice_no \ + ] else if config.type == "offer" [ + Angebots-Nr.: #config.invoice_no \ + ] + ], + footer: [ + #if config.type == "invoice" [ + Vielen Dank für deine Bestellung! \ + ] else if config.type == "estimate" or config.type == "offer" [ + Wir freuen uns auf deine Bestellung! \ + ] else if config.type == "internal" [ + *Grund für Eigenbeleg:* \ + #config.internal_reason + ] + + #text(size: 0.7em, fill: colors.subtext)[ + #if config.type == "invoice" [ + Gesamtbetrag fällig in 10 Tagen ab Rechnungserhalt. \ + Für überfällige Zahlungen wird eine Bearbeitungsgebühr von min. 5 % pro Monat berechnet. + ] else if config.type == "offer" [ + Dieses Angebot ist für einen Monat gültig. + ] else if config.type == "estimate" [ + Dieser Kostenvoranschlag ist unverbindlich. + ] + ] + ], doc, ) -// DIN 5008 Sichtfenster: 45mm -#place( - top+left, - dy: 25mm, -)[ - #text(size: 0.75em)[#underline[swablab e.V. - Katharinenstr. 1 - 72250 Freudenstadt]] \ - #v(0.5em) - #config.address -] -// DIN 5008 Informationsblock: 50mm -#place( - top+right, - dy: 30mm, -)[ - #v(1em) - Datum: #config.date \ - #if config.type != "internal" [ - Kunden-Nr.: #config.customer_no \ - ] - #if config.type == "invoice" [ - Rechnungs-Nr.: #config.invoice_no \ - ] else if config.type == "offer" [ - Angebots-Nr.: #config.invoice_no \ - ] +#if config.type == "invoice" [ + Bitte nutze deine Rechnungs-Nr. als Verwendungszweck für die Überweisung! ] - -// DIN 5008 Faltmarke 1: 105mm -#place( - top+left, - dy: 85mm, - dx: -1cm, - line( - length: -1em, - stroke: 0.5pt + colors.subtext - ) -) -// DIN 5008 Faltmarke 2: 210mm -#place( - top+left, - dy: 190mm, - dx: -1cm, - line( - length: -1em, - stroke: 0.5pt + colors.subtext - ) +#table( + columns: (auto, 1fr, auto, auto, auto ,auto), + fill: (_, row) => if row == 0 { colors.highlight } else { white }, + stroke: 0.1pt + colors.subtext, + [*Pos.*], + [*Beschreibung*], + [*Stück*], + [*Einzelpreis*], + [*Rabatt*], + [*Betrag*], + ..config.entries.enumerate().map(e => ( + e.at(0)+1, + e.at(1).description, + e.at(1).pieces, + money(e.at(1).price), + money(e.at(1).sale), + money(e.at(1).pieces * e.at(1).price - e.at(1).sale), + )).flatten().map(e => [#e]), ) -#let money(i) = { - if i == 0 { - return "0.00€" - } - - let j = str(calc.round(i * 100)) - - if i < 1 { - "0." + j.slice(-2) + "€" - } else { - j.slice(0,-2)+ "." + j.slice(-2) + "€" - } -} - -// DIN 5008 nach Faltmarke 1 -#place( - top+left, - dy: 85mm, -)[ - #table( - columns: (auto, 1fr, auto, auto, auto ,auto), - fill: (_, row) => if row == 0 { colors.highlight } else { white }, - stroke: 0.1pt + colors.subtext, - [*Pos.*], - [*Beschreibung*], - [*Stück*], - [*Einzelpreis*], - [*Rabatt*], - [*Betrag*], - ..config.entries.enumerate().map(e => ( - e.at(0)+1, - e.at(1).description, - e.at(1).pieces, - money(e.at(1).price), - money(e.at(1).sale), - money(e.at(1).pieces * e.at(1).price - e.at(1).sale), - )).flatten().map(e => [#e]), - ) - - #align(right)[ - #pad(x:1em)[ - *Gesamtbetrag: #money(config.entries.map(e => e.pieces * e.price - e.sale).sum())* - ] - ] -] - -// Footer -#place(bottom+left)[ - #if config.type == "invoice" [ - Vielen Dank für deine Bestellung! \ - ] else if config.type == "estimate" or config.type == "offer" [ - Wir freuen uns auf deine Bestellung! \ - ] else if config.type == "internal" [ - *Grund für Eigenbeleg:* \ - #config.internal_reason - ] - - #text(size: 0.7em, fill: colors.subtext)[ - #if config.type == "invoice" [ - Gesamtbetrag fällig in 10 Tagen ab Rechnungserhalt. \ - Für überfällige Zahlungen wird eine Bearbeitungsgebühr von min. 5 % pro Monat berechnet. - ] else if config.type == "offer" [ - Dieses Angebot ist für einen Monat gültig. - ]else if config.type == "estimate" [ - Dieser Kostenvoranschlag ist unverbindlich. - ] - - #table( - stroke: none, - align: top+left, - columns: (1fr,1fr,auto,1fr,1fr), - [*Telefon*],[*E-Mail / Web*],[*Bankverbindung*],[*Vereinsregister*],[*Vorstand*], - [ - +49 15679232971 - ], - [ - info\@swablab.de \ - https://swablab.de - ], - [ - VR-Bank Dornstetten-Horb \ - DE12 6426 2408 0125 6340 05 - ], - [ - VR 724909 \ - Amtsgericht Stuttgart - ], - [ - Fabian Haas \ - Manuel Knodel - ], - ) +#align(right)[ + #pad(x:1em)[ + *Gesamtbetrag: #money(config.entries.map(e => e.pieces * e.price - e.sale).sum())* ] ] \ No newline at end of file diff --git a/satzung.typ b/satzung.typ index 37e113f..c394dc6 100644 --- a/satzung.typ +++ b/satzung.typ @@ -1,6 +1,6 @@ -#import "templates/doc.typ": tmpl +#import "templates/tmpl_doc.typ": tmpl_doc -#show: doc => tmpl( +#show: doc => tmpl_doc( title: "Satzung", changes: ( [v1.0], [19.10.2020], [erste Fassung], diff --git a/spendenbescheinigung.typ b/spendenbescheinigung.typ index 932684d..8751385 100644 --- a/spendenbescheinigung.typ +++ b/spendenbescheinigung.typ @@ -1,11 +1,10 @@ -#import "templates/form.typ": tmpl, colors, form_field +#import "templates/tmpl_page.typ": tmpl_page +#import "templates/common.typ": colors +#import "templates/form.typ": form_field #let config = yaml("spendenbescheinigung.yml") -#show: doc => tmpl( +#show: doc => tmpl_page( title: "Spendenbescheinigung", - version: "", - change_date: config.date, - text_size: 11.25pt, doc, ) diff --git a/templates/common.typ b/templates/common.typ new file mode 100644 index 0000000..65b8412 --- /dev/null +++ b/templates/common.typ @@ -0,0 +1,43 @@ +#let colors = ( + primary: oklch(93.84%, 0.09, 183.69deg), + secondary: oklch(73.51%, 0.168, 40.25deg), + subtext: oklch(60%, 0, 0deg), + highlight: oklch(90%, 0, 0deg), +) + +#let money(i) = { + if i == 0 { + return "0.00€" + } + + let j = str(calc.round(i * 100)) + + if i < 1 { + "0." + j.slice(-2) + "€" + } else { + j.slice(0,-2)+ "." + j.slice(-2) + "€" + } +} + +#let common(title: none, doc) = { + set document( + title: title, + author: "swablab e.V." + ) + + set text( + font: "Noto Sans", + size: 11pt, + lang: "de" + ) + + set par( + justify: true + ) + + set page( + paper: "a4", + margin: (x: 2cm, y: 2cm), + ) + doc +} \ No newline at end of file diff --git a/templates/doc.typ b/templates/doc.typ deleted file mode 100644 index 124f380..0000000 --- a/templates/doc.typ +++ /dev/null @@ -1,108 +0,0 @@ -#let tmpl( - title: none, - changes: (), - heading_size: 18pt, - heading_font: "Ubuntu", - text_size: 12pt, - text_font: "Noto Sans", - doc, -) = { -set document( - title: title, - author: "swablab e.V." -) - -set text( - font: text_font, - size: text_size, - lang: "de" -) - -set par( - justify: true -) - -set page( - paper: "a4" -) - -set enum( - numbering: "(1)" -) - -// Titelblatt -align(center)[ - #image("lightmode-swablab.png", width: 70%) - - #pad(top: 2em, bottom: 2em)[ - #text(1.75em, font: heading_font, hyphenate: false)[ - #heading(outlined: false)[*#title*] - ]] - - - #changes.at(-3) - #changes.at(-2) \ - swablab e.V. \ - Katharinenstr. 1 \ - 72250 Freudenstadt -] - -set page( - footer: [ - #emph[#changes.at(-3)] - #h(2fr) - #counter(page).display() - ], - margin: (bottom: 2.5cm) -) - -// Inhaltsverzeichnis -show heading: it => [ - #v(2.25em, weak: true) - #set text(font: heading_font, heading_size) - #strong[#it.body] - #v(1.25em, weak: true) -] - -outline(title: [*Inhaltsverzeichnis*]) - -set par( - leading: 1em, -) - -pagebreak() - -// Formatierung Inhalt -set heading(numbering: "§1") -show heading: it => [ - #v(2.25em, weak: true) - #set text(font: heading_font, heading_size) - #strong[ - #counter(heading).display() - #it.body - ] - #v(1.25em, weak: true) -] - -// Inhalt -doc - -pagebreak() -// Änderungen -set heading(numbering: none) -show heading: it => [ - #set text(font: heading_font, heading_size) - #strong[#it.body] - #v(1.25em, weak: true) -] -block(breakable: false)[ -#heading([Änderungen]) -#table( - columns: (auto, auto, 1fr), - inset: 8pt, - align: auto, - stroke: 0.5pt, - [*Version*], [*Änderungsdatum*], [*Änderungen*], - ..changes -)] - -} \ No newline at end of file diff --git a/templates/form.typ b/templates/form.typ index eb309ba..c8ea69a 100644 --- a/templates/form.typ +++ b/templates/form.typ @@ -1,75 +1,4 @@ -#let colors = ( - primary: oklch(93.84%, 0.09, 183.69deg), - secondary: oklch(73.51%, 0.168, 40.25deg), - subtext: oklch(60%, 0, 0deg), - highlight: oklch(90%, 0, 0deg), -) - -#let tmpl( - title: none, - version: none, - change_date: none, - heading_size: 18pt, - heading_font: "Ubuntu", - text_size: 12pt, - text_font: "Noto Sans", - doc, -) = { -set document( - title: title, - author: "swablab e.V." -) - -set text( - font: text_font, - size: text_size, - lang: "de" -) - -set par( - justify: true -) - -set page( - paper: "a4", - margin: (x: 2cm, y: 2cm), -) - -// Version -place( - top + left, - dx: -2em, - dy: -0.5em, - - rotate( - 90deg, - origin: bottom + left, - text( - size: 10pt, - fill: colors.subtext, - [swablab e.V. / #title #version / #change_date] - ) - ) -) - -// Logo -place( - top + right, - dx: 2.5em, - dy: -2.5em, - image("lightmode-swablab.png", width: 25%) -) - -block(width: 100%-70pt, height: 70pt)[ - #par(justify: false)[ - #text(font: heading_font, heading_size)[ - #heading(outlined: false)[*#title*] - ] - ] -] - -doc -} +#import "common.typ": colors #let form(title, ..fields) = { grid( diff --git a/templates/tmpl_doc.typ b/templates/tmpl_doc.typ new file mode 100644 index 0000000..737bbd6 --- /dev/null +++ b/templates/tmpl_doc.typ @@ -0,0 +1,92 @@ +#import "common.typ": common, colors + +#let tmpl_doc( + title: none, + changes: (), + doc, +) = { + show: doc => common(title: title, doc) + + set enum( + numbering: "(1)" + ) + set text( + size: 12pt, + ) + + // Titelblatt + align(center)[ + #image("lightmode-swablab.png", width: 70%) + + #pad(top: 2em, bottom: 2em)[ + #text(1.75em, font: "Ubuntu", hyphenate: false)[ + #heading(outlined: false)[*#title*] + ] + ] + + #changes.at(-3) - #changes.at(-2) \ + swablab e.V. \ + Katharinenstr. 1 \ + 72250 Freudenstadt + ] + + set page( + footer: [ + #text(size: 10pt, fill: colors.subtext)[#changes.at(-3)] + #h(2fr) + #text(size: 10pt, fill: colors.subtext)[#counter(page).display()] + ], + margin: (bottom: 2.5cm) + ) + + // Inhaltsverzeichnis + show heading: it => [ + #v(2.25em, weak: true) + #set text(font: "Ubuntu", 18pt) + #strong[#it.body] + #v(1.25em, weak: true) + ] + + outline(title: [*Inhaltsverzeichnis*]) + + set par( + leading: 1em, + ) + + pagebreak() + + // Formatierung Inhalt + set heading(numbering: "§1") + show heading: it => [ + #v(2.25em, weak: true) + #set text(font: "Ubuntu", 18pt) + #strong[ + #counter(heading).display() + #it.body + ] + #v(1.25em, weak: true) + ] + + // Inhalt + doc + + pagebreak() + + // Änderungen + set heading(numbering: none) + show heading: it => [ + #set text(font: "Ubuntu", 18pt) + #strong[#it.body] + #v(1.25em, weak: true) + ] + block(breakable: false)[ + #heading([Änderungen]) + #table( + columns: (auto, auto, 1fr), + inset: 8pt, + align: auto, + stroke: 0.5pt, + [*Version*], [*Änderungsdatum*], [*Änderungen*], + ..changes + )] +} \ No newline at end of file diff --git a/templates/tmpl_letter.typ b/templates/tmpl_letter.typ new file mode 100644 index 0000000..8c8736e --- /dev/null +++ b/templates/tmpl_letter.typ @@ -0,0 +1,100 @@ +#import "tmpl_page.typ": tmpl_page +#import "common.typ": colors + +#let tmpl_letter( + title: none, + address: none, + info: none, + footer: none, + doc, +) = { + show: doc => tmpl_page( + title: title, + version: "", + change_date: "", + doc, + ) + + // DIN 5008 Sichtfenster: 45mm + place( + top+left, + dx: 7mm, + dy: 25mm, + )[ + #text(size: 0.75em)[ + #underline[swablab e.V. - Katharinenstr. 1 - 72250 Freudenstadt] + ] + + #address + ] + + // DIN 5008 Faltmarke 1: 87mm + place( + top+left, + dy: 67mm, + dx: -1cm, + line( + length: -1em, + stroke: 0.5pt + colors.subtext + ) + ) + // DIN 5008 Faltmarke 2: 192mm + place( + top+left, + dy: 172mm, + dx: -1cm, + line( + length: -1em, + stroke: 0.5pt + colors.subtext + ) + ) + + // DIN 5008 Informationsblock: 50mm + place( + top+right, + dy: 30mm, + )[ + #v(1em) + #info + ] + + // DIN 5008 nach Faltmarke 1 + place( + top+left, + dy: 67mm, + doc + ) + + // Footer + place(bottom+left)[ + #footer + + #text(size: 0.7em, fill: colors.subtext)[ + #table( + stroke: none, + align: top+left, + columns: (1fr,1fr,auto,1fr,1fr), + [*Telefon*],[*E-Mail / Web*],[*Bankverbindung*],[*Vereinsregister*],[*Vorstand*], + [ + +49 15679232971 + ], + [ + info\@swablab.de \ + https://swablab.de + ], + [ + VR-Bank Dornstetten-Horb \ + DE12 6426 2408 0125 6340 05 + ], + [ + VR 724909 \ + Amtsgericht Stuttgart + ], + [ + Fabian Haas \ + Manuel Knodel + ], + ) + ] + ] +} \ No newline at end of file diff --git a/templates/tmpl_page.typ b/templates/tmpl_page.typ new file mode 100644 index 0000000..a2c8256 --- /dev/null +++ b/templates/tmpl_page.typ @@ -0,0 +1,36 @@ +#import "common.typ": common, colors + +#let tmpl_page( + title: none, + version: none, + change_date: none, + doc, +) = { + show: doc => common(title: title, doc) + + set page( + footer: [ + #text(size: 10pt, fill: colors.subtext)[#version] + #h(2fr) + #text(size: 10pt, fill: colors.subtext)[#change_date] + ], + ) + + // Logo + place( + top + right, + dx: 2.5em, + dy: -2.5em, + image("lightmode-swablab.png", width: 25%) + ) + + block(width: 100%-70pt, height: 70pt)[ + #par(justify: false)[ + #text(font: "Ubuntu", 18pt)[ + #heading(outlined: false)[*#title*] + ] + ] + ] + + doc +} \ No newline at end of file diff --git a/werkstatt-agb.typ b/werkstatt-agb.typ index e196396..5d77879 100644 --- a/werkstatt-agb.typ +++ b/werkstatt-agb.typ @@ -1,6 +1,6 @@ -#import "templates/doc.typ": tmpl +#import "templates/tmpl_doc.typ": tmpl_doc -#show: doc => tmpl( +#show: doc => tmpl_doc( title: "Allgemeine Geschäftsbedingungen (AGB)", changes: ( [v1.0], [23.06.2023], [erste Fassung], diff --git a/werkstatt-regeln.typ b/werkstatt-regeln.typ index cb562e1..5f3fcb1 100644 --- a/werkstatt-regeln.typ +++ b/werkstatt-regeln.typ @@ -1,6 +1,6 @@ -#import "templates/form.typ": tmpl +#import "templates/tmpl_page.typ": tmpl_page -#show: doc => tmpl( +#show: doc => tmpl_page( title: "Verhaltensregeln Werkstatt", version: "v1.0", change_date: "09.09.2023",