mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 21:25:42 +00:00 
			
		
		
		
	removing new stuff in pricing modal
This commit is contained in:
		| @@ -1,7 +1,6 @@ | |||||||
| {% extends "modal_form.html" %} | {% extends "modal_form.html" %} | ||||||
|  |  | ||||||
| {% load i18n %} | {% load i18n %} | ||||||
| {% load inventree_extras %} |  | ||||||
|  |  | ||||||
| {% block pre_form_content %} | {% block pre_form_content %} | ||||||
| <table class='table table-striped table-condensed table-price-two'> | <table class='table table-striped table-condensed table-price-two'> | ||||||
| @@ -96,116 +95,3 @@ | |||||||
| {% endif %} | {% endif %} | ||||||
| <hr> | <hr> | ||||||
| {% endblock %} | {% endblock %} | ||||||
|  |  | ||||||
| {% block post_form_content %} |  | ||||||
|     {% settings_value "INVENTREE_DEFAULT_CURRENCY" as currency %} |  | ||||||
|     {% settings_value "PART_SHOW_GRAPH" as show_graph %} |  | ||||||
|  |  | ||||||
|     {% if show_graph and price_history %} |  | ||||||
|         <h4>{% trans 'Stock Pricing' %}</h4> |  | ||||||
|         {% if price_history|length > 1 %} |  | ||||||
|             <div style="height: 300px"> |  | ||||||
|                 <canvas id="StockPriceChart"></canvas> |  | ||||||
|             </div> |  | ||||||
|             <div class='alert alert-info alert-block'> |  | ||||||
|                 {% blocktrans %}All prices are converted from their original currencies to {{currency}} at the current conversion-rate.{% endblocktrans %} |  | ||||||
|             </div> |  | ||||||
|             <script> |  | ||||||
|             var pricedata = { |  | ||||||
|                     labels: [ |  | ||||||
|                         {% for line in price_history %}'{{ line.date }}',{% endfor %} |  | ||||||
|                     ], |  | ||||||
|                     datasets: [{ |  | ||||||
|                         label: '{% trans "Single Price" %}', |  | ||||||
|                         backgroundColor: 'rgba(255, 99, 132, 0.2)', |  | ||||||
|                         borderColor: 'rgb(255, 99, 132)', |  | ||||||
|                         yAxisID: 'y', |  | ||||||
|                         data: [ |  | ||||||
|                             {% for line in price_history %}{{ line.price|stringformat:".2f" }},{% endfor %} |  | ||||||
|                         ], |  | ||||||
|                         borderWidth: 1, |  | ||||||
|                         type: 'line' |  | ||||||
|                     }, |  | ||||||
|                     {% if 'price_diff' in price_history.0 %} |  | ||||||
|                     { |  | ||||||
|                         label: '{% trans "Single Price Difference" %}', |  | ||||||
|                         backgroundColor: 'rgba(68, 157, 68, 0.2)', |  | ||||||
|                         borderColor: 'rgb(68, 157, 68)', |  | ||||||
|                         yAxisID: 'y2', |  | ||||||
|                         data: [ |  | ||||||
|                             {% for line in price_history %}{{ line.price_diff|stringformat:".2f" }},{% endfor %} |  | ||||||
|                         ], |  | ||||||
|                         borderWidth: 1, |  | ||||||
|                         type: 'line' |  | ||||||
|                     }, |  | ||||||
|                     { |  | ||||||
|                         label: '{% trans "Part Single Price" %}', |  | ||||||
|                         backgroundColor: 'rgba(70, 127, 155, 0.2)', |  | ||||||
|                         borderColor: 'rgb(70, 127, 155)', |  | ||||||
|                         yAxisID: 'y', |  | ||||||
|                         data: [ |  | ||||||
|                             {% for line in price_history %}{{ line.price_part|stringformat:".2f" }},{% endfor %} |  | ||||||
|                         ], |  | ||||||
|                         borderWidth: 1, |  | ||||||
|                         type: 'line' |  | ||||||
|                     }, |  | ||||||
|                     {% endif %} |  | ||||||
|                     { |  | ||||||
|                         label: '{% trans "Quantity" %}', |  | ||||||
|                         backgroundColor: 'rgba(255, 206, 86, 0.2)', |  | ||||||
|                         borderColor: 'rgb(255, 206, 86)', |  | ||||||
|                         yAxisID: 'y1', |  | ||||||
|                         data: [ |  | ||||||
|                             {% for line in price_history %}{{ line.qty|stringformat:"f" }},{% endfor %} |  | ||||||
|                         ], |  | ||||||
|                         borderWidth: 1 |  | ||||||
|                     }] |  | ||||||
|                 } |  | ||||||
|             var ctx = document.getElementById('StockPriceChart'); |  | ||||||
|             var StockPriceChart = new Chart(ctx, { |  | ||||||
|                 type: 'bar', |  | ||||||
|                 data: pricedata, |  | ||||||
|                 options: { |  | ||||||
|                     responsive: true, |  | ||||||
|                     maintainAspectRatio: false, |  | ||||||
|                     plugins: {legend: {position: 'bottom'}}, |  | ||||||
|                     scales: { |  | ||||||
|                         y: { |  | ||||||
|                             type: 'linear', |  | ||||||
|                             position: 'left', |  | ||||||
|                             grid: {display: false}, |  | ||||||
|                             title: { |  | ||||||
|                                 display: true, |  | ||||||
|                                 text: '{% blocktrans %}Single Price - {{currency}}{% endblocktrans %}' |  | ||||||
|                             } |  | ||||||
|                         }, |  | ||||||
|                         y1: { |  | ||||||
|                             type: 'linear', |  | ||||||
|                             position: 'right', |  | ||||||
|                             grid: {display: false}, |  | ||||||
|                             titel: { |  | ||||||
|                                 display: true, |  | ||||||
|                                 text: '{% trans "Quantity" %}', |  | ||||||
|                                 position: 'right' |  | ||||||
|                             } |  | ||||||
|                         }, |  | ||||||
|                         y2: { |  | ||||||
|                             type: 'linear', |  | ||||||
|                             position: 'left', |  | ||||||
|                             grid: {display: false}, |  | ||||||
|                             title: { |  | ||||||
|                                 display: true, |  | ||||||
|                                 text: '{% blocktrans %}Single Price Difference- {{currency}}{% endblocktrans %}' |  | ||||||
|                             } |  | ||||||
|                         } |  | ||||||
|                     }, |  | ||||||
|                 } |  | ||||||
|             }); |  | ||||||
|             </script> |  | ||||||
|         {% else %} |  | ||||||
|         <div class='alert alert-danger alert-block'> |  | ||||||
|             {% trans 'No stock pricing history is available for this part.' %} |  | ||||||
|         </div> |  | ||||||
|         {% endif %} |  | ||||||
|     {% endif %} |  | ||||||
| {% endblock %} |  | ||||||
		Reference in New Issue
	
	Block a user