diff --git a/Makefile b/Makefile index e70922d..cd08b73 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,3 @@ install: mkdir -p $(DESTDIR) - cp vtdirektmarketing.php $(DESTDIR)/ + cp heinrichmalerbetrieb.php $(DESTDIR)/ diff --git a/README.md b/README.md index e69de29..496e4db 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,56 @@ +## Invoiceplane Template for Heinrich-Malerbetrieb.de + +### Setup + +Run development server + +``` +nix run +``` + +Visit http://localhost:8080 , run the setup and after login browse to system settings. In the sub menu invoice, change default PDF template to `heinrichmalerbetrieb`. + +### Configuration + +General default settings which should be set + + - User profile (company contact information), such as mail, address, phone and mail + - System settings in general and invoice: Upload company logo for login and invoice logo + (WebP image format currently not supported https://github.com/InvoicePlane/InvoicePlane/issues/1189 ). + - System settings - invoice + - Enable embed ZUGFeRD XML into PDF (e-invoice) + - PDF footer + +``` + + + + + + + + +
Seite: {PAGENO}/{nb}
+``` + + - System settings - general, currency settings + - Change symbol to: € + - Symbol after sum with space + - Currency code EUR + - Number format to European format + - System settings - general, time format: j.n.Y + - Product units: m², Std. diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..144a9c8 --- /dev/null +++ b/flake.lock @@ -0,0 +1,28 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1741310760, + "narHash": "sha256-aizILFrPgq/W53Jw8i0a1h1GZAAKtlYOrG/A5r46gVM=", + "ref": "nixpkgs-unstable", + "rev": "de0fe301211c267807afd11b12613f5511ff7433", + "shallow": true, + "type": "git", + "url": "https://github.com/NixOS/nixpkgs" + }, + "original": { + "ref": "nixpkgs-unstable", + "shallow": true, + "type": "git", + "url": "https://github.com/NixOS/nixpkgs" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..bcbe309 --- /dev/null +++ b/flake.nix @@ -0,0 +1,72 @@ +{ + description = "Invoiceplane invoice template development shell"; + + inputs.nixpkgs.url = "nixpkgs/nixos-25.05"; + + outputs = { self, nixpkgs, ... }@inputs: + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + start = + pkgs.writeShellScriptBin "start" '' + set -e + export QEMU_NET_OPTS="hostfwd=tcp::8080-:80" + ${pkgs.nixos-shell}/bin/nixos-shell --flake . + ''; + in { + nixosConfigurations.vm = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs.inputs = inputs; + pkgs = import nixpkgs { + overlays = [ + (self: super: { + invoiceplane = super.invoiceplane.overrideAttrs (oldAttrs: rec { + # Add new page numbers support + patches = oldAttrs.patches ++ [ + (fetchpatch { + url = "https://github.com/InvoicePlane/InvoicePlane/commit/bfcf81266399575e90b83612d59b457d76e3538e.patch"; + hash = ""; + }) + ]; + installPhase = oldAttrs.installPhase + '' + rm -r $out/application/views/invoice_templates/pdf + ln -sf /var/lib/invoiceplane/localhost/pdf $out/application/views/invoice_templates/pdf + ''; + }); + }) + ]; + }; + modules = [ + ({ lib, config, pkgs, ... }: { + + services.invoiceplane.sites."localhost" = { + enable = true; + settings.IP_URL = "http://localhost:8080"; + }; + + nixos-shell.mounts.extraMounts = { + "/var/lib/invoiceplane/localhost/pdf" = { + target = /home/onny/projects/invoiceplane-heinrichmalerbetrieb; + cache = "none"; + }; + }; + + system.stateVersion = "25.05"; + services.getty.autologinUser = "root"; + documentation = { + info.enable = false; + man.enable = false; + nixos.enable = false; + }; + nix = { + registry.nixpkgs.flake = inputs.nixpkgs; + settings.experimental-features = [ "nix-command" "flakes" ]; + }; + }) + ]; + }; + + packages = { inherit start; }; + defaultPackage.x86_64-linux = start; + + }; +} diff --git a/heinrichmalerbetrieb.php b/heinrichmalerbetrieb.php new file mode 100755 index 0000000..8fca80b --- /dev/null +++ b/heinrichmalerbetrieb.php @@ -0,0 +1,319 @@ + + + + + <?php _trans('invoice'); ?> + + + + + +
+ + + +
+ Heinrich GmbH • Blumenstraße 16-18 • 75233 Tiefenbronn +
+ client_email && $custom_fields['invoice']['Via Email']) { + echo 'per Email: ' . $invoice->client_email . '
'; + } ?> + client_title) { + echo $invoice->client_title . '
'; + } ?> + client_name) { + echo $invoice->client_name; + } ?> + client_surname) { + echo $invoice->client_surname; + } ?> +
+ client_vat_id) { + echo '
' . trans('vat_id_short') . ': ' . $invoice->client_vat_id . '
'; + } + if ($invoice->client_tax_code) { + echo '
' . trans('tax_code_short') . ': ' . $invoice->client_tax_code . '
'; + } + if ($invoice->client_address_1) { + echo '
' . htmlsc($invoice->client_address_1) . '
'; + } + if ($invoice->client_address_2) { + echo '
' . htmlsc($invoice->client_address_2) . '
'; + } + + echo '
'; + + if ($invoice->client_city || $invoice->client_state || $invoice->client_zip) { + echo '
'; + if ($invoice->client_zip) { + echo htmlsc($invoice->client_zip) . ' '; + } + if ($invoice->client_city) { + echo htmlsc($invoice->client_city); + } + echo '
'; + } ?> + +
+
+ user_address_1) { + echo '
' . htmlsc($invoice->user_address_1) . '
'; + } + if ($invoice->user_address_2) { + echo '
' . htmlsc($invoice->user_address_2) . '
'; + } + if ($invoice->user_city || $invoice->user_state || $invoice->user_zip) { + echo '
'; + if ($invoice->user_zip) { + echo htmlsc($invoice->user_zip) . ' '; + } + if ($invoice->user_city) { + echo htmlsc($invoice->user_city); + } + echo '
'; + } + if ($invoice->user_country) { + echo '
' . get_country_name(trans('cldr'), $invoice->user_country) . '
'; + } + + if ($invoice->user_vat_id) { + echo '
' . trans('vat_id_short') . ': ' . $invoice->user_vat_id . '
'; + } + if ($invoice->user_tax_code) { + echo '
' . trans('tax_code_short') . ': ' . $invoice->user_tax_code . '
'; + } + + if ($invoice->user_phone) { + echo '
' . trans('phone_abbr') . ': ' . htmlsc($invoice->user_phone) . '
'; + } + if ($invoice->user_fax) { + echo '
' . trans('fax_abbr') . ': ' . htmlsc($invoice->user_fax) . '
'; + } + if ($invoice->user_email) { + echo '
' . htmlsc($invoice->user_email) . '
'; + } + if ($invoice->user_web) { + echo '
' . htmlsc($invoice->user_web) . '
'; + } + ?> +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + +
Rechnung Nr.:invoice_number; ?>
(Bitte bei Zahlungen immer angeben.)
invoice_date_created, true); ?>
payment_method_name); ?>
+
+ +

+ ' . $rechnungs_betreff . '

'; + } + if ($rechnungs_text) { + echo '

' . $rechnungs_text . '

'; + } + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + invoice_item_tax_total > 0) { ?> + + + + + + + + + + + + + + invoice_discount_percent != '0.00') : ?> + + + + + + invoice_discount_amount != '0.00') : ?> + + + + + + + + + + +
Gesamt
item_name); ?>item_description)); ?> + item_quantity); ?> + item_product_unit) : ?> +
+ item_product_unit); ?> + +
+ item_price); ?> + + item_discount); ?> + + item_total); ?> +
class="text-right"> + Summe + invoice_item_subtotal); ?>
class="text-right"> + 19% MwSt. + + invoice_item_tax_total); ?> +
class="text-right"> + invoice_tax_rate_name) . ' (' . format_amount($invoice_tax_rate->invoice_tax_rate_percent) . '%)'; ?> + + invoice_tax_rate_amount); ?> +
class="text-right"> + + + invoice_discount_percent); ?>% +
class="text-right"> + + + invoice_discount_amount); ?> +
class="text-right"> + Endsumme + + invoice_balance); ?> +
+ +
+ + + +
+ Zahlungsbedingungen: zahlbar ab Rechnungsdatum innerhalb 8 Tagen rein netto. +

+Bitte überweisen Sie den Rechnungsbetrag unter Angabe der Rechnungsnummer auf unser Geschäftskonto. Vielen Dank.

+Wir weisen Sie darauf hin, dass Sie nach § 14b Abs. 1 S. 5 UStG verpflichtet sind, diese Rechnung zwei Jahre lang aufzubewahren.

+
+ + + + + + diff --git a/logo.png b/logo.png new file mode 100644 index 0000000..0e786c8 Binary files /dev/null and b/logo.png differ diff --git a/logo.webp b/logo.webp new file mode 100644 index 0000000..fbdc420 Binary files /dev/null and b/logo.webp differ diff --git a/logo_subtext.png b/logo_subtext.png new file mode 100644 index 0000000..8f89f84 Binary files /dev/null and b/logo_subtext.png differ diff --git a/logo_subtext.webp b/logo_subtext.webp new file mode 100644 index 0000000..3ac7ad6 Binary files /dev/null and b/logo_subtext.webp differ diff --git a/vtdirektmarketing.php b/vtdirektmarketing.php deleted file mode 100755 index 51180bd..0000000 --- a/vtdirektmarketing.php +++ /dev/null @@ -1,269 +0,0 @@ - - - - - <?php _trans('invoice'); ?> - - - - -
- - - - - -
-
-
-

:

-


- client_name; ?>
- client_address_1) { - echo $invoice->client_address_1 . '
'; - } ?> - client_address_2) { - echo $invoice->client_address_2 . '
'; - } ?> - client_zip) { - echo $invoice->client_zip . ' '; - } ?> - client_city) { - echo $invoice->client_city . '

'; - } ?> - client_phone) { ?> - Tel: client_phone; ?>
- -

-
-
-
- - user_name; ?> -

- user_address_1) { - echo $invoice->user_address_1 . '
'; - }?> - user_address_2) { - echo $invoice->user_address_2 . '
'; - } ?> - user_zip) { - echo $invoice->user_zip . ' '; - } ?> - - user_city) { - echo $invoice->user_city . '

'; - } ?> - - user_tax_code) { - echo '

' . trans('tax_code_short') . ': ' . $invoice->user_tax_code . '
'; - } ?> - - user_phone) { - ?>Tel: user_phone; ?>
-

-
-
-
- - - - - - - - - - - - - - - -
- : - - invoice_date_created, TRUE); ?> -
- : - - invoice_date_due, TRUE); ?> -
- : - - invoice_balance); ?> -
-
- -
-
-
- -
-

Nr. invoice_number; ?>

- Leistungszeitraum: bis
- Leistungsort:
-
- -
- - - - - - - - - - - - - - - - - - - - - - -
MengeEPGesamt
item_name; ?>item_description); ?> - item_quantity); ?> - item_product_unit) : ?> - item_product_unit); ?> - - - item_price); ?> - - item_subtotal); ?> -
-
- - - - -
- - - - - - - - - - - - - -
- Nettosumme: - - invoice_item_subtotal); ?> -
- 0% MwSt: - - 0,00 € -
- Gesamtbetrag: - - invoice_balance) ?> -
-
-
-
- - - - -