KONTOR 2 – local business software for 3D printing
==================================================

Kontor runs entirely on your computer – Mac or Windows PC. All data is stored
in an SQLite database in the folder  daten/kontor.db  – nothing goes to the internet.

Language: click the language code (DE/EN/FR/HU) at the top right of Kontor.
See the section LANGUAGES below.


INSTALLER (NO PYTHON INSTALLATION NEEDED)
-----------------------------------------
Kontor is also available as a ready-made package with its own Python:
- Mac: open Kontor-<version>-Mac.zip, drag «Kontor» into the «Applications»
  folder and double-click it. Runs on Apple Silicon and Intel (macOS 11 or later).
  When opened for the first time, macOS reports that the developer is not verified:
  System Settings › Privacy & Security › «Open Anyway».
- Windows 10/11: double-click Kontor-<version>-Setup.exe. If «Windows protected
  your PC» appears: «More info» › «Run anyway».
  Installs without administrator rights to %LOCALAPPDATA%\Programs\Kontor,
  with a shortcut on the desktop, in the Start menu and an entry under «Apps».
The data of the installed version is kept separate from the program and is
preserved during updates and when uninstalling:
  Mac:     ~/Library/Application Support/Kontor/daten
  Windows: %LOCALAPPDATA%\Kontor\daten
Update: simply install the new version over the old one (quit Kontor first).

INSTALLATION ON THE MAC (once)
------------------------------
1. Put the «Kontor» folder in your home folder
   (Finder > Go > Home, or ⇧⌘H) – e.g. /Users/your-name/Kontor.
   IMPORTANT: not in Documents, Desktop, Downloads or iCloud Drive.
   macOS blocks these folders for apps («Operation not permitted»).
   If the folder is there anyway, the «Kontor» app offers to move it.
2. Check whether Python 3 is available:
   open Terminal (Applications > Utilities > Terminal) and enter:
       python3 --version
   If a window «Install command line developer tools» appears, click
   «Install» and wait. After that everything is ready.


WINDOWS (Windows 10 and 11)
---------------------------
1. Unblock the ZIP file before unpacking: right-click > Properties >
   tick «Unblock» at the bottom > OK. Otherwise Windows warns at every start.
2. Unpack the «Kontor» folder into your user folder, i.e.
   C:\Users\your-name\Kontor. Not into OneDrive, Dropbox or another
   synchronised folder: the database does not tolerate synchronisation.
3. Double-click «Kontor einrichten (Windows).bat».
   - If Python is missing, python.org opens. Install Python and tick
     «Add python.exe to PATH» at the bottom. Then double-click again.
   - If «Windows protected your PC» appears: «More info» > «Run anyway».
   Setup creates the «Kontor» shortcut on the desktop and in the
   Start menu and starts Kontor.
4. If Windows Firewall asks about «Python»: «Allow access» for private
   networks. Kontor can then also be reached on tablets and phones on your Wi-Fi.
After that, a double-click on «Kontor» on the desktop is enough (no black
window). «Kontor starten (Windows).bat» starts Kontor with a visible window –
useful if something does not work. Messages are written to kontor.log.
Keyboard shortcuts on Windows: Ctrl instead of ⌘ (Ctrl+K search, Ctrl+S save).

Taking over data from the Mac: quit Kontor on the Mac, copy the «daten» folder
from the Kontor folder (e.g. via USB stick) and put it into the Kontor folder on
the Windows PC (replace the existing «daten» folder). Includes images, backups
and the catalogue. Do not let both computers work with the same data at the
same time – otherwise changes are lost.


STARTING (macOS)
----------------
Double-click the «Kontor» app (orange K).
Kontor starts in the background and opens in the browser – without a Terminal window.
If Kontor is already running, another click just opens the browser window.

Putting a start button on the desktop:
- Drag the «Kontor» app from the Kontor folder onto the desktop while holding
  the Option and Command keys (⌥⌘). This creates an alias.
- Or drag the app directly onto the desktop or into the Dock. It finds the
  Kontor folder by itself; if not, it asks once.

At the very first start, macOS reports that the app comes from an unverified
developer. Then:
   right-click (or Ctrl-click) «Kontor» > Open > Open.
