view stockoverview.blade: add Value column

This commit is contained in:
Kurt Riddlesperger 2019-10-11 06:26:33 -05:00
parent cb9a319996
commit da8d462672
3 changed files with 12 additions and 6 deletions

View File

@ -6,6 +6,7 @@ SELECT
p.tare_weight AS tare_weight,
p.enable_tare_weight_handling AS enable_tare_weight_handling,
sc.amount AS amount,
sc.value as value,
sc.product_id AS product_id,
sc.best_before_date AS best_before_date,
EXISTS(SELECT id FROM stock_missing_products_including_opened WHERE id = sc.product_id) AS product_missing,
@ -40,6 +41,7 @@ SELECT
p.tare_weight AS tare_weight,
p.enable_tare_weight_handling AS enable_tare_weight_handling,
sc.amount AS amount,
sc.value as value,
sc.product_id AS product_id,
sc.best_before_date AS best_before_date,
EXISTS(SELECT id FROM stock_missing_products_including_opened WHERE id = sc.product_id) AS product_missing,

View File

@ -5,9 +5,9 @@
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 },
{ 'searchable': false, "targets": 0 },
{ 'visible': false, 'targets': 5 },
{ 'visible': false, 'targets': 6 },
{ 'visible': false, 'targets': 7 }
{ 'visible': false, 'targets': 7 },
{ 'visible': false, 'targets': 8 }
],
});
$('#stock-overview-table tbody').removeClass("d-none");
@ -25,7 +25,7 @@ $("#location-filter").on("change", function()
value = "xx" + value + "xx";
}
stockOverviewTable.column(5).search(value).draw();
stockOverviewTable.column(6).search(value).draw();
});
$("#product-group-filter").on("change", function()
@ -40,7 +40,7 @@ $("#product-group-filter").on("change", function()
value = "xx" + value + "xx";
}
stockOverviewTable.column(7).search(value).draw();
stockOverviewTable.column(8).search(value).draw();
});
$("#status-filter").on("change", function()
@ -54,7 +54,7 @@ $("#status-filter").on("change", function()
// Transfer CSS classes of selected element to dropdown element (for background)
$(this).attr("class", $("#" + $(this).attr("id") + " option[value='" + value + "']").attr("class") + " form-control");
stockOverviewTable.column(6).search(value).draw();
stockOverviewTable.column(7).search(value).draw();
});
$(".status-filter-message").on("click", function()
@ -70,9 +70,9 @@ $("#clear-filter-button").on("click", function()
$("#status-filter").val("all");
$("#product-group-filter").val("all");
$("#location-filter").val("all");
stockOverviewTable.column(5).search("").draw();
stockOverviewTable.column(6).search("").draw();
stockOverviewTable.column(7).search("").draw();
stockOverviewTable.column(8).search("").draw();
stockOverviewTable.search("").draw();
});

View File

@ -128,6 +128,7 @@
<th>{{ $__t('Product') }}</th>
<th>{{ $__t('Product group') }}</th>
<th>{{ $__t('Amount') }}</th>
<th class="@if(!GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) d-none @endif">{{ $__t('Value') }}</th>
<th class="@if(!GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) d-none @endif">{{ $__t('Next best before date') }}</th>
<th class="d-none">Hidden location</th>
<th class="d-none">Hidden status</th>
@ -310,6 +311,9 @@
@endif
@endif
</td>
<td>
<span id="product-{{ $currentStockEntry->product_id }}-value" class="locale-number locale-number-currency">{{ $currentStockEntry->value }}</span>
</td>
<td class="@if(!GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) d-none @endif">
<span id="product-{{ $currentStockEntry->product_id }}-next-best-before-date">{{ $currentStockEntry->best_before_date }}</span>
<time id="product-{{ $currentStockEntry->product_id }}-next-best-before-date-timeago"