Inleiding

Kraft is a desktop application to create and organize office documents like quotes and invoices in a small business. It eases the creation of documents and helps with repeating office tasks.

Using Kraft, there is no need for fiddling with a text processor any more. Documents are created by a few clicks, edited, generated and archived automatically. Kraft generates high quality PDF output documents for printing, mailing and archiving.

Overzicht van de mogelijkheden
  • Simple but efficient and beautiful UI.

  • Efficient creation of offers, invoices and similar documents.

  • Customer management, deeply integrated with the mature KDE KAddressbook or an address collection based on a local directory.

  • Maintenance of document relations, featuring partial invoices and final invoices or invoices generated out of offers semi automatically.

  • Text templates for document header- and footertexts and for document items.

  • Catalogues of template items that can be reused.

  • De voorcalculatie van prijzen.

  • Simple material management.

  • Configurable document creation in PDF format for print and email incl. EPC QR code.

  • Support for EPC QR Code and XRechnung

De broncode van Kraft is open source en wordt onder de licentie GNU General Public License vrij gegeven.

Noot
Kraft wordt door een gemeenschap van gebruikers, programmeurs artiesten en anderen vrijwilligers gedragen.
Ook dit gebruikershandboek heeft uw hulp nodig om verbeterd te worden.

Lees hier hierover hoe u kan bijdragen

Eerste gebruik en basisconfiguratie

Als Kraft voor de eerste keer wordt opgestart, dan komt het automatisch in een initiële proces voor het maken van instellingen terecht.

During the initial setup you are asked to select a database type to use and give the name and address of your company.

You can fill in your company address (that appears on the printed documents) in two ways: in the setup procedure use the first tab Select from Addressbook for to select your own address in KAddressBook. For that there must be an entry of your own address in the address book. Alternatively the second tab Manual entry can be used to fill in the information of the address of your company manually. This step is necessary for the correct generation of your documents as the address is automatically used in the document generation step.

To generate the EPC QR Code that can be printed on the output document, the bank account details need to be added as well.

Company address

After the initial setup, select Preferences › Settings. That allows to prepare Kraft correctly for individual needs.

In het dialoogvenster voor de instellingen hebben we de tabs:

*Document Defaults
*Taxes
*Document Types
*Wages
*Units
*Own identity

In elke tab is het mogelijk om voor uw specifieke geval realistische waarden in te voeren.

Document typen

Bij het eerste gebruik vindt u een lijst met verschillende documenttypes, zoals:

  • Acceptance of order (opdrachtbevestiging)

  • Delivery receipt (afleverbon)

  • Invoice (rekening)

  • Offer (offerte)

Document type

Translate this types to your own language. You can also add new ones and remove document types you won’t use.

Uniek documentnummer

Numbercycles Each document has to have a unique identifier that identifies the document. There must not be two documents in Kraft with the same identifier.

The format of the identifier is configurable in Kraft. For that, Kraft has a concept of so called number cycles. Number cycles are used to define the form of the document number which is printed on every document.

All documents of a certain type have identifiers taken out of one number cycle. Each document type has a number cycle assigned. Different document types can use the same number cycle to generate ids from. That way, for example the document types Invoice and Final Invoice can use numbers from the same number cycle, even though they are different document types in Kraft. Number cycles are identified by their name. Users can create new number cycles and edit them clicking on the button Edit Number Cycles…​

The format of the document numbers can be customized by a template. A template can contain normal characters and also some variables that are replaced by the respective values when the document is created.

Each document number needs to be unique, and thus has to contain a counter. Kraft supports two types of counters: One (variable %i) is incremented globally for every new document. The other (variable %n) is reset every day and starts at 1 again on every new day. In addition to the counter, more information can be added to the template to form a useful number. Examples are a constant text or parts of the date.

The default numbercycle delivered with Kraft contains the year, the month and a serial number. That way you can compare offers or orders from last year with this year or the month April of last year with the month April of this year and in this way get an impression from the results of your business.

Zie de volgende tabel voor de beschikbare variabelen die gebruikt kunnen worden:

%y of %yyyy

het jaar van de documentdatum.

%yy

het jaar van de documentdatum (twee cijfers).

%w

het weeknummer van de documentdatum.

%ww

het weeknummer van het documentdatum met een nul (twee cijfers).

%d

de dag van de week als getal van de documentdatum.

%dd

de dag van de week als getal van het documentdatum met een nul (wee cijfers).

%m of %M

de maand van het documentdatum als getal.

%MM

de maand van het documentdatum als getal met een nul (twee cijfers).

%c

de ID van de klant in het kaddressbook

%type

het vertaalde doc type (offerte, rekening enz.)

%uid

het contact id van de klant.

%i .. %iiiiii

de unieke teller (verplicht)

%n .. %nnnnnn

de unieke dagteller (te combineren met de datum)

A number cycle format template needs to contain either %i or %n, if not, %i is appended automatically.

Both %i and %n are numeric values. They can also be padded with leading zeros. The length is defined by the number of i’s or n’s put into the template. For example, if a daily counter with length of three and leading zeros is desired, %nnn has to be put into the template. This works up to a length of six characters.

Noot
The "design" of the numbercycles and document numbers is very important. With the flexible system of templating Kraft can not prevent invalid number cycles. It is the responsibility of the user.

PDF sjabloon

In invoerveld "Sjabloon bestand:" kan de gebruiker een eigen sjabloon opgeven voor dit specifieke documenttype.

If the file extension of the template file is .trml, the ReportLab based document converter is used. If the file extension is .gtmpl, Kraft automatically uses the Weasyprint based converter which is default from Kraft 2.0.

OPMERKING: Het ReportLab systeem voor de PDF creatie wordt in Kraft als verouderd gezien. Gebruikt voor nieuwe sjablonen altijd op Grantlee- en Weasyprint gebaseerde sjablonen.

PDF nabewerking

Nadat Kraft het PDF-document heeft gecreëerd is het mogelijk om de gecreëerde PDF samen te voegen met statische PDFs die die zijn gecreëerd en aangepast door de gebruiker. Hiermee is het makkelijk om eigen briefhoofd met een logo of een watermerk aan de resulterende PDF toe te voegen.

The static PDFs should have the same page size as the generated documents. Keep in mind to use optimized images for logos etc. when preparing the watermark PDF to not blow up the size of the result document.

