<commit_before>- content_for :links do
  %ul.breadcrumps
    %li #{ link_to "Items", items_path }
    %li
      %span #{@item}

  .links
    = link_to "Nuevo", new_item_path, :class => 'add'
    = link_to "Editar", edit_item_path(@item) , :class => 'edit'
    = link_to "Borrar", @item , :class => 'delete', :confirm => "Esta seguro de borra el ítem", :method => :delete
%h1= @item

.show
  .input
    %label Precio de venta
    .b= ntc @item.price
  .input._25
    %label Unidad
    = @item.unit
  .input._25
    %label Activo
    %span.icon{:class => @item.active.to_s}
  .clear
  .input
    %label Tipo
    = @item.get_type
  /.input#item_discount
  /%label Descuento
  /%span= @item.discount
  .input
    %label Descripción
    = @item.description
  .clear

%h3 Inventario
- @item.stocks.includes(:store).each do |st|
  .moneybox.fl
    %label= st.store
    %h3= st.quantity

.clear

%h3 Kardex de movimientos del ítem

%table.decorated
  %tr
    %th Almacen
    %th Movimiento
    %th Cantidad

  - @item.inventory_operation_details.each do |det|
    %tr
      %td= Store.get_names_hash[det.store_id]
      - op = det.operation == "in" ? "Ingreso" : "Egreso"
      - css = det.operation == "in" ? "dark-green" : "red"
      %td.b{:class => css}= op
      %td.r= ntc det.quantity

/= javascript_include_tag 'app/item'
:javascript
  $(function() {
    if( $('#item_discount').length > 0 ) {
      /*
      $('#item_discount span').hide();
      var val = $('#item_discount span').html();
      var item_discount = new DiscountRangeShow('item_discount');
      item_discount.tableForField(val);
      */
    }
  });<commit_msg>Item list kardex ajax [completed:55]<commit_after>- content_for :links do
  %ul.breadcrumps
    %li #{ link_to "Items", items_path }
    %li
      %span #{@item}

  .links
    = link_to "Nuevo", new_item_path, :class => 'add'
    = link_to "Editar", edit_item_path(@item) , :class => 'edit'
    = link_to "Borrar", @item , :class => 'delete', :confirm => "Esta seguro de borra el ítem", :method => :delete
%h1= @item

.show
  .input
    %label Precio de venta
    .b= ntc @item.price
  .input._25
    %label Unidad
    = @item.unit
  .input._25
    %label Activo
    %span.icon{:class => @item.active.to_s}
  .clear
  .input
    %label Tipo
    = @item.get_type
  /.input#item_discount
  /%label Descuento
  /%span= @item.discount
  .input
    %label Descripción
    = @item.description
  .clear

%h3 Inventario
- @item.stocks.includes(:store).each do |st|
  .moneybox.fl
    %label= st.store
    %h3= st.quantity

.clear
- unless request.xhr?
  %h3 Kardex de movimientos del ítem
  
  - @details = @item.inventory_operation_details.page(@page)

  = paginate @details

  %table.decorated
    %tr
      %th Almacen
      %th Movimiento
      %th Cantidad

    - @details.each do |det|
      %tr
        %td= Store.get_names_hash[det.store_id]
        - op = det.operation == "in" ? "Ingreso" : "Egreso"
        - css = det.operation == "in" ? "dark-green" : "red"
        %td.b{:class => css}= op
        %td.r= ntc det.quantity

/= javascript_include_tag 'app/item'
:javascript
  $(function() {
    if( $('#item_discount').length > 0 ) {
      /*
      $('#item_discount span').hide();
      var val = $('#item_discount span').html();
      var item_discount = new DiscountRangeShow('item_discount');
      item_discount.tableForField(val);
      */
    }
  });
{'fraction_non_alphanumeric': 0.15634218289085547, 'fraction_numerical': 0.0058997050147492625, 'mean_word_length': 2.6462365591397847, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '945574', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1273, 'n_words': 284}