Invoiceplane: Difference between revisions

From NixOS Wiki
imported>Onny
Upgrade instructions
Onny (talk | contribs)
Remove unstable notice
 
(8 intermediate revisions by 2 users not shown)
Line 10: Line 10:


After that Invoiceplane will be available at http://localhost . Complete the setup by choosing your default language and setting up your user profile.
After that Invoiceplane will be available at http://localhost . Complete the setup by choosing your default language and setting up your user profile.
It is recommended to disable the setup wizard after installation is complete. Add following arguments to the settings option:
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
services.invoiceplane.sites."localhost".settings = {
  DISABLE_SETUP=true;
  SETUP_COMPLETED=true;
};
</nowiki>}}


== Configuration ==
== Configuration ==
Line 25: Line 34:
     src = pkgs.fetchgit {
     src = pkgs.fetchgit {
       url = "https://git.project-insanity.org/onny/invoiceplane-vtdirektmarketing.git";
       url = "https://git.project-insanity.org/onny/invoiceplane-vtdirektmarketing.git";
       sha256 = "1hh0q7wzsh8v8x03i82p6qrgbxr4v5fb05xylyrpp975l8axyg2z";
       rev = "0c5807132ea6cecdb9d031d9b61e478d371f7607";
      hash = "sha256-sVunmCWRYcZwADQLhQHiuU4faMB05hEqwH1/os1Rxqo=";
     };
     };
     sourceRoot = ".";
     makeFlags = [ "DESTDIR=$(out)" ];
    installPhase = ''
      mkdir -p $out
      cp invoiceplane-vtdirektmarketing/vtdirektmarketing.php $out/
    '';
   };
   };


in {
in {


    services.invoiceplane.sites."localhost" = {
  services.invoiceplane.sites."localhost" = {
      enable = true;
    enable = true;
      invoiceTemplates = [ template-vtdirektmarketing ];
    invoiceTemplates = [ template-vtdirektmarketing ];
    };
  };


}
}
Line 51: Line 57:


=== Recurring invoices ===
=== Recurring invoices ===
{{Note|Parts of this instruction and module are not yet stable and will be available in the upcoming NixOS 22.11 release.}}


See [https://wiki.invoiceplane.com/en/1.5/modules/recurring-invoices upstream documentation] on how to configure recurring. invoices. This feature requires a cron task setup which queries the Invoiceplane backend every few minutes. This can be configured with the Invoiceplane module as follows
See [https://wiki.invoiceplane.com/en/1.5/modules/recurring-invoices upstream documentation] on how to configure recurring. invoices. This feature requires a cron task setup which queries the Invoiceplane backend every few minutes. This can be configured with the Invoiceplane module as follows
Line 64: Line 68:


Replace the cron key value with the one given in the Invoiceplane administration web interface.
Replace the cron key value with the one given in the Invoiceplane administration web interface.
=== Electronic invoice ===
To enable electronic invoicing using the [http://zugferd.org standard ZUGFeRD], we can hardcode the activation into the InvoicePlane source code. Otherwise it has to be manually enabled in the settings menu of the web app.
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
nixpkgs = {
  overlays = [
    (self: super: {
      invoiceplane = super.invoiceplane.overrideAttrs (oldAttrs: rec {
        postFixup = ''
          sed -i 's/\$include_zugferd = .*/$include_zugferd = true;/g' $out/application/helpers/pdf_helper.php
        '';
      });
    })
  ];
};
</nowiki>}}
Enabling this via <code>settings</code> option is [https://github.com/InvoicePlane/InvoicePlane/issues/999 not yet possible].


== Maintenance ==
== Maintenance ==
Line 69: Line 93:
=== Upgrading to new versions ===
=== Upgrading to new versions ===


After upgrading to a new version of Invoiceplane, change following two lines of your Invoiceplane config. The path to the file
After upgrading to a new version of Invoiceplane, change following two lines of your Invoiceplane config to re-enable the setup wizard, required for database upgrades.
<code>ipconfig.php</code> depends on the hostname you configured.
 
{{file|/var/lib/invoiceplane/localhost/ipconfig.php|nix|<nowiki>
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
DISABLE_SETUP=false
services.invoiceplane.sites."localhost".settings = {
SETUP_COMPLETED=false
  DISABLE_SETUP=false;
  SETUP_COMPLETED=false;
};
</nowiki>}}
</nowiki>}}