PDF Postprocessing

De opties voor het watermerk zijn:

  1. No Watermark: No watermark is created

  2. On first page: The first page of the watermark.pdf is merged with the first page of the result document

  3. Watermark on all pages: Merges the first page of the watermark PDF to all pages of the result document

  4. alternating: For this, the watermark PDF needs to have three pages. The first page is merged to the first page of the result document, the second and third page are alternately merged to subsequent pages.

  5. different first and last page: the PDF needs to have three pages. The first page is merged to the first page of the result document, the third page to the last, and the second to all pages between first and last page.

Als een ander statisch PDF document is opgegeven in het vak "Voeg PDF toe:", dan wordt dit aan het eind van de gegenereerde PDF toegevoegd. Daarmee kan Kraft automatisch bijvoorbeeld een blad met de algemene voorwaarden toevoegen aan het uiteindelijke document.

Belastingen

Taxes In many countries there are two kinds of VAT for sold products.

Een hoog tarief en een laag tarief.

Geef hier de toepasselijke waarden op voor het hoge tarief en voor het lage tarief. Als het belastingtarief wijzigt, dan kunt u hier de startdatum met de nieuwe belastingtarieven toevoegen.

Salarissen

A list of wage costs is maintained in Kraft. The items are used in item templates during calculation. Wages

Alle data kan bewerkt en aangepast worden in een configuratiedialoog dat u kunt bereiken via het menu-item 'voorkeuren', waar u ook nieuwe items kunt toevoegen .

Remember that these units are later used in the documents, it is therefore important that you translate them to your own language and to fill in the correct prices.

Eenheden

Units of measurement A list of units of measurement is maintained in Kraft. In Kraft Configuration Dialog reachable through the Settings menu you can edit and customize items already in the list, and you can also add new items to the list.

Remember that these units are later used in the documents, it is therefore important that you translate them to your own language.

Uw eigen identiteit

Controleer hier of de informatie die u heeft opgegeven tijdens de basisconfiguratie correct is voor het gebruik in de documenten.

Waarschuwing
If you made the choice to use the information from KaddressBook then the information from a later manual entry is ignored.

After the configuration is finalized, we go back to the main window which consists of the three main tabs:

  • Documenten

  • Tijdlijn

  • Catalogi

Catalogi

Kraft supports so called Catalogs in which templates for document items are kept. With the catalogs creating documents can be significantly accelerated in the day to day business. When creating new documents, the items templates from the catalogs can be easily selected and moved over to the document.

Omdat sjablonen worden georganiseerd in mappen, kunnen hele documenten worden voorbereid en opgeborgen in verschillende mappen om later als documentsjabloon te worden gebruikt.

Uiteraard kunnen de items in de documenten worden bewerkt nadat ze in een catalogus zijn geselecteerd.

Kraft komt standaard met twee verschillende catalogi:

Material

Een catalogus met materialen die worden verkocht, met hun inkoopprijs, de winst en hun verkoopprijs.

en Standard Templates

Een catalogus met standaard recepten voor werkzaamheden zoals het planten van bomen.

Both catalogs can have chapters and sub-chapters to organize your templates. First we are going to fill in the

Materiaalcatalogus

Een catalogus met materialen die worden verkocht, met hun inkoopprijs, de winst en hun verkoopprijs. Eerst gaan we nieuwe mappen en submappen toevoegen.

Nieuwe mappen

Selecteer met de muis de kolomnaam material, selecteer vervolgens in het contextmenu [Submap toevoegen]

en voeg een extra map zoals Bomen toe

Nieuwe submappen

We are going to add sub chapters in the folder Trees. Select with the mouse the name of the chapter where you like to add a subchapter, select now in the context-menu [Add a sub chapter] and add extra subchapters like Broadleaf trees and needle trees. After adding the extra chapters and subchapters for dividing the material, we are going to add the material themselves.

Nieuw sjabloon

Select with the mouse the name of the sub-chapter or chapter where you like to add a material. Select the sub folder Broadleaf trees and select now in the context-menu

Voeg de nieuwe bomen kokosnoot-boom, appelboom en ananasboom toe.

Vul de prijs in die we hebben betaald.

Vul de winst in die we willen hebben op het materiaal.

En vul in per hoeveel ze verpakt zijn.

Material catalog After this we add also in the folder 'Wood' an item for a 'support pole' for later use with its price.

Nu gaan we naar:

Standard Templates

Dit is een catalogus met standaard recepten voor werkzaamheden zoals:

  • Bomen planten

  • Gras maaien

  • Transportkosten

  • Graszoden leggen

  • Graszaad zaaien

We gaan hier de standaard werkzaamheden voor het planten van een boom toevoegen.

Selecteer met de muis de naam van de map [Work] waar u de nieuwe sjabloon aan wilt toevoegen,

selecteer nu in het contextmenu Nieuw sjabloon

en voeg de extra sjablonen Boom planten en Gras maaien toe.

Nadat we de nieuwe sjabloon hebben aangemaakt, opent een venster met 4 tabs:

  • Sjabloon

  • Post arbeid

  • Vaste kosten

  • Materiaal

Eerst gaan we naar de tab:

Sjabloon

We geven hier de naam op van de nieuwe standaard sjabloon zoals Boom planten Standard catalog

Pas op: wees voorzichtig, dit is de naam die later op de rekening komt.

we stellen hier in dat het per stuk is en dat de winst 8% is en dat het hoge BTW-tarief van toepassing is.

Post arbeid

We fill here in a number of work steps with their time:

Tabel 1. Gebruikte tijd

Gat graven

32 min.

worker

Boom plaatsen

12 min.

worker

Gat opvullen

17 min.

worker

Water geven

5 min.

worker

De kosten voor een werknemer die we eerder hebben ingevuld worden nu gebruikt.Time calculation

Opmerking: op de rekening zien we later alleen Boom planten, we zullen dan niet de onderdelen Gat graven, boom plaatsen, Gat opvullen, Water geven zien.

We gaan nu naar de tab:

Vaste kosten

en we vullen in:

Tabel 2. Vast item

Transport cost

35 euro

1 pcs.

Fixed cost

Hierna gaan we naar de tab:

Materiaal

Here we select next, after which the window [Add Material to Calculation] opens for a selection of material. We navigate to the folder 'wood' where we select the 'support pole'.

