mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
Add a 'zero stock' threshold line to the part scheduling tab (#3587)
This commit is contained in:
parent
9c79333efd
commit
ccab177f54
@ -2539,15 +2539,34 @@ function loadPartSchedulingChart(canvas_id, part_id) {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
if (part_info.minimum_stock) {
|
var t_min = quantity_scheduled[0].x;
|
||||||
|
var t_max = quantity_scheduled[quantity_scheduled.length - 1].x;
|
||||||
|
|
||||||
|
// Construct a 'zero stock' threshold line
|
||||||
|
data.datasets.push({
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
x: t_min,
|
||||||
|
y: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
x: t_max,
|
||||||
|
y: 0,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
borderColor: 'rgba(250, 50, 50, 0.75)',
|
||||||
|
label: 'zero-stock-level',
|
||||||
|
});
|
||||||
|
|
||||||
// Construct a 'minimum stock' threshold line
|
// Construct a 'minimum stock' threshold line
|
||||||
|
if (part_info.minimum_stock) {
|
||||||
var minimum_stock_curve = [
|
var minimum_stock_curve = [
|
||||||
{
|
{
|
||||||
x: quantity_scheduled[0].x,
|
x: t_min,
|
||||||
y: part_info.minimum_stock,
|
y: part_info.minimum_stock,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
x: quantity_scheduled[quantity_scheduled.length - 1].x,
|
x: t_max,
|
||||||
y: part_info.minimum_stock,
|
y: part_info.minimum_stock,
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
@ -2626,7 +2645,14 @@ function loadPartSchedulingChart(canvas_id, part_id) {
|
|||||||
return `{% trans "Quantity" %}: ${item.raw.y}${delta}`;
|
return `{% trans "Quantity" %}: ${item.raw.y}${delta}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
labels: {
|
||||||
|
filter: function(item, chart) {
|
||||||
|
return !item.text.includes('zero-stock-level');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user