{action->getSupplierName assign=supplier}
{action->getCnt          assign=cnt}

{action->getDeliverylist   assign=deliverylist}
{action->getCheckedArray   assign=checkarray}
{action->getOrderUnitPrice assign=orderunit}
{action->getOrderNum       assign=ordernum}

{action->getPager assign=pager}

{include file="admin/header.html"}
{include file="admin/gnavi.html"}

<div id="container">

{include file="admin/menu/submenu_item.html"}

<!-- ↓段組み　メイン側 -->
<div id="main">

<h3>商品納品入力 リスト</h3>

<!-- ↓仕入れ価格計算スクリプト -->
{literal}
<script language="JavaScript">
function setPrice(target)
{
    var unit = (document.getElementById('u'+target).value!="")?document.getElementById('u'+target).value:0;
    var num  = (document.getElementById('n'+target).value!="")?document.getElementById('n'+target).value:0;
    var price= document.getElementById('p'+target);
    
    price.innerHTML = isNaN(parseInt(unit) * parseInt(num))?0:parseInt(unit) * parseInt(num);
}
</script>
{/literal}
<!-- ↑仕入れ価格計算スクリプト -->

<!-- ↓絞り込み条件 -->
<form name="search" id="search" method="GET">
<input type="hidden" name="suppliercode"     value="{$action.suppliercode}">
<input type="hidden" name="suppliermode"     value="{$action.suppliermode}">
<input type="hidden" name="deliverydatefrom" value="{$action.deliverydatefrom}">
<input type="hidden" name="deliverydateto"   value="{$action.deliverydateto}">
<input type="hidden" name="ordernumber"      value="{$action.ordernumber}">
<input type="hidden" name="jancode"          value="{$action.jancode}">
<input type="hidden" name="sortmode"         value="{$action.sortmode}">
<input type="hidden" name="pageID"           value="{$action.pageID}">

  <table border="0" cellspacing="0" cellpadding="0" class="search-box">
    <tr>
      <td>
        仕入先&nbsp;{$supplier}&nbsp;
        仕入区分
        <select name="suppliermode">
{*          <option value=""  {if $action.suppliermode == ""}selected{/if}>すべて</option> *}
          <option value="1" {if $action.suppliermode ==  1}selected{/if}>通常仕入</option>
          <option value="2" {if $action.suppliermode ==  2}selected{/if}>委託仕入</option>
{*
          <option value="3" {if $action.suppliermode ==  3}selected{/if}>社内移動</option>
          <option value="4" {if $action.suppliermode ==  4}selected{/if}>返品</option>
*}
        </select>
        注文番号<input type="text" name="ordernumber" value="{$action.ordernumber}">
        <input type="hidden" name="clear" value="1">
        <input type="submit" name="dispatch_admin_itemmanage_delivery_list" value="検索">
      </td>
    </tr>
  </table>

</form>

<form name="form1" id="form1" method="GET">
<input type="hidden" name="suppliercode"     value="{$action.suppliercode}">
<input type="hidden" name="suppliermode"     value="{$action.suppliermode}">
<input type="hidden" name="deliverydatefrom" value="{$action.deliverydatefrom}">
<input type="hidden" name="deliverydateto"   value="{$action.deliverydateto}">
<input type="hidden" name="ordernumber"      value="{$action.ordernumber}">
<input type="hidden" name="jancode"          value="{$action.jancode}">
<input type="hidden" name="sortmode"         value="{$action.sortmode}">
<input type="hidden" name="pageID"           value="{$action.pageID}">
<!-- ↑絞り込み条件 -->


<!--↓ソート -->
<table border="0" cellspacing="0" cellpadding="0" class="border-non">
<tr>
  <td>
<strong>並び替え</strong>&nbsp;&nbsp;
  <a href="{$scriptName}?action=admin_itemmanage_delivery_list&suppliercode={$action.suppliercode}&suppliermode={$action.suppliermode}&deliverydatefrom={$action.deliverydatefrom}&deliverydateto={$action.deliverydateto}&ordernumber={$action.ordernumber}&jancode={$action.jancode}&sortmode=code">品番</a>&nbsp;&nbsp;
  <a href="{$scriptName}?action=admin_itemmanage_delivery_list&suppliercode={$action.suppliercode}&suppliermode={$action.suppliermode}&deliverydatefrom={$action.deliverydatefrom}&deliverydateto={$action.deliverydateto}&ordernumber={$action.ordernumber}&jancode={$action.jancode}&sortmode=date">発売日</a>
  </td>
 </tr>
