mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 05:05:42 +00:00 
			
		
		
		
	| @@ -34,6 +34,7 @@ src="{% static 'img/blank_image.png' %}" | |||||||
| {% include "admin_button.html" with url=url %} | {% include "admin_button.html" with url=url %} | ||||||
| {% endif %} | {% endif %} | ||||||
| <!-- Printing options --> | <!-- Printing options --> | ||||||
|  | {% if report_enabled %} | ||||||
| <div class='btn-group'> | <div class='btn-group'> | ||||||
|     <button id='print-options' title='{% trans "Print actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'> |     <button id='print-options' title='{% trans "Print actions" %}' class='btn btn-outline-secondary dropdown-toggle' type='button' data-bs-toggle='dropdown'> | ||||||
|         <span class='fas fa-print'></span> <span class='caret'></span> |         <span class='fas fa-print'></span> <span class='caret'></span> | ||||||
| @@ -42,6 +43,7 @@ src="{% static 'img/blank_image.png' %}" | |||||||
|         <li><a class='dropdown-item' href='#' id='print-build-report'><span class='fas fa-file-pdf'></span> {% trans "Print build order report" %}</a></li> |         <li><a class='dropdown-item' href='#' id='print-build-report'><span class='fas fa-file-pdf'></span> {% trans "Print build order report" %}</a></li> | ||||||
|     </ul> |     </ul> | ||||||
| </div> | </div> | ||||||
|  | {% endif %} | ||||||
| <!-- Build actions --> | <!-- Build actions --> | ||||||
| {% if roles.build.change %} | {% if roles.build.change %} | ||||||
| <div class='btn-group'> | <div class='btn-group'> | ||||||
| @@ -224,9 +226,11 @@ src="{% static 'img/blank_image.png' %}" | |||||||
|         {% endif %} |         {% endif %} | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|  |     {% if report_enabled %} | ||||||
|     $('#print-build-report').click(function() { |     $('#print-build-report').click(function() { | ||||||
|         printBuildReports([{{ build.pk }}]); |         printBuildReports([{{ build.pk }}]); | ||||||
|     }); |     }); | ||||||
|  |     {% endif %} | ||||||
|  |  | ||||||
|     $("#build-delete").on('click', function() { |     $("#build-delete").on('click', function() { | ||||||
|         launchModalForm( |         launchModalForm( | ||||||
|   | |||||||
| @@ -27,6 +27,7 @@ | |||||||
|         <div class='button-toolbar container-fluid' style='float: right;'> |         <div class='button-toolbar container-fluid' style='float: right;'> | ||||||
|             <div class='btn-group' role='group'> |             <div class='btn-group' role='group'> | ||||||
|                  |                  | ||||||
|  |                 {% if report_enabled %} | ||||||
|                 <div class='btn-group' role='group'> |                 <div class='btn-group' role='group'> | ||||||
|                     <!-- Print actions --> |                     <!-- Print actions --> | ||||||
|                     <button id='build-print-options' class='btn btn-primary dropdown-toggle' data-bs-toggle='dropdown'> |                     <button id='build-print-options' class='btn btn-primary dropdown-toggle' data-bs-toggle='dropdown'> | ||||||
| @@ -38,6 +39,7 @@ | |||||||
|                         </a></li> |                         </a></li> | ||||||
|                     </ul> |                     </ul> | ||||||
|                 </div> |                 </div> | ||||||
|  |                 {% endif %} | ||||||
|                 <!-- Buttons to switch between list and calendar views --> |                 <!-- Buttons to switch between list and calendar views --> | ||||||
|                 <button class='btn btn-outline-secondary' type='button' id='view-calendar' title='{% trans "Display calendar view" %}'> |                 <button class='btn btn-outline-secondary' type='button' id='view-calendar' title='{% trans "Display calendar view" %}'> | ||||||
|                     <span class='fas fa-calendar-alt'></span> |                     <span class='fas fa-calendar-alt'></span> | ||||||
| @@ -181,6 +183,7 @@ loadBuildTable($("#build-table"), { | |||||||
|     url: "{% url 'api-build-list' %}", |     url: "{% url 'api-build-list' %}", | ||||||
| }); | }); | ||||||
|  |  | ||||||
|  | {% if report_enabled %} | ||||||
| $('#multi-build-print').click(function() { | $('#multi-build-print').click(function() { | ||||||
|     var rows = $("#build-table").bootstrapTable('getSelections'); |     var rows = $("#build-table").bootstrapTable('getSelections'); | ||||||
|  |  | ||||||
| @@ -192,5 +195,6 @@ $('#multi-build-print').click(function() { | |||||||
|  |  | ||||||
|     printBuildReports(build_ids); |     printBuildReports(build_ids); | ||||||
| }); | }); | ||||||
|  | {% endif %} | ||||||
|  |  | ||||||
| {% endblock %} | {% endblock %} | ||||||
| @@ -768,6 +768,13 @@ class InvenTreeSetting(BaseInvenTreeSetting): | |||||||
|             'validator': InvenTree.validators.validate_part_name_format |             'validator': InvenTree.validators.validate_part_name_format | ||||||
|         }, |         }, | ||||||
|  |  | ||||||
|  |         'REPORT_ENABLE': { | ||||||
|  |             'name': _('Enable Reports'), | ||||||
|  |             'description': _('Enable generation of reports'), | ||||||
|  |             'default': False, | ||||||
|  |             'validator': bool, | ||||||
|  |         }, | ||||||
|  |  | ||||||
|         'REPORT_DEBUG_MODE': { |         'REPORT_DEBUG_MODE': { | ||||||
|             'name': _('Debug Mode'), |             'name': _('Debug Mode'), | ||||||
|             'description': _('Generate reports in debug mode (HTML output)'), |             'description': _('Generate reports in debug mode (HTML output)'), | ||||||
|   | |||||||
| @@ -29,7 +29,9 @@ | |||||||
|         <span class='fas fa-print'></span> <span class='caret'></span> |         <span class='fas fa-print'></span> <span class='caret'></span> | ||||||
|     </button> |     </button> | ||||||
|     <ul class='dropdown-menu' role='menu'> |     <ul class='dropdown-menu' role='menu'> | ||||||
|  |         {% if report_enabled %} | ||||||
|         <li><a class='dropdown-item' href='#' id='print-order-report'><span class='fas fa-file-pdf'></span> {% trans "Print purchase order report" %}</a></li> |         <li><a class='dropdown-item' href='#' id='print-order-report'><span class='fas fa-file-pdf'></span> {% trans "Print purchase order report" %}</a></li> | ||||||
|  |         {% endif %} | ||||||
|         <li><a class='dropdown-item' href='#' id='export-order'><span class='fas fa-file-download'></span> {% trans "Export order to file" %}</a></li> |         <li><a class='dropdown-item' href='#' id='export-order'><span class='fas fa-file-download'></span> {% trans "Export order to file" %}</a></li> | ||||||
|     </ul> |     </ul> | ||||||
| </div> | </div> | ||||||
| @@ -169,9 +171,11 @@ $("#place-order").click(function() { | |||||||
| }); | }); | ||||||
| {% endif %} | {% endif %} | ||||||
|  |  | ||||||
|  | {% if report_enabled %} | ||||||
| $('#print-order-report').click(function() { | $('#print-order-report').click(function() { | ||||||
|     printPurchaseOrderReports([{{ order.pk }}]); |     printPurchaseOrderReports([{{ order.pk }}]); | ||||||
| }); | }); | ||||||
|  | {% endif %} | ||||||
|  |  | ||||||
| $("#edit-order").click(function() { | $("#edit-order").click(function() { | ||||||
|  |  | ||||||
|   | |||||||
| @@ -26,10 +26,11 @@ | |||||||
|     <div id='table-buttons'> |     <div id='table-buttons'> | ||||||
|         <div class='button-toolbar container-fluid' style='float: right;'> |         <div class='button-toolbar container-fluid' style='float: right;'> | ||||||
|             <div class='btn-group' role='group'> |             <div class='btn-group' role='group'> | ||||||
|                  |                 {% if report_enabled %} | ||||||
|                 <button id='order-print' class='btn btn-outline-secondary' title='{% trans "Print Order Reports" %}'> |                 <button id='order-print' class='btn btn-outline-secondary' title='{% trans "Print Order Reports" %}'> | ||||||
|                     <span class='fas fa-print'></span> |                     <span class='fas fa-print'></span> | ||||||
|                 </button> |                 </button> | ||||||
|  |                 {% endif %} | ||||||
|                 <button class='btn btn-outline-secondary' type='button' id='view-calendar' title='{% trans "Display calendar view" %}'> |                 <button class='btn btn-outline-secondary' type='button' id='view-calendar' title='{% trans "Display calendar view" %}'> | ||||||
|                     <span class='fas fa-calendar-alt'></span> |                     <span class='fas fa-calendar-alt'></span> | ||||||
|                 </button> |                 </button> | ||||||
| @@ -169,6 +170,7 @@ $("#view-list").click(function() { | |||||||
|     $("#view-calendar").show(); |     $("#view-calendar").show(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
|  | {% if report_enabled %} | ||||||
| $("#order-print").click(function() { | $("#order-print").click(function() { | ||||||
|     var rows = $("#purchase-order-table").bootstrapTable('getSelections'); |     var rows = $("#purchase-order-table").bootstrapTable('getSelections'); | ||||||
|  |  | ||||||
| @@ -180,6 +182,7 @@ $("#order-print").click(function() { | |||||||
|  |  | ||||||
|     printPurchaseOrderReports(orders); |     printPurchaseOrderReports(orders); | ||||||
| }) | }) | ||||||
|  | {% endif %} | ||||||
|  |  | ||||||
| $("#po-create").click(function() { | $("#po-create").click(function() { | ||||||
|     createPurchaseOrder(); |     createPurchaseOrder(); | ||||||
|   | |||||||
| @@ -39,7 +39,9 @@ src="{% static 'img/blank_image.png' %}" | |||||||
|         <span class='fas fa-print'></span> <span class='caret'></span> |         <span class='fas fa-print'></span> <span class='caret'></span> | ||||||
|     </button> |     </button> | ||||||
|     <ul class='dropdown-menu' role='menu'> |     <ul class='dropdown-menu' role='menu'> | ||||||
|  |         {% if report_enabled %} | ||||||
|         <li><a class='dropdown-item' href='#' id='print-order-report'><span class='fas fa-file-pdf'></span> {% trans "Print sales order report" %}</a></li> |         <li><a class='dropdown-item' href='#' id='print-order-report'><span class='fas fa-file-pdf'></span> {% trans "Print sales order report" %}</a></li> | ||||||
|  |         {% endif %} | ||||||
|         <li><a class='dropdown-item' href='#' id='export-order'><span class='fas fa-file-download'></span> {% trans "Export order to file" %}</a></li> |         <li><a class='dropdown-item' href='#' id='export-order'><span class='fas fa-file-download'></span> {% trans "Export order to file" %}</a></li> | ||||||
|         <!-- |         <!-- | ||||||
|         <li><a class='dropdown-item' href='#' id='print-packing-list'><span class='fas fa-clipboard-list'></span>{% trans "Print packing list" %}</a></li> |         <li><a class='dropdown-item' href='#' id='print-packing-list'><span class='fas fa-clipboard-list'></span>{% trans "Print packing list" %}</a></li> | ||||||
| @@ -206,9 +208,11 @@ $("#ship-order").click(function() { | |||||||
|     }); |     }); | ||||||
| }); | }); | ||||||
|  |  | ||||||
|  | {% if report_enabled %} | ||||||
| $('#print-order-report').click(function() { | $('#print-order-report').click(function() { | ||||||
|     printSalesOrderReports([{{ order.pk }}]); |     printSalesOrderReports([{{ order.pk }}]); | ||||||
| }); | }); | ||||||
|  | {% endif %} | ||||||
|  |  | ||||||
| $('#export-order').click(function() { | $('#export-order').click(function() { | ||||||
|     exportOrder('{% url "so-export" order.id %}'); |     exportOrder('{% url "so-export" order.id %}'); | ||||||
|   | |||||||
| @@ -29,10 +29,11 @@ | |||||||
|     <div id='table-buttons'> |     <div id='table-buttons'> | ||||||
|         <div class='button-toolbar container-fluid' style='float: right;'> |         <div class='button-toolbar container-fluid' style='float: right;'> | ||||||
|             <div class='btn-group'> |             <div class='btn-group'> | ||||||
|                  |                 {% if report_enabled %} | ||||||
|                 <button id='order-print' class='btn btn-outline-secondary' title='{% trans "Print Order Reports" %}'> |                 <button id='order-print' class='btn btn-outline-secondary' title='{% trans "Print Order Reports" %}'> | ||||||
|                     <span class='fas fa-print'></span> |                     <span class='fas fa-print'></span> | ||||||
|                 </button> |                 </button> | ||||||
|  |                 {% endif %} | ||||||
|                 <button class='btn btn-outline-secondary' type='button' id='view-calendar' title='{% trans "Display calendar view" %}'> |                 <button class='btn btn-outline-secondary' type='button' id='view-calendar' title='{% trans "Display calendar view" %}'> | ||||||
|                     <span class='fas fa-calendar-alt'></span> |                     <span class='fas fa-calendar-alt'></span> | ||||||
|                 </button> |                 </button> | ||||||
| @@ -173,6 +174,7 @@ loadSalesOrderTable("#sales-order-table", { | |||||||
|     url: "{% url 'api-so-list' %}", |     url: "{% url 'api-so-list' %}", | ||||||
| }); | }); | ||||||
|  |  | ||||||
|  | {% if report_enabled %} | ||||||
| $("#order-print").click(function() { | $("#order-print").click(function() { | ||||||
|     var rows = $("#sales-order-table").bootstrapTable('getSelections'); |     var rows = $("#sales-order-table").bootstrapTable('getSelections'); | ||||||
|  |  | ||||||
| @@ -184,6 +186,7 @@ $("#order-print").click(function() { | |||||||
|  |  | ||||||
|     printSalesOrderReports(orders); |     printSalesOrderReports(orders); | ||||||
| }) | }) | ||||||
|  | {% endif %} | ||||||
|  |  | ||||||
| $("#so-create").click(function() { | $("#so-create").click(function() { | ||||||
|     createSalesOrder(); |     createSalesOrder(); | ||||||
|   | |||||||
| @@ -164,7 +164,9 @@ | |||||||
|                     <li><a class='dropdown-item' href='#' id='multi-part-category' title='{% trans "Set category" %}'>{% trans "Set Category" %}</a></li> |                     <li><a class='dropdown-item' href='#' id='multi-part-category' title='{% trans "Set category" %}'>{% trans "Set Category" %}</a></li> | ||||||
|                     {% endif %} |                     {% endif %} | ||||||
|                     <li><a class='dropdown-item' href='#' id='multi-part-order' title='{% trans "Order parts" %}'>{% trans "Order Parts" %}</a></li> |                     <li><a class='dropdown-item' href='#' id='multi-part-order' title='{% trans "Order parts" %}'>{% trans "Order Parts" %}</a></li> | ||||||
|  |                     {% if report_enabled %} | ||||||
|                     <li><a class='dropdown-item' href='#' id='multi-part-print-label' title='{% trans "Print Labels" %}'>{% trans "Print Labels" %}</a></li> |                     <li><a class='dropdown-item' href='#' id='multi-part-print-label' title='{% trans "Print Labels" %}'>{% trans "Print Labels" %}</a></li> | ||||||
|  |                     {% endif %} | ||||||
|                     <li><a class='dropdown-item' href='#' id='multi-part-export' title='{% trans "Export" %}'>{% trans "Export Data" %}</a></li> |                     <li><a class='dropdown-item' href='#' id='multi-part-export' title='{% trans "Export" %}'>{% trans "Export Data" %}</a></li> | ||||||
|                 </ul> |                 </ul> | ||||||
|             </div> |             </div> | ||||||
|   | |||||||
| @@ -373,7 +373,9 @@ | |||||||
|                     </button> |                     </button> | ||||||
|                     <ul class='dropdown-menu' role='menu'> |                     <ul class='dropdown-menu' role='menu'> | ||||||
|                         <li><a class='dropdown-item' href='#' id='download-bom'><span class='fas fa-file-download'></span> {% trans "Export BOM" %}</a></li> |                         <li><a class='dropdown-item' href='#' id='download-bom'><span class='fas fa-file-download'></span> {% trans "Export BOM" %}</a></li> | ||||||
|  |                         {% if report_enabled %} | ||||||
|                         <li><a class='dropdown-item' href='#' id='print-bom-report'><span class='fas fa-file-pdf'></span> {% trans "Print BOM Report" %}</a></li> |                         <li><a class='dropdown-item' href='#' id='print-bom-report'><span class='fas fa-file-pdf'></span> {% trans "Print BOM Report" %}</a></li> | ||||||
|  |                         {% endif %} | ||||||
|                     </ul> |                     </ul> | ||||||
|                 </div> |                 </div> | ||||||
|                 <!-- Actions menu --> |                 <!-- Actions menu --> | ||||||
| @@ -766,9 +768,11 @@ | |||||||
|             ); |             ); | ||||||
|         }); |         }); | ||||||
|  |  | ||||||
|  |         {% if report_enabled %} | ||||||
|         $("#print-bom-report").click(function() { |         $("#print-bom-report").click(function() { | ||||||
|             printBomReports([{{ part.pk }}]); |             printBomReports([{{ part.pk }}]); | ||||||
|         }); |         }); | ||||||
|  |         {% endif %} | ||||||
|     }); |     }); | ||||||
|  |  | ||||||
|     // Load the "related parts" tab |     // Load the "related parts" tab | ||||||
|   | |||||||
| @@ -12,6 +12,7 @@ | |||||||
|  |  | ||||||
| <table class='table table-striped table-condensed'> | <table class='table table-striped table-condensed'> | ||||||
|     <tbody> |     <tbody> | ||||||
|  |         {% include "InvenTree/settings/setting.html" with key="REPORT_ENABLE" %} | ||||||
|         {% include "InvenTree/settings/setting.html" with key="REPORT_DEFAULT_PAGE_SIZE" %} |         {% include "InvenTree/settings/setting.html" with key="REPORT_DEFAULT_PAGE_SIZE" %} | ||||||
|         {% include "InvenTree/settings/setting.html" with key="REPORT_DEBUG_MODE" %} |         {% include "InvenTree/settings/setting.html" with key="REPORT_DEBUG_MODE" %} | ||||||
|         {% include "InvenTree/settings/setting.html" with key="REPORT_ENABLE_TEST_REPORT" %} |         {% include "InvenTree/settings/setting.html" with key="REPORT_ENABLE_TEST_REPORT" %} | ||||||
|   | |||||||
| @@ -4,6 +4,7 @@ | |||||||
|  |  | ||||||
| {% settings_value 'BARCODE_ENABLE' as barcodes %} | {% settings_value 'BARCODE_ENABLE' as barcodes %} | ||||||
| {% settings_value 'REPORT_ENABLE_TEST_REPORT' as test_report_enabled %} | {% settings_value 'REPORT_ENABLE_TEST_REPORT' as test_report_enabled %} | ||||||
|  | {% settings_value "REPORT_ENABLE" as report_enabled %} | ||||||
|  |  | ||||||
| <!DOCTYPE html> | <!DOCTYPE html> | ||||||
| <html lang="en"> | <html lang="en"> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user