Tabel 3. Gebruikte materialen

1

boompaal

3,5 euro

Material

We gaan nu terug naar de eerste tab 'Sjabloon'

In de eerste tab [Sjabloon], kunnen we nu de totale kosten per eenheid zien.

Klik op OK om het resultaat op te slaan of op Annuleren om het resultaat te verwijderen.

We maken een tweede sjabloon 'Gras maaien'.

we vullen in Gras maaien, als eenheid kiezen we sm (square meter in het Engels) of m² (in het Nederlands), in de tweede tab vullen we in dat 3 min nodig hebben per vierkante meter.

Klik op OK om het resultaat op te slaan of op Annuleren om het resultaat te verwijderen.


Kop- en voettekst-sjablonen

Kraft supports text templates also for the header- and footer-text of documents. Each document type has its own set of text templates. To access them, open a document of a certain document type in edit mode and use the show templates to make the templates visible. In both the header- and footer-section the stored templates become visible.

Direct onder het navigatie-paneel rechts van het venster ziet u een lijst met de namen van de beschikbare sjablonen. Als u op een van de namen in de lijst klikt dan krijgt u de tekst in het paneel eronder te zien.

Daaronder zijn knoppen met de volgende functies van links naar rechts:

  1. Voeg een sjabloon toe aan het document: Deze knop vervangt de tekst van het document met het geselecteerde sjabloon.

  2. Vervang tekst in document door sjabloon: Het geselecteerde sjabloon wordt op de huidige plaats van de cursor in het document toegevoegd.

  3. Nieuw sjabloon aanmaken: Opent een dialoogvenster om een compleet nieuw sjabloon voor het huidige doc type te creëren.

  4. Dit sjabloon bewerken: Opent het dialoogvenster om het huidige geselecteerde sjabloon te bewerken.

  5. Dit sjabloon verwijderen: Verwijderd het sjabloon permanent van de lijst met beschikbare sjablonen.

Noot
Sjablonen met de naam Standard zijn de standaard sjablonen voor dat document type. Zijn worden automatisch toegevoegd als een document van dit type wordt gecreëerd.

Macro’s

In zowel de kop-sjablonen als de voet-sjablonen kunnen macro’s aanwezig zijn die worden vervangen door uitgerekende waarden op het moment dat het document naar het eindresultaat wordt omgezet.

De macro’s in de volgende lijst zijn beschikbaar:

  • DATE_ADD_DAYS(<amount_days>): Returns the date of the document plus the number of days specified as parameter to the macro.

  • ITEM_COUNT_WITH_TAG(<tag>): Geeft het aantal items dat zijn getagged met de tag.

  • NETTO_SUM_PER_TAG(<tag>): Returns the net sum of all items that are tagged with the named tag.

  • BRUTTO_SUM_PER_TAG(<tag>): Returns the gross sum of all items that are tagged with the named tag.

  • VAT_SUM_PER_TAG(<tag>): Geeft de pure belasting van alle items die zijn getagged met de opgegeven tag.

  • IF_ANY_HAS_TAG(<tag>) en END_HAS_TAG: Voegt de tekst tussen de macro’s toe alleen als er tenminste een item is met deze tag.

Als voorbeeld, deze voettekst-sjabloon kan worden gebruikt om automatisch zinvolle teksten te genereren:

Betaal deze rekening binnen drie weken na de datum van het document, wat is DATE_ADD_DAYS(21).

IF_ANY_HAS_TAG(Material)
Deze rekening vermeld het materiaal in ITEM_COUNT_WITH_TAG(Material) items. De netto waarde is NETTO_SUM_PER_TAG(Material),
plus VAT_SUM_PER_TAG(Material) = BRUTTO_SUM_PER_TAG(Material).
END_HAS_TAG

We zijn nu klaar voor de eerste rekening.

De creatie van documenten

De eerste rekening

Open de tab Documenten

Klik op Nieuw document

The document [creation wizard] opens.

Selecteer in document type invoice (rekening).

Vul op het whiteboard een korte tekst over wat de rekening is, zoals: gras maaien en boom planten voor de heer Jansen .

Klik op Volgende

Select on the new window the name and address of the client.

(if the name and address are not there, click then on new contact or on edit contact if you want to edit the contact)

Klik op OK.

Now the document [items] window opens.

Dit venster heeft bovenaan 2 tabs en 3 knoppen:

  • Item toevoegen…​,

  • Korting geven,

  • Document tonen.

Aan de linkerkant kunt u alle items zien die we op de rekening willen plaatsen, aan de rechterkant zien we de tekst van de koptekst, de totale prijs en de voettekst.

Als u op de tekst van de koptekst of van de voettekst aan de rechterkant klikt dan verandert het venster zodanig dat u de koptekst of de voettekst kan bewerken.

Pas de koptekst en de voettekst aan naar uw situatie, in de voettekst kan u bijvoorbeeld een tekst plaatsen als: Wij maken uw tuindroom werkelijkheid.

Klik op de knop Document tonen.

The right tab changes and now shows the earlier made templates, we select in the group Work, the subgroup Plant tree and click then on the button with the left-pointing arrow at the bottom.

Een nieuw venster [Item van sjabloon creëren] opent.

Omdat we 2 bomen hebben geplant, gaan we naar het veld [invoegen] en veranderen dit naar 2 pcs (in het Nederlands stk).

Klik op OK om het resultaat op te slaan of op Annuleren om het resultaat te verwijderen.

The window closes and we go back to the main window.

We klikken opnieuw op Document tonen en selecteren deze keer gras maaien, we klikken opnieuw op de knop met de pijl, in het geopende venster stellen we in dat het grasveld 24 vierkante meter was.

Klik op OK om het resultaat op te slaan of op Annuleren om het resultaat te verwijderen.

We add now manually an item by clicking on the button Add item… and the window [create new item] opens.

Omdat we een speciale boom hebben geleverd, vullen we hier de naam van de speciale boom liguster in, in het veld invoegen vullen we het aantal van de speciale boom die we geleverd hebben in en de prijs daarvan.

Waarschuwing
Remember that in the catalog we can add a profit on the price of the material, in the invoice and in the offer we can not add a profit on the price of the material.

We hebben nu een rekening met 3 items.

Klik op OK om de rekening op te slaan of op Annuleren om de rekening te verwijderen.

