<commit_before>= page_header t('.heading')

= form_for [:admin, @order] do |f|

  table.table.table-bordered
    tr
      th.qty Qty
      th Product name
      th Weight (each)
      th.price Price (each)
      th Tax (%)
      th Total

    - @order.order_lines.each do |line|
      tr
        td
          input name="order_line_quantity[#{line.id}]" value="#{line.quantity}"
        td
          input name="order_line_product_name[#{line.id}]" value="#{line.product_name}"
        td
          input name="order_line_product_weight[#{line.id}]" value="#{line.product_weight}"
        td
          input name="order_line_product_price[#{line.id}]" value="#{line.product_price}"
        td
          input name="order_line_tax_percentage[#{line.id}]" value="#{line.tax_percentage}"
        td
          = line.line_total_net
    tr
      td colspan="4"
      th VAT
      td.price.total= formatted_price(@order.tax_total)
    tr
      td colspan="4"
      th Total
      td.price.total= formatted_price(@order.total)

  .form-group
    = admin_submit_button(f)<commit_msg>Start of UI to add new order lines<commit_after>= page_header t('.heading')

= form_for [:admin, @order] do |f|

  table.table.table-bordered
    tr
      th.qty Qty
      th Product name
      th Weight (each)
      th.price Price (each)
      th Tax (%)
      th Total

    - @order.order_lines.each do |line|
      tr
        td
          input name="order_line_quantity[#{line.id}]" value="#{line.quantity}"
        td
          input name="order_line_product_name[#{line.id}]" value="#{line.product_name}"
        td
          input name="order_line_product_weight[#{line.id}]" value="#{line.product_weight}"
        td
          input name="order_line_product_price[#{line.id}]" value="#{line.product_price}"
        td
          input name="order_line_tax_percentage[#{line.id}]" value="#{line.tax_percentage}"
        td
          = line.line_total_net
    tbody.additional-lines
    tr
      td colspan="4"
        button#add-line Add Line
      th VAT
      td.price.total= formatted_price(@order.tax_total)
    tr
      td colspan="4"
      th Total
      td.price.total= formatted_price(@order.total)

  .form-group
    = admin_submit_button(f)

javascript:
  $(function() {
    var id = -1;
    $('#add-line').click(function() {
      html = '<tr>' +
        '<td><input name="order_line_quantity[' + id + ']" value="1"></td>' +
        '<td><input name="order_line_product_name[' + id + ']"></td>' +
        '<td><input name="order_line_product_weight[' + id + ']" value="0.0"></td>' +
        '<td><input name="order_line_product_price[' + id + ']" value="0.0"></td>' +
        '<td><input name="order_line_tax_percentage[' + id + ']" value="0.0"></td>' +
        '<td></td>' +
        '</tr>';
      $('.additional-lines').append(html);
      id -= 1;
      return false;
    });
  });

{'fraction_non_alphanumeric': 0.15988877302745916, 'fraction_numerical': 0.0045185957594716716, 'mean_word_length': 2.463297232250301, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, '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': '2475923', 'n_tokens_mistral': 970, 'n_tokens_neox': 955, 'n_words': 179}