Advertisement
sySmago

new-order-view

May 24th, 2022
762
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <% if @order.errors.any? %>
  2.     <ul>
  3.         <% @order.errors.full_messages.each do |msg| %>
  4.         <li><%= msg %></li>
  5.         <% end %>
  6.     </ul>
  7. <% end %>
  8.  
  9. <h1>Gerar Ordem de Serviço<h2>
  10. <hr style="height:2px;border-width:0;color:gray;background-color:gray">
  11. <h2>Produto:<%= @product.code %></h2>
  12. <p><strong> Peso: </strong><%= @product.weight %>g</p>
  13. <p><strong> Altura: </strong><%= @product.height %>cm</p>
  14. <p><strong> Largura: </strong><%= @product.width %>cm</p>
  15. <p><strong> Profundidade: </strong><%= @product.depth %>cm</p>
  16. <p><strong> Endereço de Entrega: </strong><%= @product.customer_address %></p>
  17. <p><strong> Distância: </strong><%= @product.distance %>km</p>
  18. <hr style="height:2px;border-width:0;color:gray;background-color:gray">
  19. <h2>Preços</h2>
  20.  
  21. <% if !(@available_shipping_companyes).nil? %>
  22.     <%= form_with model: [:admin, @product, @order] do |o| %>
  23.         <% @available_shipping_companyes.each do |asp| %>
  24.             <div>
  25.                 <%= o.radio_button :shipping_price, Order.price_calculator(@product, asp), id: "#{asp.id}", :checked => true %>
  26.                 <%= label_tag(:shipping_price, "Transportadora: #{asp.brand_name} | Preço: R$#{Order.price_calculator(@product, asp)} | Prazo de Entrega: #{Order.deadline_calculator(@product, asp)} dias úteis") %>
  27.             </div>
  28.         <% end %>
  29.         <div>
  30.             <%= o.submit 'Gerar Ordem de Serviço' %>
  31.         </div>
  32.     <% end %>
  33. <% else %>
  34.     <p>Não há Transportadoras disponíveis.</p>
  35. <% end %>
Advertisement
RAW Paste Data Copied
Advertisement