On newer macOS versions instead: System Settings >
Privacy & Security > at the very bottom next to «Kontor» click «Open Anyway».
This is only needed once.

Alternatively, start as before with «Kontor starten.command»
(with Terminal window) or in Terminal:
       cd ~/Kontor
       python3 server.py

Address in the browser:  http://localhost:8765


ON IPAD AND IPHONE
------------------
Kontor can also be reached on iPad and iPhone on your own Wi-Fi. You will find the
address and a QR code to scan under «Company & data» › «On iPad and
iPhone». In Safari, «Share › Add to Home Screen» creates an icon.
- The computer running Kontor must be switched on and Kontor must be running.
- If macOS asks whether «Python» may accept incoming connections: «Allow».
- All devices on the same Wi-Fi can open Kontor. Only use it on your own,
  protected Wi-Fi. Kontor can only be quit on the computer it runs on.
- To make it reachable only on this computer: start in Terminal with
      KONTOR_NUR_LOKAL=1 python3 server.py

QUITTING
--------
Click the on/off symbol at the top right of Kontor > «Quit».
(If Kontor was started with «Kontor starten.command», you can also close
the Terminal window.)
Server messages are written to  kontor.log  in the Kontor folder.


DATA & BACKUP
-------------
- Database:  daten/kontor.db
- Backups:   daten/sicherungen/  (automatically once a day at start-up,
  also via «Company & data > Back up now». The last 30 are kept.)
- For an external backup, simply copy the  daten  folder
  (e.g. to a USB stick or iCloud Drive), ideally while Kontor is closed.
  It also contains the document archive (daten/archiv) and the files (daten/dateien).
- Before an update with a new database structure, Kontor automatically creates
  a backup «…_vor-update.db».
- Restoring: quit Kontor, copy the desired backup to  daten/kontor.db
  (rename the old file first), start Kontor.

At the first start, sample data is loaded. Under «Company & data» you can
delete it and enter your company details (name, address, IBAN, VAT).


OPERATION IN BRIEF
------------------
- ⌘K           global search (customers, documents, jobs, material …)
- ⌘S           save record
- Lists: click a column header to sort, filter field, CSV export for Excel
- Quote > «Convert to invoice»
- Job > status «Finished» posts filament, material and machine hours
- Job > «Create invoice» takes print time and material as lines
  (prices from the products in the categories «Druckzeit» and «Material»)
- Machine > «Maintenance done» resets the maintenance counter
- Spool > «Weigh» / Material > «Stock entry» for incoming, outgoing, stocktaking
- Invoice/quote > «PDF» or «Send by e-mail» (opens Apple Mail)
- Every change is logged in the «History» tab

LANGUAGES (GERMAN, ENGLISH, FRENCH, HUNGARIAN)
---------------------------------------------
- Screen: click the language code (DE/EN/FR/HU) at the top right. The choice
  applies per user (with sign-in) or to this Kontor (without sign-in).
- Documents and e-mails: set it for the customer under «Contact» › «Language»
  (or for the supplier for purchase orders). «Company default» uses the
  «Language of documents» from «Company & data» › «Country, currency & tax».
  Quotes, invoices, credit notes, reminders, delivery notes, order
  confirmations and the suggested e-mail texts then appear in that language.
  The Swiss QR payment part is in German, French or English (English for
  Hungarian), as the standard requires.
- Your own texts (lines, notes, reminder and shipping texts you changed)
  stay as you write them. Standard texts that you did not change are
  translated automatically.
- Invoices that are already locked remain in the archive in their original
  language (unalterable).


PRINTERS: QUERYING LOADED FILAMENT
----------------------------------
Kontor queries your printers directly on the local network (no cloud) and shows
material, colour, manufacturer and remaining amount per slot – and which material
from your stock matches.
Set up with the assistant: Machines > open machine > Details >
«Printer on the network» > «Set up printer» (or on the printer card the
gear icon or «Set up network»).
  1. Choose the manufacturer: Bambu Lab, Prusa, Creality, Anycubic, Snapmaker,
     Elegoo, Qidi, Sovol, Voron/Klipper, OctoPrint or «Other manufacturer».
  2. Choose the model. Kontor shows how the printer is connected and where
     the consumption after the print comes from.
  3. Connection: fill in only the fields the model needs – with a note on
     where to find the value on the printer. «Test connection» queries the
     printer immediately, «Save» applies manufacturer, model and access.
