diff --git a/docs/assets/images/report/bom_example.png b/docs/assets/images/report/bom_example.png new file mode 100644 index 0000000..a674631 Binary files /dev/null and b/docs/assets/images/report/bom_example.png differ diff --git a/docs/report/bom.md b/docs/report/bom.md new file mode 100644 index 0000000..f656d25 --- /dev/null +++ b/docs/report/bom.md @@ -0,0 +1,113 @@ +--- +title: BOM Generation +--- + +## BOM Generation +The bill of materials is an essential part of the documentation that needs to be sent to the factory. A simple csv export is OK to be important into SMT machines. But for human readable documentation it might not be sufficient. Additional information is needed. The Inventree report system allows to generate BOM well formatted BOM reports. + +### A simple example +The following picture shows a simple example for a PCB with just three components from two different parts. + +{% with id="report-options", url="report/bom_example.png", description="BOM example" %} {% include 'img.html' %} {% endwith %} + +This example has been created using the following html template: + +```html +{% raw %} +{% extends "report/inventree_report_base.html" %} + +{% load i18n %} +{% load report %} +{% load inventree_extras %} + +{% block page_margin %} +margin-left: 2cm; +margin-right: 1cm; +margin-top: 4cm; +{% endblock %} + +{% block bottom_left %} +content: "v{{report_revision}} - {{ date.isoformat }}"; +{% endblock %} + +{% block bottom_center %} +content: "InvenTree v{% inventree_version %}"; +{% endblock %} + +{% block style %} +.header-left { + text-align: left; + float: left; +} +table { + border: 1px solid #eee; + border-radius: 3px; + border-collapse: collapse; + width: 100%; + font-size: 80%; +} +table td { + border: 1px solid #eee; +} +{% endblock %} + +{% block header_content %} +
Board | {{ part.IPN }} |
Description | {{ part.description }} |
User | {{ user }} |
Date | {{ date }} |
Number of different components (codes) | {{ bom_items.count }} |
{% trans "IPN" %} | +{% trans "MPN" %} | +{% trans "Manufacturer" %} | +{% trans "Quantity" %} | +{% trans "Reference" %} | +{% trans "Substitute" %} | +
---|---|---|---|---|---|
{{ line.sub_part.IPN }} | +{{ line.sub_part.name }} | ++ {% for manf in line.sub_part.manufacturer_parts.all %} + {{ manf.manufacturer.name }} + {% endfor %} + | +{% decimal line.quantity %} | +{{ line.reference }} | +
+ {% for sub in line.substitutes.all %}
+ {{ sub.part.IPN }} + {% endfor %} + |
+