diff --git a/docs/releases/0.1.6.md b/docs/releases/0.1.6.md index 72b83df..15e8ba1 100644 --- a/docs/releases/0.1.6.md +++ b/docs/releases/0.1.6.md @@ -24,6 +24,8 @@ Refer to the [report documentation](../../report/report) for further information !!! warning "LaTeX Support" LaTeX report templates are no longer supported for a number of technical and ideological reasons +[#1292](https://github.com/inventree/InvenTree/pull/1292) adds support for build order / work order reports. Refer to the [build report documentation](../../report/build) for further information. + ## Major Bug Fixes | PR | Description | | --- | --- | diff --git a/docs/report/build.md b/docs/report/build.md new file mode 100644 index 0000000..6850b00 --- /dev/null +++ b/docs/report/build.md @@ -0,0 +1,24 @@ +--- +title: Build Order Report +--- + +## Build Order Report + +Custom build order reports may be generated against any given Build Order. For example, build order reports can be used to generate work orders. + +### Build Filters + +!!! missing "TODO" + This section rquires further work + +### Context Variables + +In addition to the default report context variables, the following context variables are made available to the build order report template for rendering: + +| Variable | Description | +| --- | --- | +| build | The build object the report is being generated against | +| part | The part object that the build references | +| reference | The build order reference string | +| quantity | Build order quantity | + diff --git a/docs/report/report.md b/docs/report/report.md index fca460f..4d93ad2 100644 --- a/docs/report/report.md +++ b/docs/report/report.md @@ -48,6 +48,24 @@ For example, rendering the name of a part (which is available in the particular !!! info "Variables" Templates will have different variables available to them depending on the report type. Read the detail information on each report type for further information. +### Context Data + +Each report has access to a number of context variables by default. The following context variables are provided to every report template: + +| Variable | Description | +| --- | --- | +| date | Current date, represented as a Python datetime.date object | +| datetime | Current datetime, represented as a Python datetime object | +| default_page_size | InvenTree default page size variable | +| report_name | Name of the report template | +| report_description | Description of the report template | +| report_revision | Revision of the report template | +| request | Django request object | +| user | User who made the request to render the template | + +!!! info "Specific Report Context" + Specific report types may have additional context variables + ### Conditional Rendering The django template system allows for conditional rendering, providing conditional flow statements such as `{% raw %}{% if %}{% endraw %}`, `{% raw %}{% for in %}{% endraw %}`, etc. @@ -182,7 +200,7 @@ InvenTree supports the following reporting functionality: ### Build Report -Build Report: TODO +[Build Order](../build): Format a build order report ### Purchase Order [Purchase Order report](../order): Order line items diff --git a/docs/report/test.md b/docs/report/test.md index d901081..5b5a162 100644 --- a/docs/report/test.md +++ b/docs/report/test.md @@ -27,12 +27,14 @@ In the example below, a test report template is uploaded and assigned to the par ### Context Variables -The following context variables are made available to the TestReport template for rendering: +In addition to the default report context variables, the following context variables are made available to the TestReport template for rendering: -- **stock_item**: The individual stock item for which this test report is being generated -- **part**: The Part of which the stock_item is an instance -- **results**: A dict of test result objects, where the 'key' for each test result is a shortened version of the test name (see below) -- **result_list**: A list of each test result object +| Variable | Description | +| --- | --- | +| stock_item | The individual stock item for which this test report is being generated | +| part | The Part of which the stock_item is an instance | +| results | A dict of test result objects, where the 'key' for each test result is a shortened version of the test name (see below) | +| result_list | A list of each test result object | #### Results diff --git a/mkdocs.yml b/mkdocs.yml index 22f5428..55b2485 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -74,6 +74,7 @@ nav: - Reports: - Test Reports: report/test.md - Packing List: report/pack.md + - Build Order: report/build.md - Order: report/order.md - Labels: report/labels.md - Admin: