<?php

$address = new address();
if (!empty($$class->address_id)) {
 $address = $address->findBy_id($$class->address_id);
}


if (!empty($_GET['sd_store_id']) && empty($sd_store_subinventory_object)) {
 $sd_store_subinventory_object = sd_store_subinventory::find_by_parent_id($_GET['sd_store_id']);
}

if (empty($sd_store_subinventory_object)) {
 $sd_store_subinventory_object = [new sd_store_subinventory()];
}

$pageno = !empty($_GET['pageno']) ? $_GET['pageno'] : 1;
$per_page = !empty($_GET['per_page']) ? $_GET['per_page'] : 10;
$total_count = count($sd_store_subinventory_object);
$pagination = new pagination($pageno, $per_page, $total_count);
$pagination->setProperty('_path', 'form');
$position = ($pageno - 1) * $per_page;

if (!empty($sd_store_subinventory_object)) {
 foreach ($sd_store_subinventory_object as &$price_line) {
  if (!empty($price_line->item_id_m)) {
   $item = item::find_by_item_id_m($price_line->item_id_m);
   $price_line->item_number = $item->item_number;
   $price_line->item_description = $item->item_description;
  } else {
   $price_line->item_number = null;
   $price_line->item_description = null;
  }
 }
}
?>