What each manufacturer needs:
  Bambu Lab (X1, P1, P2S, A1, H2):  IP address, LAN access code, serial number.
      With current firmware, switch on «LAN Only» and «Developer mode» on the
      printer – the printer is then no longer connected to the Bambu cloud
      (Bambu Handy / remote access do not work during that time).
  Prusa (Core One, MK4/S, MK3.9, XL, MINI+):  PrusaLink. IP address and
      password (on the printer: Settings > Network > PrusaLink), user
      usually «maker». MK3S+ with Raspberry Pi: leave the user empty and
      put the API key in the password field.
  Creality (K2, K1, Creality OS):  IP address only.
  Anycubic (Kobra S1, S1 Max, Kobra 3):  IP address, LAN mode on the printer on.
  Snapmaker U1:  IP address, API key only if sign-in is active.
  Klipper/Moonraker (Elegoo Neptune 4, Qidi, Sovol, Voron, rooted
      Creality):  IP address, port 7125 is used automatically.
  OctoPrint:  address and API key (OctoPrint > Settings > API).
Secrets (access code, password) stay only in the local database.
Printers without a network interface: choose «Without network query» –
prints are then posted manually.
In the machine list, «Query filament of all printers» queries all of them at once.
Slots found are matched to your spools (same material, similar colour). A spool
assigned to exactly this slot with «Load into printer» always takes precedence.
If no matching spool exists: «Create as spool».
The printers’ protocols are not officially documented. If something does not
work, «Raw data» shows what the printer sent – this data contains no
passwords and helps with troubleshooting.

CONSUMPTION AFTER PRINTING (Prints & consumption)
-------------------------------------------------
Kontor detects finished prints and suggests how much filament to deduct from
which spool. Nothing is posted until you confirm.
- Works automatically for all printers set up with the assistant (see above).
- When a print is finished, «Print finished» appears at the bottom right, and a
  note appears in the navigation under «Prints & consumption» and on the printer card.
- «Confirm consumption» shows the assigned material and the quantity in grams
  for each spool. Material and quantity can be changed and further rows
  added. «Post» deducts the quantities from stock, «Discard» does not.
- Optionally assign a job: the job then takes the measured quantity and print
  time and does not deduct again on completion.
- The print time can be credited to the machine’s operating hours.
- Where the quantities come from:
    Snapmaker U1: from the print history and the slicer data in the print file
      (grams per nozzle). Also prints that ran while Kontor was closed.
    Creality K2:  from the print history (if the printer offers it), otherwise
      from the filament length used. For this, Kontor keeps track during the
      print of which CFS slot is printing – Kontor should be running during
      the print.
    Anycubic:     from the filament length used, per ACE slot – Kontor should
      be running during the print.
    Bambu Lab:    from the print file on the printer (grams per filament),
      per AMS slot. If that does not work, enter the quantity manually.
    Klipper/Moonraker: like the Snapmaker, from print history and slicer data.
    Prusa / OctoPrint: from the slicer data or the filament length of the
      print file – Kontor should be running during the print.
    Cancelled prints are calculated proportionally.
- Printers without network: open machine > «Post print»
  or under «Prints & consumption» > «Post print manually».
- Switching on/off and the check interval: «Company & data» > «Print monitor».
- At the very first check, Kontor only notes the current state. Older prints
  are not suggested afterwards.

ANNUAL ACCOUNTS
---------------
Navigation > Finances > «Annual accounts»: income and expenditure statement with
financial position for sole proprietorships with less than CHF 500,000 turnover
(Swiss CO Art. 957). Outside Switzerland, check with your tax adviser whether it
is sufficient.
- Choose the year and how income is counted: «by receipt of payment» (date
  «Paid on» of the invoice) or «by invoice date».
- Income by product category, expenses by category, depreciation,
  profit or loss, monthly trend.
