<%= render :partial => "base/title", :locals => {:title => "ご注文の確定"} %>

<% @order_deliveries.each do |retailer_id, order_delivery| %>

<% @order_details_map[retailer_id].each_with_index do | detail, i | %>
商品名<%= link_to_product(detail.product, detail.product_style_name) %>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<div style="text-align:right;">単価：&yen;<%= number_with_delimiter detail.price %>
 / 数量：<%= number_with_delimiter detail.quantity %>個<br />
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
計:&yen;<%= number_with_delimiter detail.subtotal %>（税込み価格）</div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "5" %><br /></div>
<% end %>

<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<div style="clear:both; background-color:#F3F3EC; text-align:center;"><%= image_tag_mobile "border", :width => "226", :height => "2" %><br /></div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>

<!-- 合計 -->
小計（税込み価格）:<%= number_with_delimiter order_delivery.subtotal %>円
<br/>
送料:<%= number_with_delimiter order_delivery.deliv_fee %>円
<br/>
手数料:<%= number_with_delimiter order_delivery.charge %>円
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "4" %><br /></div>
<div style="text-align:center;">【 合計 <%= number_with_delimiter order_delivery.total %>円 】</div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "4" %><br /></div>


<!-- ポイント -->
<% if @login_customer %>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<div style="clear:both; background-color:#F3F3EC; text-align:center;"><%= image_tag_mobile "border", :width => "226", :height => "2" %><br /></div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
ご使用ポイント
<br/>
-<%= number_with_delimiter(order_delivery.use_point.to_i) %>Pt
<br/>


ご注文前のポイント
<br/>
<%= number_with_delimiter(@login_customer.point.to_i) %>Pt
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<% end %>

<% end %>

<% unless @not_login_customer %>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
今回加算されるポイント
<br/>
+<%= number_with_delimiter(@cart_point.to_i) %>Pt
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
ご注文完了後のポイント
<br/>
<%= number_with_delimiter(@point_after_operation.to_i) %>Pt
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>

<% end %>

<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "4" %><br /></div>
<div style="text-align:center;">【 支払金額  <%= number_with_delimiter @payment_total %>円 】</div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "4" %><br /></div>

<!-- お客様情報 -->
<% od = @order_deliveries.values.first %>
<% if @not_login_customer %>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<div style="clear:both; background-color:#F3F3EC; text-align:center;"><%= image_tag_mobile "border", :width => "226", :height => "2" %><br /></div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<span style="color:#FF9775;">■</span> お客様情報<br />
お名前
<br/>
<%=h od.family_name %>&nbsp;<%=h od.first_name %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
お名前（フリガナ）
<br/>
<%=h od.family_name_kana %>&nbsp;<%=h od.first_name_kana %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
郵便番号
<br/>
〒<%=h od.deliv_zipcode01 %>-<%=h od.deliv_zipcode02 %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
住所
<br/>
<%=h od.prefecture.name %><%=h od.address_city %><%=h od.address_detail %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
電話番号
<br/>
<%=h od.tel01 %>-<%=h od.tel02 %>-<%=h od.tel03 %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
ファックス番号
<br/>
<%=h od.fax01 %>-<%=h od.fax02 %>-<%=h od.fax03 %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
メールアドレス
<br/>
<%=h od.email %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
性別
<br/>
<%=h od.sex_name %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
生年月日
<br/>
<%=h od.birthday %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
職業
<br/>
<%=h od.occupation && od.occupation.name %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<% end %>

<!-- お届け先 -->
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<div style="clear:both; background-color:#F3F3EC; text-align:center;"><%= image_tag_mobile "border", :width => "226", :height => "2" %><br /></div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<span style="color:#FF9775;">■</span> お届け先<br />
〒<%=h od.deliv_zipcode01 %>-<%=h od.deliv_zipcode02 %>
<br/>
<%=h od.deliv_pref.name %><%=h od.deliv_address_city %><%=h od.deliv_address_detail %>
<br/>
<%=h od.deliv_family_name %>&nbsp;<%=h od.deliv_first_name %>
<br/>
Tel. <%=h od.deliv_tel01 %>-<%=h od.deliv_tel02 %>-<%=h od.deliv_tel03 %>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "4" %><br /></div>

