2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-20 13:56:30 +00:00

refactor for better readabilty

This commit is contained in:
2021-06-25 07:40:01 +02:00
parent b99af16bfd
commit 4921cd47f9
2 changed files with 25 additions and 13 deletions

View File

@ -340,7 +340,7 @@
borderWidth: 1
}]
}
var StockPriceChart = loadStockPricingChart(document.getElementById('StockPriceChart'), pricedata)
var StockPriceChart = loadStockPricingChart($('#StockPriceChart'), pricedata)
var bom_colors = randomColor({hue: 'green', count: {{ bom_parts|length }} })
var bomdata = {
labels: [{% for line in bom_parts %}'{{ line.name }}',{% endfor %}],
@ -369,12 +369,14 @@
{% if show_internal_price and roles.sales_order.view %}
initPriceBreakSet(
$('#internal-price-break-table'),
{{part.id}},
'internal price break',
'internal-price',
"{% url 'api-part-internal-price-list' %}",
$('#new-internal-price-break'),
'{% url 'internal-price-break-create' %}'
{
part_id: {{part.id}},
pb_human_name: 'internal price break',
pb_url_slug: 'internal-price',
pb_url: '{% url 'api-part-internal-price-list' %}',
pb_new_btn: $('#new-internal-price-break'),
pb_new_url: '{% url 'internal-price-break-create' %}',
},
);
{% endif %}
@ -393,12 +395,14 @@
{% if part.salable and roles.sales_order.view %}
initPriceBreakSet(
$('#price-break-table'),
{{part.id}},
'sale price break',
'sale-price',
"{% url 'api-part-sale-price-list' %}",
$('#new-price-break'),
'{% url 'sale-price-break-create' %}'
{
part_id: {{part.id}},
pb_human_name: 'sale price break',
pb_url_slug: 'sale-price',
pb_url: "{% url 'api-part-sale-price-list' %}",
pb_new_btn: $('#new-price-break'),
pb_new_url: '{% url 'sale-price-break-create' %}',
},
);
{% endif %}