fix: update custom fields in DocumentGenerator and DOCX_TEMPLATES_README for better usability

This commit is contained in:
2025-12-16 11:23:50 +01:00
parent 1fb435eb87
commit 75b8bfd84f
2 changed files with 97 additions and 25 deletions

View File

@@ -49,11 +49,16 @@ This system allows you to generate DOCX documents by filling templates with proj
#### Financial
- `{wartosc_zlecenia}`, `{wartosc_zlecenia_1}`, `{wartosc_zlecenia_2}` - Contract value
#### Contacts
- `{contacts}` - Array of contacts (use loops in advanced templates)
- `{primary_contact}` - Primary contact name
- `{primary_contact_phone}` - Primary contact phone
- `{primary_contact_email}` - Primary contact email
#### Standard Custom Fields (Pre-filled but Editable)
- `{zk}` - ZK field
- `{nr_zk}` - ZK number
- `{kabel}` - Cable information
- `{dlugosc}` - Length
- `{data_wykonania}` - Execution date
- `{st_nr}` - Station number
- `{obw}` - Circuit
- `{wp_short}` - Short WP reference
- `{plomba}` - Seal/plomb information
## Example Template Content
@@ -78,6 +83,17 @@ Meeting Notes: {meeting_notes}
Special Instructions: {special_instructions}
Additional Comments: {additional_comments}
Technical Details:
ZK: {zk}
ZK Number: {nr_zk}
Cable: {kabel}
Length: {dlugosc}
Execution Date: {data_wykonania}
Station Number: {st_nr}
Circuit: {obw}
WP Short: {wp_short}
Seal: {plomba}
Primary Contact:
Name: {primary_contact}
Phone: {primary_contact_phone}
@@ -100,7 +116,7 @@ Generated on: {today_date}
2. In the sidebar, find the "Generate Document" section
3. Select a template from the dropdown
4. **Optional**: Click "Pokaż dodatkowe pola" to add custom data
5. Add any custom fields you need (e.g., `custom_note`, `additional_info`)
5. Fill in the standard fields (zk, nr_zk, kabel, etc.) and any additional custom fields
6. Click "Generate Document"
7. The filled document will be downloaded automatically with filename: `{template_name}_{project_name}_{timestamp}.docx`
@@ -108,10 +124,16 @@ Generated on: {today_date}
During document generation, you can add custom data that will be merged with the project data:
### Standard Fields (Pre-filled but Fully Editable)
These fields are pre-filled with common names but can be modified or removed:
- `zk`, `nr_zk`, `kabel`, `dlugosc`, `data_wykonania`, `st_nr`, `obw`, `wp_short`, `plomba`
### Additional Custom Fields
- **Custom fields** override project data if they have the same name
- Use descriptive names like `meeting_notes`, `special_instructions`, `custom_date`
- Custom fields are available in templates as `{custom_field_name}`
- Empty custom fields are ignored
- All fields can be removed if not needed
### Example Custom Fields:
- `meeting_notes`: "Please bring project documentation"