We klikken op OK en slaan het resultaat op.

Uw eerste rekening is nu klaar voor verzending.

In het venster met documenten zien we onze eerste rekening, merk op dat dit document een documentnummer heeft die we aan de linkerkant zien.

Bovenaan het venster met alle rekeningen zien we de knop btn: [Print Document], waar we op klikken.

A PDF will now be made from the invoice which we can print on paper or send by email to the client.

After this we are going to create an offer for some work in a garden.

Een offerte creëren

De klant heeft gevraagd of we een boom kunnen planten, we bieden 3 verschillende bomen aan die we kunnen planten.

Beside this, we have seen that there is a lifeless tree, which we will offer to remove as extra work. Numbercycles

De totale prijs willen we exclusief de prijs voor de verwijdering van de dode boom en alleen de prijs van een boom en niet van drie bomen.

Open opnieuw de tab Documenten.

Klik op Nieuw document

Het document-venster [creation wizard] opent.

Selecteer in btn: [document type]>offer.

Vul op het whiteboard een korte tekst over waarover de offerte gaat, zoals: een boom planten en verwijding van dode boom .

Klik op Volgende

Selecteer in het volgende venster de naam en adres van de klant.

(Als de naam en adres niet aanwezig zijn, klik dan op nieuw contactpersoon of op contactpersoon bewerken als u het contact wilt bewerken)

Klik op OK.

Nu opent het venster [Document bewerken].

Dit venster heeft bovenaan 2 tabs en 3 knoppen:

  • Item toevoegen…​,

  • Korting geven,

  • Document tonen.

Klik op de knop Document tonen.

The right tab changes and now shows the earlier made templates, we select in the group Work, the subgroup Plant tree and click then on the button with the left-pointing arrow at the bottom.

Een nieuw venster [Item van sjabloon creëren] opent.

Omdat we 1 boom willen planten, gaan we naar het veld [invoegen] en houden dit op 1 pcs (in het Nederlands stk).

Klik op OK om het resultaat op te slaan of op Annuleren om het resultaat te verwijderen.

The window closes and we go back to the main window.

We klikken op de knop Document tonen en selecteren deze keer de catalogus Material.

The material-catalog opens, and we can select in the chapter trees the subchapter Broadleaf trees in which we select the apple tree which we made earlier.

Klik op OK om het resultaat op te slaan of op Annuleren om het resultaat te verwijderen.

The window closes and we go back to the main window.

We add now manually an item by clicking on the button Add item….

Het venster [Nieuw item aanmaken] opent.

We want the client to be able to make a choice from an apple, a pear tree and the liguster.

Therefore we are also going to add a pear tree manually.

We click on the button Add item… and the window [create new item] opens.

We vullen hier de naam van de boom Perenboom in, en in veld invoegen vullen we het aantal van de speciale bomen in die we kunnen leveren en de prijs daarvan.

We want add this to the material catalog for future use, therefore we select also [select this item as template for future documents] and we select in trees.

Klik op OK om het resultaat op te slaan of op Annuleren om het resultaat te verwijderen.

We do this again but then for the liguster.

We hebben nu 3 items met bomen in de offerte.

En tenslotte voegen we een item toe met 'boom verwijderen' met 0,5 uur voor 32 euro.

Links van het item zien we 2 knoppen:

Een knop met een vlag en een knop met wat lijkt op een pagina.

We select the upper button with the page after which a context-menu opens with the items:

Context menu

[ Soort item]->[Normaal]
[Soort item]>[Alternatief]
[Soort item]>[Op verzoek]
[Belasting]
[Omhoog verplaatsen]
[Omlaag verplaatsen]
[Item vastzetten]
[Item ontgrendelen]
[Verwijder item]

We selecteren hier [Soort item] en veranderen dit voor perenboom van [normaal] naar [alternatief].

We doen dit ook voor [liguster] en voor [Boom verwijderen] veranderen we dit van [normaal] naar [Op verzoek].

Context menu

Klik op OK om het resultaat op te slaan of op Annuleren om het resultaat te verwijderen.

We want to see the result and therefore we click on the button [show document].

We see now that the price of the pear tree, the liguster and the removal of the tree is not used for the total price. When we are happy with the result, we can click on the button close after which we click on the button Print Document for making a PDF that we can print out or send to the client.

After your first invoice, your first offer is now also ready for sending.

Een Acceptance of order (opdrachtbevestiging) aanmaken

Het documenttype "Acceptance of Order" (opdrachtbevestiging) wordt verstuurd als vervolg op een offerte.

Numbercycles

When a client has made a request, we will send an offer in which we describe which items we will deliver. Hopefully the client will give an order for the work.

It is a good practice to respond on the order with an "Acceptance of order" in which we describe all the items we will deliver. We can make the "Acceptance of order" in the same way as we made the invoice or the offer by selecting each item and correcting the number of delivery. This takes time and we can make errors by forgetting items or filling an incorrect number.

U kunt dit sneller doen door de offer (offerte) in de lijst te selecteren en vervolgens Creëer opvolg document in het context menu of in het hoofdmenu te selecteren.

We hebben nu als documenttype de keuze uit:

[Acceptance of order]
[Invoice]
[Partial Invoice]
[final Invoice]
[Progress Payment Invoice]

Followup document

We select here "Acceptance of order". We have now a copy of the offer as an Acceptance of order (do not forget to adapt Alternative Delivery items and on demand items.)

Followup document

U kunt dit ook doen voor de creatie van de invoice (rekening) als opvolging van de opdrachtbevestiging. Elk documenttype heeft een specifieke lijst met opvolg-documenten. Het is een goede gewoonte om op de rekening precies te omschrijven wat is geleverd.

Address Books

For efficient usage of Kraft, the address management is very important. Contact information of customers and suppliers needs to be managed and used daily.

Kraft does not come with its own address book implementation, but uses an established and mature solution called KAddressbook which is provided as part of the PIM (Personal Information Management) software collection of KDE. Integration with KAddressBook is the recommendation and default of Kraft.

However, in some situations the KAddressBook Integration can not be set up. In those cases, Kraft can also read an address collection of a local directory. The directory can be set in the Kraft config file in group [KraftV2], key KraftV2AddressDir. If not explicitly set, it defaults to $HOME/.local/share/contacts.