- Depreciation: enter purchase price, commissioning date, method
  (declining balance/straight-line) and rate for the machine (customary: 40 %
  declining or 20 % straight-line for production machines). Record the purchase
  as an expense in the category «Investments» – it then does not count as an
  expense but goes through depreciation.
- Financial position as at 31.12.: Kontor calculates open invoices, filament
  stock and book value of the machines; you enter bank/cash and open supplier
  invoices.
- VAT (if liable): values per quarter/half-year/year with the fields of the Swiss
  VAT form (effective method) or with the net tax rate; in Austria and Germany
  per month or quarter with the codes of the advance return.
- «Annual statement (PDF)» for the tax return (income statement,
  depreciation, financial position, VAT, journal) and «Journal (CSV)» for Excel
  or your accountant.
- «Mark as paid» sets the «Paid on» date on invoices; it can be changed in
  the invoice.
Kontor does not replace an accountant – if in doubt, ask the tax office.

MAILING
-------
Navigation > Sales > «Mailing»: one e-mail to several customers.
- Choose recipients: filters (active only, with open invoices, active in
  recent months, search) and a tick per customer. Customers without a valid
  e-mail address or with «Receives mailings» = off are left out.
- Subject and text with placeholders: {anrede}, {name}, {firma}, {ort}.
  {anrede} = the customer’s «Letter salutation», otherwise «Hello» + contact
  person (in the customer’s language).
- Optionally an attachment (up to 10 MB) and an unsubscribe note at the end.
- «Send»: Kontor sends each person their own e-mail via your mailbox.
  Set up once under «Company & data» > «E-mail sending» (server, port,
  user, password – an app password for Gmail and iCloud), then
  «Send test e-mail». The password stays on this computer.
- Without setup: «Open in mail program (BCC)» or «Copy addresses».
- «Sent mailings» shows to whom the e-mail went and which addresses the mail
  server rejected. The customer’s history also shows it.
Note: only send advertising e-mails to customers who can expect them, and
respect unsubscriptions (switch off «Receives mailings» for the customer).

COSTING AND CUSTOMER DISCOUNT
-----------------------------
Open a job > «Costing» tab (or the «Costing» button).
- Switch cost items on and off: material, electricity, wear, working time,
  post-processing, shipping, plus «Other costs» (packaging, accessories …).
- Profit margin in percent; «Hide margin» distributes it across the lines in
  the quote and invoice, otherwise it appears as a separate line.
- Discount: enter a default discount for the customer under «Terms». New
  jobs take it over; it can be adjusted in the job.
- On the right you see cost price, margin, discount, shipping, net price, VAT,
  total and price per piece. «Create quote» / «Create invoice» take the costing
  over as lines.
- Required: cost price per kg for the material; for the machine under
  «Costing»: power consumption (W), purchase price and service life (h).
- Electricity price, hourly rates, default margin, working time and shipping:
  «Company & data» > «Costing».

MAINTENANCE
-----------
Under «Maintenance» (navigation) and in the «Maintenance» tab of each machine.
- Adopt the manufacturers’ maintenance plans: Creality K2 / K2 Pro / K2 Plus,
  Anycubic Kobra S1 / S1 Max, Snapmaker U1 and a general FDM plan.
  Each task has intervals in days, print hours and/or kg of filament –
  whichever is reached first makes it due. «Suggestion» means: the manufacturer
  gives no fixed interval, Kontor suggests one.
- When adopting, choose: «Today» (intervals start now) or
  «Unknown» (everything due immediately).
- «Record maintenance»: tick the work done (due tasks are preselected),
  enter other work, date, note and costs. Everything goes into the
  maintenance log.
- Tasks can be edited, paused, deleted or created yourself.
- Print hours count via the machine’s operating hours, filament via the
  posted prints and jobs of the machine.
- Due maintenance appears in the navigation, on the printer card and in the
  overview under «Action needed».

IMAGES FOR MACHINES, SPOOLS AND MATERIAL
----------------------------------------
Open a machine, spool or material > Details > «Image» area:
- click and choose a photo, drag an image in or paste a copied image
  with ⌘V (e.g. in the browser right-click a product photo >
  «Copy image»).