<!-- お支払方法・お届け時間 -->
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<div style="clear:both; background-color:#F3F3EC; text-align:center;"><%= image_tag_mobile "border", :width => "226", :height => "2" %><br /></div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>

<span style="color:#FF9775;">■</span> お支払方法・お届け時間<br />
<%=h od.payment.name %>
<br/>
<%=h od.delivery_time_name %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "4" %><br /></div>
<div style="clear:both; background-color:#F3F3EC; text-align:center;"><%= image_tag_mobile "border", :width => "226", :height => "2" %><br /></div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "4" %><br /></div>

<% form_tag :action => @next do %>
<div style="text-align:center;">
    <%= render :partial=>'order_deliveries' %>
    <%- @order_deliveries.each do |key, order_delivery| -%>
      <%- order_delivery.attribute_names.each do |column| %>
        <%= hidden_field_tag "order_deliveries[#{key}][#{column}]", order_delivery[column] %>
      <%- end %>
    <%- end -%>
    <% if @not_login_customer%>
    <%=hidden_field_tag "temporary_customer_flag","1"%>
      <% if !params[:address_enable].nil?%>
        <%=hidden_field_tag "address_enable","1"%>
      <% end%>  
    <% end%>

    <%= submit_tag '注文' %>
</div>
<% end %>
<% form_tag :action => 'purchase' do %>
<div style="text-align:center;">
    <%= render :partial=>'order_deliveries' %>
    <%- @order_deliveries.each do |key, order_delivery| -%>
      <%- order_delivery.attribute_names.each do |column| %>
        <%= hidden_field_tag "order_deliveries[#{key}][#{column}]", order_delivery[column] %>
      <%- end %>
    <%- end -%>
    <% if @not_login_customer%>
    <%=hidden_field_tag "temporary_customer_flag","1"%>
      <% if !params[:address_enable].nil?%>
        <%=hidden_field_tag "address_enable","1"%>
      <% end%>  
    <% end%>
    <%=hidden_field_tag "back","1" %>
    <%= submit_tag '戻る' %>
    <br/>
</div>
<% end %>
<% if false %>


<% @order_details.each_with_index do | detail, i | %>
商品名<%= link_to_product(detail.product, detail.product_style_name) %>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<div style="text-align:right;">単価：&yen;<%= number_with_delimiter detail.price %>
 / 数量：<%= number_with_delimiter detail.quantity %>個<br />
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
計:&yen;<%= number_with_delimiter detail.subtotal %>（税込み価格）</div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "5" %><br /></div>
<% end %>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<div style="clear:both; background-color:#F3F3EC; text-align:center;"><%= image_tag_mobile "border", :width => "226", :height => "2" %><br /></div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>

<!-- 合計 -->
小計（税込み価格）:<%= number_with_delimiter @order_delivery.subtotal %>円
<br/>
送料:<%= number_with_delimiter @order_delivery.deliv_fee %>円
<br/>
手数料:<%= number_with_delimiter @order_delivery.charge %>円
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "4" %><br /></div>
<div style="text-align:center;">【 合計 <%= number_with_delimiter @order_delivery.total %>円 】</div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "4" %><br /></div>

<!-- ポイント -->
<% if @login_customer %>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<div style="clear:both; background-color:#F3F3EC; text-align:center;"><%= image_tag_mobile "border", :width => "226", :height => "2" %><br /></div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
ご注文前のポイント
<br/>
<%= number_with_delimiter(@login_customer.point.to_i) %>Pt
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
ご使用ポイント
<br/>
-<%= number_with_delimiter(@order_delivery.use_point.to_i) %>Pt
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
今回加算されるポイント
<br/>
+<%= number_with_delimiter(@cart_point.to_i) %>Pt
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
ご注文完了後のポイント
<br/>
<%= number_with_delimiter(@point_after_operation.to_i) %>Pt
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>

<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "4" %><br /></div>
<div style="text-align:center;">【 支払金額  <%= number_with_delimiter @order_delivery.payment_total %>円 】</div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "4" %><br /></div>
<% end %>

