2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-15 03:25:42 +00:00

Bug fix for zero quantity pricing ()

- Fix default value for formatPriceRange method
- Display empty value in table

(cherry picked from commit 07d9c2264e)
This commit is contained in:
Oliver
2023-05-05 22:40:20 +10:00
committed by GitHub
parent fdaf6d3e19
commit c29e58aeaa
2 changed files with 9 additions and 1 deletions
InvenTree/templates/js/translated

@ -76,7 +76,11 @@ function formatPriceRange(price_min, price_max, options={}) {
var p_min = price_min || price_max;
var p_max = price_max || price_min;
var quantity = options.quantity || 1;
var quantity = 1;
if ('quantity' in options) {
quantity = options.quantity;
}
if (p_min == null && p_max == null) {
return null;

@ -2063,6 +2063,10 @@ function loadStockTable(table, options) {
currency = baseCurrency();
}
if (row.quantity <= 0) {
return '-';
}
return formatPriceRange(
min_price,
max_price,