Org mode calculation for VAT tax return
=======================================

The fiscal year 2023 has come to a conclusion, and the final VAT tax
return must be made.

Each quarter, small enterprises in the Netherlands must file their VAT
tax return. This must be completed within the first month following
the conclusion of the quarter. The VAT tax return for the first
quarter is due in April, the VAT tax return for the second quarter is
due in July, and so on.

The closing tax return is the VAT tax return for the fourth quarter.
Of course, the total of the four quarterly VAT tax returns must match
the general ledger for the entire year.

I normally create a spreadsheet at the end of the year to discover any
discrepancies between the sum of the quarterly VAT tax returns and the
balance sheet.

LibreOffice
-----------
LibreOffice is the go-to open source spreadsheets application.
Recently I migrated my Lenovo ThinkPad X201 from OpenBSD to FreeBSD.
I haven't installed LibreOffice on it yet.

`pkg install libreoffice' revealed a whopping 1 GB of packages to
install, including the dependencies. I decided not to give the OK for
this, and rather search for another solution.

Emacs org mode
--------------
Emacs org mode makes it easy to create and format tables in plain
text. The command `Ctrl-c +' (`org-table-sum') sums the numbers in the
current column. The result is shown in the echo area and can be
inserted with the paste command `Ctrl-y'. See [1].

I created a table with the numbers stated on the four quarterly tax
returns (three filed and one to file) and for each column let Emacs
calculate the sum.

For the final check I did some calculations using the brilliant
RPN command line calculator `dc'.
See [2].

Everything in plain text
------------------------
With the help of Emacs, my whole financial system is now in plain
text:

* Invoices: home made script creates Postscript invoices

* Bank account transactions: a CSV file provided by the bank

* Double-entry accounting system: ledger
 See [3]

* Spreadsheet: Emacs org mode tables

* Command line RPN calculator: dc

The accounting requires little human keyboard entries. I use a Perl
script to generate ledger journal items from the bank account CSV
file. When I create an invoice with my custom Lisp script, it also
adds an item to the ledger journal. Only procurement invoices must be
manually put into the ledger journal.

[1]: https://orgmode.org/manual/Built_002din-Table-Editor.html
[2]: https://en.wikipedia.org/wiki/Dc_(computer_program)
[3]: https://ledger-cli.org/


Last edited: $Date: 2024/01/13 15:41:18 $