<!-- お客様情報 -->
<% if @not_login_customer %>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<div style="clear:both; background-color:#F3F3EC; text-align:center;"><%= image_tag_mobile "border", :width => "226", :height => "2" %><br /></div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<span style="color:#FF9775;">■</span> お客様情報<br />
お名前
<br/>
<%=h @order_delivery.family_name %>&nbsp;<%=h @order_delivery.first_name %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
お名前（フリガナ）
<br/>
<%=h @order_delivery.family_name_kana %>&nbsp;<%=h @order_delivery.first_name_kana %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
郵便番号
<br/>
〒<%=h @order_delivery.deliv_zipcode01 %>-<%=h @order_delivery.deliv_zipcode02 %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
住所
<br/>
<%=h @order_delivery.prefecture.name %><%=h @order_delivery.address_city %><%=h @order_delivery.address_detail %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
電話番号
<br/>
<%=h @order_delivery.tel01 %>-<%=h @order_delivery.tel02 %>-<%=h @order_delivery.tel03 %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
ファックス番号
<br/>
<%=h @order_delivery.fax01 %>-<%=h @order_delivery.fax02 %>-<%=h @order_delivery.fax03 %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
メールアドレス
<br/>
<%=h @order_delivery.email %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
性別
<br/>
<%=h @order_delivery.sex_name %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
生年月日
<br/>
<%=h @order_delivery.birthday %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
職業
<br/>
<%=h @order_delivery.occupation && @order_delivery.occupation.name %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<% end %>

<!-- お届け先 -->
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<div style="clear:both; background-color:#F3F3EC; text-align:center;"><%= image_tag_mobile "border", :width => "226", :height => "2" %><br /></div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<span style="color:#FF9775;">■</span> お届け先<br />
〒<%=h @order_delivery.deliv_zipcode01 %>-<%=h @order_delivery.deliv_zipcode02 %>
<br/>
<%=h @order_delivery.deliv_pref.name %><%=h @order_delivery.deliv_address_city %><%=h @order_delivery.deliv_address_detail %>
<br/>
<%=h @order_delivery.deliv_family_name %>&nbsp;<%=h @order_delivery.deliv_first_name %>
<br/>
Tel. <%=h @order_delivery.deliv_tel01 %>-<%=h @order_delivery.deliv_tel02 %>-<%=h @order_delivery.deliv_tel03 %>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "4" %><br /></div>

<!-- お支払方法・お届け時間 -->
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>
<div style="clear:both; background-color:#F3F3EC; text-align:center;"><%= image_tag_mobile "border", :width => "226", :height => "2" %><br /></div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "2" %><br /></div>

<span style="color:#FF9775;">■</span> お支払方法・お届け時間<br />
<%=h @order_delivery.payment.name %>
<br/>
<%=h @order_delivery.delivery_time_name %>
<br/>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "4" %><br /></div>
<div style="clear:both; background-color:#F3F3EC; text-align:center;"><%= image_tag_mobile "border", :width => "226", :height => "2" %><br /></div>
<div style="background-color:#F3F3EC;"><%= image_tag_mobile "spacer", :width => "1", :height => "4" %><br /></div>

<% form_tag :action => @next do %>
<div style="text-align:center;">
    <%= render :partial=>'order_delivery_hiddens' %>
    <%=hidden_field :order_delivery,:use_point %>
    <%=hidden_field :order_delivery,:payment_id%>
    <%=hidden_field :order_delivery,:delivery_time_id%>
    <%= hidden_field_tag "point_after_operation", @point_after_operation %>
    <%= submit_tag '注文' %>
</div>
<% end %>
<% form_tag :action => 'purchase2' do %>
<div style="text-align:center;">
    <%= render :partial=>'order_delivery_hiddens' %>
    <%=hidden_field :order_delivery,:use_point %>
    <%=hidden_field :order_delivery,:payment_id%>
    <%=hidden_field :order_delivery,:delivery_time_id%>	
	<% if @login_customer && @order_delivery.use_point && @order_delivery.use_point > 0%>
	<%=hidden_field_tag "point_check","true"%>
	<% end %>
    <%=hidden_field_tag "back","1" %>
    <%= submit_tag '戻る' %>
    <br/>
</div>
<% end %>

<% end %>
