<% unless product.blank? %>
| <%= product_tag(product, :size => 32, :type => 'image') %> |
<% end %>
<%= product_tag(product, :type => 'plain') unless product.blank? %>
<%= f.hidden_field :product_id %>
<% if !product.blank? && f.object.description.blank? %>
<%= link_to_function "(#{l(:label_products_add_description)})", "$(this).hide(); $(this).parent().next().show(); return false;" %>
<% end %>
<%= f.text_area :description, :no_label => true, :rows => f.object.description.blank? ? 2 : [f.object.description.lines.count, 2].max, :onkeyup => "activateTextAreaResize(this);", :style => "width:99%; #{(product.blank? || !f.object.description.blank?) ? "" : "display:none;"}" -%>
|
<% f.object.custom_field_values.each do |cf| %>
<%= custom_field_tag("order[lines_attributes][#{f.index}]", cf) %> |
<% end %>
<%= f.text_field :quantity, :no_label => true, :size => 6, :onkeyup => 'updateTotal(this)' %> |
<%= f.text_field :price, :no_label => true, :size => 8, :onkeyup => 'updateTotal(this)' %> |
<% if !ContactsSetting.disable_taxes? || (f.object.container.respond_to?(:has_taxes?) && f.object.container.has_taxes?) %>
<% line_tax = (f.object.new_record? && f.object.tax.blank?) ? ContactsSetting.default_tax : f.object.tax %>
<%= check_box_tag :show_tax, "1", false, :onclick=>"$(this).hide(); $(this).parent().find('.tax-fields').show(); $(this).next().find('input').focus(); return false;" if line_tax.blank? || line_tax == 0 %>
"><%= f.text_field :tax, :no_label => true, :size => 5, :value => line_tax %> %
|
<% end %>
<%= check_box_tag :show_discount, "1", false, :onclick=>"$(this).hide(); $(this).parent().find('.discount-fields').show(); $(this).next().find('input').focus(); return false;" if f.object.discount.to_i == 0 %>
">
<%= f.text_field :discount, :no_label => true, :size => 5, :style => f.object.discount.to_i == 0 ? "display:none;" : "", :onkeyup => 'updateTotal(this)', :class => "discount-fields" %> %
|
<%= format("%.2f\n", f.object.total) if f.object.price && f.object.quantity %> |
<%= deals_link_to_remove_fields "", f, :class => "icon icon-del" %>
|
<%= f.hidden_field :position, :class => 'position' %>