echo gettext('Key Name');
?>
</th>
           <th><?php 
echo gettext('Key Value');
?>
</th>
          </tr>
         </thead>
         <tbody class="form_data_line_tbody">
          <?php 
$count = 0;
if (!empty($search_result)) {
    foreach ($search_result as $inv_reservation) {
        if (!empty(${$class}->onhand_id)) {
            $onhand_i = onhand_v::find_by_id(${$class}->onhand_id);
            ${$class}->onhand = $onhand_i->onhand;
            ${$class}->reservable_onhand = $onhand_i->reservable_onhand;
        } else {
            ${$class}->onhand = ${$class}->reservable_onhand = null;
        }
        if (!empty(${$class}->inv_serial_number_id)) {
            $inv_serial_number_i = inv_serial_number::find_by_id(${$class}->inv_serial_number_id);
            ${$class}->serial_number = $inv_serial_number_i->serial_number;
        } else {
            ${$class}->serial_number = null;
        }
        ?>
         
            <tr class="inv_reservation_line<?php 
        echo $count;
   <th><?php echo gettext('Serial') ?> #</th>
   <th><?php echo gettext('Onhand') ?></th>
   <th><?php echo gettext('Res. Onhand') ?></th>
   <th><?php echo gettext('Onhand Id') ?></th>
   <th><?php echo gettext('Comment') ?></th>
   <th><?php echo gettext('Key Name') ?></th>
   <th><?php echo gettext('Key Value') ?></th>
  </tr>
 </thead>
 <tbody class="form_data_line_tbody">
  <?php
  $count = 0;
  if (!empty($search_result)) {
   foreach ($search_result as $inv_reservation) {
    if (!empty($$class->onhand_id)) {
     $onhand_i = onhand_v::find_by_id($$class->onhand_id);
     $$class->onhand = $onhand_i->onhand;
     $$class->reservable_onhand = $onhand_i->reservable_onhand;
    }else{
     $$class->onhand =  $$class->reservable_onhand = null;
    }
    if (!empty($$class->inv_serial_number_id)) {
     $inv_serial_number_i = inv_serial_number::find_by_id($$class->inv_serial_number_id);
     $$class->serial_number = $inv_serial_number_i->serial_number;
    }else{
     $$class->serial_number =  null;
    }
    ?>         
    <tr class="inv_reservation_line<?php echo $count ?>">
     <td><?php $f->seq_field_d($count); ?></td>
     <td><?php echo $f->select_field_from_array('supply_type', inv_reservation::$supply_type_a, $$class->supply_type); ?></td>
Exemplo n.º 3
0
<?php

include_once "../../../includes/basics/basics.inc";
if (!empty($_GET['item_id_m']) && !empty($_GET['find_onhand_details']) && !empty($_GET['org_id']) && !empty($_GET['subinventory_id'])) {
    $onhand = new onhand_v();
    $onhand->item_id_m = $_GET['item_id_m'];
    $onhand->org_id = $_GET['org_id'];
    $onhand->subinventory_id = $_GET['subinventory_id'];
    $onhand->locator_id = !empty($_GET['locator_id']) ? $_GET['locator_id'] : null;
    $onhand_i = $onhand->findBy_itemIdm_location();
    $onhand_a = [];
    $onhand_sum = 0;
    $reservable_onhand_sum = 0;
    echo header('Content-Type: application/json');
    if ($onhand_i && count($onhand_i) >= 1) {
        foreach ($onhand_i as $onhand_obj) {
            $onhand_sum += $onhand_obj->onhand;
            $reservable_onhand_sum += $onhand_obj->reservable_onhand;
        }
    }
    // pa($onhand_i);
    $onhand_a['onhand'] = $onhand_sum;
    $onhand_a['reservable_onhand'] = $reservable_onhand_sum;
    if (!empty($onhand_i) && count($onhand_i) == 1) {
        $onhand_a['onhand_id'] = $onhand_i[0]->onhand_id;
    }
    echo json_encode($onhand_a);
}