Aam-Digital / ndb-core

Easy-to-use case management web app for NGOs anywhere in the world.
http://www.aam-digital.com
GNU General Public License v3.0
55 stars 18 forks source link

Feature: PDF generation with entity placeholders #2266

Open sleidig opened 7 months ago

sleidig commented 7 months ago

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:


Implementation Tasks

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

[original internal specs / client request]

tomwwinter commented 3 months ago

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

sleidig commented 3 months ago

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