</table>
<!--↑ソート -->

<!--↓エラーメッセージ -->
{errorList->getMessages assign=errmsg}
{if $errmsg}
<div class="error">
  <ul class="alert">
  {foreach from=$errmsg item=msg}
    <li>{$msg|escape}</li>
  {/foreach}
  </ul>
</div>
{/if}
<!--↑エラーメッセージ -->


<!-- ↓ページナビ、データ件数（上） -->
<table class="navi_upper" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <div class="pagenavi">
        {$pager}
      </div>
    </td>
    <td>
      <div class="detanumber1">
        {$cnt}件のデータ
      </div>
    </td>
  </tr>
</table>
<!-- ↑ページナビ、データ件数（上） -->

<!-- ↓検索結果 -->
<table class="hyou" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th class="check">チェック</th>
    <th class="order_number">注文番号</th>

    <th class="product_number">品番</th>
    <th class="title">タイトル</th>

    <th class="sell_date">発売日</th>
    <th class="list_price">定価</th>
    <th class="unit_price">仕入単価</th>
    <th class="order_number">発注数</th>
    <th class="deliver_number">納品数</th>
    <th class="order_price">発注金額</th>
  </tr>

  {foreach from=$deliverylist item=one key=key}
  <tr>
    <td class="check">
      <input type="checkbox" name="ischecked[{$key}]" value="1"{if $checkarray[$key]} checked{/if}>
      <input type="hidden"   name="itemcd[{$key}]"    value="{$one.itemcd}">
      <input type="hidden"   name="structcd[{$key}]"  value="{$one.structcd}">
      <input type="hidden"   name="stocktitlecd[{$key}]"  value="{$one.stocktitlecd}">
      
    </td>
    <td class="order_number2">{$one.orderno|escape}</td>

    <td class="product_number">{$one.makeritemcd}</td>
    <td class="title">{$one.itemnm}&nbsp;{$one.variationnm}</td>

    <td class="sell_date">{$one.salestartdate|date_format:"%Y/%m/%d"}</td>
    <td class="list_price">{$one.makerprice|number_format}円</td>
    <td class="unit_price"><input type="text" name="orderunitprice[{$key}]" value="{if $orderunit[$key]}{$orderunit[$key]}{else}{$one.costprice}{/if}" id="u{$key}" onchange="setPrice('{$key}')" size=5>&nbsp;円</td>
    <td class="order_number">{$one.cnt}本</td>
    <td class="deliver_number"><input type="text" name="ordernum[{$key}]" value="{if $ordernum[$key]}{$ordernum[$key]}{else}{$one.ordernum}{/if}" id="n{$key}" onchange="setPrice('{$key}')" size=5>&nbsp;本</td>
    <td class="order_price"><span id="p{$key}">0</span>円</td>
  </tr>
  {foreachelse}
  <tr>
    <td class="name" colspan="12" align="center">該当するデータは現在登録されておりません。</td>
  </tr>
  {/foreach}
</table>
<!-- ↑検索結果 -->
<!-- ↓ページナビ、データ件数（下） -->
<table class="navi_lower" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <div class="pagenavi">
        {$pager}
      </div>
    </td>
    <td>
      <div class="detanumber1">
        {$cnt}件のデータ
      </div>
    </td>
  </tr>
</table>
<!-- ↑ページナビ、データ件数（下） -->
 


<table width="680"border="0" cellspacing="0" cellpadding="0">
   <tr>
       <td >チェックしたものを<input type="Submit" name="dispatch_admin_itemmanage_delivery_confirm" value="納品済にする"></td>
       <td><input type="submit" name="dispatch_admin_itemmanage_delivery_search" value="検索画面へ"></td>
   </tr>
 </table>


   <table class="attention">
     <tr>
       <td>注意！<br>
         納品数が違う場合は、仕入れ担当者に連絡してください！</td>
     </tr>
   </table>

</form>

<div class="pagetop" title="ページトップへ"><a href="#top">ページトップへ</a></div>

</div>
<!--End of main-->

<div class="cr"></div>
</div>
<!--End of container-->

{include file="admin/footer.html"}
