Skip to content

bjoernalbers/belegnr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

81 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

belegnr โ€” Generate sequential, unique document numbers (Belegnummern) ๐Ÿ“„

belegnr is a simple shell script to make you and the Finanzamt happy :-)

Why?

I do my accounting with sevdesk and am generally quite happy with it. But one thing bothers me: sevdesk does not automatically generate unique document numbers, which are required by the German Federal Ministry of Finance (Bundesfinanzministerium):

Jedem Geschรคftsvorfall muss ein Beleg zugrunde liegen, mit folgenden Inhalten:

  • Eindeutige Belegnummer (z. B. Index, Paginiernummer, Dokumenten-ID, fortlaufende Rechnungsausgangsnummer)
  • ...

Source: GoBD, issue 2023

(Using external invoice numbers as document numbers does not guarantee uniqueness.)

belegnr helps with my bookkeeping by creating sequential, unique document numbers a.k.a. Belegnummern.

Installation

The macOS installer will install belegnr under /usr/local/bin/belegnr.

To install it manually:

sudo curl -fsSL -o /usr/local/bin/belegnr \
    https://github.com/bjoernalbers/belegnr/releases/latest/download/belegnr \
    && sudo chmod +x /usr/local/bin/belegnr

You can also clone this repository and run make install.

Here is a macOS shortcut to create a new Belegnummer via belegnr and copy it into the clipboard.

Usage

Run belegnr without options (or with -h flag) to display usage instructions:

$ belegnr
belegnr โ€” Generate sequential, unique document numbers (Belegnummern) ๐Ÿ“„

Usage: belegnr [OPTIONS]

Options:
  -c  Create new Belegnummer
  -h  Display this help and exit
  -p  Print current Belegnummer
  -r  Reset counter (~/.belegnr) to given value, i.e. -r 1000

To create a new unique Belegnummer, use the -c flag:

$ belegnr -c
BE-1
$ belegnr -c
BE-2
$ belegnr -c
BE-3

Print the current (latest) Belegnummer with -p:

$ belegnr -p
BE-3

To start at a different number, just reset the counter:

$ belegnr -r 1000
Really reset counter? (y/N): y
BE-1000

The counter is stored in the file ~/.belegnr:

$ cat ~/.belegnr
1000

Uninstallation

Just run this command to remove belegnr:

sudo rm /usr/local/bin/belegnr

About

Generate sequential, unique document numbers (Belegnummern) ๐Ÿ“„

Topics

Resources

License

Stars

Watchers

Forks

Contributors