This directory needs to contain single files in the vCard format, with file extension .vcf. All these files are read and presented as addresses in Kraft.

Noot
Kraft does not alter the entries in the addressbook directory. It is accessed read only.

To edit addresses and add new ones, users can still use KAddressBook, which has support for local address books. It is also possible to synchronize addresses into a local directory from other remote address collections such as Google Addresses utilizing a tool like vdirsyncer.

Kraft naar wens aanpassen

Een groot gedeelte van de grafische interface van Kraft kan aangepast worden, met name de uitvoer die het genereert.

Documentuitvoer aanpassen

To create PDF output documents, the document data that was edited in the Kraft app is filled into a template. The template defines how the output document looks like, i.e. by font settings, placing of elements and such.

Het bestand dat is samengesteld uit een combinatie van de data en de sjabloon wordt geconverteerd naar een PDF met een speciaal document creation script. Dit alles wordt automatisch door Kraft gestart als een document uitgeprint moet worden.

Each document type in Kraft can have its own template that is used to create a PDF. Which one can be set in the Settings dialog for document types.

WeasyPrint Documenten

Noot
Kraft still ships with the old ReportLab based converter, but that will be deprecated in the future. The WeasyPrint based system is the future. It is recommended to port existing templates.

Kraft gebruikt met WeasyPrint een zeer krachtige generator waarmee het erg makkelijk is om documenten te creëren die intensief naar naar wens aangepast kunnen worden en toch een goede kwaliteit hebben.

WeasyPrint converteert een html-bestand naar PDF. Daarbij wordt een cascade stylesheet (CSS)-bestand geïntegreerd wat een grote invloed heeft op het uiterlijk van het PDF-document.

De html- en CSS invoerbestanden voor WeasyPrint worden gecreëerd met de hulp van het Kraft sjabloonbestand.

Om voor een document een op WeasyPrint gebaseerde sjabloon te gebruiken, creëert u eenvoudig een sjabloonbestand en slaat deze op met de extensie .gtmpl. Met deze bestand-extensie gebruikt Kraft automatisch WeasyPrint met daarbij Grantlee sjablonen voor de rendering.

Vanaf versie 0.95 van Kraft vindt u een voorbeeld document in het Grantlee- en WeasyPrint formaat. U kunt het vinden in /usr/share/kraft/reports/invoice.gtmpl of online op Github. Een voorbeeld CSS-bestand kraft.css (on Github) wordt meegeleverd zodat u dit als startpunt kan gebruiken om het naar wens aan te passen.

Sjabloon variabelen

Om de PDF te genereren, moet Kraft de data van het document waaraan u in Kraft heeft gewerkt overbrengen naar het input-document dat met de hulp van Weasyprint wordt verwerkt tot een PDF. Daarvoor gebruikt Kraft een tekstsjabloon. Daarin vervangt Kraft variabelen door de daadwerkelijke waarden.

De tag {{ doc.doctype }} wordt bijvoorbeeld tijdens het genereer proces vervangen door het huidige document type.

The syntax is based on the Django syntax for templates described in the docs.

The following tables list the available variables in a document template. The variables are grouped under certain namespaces, depending on their meaning, ie. doc or label.

Contacts: For both the own identity with prefix me and for the customer contact with prefix customer the following variables are defined.

Document Template: 4. Variables of a contact, both own identity (prefix me) and the customer contact (prefix customer)
Name of Variable Description Example Value

me.COUNTRY

Country of the contact address

me.EMAIL

Preferred email address of the contact

info@goofy.com

me.EXTENDED

Extended address line of the contact address

me.FAX

Fax number of the contact

0912 232322

me.LABEL

Formatted address label of the contact

me.LOCALITY

Locality (city) of the contact address

me.MOBILE

Mobile phone number of the contact

me.NAME

Real name of the contact

Goofy Enterprises

me.ORGANISATION

Organization of the contact, falls back to the real name

Goofy Enterprises

me.PHONE

Work phone number of the contact

0912 211259

me.POSTBOX

Post office box of the contact address

me.POSTCODE

Postal code of the contact address

92192 Spradsdorf

me.REGION

Region (state) of the contact address

me.STREET

Street of the contact address

Steinstr. 34

me.URL

Website URL of the contact

https://www.goofy.com

Document: Document specific variables.

Document Template: 5. Specific document variables
Name of Variable Description Example Value

doc.address

Formatted address string of the customer

Birgit Brillant Bauernstr. 2 91823 Wertheim

doc.bruttoSumNum

Brutto sum as numerical value, not localized

2808.00

doc.bruttoSumStr

Brutto sum localized as user string

2.808,00 €

doc.buyerReference

Buyer reference string, mainly for XRechnung

doc.clientUid

UID of the client/customer

6ef30b5a-1e02-4ea7-86cd-d5aa4ccdf340

doc.dateStr

Date as localized string according to user settings

07.06.2026

doc.dateStrISO

date string ISO formatted, for XRechnung

2026-06-07

doc.docIDStr

Document ID as string

23bf7469-736e-460b-ae21-4af8b2c8f6cd

doc.docIdentifier

Human readable document identifier, e.g. 'Invoice 2026-001' or a draft marker

Rechnung vom 07.06.2026 (Entwurf)

doc.docType

Localized document type, e.g. Invoice, Offer or Delivery Receipt

Rechnung

doc.dueDateStrISO

Payment due date, ISO formatted, for XRechnung

doc.fullTaxPercentNum

Full tax rate in percent as numerical value, not localized

19.00

doc.fullTaxPercentStr

Full tax rate in percent localized as user string

19

doc.fullTaxSumNum

Tax amount of the full taxed items as numerical value, not localized

380.00

doc.fullTaxSumStr

Tax amount of the full taxed items localized as user string

380,00 €

doc.fullTaxesDocument

True if all items of the document are taxed with the full tax rate

false

doc.goodbye

Closing greeting line of the document, e.g. 'Kind regards'

liebe Grüsse,

doc.hasIndividualTaxation

True if the document mixes different tax rates across its items

true

doc.ident

Document identification number, 'draft' for unsaved documents

draft

doc.individualTaxesDocument

True if the document mixes different tax rates across its items

true

doc.isDraftState

True if the document is still in draft state

true

doc.isInvoice

True if the document is an invoice

true

doc.items

List of the document positions (line items)

doc.nettoSumNum

