You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
* Add release entry for 0.11.x
* Add note about default reports.
* Add brief documentation on report filtering
* Add images for report filter selection
* More report docs
* Cleanup
* Fix filter docs for TestReport
* Update context variables for TestReport
* Add context variable information for purchase order
* Updates for sales order report docs
Copy file name to clipboardExpand all lines: docs/report/build.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,11 @@ title: Build Order Report
4
4
5
5
## Build Order Report
6
6
7
-
Custom build order reports may be generated against any given Build Order. For example, build order reports can be used to generate work orders.
7
+
Custom build order reports may be generated against any given [Build Order](../build/build.md). For example, build order reports can be used to generate work orders.
8
+
9
+
### Build Filters
10
+
11
+
A build order report template may define a set of filters against which [Build Order](../build/build.md) items are sorted.
Copy file name to clipboardExpand all lines: docs/report/purchase_order.md
+16-2Lines changed: 16 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,24 @@ title: Purchase Order Report
4
4
5
5
## Purchase Order Reports
6
6
7
+
Custom purchase order reports may be generated against any given [Purchase Order](../buy/po.md). For example, purchase order reports could be used to generate a pdf of the order to send to a supplier.
8
+
9
+
### Purchase Order Filters
10
+
11
+
The report template can be filtered against available [Purchase Order](../buy/po.md) instances.
12
+
7
13
### Context Variables
8
14
9
-
!!! missing "TODO"
10
-
This section requires further work
15
+
In addition to the default report context variables, the following variables are made available to the purchase order report template for rendering:
16
+
17
+
| Variable | Description |
18
+
| --- | --- |
19
+
| order | The specific Purchase Order object |
20
+
| reference | The order reference field (can also be accessed as `{% raw %}{{ order.description }}{% endraw %}`) |
21
+
| description | The order description field |
22
+
| supplier | The [supplier](../buy/supplier.md) associated with this purchase order |
23
+
| lines | A list of available line items for this order |
24
+
| extra_lines | A list of available *extra* line items for this order |
Copy file name to clipboardExpand all lines: docs/report/report.md
+56-4Lines changed: 56 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -146,6 +146,62 @@ InvenTree supports the following reporting functionality:
146
146
| [Sales Order Report](./sales_order.md) | Format a sales order report |
147
147
| [Return Order Report](./return_order.md) | Format a return order report |
148
148
149
+
### Default Reports
150
+
151
+
InvenTree is supplied with a number of default templates "out of the box". These are generally quite simple, but serve as a starting point for building custom reports to suit a specific need.
152
+
153
+
!!! tip "Read the Source"
154
+
The sourcecode for the default reports is [available on GitHub](https://github.com/inventree/InvenTree/tree/master/InvenTree/report/templates/report). Use this as a guide for generating your own reports!
155
+
156
+
## Creating Reports
157
+
158
+
Report templates are created (and edited) via the [admin interface](../settings/admin.md), under the *Report*section. Select the certain type of report template you are wanting to create, and press the *Add*button in the top right corner:
Only users with staff access can upload or edit report template files.
166
+
167
+
!!! info "Editing Reports"
168
+
Existing reports can be edited from the admin interface, in the same location as described above. To change the contents of the template, re-uploadatemplate file, to overrie the existing templatedata.
169
+
170
+
### Name and Description
171
+
172
+
Each report template requires a name and description, which identify and describe the report template.
173
+
174
+
### Enabled Status
175
+
176
+
Boolean field which determines if the specific report template is enabled, and available for use. Reports can be disabled to remove them from the list of available templates, but without deleting them from the database.
177
+
178
+
### Filename Pattern
179
+
180
+
The filename pattern used to generate the output `.pdf` file. Defaults to "report.pdf"
181
+
182
+
### Report Filters
183
+
184
+
Each type of report provides a*filters* field, which can be used to filter which items a report can be generated against. The target of the *filters* field depends on the type of report - refer to the documentation on the specific report type for more information.
185
+
186
+
For example, the [Test Report](./test.md) filter targets the linked [Stock Item](../stock/status.md) object, and can be used to select which stock items are allowed for the given report. Let's say that a certain test report should only be generated for "trackable" stock items. Afilter could easily be constructed to accommodate this, by limiting available items to those where the associated [Part](../part/part.md) is *trackable*:
Report filtering is an advanced topic, and requires a little bit of knowledge of the underlying data structure!
200
+
201
+
### Metadata
202
+
203
+
A JSON field made available to any [plugins](../extend/plugins.md) - but not used by internal code.
204
+
149
205
## Report Options
150
206
151
207
A number of global reporting options are available for customizing InvenTree reports:
@@ -175,10 +231,6 @@ Setting the *Debug Mode* option renders the template as raw HTML instead of PDF,
175
231
!!! warning "HTML Rendering Limitations"
176
232
When rendered in debug mode, @page attributes (such as size, etc) will **not** be observed. Additionally, any asset files stored on the InvenTree server will not be rendered. Debug mode is not intended to produce "good looking" documents!
177
233
178
-
## Uploading Templates
179
-
180
-
Custom report templates can be uploaded using the [Admin Interface](../settings/admin.md). Only users with admin access can upload and/or edit report template files.
181
-
182
234
## Report Assets
183
235
184
236
User can upload asset files (e.g. images) which can be used when generating reports. For example, you may wish to generate a report with your company logo in the header. Asset files are uploaded via the admin interface.
Copy file name to clipboardExpand all lines: docs/report/sales_order.md
+16-2Lines changed: 16 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,24 @@ title: Sales Order Reports
4
4
5
5
## Sales Order Reports
6
6
7
+
Custom sales order reports may be generated against any given [Sales Order](../sell/so.md). For example, a sales order report could be used to generate an invoice to send to a customer.
8
+
9
+
### Sales Order Filters
10
+
11
+
The report template can be filtered against available [Sales Order](../sell/so.md) instances.
12
+
7
13
### Context Variables
8
14
9
-
!!! missing "TODO"
10
-
This section requires further work
15
+
In addition to the default report context variables, the following variables are made available to the sales order report template for rendering:
16
+
17
+
| Variable | Description |
18
+
| --- | --- |
19
+
| order | The specific Sales Order object |
20
+
| reference | The order reference field (can also be accessed as `{% raw %}{{ order.description }}{% endraw %}`) |
21
+
| description | The order description field |
22
+
| customer | The [customer](../sell/customer.md) associated with the particular sales order |
23
+
| lines | A list of available line items for this order |
24
+
| extra_lines | A list of available *extra* line items for this order |
Copy file name to clipboardExpand all lines: docs/report/test.md
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,29 +10,35 @@ Custom test reports may be generated against any given stock item. All testing d
10
10
11
11
For example, an "Acceptance Test" report template may be customized to the particular device, with the results for certain tests rendering in a particular part of the page, with any tests which have not passed highlighted.
12
12
13
-
### Part Filters
13
+
### Stock Item Filters
14
14
15
-
A TestReport template may define a set of filters against which parts are sorted. Any Part objects which match the provided filters can use the given TestReport.
15
+
A TestReport template may define a set of filters against which stock items are sorted. Any [StockItem](../stock/stock.md) objects which match the provided filters can use the given TestReport.
16
16
17
-
This allows each TestReport to easily be assigned to a particular Part, or even multiple parts.
17
+
This allows each TestReport to easily be assigned to a particular StockItem, or even multiple items.
18
18
19
-
In the example below, a test report template is uploaded and assigned to the part with the name *"My Widget"*. Any combination of fields relevant to the Part model can be used here.
19
+
In the example below, a test report template is uploaded and available to any stock items linked to a part with the name *"My Widget"*. Any combination of fields relevant to the StockItem model can be used here.
20
20
21
-
{% with id="test_report_add", url="admin/test_report_add.png", description="Upload test report template" %}
21
+
{% with id="test-report-filters", url="report/test_report_filters.png", description="Test report filters" %}
22
22
{% include 'img.html' %}
23
23
{% endwith %}
24
24
25
+
25
26
### Context Variables
26
27
27
28
In addition to the default report context variables, the following context variables are made available to the TestReport template for rendering:
28
29
29
30
| Variable | Description |
30
31
| --- | --- |
31
-
| stock_item | The individual [StockItem](./context_variables.md#stockitem) object for which this test report is being generated |
32
+
| stock_item | The individual [Stock Item](./context_variables.md#stockitem) object for which this test report is being generated |
33
+
| serial | The serial number of the linked Stock Item |
32
34
| part | The [Part](./context_variables.md#part) object of which the stock_item is an instance |
35
+
| parameters | A dict object representing the [parameters](../part/parameter.md) of the referenced part |
36
+
| test_keys | A list of the available 'keys' for the test results recorded against the stock item |
37
+
| test_template_list | A list of the available [test templates](../part/test.md#part-test-templates) for the referenced part |
38
+
| test_template_map | A map / dict of the available test templates |
33
39
| results | A dict of test result objects, where the 'key' for each test result is a shortened version of the test name (see below) |
34
40
| result_list | A list of each test result object |
35
-
| installed_items | A flattened list representing all [StockItem](./context_variables.md#stockitem) objects which are *installed inside* the referenced [StockItem](./context_variables.md#stockitem) object |
41
+
| installed_items | A flattened list representing all [Stock Item](./context_variables.md#stockitem) objects which are *installed inside* the referenced [Stock Item](./context_variables.md#stockitem) object |
0 commit comments