spf_barcode 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/generador_orden.rb +47 -0
- data/lib/spf_barcode.rb +14 -0
- data/lib/spf_barcode/version.rb +1 -1
- data/lib/to_barcode_alfanumerico.rb +13 -0
- data/lib/to_barcode_numerico.rb +14 -0
- metadata +6 -17
    
        checksums.yaml
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            !binary "U0hBMQ==":
         | 
| 3 3 | 
             
              metadata.gz: !binary |-
         | 
| 4 | 
            -
                 | 
| 4 | 
            +
                Yzc1N2Y0MWVhYmE3MmQwNjE1NzNmNDcxMzhiYzhhMTlhNjgxMGU5MA==
         | 
| 5 5 | 
             
              data.tar.gz: !binary |-
         | 
| 6 | 
            -
                 | 
| 6 | 
            +
                NDBiNTk2M2I2OTBmM2QyZmU3MGFhNzFhNDY3NDFhZGIxMDY3ZDcxNQ==
         | 
| 7 7 | 
             
            SHA512:
         | 
| 8 8 | 
             
              metadata.gz: !binary |-
         | 
| 9 | 
            -
                 | 
| 10 | 
            -
                 | 
| 11 | 
            -
                 | 
| 9 | 
            +
                ZjU0ZWI4NDcyYzIyMGY4ZjUyZGQ3NWYzMWMxNTZlOTYwYjgyMzcxMTNhZmEz
         | 
| 10 | 
            +
                NjUzOTRjYmQ5NDc2NDNkODVjNjZlOTNmYmZhMTY4ZmZlOTkyYzkxMmU2NGYx
         | 
| 11 | 
            +
                MjY5MGE2YTJjNDdkMzY0ZmUzN2Q2MDkwMzIzNjViMzg2ODA3MGU=
         | 
| 12 12 | 
             
              data.tar.gz: !binary |-
         | 
| 13 | 
            -
                 | 
| 14 | 
            -
                 | 
| 15 | 
            -
                 | 
| 13 | 
            +
                NGVlMWQwMWQ2YmVjOTdiOTVlMTFkZWI5OTQ4YjRiOGM3YTBhZGIwNjM1MTJi
         | 
| 14 | 
            +
                ZmI2MWY3YmE2M2E1M2QyZjA1MGQ2NWViYWU4MDQ3MGNhM2NkNmMyMjg0ODZl
         | 
| 15 | 
            +
                NjA0N2ExMWU4ZWU4NDlkYjVhOWViZGM4YWIzYTM3YjAyNzg3NWY=
         | 
| @@ -0,0 +1,47 @@ | |
| 1 | 
            +
            # encoding: utf-8
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            # ESTA CLASE GENERA UN NUMERO PARA ARMAR PAREJAS DE LAMINADOS
         | 
| 4 | 
            +
            # PARA QUE SEA MAS FACIL LA IDENTIFICACION DE LOS MISMOS
         | 
| 5 | 
            +
            # EN LUGAR DE FIJARSE EN UNA MEDIDA 1234*876
         | 
| 6 | 
            +
            # SE VA A GENERAR UN NUMERO DEL 1 A N 
         | 
| 7 | 
            +
            # Y TMB 23-2 SIGNIFICA QUE LA MEDIDA 23 TIENE DOS VIDRIOS O LAMINADOS
         | 
| 8 | 
            +
             | 
| 9 | 
            +
             | 
| 10 | 
            +
            class GeneradorOrden
         | 
| 11 | 
            +
              def initialize(traz_lam)
         | 
| 12 | 
            +
                @componente = traz_lam.componente
         | 
| 13 | 
            +
                @linea_item = traz_lam.linea_item
         | 
| 14 | 
            +
                @pedido = @linea_item.item.pedido
         | 
| 15 | 
            +
                @composicion = traz_lam.composicion
         | 
| 16 | 
            +
              end
         | 
| 17 | 
            +
             | 
| 18 | 
            +
              def get
         | 
| 19 | 
            +
                contador_medida = 1
         | 
| 20 | 
            +
                # asigna el primer número
         | 
| 21 | 
            +
                @pedido.items.order(:id).map(&:item_medidas).flatten.each do |im|
         | 
| 22 | 
            +
                  break if im == @linea_item
         | 
| 23 | 
            +
                  contador_medida += 1
         | 
| 24 | 
            +
                end
         | 
| 25 | 
            +
             | 
| 26 | 
            +
             | 
| 27 | 
            +
                return contador_medida.to_s unless @composicion.es_dvh?
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                array = []
         | 
| 30 | 
            +
                @composicion.get_vidrios.each do |componente|
         | 