Netto sum as numerical value, not localized

2400.00

doc.nettoSumStr

Netto sum localized as user string

2.400,00 €

doc.noTaxesDocument

True if none of the document items are taxed

false

doc.objectName

General object name

doc.owner

Owner of the document

klaas

doc.postText

Text printed after the document positions, as plain text

Bitte überweise bald.

doc.postTextHtml

Text printed after the document positions, as HTML

Bitte überweise bald.

doc.preText

Text printed before the document positions, as plain text

hier kommt die Rechnung für die ausgeführten Arbeiten in deinem Garten.

doc.preTextHtml

Text printed before the document positions, as HTML

hier kommt die Rechnung für die ausgeführten Arbeiten in deinem Garten.

doc.predecessor

Identifier of the predecessor document this one was created from

31cf5f14-7dad-409e-b93f-f18a4c528fc7

doc.projectLabel

Label of the project the document belongs to

testprojekt

doc.reducedTaxPercentNum

Reduced tax rate in percent as numerical value, not localized

7.00

doc.reducedTaxPercentStr

Reduced tax rate in percent localized as user string

7

doc.reducedTaxSumNum

Tax amount of the reduced taxed items as numerical value, not localized

28.00

doc.reducedTaxSumStr

Tax amount of the reduced taxed items localized as user string

28,00 €

doc.reducedTaxesDocument

True if all items of the document are taxed with the reduced tax rate

false

doc.salut

Salutation line of the document, e.g. 'Dear Mr. Smith'

Liebe Birgit,

doc.state

Document state as string, e.g. Draft, Final, Retracted or Invalid

Draft

doc.taxMarkerFull

Marker value identifying items taxed with the full tax rate

1

doc.taxMarkerReduced

Marker value identifying items taxed with the reduced tax rate

2

doc.taxPercentNum

Applicable tax rate in percent as numerical value, not localized

doc.taxPercentStr

Applicable tax rate in percent localized as user string

doc.taxSumNum

Total tax amount as numerical value, not localized

408.00

doc.taxSumStr

Total tax amount localized as user string

408,00 €

doc.timeOfSupplyEnd

End of the time of supply as localized string according to user settings

doc.timeOfSupplyEndISO

End of the time of supply, ISO formatted, for XRechnung

doc.timeOfSupplyMultiDay

True if the time of supply spans more than a single day

false

doc.timeOfSupplyStart

Start of the time of supply as localized string according to user settings

doc.timeOfSupplyStartISO

Start of the time of supply, ISO formatted, for XRechnung

doc.timeOfSupplyValid

True if a valid time of supply is set on the document

false

Document Template: 6. Report items variables, from a loop over doc.items
Name of Variable Description Example Value

item.amount

Quantity of the item localized as user string

1

item.amountNum

Quantity of the item as numerical value, not localized

1.00

item.htmlText

Text of the item, as HTML

Wir machen alles! Hat leider länger gedauert.

item.itemNumber

Sequential number of the item within the document

1

item.kind

Kind of the item, e.g. Position, Text, Demand or Alternative

Normal

item.nettoPrice

Net total price of the item localized as user string

2.000,00 €

item.nettoPriceNum

Net total price of the item as numerical value, not localized

2000.00

item.objectName

General object name

item.taxMarker

Marker value identifying the tax rate applied to the item

1

item.text

Text of the item, as plain text

Wir machen alles! Hat leider länger gedauert.

item.unit

Unit of the item, e.g. 'piece' or 'hour'

pausch.

item.unitCode

UN/ECE Recommendation 20 unit code of the item, for XRechnung

item.unitPrice

Unit price of the item localized as user string

2.000,00 €

item.unitPriceNum

Unit price of the item as numerical value, not localized

2000.00

Document Template: 7. A generated EPC QR Code
Name of Variable Description Example Value

epcqrcode.show

True if the EPC QR code should be shown on the document

true

epcqrcode.svgfilename

File path of the generated EPC QR code SVG image

/tmp/JyMNOz.svg

epcqrcode.valid

True if a valid EPC QR code was generated for the document

true

Document Template: 8. Document Labels, translated
Name of Variable Description Value

label.CURRENCY_SIGN

The configured currency symbol

€

label.CUST_ID

Label for the customer ID, e.g. 'Customer ID'

Kundennr.

label.DATE

Label for the document date, e.g. 'Date'

Datum

label.DOC_NO

Label for the document number, e.g. 'Document No.'

Dokument Nr.

label.EMAIL

Label for the email address, e.g. 'Email'

Email

label.FAX

Label for the fax number, e.g. 'Fax'

Fax

label.ITEM

Label for the item column, e.g. 'Item'

Posten

label.MOBILE

Label for the mobile number, e.g. 'Mobile'

Mobil

label.NET

Label for the net amount, e.g. 'Net'

Netto

label.NO_SHORT

Label for the position sequence number column, e.g. 'No.'

Nr.

label.PAGE

Label for the page number, e.g. 'Page'

Seite

label.PAGE_OF

The 'of' word in 'page X of Y'

von

label.PHONE

Label for the phone number, e.g. 'Phone'

Telefon

label.PREDECESSOR

Label for the predecessor document number

Vorgänger-Dokument

label.PRICE

Label for the price column, e.g. 'Price'

Preis

label.PROJECT

Label for the project, e.g. 'Project'

Projekt

label.QUANTITY_SHORT

Label for the quantity column, e.g. 'Qty.'

Menge

label.SUM

Label for the sum column, e.g. 'Sum'

Summe

label.TIMEOFSUPPLY

Label for the time of supply, e.g. 'Time of supply'

Time of supply

label.TYPE

Label for the document type, e.g. 'Type'

Typ

label.UNIT

Label for the unit column, e.g. 'Unit'

Einh.

label.VAT

Label for the value added tax, e.g. 'VAT'

MwSt.

label.WEBSITE

Label for the website, e.g. 'Website'

Webseite

Document Template: 9. Kraft Information Variables
Name of Variable Description Value

kraft.DB_SCHEME

Database schema version of the running Kraft instance

DB-Scheme 24

kraft.HOSTNAME

Host name of the machine running Kraft

localhost.localdomain

kraft.SYS_USER

System user name running Kraft

klaas

kraft.VERSION

Kraft version string including code name

Kraft 2.0.0 Cumulus

