update flake, changes to template

This commit is contained in:
Jonas Heinrich 2025-01-07 10:08:03 +01:00
parent ad63f6f0df
commit cb747de19a
6 changed files with 67 additions and 50 deletions

View file

@ -0,0 +1,18 @@
## 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

15
flake.lock generated
View file

@ -2,17 +2,18 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1735531152,
"narHash": "sha256-As8I+ebItDKtboWgDXYZSIjGlKeqiLBvjxsQHUmAf1Q=",
"owner": "NixOS",
"lastModified": 1736100068,
"narHash": "sha256-wtipqLxpphkpxTGJvVuej+msDzABUfWm5TeO31d00MY=",
"owner": "onny",
"repo": "nixpkgs",
"rev": "3ffbbdbac0566a0977da3d2657b89cbcfe9a173b",
"rev": "68a0940f753446728b57c74db999ab08421e9d46",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-24.11",
"type": "indirect"
"owner": "onny",
"ref": "invoiceplane-https",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {

View file

@ -1,7 +1,8 @@
{
description = "Invoiceplane invoice template development shell";
inputs.nixpkgs.url = "nixpkgs/nixos-24.11";
#inputs.nixpkgs.url = "nixpkgs/nixos-24.11";
inputs.nixpkgs.url = "github:onny/nixpkgs/invoiceplane-https";
outputs = { self, nixpkgs, ... }@inputs:
let
@ -33,12 +34,18 @@
services.invoiceplane.sites."localhost" = {
enable = true;
settings.IP_URL = "http://localhost:8080";
settings = {
IP_URL = "http://localhost:8080";
#DISABLE_SETUP = true;
#SETUP_COMPLETED = true;
};
};
services.caddy.virtualHosts."localhost".hostName = "http://localhost";
nixos-shell.mounts.extraMounts = {
"/var/lib/invoiceplane/localhost/pdf" = {
target = /home/onny/projects/invoiceplane-heinrichmalerbetrieb;
target = ./.;
cache = "none";
};
};

View file

@ -6,11 +6,23 @@
<link rel="stylesheet"
href="<?php echo base_url(); ?>assets/<?php echo get_setting('system_theme', 'invoiceplane'); ?>/css/templates.css">
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/core/css/custom-pdf.css">
<style>
.highlight {
color: #050582;
}
.logo {
width: 200px;
float: right;
}
.company {
font-size: 0.8rem;
}
</style>
</head>
<body>
<header class="clearfix">
<div id="logo">
<div id="logo" class="logo">
<?php echo invoice_logo_pdf(); ?>
</div>
@ -31,22 +43,19 @@
if ($invoice->client_address_2) {
echo '<div>' . htmlsc($invoice->client_address_2) . '</div>';
}
echo '<br/>';
if ($invoice->client_city || $invoice->client_state || $invoice->client_zip) {
echo '<div>';
if ($invoice->client_city) {
echo htmlsc($invoice->client_city) . ' ';
}
if ($invoice->client_state) {
echo htmlsc($invoice->client_state) . ' ';
}
if ($invoice->client_zip) {
echo htmlsc($invoice->client_zip);
echo htmlsc($invoice->client_zip) . ' ';
}
if ($invoice->client_city) {
echo htmlsc($invoice->client_city);
}
echo '</div>';
}
if ($invoice->client_country) {
echo '<div>' . get_country_name(trans('cldr'), $invoice->client_country) . '</div>';
}
echo '<br/>';
@ -55,8 +64,7 @@
} ?>
</div>
<div id="company">
<div><?php _htmlsc($invoice->user_name); ?></div>
<div id="company" class="company">
<?php if ($invoice->user_address_1) {
echo '<div>' . htmlsc($invoice->user_address_1) . '</div>';
}
@ -65,14 +73,11 @@
}
if ($invoice->user_city || $invoice->user_state || $invoice->user_zip) {
echo '<div>';
if ($invoice->user_city) {
echo htmlsc($invoice->user_city) . ' ';
}
if ($invoice->user_state) {
echo htmlsc($invoice->user_state) . ' ';
}
if ($invoice->user_zip) {
echo htmlsc($invoice->user_zip);
echo htmlsc($invoice->user_zip) . ' ';
}
if ($invoice->user_city) {
echo htmlsc($invoice->user_city);
}
echo '</div>';
}
@ -80,8 +85,6 @@
echo '<div>' . get_country_name(trans('cldr'), $invoice->user_country) . '</div>';
}
echo '<br/>';
if ($invoice->user_vat_id) {
echo '<div>' . trans('vat_id_short') . ': ' . $invoice->user_vat_id . '</div>';
}
@ -89,14 +92,18 @@
echo '<div>' . trans('tax_code_short') . ': ' . $invoice->user_tax_code . '</div>';
}
echo '<br/>';
if ($invoice->user_phone) {
echo '<div>' . trans('phone_abbr') . ': ' . htmlsc($invoice->user_phone) . '</div>';
}
if ($invoice->user_fax) {
echo '<div>' . trans('fax_abbr') . ': ' . htmlsc($invoice->user_fax) . '</div>';
}
if ($invoice->user_email) {
echo '<div class="highlight">' . htmlsc($invoice->user_email) . '</div>';
}
if ($invoice->user_web) {
echo '<div class="highlight">' . htmlsc($invoice->user_web) . '</div>';
}
?>
</div>
@ -129,22 +136,6 @@
<h1 class="invoice-title"><?php echo trans('invoice') . ' ' . $invoice->invoice_number; ?></h1>
<?php
$leistungsort = $custom_fields['invoice']['leistung_ort'];
$leistung_von = $custom_fields['invoice']['leistung_von'];
$leistung_bis = $custom_fields['invoice']['leistung_bis'];
if ($leistung_von && $leistung_bis) {
$leistung_von = new DateTime($leistung_von);
$leistung_bis = new DateTime($leistung_bis);
$leistung_von = $leistung_von->format('d.m.Y');
$leistung_bis = $leistung_bis->format('d.m.Y');
echo '<div>Leistungszeitraum: ' . $leistung_von . ' bis ' . $leistung_bis . '</div>';
}
if ($leistungsort) {
echo '<div>Leistungsort: ' . $leistungsort . '</div>';
}
?>
<table class="item-table">
<thead>
<tr>

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 KiB

BIN
logo.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB