<% sa = @order.shipping_address shipping_address = sa.address1 shipping_address << "
#{sa.address2}" if sa.address2 && sa.address2.length > 0 shipping_address << "
#{sa.city}, #{sa.state} #{sa.zip}" captured = @order.financial_status == 'captured' %>

Edit Order #<%= @order.id %>

<%= if @order.customer.nil? then 'Guest' else 'Customer' end %> Shipping Address Order Status Payment Status Transaction ID
<%= "#{@order.shipping_address.first_name} #{@order.shipping_address.last_name}" %>
<% if @order.customer %> "><%= "#{@order.customer.email}" %>
<% elsif @order.email %> <%= @order.email %> <% end %> <%= @order.customer ? @order.customer.phone : @order.shipping_address.phone %>
<%= "#{@order.shipping_address.name}" %>
<%= raw shipping_address %>
<%= @order.financial_status %> <% if @order.financial_status == 'authorized' %> for <%= number_to_currency(@order.auth_amount) %> <% end %> <%= @order.transaction_id %>

<% @order.line_items.each do |li| %> <% end %>
Item Status Tracking Number Unit Price Quantity Subtotal
<% if li.variant.nil? || li.variant.product.nil? %> <%= li.variant_sku %> <% else %> <%= li.variant.product.title %>
<%= li.variant.sku %>
<%= li.variant.title %> <% end %>
<%= number_to_currency(li.variant.price) %> <% if captured %><%= li.quantity %><% else %>
<% end %>
<%= number_to_currency(li.price) %>
Subtotal <%= number_to_currency(@order.subtotal ) %>
Tax <%= number_to_currency(@order.tax ) %>
<%= @order.shipping_method ? @order.shipping_method : '' %> Shipping & Handling <%= number_to_currency(@order.shipping + @order.handling) %>
Discount <% if captured && @order.discounts.any? %> <%= number_to_currency(@order.amount_discounted || 0) %> <% elsif @order.discounts.any? %> <%= number_to_currency(@order.discounts.first.amount_current) %> <% else %> $0.00 <% end %>
Total <%= number_to_currency(@order.total ) %>

<% if @order.financial_status == 'authorized' %> <% end %> <% if @order.financial_status == 'captured' %> <% end %>

<% content_for :caboose_js do %> <%= javascript_include_tag 'caboose/model/all' %> <% end %>