Karyo
Documentation/ Extended user guide

Document templates

Karyo 2.1.1rendered at build time
On this page

Document templates let an administrator change the layout of a generated document for one goods owner. An override replaces the bundled bill of lading, packing slip, label and so on for that owner. Karyo keeps every version, so you can go back to an earlier one. It changes layout only. It does not add a new document, change which data a document holds, or print anything.

Switch it on

A Company administrator who holds settings.manage at the Company switches it on at Admin > Capabilities, on the row named Document templates. The panel previews what appears and asks you to confirm. The capability needs no setting and no connected service.

To use the page you need three things:

  • settings.manage. The Administrator profile holds it. It can be granted only at the Company or at a Business Unit. An administrator at one Business Unit can work only on that unit's overrides.
  • An operating-company account. A goods owner's own users are refused, even with the grant.
  • organization.read, so the page can list your Business Units.

What appears when it is on

  • Document templates in the Admin sidebar, in the Govern group.

There is no setting, column or floor-app entry. The Documents archive in the same sidebar is a Core page. It shows whether or not this capability is on.

Using it

Karyo looks for an override each time it makes a document. It takes the Business Unit that owns the Facility of the record. If that unit has an active version for that document, Karyo renders it. Otherwise the bundled template renders. The same rule covers the download, the archived copy and a label sent to the printer.

The page offers ten documents in its Template path list:

Template path Document
/templates/packing-slip.html Packing slip
/templates/bol.html Bill of lading
/templates/label.zpl Carrier label for a shipping unit
/templates/packet-list.html Packet list for a shipment
/templates/packet-content-list.html Content list for a shipping unit
/templates/pick-ticket.html Pick ticket
/templates/delivery-note.html Delivery note
/templates/ul-content-list.html Content list for a unit load
/templates/ul-label.zpl Unit load label
/templates/location-label.zpl Location label

The Location label template fills in locationClassName where earlier versions filled in areaName. If you stored an override of /templates/location-label.zpl from the earlier bundled label, replace {areaName} with {locationClassName} in it. Until you do, printing a Location label fails.

The server accepts an eleventh path, /templates/ul-advice-label.zpl, the unit load labels for a receiving advice. The page does not list it, so that override can be made only through the API. No other path is accepted.

To add a version:

  1. Open Admin > Document templates.
  2. Choose a Business Unit.
  3. Choose a Template path.
  4. Paste the source into the box, or press Choose template file and pick an .html, .zpl or .txt file. The file is read into the box. Nothing is sent yet.
  5. Press Upload. The page says "Template version uploaded".

The new version becomes active at once, and the version that was active turns Inactive. The source is Qute template text. Karyo refuses it if it is larger than 256 KB or if it does not parse. Karyo checks only that the source parses. It does not render a sample, so print one real document after every upload.

Two rules apply to an override exactly as they do to a bundled template. HTML becomes a PDF without fetching any image, font or other outside address, so use inline styles. Every value Karyo fills in is escaped. In a ZPL template, Karyo removes the ^ and ~ control characters from the text it fills in.

After you choose a Business Unit and a path, the table lists the versions, newest first, with Version, Status, Created and Actions.

To go back to an earlier version, press Activate on its row. The page says "Version activated", and the next document uses it.

To remove a version, press Delete and confirm. A deleted version cannot be restored. If you delete the active version, no version is active and the bundled template prints. Older versions that remain do not take over. Press Activate on one of them if you want that instead.

If a path has no versions, the page says "No overrides yet", and the bundled template is in effect. The bundled templates are part of the build. Changing one is a change to the build, not a change on this page.

When you switch it off

The sidebar entry disappears, and the address shows the not-found page. Nothing is deleted. The stored versions stay, and the REST routes under /api/v1/document-templates stay callable.

Switching it off does not turn the overrides off. Document rendering never checks the switch, so every active override keeps being used. If you want the bundled documents back, delete the active versions first. There is no rule that lets open work finish for this capability, because it has none.

Next