Past inventories used to list all current products,
not just the ones that existed at the time of inventory. Fixed.
This commit is contained in:
parent
746ad28545
commit
437ec951bd
@ -295,13 +295,19 @@ abstract class Page extends Responder {
|
|||||||
final protected function build_inventory_details($inventory,
|
final protected function build_inventory_details($inventory,
|
||||||
$interactive = true) {
|
$interactive = true) {
|
||||||
$startdate = format_date($inventory->get_starttime());
|
$startdate = format_date($inventory->get_starttime());
|
||||||
$all_products = get_items('product');
|
|
||||||
$seen = $inventory->get_seen_products();
|
$seen = $inventory->get_seen_products();
|
||||||
$unseen = array();
|
$unseen = array();
|
||||||
foreach($all_products as $product) {
|
if($interactive) {
|
||||||
if(!in_array($product, $seen)) {
|
$all_products = get_items('product');
|
||||||
$unseen[] = $product;
|
$total_count = count($all_products);
|
||||||
|
foreach($all_products as $product) {
|
||||||
|
if(!in_array($product, $seen)) {
|
||||||
|
$unseen[] = $product;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$unseen = $inventory->get_unseen_products();
|
||||||
|
$total_count = count($unseen) + count($seen);
|
||||||
}
|
}
|
||||||
$missing = i18n('Missing products');
|
$missing = i18n('Missing products');
|
||||||
$hidden = 'hidden';
|
$hidden = 'hidden';
|
||||||
@ -318,7 +324,7 @@ abstract class Page extends Responder {
|
|||||||
$seen_table = $this->build_seen_table($seen, $inventory);
|
$seen_table = $this->build_seen_table($seen, $inventory);
|
||||||
}
|
}
|
||||||
return replace(array('start_date' => $startdate,
|
return replace(array('start_date' => $startdate,
|
||||||
'total_count' => count($all_products),
|
'total_count' => $total_count,
|
||||||
'seen_count' => count($seen),
|
'seen_count' => count($seen),
|
||||||
'hide' => $hidden,
|
'hide' => $hidden,
|
||||||
'unseen_title' => $missing,
|
'unseen_title' => $missing,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user