- Kontor reduces the image to at most 1000 pixels and stores it under
  daten/bilder/. Backing up the «daten» folder backs up the images too.
Machine photos appear on the printer cards and in «Printers live»,
spool photos in the spool list and with the spools loaded in a printer.

FILAMENT CATALOGUE
------------------
Under Spools > «From catalogue» you will find filaments from the open
database SpoolmanDB (MIT licence, github.com/Donkie/SpoolmanDB).
- The first time, click «Download catalogue now» (needs internet).
  The catalogue is stored under  daten/katalog/ ; search then also works
  offline. «Update catalogue» fetches the latest version.
- Search, e.g. «Bambu PETG HF Black», or filter by manufacturer, material and
  diameter. Clicking a row applies description, manufacturer, material, colour
  with colour code, diameter, spool contents, empty spool, density and
  temperatures. Filaments already recorded are marked.
- In a material record, «Take from catalogue» fills in the fields.
- You enter stock, minimum stock, price and storage location yourself. For new
  material, the «Opening stock» is recorded as a stock entry when saving.
- Stock entry > «Stocktaking with scale»: weigh the spools, enter weight and
  number – Kontor subtracts the weight of the empty spools.

CSV IMPORT
----------
Customers, products, spools, machines and expenses can be imported from CSV
files: click «CSV import» in the list (or under «Company & data»).
1. Choose the file or drag it into the window (Excel, Numbers, bexio etc.).
   Separator (; , tab) and character set are detected automatically.
2. Check the column mapping. Known column names are mapped automatically,
   everything else via a selection field.
3. «Check» shows how many rows will be created or updated and which rows
   have errors – nothing is saved yet.
4. «Import» saves. A backup is created automatically beforehand.
- If the number (e.g. K-1001) already exists, the record is updated or the
  row skipped – depending on the setting. Empty cells overwrite nothing.
  Without a number, a new one is assigned automatically.