On the PDF output it is nice to have a logo image included, if the documents should not be printed on a prepared stationery that comes with a printed logo already.

This chapter describes a few methods to achieve that with the weasyprint based template.

PDF Watermark Functionality

The first, and easiest way to add a logo and other details on the print out is to use the so called PDF Watermark option.

That means that the generated document, which does not contain a logo at all, is merged with another PDF into one doc. The so called watermark feature requires an otherwise empty PDF page of the same size as your generated document, that has the logo printed at the right position. It can be created with a text processor that can export PDF.

In the Kraft doc type settings dialog, the watermark options for a specific doc type can be selected. The watermark PDF file can be selected and either be applied to the first page only, or to every page of the generated document.

Once set up, Kraft automatically merges the generated document with the watermark PDF. The result document contains the content of both documents merged together. This is not only useful for logos, but also other details in the document footer.

CSS Directives for Pages

The second option is to use the CSS directive for page content on printed HTML pages. This only works with weasyprint based doc generation.

It uses Cascading Style Sheet (CSS) directives for paged media. CSS uses the @page keyword to define attributes of the page on which the content is printed. Weasyprint makes heavy use of that, for example to define the page size.

In the Kraft default template for weasyprint called invoice.gtmpl this page section can be found:

@page {
    size: A4;
    margin-left: 2.4cm;
    margin-top:27mm;
    margin-right: 1.6cm;
    margin-bottom: 2cm;
    color: #2f590a;
}

which defines the page size to be A4, with the given margins and a default text color.

To add a logo on in the top left corner of the first page of the result doc, the following snippet could be added:

@page :first {
  margin-top: 20mm;
  margin-bottom: 3cm;

  @top-left {
    content: url(/home/miller/miller_logo_s1.png);
    width:3cm;
    height: 1cm;
  }
}

This displays the top left content only on the first page, and also assigns a different top- and bottom margin to the first page. Note that the content url in the example is a local path, but any valid URL can be used.

A more fine granular way of placing the logo can be achieved by placing an img tag into the template like this:

<img id="logo" src="file:///path/to/your/logo.png" />

The CSS code to place the logo accordingly is like

/*
 * Absolute positioned logo
 */
img#logo {
  position: absolute;
  right: 0px;
  top: -100px;
  width: 178px;
  z-index: -1;
}

With that, the logo is independent from the @page positioning from the first example.

EPC QR Code

Met de door Weasyprint gegenereerde PDF kan Kraft overweg met de EPC QR Code wat een implementatie is van een Europese standaard voor betalingen via de computer en mobiele apparaten.

In Duitsland is het ook bekend als Giro Code, in België als Bancontact QR, in Nederland als iDEAL QR-code en in Spanje is het ook bekend als Bizum QR-code.

To use the EPC QR code on the invoice printout, the bank account information has to be added to the own identity settings dialog in Kraft. The giro code is current only generated for documents with the document type Rechnung.

Om de gegenereerde EPC QR Code op het PDF document te krijgen, moet aan het Weasyprint sjabloon een code zoals hieronder toegevoegd worden:

    {%if doc.isInvoice and epcqrcode.valid %}
    <p class="epcqrcode">
      <img class="epc" src="file://{{ epcqrcode.svgfilename }}" alt="EPC QR Code" />
      Dieser QR Code ermöglicht einfaches, sicheres und schnelles Begleichen dieser Rechnung via GiroPay:
      Diesen Code mit dem Smartphone scannen und Überweisung per Banking App aufgeben.
    </p>
    {% endif %}

Hoofdvenster van het programma

Het menu Bestand

[Bestand]>[Afsluiten]
[Ctrl]+[Q]
Sluit het programma af.

Het document-menu

[Document]>[Document tonen]
[Ctrl]+[R]
Opent een venster met het geselecteerde document om deze te tonen.
[Document]>[Document bewerken]
[Ctrl+O]
Opent een venster met het geselecteerde document voor bewerking.
[Document]>[Open gearchiveerd document]
[Ctrl]+[A]
Opent een gearchiveerd document.
[Document]>[Nieuw document]
Opent een venster met een wizard voor de creatie van een nieuw client-document.
[Document]>[Kopieer Document]
Maakt een kopie van het geselecteerde client-document naar een nieuw client-document
Deze kan bij een andere klant horen of zelfs een ander documenttype zijn.
[Document]>[Creëer een opvolg Document]
Kopieert de inhoud van een offerte naar een order-acceptatie of een rekening.
[Document]>[Verzend document]
[Ctrl]+[M]
Verzend een document per email.

Het instellingen-menu

[Settings]>[Edit Tag Templates]
[Ctrl]+[E]
Opens a window where you can add, edit or translate the tags (like work,
material, plants or discounts).
[Settings]>[Redo initial setup]
[Ctrl+R]
Repeats the initial setup. After this, a restart of Kraft is required.
[Settings]>[Shown toolbars]
Here you can decide if the `main toolbar` and the toolbar `Document Actions`
are shown.
[Settings]>[Configure Kraft]
[Ctrl]+[Shift]+[,]
Here you can configure Kraft.

Het document-bewerkingsvenster.

Het contextmenu

 [Context]>[Soort item]
 wijzigt de status van dit item tussen
* Normaal
* Alternatief
* Op verzoek
 [Context]>[Belasting]
Lijkt niet te werken.
[Context]>[Omhoog verplaatsen]
Verplaatst dit item een plaats omhoog in het document.
[Context]>[Omlaag verplaatsen]
Verplaatst dit item een plaats omlaag in het document.
[Context]>[Lock item]
It is not clear what it does.
[Context]>[Unlock item]
It is not clear what it does.
[Context]>[Verwijder item]
Verwijdert dit item uit het document.

Geavanceerde onderwerpen

Dit hoofdstuk beschrijft geavanceerde onderwerpen rond het gebruik van Kraft. Daarbij wordt enige kennis van Linux veronderstelt, en het is verstandig om de instellingen door ervaren Linux-beheerders uit te laten voeren en deze vervolgens zorgvuldig en uitgebreid te testen.

Kraft gemeenschappelijk gebruiken.

Kraft can be used collaboratively in a distributed environment. That means that multiple users work on their desktops with their own Kraft instance on the same data.

De hele situatie is aan verandering onderhevig, omdat Kraft in de nabije toekomst ownCloud als privé Cloud voor de opslag van de data zal gebruiken.

