Chapter 5. How to...

5.1. How to use Skrooge in my language?
5.2. How to set default currency and date format?
5.3. How to reduce the size of my document?
5.4. How to define a new invoice extractor?

5.1.

How to use Skrooge in my language?

Check if Skrooge is well translated to your language and if you have installed all packages for Skrooge provided by your distribution.

5.2.

How to set default currency and date format?

Default currency and date format are retrieved from Plasma™'s System Settings. Some distributions do not ship it with Skrooge. In such case you should install it through your distribution's package manager.

You can then start it in a console: systemsettings5

And select your preferred settings, in the Format section.

5.3.

How to reduce the size of my document?

The size of your document can be very important. If you delete some old transactions, the size will increase. This is normal because Skrooge keeps the history of all modifications for the undo/redo mechanism. So if you want to reduce the size of your document, you just have to clear the history.

5.4.

How to define a new invoice extractor?

Skrooge uses pdftotext to extract all strings of a PDF. After that, it uses a text file describing how to find key values. If you want to define a new invoice extractor, you have to do that:

  • Launch pdftotext on your PDF file

  • Open the text file generated and the corresponding PDF file

  • Create a new text with an extension .extractor. Example: google.extractor

  • Your file must be like this:

    	payee=REGEXPCAP:^(Biofan) SPRL$
    	date=REGEXPCAP:^Order Date: (.*)$
    	dateformat=dd MMM yyyy
    	number=REGEXPCAP:^N° de facture (.*)$
    	mode=SET:Carte
    	comment=REGEXPCAP:^N° de commande (.*)$|SET:Commande %1
    	amount=REGEXP:^Montant global:$|LINEOFFSET:2
    	

    Each attribute (payee, date, number, mode, comment and amount) use the same syntax: COMMAND:value|COMMAND:value|...

    The command can be:

    • REGEXPCAP: This is a regular expression capturing a value

    • REGEXP: To find the line in the file matching a regular expression

    • LINEOFFSET: To change the line index.

    • SET: To force the value. Can be used as first command or after the REGEXPCAP (see example).

    dateformat is the format of the date extracted.

  • Put this file into the same directory as all other .extractor files