ndb-core icon indicating copy to clipboard operation
ndb-core copied to clipboard

Feature: PDF generation with entity placeholders

Open sleidig opened this issue 11 months ago • 2 comments

As a user I want to download a pdf of a certificate with the name and address from the entity's fields, so that I can quickly, directly from the system create files for certain templates.

From various clients and use cases we have observed the need to create PDFs or print certain documents (e.g. a workshop certificate, school mark sheet, invoice, etc.). At the moment users create these by hand using Word or possibly export data from Aam Digital as a .csv table and then use a Mail Merge functionality to generate individual documents from a Word template. This is a lot of extra effort and requires advanced skills with Word.

User Stories / Requirements

Managing templates

  1. [x] User can create a new template
    1. [x] define the valid entity type(s) for the template
    2. [x] provide a name for the template
    3. [x] upload template (Word) file
  2. [x] User can view list of all templates in an admin interface
    1. [x] filter templates by the entity type (record type, e.g. "Child", "School", "Note", ...) they are available for.
  3. [x] User can edit an existing template
    1. [x] edit the name and entity type(s) for which the template can be used
    2. [x] edit the template design (i.e. re-upload a new template file?)
  4. [x] User can delete an existing template

Generating PDFs from templates

  1. [x] User can create a PDF from a template for a specific entity record
    1. [x] use the action "Print Documents" from the entity menu on the detail view of a record (three dots menu)
    2. [x] select a template in the dialog from all the available templates for this entity type
    3. [x] (generate PDF filled with current data via API)
    4. [x] download the generate PDF document, which is generated from the template by filling in details (e.g. name, address, etc.) of the current record for the placeholders of the template.
  2. [ ] Generated PDF is automatically added as file attachment to the entity to be stored.
  3. [x] User can add a new template from the UI while trying to generate a PDF
    1. [x] The UI for selecting an existing template guides the user to the option of creating a new template (see "Managing templates"), if the required template doesn't exist yet.

Further extensions of the functionality:

  • User can create PDFs from a template for a batch of selected entity records (bulk action)
    1. The same flow to generate PDFs is available as a bulk action from list views for a selection of multiple records at once.
    2. The UX works the same as for an individual PDF from a details view

Implementation Tasks

https://docs.google.com/spreadsheets/d/1PecYL2UgN71P8sh8wXnKALKJCBYDngWV_0L8WEX5MY4/edit?gid=0#gid=0

[original internal specs / client request]

sleidig avatar Feb 28 '24 07:02 sleidig

I added some notes in the internal document, lets discuss this.

tomwwinter avatar Jun 18 '24 08:06 tomwwinter

Detailed implementation plan is ready. We are waiting for confirmation of clients who will fund this feature development.

sleidig avatar Jun 19 '24 13:06 sleidig