Database en Document-pool gezamenlijk gebruiken

De eenvoudigste situatie is als twee of meer Kraft-gebruikers de database gemeenschappelijk gebruiken en toegang tot dezelfde pool van PDF-documenten op de harde schijf hebben. Om het eenvoudig te houden, worden hier de situatie met twee gebruikers beschreven.

Een veelvoorkomende situatie kan als volgt zijn: twee verschillende Linux gebruikers willen Kraft gebruiken. Ze hebben beide hun eigen computer en werken in hetzelfde netwerk. Dit voorbeeld beschrijft een situatie met een hoofdkantoor die Kraft in de normale modus gebruiken, en een Notebook met Kraft, die in de read-only modus is om de documenten te bekijken, de catalogus te raadplegen en dergelijke.

Daarvoor is het volgende vereist:

  1. Als Database-Backend wordt MySQL of MariaDB gebruikt. Sqlite is niet mogelijk.

  2. De Database is met de gebruiker MySQL vanuit beide computers bereikbaar.

  3. De map waarin de documenten worden opgeslagen, wordt voor beide computers bereikbaar zijn (shared).

Pas op: Er is geen beveiliging tegen het feit dat beide gebruikers tegelijk hetzelfde document kunnen bewerken. Om dat dit gevaarlijk is en tot onvoorziene resultaten kan leiden, raden wij aan om Kraft buiten het kantoor alleen in de readonly-modus te gebruiken. Deze readonly-modus wordt met de parameter -r ingeschakeld.

Sharing the Database

De database-server moet op de hoofdmachine geïnstalleerd zijn, of het moet op een gespecialiseerd apparaat zoals een NAS geïnstalleerd zijn. De snelheid van het netwerk beïnvloed de bruikbaarheid natuurlijk enorm.

Howtos voor het gebruik van MySQL zijn op het internet te vinden.

Sharing the Document Pool Directory

Kraft schrijft de gegenereerde PDF’s in een lokale map. Welke dat is, kunt u instellen in het config-bestand van Kraft. Het config-bestand moet voor alle exemplaren van Kraft correct ingesteld zijn.

U kunt deze vinden in de thuismap van de gebruiker met de relatieve pad .config/kraftrc. Daarin moet de volgende tekst voorkomen:

[reporting]
PdfOutputDir=/data/space/kraftdoc/pdf

There are different ways how to share that directory, i.e. NFS or SMB storages. It is important that both users from both machines can list and access the files. The main user needs read and write access, read only users only need read access to the files.

Een aanbevolen opstelling is een NFS Share met autofs, die op de hoofdmachine is ingesteld. Om de toegang tot de bestanden te beheren, raden wij aan om een gebruikersgroep te creëren waarin u de toegangsrechten kan beheren.

Starting Kraft in read-only mode

Om Kraft in de read-only modus te starten, moet het programma met de volgende parameter -r gestart worden.

Gebruik van XRechnung

Kraft ondersteund het gebruik van de XRechnung standaard. Dat is een digitaal formaat voor electronische rekeningen, en als wet ingevoerd in Duitsland wat een EU richtlijn volgt. De XRechnung is een XML-bestandsformaat ontworpen voor dat doel.

To use the XRechnung Export productively, a little manual work is still needed in Kraft. Kraft creates the XML file based on a template, very similar to the normal PDF documents. That means that it loads a template that contains static elements (i.e. the company address) that do not change between different invoices. The dynamic elements (customer data, items etc.) are filled into the template during the generation step.

In order to generate correct XRechnung files for the specific company that is using Kraft, the admin has to adapt the template file manually to the company’s needs. Note that this has only to be done once and should be easy for a person with a bit of computer experience (Basic knowledge about XML appreciated!).

Om het bestand aan te passen aan de eisen van het bedrijf, kunt u het beste beginnen met het voorbeeld XRechnung-bestand. U moet het downloaden en vervolgens opslaan op een plek waar u het kan bewerken. Open het in een normale tekstverwerker, zoals Kate.

Read carefully through the file without being scared off by the XML format. All user strings (i.e. company name, address and such) are user specific and should be replaced accordingly. Find details about the format here to better understand the meaning of the fields.

Zorg ervoor dat u de correcte XML-opmaak niet verstoort en wijzig niet de locatie van waar {{ template_name }} is gebruikt.

Once the file is adapted to the needs, open the Settings dialog of Kraft and insert the filename into the entry field for the XRechnung Template File on the Document Defaults page.

Next is to specify for which document types the XRechnung export should be made available. For that, open the Kraft Settings dialog, and proceed to the Document Type tab on the left. For each document type listed there, you can mark the checkbox Enable XRechnung Support.

After those steps, the Export XRechung menu item will let you open a dialog to add a few additional parameters for the XRechnung that Kraft does not have by default, and lets you pick a filename where to save the XRechnung invoice file to.

This file can now be transferred to the receiver of the invoice via email, a private file share or the like.

Noot
Er zijn validators voor rekeningen in het XRechnung formaat op het internet te vinden. Het is verstandig om het bestandsformaat van de XRechnung dat uit Kraft is geëxporteerd te laten valideren.

De taalregio wijzigen

Als het nodig dat Kraft een andere taalregio (bijvoorbeeld voor een andere valuta) gebruikt dan die in de huidige desktop is ingesteld, dan kan dit worden bereikt door de gewenste taalregio in het opstart-bestand van Kraft in te stellen.

Bij een linux desktop, worden programma’s normaal gesproken opgestart met de hulp van een zogeheten desktop-bestand. Hierin is informatie aanwezig over hoe het Kraft-programma wordt opgestart als de gebruiker klikt op het pictogram op de desktop of in het start menu.

Het desktop-bestand is meestal te vinden in /usr/share/applications/de.volle-kraft-voraus.kraft.desktop.

Daarin is de volgende regel aanwezig

Exec=kraft %u

wat het programma start met de standaard taalregio.

Als u dit bijvoorbeeld wijzigt naar

Exec=env LANG=de_DE.UTF-8 kraft %u

dan verandert dat naar de Duitse taalregio, onafhankelijk van de desktop environment locatie.

Dankbetuigingen en licentie

Program and documentation copyright 2004–2026 Klaas Freitag

Documentation copyright 2020-2026 Ronald Stroethoff