| 31 | 
            +
                  laminado_elementos = componente.elementos.sort{ |a,b| a.orden <=> b.orden }.map(&:elemento_de_componente).flatten
         | 
| 32 | 
            +
                  array << {componente: componente, elementos: laminado_elementos}
         | 
| 33 | 
            +
                end
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                return contador_medida.to_s if array.map{|a| a[:elementos]}.uniq.length == 1
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                contador_componente = 1
         | 
| 38 | 
            +
                array.map{ |a| a[:componente] }.each do |comp|
         | 
| 39 | 
            +
                  break if comp == @componente
         | 
| 40 | 
            +
                  contador_componente += 1
         | 
| 41 | 
            +
                end
         | 
| 42 | 
            +
             | 
| 43 | 
            +
             | 
| 44 | 
            +
                "#{contador_medida}/#{contador_componente.to_s36}"
         | 
| 45 | 
            +
             | 
| 46 | 
            +
              end
         | 
| 47 | 
            +
            end
         | 
    
        data/lib/spf_barcode.rb
    CHANGED
    
    | @@ -1,4 +1,9 @@ | |
| 1 1 | 
             
            # encoding: utf-8
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            require 'to_barcode_alfanumerico'
         | 
| 4 | 
            +
            require 'to_barcode_numerico'
         | 
| 5 | 
            +
            require 'generador_orden'
         | 
| 6 | 
            +
             | 
| 2 7 | 
             
            class BarcodeOptimaDecode
         | 
| 3 8 | 
             
              def initialize(barcode)
         | 
| 4 9 | 
             
                @barcode = barcode
         | 
| @@ -57,6 +62,15 @@ class BarcodeOptimaDecode | |
| 57 62 | 
             
                  when '5' then @accion = 'SELECCIONAR'
         | 
| 58 63 | 
             
                  when '8' then @accion = 'REDIRECCION'
         | 
| 59 64 | 
             
                  end
         | 
| 65 | 
            +
                elsif @barcode.length.between?(9,11)
         | 
| 66 | 
            +
             | 
| 67 | 
            +
                  @barcode_alfanumerico = @barcode
         | 
| 68 | 
            +
                  @barcode = @barcode.to_i36.to_s
         | 
| 69 | 
            +
             | 
| 70 | 
            +
                  decode_pedido
         | 
| 71 | 
            +
                  decode_item
         | 
| 72 | 
            +
                  decode_item_medida
         | 
| 73 | 
            +
                  decode_objeto
         | 
| 60 74 | 
             
                else
         | 
| 61 75 |  | 
| 62 76 | 
             
                  decode_pedido
         | 
    
        data/lib/spf_barcode/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,29 +1,15 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: spf_barcode
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.14
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Carlos Ramseyer
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 12 | 
            -
            dependencies:
         | 
| 13 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 14 | 
            -
              name: rails
         | 
| 15 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 | 
            -
                requirements:
         | 
| 17 | 
            -
                - - ! '>='
         | 
| 18 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: 4.0.2
         | 
| 20 | 
            -
              type: :runtime
         | 
| 21 | 
            -
              prerelease: false
         | 
| 22 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 | 
            -
                requirements:
         | 
| 24 | 
            -
                - - ! '>='
         | 
| 25 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version: 4.0.2
         | 
| 11 | 
            +
            date: 2017-04-03 00:00:00.000000000 Z
         | 
| 12 | 
            +
            dependencies: []
         | 
| 27 13 | 
             
            description: Lector de codigo de barra
         | 
| 28 14 | 
             
            email:
         | 
| 29 15 | 
             
            - cmramseyer@gmail.com
         | 
| @@ -34,9 +20,12 @@ files: | |
| 34 20 | 
             
            - MIT-LICENSE
         | 
| 35 21 | 
             
            - README.rdoc
         | 
| 36 22 | 
             
            - Rakefile
         | 
| 23 | 
            +
            - lib/generador_orden.rb
         | 
| 37 24 | 
             
            - lib/spf_barcode.rb
         | 
| 38 25 | 
             
            - lib/spf_barcode/version.rb
         | 
| 39 26 | 
             
            - lib/tasks/spf_barcode_tasks.rake
         | 
| 27 | 
            +
            - lib/to_barcode_alfanumerico.rb
         | 
| 28 | 
            +
            - lib/to_barcode_numerico.rb
         | 
| 40 29 | 
             
            - test/dummy/README.rdoc
         | 
| 41 30 | 
             
            - test/dummy/Rakefile
         | 
| 42 31 | 
             
            - test/dummy/app/assets/javascripts/application.js
         |