Access your Invoiceplane instance again in your browser and rerun the setup wizard which now reappears. After upgrading the tables you can login as usual. It is now recommended to change both variables in the config file above back to <code>true</code>.
Access your Invoiceplane instance again in your browser and rerun the setup. After upgrading the tables you can login as usual. It is now recommended to change both variables in the config file above back to <code>true</code>.


== See also ==
== See also ==
* [[Crater]], alternative self-hosted invoicing application
* [[Crater]], alternative self-hosted invoicing application


[[Category:Server]]
[[Category:Web Applications]]
[[Category:Web Applications]]

Latest revision as of 08:08, 31 May 2024

Invoiceplane is a web application for managing invoices, clients and payments.

Installation

To setup Invoiceplane locally, this is the most minimal configuration to get started

/etc/nixos/configuration.nix
services.invoiceplane.sites."localhost".enable = true;

After that Invoiceplane will be available at http://localhost . Complete the setup by choosing your default language and setting up your user profile.

It is recommended to disable the setup wizard after installation is complete. Add following arguments to the settings option:

/etc/nixos/configuration.nix
services.invoiceplane.sites."localhost".settings = {
  DISABLE_SETUP=true;
  SETUP_COMPLETED=true;
};

Configuration

Invoice templates

Invoiceplane will render and export invoices as PDF. You can create your own invoice templates or reuse existing ones. The following example fetches an invoice template and makes it available to your running Invoiceplane instance

/etc/nixos/configuration.nix
{ config, pkgs, lib, ... }:
let

  template-vtdirektmarketing = pkgs.stdenv.mkDerivation {
    name = "vtdirektmarketing";
    src = pkgs.fetchgit {
      url = "https://git.project-insanity.org/onny/invoiceplane-vtdirektmarketing.git";
      rev = "0c5807132ea6cecdb9d031d9b61e478d371f7607";
      hash = "sha256-sVunmCWRYcZwADQLhQHiuU4faMB05hEqwH1/os1Rxqo=";
    };
    makeFlags = [ "DESTDIR=$(out)" ];
  };

in {

  services.invoiceplane.sites."localhost" = {
    enable = true;
    invoiceTemplates = [ template-vtdirektmarketing ];
  };

}

Invoice mail delivery

There are several methods to automatically deliver invoices via mail. First we have to configure which mail backend to use. One method which is confirmed to work on NixOS is to use sendmail. Using a configured program like Msmtp to relay mails from your server using your existing mail provider. Unfortunately it is not yet possible to configure the mail backend with extraSettings. In this case navigate in the web interface to: Settings → System settings → E-Mail and set mail delivery method to Sendmail.

Invoices can be send directly while editing them. It is also possible to create a common mail template which can be reused. Go to Settings → Mail templates. To configure a default mail template, go to Settings → System settings → Invoices.

Recurring invoices

See upstream documentation on how to configure recurring. invoices. This feature requires a cron task setup which queries the Invoiceplane backend every few minutes. This can be configured with the Invoiceplane module as follows

/etc/nixos/configuration.nix
services.invoiceplane.sites."localhost" = {
  cron.enable = true;
  cron.key = "1234";
};

Replace the cron key value with the one given in the Invoiceplane administration web interface.

Electronic invoice

To enable electronic invoicing using the standard ZUGFeRD, we can hardcode the activation into the InvoicePlane source code. Otherwise it has to be manually enabled in the settings menu of the web app.

/etc/nixos/configuration.nix
nixpkgs = {
  overlays = [
    (self: super: {
      invoiceplane = super.invoiceplane.overrideAttrs (oldAttrs: rec {
        postFixup = ''
          sed -i 's/\$include_zugferd = .*/$include_zugferd = true;/g' $out/application/helpers/pdf_helper.php
        '';
      });
    })
  ];
};

Enabling this via settings option is not yet possible.

Maintenance

Upgrading to new versions

After upgrading to a new version of Invoiceplane, change following two lines of your Invoiceplane config to re-enable the setup wizard, required for database upgrades.

/etc/nixos/configuration.nix
services.invoiceplane.sites."localhost".settings = {
  DISABLE_SETUP=false;
  SETUP_COMPLETED=false;
};

Access your Invoiceplane instance again in your browser and rerun the setup. After upgrading the tables you can login as usual. It is now recommended to change both variables in the config file above back to true.

See also

  • Crater, alternative self-hosted invoicing application