<h2>受注履歴</h2>
<table cellspacing="1" class="data">
 <tr>
  <th>対応状況</th>
  <td><%=h @order_delivery.status_view %></td>
 </tr>
 <tr>
  <th>発送日</th>
   <td><%= @order_delivery.shipped_at ? date(@order_delivery.shipped_at) : '未発送' %></td>
 </tr>
 <tr>
  <th>発送伝票番号</th>
   <td>
    <% if @order_delivery.delivery_tickets.empty? %>
     未発送
    <% else %>
    <ul>
     <% @order_delivery.delivery_tickets.each do |ticket| %>
      <li><%=h ticket.code %></li>
     <% end %>
    </ul>
    <% end %>
   </td>
 </tr>
</table>

<h3>お客様情報</h3>
<br />
<table cellspacing="1" class="data">
 <tr>
  <th>受注コード</th><td><%=h @order_delivery.order_code %></td>
  <th>顧客ID</th><td><%=h (@order_delivery.customer_id) %></td>
 </tr>
 <tr>
  <th>受注日</th><td colspan="3"><%= date @order_delivery.received_at %></td>
 </tr>
 <tr>
  <th>顧客名</th><td><%=h @order_delivery.family_name %> <%=h @order_delivery.first_name %></td>
  <th>顧客名（カナ）</th><td><%=h @order_delivery.family_name_kana %> <%=h @order_delivery.first_name_kana %></td>
 </tr>
 <tr>
  <th>メールアドレス</th><td><%=h @order_delivery.email %></td>
  <th>TEL</th><td><%=h @order_delivery.tel01 %>-<%=h @order_delivery.tel03 %>-<%=h @order_delivery.tel03 %></td>
 </tr>
 <tr>
  <th>住所</th>
  <td colspan="3">〒<%=h @order_delivery.zipcode01 %>-<%=h @order_delivery.zipcode02 %><br />
  <%=h @order_delivery.prefecture_name %><%=h @order_delivery.address_city %><%=h @order_delivery.address_detail %></td>
 </tr>
 <tr>
  <th>備考(その他お問い合わせ)</th>
  <td colspan="3"><%=h_br @order_delivery.message %></td>
 </tr>
</table><br />

<h3>配送先情報</h3>
<br />
<table cellspacing="1" class="data">
 <tr>
  <th>お名前</th>
  <td><%=h @order_delivery.deliv_family_name %> <%=h @order_delivery.deliv_first_name %></td>
  <th>お名前（カナ）</th>
  <td><%=h @order_delivery.deliv_family_name_kana %> <%=h @order_delivery.deliv_first_name_kana %></td>
 </tr>
 <tr>
  <th>FAX</th>
  <td colspan="3"><%=h @order_delivery.deliv_fax01 -%>
   - <%=h @order_delivery.deliv_fax02 -%>
   - <%=h @order_delivery.deliv_fax03 -%></td>
 </tr>
 <tr>
  <th>郵便番号</th>
  <td>〒<%=h @order_delivery.deliv_zipcode01 %>-<%=h @order_delivery.deliv_zipcode02 %></td>
  <th>TEL</th>
  <td><%=h @order_delivery.deliv_tel01 -%>
   - <%=h @order_delivery.deliv_tel02 -%>
   - <%=h @order_delivery.deliv_tel03 -%></td>
 </tr>
 <tr>
  <th>住所</th>
  <td colspan="3"><%=h @order_delivery.deliv_pref_name %><br /> <br />
   <%=h @order_delivery.deliv_address_city %><br /><br />
   <%=h @order_delivery.deliv_address_detail %>
  </td>
 </tr>
</table><br />

<h3>受注商品情報</h3>
<br />
<table cellspacing="1" class="data">
 <tr>
  <th>商品コード</th><th>商品名/規格1/規格2</th><th>単価</th><th>数量</th><th>税込み価格</th><th>小計</th>
 </tr>
 <% @order_delivery.order_details.each do | detail | %>
  <tr>
   <td><%=h detail.product_code %></td>
   <td><%=h detail.product_name %>/<%=h detail.style_category_name1 %>/<%=h detail.style_category_name2 %></td>
   <td><%= number_with_delimiter(detail.price) %>円</td>
   <td><%= number_with_delimiter(detail.quantity) %></td>
   <td><%= number_with_delimiter(detail.price_with_tax) %>円</td>
   <td><%= number_with_delimiter(detail.subtotal) %>円</td>
  </tr>
 <% end %>
 <tr>
  <th colspan="5">小計</th>
  <td><%=h number_with_delimiter(@order_delivery.subtotal) %>円</td>
 </tr>
 <tr>
  <th colspan="5">値引</th>
  <td><%= number_with_delimiter @order_delivery.discount %>円</td>
 </tr>
 <tr>
  <th colspan="5">送料</th>
  <td><%= number_with_delimiter @order_delivery.deliv_fee %>円</td>
 </tr>
 <tr>
  <th colspan="5">手数料</th>
  <td><%= number_with_delimiter @order_delivery.charge %>円</td>
 </tr>
 <tr>
  <th colspan="5">合計</th>
  <td><%=h number_with_delimiter(@order_delivery.total) %>円</td>
 </tr>
 <tr>
  <th colspan="5">お支払い合計</th>
  <td><%=h number_with_delimiter(@order_delivery.payment_total) %>円</td>
 </tr>
  <tr>
   <th colspan="5">使用ポイント</th>
   <td><%=h number_with_delimiter(@order_delivery.use_point) %>ポイント</td>
  </tr>
  <tr>
   <th colspan="5">追加ポイント</th>
   <td><%=h number_with_delimiter(@order_delivery.add_point) %>ポイント</td>
  </tr>
 <tr>
  <th colspan="6">お支払方法（お支払方法の変更に伴う手数料の変更は手動にてお願いします。)</th>
 </tr>
 <tr>
  <td colspan="6"><%=h @order_delivery.payment_name  %></td>
 </tr>
 <tr>
  <th colspan="6">時間指定</th>
 </tr>
 <tr>
  <td colspan="6"><%= @order_delivery.delivery_time_name %></td>
 </tr>
 <tr>
  <th colspan="6">SHOPメモ</th>
 </tr>
 <tr>
  <td colspan="6"><%= h_br(@order_delivery.note) %></td>
 </tr>
</table>
