<commit_before>- item ||= f.object
%tr.nested-fields
  %td
    .selector
      = f.input_field(:product_id, 'data-selector' => url_for(:controller => :products, :action => :unroll), 'data-selector-new-item' => url_for(:action => :new, :controller => :products))
    - if item.errors.count > 0
      = item.errors.messages.inspect
  %td.decimal= f.input_field(:quantity, :size => 7, :class => "item-pta item-wta")
  %td
    = f.input_field(:price_amount, :class => "item-pta item-wta")
  %td.decimal
    = f.select(:tax_id, Tax.to_a.collect{|t| [t.name, t.id, {'data-rate' => (100.0 + t.amount).to_f/100.0}]}, {}, 'data-value' => 'rate', :class => "item-wta")
  %td.decimal.pta{'data-use' => ".item-pta", 'data-use-closest' => 'tr', 'data-calculate' => 'mul'}=item.pretax_amount
  %td.decimal.wta{'data-use' => ".item-wta", 'data-use-closest' => 'tr', 'data-calculate' => 'mul'}=item.amount
  %td.currency= @sale.currency
  %td.action
    = link_to_remove_association(content_tag(:i) + h(:destroy.tl), f, 'data-no-turbolink' => true, :class => 'remove-item')<commit_msg>fix bug linked on Models and on tax data-rate (to_f ) when adding a sale_items<commit_after>- item ||= f.object
%tr.nested-fields
  %td
    .selector
      = f.input_field(:variant_id, 'data-selector' => url_for(:controller => :product_nature_variants, :action => :unroll), 'data-selector-new-item' => url_for(:action => :new, :controller => :product_nature_variants))
    - if item.errors.count > 0
      = item.errors.messages.inspect
  %td.decimal= f.input_field(:quantity, :size => 7, :class => "item-pta item-wta")
  %td
    = f.input_field(:unit_price_amount, :class => "item-pta item-wta")
  %td.decimal
    = f.select(:tax_id, Tax.all.collect{|t| [t.name, t.id, {'data-rate' => ((100 + t.amount)/100)}]}, {}, 'data-value' => 'rate', :class => "item-wta")
  %td.decimal.pta{'data-use' => ".item-pta", 'data-use-closest' => 'tr', 'data-calculate' => 'mul'}=item.pretax_amount
  %td.decimal.wta{'data-use' => ".item-wta", 'data-use-closest' => 'tr', 'data-calculate' => 'mul'}=item.amount
  %td.currency= @sale.currency
  %td.action
    = link_to_remove_association(content_tag(:i) + h(:destroy.tl), f, 'data-no-turbolink' => true, :class => 'remove-item')
{'fraction_non_alphanumeric': 0.22242152466367712, 'fraction_numerical': 0.008071748878923767, 'mean_word_length': 4.224824355971897, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7141717', 'n_tokens_mistral': 886, 'n_tokens_neox': 854, 'n_words': 146}