- Numbers may use Swiss notation (1'250.50, 12.-, CHF 9.90),
  dates e.g. 31.08.2026 or 2026-08-31, yes/no fields ja/nein/1/0/x.
- Spools: «Stock (g)» is recorded as a stock entry (opening stock or
  stocktaking) so that the stock movements are correct.
- Expenses: negative amounts from bank statements are taken over as expenses.
- «Template» downloads an empty CSV file with the matching columns.
- A list created with «CSV export» can be imported again.
Quotes, invoices and jobs are not imported via CSV.

COUNTRY, CURRENCY AND VAT (CH, LI, AT, DE, FR, HU)
--------------------------------------------------
System > «Company & data» > «Country, currency & tax»:
- Country: Switzerland, Liechtenstein, Austria, Germany, France or Hungary. When
  changing, currency, standard tax rate and note are suggested accordingly.
- Currency: CHF, EUR or HUF (forint). Amounts are not converted – the change
  is meant for starting with Kontor, not for existing accounts.
- Tax rates available: CH/LI 8.1 / 2.6 / 3.8 / 0 %, AT 20 / 10 / 13 / 0 %,
  DE 19 / 7 / 0 %, FR 20 / 10 / 5.5 / 2.1 / 0 %, HU 27 / 18 / 5 / 0 %. The standard
  rate applies to new documents; it can be changed per quote, invoice and expense.
- «Note at 0 %» appears on documents without tax, e.g. for small businesses
  (DE: § 19 UStG, AT: § 6 Abs. 1 Z 27 UStG, FR: «TVA non applicable, art. 293 B
  du CGI», HU: «Alanyi adómentes» – pre-filled).
- Format: CH 1'234.50 CHF (rounded to 5 centimes), AT/DE 1.234,50 €
  (rounded to the cent), FR/HU 1 234,50 (HUF: rounded to the whole forint).
  On documents the tax is called MWST, USt., MwSt., VAT, TVA or ÁFA depending
  on the language.
- Payment: CH/LI get the QR payment slip (also possible in EUR).
  AT/DE/FR get a QR code for SEPA transfers (GiroCode) in EUR, which banking
  apps can read. Enter the IBAN (and optionally BIC) for this. There is no
  payment QR code for HUF (the invoice shows the IBAN and reference).
- AT/DE: instead of «Offerte», German texts say «Angebot» everywhere
  (screen, PDF, e-mail), and texts on documents use ß (Grüße, gemäß).
- AT/DE/FR/HU: invoices show the date of supply (= invoice date), and in the footer
  the VAT ID and – if entered – the tax number (FR: SIRET, HU: Adószám).
- Annual accounts AT/DE: VAT per month or quarter with the codes of the
  advance return (DE UStVA 81/86/66, AT U30 022/029/006/060); FR/HU without codes.
  Bank file (camt) and shop import only take over payments in the selected
  currency. Information without guarantee – if in doubt, ask your tax adviser.

QR PAYMENT SLIP (SWITZERLAND)
-----------------------------
Every invoice gets the Swiss QR payment part with receipt at the bottom of the PDF
(Swiss Payment Standards, version 2.0). Requirements under «Company & data»:
- a valid Swiss IBAN (CH…) or QR-IBAN
- company name, postcode and city
With a normal IBAN, an RF reference is generated from the invoice number,
with a QR-IBAN a 27-digit QR reference. If the customer address is missing,
«Payable by» stays empty to be filled in. The invoice preview also shows
the payment part.
Tip: before sending the first invoice, scan one with your own banking app
and check that all details are correct.


ACCESS & USERS (sign-in on Wi-Fi)
---------------------------------
«Company & data» > «Access & users»:
1. «Create user»: username, password (at least 8 characters), role.
   Owner = everything. Employee = without finances, expenses, reports,
   annual accounts and settings.
2. Switch on «Require sign-in».
After that, every access from the iPad, iPhone or another computer needs a
sign-in. On the Kontor computer itself it works without, as long as «On the
Kontor computer without sign-in» is switched on. After 5 wrong passwords,
sign-in from that device is blocked briefly. At the top right: change
password, sign out.
Forgot the password and sign-in is also required on the Kontor computer:
start Kontor once like this:  KONTOR_OHNE_LOGIN=1 python3 server.py
(Windows: set KONTOR_OHNE_LOGIN=1 & py server.py), then set a new password under
«Access & users» and restart Kontor normally.

INVOICES: LOCKING, ARCHIVE, CREDIT NOTE, CANCELLATION
-----------------------------------------------------
As soon as an invoice leaves draft status (status «Open», sent by e-mail),
it is locked: content and lines can no longer be changed, the PDF is stored
with a checksum in the folder daten/archiv and is always output exactly the
same way again (retention obligation 10 years, Swiss GeBüV).
- Error in an open invoice: «Cancel» – Kontor creates a cancellation credit
  note, the invoice remains in the archive.
- Price reduction, return, invoice already paid: «Credit note» – the credit
  note is created as a draft; adjust the lines and set it to «Open».
  Then «Offset against invoice» or, after the refund, «Mark as paid out».
  Credit notes reduce turnover and VAT in the annual accounts.
- System > «Change log»: every change with time and person. The entries are
  chained with checksums. «Check integrity» reports entries or archive PDFs
  changed afterwards.

PAYMENTS AND BANK FILE (camt.054 / camt.053)
--------------------------------------------
Open an invoice > «Record payment» (partial payments too). The «Payments &
reminders» tab shows payments, reminders, credit notes, delivery notes and archive.
In bulk: Invoices > «Import bank file». In e-banking, download the credit
advice camt.054 (or the account statement camt.053) as XML or ZIP and drag
it in. Kontor matches via the QR/RF reference, the invoice number in the
payment text or the amount. Reliable matches are preselected; nothing is
posted until «Post selected». Importing the same bank file twice does not
post anything twice.

DUNNING
-------
Sales > «Dunning» lists overdue invoices with the next level: payment reminder
(10 days after the due date, no fee), 1st reminder (+14 days, CHF 20),
2nd reminder (+14 days, CHF 30). Levels, fees, deadlines and texts under
«Reminder levels & texts». Due ones are preselected.
«Reminders as PDF» creates a combined PDF for printing, «Send by e-mail»
sends each reminder with PDF via your mailbox. Each reminder contains a QR
payment slip (open amount + fee) with the same reference – so when the bank
file is imported, the payment is matched to the invoice again.
Customers or invoices can be blocked with «Do not send reminders».
Note: only charge reminder fees and default interest if they have been agreed.

FILES AND 3D MODELS
-------------------
Job > «Files» tab: drag in STL, 3MF, OBJ, G-code, «.gcode.3mf» and any other
files. Same file name = new version. Kontor shows a rotatable 3D preview
(for 3MF also the thumbnail), dimensions and volume.
From G-code or «.gcode.3mf» (Bambu Studio, OrcaSlicer, PrusaSlicer, Cura)
Kontor reads the slicer’s grams and print time. «Apply values» sets material
required and print time in the job. Files also for products, models and
expenses (receipts). Stored in the folder daten/dateien.

QUOTE FROM 3D FILE
------------------
Quotes (or jobs) > «From 3D file»: choose a customer, drag in the file, set
material, printer, quantity, infill, wall thickness and supports. Kontor
estimates grams and print time and immediately shows price and cost price from
your costing. «Create job & quote» creates both.
The estimate from STL/3MF/OBJ is usually within ±30 %. It becomes exact with
a «.gcode.3mf» or G-code file created in the slicer. The print time depends
on the printer’s «Print performance» (Machine > Operation & maintenance,
in mm³/s) – fine-tune it with your own values.

POST-CALCULATION AND REPORTS
----------------------------
Job > «Post-calculation» tab: planned (target) versus actual for material,
print time and cost price, turnover and contribution margin. Actual values
come from the posted prints of this job (incl. misprints); you enter the
actual working time in the job.
Finances > «Reports»: all completed jobs of a year, contribution margin per
customer, material and printer, and the scrap analysis.

MISPRINTS AND SCRAP
-------------------
When confirming consumption, tick «Misprint / scrap» and choose the reason
(preselected for cancelled prints). The material is deducted from stock and
the costs (material, electricity, wear) are calculated. Reports >
«Scrap» shows the rate per printer and material and the most frequent reasons.

PRINT PLANNING
--------------
Production > «Print planning»: timeline per printer with all planned, released
and running jobs, one after another from now. A running print (Printers live)
is taken into account. Dragging bars changes the order or printer, a click
opens the job. Red = the due date will not be met.
«Working hours»: when prints can be started, whether they may run overnight
and the pause between two prints.

SPOOLS AND QR LABELS
--------------------
Production > «Spools»: each entry is a single roll of filament (or a bottle of
resin) with number, contents and remaining amount. Several rolls of the same
variety (manufacturer, material/type, colour) are several entries; «This variety»
shows the total stock. The minimum stock applies per variety.
- «Record spool» or «From catalogue»; «More spools» creates copies.
- Consumption from prints is deducted first from the spool loaded in this
  printer. If it is not enough, the rest goes to another spool of the same
  variety; an empty spool is unloaded automatically.
- «Weigh»: enter the gross weight, Kontor subtracts the empty spool.
  «Correct remaining», «Load into printer», «Used up».
- List: «Without empty» hides used-up spools, «Only varieties running low»
  shows what should be reordered.
«Print labels»: A4 sheet 3 × 8 (70 × 37 mm, e.g. Avery Zweckform 3475)
or continuous label 62 × 29 mm (Brother QL). The QR code opens the spool in
Kontor – scan it with the iPhone camera on the same Wi-Fi, then weigh, load or
mark as empty. Address in the QR: «Company & data» > «Kontor address for QR»
(empty = Wi-Fi address of this computer).

MATERIAL (BOUGHT IN: LEDS, MAGNETS, THREADED INSERTS …)
-------------------------------------------------------
Production > «Material»: everything apart from filament that is built into a
product – e.g. LED strips, LED modules, magnets, screws, threaded inserts,
packaging. Per material: category, unit (pcs, m, g, pack …), stock,
minimum stock, cost price, supplier, order number, storage location, image.
- «Stock entry» for incoming, outgoing or stocktaking; «Movements» tab.
- Bill of materials: in the job (Details, bottom) and in the product, add
  material and enter the quantity. The costs appear in the costing as
  «Material (bought in)». When the job is completed (Finished), the material
  is booked out of stock; after that the bill of materials is locked.
- «Reproduce» takes over the product’s bill of materials × quantity.
- Material below minimum stock appears in the overview and in the order
  suggestions (Purchasing).

TRIAL VERSION AND LICENCE KEY
-----------------------------
The trial version runs for 30 days. With a licence key it becomes the full
version – without reinstalling; all data is kept.
Activate: click «Trial version · … days left» at the top right (or on the
locked page after expiry), paste the key, «Activate». «Company & data» then
shows «Full version · licensed to …». The licence is kept even after
reinstalling.

MODELS AND LICENCES
-------------------
Master data > «Models & licences»: models with source (Printables, MakerWorld,
Thingiverse …), designer, licence and «Sale allowed». The licence list states
for common licences whether prints may be sold (e.g. CC BY yes,
CC BY-NC no, Standard Digital File License only with permission). Choose the
model in the job or product: for models that are not cleared, Kontor warns and
asks before creating a quote or invoice. Information without guarantee –
the terms of the platform or designer are authoritative.

STOCK ITEMS (FINISHED PARTS)
----------------------------
Product > «Stock & production» > switch on «Stock items», enter minimum stock,
material and print time per piece. The stock changes through:
- Locking an invoice: lines with this product are booked out
  (cancellation books back, shop import also books out)
- «Reproduce»: creates a job without a customer; on completion
  (Finished) the quantity is booked in
- manual «Stock entry»

PURCHASING
----------
Purchasing > Order suggestions: filament (per variety), material and spare parts
below minimum stock
(stock − reserved + already ordered), topped up to double.
«Create purchase orders» creates one purchase order per supplier. In the
purchase order: PDF, order by e-mail, «Book goods receipt» – filament is
created as new spools, material and spare parts are booked in, and optionally
the expense is created at the same time. For spools and material, enter
«Supplier», «Order number» and «Minimum order quantity». Spare parts (nozzles,
plates, belts …) can be booked out as used under «Record maintenance».

SHIPPING AND SHOP ORDERS
------------------------
Invoice > «Delivery note» or Sales > «Shipping» > «Create delivery note».
In the shipment: shipping method, tracking number, delivery note PDF, address
label (A6 or 62 mm) and «Notify customer» (e-mail with tracking and
delivery note). Quote > «Order confirmation» creates the PDF for it.
Shipping labels with a Swiss Post barcode require a Swiss Post business
customer account – Kontor prints the address label, you buy the postage from
the post office.
Shop orders: Invoices > «Shop orders». Drag in the CSV export from Shopify
(Orders > Export), Etsy (ordered items) or WooCommerce. Each order creates a
paid invoice (shop prices incl. VAT), optionally also a job. New customers are
created, SKU = article number books out stock items. Orders in currencies other
than the company currency are skipped. Kontor detects duplicate orders.

EXPORT FOR THE ACCOUNTANT
-------------------------
Finances > Annual accounts > at the very bottom:
- «Package (ZIP)»: annual statement (PDF), posting journal for Banana (TXT) and
  as CSV, all archived invoices, credit notes, reminders and the receipts
  attached to expenses, plus an explanation.
- «Banana (TXT)»: Banana > Actions > Import into accounting > Transactions >
  text file with column headers.
- «Accounts»: account numbers according to the Swiss SME chart of accounts
  (bank 1020, receivables 1100, revenue 3000, material 4000 …) and VAT codes
  (V81, M81, I81) – compare with your accountant’s chart of accounts.

TECHNICAL
---------
server.py          web server and database logic (Python standard library only)
kontor_pdf.py      PDF generation for quotes and invoices
kontor_qr.py       QR code and Swiss QR bill
kontor_i18n.py     languages: translation for PDFs and e-mails (dictionaries in app/i18n/)
kontor_land.py     country, currency, tax rates (CH, LI, AT, DE, FR, HU)
app/index.html     user interface
app/kontor2.js     user interface: extensions
Change port:       KONTOR_PORT=9000 python3 server.py   (Windows: set KONTOR_PORT=9000 & py server.py)
