From 7f4a4861c13c2ce479488f2d3d97fc8ae1b5a925 Mon Sep 17 00:00:00 2001 From: Alex Bono Date: Tue, 5 Jun 2018 15:06:55 -0600 Subject: [PATCH 001/112] agregado travis en el gemfile --- Gemfile | 1 + Gemfile.lock | 41 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index bf3c8ad..82b0b34 100755 --- a/Gemfile +++ b/Gemfile @@ -14,6 +14,7 @@ gem 'puma', '~> 3.7' gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' +gem 'travis' # See https://github.com/rails/execjs#readme for more supported runtimes # gem 'therubyracer', platforms: :ruby diff --git a/Gemfile.lock b/Gemfile.lock index cda6a14..fe215f1 100755 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -41,6 +41,7 @@ GEM addressable (2.5.1) public_suffix (~> 2.0, >= 2.0.2) arel (8.0.0) + backports (3.11.3) bcrypt (3.1.11) bindex (0.5.0) builder (3.2.3) @@ -68,6 +69,7 @@ GEM execjs coffee-script-source (1.12.2) concurrent-ruby (1.0.5) + connection_pool (2.2.2) devise (4.3.0) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -75,15 +77,29 @@ GEM responders warden (~> 1.2.3) erubi (1.6.1) + ethon (0.11.0) + ffi (>= 1.3.0) execjs (2.7.0) + faraday (0.15.2) + multipart-post (>= 1.2, < 3) + faraday_middleware (0.12.2) + faraday (>= 0.7.4, < 1.0) ffi (1.9.18) font-awesome-rails (4.7.0.2) railties (>= 3.2, < 5.2) + gh (0.14.0) + addressable + backports + faraday (~> 0.8) + multi_json (~> 1.0) + net-http-persistent (>= 2.7) + net-http-pipeline globalid (0.4.0) activesupport (>= 4.2.0) haml (5.0.2) temple (>= 0.8.0) tilt + highline (1.7.10) i18n (0.8.6) jbuilder (2.7.0) activesupport (>= 4.2.0) @@ -94,6 +110,7 @@ GEM thor (>= 0.14, < 2.0) jquery-ui-rails (5.0.5) railties (>= 3.2.16) + json (2.1.0) kaminari (1.0.1) activesupport (>= 4.1.0) kaminari-actionview (= 1.0.1) @@ -107,6 +124,8 @@ GEM kaminari-core (= 1.0.1) kaminari-core (1.0.1) kgio (2.11.0) + launchy (2.4.3) + addressable (~> 2.3) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) @@ -126,7 +145,11 @@ GEM mini_portile2 (2.2.0) minitest (5.10.3) multi_json (1.12.1) + multipart-post (2.0.0) nested_form (0.3.2) + net-http-persistent (3.0.0) + connection_pool (~> 2.2) + net-http-pipeline (1.0.1) nio4r (2.1.0) nokogiri (1.8.0) mini_portile2 (~> 2.2.0) @@ -140,6 +163,9 @@ GEM pg (0.21.0) public_suffix (2.0.5) puma (3.10.0) + pusher-client (0.6.2) + json + websocket (~> 1.0) rack (2.0.3) rack-pjax (1.0.0) nokogiri (~> 1.5) @@ -226,9 +252,20 @@ GEM thor (0.20.0) thread_safe (0.3.6) tilt (2.0.8) + travis (1.8.8) + backports + faraday (~> 0.9) + faraday_middleware (~> 0.9, >= 0.9.1) + gh (~> 0.13) + highline (~> 1.6) + launchy (~> 2.1) + pusher-client (~> 0.4) + typhoeus (~> 0.6, >= 0.6.8) turbolinks (5.0.1) turbolinks-source (~> 5) turbolinks-source (5.0.3) + typhoeus (0.8.0) + ethon (>= 0.8.0) tzinfo (1.2.3) thread_safe (~> 0.1) uglifier (3.2.0) @@ -243,6 +280,7 @@ GEM activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) + websocket (1.2.8) websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) @@ -276,6 +314,7 @@ DEPENDENCIES spring spring-watcher-listen (~> 2.0.0) sqlite3 + travis turbolinks (~> 5) tzinfo-data uglifier (>= 1.3.0) @@ -285,4 +324,4 @@ DEPENDENCIES wkhtmltopdf-binary BUNDLED WITH - 1.16.0 + 1.16.2 From 42ab50690d66e3650d41e51237bfde74f755b96b Mon Sep 17 00:00:00 2001 From: Esther Date: Tue, 5 Jun 2018 15:06:56 -0600 Subject: [PATCH 002/112] Changes en el model y view de Batch --- app/controllers/batches_controller.rb | 9 ++++++--- app/models/certificate_type.rb | 2 ++ app/views/batches/new.html.erb | 17 ++++++++++++----- ...0531204809_add_certificatetype_to_batches.rb | 5 +++++ ...1204810_add_postharvest_center_to_batches.rb | 5 +++++ ...1204811_add_entry_sheet_number_to_batches.rb | 5 +++++ ...0531204812_add_organization_id_to_batches.rb | 5 +++++ ...20180531204813_add_received_by_to_batches.rb | 5 +++++ ...0180531204814_add_delivered_by_to_batches.rb | 5 +++++ .../20180531204815_create_certificate_types.rb | 9 +++++++++ db/schema.rb | 14 +++++++++++++- db/seeds.rb | 12 ++++++++++++ mig.sh | 8 ++++++++ test/fixtures/certificate_types.yml | 7 +++++++ test/models/certificate_type_test.rb | 7 +++++++ 15 files changed, 106 insertions(+), 9 deletions(-) create mode 100644 app/models/certificate_type.rb create mode 100644 db/migrate/20180531204809_add_certificatetype_to_batches.rb create mode 100644 db/migrate/20180531204810_add_postharvest_center_to_batches.rb create mode 100644 db/migrate/20180531204811_add_entry_sheet_number_to_batches.rb create mode 100644 db/migrate/20180531204812_add_organization_id_to_batches.rb create mode 100644 db/migrate/20180531204813_add_received_by_to_batches.rb create mode 100644 db/migrate/20180531204814_add_delivered_by_to_batches.rb create mode 100644 db/migrate/20180531204815_create_certificate_types.rb create mode 100755 mig.sh create mode 100644 test/fixtures/certificate_types.yml create mode 100644 test/models/certificate_type_test.rb diff --git a/app/controllers/batches_controller.rb b/app/controllers/batches_controller.rb index 6ff2b25..116aa3d 100644 --- a/app/controllers/batches_controller.rb +++ b/app/controllers/batches_controller.rb @@ -2,15 +2,18 @@ class BatchesController < ApplicationController before_action :authenticate_user! def new @cocoa = CocoaType.all + @certificate = CertificateType.all @genetic = GeneticMaterial.all @entryControl = EntryControl.find(params[:entry_control_id]) - @batch=@entryControl.batches.build + @batch=@entryControl.batches.build end def create entryControl = EntryControl.find(params[:entry_control_id]) batch=entryControl.batches.build(batches_params) - + + batch.enterCode = entryControl.organization.code+batch.postharvestCenter+"-"+entryControl.entryDate.strftime('%d%m%y')+"-EAHT" + if batch.save createNotification redirect_to entryControl @@ -52,7 +55,7 @@ def show private def batches_params - params.require(:batch).permit(:sackAmount, :weight, :enterCode, :cocoaType, :geneticMaterial, :ft) + params.require(:batch).permit(:sackAmount, :weight, :enterCode, :certificatetype, :postharvestCenter, :cocoaType, :geneticMaterial, :ft) end def createNotification diff --git a/app/models/certificate_type.rb b/app/models/certificate_type.rb new file mode 100644 index 0000000..8709de3 --- /dev/null +++ b/app/models/certificate_type.rb @@ -0,0 +1,2 @@ +class CertificateType < ApplicationRecord +end diff --git a/app/views/batches/new.html.erb b/app/views/batches/new.html.erb index 62e3861..ed786fc 100644 --- a/app/views/batches/new.html.erb +++ b/app/views/batches/new.html.erb @@ -16,19 +16,26 @@ <%= f.label :weight, "Peso en libras" %> <%= f.number_field :weight, step: :any, min: 0 , :required => true %> + +
- <%= f.label :enterCode, "Código de indentificación" %> - <%= f.text_field :enterCode , :required => true %> + <%= f.label :postharvestCenter, "Centro de poscosecha" %> + <%= f.text_field :postharvestCenter , :required => true %>

- <%= f.label :cocoaType, "Tipo de cacao" %> + <%= f.label :cocoaType, "Calidad" %> <%= f.collection_select :cocoaType, @cocoa, :id, :name, class:"dropdown-button btn" %>

- <%= f.label :geneticMaterial, "Material genético" %> + <%= f.label :certificatetype, "Certificado" %> + <%= f.collection_select :certificatetype, @certificate, :id, :name, class:"dropdown-button btn" %> +

+ +

+ <%= f.label :geneticMaterial, "Variedad" %> <%= f.collection_select :geneticMaterial, @genetic, :id, :name, class:"dropdown-button btn" %>

@@ -53,4 +60,4 @@ $(document).on('turbolinks:load', function () { $('select').material_select(); }) - \ No newline at end of file + diff --git a/db/migrate/20180531204809_add_certificatetype_to_batches.rb b/db/migrate/20180531204809_add_certificatetype_to_batches.rb new file mode 100644 index 0000000..23ff639 --- /dev/null +++ b/db/migrate/20180531204809_add_certificatetype_to_batches.rb @@ -0,0 +1,5 @@ +class AddCertificatetypeToBatches < ActiveRecord::Migration[5.1] + def change + add_column :batches, :certificatetype, :integer + end +end diff --git a/db/migrate/20180531204810_add_postharvest_center_to_batches.rb b/db/migrate/20180531204810_add_postharvest_center_to_batches.rb new file mode 100644 index 0000000..9cd64cb --- /dev/null +++ b/db/migrate/20180531204810_add_postharvest_center_to_batches.rb @@ -0,0 +1,5 @@ +class AddPostharvestCenterToBatches < ActiveRecord::Migration[5.1] + def change + add_column :batches, :postharvestCenter, :integer + end +end diff --git a/db/migrate/20180531204811_add_entry_sheet_number_to_batches.rb b/db/migrate/20180531204811_add_entry_sheet_number_to_batches.rb new file mode 100644 index 0000000..75f76ae --- /dev/null +++ b/db/migrate/20180531204811_add_entry_sheet_number_to_batches.rb @@ -0,0 +1,5 @@ +class AddEntrySheetNumberToBatches < ActiveRecord::Migration[5.1] + def change + add_column :batches, :entrySheetNumber, :integer + end +end diff --git a/db/migrate/20180531204812_add_organization_id_to_batches.rb b/db/migrate/20180531204812_add_organization_id_to_batches.rb new file mode 100644 index 0000000..2432ff0 --- /dev/null +++ b/db/migrate/20180531204812_add_organization_id_to_batches.rb @@ -0,0 +1,5 @@ +class AddOrganizationIdToBatches < ActiveRecord::Migration[5.1] + def change + add_column :batches, :organizationId, :integer + end +end diff --git a/db/migrate/20180531204813_add_received_by_to_batches.rb b/db/migrate/20180531204813_add_received_by_to_batches.rb new file mode 100644 index 0000000..f458719 --- /dev/null +++ b/db/migrate/20180531204813_add_received_by_to_batches.rb @@ -0,0 +1,5 @@ +class AddReceivedByToBatches < ActiveRecord::Migration[5.1] + def change + add_column :batches, :receivedBy, :string + end +end diff --git a/db/migrate/20180531204814_add_delivered_by_to_batches.rb b/db/migrate/20180531204814_add_delivered_by_to_batches.rb new file mode 100644 index 0000000..24fad9b --- /dev/null +++ b/db/migrate/20180531204814_add_delivered_by_to_batches.rb @@ -0,0 +1,5 @@ +class AddDeliveredByToBatches < ActiveRecord::Migration[5.1] + def change + add_column :batches, :deliveredBy, :string + end +end diff --git a/db/migrate/20180531204815_create_certificate_types.rb b/db/migrate/20180531204815_create_certificate_types.rb new file mode 100644 index 0000000..e7c7931 --- /dev/null +++ b/db/migrate/20180531204815_create_certificate_types.rb @@ -0,0 +1,9 @@ +class CreateCertificateTypes < ActiveRecord::Migration[5.1] + def change + create_table :certificate_types do |t| + t.string :name + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 74b4a69..d4a0e09 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171212223913) do +ActiveRecord::Schema.define(version: 20180531204815) do create_table "acceptances", force: :cascade do |t| t.decimal "max_qualityA" @@ -45,6 +45,12 @@ t.integer "export_batch_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.integer "certificatetype" + t.integer "postharvestCenter" + t.integer "entrySheetNumber" + t.integer "organizationId" + t.string "receivedBy" + t.string "deliveredBy" t.index ["entry_control_id"], name: "index_batches_on_entry_control_id" end @@ -78,6 +84,12 @@ t.index ["batch_id"], name: "index_certificate_checks_on_batch_id" end + create_table "certificate_types", force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "checkings", force: :cascade do |t| t.integer "batch_id" t.datetime "created_at", null: false diff --git a/db/seeds.rb b/db/seeds.rb index c2ab337..9c3e876 100755 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -62,6 +62,18 @@ c.name = 'C' end +CertificateType.create do |ct| + ct.name= 'E' +end + +CertificateType.create do |ct| + ct.name= 'T' +end + +CertificateType.create do |ct| + ct.name= 'C' +end + GeneticMaterial.create do |g| g.name = 'HT' end diff --git a/mig.sh b/mig.sh new file mode 100755 index 0000000..846a0ef --- /dev/null +++ b/mig.sh @@ -0,0 +1,8 @@ +rails g migration add_certificatetype_to_batches certificatetype:integer +rails g migration add_postharvestCenter_to_batches postharvestCenter:integer +rails g migration add_entrySheetNumber_to_batches entrySheetNumber:integer +rails g migration add_organizationId_to_batches organizationId:integer +rails g migration add_receivedBy_to_batches receivedBy:string +rails g migration add_deliveredBy_to_batches deliveredBy:string +rails g model certificate_types name:string +rake db:migrate diff --git a/test/fixtures/certificate_types.yml b/test/fixtures/certificate_types.yml new file mode 100644 index 0000000..56066c6 --- /dev/null +++ b/test/fixtures/certificate_types.yml @@ -0,0 +1,7 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + name: MyString + +two: + name: MyString diff --git a/test/models/certificate_type_test.rb b/test/models/certificate_type_test.rb new file mode 100644 index 0000000..f00134a --- /dev/null +++ b/test/models/certificate_type_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class CertificateTypeTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From 992862dbbe542cf271c2bcb4ee7622ce59151777 Mon Sep 17 00:00:00 2001 From: Alex Bono Date: Sun, 10 Jun 2018 13:56:36 -0600 Subject: [PATCH 003/112] Disenando el view V1 --- app/controllers/entry_controls_controller.rb | 5 ++ app/controllers/organizations_controller.rb | 2 + app/views/entry_controls/index.html.erb | 83 ++++++++++++++++++++ app/views/entry_controls/show.html.erb | 4 +- app/views/layouts/application.html.erb | 4 +- 5 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 app/views/entry_controls/index.html.erb diff --git a/app/controllers/entry_controls_controller.rb b/app/controllers/entry_controls_controller.rb index 1df6a53..d12e8ba 100755 --- a/app/controllers/entry_controls_controller.rb +++ b/app/controllers/entry_controls_controller.rb @@ -21,6 +21,11 @@ def show @batches = @entry.batches end + def index + #@batches = @entry.batches + end + + private def entryControl_params params.require(:entry_control).permit(:entryDate, :exchangeRate, :receivedBy, :deliveredBy,:entry_number) diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 45733e2..ab705bb 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -4,6 +4,8 @@ def index @organizations = Organization.all end + @organization ||= Organization.all + def show organization = Organization.find(params[:id]) @entries = organization.entry_controls diff --git a/app/views/entry_controls/index.html.erb b/app/views/entry_controls/index.html.erb new file mode 100644 index 0000000..d4ae304 --- /dev/null +++ b/app/views/entry_controls/index.html.erb @@ -0,0 +1,83 @@ + +
+
+
+
+
+ + +
+ +
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+ + +
+ +
+ + +
+ + +
+ <%= link_to "Regresar", quality_controls_path , class: "btn btn-primary"%> +
+ +
+
+
+
+
\ No newline at end of file diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index 7aa27d0..899bd37 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -7,8 +7,8 @@

Control de ingreso

- Organización: - <%= Organization.find(@entry.organization_id).name %> + Organización: Testing! +

Recibido por: diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 51815a9..3d87210 100755 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -28,7 +28,7 @@ <% if not current_user.admin_role %> <% if current_user.warehouse_role %>

  • archiveBodega
  • -
  • <%= link_to 'Control de ingreso', organizations_path, class:"white-text li-back"%>
  • +
  • <%= link_to 'Control de ingreso', '/entry_controls', class:"white-text li-back"%>
  • <% if Notification.where(kind: 3, read: false).count == 1 %> <%= Notification.where(kind: 3, read: false).count %> <% elsif Notification.where(kind: 3, read: false).count > 1 %> @@ -189,7 +189,7 @@ <% if not current_user.admin_role %> <% if current_user.warehouse_role %>
  • archiveBodega
  • -
  • <%= link_to 'Control de ingreso', organizations_path, class:"white-text li-back"%>
  • +
  • <%= link_to 'Control de ingreso','/entry_controls', class:"white-text li-back"%>
  • <% if Notification.where(kind: 3, read: false).count == 1 %> <%= Notification.where(kind: 3, read: false).count %> <% elsif Notification.where(kind: 3, read: false).count > 1 %> From 2809ecb0a62efd2a3fe2c5fd632ae019497b48de Mon Sep 17 00:00:00 2001 From: Alex Bono Date: Mon, 11 Jun 2018 16:01:27 -0600 Subject: [PATCH 004/112] Avances --- app/controllers/entry_controls_controller.rb | 6 ++ app/controllers/organizations_controller.rb | 2 +- app/views/entry_controls/index.html.erb | 62 +++++++++----------- 3 files changed, 34 insertions(+), 36 deletions(-) diff --git a/app/controllers/entry_controls_controller.rb b/app/controllers/entry_controls_controller.rb index d12e8ba..3bd27f0 100755 --- a/app/controllers/entry_controls_controller.rb +++ b/app/controllers/entry_controls_controller.rb @@ -5,6 +5,8 @@ def new @entryControl = @organization.entry_controls.build end + + def create organization = Organization.find(params[:organization_id]) entryControl = organization.entry_controls.build(entryControl_params) @@ -19,10 +21,14 @@ def create def show @entry = EntryControl.find(params[:id]) @batches = @entry.batches + end def index #@batches = @entry.batches + + + end diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index ab705bb..7d5053d 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -4,7 +4,7 @@ def index @organizations = Organization.all end - @organization ||= Organization.all + def show organization = Organization.find(params[:id]) diff --git a/app/views/entry_controls/index.html.erb b/app/views/entry_controls/index.html.erb index d4ae304..4ef4cdf 100644 --- a/app/views/entry_controls/index.html.erb +++ b/app/views/entry_controls/index.html.erb @@ -4,30 +4,40 @@
    + + +
    -
    - + +
    - - + +
    - - + +
    - - + +
    - - + + +
    +
    + +
    @@ -43,38 +53,20 @@
    +
    -
    - - -
    + + + <%= link_to "Cancelar", '/entry_controls' , class: "btn btn-primary"%> -
    - - -
    -
    - <%= link_to "Regresar", quality_controls_path , class: "btn btn-primary"%> -
    +
    From 1c0be685e9655032819bc5890f623b7018caa55b Mon Sep 17 00:00:00 2001 From: Alex Bono Date: Mon, 11 Jun 2018 16:52:08 -0600 Subject: [PATCH 005/112] Arreglar discrepancias por merge --- db/seeds.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 9c3e876..c72ee41 100755 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,3 +1,4 @@ +=begin User.create! do |u| u.email = 'warehouse' u.password = 'warehouse' @@ -61,7 +62,7 @@ CocoaType.create do |c| c.name = 'C' end - +=end CertificateType.create do |ct| ct.name= 'E' end @@ -73,7 +74,7 @@ CertificateType.create do |ct| ct.name= 'C' end - +=begin GeneticMaterial.create do |g| g.name = 'HT' end @@ -428,3 +429,4 @@ Archive.create! do |a| a.title = "Factura de venta" end +=end From 460502d217aeb4f519c53a2181e45a4a524e5b25 Mon Sep 17 00:00:00 2001 From: Alex Bono Date: Tue, 12 Jun 2018 00:37:44 -0600 Subject: [PATCH 006/112] parte visual finalizada --- app/controllers/entry_controls_controller.rb | 2 +- app/views/entry_controls/index.html.erb | 67 +++++++++++++------- 2 files changed, 45 insertions(+), 24 deletions(-) diff --git a/app/controllers/entry_controls_controller.rb b/app/controllers/entry_controls_controller.rb index 3bd27f0..32cfd5c 100755 --- a/app/controllers/entry_controls_controller.rb +++ b/app/controllers/entry_controls_controller.rb @@ -1,7 +1,7 @@ class EntryControlsController < ApplicationController before_action :authenticate_user! def new - @organization = Organization.find(params[:organization_id]) + @organization = Organization.all @entryControl = @organization.entry_controls.build end diff --git a/app/views/entry_controls/index.html.erb b/app/views/entry_controls/index.html.erb index 4ef4cdf..9d7d584 100644 --- a/app/views/entry_controls/index.html.erb +++ b/app/views/entry_controls/index.html.erb @@ -10,59 +10,80 @@
    - -
    -
    - - + +
    - +
    - - + +
    - - + +
    +
    - - + +
    - - + +
    -
    -
    +
    -
    - +
    +
    +

    + + +

    +
    +
    + + +
    + <%= link_to "Cancelar", '/entry_controls' , class: "btn btn-primary"%> + + + <%= form_for [@entryControl, @batch] do |f| %> +
    + <%= f.label :sackAmount, "Cantidad de sacos" %> + <%= f.number_field :sackAmount, min: 0 , :required => true %> +
    +
    + <%= f.label :weight, "Peso en libras" %> + <%= f.number_field :weight, step: :any, min: 0 , :required => true %> +
    + <% end %> + + - <%= link_to "Cancelar", '/entry_controls' , class: "btn btn-primary"%> From 9789a947108bb26fb58b3cb65a32371877bda48c Mon Sep 17 00:00:00 2001 From: Alex Bono Date: Tue, 12 Jun 2018 01:14:39 -0600 Subject: [PATCH 007/112] parte visual finalizadav2 --- app/views/entry_controls/index.html.erb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/app/views/entry_controls/index.html.erb b/app/views/entry_controls/index.html.erb index 9d7d584..ff48627 100644 --- a/app/views/entry_controls/index.html.erb +++ b/app/views/entry_controls/index.html.erb @@ -70,18 +70,7 @@ <%= link_to "Cancelar", '/entry_controls' , class: "btn btn-primary"%> - <%= form_for [@entryControl, @batch] do |f| %> -
    - <%= f.label :sackAmount, "Cantidad de sacos" %> - <%= f.number_field :sackAmount, min: 0 , :required => true %> -
    - -
    - <%= f.label :weight, "Peso en libras" %> - <%= f.number_field :weight, step: :any, min: 0 , :required => true %> -
    - <% end %> - + From ba81cb5589b18dbae4af1d6cabbb4bd9d1d7311d Mon Sep 17 00:00:00 2001 From: Esther Date: Wed, 13 Jun 2018 19:27:08 -0600 Subject: [PATCH 008/112] Checklist for files added --- app/assets/javascripts/filechecklist.coffee | 3 ++ app/assets/stylesheets/filechecklist.scss | 3 ++ app/controllers/filechecklists_controller.rb | 37 ++++++++++++++++ app/helpers/filechecklist_helper.rb | 2 + app/models/entry_control.rb | 1 + app/models/filechecklist.rb | 3 ++ app/views/entry_controls/show.html.erb | 26 +++-------- app/views/filechecklists/edit.html.erb | 44 +++++++++++++++++++ app/views/filechecklists/new.html.erb | 44 +++++++++++++++++++ config/routes.rb | 4 +- .../20180613214638_create_filechecklists.rb | 15 +++++++ db/schema.rb | 15 ++++++- .../filechecklist_controller_test.rb | 9 ++++ test/fixtures/filechecklists.yml | 19 ++++++++ test/models/filechecklist_test.rb | 7 +++ 15 files changed, 210 insertions(+), 22 deletions(-) create mode 100644 app/assets/javascripts/filechecklist.coffee create mode 100644 app/assets/stylesheets/filechecklist.scss create mode 100644 app/controllers/filechecklists_controller.rb create mode 100644 app/helpers/filechecklist_helper.rb create mode 100644 app/models/filechecklist.rb create mode 100644 app/views/filechecklists/edit.html.erb create mode 100644 app/views/filechecklists/new.html.erb create mode 100644 db/migrate/20180613214638_create_filechecklists.rb create mode 100644 test/controllers/filechecklist_controller_test.rb create mode 100644 test/fixtures/filechecklists.yml create mode 100644 test/models/filechecklist_test.rb diff --git a/app/assets/javascripts/filechecklist.coffee b/app/assets/javascripts/filechecklist.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/filechecklist.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/filechecklist.scss b/app/assets/stylesheets/filechecklist.scss new file mode 100644 index 0000000..090df37 --- /dev/null +++ b/app/assets/stylesheets/filechecklist.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Filechecklist controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/filechecklists_controller.rb b/app/controllers/filechecklists_controller.rb new file mode 100644 index 0000000..3f65718 --- /dev/null +++ b/app/controllers/filechecklists_controller.rb @@ -0,0 +1,37 @@ +class FilechecklistsController < ApplicationController + before_action :authenticate_user! + + def new + @entry = EntryControl.find(params[:entry_control_id]) + @checklist = @entry.filechecklists.build + end + + def create + entry = EntryControl.find(params[:entry_control_id]) + checklist = entry.filechecklists.build(checklist_params) + + if checklist.save + redirect_to entry, notice: "Guardado con éxito" + else + flash[:errors] = "No se pudo guardar" + render :new + end + end + + def edit + @checklist = Filechecklist.find(params[:id]) + end + + def update + checklist = Filechecklist.find(params[:id]) + if checklist.update(checklist_params) + redirect_to checklist.entry_control + else + render 'edit' + end + end + + def checklist_params + params.require(:filechecklist).permit(:referralSheet, :producersList, :inspectionSheet, :embacingControl, :collectionCleaningControl, :warehouseEntrySheet) + end +end diff --git a/app/helpers/filechecklist_helper.rb b/app/helpers/filechecklist_helper.rb new file mode 100644 index 0000000..0809214 --- /dev/null +++ b/app/helpers/filechecklist_helper.rb @@ -0,0 +1,2 @@ +module FilechecklistHelper +end diff --git a/app/models/entry_control.rb b/app/models/entry_control.rb index c482fad..a333887 100755 --- a/app/models/entry_control.rb +++ b/app/models/entry_control.rb @@ -4,6 +4,7 @@ class EntryControl < ApplicationRecord has_attached_file :ec_files do_not_validate_attachment_file_type :ec_files has_many :documents + has_many :filechecklists validates :organization, presence: true validates :entryDate, presence: true diff --git a/app/models/filechecklist.rb b/app/models/filechecklist.rb new file mode 100644 index 0000000..1e60fd3 --- /dev/null +++ b/app/models/filechecklist.rb @@ -0,0 +1,3 @@ +class Filechecklist < ApplicationRecord + belongs_to :entry_control +end diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index 7aa27d0..adc9331 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -91,28 +91,14 @@ ARCHIVOS
    - - - - - - - - - <% @entry.documents.each do |doc| %> - - - - <% end %> - - <% end %> - -
    Nombre del archivo
    <%=doc.title%><%= link_to "Descargar archivo", doc.ec_data.url(:original, false) %> - <% if current_user.warehouse_role || current_user.admin_role %> - <%= link_to 'Editar', edit_document_path(doc) %>
    <% if current_user.warehouse_role %>
    - <%= link_to "Agregar Archivo", new_entry_control_document_path(@entry), class:"waves-effect waves-light btn" %> + <% if @entry.filechecklists.empty? %> + <%= link_to "Verificar documentos", new_entry_control_filechecklist_path(@entry), class:"waves-effect waves-light btn" %> + <% else %> + <%= link_to "Verificar documentos", edit_filechecklist_path(@entry.filechecklists.first), class:"waves-effect waves-light btn" %> + <% end %> + <% end %>
    diff --git a/app/views/filechecklists/edit.html.erb b/app/views/filechecklists/edit.html.erb new file mode 100644 index 0000000..717c2cd --- /dev/null +++ b/app/views/filechecklists/edit.html.erb @@ -0,0 +1,44 @@ +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/filechecklists/new.html.erb b/app/views/filechecklists/new.html.erb new file mode 100644 index 0000000..77c26cd --- /dev/null +++ b/app/views/filechecklists/new.html.erb @@ -0,0 +1,44 @@ +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 3f0e70f..fc07015 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,7 +4,7 @@ get 'export_batches/new' - get 'reports/index' + get 'reports/index'# get 'purchases/index' @@ -35,6 +35,7 @@ resources :static_pages resources :export_batches resources :documents + resources :filechecklists resources :entry_controls do resources :batches @@ -60,6 +61,7 @@ resources :entry_controls do resources :documents, only: [:new, :create] + resources :filechecklists, only: [:new, :create] end resources :invoices do diff --git a/db/migrate/20180613214638_create_filechecklists.rb b/db/migrate/20180613214638_create_filechecklists.rb new file mode 100644 index 0000000..495415f --- /dev/null +++ b/db/migrate/20180613214638_create_filechecklists.rb @@ -0,0 +1,15 @@ +class CreateFilechecklists < ActiveRecord::Migration[5.1] + def change + create_table :filechecklists do |t| + t.boolean :referralSheet + t.boolean :producersList + t.boolean :inspectionSheet + t.boolean :embacingControl + t.boolean :collectionCleaningControl + t.boolean :warehouseEntrySheet + t.references :entry_control, foreign_key: true + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index d4a0e09..9198dbb 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180531204815) do +ActiveRecord::Schema.define(version: 20180613214638) do create_table "acceptances", force: :cascade do |t| t.decimal "max_qualityA" @@ -145,6 +145,19 @@ t.datetime "updated_at", null: false end + create_table "filechecklists", force: :cascade do |t| + t.boolean "referralSheet" + t.boolean "producersList" + t.boolean "inspectionSheet" + t.boolean "embacingControl" + t.boolean "collectionCleaningControl" + t.boolean "warehouseEntrySheet" + t.integer "entry_control_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["entry_control_id"], name: "index_filechecklists_on_entry_control_id" + end + create_table "genetic_materials", force: :cascade do |t| t.string "name" t.datetime "created_at", null: false diff --git a/test/controllers/filechecklist_controller_test.rb b/test/controllers/filechecklist_controller_test.rb new file mode 100644 index 0000000..dc065c7 --- /dev/null +++ b/test/controllers/filechecklist_controller_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class FilechecklistControllerTest < ActionDispatch::IntegrationTest + test "should get new" do + get filechecklist_new_url + assert_response :success + end + +end diff --git a/test/fixtures/filechecklists.yml b/test/fixtures/filechecklists.yml new file mode 100644 index 0000000..d4e7399 --- /dev/null +++ b/test/fixtures/filechecklists.yml @@ -0,0 +1,19 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + referralSheet: false + producersList: false + inspectionSheet: false + embacingControl: false + collectionCleaningControl: false + warehouseEntrySheet: false + entry_control: one + +two: + referralSheet: false + producersList: false + inspectionSheet: false + embacingControl: false + collectionCleaningControl: false + warehouseEntrySheet: false + entry_control: two diff --git a/test/models/filechecklist_test.rb b/test/models/filechecklist_test.rb new file mode 100644 index 0000000..1689d1c --- /dev/null +++ b/test/models/filechecklist_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class FilechecklistTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From 3278389e40188fb35e4a4b85c2f832899f81b6fb Mon Sep 17 00:00:00 2001 From: Esther Date: Wed, 13 Jun 2018 22:42:07 -0600 Subject: [PATCH 009/112] changes on the checklist appeareance and model --- app/controllers/filechecklists_controller.rb | 15 +++++++++++++-- app/views/entry_controls/show.html.erb | 4 +--- app/views/filechecklists/edit.html.erb | 4 ++++ app/views/filechecklists/new.html.erb | 4 ++++ ...0614012823_add_everything_to_filechecklists.rb | 5 +++++ ...80614012904_add_bill_copy_to_filechecklists.rb | 5 +++++ db/schema.rb | 4 +++- 7 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20180614012823_add_everything_to_filechecklists.rb create mode 100644 db/migrate/20180614012904_add_bill_copy_to_filechecklists.rb diff --git a/app/controllers/filechecklists_controller.rb b/app/controllers/filechecklists_controller.rb index 3f65718..4f58303 100644 --- a/app/controllers/filechecklists_controller.rb +++ b/app/controllers/filechecklists_controller.rb @@ -1,5 +1,6 @@ class FilechecklistsController < ApplicationController before_action :authenticate_user! + after_action :set_everything, only: [:edit, :update] def new @entry = EntryControl.find(params[:entry_control_id]) @@ -9,7 +10,7 @@ def new def create entry = EntryControl.find(params[:entry_control_id]) checklist = entry.filechecklists.build(checklist_params) - + checklist.everything= false if checklist.save redirect_to entry, notice: "Guardado con éxito" else @@ -31,7 +32,17 @@ def update end end + def set_everything + @checklist = Filechecklist.find(params[:id]) + if @checklist.referralSheet & @checklist.inspectionSheet & @checklist.embacingControl & @checklist.producersList & @checklist.collectionCleaningControl & @checklist.warehouseEntrySheet & @checklist.billCopy + @checklist.everything= true + else + @checklist.everything= false + end + @checklist.save + end + def checklist_params - params.require(:filechecklist).permit(:referralSheet, :producersList, :inspectionSheet, :embacingControl, :collectionCleaningControl, :warehouseEntrySheet) + params.require(:filechecklist).permit(:referralSheet, :producersList, :inspectionSheet, :embacingControl, :collectionCleaningControl, :warehouseEntrySheet, :billCopy) end end diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index adc9331..3c563d2 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -88,17 +88,15 @@
  • file_upload - ARCHIVOS + DOCUMENTOS
    <% if current_user.warehouse_role %> -
    <% if @entry.filechecklists.empty? %> <%= link_to "Verificar documentos", new_entry_control_filechecklist_path(@entry), class:"waves-effect waves-light btn" %> <% else %> <%= link_to "Verificar documentos", edit_filechecklist_path(@entry.filechecklists.first), class:"waves-effect waves-light btn" %> <% end %> - <% end %>
  • diff --git a/app/views/filechecklists/edit.html.erb b/app/views/filechecklists/edit.html.erb index 717c2cd..ea5cc20 100644 --- a/app/views/filechecklists/edit.html.erb +++ b/app/views/filechecklists/edit.html.erb @@ -30,6 +30,10 @@ <%= f.check_box :warehouseEntrySheet %> <%= f.label 'warehouseEntrySheet', "Hoja de ingreso a bodega" %>
    +
    + <%= f.check_box :billCopy %> + <%= f.label 'billCopy', "Copia de factura" %> +

    <%= link_to "Regresar", @checklist.entry_control , class: "btn btn-primary"%> diff --git a/app/views/filechecklists/new.html.erb b/app/views/filechecklists/new.html.erb index 77c26cd..1a3dcfb 100644 --- a/app/views/filechecklists/new.html.erb +++ b/app/views/filechecklists/new.html.erb @@ -30,6 +30,10 @@ <%= f.check_box :warehouseEntrySheet %> <%= f.label 'warehouseEntrySheet', "Hoja de ingreso a bodega" %>
    +
    + <%= f.check_box :billCopy %> + <%= f.label 'billCopy', "Copia de factura" %> +

    <%= link_to "Regresar", @entry , class: "btn btn-primary"%> diff --git a/db/migrate/20180614012823_add_everything_to_filechecklists.rb b/db/migrate/20180614012823_add_everything_to_filechecklists.rb new file mode 100644 index 0000000..ef4497c --- /dev/null +++ b/db/migrate/20180614012823_add_everything_to_filechecklists.rb @@ -0,0 +1,5 @@ +class AddEverythingToFilechecklists < ActiveRecord::Migration[5.1] + def change + add_column :filechecklists, :everything, :boolean + end +end diff --git a/db/migrate/20180614012904_add_bill_copy_to_filechecklists.rb b/db/migrate/20180614012904_add_bill_copy_to_filechecklists.rb new file mode 100644 index 0000000..9abf078 --- /dev/null +++ b/db/migrate/20180614012904_add_bill_copy_to_filechecklists.rb @@ -0,0 +1,5 @@ +class AddBillCopyToFilechecklists < ActiveRecord::Migration[5.1] + def change + add_column :filechecklists, :billCopy, :boolean + end +end diff --git a/db/schema.rb b/db/schema.rb index 9198dbb..1256b28 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180613214638) do +ActiveRecord::Schema.define(version: 20180614012904) do create_table "acceptances", force: :cascade do |t| t.decimal "max_qualityA" @@ -155,6 +155,8 @@ t.integer "entry_control_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.boolean "everything" + t.boolean "billCopy" t.index ["entry_control_id"], name: "index_filechecklists_on_entry_control_id" end From ce3ee588147acf61c429a704136af33e9052834b Mon Sep 17 00:00:00 2001 From: LourdesZamora Date: Thu, 14 Jun 2018 10:34:46 -0600 Subject: [PATCH 010/112] Generacion de Codigo de ingreso de lotes --- app/controllers/batches_controller.rb | 16 +++++++++++++--- db/seeds.rb | 6 ++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/controllers/batches_controller.rb b/app/controllers/batches_controller.rb index 116aa3d..94863b7 100644 --- a/app/controllers/batches_controller.rb +++ b/app/controllers/batches_controller.rb @@ -11,9 +11,19 @@ def new def create entryControl = EntryControl.find(params[:entry_control_id]) batch=entryControl.batches.build(batches_params) - - batch.enterCode = entryControl.organization.code+batch.postharvestCenter+"-"+entryControl.entryDate.strftime('%d%m%y')+"-EAHT" - + + genetic=GeneticMaterial.find(batch.geneticMaterial).name + quality=CertificateType.find(batch.certificatetype).name + cocoat=CocoaType.find(batch.cocoaType).name + c = entryControl.organization.code+batch.postharvestCenter.to_s+"-"+entryControl.entryDate.strftime('%d%m%y')+"-"+quality+cocoat+genetic + code="" + if batch.ft + code=c+"-FT" + else + code= c + end + + batch.enterCode=code if batch.save createNotification redirect_to entryControl diff --git a/db/seeds.rb b/db/seeds.rb index 9c3e876..c27550d 100755 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,3 +1,4 @@ +=begin User.create! do |u| u.email = 'warehouse' u.password = 'warehouse' @@ -61,7 +62,7 @@ CocoaType.create do |c| c.name = 'C' end - +=end CertificateType.create do |ct| ct.name= 'E' end @@ -73,7 +74,7 @@ CertificateType.create do |ct| ct.name= 'C' end - +=begin GeneticMaterial.create do |g| g.name = 'HT' end @@ -428,3 +429,4 @@ Archive.create! do |a| a.title = "Factura de venta" end +=end \ No newline at end of file From 740b9a8d27178b565bbd35f90fd83f71706d8c24 Mon Sep 17 00:00:00 2001 From: Francis Villalobos Date: Thu, 14 Jun 2018 13:17:57 -0600 Subject: [PATCH 011/112] Codigo de barra agregado --- app/assets/stylesheets/application.scss | 18 ++++++++++++++- .../stylesheets/fonts/IDAutomationHC39M.eot | Bin 0 -> 36592 bytes .../stylesheets/fonts/IDAutomationHC39M.woff | Bin 0 -> 9860 bytes app/controllers/barcodes_controller.rb | 10 +++++++++ app/views/barcodes/new.html.erb | 21 ++++++++++++++++++ app/views/entry_controls/show.html.erb | 5 ++++- config/routes.rb | 3 +++ 7 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 app/assets/stylesheets/fonts/IDAutomationHC39M.eot create mode 100644 app/assets/stylesheets/fonts/IDAutomationHC39M.woff create mode 100644 app/controllers/barcodes_controller.rb create mode 100644 app/views/barcodes/new.html.erb diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 6dabb3f..631a350 100755 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -126,4 +126,20 @@ body{ .padding-sidenav{ padding-left: 25px; -} \ No newline at end of file +} + +$font-path: './fonts'; +$font-name: 'IDAutomationHC39M'; +$fallback-src: url("#{$font-path}/#{$font-name}.eot"); +$src: + url("#{$font-path}/#{$font-name}.eot?#iefix") format('embedded-opentype'), + url("#{$font-path}/#{$font-name}.woff") format('woff') +; + +@font-face { + font-family: $font-name; + src: $fallback-src; + src: $src; + font-weight: normal; + font-style: normal; +} diff --git a/app/assets/stylesheets/fonts/IDAutomationHC39M.eot b/app/assets/stylesheets/fonts/IDAutomationHC39M.eot new file mode 100644 index 0000000000000000000000000000000000000000..1a0c71194d4bd92e27517881cf5db75911dfe0c0 GIT binary patch literal 36592 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
    Q4megk7V@eGpgr)|V^wNOlR+TaDo= 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 literal 0 HcmV?d00001 diff --git a/app/assets/stylesheets/fonts/IDAutomationHC39M.woff b/app/assets/stylesheets/fonts/IDAutomationHC39M.woff new file mode 100644 index 0000000000000000000000000000000000000000..dd3fd6e5e50ff3f876f4b901f472db05221afd23 GIT binary patch literal 9860 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 DI+~

    +

    +
    +
    +
    +
    +

    +
    +

    (<%=@batch.enterCode%>)

    +
    +
    +
    + <%= link_to "Regresar", @batch.entry_control , class: "btn btn-primary"%> +
    +
    +
    +
    +
    +<% end %> diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index 3c563d2..dd9b2ec 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -74,7 +74,10 @@ <%= link_to "Editar análisis físico", edit_quality_control_path(batch.quality_control.id) %> - <% end %> + <% end %>purchase_role + + <%= link_to "Código de Barra", new_batch_barcode_path(batch) %> + <% end %> diff --git a/config/routes.rb b/config/routes.rb index fc07015..f8ac39a 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -36,10 +36,12 @@ resources :export_batches resources :documents resources :filechecklists + resources :barcodes resources :entry_controls do resources :batches resources :reports + resources :barcodes end resources :batches do @@ -49,6 +51,7 @@ resources :purchases resources :sensory_analyses resources :reports + resources :barcodes end resources :quality_controls do From dffdcbfaf9533a441a12a5f1bacb9ad1194c0fab Mon Sep 17 00:00:00 2001 From: Francis Villalobos Date: Thu, 14 Jun 2018 13:25:43 -0600 Subject: [PATCH 012/112] Codigo de barra ahora es visible en distintos usuarioS --- app/views/barcodes/new.html.erb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/views/barcodes/new.html.erb b/app/views/barcodes/new.html.erb index 2fc61a1..107e71c 100644 --- a/app/views/barcodes/new.html.erb +++ b/app/views/barcodes/new.html.erb @@ -1,4 +1,3 @@ -<% if current_user.administration_role || current_user.admin_role %>
    @@ -18,4 +17,3 @@
    -<% end %> From 634382d83ec9aeed102431087c93d8966da7e8ff Mon Sep 17 00:00:00 2001 From: Esther Date: Thu, 14 Jun 2018 14:55:12 -0600 Subject: [PATCH 013/112] Fixed issues with checklist not showing and issues with the code generation --- app/controllers/batches_controller.rb | 8 ++++++-- app/controllers/filechecklists_controller.rb | 2 +- app/views/batches/new.html.erb | 4 +--- app/views/entry_controls/show.html.erb | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/controllers/batches_controller.rb b/app/controllers/batches_controller.rb index 94863b7..95d9bf7 100644 --- a/app/controllers/batches_controller.rb +++ b/app/controllers/batches_controller.rb @@ -15,10 +15,14 @@ def create genetic=GeneticMaterial.find(batch.geneticMaterial).name quality=CertificateType.find(batch.certificatetype).name cocoat=CocoaType.find(batch.cocoaType).name - c = entryControl.organization.code+batch.postharvestCenter.to_s+"-"+entryControl.entryDate.strftime('%d%m%y')+"-"+quality+cocoat+genetic + c = entryControl.organization.code+"0"+batch.postharvestCenter.to_s+"-"+entryControl.entryDate.strftime('%d%m%y')+"-"+quality+cocoat+genetic code="" if batch.ft - code=c+"-FT" + if quality== 'C' && cocoat == 'C' + code=c + else + code=c+"-FT" + end else code= c end diff --git a/app/controllers/filechecklists_controller.rb b/app/controllers/filechecklists_controller.rb index 4f58303..eb309ca 100644 --- a/app/controllers/filechecklists_controller.rb +++ b/app/controllers/filechecklists_controller.rb @@ -26,7 +26,7 @@ def edit def update checklist = Filechecklist.find(params[:id]) if checklist.update(checklist_params) - redirect_to checklist.entry_control + redirect_to checklist.entry_control, notice: "Guardado con éxito" else render 'edit' end diff --git a/app/views/batches/new.html.erb b/app/views/batches/new.html.erb index ed786fc..be2d719 100644 --- a/app/views/batches/new.html.erb +++ b/app/views/batches/new.html.erb @@ -15,9 +15,7 @@
    <%= f.label :weight, "Peso en libras" %> <%= f.number_field :weight, step: :any, min: 0 , :required => true %> -
    - - +
    <%= f.label :postharvestCenter, "Centro de poscosecha" %> diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index dd9b2ec..a8797d0 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -74,7 +74,7 @@ <%= link_to "Editar análisis físico", edit_quality_control_path(batch.quality_control.id) %> - <% end %>purchase_role + <% end %> <%= link_to "Código de Barra", new_batch_barcode_path(batch) %> @@ -94,13 +94,13 @@ DOCUMENTOS
    - <% if current_user.warehouse_role %> + <% if @entry.filechecklists.empty? %> <%= link_to "Verificar documentos", new_entry_control_filechecklist_path(@entry), class:"waves-effect waves-light btn" %> <% else %> <%= link_to "Verificar documentos", edit_filechecklist_path(@entry.filechecklists.first), class:"waves-effect waves-light btn" %> <% end %> - <% end %> +
    <% end %> From 491f02ab92b7b6d85e45ecb51405a101775aef26 Mon Sep 17 00:00:00 2001 From: Esther Date: Thu, 14 Jun 2018 15:02:40 -0600 Subject: [PATCH 014/112] Fixed more issues with code generation --- app/controllers/batches_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/batches_controller.rb b/app/controllers/batches_controller.rb index 95d9bf7..9b27c6a 100644 --- a/app/controllers/batches_controller.rb +++ b/app/controllers/batches_controller.rb @@ -20,8 +20,10 @@ def create if batch.ft if quality== 'C' && cocoat == 'C' code=c + batch.ft=false else code=c+"-FT" + end else code= c From 1b4c7cdec88b80f4f2e331d01cae5484aa8e0b64 Mon Sep 17 00:00:00 2001 From: Esther Date: Sun, 24 Jun 2018 13:47:31 -0600 Subject: [PATCH 015/112] fixed some issues with reports --- app/assets/stylesheets/reports.scss | 1 + app/controllers/filechecklists_controller.rb | 4 ++ app/views/batches/show.html.erb | 26 +++-------- app/views/filechecklists/edit.html.erb | 8 +++- app/views/filechecklists/show.html.erb | 47 ++++++++++++++++++++ app/views/reports/pdf.pdf.erb | 2 +- 6 files changed, 64 insertions(+), 24 deletions(-) create mode 100644 app/views/filechecklists/show.html.erb diff --git a/app/assets/stylesheets/reports.scss b/app/assets/stylesheets/reports.scss index 6ef9018..266c4d5 100644 --- a/app/assets/stylesheets/reports.scss +++ b/app/assets/stylesheets/reports.scss @@ -1,3 +1,4 @@ // Place all the styles related to the reports controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ + diff --git a/app/controllers/filechecklists_controller.rb b/app/controllers/filechecklists_controller.rb index eb309ca..8761eef 100644 --- a/app/controllers/filechecklists_controller.rb +++ b/app/controllers/filechecklists_controller.rb @@ -32,6 +32,10 @@ def update end end + def show + @checklist = Filechecklist.find(params[:id]) + end + def set_everything @checklist = Filechecklist.find(params[:id]) if @checklist.referralSheet & @checklist.inspectionSheet & @checklist.embacingControl & @checklist.producersList & @checklist.collectionCleaningControl & @checklist.warehouseEntrySheet & @checklist.billCopy diff --git a/app/views/batches/show.html.erb b/app/views/batches/show.html.erb index 8b21385..c253b83 100644 --- a/app/views/batches/show.html.erb +++ b/app/views/batches/show.html.erb @@ -21,27 +21,11 @@

    - DOCUMENTOS - - - - - - - - - <% @batch.entry_control.documents.each do |doc| %> - - - - <% end %> - -
    Nombre del archivo
    - <%=doc.title%> - - <%= link_to "Descargar archivo", doc.ec_data.url(:original, false) %> - -
    + <% if @batch.entry_control.filechecklists.empty? %> + <%= link_to "Verificar documentos", new_entry_control_filechecklist_path(@batch.entry_control), class:"waves-effect waves-light btn" %> + <% else %> + <%= link_to "Verificar documentos", filechecklist_path(@batch.entry_control.filechecklists.first), class:"waves-effect waves-light btn" %> + <% end %>
    <%= link_to "Regresar", checkings_path , class: "btn btn-primary"%> Determinar diff --git a/app/views/filechecklists/edit.html.erb b/app/views/filechecklists/edit.html.erb index ea5cc20..ba63776 100644 --- a/app/views/filechecklists/edit.html.erb +++ b/app/views/filechecklists/edit.html.erb @@ -36,8 +36,12 @@

    - <%= link_to "Regresar", @checklist.entry_control , class: "btn btn-primary"%> - <%= f.submit "Guardar", class:"btn btn-default btn-lg" %> + <% if current_user.certification_role %> + <%= link_to "Regresar", :back , class: "btn btn-primary"%> + <% else %> + <%= link_to "Regresar", @checklist.entry_control , class: "btn btn-primary"%> + <%= f.submit "Guardar", class:"btn btn-default btn-lg" %> + <% end %>
    <% end %> diff --git a/app/views/filechecklists/show.html.erb b/app/views/filechecklists/show.html.erb new file mode 100644 index 0000000..3d8c493 --- /dev/null +++ b/app/views/filechecklists/show.html.erb @@ -0,0 +1,47 @@ +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    \ No newline at end of file diff --git a/app/views/reports/pdf.pdf.erb b/app/views/reports/pdf.pdf.erb index 9afc521..4a98daa 100644 --- a/app/views/reports/pdf.pdf.erb +++ b/app/views/reports/pdf.pdf.erb @@ -2,7 +2,7 @@ - <%= wicked_pdf_stylesheet_link_tag "application" %> + <%= wicked_pdf_stylesheet_link_tag "pdf" %>
    From d354a62e0c028f82a93991e2be6f4f0bbe8001de Mon Sep 17 00:00:00 2001 From: Esther Date: Wed, 27 Jun 2018 00:30:43 -0600 Subject: [PATCH 016/112] Inventory --- app/assets/javascripts/inventories.coffee | 3 + app/assets/stylesheets/inventories.scss | 3 + app/controllers/inventories_controller.rb | 17 + app/helpers/inventories_helper.rb | 2 + app/views/inventories/index.html.erb | 332 ++++++++++++++++++ app/views/inventories/pdf.pdf.erb | 99 ++++++ app/views/layouts/application.html.erb | 3 + config/routes.rb | 5 + .../inventories_controller_test.rb | 9 + 9 files changed, 473 insertions(+) create mode 100644 app/assets/javascripts/inventories.coffee create mode 100644 app/assets/stylesheets/inventories.scss create mode 100644 app/controllers/inventories_controller.rb create mode 100644 app/helpers/inventories_helper.rb create mode 100644 app/views/inventories/index.html.erb create mode 100644 app/views/inventories/pdf.pdf.erb create mode 100644 test/controllers/inventories_controller_test.rb diff --git a/app/assets/javascripts/inventories.coffee b/app/assets/javascripts/inventories.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/inventories.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/inventories.scss b/app/assets/stylesheets/inventories.scss new file mode 100644 index 0000000..19fcaa6 --- /dev/null +++ b/app/assets/stylesheets/inventories.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Inventories controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/inventories_controller.rb b/app/controllers/inventories_controller.rb new file mode 100644 index 0000000..e5dadb9 --- /dev/null +++ b/app/controllers/inventories_controller.rb @@ -0,0 +1,17 @@ +class InventoriesController < ApplicationController + before_action :authenticate_user! + def index + @entries = EntryControl.search(params[:searchbox].to_s, params[:from].to_s,params[:to].to_s) + part1 = request.original_url.to_s.split("?")[0] + part2 = request.original_url.to_s.split("?")[1] + @new_url = part1 + ".pdf" + if part2 != nil + @new_url = @new_url + "?" + part2 + end + respond_to do |format| + format.html + format.pdf {render template: 'inventories/pdf', pdf: 'pdf'} + end + end + +end \ No newline at end of file diff --git a/app/helpers/inventories_helper.rb b/app/helpers/inventories_helper.rb new file mode 100644 index 0000000..a6ee519 --- /dev/null +++ b/app/helpers/inventories_helper.rb @@ -0,0 +1,2 @@ +module InventoriesHelper +end diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb new file mode 100644 index 0000000..d8ff050 --- /dev/null +++ b/app/views/inventories/index.html.erb @@ -0,0 +1,332 @@ +
    +
    +
    +
    +
    + + +
      +
    • +
      + chrome_reader_mode + FILTROS +
      +
      + <%= form_tag({:controller => "inventories", :action => "index"}, :method => :get) do %> + +

      Organización: <%= select_tag "searchbox", options_from_collection_for_select(Organization.all, :name, :name), :include_blank => 'TODOS' %>

      + +

      Desde: <%= text_field_tag "from", params[:from], type:"date", class:"datepicker" %>

      + +

      Hasta: <%= text_field_tag "to", params[:to], type:"date", class:"datepicker" %>

      + +

      Calidad: <%= select_tag :quality, options_for_select([["A", 1], ["B", 2] , ["C", 3]], params[:quality]), id: "different_option_value_html" ,:include_blank => 'TODOS'%>

      + +

      Certificado: <%= select_tag :certificate, options_for_select([["E", 1], ["T", 2] , ["C", 3]], params[:certificate]), id: "different_option_value_html2" ,:include_blank => 'TODOS'%>

      + +

      Variedad: <%= select_tag :variety, options_for_select([["HT", 1], ["IA", 2]], params[:variety]), id: "different_option_value_html3" ,:include_blank => 'TODOS'%>

      + +

      + <%= check_box_tag(:ft, params[:ft]) %> + <%= label_tag(:ft, "Comercio justo") %> +

      + +
      + <%= submit_tag "Generar", :name => nil, class:"btn btn-default btn-lg" %> + <%= button_tag "Limpiar", :name => nil, class:"btn btn-default btn-lg", id:"reset" %> + <% end %> + +
      +
    • +
    + + +

    + INVENTARIO +

    + +

    Calidad: + <% if params[:quality]=="" %> + TODAS + <%else%> + <%= CocoaType.find(params[:quality]).name%> + <%end%> +

    + +

    Certificado: + <% if params[:certificate]=="" %> + TODOS + <%else%> + <%= CertificateType.find(params[:certificate]).name%> + <%end%> +

    + +

    Variedad: + <% if params[:variety]=="" %> + TODAS + <%else%> + <%= GeneticMaterial.find(params[:variety]).name%> + <%end%> +

    + +

    Comercio justo: + <% if params[:ft].to_s != "on" %> + No + <%else%> + Si + <%end%> +

    + +

    + Cantidad de lotes en bodega: + <%= Batch.all.count %> +

    +

    + +
    + + + + + + + + + + + + + + <% @entries.each do |entry| %> + <% entry.batches.each do |batch| %> + + <% if params[:ft].to_s == "on" && batch.ft%> + <% if params[:variety] == "" %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if batch.geneticMaterial== params[:variety].to_i %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if !(batch.ft) %> + <% if params[:variety] == "" %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if batch.geneticMaterial== params[:variety].to_i %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + + <% end %> + <% end %> + +
    Cantidad de sacosPesoCódigo de loteTipo de cacaoVariedadCertificadoOrganización
    <%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %>
    +
    +
    +
    +
    +
    +
    + + + + + + + + + diff --git a/app/views/inventories/pdf.pdf.erb b/app/views/inventories/pdf.pdf.erb new file mode 100644 index 0000000..4a98daa --- /dev/null +++ b/app/views/inventories/pdf.pdf.erb @@ -0,0 +1,99 @@ + + + + + <%= wicked_pdf_stylesheet_link_tag "pdf" %> + + +
    +

    Chocolats Halba

    +

    Reporte

    +
    + + + + + + + + + + + + + <% @entries.each do |entry| %> + <% entry.batches.each do |batch| %> + <% if batch.quality_control != nil %> + <% if batch.quality_control.revision != nil %> + + <% if params[:purchased].to_s != "on" && params[:quality] == "" %> + <% if batch.purchase == nil %> + + + + + + + <% end %> + <% end %> + <% if params[:purchased].to_s == "on" && params[:quality] == "" %> + <% if batch.purchase != nil %> + <% if batch.purchase.decision == 1 %> + + + + + + <% if params[:searchbox] == "" %> + + <% end %> + <% end %> + <% end %> + <% end %> + <% if params[:purchased].to_s != "on" && params[:quality] != "" %> + <% if batch.quality_control != nil %> + <% if batch.quality_control.revision != nil %> + <% if batch.quality_control.revision.status == params[:quality].to_i %> + <% if batch.purchase == nil %> + + + + + + <% if params[:searchbox] == "" %> + + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% if params[:purchased].to_s == "on" && params[:quality] != "" %> + <% if batch.quality_control != nil %> + <% if batch.quality_control.revision != nil %> + <% if batch.quality_control.revision.status == params[:quality].to_i %> + <% if batch.purchase != nil %> + <% if batch.purchase.decision == 1 %> + + + + + + <% if params[:searchbox] == "" %> + + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + + <% end %> + <% end %> + <% end %> + <% end %> + +
    Cant. sacosPesoIdentificacionTipo de cacaoMaterial geneticoOrganizacion
    <%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.quality_control.revision.status).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.quality_control.revision.status).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.quality_control.revision.status).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.quality_control.revision.status).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.entry_control.organization.name %>
    + +
    \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 51815a9..0df8f13 100755 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -28,6 +28,7 @@ <% if not current_user.admin_role %> <% if current_user.warehouse_role %>
  • archiveBodega
  • +
  • <%= link_to 'Inventario', inventories_path , class:"white-text li-back"%>
  • <%= link_to 'Control de ingreso', organizations_path, class:"white-text li-back"%>
  • <% if Notification.where(kind: 3, read: false).count == 1 %> <%= Notification.where(kind: 3, read: false).count %> @@ -35,6 +36,7 @@ <%= Notification.where(kind: 3, read: false).count %> <% end %>
  • <%= link_to 'Mover lotes', batches_moveBatches_path,class:"white-text li-back"%>
  • + <% end %> <% if current_user.quality_manager_role %>
  • assignment_indJefe de calidad
  • @@ -196,6 +198,7 @@ <%= Notification.where(kind: 3, read: false).count %> <% end %>
  • <%= link_to 'Mover lotes', batches_moveBatches_path,class:"white-text li-back"%>
  • +
  • <%= link_to 'Inventario', inventories_path , class:"white-text li-back"%>
  • <% end %> <% if current_user.quality_manager_role %>
  • assignment_indJefe de calidad
  • diff --git a/config/routes.rb b/config/routes.rb index f8ac39a..37950b0 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,10 +1,13 @@ Rails.application.routes.draw do + get 'inventories/index' + get 'export_batches/join' get 'export_batches/new' get 'reports/index'# + get 'inventories/index'# get 'purchases/index' @@ -32,6 +35,7 @@ resources :certificate_checks resources :purchases resources :reports + resources :inventories resources :static_pages resources :export_batches resources :documents @@ -42,6 +46,7 @@ resources :batches resources :reports resources :barcodes + resources :inventories end resources :batches do diff --git a/test/controllers/inventories_controller_test.rb b/test/controllers/inventories_controller_test.rb new file mode 100644 index 0000000..bc23a8e --- /dev/null +++ b/test/controllers/inventories_controller_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class InventoriesControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get inventories_index_url + assert_response :success + end + +end From 29a5750f429b873623c8efd50a8c7d5734f40b31 Mon Sep 17 00:00:00 2001 From: Esther Date: Wed, 27 Jun 2018 00:53:44 -0600 Subject: [PATCH 017/112] Fixed nil issues in Inventory --- app/views/inventories/index.html.erb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index d8ff050..2a1f4a3 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -14,7 +14,7 @@ FILTROS
    - <%= form_tag({:controller => "inventories", :action => "index"}, :method => :get) do %> + <%= form_tag({:controller => "inventories", :action => "index"}, :method => :get) do %>

    Organización: <%= select_tag "searchbox", options_from_collection_for_select(Organization.all, :name, :name), :include_blank => 'TODOS' %>

    @@ -41,14 +41,13 @@
  • - - +

    INVENTARIO

    Calidad: - <% if params[:quality]=="" %> + <% if params[:quality]=="" || params[:quality]==nil %> TODAS <%else%> <%= CocoaType.find(params[:quality]).name%> @@ -56,7 +55,7 @@

    Certificado: - <% if params[:certificate]=="" %> + <% if params[:certificate]=="" || params[:certificate]==nil %> TODOS <%else%> <%= CertificateType.find(params[:certificate]).name%> @@ -64,7 +63,7 @@

    Variedad: - <% if params[:variety]=="" %> + <% if params[:variety]=="" || params[:variety]==nil %> TODAS <%else%> <%= GeneticMaterial.find(params[:variety]).name%> From 6330e9e60729aab60e308bf2cb23340d512f4a19 Mon Sep 17 00:00:00 2001 From: Esther Date: Wed, 27 Jun 2018 01:34:10 -0600 Subject: [PATCH 018/112] Design fixes --- app/views/inventories/index.html.erb | 135 +++++++++++++++++++-------- 1 file changed, 94 insertions(+), 41 deletions(-) diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index 2a1f4a3..3e7b80b 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -27,12 +27,20 @@

    Certificado: <%= select_tag :certificate, options_for_select([["E", 1], ["T", 2] , ["C", 3]], params[:certificate]), id: "different_option_value_html2" ,:include_blank => 'TODOS'%>

    Variedad: <%= select_tag :variety, options_for_select([["HT", 1], ["IA", 2]], params[:variety]), id: "different_option_value_html3" ,:include_blank => 'TODOS'%>

    - +
    +

    <%= check_box_tag(:ft, params[:ft]) %> <%= label_tag(:ft, "Comercio justo") %>

    - +
    +
    +

    + <%= check_box_tag(:purchase, params[:purchase], :disabled => true) %> + <%= label_tag(:purchase, "Comprado") %> +

    +
    +

    <%= submit_tag "Generar", :name => nil, class:"btn btn-default btn-lg" %> <%= button_tag "Limpiar", :name => nil, class:"btn btn-default btn-lg", id:"reset" %> @@ -42,49 +50,94 @@ -

    - INVENTARIO -

    - -

    Calidad: - <% if params[:quality]=="" || params[:quality]==nil %> - TODAS - <%else%> - <%= CocoaType.find(params[:quality]).name%> - <%end%> -

    +
    +
    +
    +

    Calidad: + <% if params[:quality]=="" %> + TODAS + <%else%> + <% if params[:quality]==nil %> + + <%else%> + <%= CocoaType.find(params[:quality]).name%> + <%end%> + <%end%> +

    -

    Certificado: - <% if params[:certificate]=="" || params[:certificate]==nil %> - TODOS - <%else%> - <%= CertificateType.find(params[:certificate]).name%> - <%end%> -

    +

    Certificado: + <% if params[:certificate]=="" %> + TODOS + <%else%> + <% if params[:certificate]==nil %> + + <%else%> + <%= CertificateType.find(params[:certificate]).name%> + <%end%> + <%end%> +

    -

    Variedad: - <% if params[:variety]=="" || params[:variety]==nil %> - TODAS - <%else%> - <%= GeneticMaterial.find(params[:variety]).name%> - <%end%> -

    - -

    Comercio justo: - <% if params[:ft].to_s != "on" %> - No - <%else%> - Si - <%end%> -

    +

    Variedad: + <% if params[:variety]=="" %> + TODAS + <%else%> + <% if params[:variety]==nil %> + + <%else%> + <%= GeneticMaterial.find(params[:variety]).name%> + <%end%> + <%end%> +

    + + +
    +
    +
    +
    + +

    Organización: + <% if params[:searchbox]=="" %> + TODAS + <%else%> + <% if params[:searchbox]==nil %> + + <%else%> + <%= params[:searchbox].to_s%> + <%end%> + <%end%> +

    + +

    Comercio justo: + <% if params[:ft].to_s != "on" %> + No + <%else%> + Si + <%end%> +

    + +

    Comprado: + <% if params[:purchase].to_s != "on" %> + No + <%else%> + Si + <%end%> +

    +
    +
    +
    +
    +
    +
    +

    + Cantidad de lotes en bodega: + <%= Batch.all.count %> +

    -

    - Cantidad de lotes en bodega: - <%= Batch.all.count %> -

    -

    +

    +
    +
    + -
    From 1987ebd05f169d8e5d755e31c7cccc159f188a4b Mon Sep 17 00:00:00 2001 From: Esther Date: Wed, 27 Jun 2018 01:40:29 -0600 Subject: [PATCH 019/112] Inventory ready --- app/views/inventories/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index 3e7b80b..0c4a00e 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -36,7 +36,7 @@

    - <%= check_box_tag(:purchase, params[:purchase], :disabled => true) %> + <%= check_box_tag(:purchase, params[:purchase], false ,disabled: true) %> <%= label_tag(:purchase, "Comprado") %>

    From 5cb937139cd61c1d313b71504cdd7bf77ea3f31f Mon Sep 17 00:00:00 2001 From: Alex Bono Date: Wed, 27 Jun 2018 12:00:59 -0600 Subject: [PATCH 020/112] cambios en views --- app/controllers/entry_controls_controller.rb | 7 +- app/views/entry_controls/index.html.erb | 71 ++++---------------- app/views/entry_controls/new.html.erb | 6 +- app/views/entry_controls/show.html.erb | 3 +- app/views/layouts/application.html.erb | 4 +- app/views/organizations/index.html.erb | 54 ++++++++------- 6 files changed, 55 insertions(+), 90 deletions(-) diff --git a/app/controllers/entry_controls_controller.rb b/app/controllers/entry_controls_controller.rb index 32cfd5c..2314c86 100755 --- a/app/controllers/entry_controls_controller.rb +++ b/app/controllers/entry_controls_controller.rb @@ -1,8 +1,8 @@ class EntryControlsController < ApplicationController before_action :authenticate_user! def new - @organization = Organization.all - @entryControl = @organization.entry_controls.build + @organization = Organization.find(params[:searchbox]) + @entryControl = @organization.entry_controls.build end @@ -25,7 +25,8 @@ def show end def index - #@batches = @entry.batches + @organization = Organization.all + diff --git a/app/views/entry_controls/index.html.erb b/app/views/entry_controls/index.html.erb index ff48627..04f0ae6 100644 --- a/app/views/entry_controls/index.html.erb +++ b/app/views/entry_controls/index.html.erb @@ -9,65 +9,22 @@

    Control de ingreso

    -
    - -
    -
    - - -
    - -
    - - -
    -
    - - -
    - -
    - - -
    -
    - - -
    -
    - - -
    + <%= form_for [@organization, @entryControl] do |f| %> + +

    + <%= f.label :organization_id, "Organizacion" %> + <%= f.collection_select :organization_id, @organization, :id, :name, class:"dropdown-button btn" %> +

    -
    - - -
    -
    - -

    - - -

    -
    -
    - - -
    + +

    + <%= link_to "Regresar", organizations_path , class: "btn btn-primary"%> + <%= f.submit "Aceptar", class:"btn btn-default btn-lg" %> +

    + <% end %> + - <%= link_to "Cancelar", '/entry_controls' , class: "btn btn-primary"%> + diff --git a/app/views/entry_controls/new.html.erb b/app/views/entry_controls/new.html.erb index 6057607..682cf29 100755 --- a/app/views/entry_controls/new.html.erb +++ b/app/views/entry_controls/new.html.erb @@ -9,10 +9,8 @@ -

    - Cooperativa: - <%= @organization.name %> -

    + +
    <%= f.label :entry_number, "Número de hoja de ingreso" %> diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index 899bd37..f338676 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -7,7 +7,8 @@

    Control de ingreso

    - Organización: Testing! + Organización: + <%= Organization.find(@entry.organization_id).name%>

    diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 3d87210..be158b7 100755 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -28,7 +28,7 @@ <% if not current_user.admin_role %> <% if current_user.warehouse_role %>

  • archiveBodega
  • -
  • <%= link_to 'Control de ingreso', '/entry_controls', class:"white-text li-back"%>
  • +
  • <%= link_to 'Control de ingreso', organizations_path, class:"white-text li-back"%>
  • <% if Notification.where(kind: 3, read: false).count == 1 %> <%= Notification.where(kind: 3, read: false).count %> <% elsif Notification.where(kind: 3, read: false).count > 1 %> @@ -189,7 +189,7 @@ <% if not current_user.admin_role %> <% if current_user.warehouse_role %>
  • archiveBodega
  • -
  • <%= link_to 'Control de ingreso','/entry_controls', class:"white-text li-back"%>
  • +
  • <%= link_to 'Control de ingreso',organizations_path, class:"white-text li-back"%>
  • <% if Notification.where(kind: 3, read: false).count == 1 %> <%= Notification.where(kind: 3, read: false).count %> <% elsif Notification.where(kind: 3, read: false).count > 1 %> diff --git a/app/views/organizations/index.html.erb b/app/views/organizations/index.html.erb index 00b42a6..0281e17 100644 --- a/app/views/organizations/index.html.erb +++ b/app/views/organizations/index.html.erb @@ -6,29 +6,20 @@ - -
    - - - - - - - - - <% @organizations.each do |organization| %> - - - - <% if current_user.warehouse_role %> - - <% else %> - - <% end %> - - <% end %> - -
    CódigoNombre
    <%= organization.code %><%= organization.name %><%= link_to "Nuevo control de ingreso", new_organization_entry_control_path(organization) %><%= link_to "Controles de ingreso", organization %>
    + + + <%= form_tag({:controller => "entry_controls", :action => "new"}, :method => :get) do %> + +

    Organización: <%= select_tag "searchbox", options_from_collection_for_select(@organizations, :id, :name), id:"or"%>

    + +
    + <%= submit_tag "Aceptar", :name => nil, class:"btn btn-default btn-lg" %> + <%= link_to "Limpiar", '/organizations' , class: "btn btn-primary"%> + + + <% end %> + + @@ -67,3 +58,20 @@ } } + + + \ No newline at end of file From d481bae6e42312b27b3c1f10e157407e96df8fb8 Mon Sep 17 00:00:00 2001 From: LourdesZamora Date: Wed, 27 Jun 2018 12:06:00 -0600 Subject: [PATCH 021/112] Mostrar lista de controles de ingreso --- app/views/layouts/application.html.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 51815a9..5f174cd 100755 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -34,6 +34,7 @@ <% elsif Notification.where(kind: 3, read: false).count > 1 %> <%= Notification.where(kind: 3, read: false).count %> <% end %> +
  • <%= link_to 'Controles de Ingreso', "/quality_controls",class:"white-text li-back"%>
  • <%= link_to 'Mover lotes', batches_moveBatches_path,class:"white-text li-back"%>
  • <% end %> <% if current_user.quality_manager_role %> @@ -195,6 +196,7 @@ <% elsif Notification.where(kind: 3, read: false).count > 1 %> <%= Notification.where(kind: 3, read: false).count %> <% end %> +
  • <%= link_to 'Controles de Ingreso', "/quality_controls",class:"white-text li-back"%>
  • <%= link_to 'Mover lotes', batches_moveBatches_path,class:"white-text li-back"%>
  • <% end %> <% if current_user.quality_manager_role %> From 4bfc433a55e8d51c58a05b8f75c388bc90750d26 Mon Sep 17 00:00:00 2001 From: Alex Bono Date: Wed, 27 Jun 2018 13:22:02 -0600 Subject: [PATCH 022/112] agregado la columna de convertir de libras a kg --- app/views/entry_controls/show.html.erb | 4 +++- app/views/inventories/index.html.erb | 23 +++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index fcd08e0..b4e2035 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -31,7 +31,8 @@ Cantidad de sacos - Peso + Peso en Libras + Peso en Kilogramos Código de identificación Tipo de cacao Material genético @@ -45,6 +46,7 @@ <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index 0c4a00e..d38cb8c 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -142,13 +142,14 @@ Cantidad de sacos - Peso + Peso LB + Peso KG Código de lote Tipo de cacao Variedad Certificado Organización - + <% @entries.each do |entry| %> @@ -160,6 +161,9 @@ <% if params[:certificate] == "" %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -169,6 +173,7 @@ <% if batch.certificatetype == params[:certificate].to_i %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -181,6 +186,7 @@ <% if params[:certificate] == "" %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -190,6 +196,7 @@ <% if batch.certificatetype == params[:certificate].to_i %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -205,6 +212,7 @@ <% if params[:certificate] == "" %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -214,6 +222,7 @@ <% if batch.certificatetype == params[:certificate].to_i %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -226,6 +235,7 @@ <% if params[:certificate] == "" %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -235,6 +245,7 @@ <% if batch.certificatetype == params[:certificate].to_i %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -253,6 +264,7 @@ <% if params[:certificate] == "" %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -262,6 +274,7 @@ <% if batch.certificatetype == params[:certificate].to_i %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -274,6 +287,7 @@ <% if params[:certificate] == "" %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -283,6 +297,7 @@ <% if batch.certificatetype == params[:certificate].to_i %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -298,6 +313,7 @@ <% if params[:certificate] == "" %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -307,6 +323,7 @@ <% if batch.certificatetype == params[:certificate].to_i %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -319,6 +336,7 @@ <% if params[:certificate] == "" %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> @@ -328,6 +346,7 @@ <% if batch.certificatetype == params[:certificate].to_i %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %> From e13816ac4b18f32d431309db8761fc0c26b3f479 Mon Sep 17 00:00:00 2001 From: Francis Villalobos Date: Wed, 27 Jun 2018 14:17:25 -0600 Subject: [PATCH 023/112] Graficas --- app/controllers/batches_controller.rb | 2 +- app/controllers/quality_controls_controller.rb | 6 +++--- app/controllers/sensory_analyses_controller.rb | 2 +- app/views/batches/edit.html.erb | 14 +++++++++++++- app/views/batches/new.html.erb | 7 ++++++- app/views/entry_controls/show.html.erb | 2 +- app/views/quality_controls/show.html.erb | 10 +++++----- app/views/sensory_analyses/new.html.erb | 5 +++-- ...180625034016_add_samples_to_sensory_analysis.rb | 5 +++++ .../20180627133812_add_samples_to_batches.rb | 5 +++++ db/schema.rb | 4 +++- 11 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 db/migrate/20180625034016_add_samples_to_sensory_analysis.rb create mode 100644 db/migrate/20180627133812_add_samples_to_batches.rb diff --git a/app/controllers/batches_controller.rb b/app/controllers/batches_controller.rb index 9b27c6a..278d33b 100644 --- a/app/controllers/batches_controller.rb +++ b/app/controllers/batches_controller.rb @@ -71,7 +71,7 @@ def show private def batches_params - params.require(:batch).permit(:sackAmount, :weight, :enterCode, :certificatetype, :postharvestCenter, :cocoaType, :geneticMaterial, :ft) + params.require(:batch).permit(:sackAmount, :weight, :enterCode, :certificatetype, :postharvestCenter, :cocoaType, :geneticMaterial, :ft, :samples) end def createNotification diff --git a/app/controllers/quality_controls_controller.rb b/app/controllers/quality_controls_controller.rb index ddb5627..f270407 100644 --- a/app/controllers/quality_controls_controller.rb +++ b/app/controllers/quality_controls_controller.rb @@ -61,7 +61,7 @@ def show private def quality_params - params.require(:quality_control).permit(:code, :final_code, :cut_at, :f_harvest, :s_harvest, :trinitary, :outsider, :observation, :made_by) + params.require(:quality_control).permit(:code, :final_code, :cut_at, :f_harvest, :s_harvest, :trinitary, :outsider, :observation, :made_by, :samples) end def defineResult(batch) @@ -141,8 +141,8 @@ def dataValues(batch) category.parameters.order(:place).each do |parameter| if parameter.acceptance == nil if parameter.category.place = 4 - if category.runs = 1 - value = Result.where(parameter_id: parameter.id, batch_id: batch.id, run: 1).first.score + if category.runs >= 1 + value = Result.where(parameter_id: parameter.id, batch_id: @batch.id).sum(:score)/3 data.append(value) end end diff --git a/app/controllers/sensory_analyses_controller.rb b/app/controllers/sensory_analyses_controller.rb index 34d9c78..1afb1df 100644 --- a/app/controllers/sensory_analyses_controller.rb +++ b/app/controllers/sensory_analyses_controller.rb @@ -31,7 +31,7 @@ def create private def sensory_params - params.require(:sensory_analysis).permit(:observation, :made_by) + params.require(:sensory_analysis).permit(:observation, :made_by, :samples) end def createNotification(batch) diff --git a/app/views/batches/edit.html.erb b/app/views/batches/edit.html.erb index 4d1a5ba..f23ba4d 100644 --- a/app/views/batches/edit.html.erb +++ b/app/views/batches/edit.html.erb @@ -7,16 +7,22 @@

    Lote

    <%= form_for [@batch] do |f| %> + <% if current_user.warehouse_role || current_user.admin_role %>
    <%= f.label :sackAmount, "Cantidad de sacos" %> <%= f.number_field :sackAmount, min: 0 , :required => true %> -
    +
    <%= f.label :weight, "Peso en libras" %> <%= f.number_field :weight, step: :any, min: 0 , :required => true %>
    +
    + <%= f.label :samples, "Número de Muestras" %> + <%= f.number_field :samples, step: :any, min: 0 %> +
    +
    <%= f.label :enterCode, "Código de indentificación" %> <%= f.text_field :enterCode , :required => true %> @@ -36,6 +42,12 @@ <%= f.check_box :ft %> <%= f.label 'ft', "Comercio justo" %>
    + <% else %> +
    + <%= f.label :samples, "Número de Muestras" %> + <%= f.number_field :samples, step: :any, min: 0 %> +
    + <% end %>

    diff --git a/app/views/batches/new.html.erb b/app/views/batches/new.html.erb index be2d719..755d207 100644 --- a/app/views/batches/new.html.erb +++ b/app/views/batches/new.html.erb @@ -15,7 +15,12 @@

    <%= f.label :weight, "Peso en libras" %> <%= f.number_field :weight, step: :any, min: 0 , :required => true %> -
    + + +
    + <%= f.label :samples, "Número de Muestras" %> + <%= f.number_field :samples, step: :any, min: 0 , :required => true %> +
    <%= f.label :postharvestCenter, "Centro de poscosecha" %> diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index a8797d0..8633430 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -53,7 +53,7 @@ <%= GeneticMaterial.find(batch.geneticMaterial).name %> - <% if current_user.warehouse_role || current_user.admin_role %> + <% if current_user.warehouse_role || current_user.admin_role || current_user.quality_role%> <%= link_to 'Editar', edit_batch_path(batch) %> <% end %> <% if current_user.quality_role && QualityControl.where(batch_id: batch.id).blank? %> diff --git a/app/views/quality_controls/show.html.erb b/app/views/quality_controls/show.html.erb index 67e9e90..b650085 100644 --- a/app/views/quality_controls/show.html.erb +++ b/app/views/quality_controls/show.html.erb @@ -140,12 +140,12 @@ <%= category.name %> - <% (1..category.runs).each do |i| %> + <% (1..@batch.samples.to_i).each do |i| %> <%= i %> <% end %> - <% if category.runs > 1 %> + <% if @batch.samples.to_i > 1 %> Resultado promedio <% end %> @@ -154,8 +154,8 @@ <%= parameter.name %> - <% if category.runs > 1 %> - <% (1..category.runs).each do |i| %> + <% if @batch.samples.to_i > 1 %> + <% (1..@batch.samples.to_i).each do |i| %> <%= number_with_precision(Result.where(parameter_id: parameter.id, batch_id: @batch.id, run: i).first.score,precision: 0) %> @@ -166,7 +166,7 @@ <%= parameter.unit %> <% end %> - <% if category.runs > 1 %> + <% if @batch.samples.to_i > 1 %> <%= number_with_precision(Result.where(parameter_id: parameter.id, batch_id: @batch.id).sum(:score)/3, precision: 2) %>% <% end %> diff --git a/app/views/sensory_analyses/new.html.erb b/app/views/sensory_analyses/new.html.erb index 1edc98c..8a83d14 100644 --- a/app/views/sensory_analyses/new.html.erb +++ b/app/views/sensory_analyses/new.html.erb @@ -26,6 +26,7 @@ <%= f.text_field :made_by, :required => true%>
    +
    • @@ -39,7 +40,7 @@ <%= category.name %> - <% (1..category.runs).each do |i| %> + <% (1..@batch.samples).each do |i| %> <%= i %> @@ -52,7 +53,7 @@ <%= parameter.name %> <%= fields_for 'results[]', Result.new do |r| %> - <% (1..category.runs).each do |i| %> + <% (1..@batch.samples).each do |i| %> <%= r.hidden_field :parameter_id, :value => parameter.id %> <%= r.hidden_field :run, :value => i %> diff --git a/db/migrate/20180625034016_add_samples_to_sensory_analysis.rb b/db/migrate/20180625034016_add_samples_to_sensory_analysis.rb new file mode 100644 index 0000000..4c97d7e --- /dev/null +++ b/db/migrate/20180625034016_add_samples_to_sensory_analysis.rb @@ -0,0 +1,5 @@ +class AddSamplesToSensoryAnalysis < ActiveRecord::Migration[5.1] + def change + add_column :sensory_analyses, :samples, :integer + end +end diff --git a/db/migrate/20180627133812_add_samples_to_batches.rb b/db/migrate/20180627133812_add_samples_to_batches.rb new file mode 100644 index 0000000..e79838d --- /dev/null +++ b/db/migrate/20180627133812_add_samples_to_batches.rb @@ -0,0 +1,5 @@ +class AddSamplesToBatches < ActiveRecord::Migration[5.1] + def change + add_column :batches, :samples, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 1256b28..a82ad34 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180614012904) do +ActiveRecord::Schema.define(version: 20180627133812) do create_table "acceptances", force: :cascade do |t| t.decimal "max_qualityA" @@ -51,6 +51,7 @@ t.integer "organizationId" t.string "receivedBy" t.string "deliveredBy" + t.integer "samples" t.index ["entry_control_id"], name: "index_batches_on_entry_control_id" end @@ -255,6 +256,7 @@ t.integer "batch_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.integer "samples" t.index ["batch_id"], name: "index_sensory_analyses_on_batch_id" end From 258163bd59523d29a18e2af0a57f690574792cc9 Mon Sep 17 00:00:00 2001 From: Francis Villalobos Date: Wed, 27 Jun 2018 14:50:15 -0600 Subject: [PATCH 024/112] Nada --- app/assets/javascripts/inventories.coffee | 3 + app/assets/stylesheets/inventories.scss | 3 + app/assets/stylesheets/reports.scss | 1 + app/controllers/entry_controls_controller.rb | 16 +- app/controllers/filechecklists_controller.rb | 4 + app/controllers/inventories_controller.rb | 17 + app/controllers/organizations_controller.rb | 2 + app/helpers/inventories_helper.rb | 2 + app/views/batches/show.html.erb | 26 +- app/views/entry_controls/index.html.erb | 42 ++ app/views/entry_controls/new.html.erb | 6 +- app/views/entry_controls/show.html.erb | 7 +- app/views/filechecklists/edit.html.erb | 8 +- app/views/filechecklists/show.html.erb | 47 ++ app/views/inventories/index.html.erb | 403 ++++++++++++++++++ app/views/inventories/pdf.pdf.erb | 99 +++++ app/views/layouts/application.html.erb | 5 +- app/views/organizations/index.html.erb | 54 ++- app/views/reports/pdf.pdf.erb | 2 +- config/routes.rb | 5 + db/seeds.rb | 6 +- .../inventories_controller_test.rb | 9 + 22 files changed, 710 insertions(+), 57 deletions(-) create mode 100644 app/assets/javascripts/inventories.coffee create mode 100644 app/assets/stylesheets/inventories.scss create mode 100644 app/controllers/inventories_controller.rb create mode 100644 app/helpers/inventories_helper.rb create mode 100644 app/views/entry_controls/index.html.erb create mode 100644 app/views/filechecklists/show.html.erb create mode 100644 app/views/inventories/index.html.erb create mode 100644 app/views/inventories/pdf.pdf.erb create mode 100644 test/controllers/inventories_controller_test.rb diff --git a/app/assets/javascripts/inventories.coffee b/app/assets/javascripts/inventories.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/inventories.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/inventories.scss b/app/assets/stylesheets/inventories.scss new file mode 100644 index 0000000..19fcaa6 --- /dev/null +++ b/app/assets/stylesheets/inventories.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Inventories controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/reports.scss b/app/assets/stylesheets/reports.scss index 6ef9018..266c4d5 100644 --- a/app/assets/stylesheets/reports.scss +++ b/app/assets/stylesheets/reports.scss @@ -1,3 +1,4 @@ // Place all the styles related to the reports controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ + diff --git a/app/controllers/entry_controls_controller.rb b/app/controllers/entry_controls_controller.rb index 1df6a53..2314c86 100755 --- a/app/controllers/entry_controls_controller.rb +++ b/app/controllers/entry_controls_controller.rb @@ -1,10 +1,12 @@ class EntryControlsController < ApplicationController before_action :authenticate_user! def new - @organization = Organization.find(params[:organization_id]) - @entryControl = @organization.entry_controls.build + @organization = Organization.find(params[:searchbox]) + @entryControl = @organization.entry_controls.build end + + def create organization = Organization.find(params[:organization_id]) entryControl = organization.entry_controls.build(entryControl_params) @@ -19,8 +21,18 @@ def create def show @entry = EntryControl.find(params[:id]) @batches = @entry.batches + end + def index + @organization = Organization.all + + + + + end + + private def entryControl_params params.require(:entry_control).permit(:entryDate, :exchangeRate, :receivedBy, :deliveredBy,:entry_number) diff --git a/app/controllers/filechecklists_controller.rb b/app/controllers/filechecklists_controller.rb index eb309ca..8761eef 100644 --- a/app/controllers/filechecklists_controller.rb +++ b/app/controllers/filechecklists_controller.rb @@ -32,6 +32,10 @@ def update end end + def show + @checklist = Filechecklist.find(params[:id]) + end + def set_everything @checklist = Filechecklist.find(params[:id]) if @checklist.referralSheet & @checklist.inspectionSheet & @checklist.embacingControl & @checklist.producersList & @checklist.collectionCleaningControl & @checklist.warehouseEntrySheet & @checklist.billCopy diff --git a/app/controllers/inventories_controller.rb b/app/controllers/inventories_controller.rb new file mode 100644 index 0000000..e5dadb9 --- /dev/null +++ b/app/controllers/inventories_controller.rb @@ -0,0 +1,17 @@ +class InventoriesController < ApplicationController + before_action :authenticate_user! + def index + @entries = EntryControl.search(params[:searchbox].to_s, params[:from].to_s,params[:to].to_s) + part1 = request.original_url.to_s.split("?")[0] + part2 = request.original_url.to_s.split("?")[1] + @new_url = part1 + ".pdf" + if part2 != nil + @new_url = @new_url + "?" + part2 + end + respond_to do |format| + format.html + format.pdf {render template: 'inventories/pdf', pdf: 'pdf'} + end + end + +end \ No newline at end of file diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 45733e2..7d5053d 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -4,6 +4,8 @@ def index @organizations = Organization.all end + + def show organization = Organization.find(params[:id]) @entries = organization.entry_controls diff --git a/app/helpers/inventories_helper.rb b/app/helpers/inventories_helper.rb new file mode 100644 index 0000000..a6ee519 --- /dev/null +++ b/app/helpers/inventories_helper.rb @@ -0,0 +1,2 @@ +module InventoriesHelper +end diff --git a/app/views/batches/show.html.erb b/app/views/batches/show.html.erb index 8b21385..c253b83 100644 --- a/app/views/batches/show.html.erb +++ b/app/views/batches/show.html.erb @@ -21,27 +21,11 @@

      - DOCUMENTOS - - - - - - - - - <% @batch.entry_control.documents.each do |doc| %> - - - - <% end %> - -
      Nombre del archivo
      - <%=doc.title%> - - <%= link_to "Descargar archivo", doc.ec_data.url(:original, false) %> - -
      + <% if @batch.entry_control.filechecklists.empty? %> + <%= link_to "Verificar documentos", new_entry_control_filechecklist_path(@batch.entry_control), class:"waves-effect waves-light btn" %> + <% else %> + <%= link_to "Verificar documentos", filechecklist_path(@batch.entry_control.filechecklists.first), class:"waves-effect waves-light btn" %> + <% end %>
      <%= link_to "Regresar", checkings_path , class: "btn btn-primary"%> Determinar diff --git a/app/views/entry_controls/index.html.erb b/app/views/entry_controls/index.html.erb new file mode 100644 index 0000000..04f0ae6 --- /dev/null +++ b/app/views/entry_controls/index.html.erb @@ -0,0 +1,42 @@ + +
      +
      +
      +
      +
      + + + + <%= form_for [@organization, @entryControl] do |f| %> + +

      + <%= f.label :organization_id, "Organizacion" %> + <%= f.collection_select :organization_id, @organization, :id, :name, class:"dropdown-button btn" %> +

      + + +

      + <%= link_to "Regresar", organizations_path , class: "btn btn-primary"%> + <%= f.submit "Aceptar", class:"btn btn-default btn-lg" %> +

      + <% end %> + + + + + + + + + + + + + +
      +
      +
      +
      +
      \ No newline at end of file diff --git a/app/views/entry_controls/new.html.erb b/app/views/entry_controls/new.html.erb index 6057607..682cf29 100755 --- a/app/views/entry_controls/new.html.erb +++ b/app/views/entry_controls/new.html.erb @@ -9,10 +9,8 @@ -

      - Cooperativa: - <%= @organization.name %> -

      + +
      <%= f.label :entry_number, "Número de hoja de ingreso" %> diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index 8633430..7a8b2b4 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -8,7 +8,8 @@

      Organización: - <%= Organization.find(@entry.organization_id).name %> + <%= Organization.find(@entry.organization_id).name%> +

      Recibido por: @@ -30,7 +31,8 @@ Cantidad de sacos - Peso + Peso en Libras + Peso en Kilogramos Código de identificación Tipo de cacao Material genético @@ -44,6 +46,7 @@ <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg <%= batch.enterCode %> diff --git a/app/views/filechecklists/edit.html.erb b/app/views/filechecklists/edit.html.erb index ea5cc20..ba63776 100644 --- a/app/views/filechecklists/edit.html.erb +++ b/app/views/filechecklists/edit.html.erb @@ -36,8 +36,12 @@


      - <%= link_to "Regresar", @checklist.entry_control , class: "btn btn-primary"%> - <%= f.submit "Guardar", class:"btn btn-default btn-lg" %> + <% if current_user.certification_role %> + <%= link_to "Regresar", :back , class: "btn btn-primary"%> + <% else %> + <%= link_to "Regresar", @checklist.entry_control , class: "btn btn-primary"%> + <%= f.submit "Guardar", class:"btn btn-default btn-lg" %> + <% end %>
      <% end %> diff --git a/app/views/filechecklists/show.html.erb b/app/views/filechecklists/show.html.erb new file mode 100644 index 0000000..3d8c493 --- /dev/null +++ b/app/views/filechecklists/show.html.erb @@ -0,0 +1,47 @@ +
      +
      +
      +
      +
      + +
      +
      +
      +
      +
      \ No newline at end of file diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb new file mode 100644 index 0000000..d38cb8c --- /dev/null +++ b/app/views/inventories/index.html.erb @@ -0,0 +1,403 @@ +
      +
      +
      +
      +
      + + +
        +
      • +
        + chrome_reader_mode + FILTROS +
        +
        + <%= form_tag({:controller => "inventories", :action => "index"}, :method => :get) do %> + +

        Organización: <%= select_tag "searchbox", options_from_collection_for_select(Organization.all, :name, :name), :include_blank => 'TODOS' %>

        + +

        Desde: <%= text_field_tag "from", params[:from], type:"date", class:"datepicker" %>

        + +

        Hasta: <%= text_field_tag "to", params[:to], type:"date", class:"datepicker" %>

        + +

        Calidad: <%= select_tag :quality, options_for_select([["A", 1], ["B", 2] , ["C", 3]], params[:quality]), id: "different_option_value_html" ,:include_blank => 'TODOS'%>

        + +

        Certificado: <%= select_tag :certificate, options_for_select([["E", 1], ["T", 2] , ["C", 3]], params[:certificate]), id: "different_option_value_html2" ,:include_blank => 'TODOS'%>

        + +

        Variedad: <%= select_tag :variety, options_for_select([["HT", 1], ["IA", 2]], params[:variety]), id: "different_option_value_html3" ,:include_blank => 'TODOS'%>

        +
        +
        +

        + <%= check_box_tag(:ft, params[:ft]) %> + <%= label_tag(:ft, "Comercio justo") %> +

        +
        +
        +

        + <%= check_box_tag(:purchase, params[:purchase], false ,disabled: true) %> + <%= label_tag(:purchase, "Comprado") %> +

        +
        +
        +
        + <%= submit_tag "Generar", :name => nil, class:"btn btn-default btn-lg" %> + <%= button_tag "Limpiar", :name => nil, class:"btn btn-default btn-lg", id:"reset" %> + <% end %> + +
        +
      • +
      + +
      +
      +
      +

      Calidad: + <% if params[:quality]=="" %> + TODAS + <%else%> + <% if params[:quality]==nil %> + + <%else%> + <%= CocoaType.find(params[:quality]).name%> + <%end%> + <%end%> +

      + +

      Certificado: + <% if params[:certificate]=="" %> + TODOS + <%else%> + <% if params[:certificate]==nil %> + + <%else%> + <%= CertificateType.find(params[:certificate]).name%> + <%end%> + <%end%> +

      + +

      Variedad: + <% if params[:variety]=="" %> + TODAS + <%else%> + <% if params[:variety]==nil %> + + <%else%> + <%= GeneticMaterial.find(params[:variety]).name%> + <%end%> + <%end%> +

      + + +
      +
      +
      +
      + +

      Organización: + <% if params[:searchbox]=="" %> + TODAS + <%else%> + <% if params[:searchbox]==nil %> + + <%else%> + <%= params[:searchbox].to_s%> + <%end%> + <%end%> +

      + +

      Comercio justo: + <% if params[:ft].to_s != "on" %> + No + <%else%> + Si + <%end%> +

      + +

      Comprado: + <% if params[:purchase].to_s != "on" %> + No + <%else%> + Si + <%end%> +

      +
      +
      +
      +
      +
      +
      +

      + Cantidad de lotes en bodega: + <%= Batch.all.count %> +

      + +

      +
      +
      + + + + + + + + + + + + + + + + + <% @entries.each do |entry| %> + <% entry.batches.each do |batch| %> + + <% if params[:ft].to_s == "on" && batch.ft%> + <% if params[:variety] == "" %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if batch.geneticMaterial== params[:variety].to_i %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if !(batch.ft) %> + <% if params[:variety] == "" %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if batch.geneticMaterial== params[:variety].to_i %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + + <% end %> + <% end %> + +
      Cantidad de sacosPeso LBPeso KGCódigo de loteTipo de cacaoVariedadCertificadoOrganización
      <%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %>
      +
      +
      +
      +
      +
      +
      + + + + + + + + + diff --git a/app/views/inventories/pdf.pdf.erb b/app/views/inventories/pdf.pdf.erb new file mode 100644 index 0000000..4a98daa --- /dev/null +++ b/app/views/inventories/pdf.pdf.erb @@ -0,0 +1,99 @@ + + + + + <%= wicked_pdf_stylesheet_link_tag "pdf" %> + + +
      +

      Chocolats Halba

      +

      Reporte

      +
      + + + + + + + + + + + + + <% @entries.each do |entry| %> + <% entry.batches.each do |batch| %> + <% if batch.quality_control != nil %> + <% if batch.quality_control.revision != nil %> + + <% if params[:purchased].to_s != "on" && params[:quality] == "" %> + <% if batch.purchase == nil %> + + + + + + + <% end %> + <% end %> + <% if params[:purchased].to_s == "on" && params[:quality] == "" %> + <% if batch.purchase != nil %> + <% if batch.purchase.decision == 1 %> + + + + + + <% if params[:searchbox] == "" %> + + <% end %> + <% end %> + <% end %> + <% end %> + <% if params[:purchased].to_s != "on" && params[:quality] != "" %> + <% if batch.quality_control != nil %> + <% if batch.quality_control.revision != nil %> + <% if batch.quality_control.revision.status == params[:quality].to_i %> + <% if batch.purchase == nil %> + + + + + + <% if params[:searchbox] == "" %> + + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% if params[:purchased].to_s == "on" && params[:quality] != "" %> + <% if batch.quality_control != nil %> + <% if batch.quality_control.revision != nil %> + <% if batch.quality_control.revision.status == params[:quality].to_i %> + <% if batch.purchase != nil %> + <% if batch.purchase.decision == 1 %> + + + + + + <% if params[:searchbox] == "" %> + + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + + <% end %> + <% end %> + <% end %> + <% end %> + +
      Cant. sacosPesoIdentificacionTipo de cacaoMaterial geneticoOrganizacion
      <%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.quality_control.revision.status).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.quality_control.revision.status).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.quality_control.revision.status).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.quality_control.revision.status).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.entry_control.organization.name %>
      + +
      \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 51815a9..22d150c 100755 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -28,6 +28,7 @@ <% if not current_user.admin_role %> <% if current_user.warehouse_role %>
    • archiveBodega
    • +
    • <%= link_to 'Inventario', inventories_path , class:"white-text li-back"%>
    • <%= link_to 'Control de ingreso', organizations_path, class:"white-text li-back"%>
    • <% if Notification.where(kind: 3, read: false).count == 1 %> <%= Notification.where(kind: 3, read: false).count %> @@ -35,6 +36,7 @@ <%= Notification.where(kind: 3, read: false).count %> <% end %>
    • <%= link_to 'Mover lotes', batches_moveBatches_path,class:"white-text li-back"%>
    • + <% end %> <% if current_user.quality_manager_role %>
    • assignment_indJefe de calidad
    • @@ -189,13 +191,14 @@ <% if not current_user.admin_role %> <% if current_user.warehouse_role %>
    • archiveBodega
    • -
    • <%= link_to 'Control de ingreso', organizations_path, class:"white-text li-back"%>
    • +
    • <%= link_to 'Control de ingreso',organizations_path, class:"white-text li-back"%>
    • <% if Notification.where(kind: 3, read: false).count == 1 %> <%= Notification.where(kind: 3, read: false).count %> <% elsif Notification.where(kind: 3, read: false).count > 1 %> <%= Notification.where(kind: 3, read: false).count %> <% end %>
    • <%= link_to 'Mover lotes', batches_moveBatches_path,class:"white-text li-back"%>
    • +
    • <%= link_to 'Inventario', inventories_path , class:"white-text li-back"%>
    • <% end %> <% if current_user.quality_manager_role %>
    • assignment_indJefe de calidad
    • diff --git a/app/views/organizations/index.html.erb b/app/views/organizations/index.html.erb index 00b42a6..0281e17 100644 --- a/app/views/organizations/index.html.erb +++ b/app/views/organizations/index.html.erb @@ -6,29 +6,20 @@ - - - - - - - - - - - <% @organizations.each do |organization| %> - - - - <% if current_user.warehouse_role %> - - <% else %> - - <% end %> - - <% end %> - -
      CódigoNombre
      <%= organization.code %><%= organization.name %><%= link_to "Nuevo control de ingreso", new_organization_entry_control_path(organization) %><%= link_to "Controles de ingreso", organization %>
      + + + <%= form_tag({:controller => "entry_controls", :action => "new"}, :method => :get) do %> + +

      Organización: <%= select_tag "searchbox", options_from_collection_for_select(@organizations, :id, :name), id:"or"%>

      + +
      + <%= submit_tag "Aceptar", :name => nil, class:"btn btn-default btn-lg" %> + <%= link_to "Limpiar", '/organizations' , class: "btn btn-primary"%> + + + <% end %> + + @@ -67,3 +58,20 @@ } } + + + \ No newline at end of file diff --git a/app/views/reports/pdf.pdf.erb b/app/views/reports/pdf.pdf.erb index 9afc521..4a98daa 100644 --- a/app/views/reports/pdf.pdf.erb +++ b/app/views/reports/pdf.pdf.erb @@ -2,7 +2,7 @@ - <%= wicked_pdf_stylesheet_link_tag "application" %> + <%= wicked_pdf_stylesheet_link_tag "pdf" %>
      diff --git a/config/routes.rb b/config/routes.rb index f8ac39a..37950b0 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,10 +1,13 @@ Rails.application.routes.draw do + get 'inventories/index' + get 'export_batches/join' get 'export_batches/new' get 'reports/index'# + get 'inventories/index'# get 'purchases/index' @@ -32,6 +35,7 @@ resources :certificate_checks resources :purchases resources :reports + resources :inventories resources :static_pages resources :export_batches resources :documents @@ -42,6 +46,7 @@ resources :batches resources :reports resources :barcodes + resources :inventories end resources :batches do diff --git a/db/seeds.rb b/db/seeds.rb index c27550d..2886b41 100755 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -429,4 +429,8 @@ Archive.create! do |a| a.title = "Factura de venta" end -=end \ No newline at end of file +<<<<<<< HEAD +=end +======= +=end +>>>>>>> origin/Esther diff --git a/test/controllers/inventories_controller_test.rb b/test/controllers/inventories_controller_test.rb new file mode 100644 index 0000000..bc23a8e --- /dev/null +++ b/test/controllers/inventories_controller_test.rb @@ -0,0 +1,9 @@ +require 'test_helper' + +class InventoriesControllerTest < ActionDispatch::IntegrationTest + test "should get index" do + get inventories_index_url + assert_response :success + end + +end From 6de6c837d2de1762d6002ce5ef855679a7f6d33d Mon Sep 17 00:00:00 2001 From: Francis Villalobos Date: Wed, 27 Jun 2018 15:06:01 -0600 Subject: [PATCH 025/112] Final changes --- app/views/entry_controls/new.html.erb | 1 + app/views/entry_controls/show.html.erb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/views/entry_controls/new.html.erb b/app/views/entry_controls/new.html.erb index 682cf29..e1dc5b6 100755 --- a/app/views/entry_controls/new.html.erb +++ b/app/views/entry_controls/new.html.erb @@ -26,6 +26,7 @@ <%= f.label :deliveredBy, "Entregado por" %> <%= f.text_field :deliveredBy, :required => true %> +

      <%= link_to "Regresar", organizations_path , class: "btn btn-primary"%> diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index 7a8b2b4..af6b83c 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -19,6 +19,7 @@ Entregado por: <%= @entry.deliveredBy %>

      +
      • From 337b661abac6b0b6d453b5a4d2b905d120548161 Mon Sep 17 00:00:00 2001 From: Francis Villalobos Date: Wed, 18 Jul 2018 12:50:56 -0600 Subject: [PATCH 026/112] Update seeds.rb Fixed seeds.rb error --- db/seeds.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 2886b41..c72ee41 100755 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -429,8 +429,4 @@ Archive.create! do |a| a.title = "Factura de venta" end -<<<<<<< HEAD =end -======= -=end ->>>>>>> origin/Esther From 83ef27c335a10a01315cbc4bb44718d54c82604f Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 18 Jul 2018 13:03:43 -0700 Subject: [PATCH 027/112] Seed.rb fixed --- db/seeds.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 2886b41..8f69edb 100755 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,4 +1,3 @@ -=begin User.create! do |u| u.email = 'warehouse' u.password = 'warehouse' @@ -62,7 +61,7 @@ CocoaType.create do |c| c.name = 'C' end -=end + CertificateType.create do |ct| ct.name= 'E' end @@ -74,7 +73,7 @@ CertificateType.create do |ct| ct.name= 'C' end -=begin + GeneticMaterial.create do |g| g.name = 'HT' end @@ -428,9 +427,4 @@ end Archive.create! do |a| a.title = "Factura de venta" -end -<<<<<<< HEAD -=end -======= -=end ->>>>>>> origin/Esther +end \ No newline at end of file From 6e1cddeda96bca3b3c69af7da6f0be24ed98cc58 Mon Sep 17 00:00:00 2001 From: Esther Date: Mon, 30 Jul 2018 17:44:39 -0600 Subject: [PATCH 028/112] Cerfitications now has permission on the filechecklist --- app/controllers/filechecklists_controller.rb | 6 +++++- app/views/batches/show.html.erb | 2 +- app/views/filechecklists/edit.html.erb | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/filechecklists_controller.rb b/app/controllers/filechecklists_controller.rb index 8761eef..416ce04 100644 --- a/app/controllers/filechecklists_controller.rb +++ b/app/controllers/filechecklists_controller.rb @@ -26,7 +26,11 @@ def edit def update checklist = Filechecklist.find(params[:id]) if checklist.update(checklist_params) - redirect_to checklist.entry_control, notice: "Guardado con éxito" + if current_user.certification_role + flash[:notice] = "Guardado" + else + redirect_to checklist.entry_control, notice: "Guardado con éxito" + end else render 'edit' end diff --git a/app/views/batches/show.html.erb b/app/views/batches/show.html.erb index c253b83..d4e4e64 100644 --- a/app/views/batches/show.html.erb +++ b/app/views/batches/show.html.erb @@ -24,7 +24,7 @@ <% if @batch.entry_control.filechecklists.empty? %> <%= link_to "Verificar documentos", new_entry_control_filechecklist_path(@batch.entry_control), class:"waves-effect waves-light btn" %> <% else %> - <%= link_to "Verificar documentos", filechecklist_path(@batch.entry_control.filechecklists.first), class:"waves-effect waves-light btn" %> + <%= link_to "Verificar documentos", edit_filechecklist_path(@batch.entry_control.filechecklists.first), class:"waves-effect waves-light btn" %> <% end %> <%= link_to "Regresar", checkings_path , class: "btn btn-primary"%> diff --git a/app/views/filechecklists/edit.html.erb b/app/views/filechecklists/edit.html.erb index ba63776..4d5ad7f 100644 --- a/app/views/filechecklists/edit.html.erb +++ b/app/views/filechecklists/edit.html.erb @@ -38,6 +38,7 @@
        <% if current_user.certification_role %> <%= link_to "Regresar", :back , class: "btn btn-primary"%> + <%= f.submit "Guardar", class:"btn btn-default btn-lg" %> <% else %> <%= link_to "Regresar", @checklist.entry_control , class: "btn btn-primary"%> <%= f.submit "Guardar", class:"btn btn-default btn-lg" %> From f501be903a8078bb18edb19e4b77323f6c18a708 Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 30 Jul 2018 16:45:39 -0700 Subject: [PATCH 029/112] El numero de muestras es unicamente editable por el area de quality. --- app/views/batches/edit.html.erb | 5 ----- app/views/batches/new.html.erb | 5 +---- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/views/batches/edit.html.erb b/app/views/batches/edit.html.erb index f23ba4d..e8a132b 100644 --- a/app/views/batches/edit.html.erb +++ b/app/views/batches/edit.html.erb @@ -18,11 +18,6 @@ <%= f.number_field :weight, step: :any, min: 0 , :required => true %>
        -
        - <%= f.label :samples, "Número de Muestras" %> - <%= f.number_field :samples, step: :any, min: 0 %> -
        -
        <%= f.label :enterCode, "Código de indentificación" %> <%= f.text_field :enterCode , :required => true %> diff --git a/app/views/batches/new.html.erb b/app/views/batches/new.html.erb index 755d207..23b3d33 100644 --- a/app/views/batches/new.html.erb +++ b/app/views/batches/new.html.erb @@ -17,10 +17,7 @@ <%= f.number_field :weight, step: :any, min: 0 , :required => true %>
        -
        - <%= f.label :samples, "Número de Muestras" %> - <%= f.number_field :samples, step: :any, min: 0 , :required => true %> -
        + <%= f.hidden_field :samples, step: :any, :value => 1, :required => true %>
        <%= f.label :postharvestCenter, "Centro de poscosecha" %> From 0af0a9a0f4fabaff5dc88a32d71daeaa5a8d406f Mon Sep 17 00:00:00 2001 From: christian-edgardo-rodriguez Date: Mon, 6 Aug 2018 11:30:02 -0600 Subject: [PATCH 030/112] elementos innecesarios eliminados --- app/views/quality_controls/new.html.erb | 42 ------------------------- 1 file changed, 42 deletions(-) diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index 1ce0408..889a963 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -37,48 +37,6 @@ DATOS GENERALES
        -
        - <%= f.label :code, "Número de hoja" %> - <%= f.text_field :code , :required => true%> -
        - -
        - - - - - - - - -
        - <%= f.check_box :f_harvest, :class=>"harvest" %> - <%= f.label 'f_harvest', "Primera cosecha" %> - - <%= f.check_box :s_harvest, :class=>"harvest" %> - <%= f.label 's_harvest', "Segunda cosecha" %> -
        -
        - -
        - - - - - - - - -
        - <%= f.check_box :trinitary, :class=>"variety" %> - <%= f.label 'trinitary', "Trinitario" %> - - <%= f.check_box :outsider, :class=>"variety" %> - <%= f.label 'outsider', "Forastero" %> -
        -
        - -
        <%= f.label :made_by, "Persona responsable" %> <%= f.text_field :made_by , :required => true%> From 4c26ce20bf4dcd3613f8f156a565270a5d7b9005 Mon Sep 17 00:00:00 2001 From: Esther Date: Tue, 7 Aug 2018 12:09:18 -0600 Subject: [PATCH 031/112] Filtro de comprado en el inventario --- app/views/inventories/index.html.erb | 216 ++++++++++++++++++++++++++- 1 file changed, 213 insertions(+), 3 deletions(-) diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index d38cb8c..e16b0c8 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -36,7 +36,7 @@

        - <%= check_box_tag(:purchase, params[:purchase], false ,disabled: true) %> + <%= check_box_tag(:purchase, params[:purchase]) %> <%= label_tag(:purchase, "Comprado") %>

        @@ -154,8 +154,9 @@ <% @entries.each do |entry| %> <% entry.batches.each do |batch| %> - - <% if params[:ft].to_s == "on" && batch.ft%> + + <% if params[:purchase].to_s == "on" && batch.purchase != nil %> + <% if params[:ft].to_s == "on" && batch.ft %> <% if params[:variety] == "" %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> @@ -359,6 +360,215 @@ <% end %> <% end %> <% end %> + <% end %> + <% else %> + <% if batch.purchase == nil %> + <% if params[:ft].to_s == "on" && batch.ft %> + <% if params[:variety] == "" %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if batch.geneticMaterial== params[:variety].to_i %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if !(batch.ft) %> + <% if params[:variety] == "" %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if batch.geneticMaterial== params[:variety].to_i %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> <% end %> <% end %> From 5b90cfc19066b7230f8853dfe08d4993a79c846c Mon Sep 17 00:00:00 2001 From: christian-edgardo-rodriguez Date: Wed, 8 Aug 2018 11:48:04 -0600 Subject: [PATCH 032/112] cambiado organizacion por proveedor (solo visual) --- app/views/batches/show.html.erb | 4 ++-- app/views/checkings/index.html.erb | 2 +- app/views/entry_controls/index.html.erb | 2 +- app/views/entry_controls/show.html.erb | 2 +- app/views/export_batches/show.html.erb | 2 +- app/views/inventories/index.html.erb | 6 +++--- app/views/inventories/pdf.pdf.erb | 2 +- app/views/organizations/index.html.erb | 4 ++-- app/views/purchases/index.html.erb | 2 +- app/views/purchases/new.html.erb | 2 +- app/views/quality_controls/index.html.erb | 2 +- app/views/reports/index.html.erb | 4 ++-- app/views/reports/pdf.pdf.erb | 2 +- app/views/static_pages/stages.html.erb | 2 +- app/views/static_pages/traceability.html.erb | 2 +- 15 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/views/batches/show.html.erb b/app/views/batches/show.html.erb index d4e4e64..6bdf333 100644 --- a/app/views/batches/show.html.erb +++ b/app/views/batches/show.html.erb @@ -13,7 +13,7 @@

        Control de ingreso: <%= @batch.entry_control.entry_number %>

        -

        Organización: +

        Proveedor: <%= @batch.entry_control.organization.name %>

        Fecha de ingreso: @@ -50,7 +50,7 @@ <%= @batch.enterCode %>

        - Organización: + Proveedor: <%= @batch.entry_control.organization.name %>

        diff --git a/app/views/checkings/index.html.erb b/app/views/checkings/index.html.erb index 6b0bb9f..c805ee4 100644 --- a/app/views/checkings/index.html.erb +++ b/app/views/checkings/index.html.erb @@ -10,7 +10,7 @@ Código de lote - Organización + Proveedor Fecha de ingreso diff --git a/app/views/entry_controls/index.html.erb b/app/views/entry_controls/index.html.erb index 04f0ae6..7b0ce26 100644 --- a/app/views/entry_controls/index.html.erb +++ b/app/views/entry_controls/index.html.erb @@ -12,7 +12,7 @@ <%= form_for [@organization, @entryControl] do |f| %>

        - <%= f.label :organization_id, "Organizacion" %> + <%= f.label :organization_id, "Proveedor" %> <%= f.collection_select :organization_id, @organization, :id, :name, class:"dropdown-button btn" %>

        diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index af6b83c..a40f682 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -7,7 +7,7 @@

        Control de ingreso

        - Organización: + Proveedor: <%= Organization.find(@entry.organization_id).name%>

        diff --git a/app/views/export_batches/show.html.erb b/app/views/export_batches/show.html.erb index 6c9dc24..f3b2b6f 100644 --- a/app/views/export_batches/show.html.erb +++ b/app/views/export_batches/show.html.erb @@ -10,7 +10,7 @@ Código de lote - Organización + Proveedor diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index e16b0c8..0926e74 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -16,7 +16,7 @@
        <%= form_tag({:controller => "inventories", :action => "index"}, :method => :get) do %> -

        Organización: <%= select_tag "searchbox", options_from_collection_for_select(Organization.all, :name, :name), :include_blank => 'TODOS' %>

        +

        Proveedor: <%= select_tag "searchbox", options_from_collection_for_select(Organization.all, :name, :name), :include_blank => 'TODOS' %>

        Desde: <%= text_field_tag "from", params[:from], type:"date", class:"datepicker" %>

        @@ -95,7 +95,7 @@
        -

        Organización: +

        Proveedor: <% if params[:searchbox]=="" %> TODAS <%else%> @@ -148,7 +148,7 @@ Tipo de cacao Variedad Certificado - Organización + Proveedor diff --git a/app/views/inventories/pdf.pdf.erb b/app/views/inventories/pdf.pdf.erb index 4a98daa..a468d1d 100644 --- a/app/views/inventories/pdf.pdf.erb +++ b/app/views/inventories/pdf.pdf.erb @@ -17,7 +17,7 @@ Identificacion Tipo de cacao Material genetico - Organizacion + Proveedor diff --git a/app/views/organizations/index.html.erb b/app/views/organizations/index.html.erb index 0281e17..66d2469 100644 --- a/app/views/organizations/index.html.erb +++ b/app/views/organizations/index.html.erb @@ -4,13 +4,13 @@

        <%= form_tag({:controller => "entry_controls", :action => "new"}, :method => :get) do %> -

        Organización: <%= select_tag "searchbox", options_from_collection_for_select(@organizations, :id, :name), id:"or"%>

        +

        Proveedor: <%= select_tag "searchbox", options_from_collection_for_select(@organizations, :id, :name), id:"or"%>


        <%= submit_tag "Aceptar", :name => nil, class:"btn btn-default btn-lg" %> diff --git a/app/views/purchases/index.html.erb b/app/views/purchases/index.html.erb index 1e6c8fe..0666517 100644 --- a/app/views/purchases/index.html.erb +++ b/app/views/purchases/index.html.erb @@ -11,7 +11,7 @@ Código de lote Control de Ingreso - Organización + Proveedor Fecha de Ingreso diff --git a/app/views/purchases/new.html.erb b/app/views/purchases/new.html.erb index 6dc5f4b..a06468d 100644 --- a/app/views/purchases/new.html.erb +++ b/app/views/purchases/new.html.erb @@ -8,7 +8,7 @@

        Código de lote: <%= @batch.enterCode %>

        Control de Ingreso: <%= @batch.entry_control.entry_number %>

        -

        Organización: <%= @batch.entry_control.organization.name %>

        +

        Proveedor: <%= @batch.entry_control.organization.name %>

        Fecha de Ingreso: <%= @batch.entry_control.entryDate %>

        Precio: L.<%= number_with_precision(Price.where(cocoa_type_id: @batch.quality_control.revision.status).first.price*@batch.weight, precision: 2) %>


        diff --git a/app/views/quality_controls/index.html.erb b/app/views/quality_controls/index.html.erb index 18114a8..b4dee9e 100644 --- a/app/views/quality_controls/index.html.erb +++ b/app/views/quality_controls/index.html.erb @@ -10,7 +10,7 @@ - + diff --git a/app/views/reports/index.html.erb b/app/views/reports/index.html.erb index 73eb275..67f0fef 100644 --- a/app/views/reports/index.html.erb +++ b/app/views/reports/index.html.erb @@ -8,7 +8,7 @@ <%= form_tag({:controller => "reports", :action => "index"}, :method => :get) do %> -

        Organización: <%= select_tag "searchbox", options_from_collection_for_select(Organization.all, :name, :name), :include_blank => 'TODOS' %>

        +

        Proveedor: <%= select_tag "searchbox", options_from_collection_for_select(Organization.all, :name, :name), :include_blank => 'TODOS' %>

        Desde: <%= text_field_tag "from", params[:from], type:"date", class:"datepicker" %>

        @@ -30,7 +30,7 @@ - + diff --git a/app/views/reports/pdf.pdf.erb b/app/views/reports/pdf.pdf.erb index 4a98daa..a468d1d 100644 --- a/app/views/reports/pdf.pdf.erb +++ b/app/views/reports/pdf.pdf.erb @@ -17,7 +17,7 @@ - + diff --git a/app/views/static_pages/stages.html.erb b/app/views/static_pages/stages.html.erb index a3d7bc7..9b91e7c 100644 --- a/app/views/static_pages/stages.html.erb +++ b/app/views/static_pages/stages.html.erb @@ -11,7 +11,7 @@ - + diff --git a/app/views/static_pages/traceability.html.erb b/app/views/static_pages/traceability.html.erb index 7f7659d..d9d77b3 100644 --- a/app/views/static_pages/traceability.html.erb +++ b/app/views/static_pages/traceability.html.erb @@ -11,7 +11,7 @@ - + From 84c2e55fcb62d1dab9e1c5b3e0a9286678ac43d3 Mon Sep 17 00:00:00 2001 From: Esther Date: Wed, 8 Aug 2018 22:51:58 -0600 Subject: [PATCH 033/112] Reports from inventoty --- app/assets/stylesheets/application.scss | 1 + app/controllers/inventories_controller.rb | 8 + app/views/inventories/index.html.erb | 18 +- app/views/inventories/pdf.pdf.erb | 215 ++++++++++++---------- app/views/reports/pdf.pdf.erb | 4 +- 5 files changed, 139 insertions(+), 107 deletions(-) diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 631a350..3646a86 100755 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -68,6 +68,7 @@ h1 { font-size: 20px; } + .page-header h1 { background: #37BC9B; padding: 10px 15px; diff --git a/app/controllers/inventories_controller.rb b/app/controllers/inventories_controller.rb index e5dadb9..ef3e874 100644 --- a/app/controllers/inventories_controller.rb +++ b/app/controllers/inventories_controller.rb @@ -2,6 +2,14 @@ class InventoriesController < ApplicationController before_action :authenticate_user! def index @entries = EntryControl.search(params[:searchbox].to_s, params[:from].to_s,params[:to].to_s) + @batchesEAHT = Batch.where(cocoaType: 1) + @batchesEBHT = Batch.where(cocoaType: 2) + @batchesECHT = Batch.where(cocoaType: 3) + @batchesCE = Batch.where(certificatetype: 1) + @batchesCT= Batch.where(certificatetype: 2) + @batchesCC = Batch.where(certificatetype: 3) + @batchesIA = Batch.where(geneticMaterial: 2) + @batchesHT = Batch.where(geneticMaterial: 1) part1 = request.original_url.to_s.split("?")[0] part2 = request.original_url.to_s.split("?")[1] @new_url = part1 + ".pdf" diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index e16b0c8..197daac 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -73,7 +73,7 @@ <%else%> <%= CertificateType.find(params[:certificate]).name%> - <%end%> + <%end%> <%end%>

        @@ -132,13 +132,13 @@ Cantidad de lotes en bodega: <%= Batch.all.count %>

        -

        + <%= link_to "Generar Estadisticas", @new_url.to_s ,class:"btn btn-default btn-lg",target: :_blank %> -
        OrganizaciónProveedor Fecha de ingreso
        Código de lote Tipo de cacao Material genéticoOrganizaciónProveedor
        Identificacion Tipo de cacao Material geneticoOrganizacionProveedor
        Código de loteOrganizaciónProveedor
        Código de loteOrganizaciónProveedor
        +
        @@ -156,15 +156,13 @@ <% entry.batches.each do |batch| %> <% if params[:purchase].to_s == "on" && batch.purchase != nil %> - <% if params[:ft].to_s == "on" && batch.ft %> + <% if params[:ft].to_s == "on" && batch.ft == true %> <% if params[:variety] == "" %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - - @@ -363,7 +361,8 @@ <% end %> <% else %> <% if batch.purchase == nil %> - <% if params[:ft].to_s == "on" && batch.ft %> + <% if params[:ft].to_s == "on" %> + <% if (batch.ft) %> <% if params[:variety] == "" %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> @@ -465,6 +464,7 @@ <% end %> <% end %> <% end %> + <% end %> <% else %> <% if !(batch.ft) %> <% if params[:variety] == "" %> @@ -574,8 +574,8 @@ <% end %> <% end %> -
        Cantidad de sacos
        <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %>
        -
        + +
        diff --git a/app/views/inventories/pdf.pdf.erb b/app/views/inventories/pdf.pdf.erb index 4a98daa..ffcbd1d 100644 --- a/app/views/inventories/pdf.pdf.erb +++ b/app/views/inventories/pdf.pdf.erb @@ -1,99 +1,122 @@ - - - <%= wicked_pdf_stylesheet_link_tag "pdf" %> - - -
        -

        Chocolats Halba

        -

        Reporte

        -
        - - - - - - - - - - - - - <% @entries.each do |entry| %> - <% entry.batches.each do |batch| %> - <% if batch.quality_control != nil %> - <% if batch.quality_control.revision != nil %> - - <% if params[:purchased].to_s != "on" && params[:quality] == "" %> - <% if batch.purchase == nil %> - - - - - - - <% end %> - <% end %> - <% if params[:purchased].to_s == "on" && params[:quality] == "" %> - <% if batch.purchase != nil %> - <% if batch.purchase.decision == 1 %> - - - - - - <% if params[:searchbox] == "" %> - - <% end %> - <% end %> - <% end %> - <% end %> - <% if params[:purchased].to_s != "on" && params[:quality] != "" %> - <% if batch.quality_control != nil %> - <% if batch.quality_control.revision != nil %> - <% if batch.quality_control.revision.status == params[:quality].to_i %> - <% if batch.purchase == nil %> - - - - - - <% if params[:searchbox] == "" %> - - <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - <% if params[:purchased].to_s == "on" && params[:quality] != "" %> - <% if batch.quality_control != nil %> - <% if batch.quality_control.revision != nil %> - <% if batch.quality_control.revision.status == params[:quality].to_i %> - <% if batch.purchase != nil %> - <% if batch.purchase.decision == 1 %> - - - - - - <% if params[:searchbox] == "" %> - - <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - - <% end %> - <% end %> - <% end %> - <% end %> - -
        Cant. sacosPesoIdentificacionTipo de cacaoMaterial geneticoOrganizacion
        <%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.quality_control.revision.status).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.quality_control.revision.status).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.quality_control.revision.status).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= batch.enterCode %><%= CocoaType.find(batch.quality_control.revision.status).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.entry_control.organization.name %>
        - + + + <%= wicked_pdf_stylesheet_link_tag "pdf" %> + + + + +
        +

        Chocolats Halba

        +

        Reporte de Inventario

        + +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        CalidadCantidad (Kg)Cantidad (Lb)Numero de sacos
        A<%= number_with_precision(@batchesEAHT.sum(&:weight)/2.204623, precision: 2)%><%= number_with_precision(@batchesEAHT.sum(&:weight), precision: 2)%><%= @batchesEAHT.sum(&:sackAmount)%>
        B<%= number_with_precision(@batchesEBHT.sum(&:weight)/2.204623, precision: 2)%><%= number_with_precision(@batchesEBHT.sum(&:weight), precision: 2)%><%= @batchesEBHT.sum(&:sackAmount)%>
        C<%= number_with_precision(@batchesECHT.sum(&:weight)/2.204623, precision: 2)%><%= number_with_precision(@batchesECHT.sum(&:weight), precision: 2)%><%= @batchesECHT.sum(&:sackAmount)%>
        +
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        CertificadoCantidad (Kg)Cantidad (Lb)Numero de sacos
        E<%= number_with_precision(@batchesCE.sum(&:weight)/2.204623, precision: 2)%><%= number_with_precision(@batchesCE.sum(&:weight), precision: 2)%><%= @batchesCE.sum(&:sackAmount)%>
        T<%= number_with_precision(@batchesCT.sum(&:weight)/2.204623, precision: 2)%><%= number_with_precision(@batchesCT.sum(&:weight), precision: 2)%><%= @batchesCT.sum(&:sackAmount)%>
        C<%= number_with_precision(@batchesCC.sum(&:weight)/2.204623, precision: 2)%><%= number_with_precision(@batchesCC.sum(&:weight), precision: 2)%><%= @batchesCC.sum(&:sackAmount)%>
        + +
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + +
        VariedadCantidad (Kg)Cantidad (Lb)Numero de sacos
        HT<%= number_with_precision(@batchesHT.sum(&:weight)/2.204623, precision: 2)%><%= number_with_precision(@batchesHT.sum(&:weight), precision: 2)%><%= @batchesHT.sum(&:sackAmount)%>
        IA<%= number_with_precision(@batchesIA.sum(&:weight)/2.204623, precision: 2)%><%= number_with_precision(@batchesIA.sum(&:weight), precision: 2)%><%= @batchesIA.sum(&:sackAmount)%>
        + +
        \ No newline at end of file diff --git a/app/views/reports/pdf.pdf.erb b/app/views/reports/pdf.pdf.erb index 4a98daa..3d99fb4 100644 --- a/app/views/reports/pdf.pdf.erb +++ b/app/views/reports/pdf.pdf.erb @@ -7,12 +7,12 @@

        Chocolats Halba

        -

        Reporte

        +

        Estadisticas

        - + From 8ea9a5b149e89ed5fd463048aabd3a58030d5cda Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 9 Aug 2018 07:38:55 -0700 Subject: [PATCH 034/112] Added changes for checking sum of beans --- .../quality_controls_controller.rb | 2 +- app/views/batches/edit.html.erb | 7 +--- app/views/entry_controls/show.html.erb | 7 +++- app/views/quality_controls/new.html.erb | 39 +++++++++++++++---- config/application.rb | 1 - config/initializers/assets.rb | 3 +- 6 files changed, 40 insertions(+), 19 deletions(-) diff --git a/app/controllers/quality_controls_controller.rb b/app/controllers/quality_controls_controller.rb index f270407..ee75833 100644 --- a/app/controllers/quality_controls_controller.rb +++ b/app/controllers/quality_controls_controller.rb @@ -6,7 +6,7 @@ def index def new @batch = Batch.find(params[:batch_id]) - @qualityControl = @batch.build_quality_control + @qualityControl = @batch.build_quality_control end def create diff --git a/app/views/batches/edit.html.erb b/app/views/batches/edit.html.erb index e8a132b..47d027c 100644 --- a/app/views/batches/edit.html.erb +++ b/app/views/batches/edit.html.erb @@ -17,12 +17,7 @@ <%= f.label :weight, "Peso en libras" %> <%= f.number_field :weight, step: :any, min: 0 , :required => true %> - -
        - <%= f.label :enterCode, "Código de indentificación" %> - <%= f.text_field :enterCode , :required => true %> -
        - +

        <%= f.label :cocoaType, "Tipo de cacao" %> <%= f.collection_select :cocoaType, CocoaType.all, :id, :name, class:"dropdown-button btn" %> diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index af6b83c..fffcada 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -57,9 +57,14 @@

        - <% if current_user.warehouse_role || current_user.admin_role || current_user.quality_role%> + <% if current_user.warehouse_role || current_user.admin_role %> <% end %> + + <% if current_user.quality_role %> + + <% end %> + <% if current_user.quality_role && QualityControl.where(batch_id: batch.id).blank? %> + <% if parameter.id == 1 || parameter.id == 2 || parameter.id == 3 %> + + <%else%> + + <% end %> <% end %> <% end %> <% end %> -
        Cant. sacosHoja de Ingreso Peso Identificacion Tipo de cacao <%= GeneticMaterial.find(batch.geneticMaterial).name %> <%= link_to 'Editar', edit_batch_path(batch) %><%= link_to 'Ingresar número de muestras', edit_batch_path(batch) %> <%= link_to "Análisis físico", new_batch_quality_control_path(batch)%> diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index 1ce0408..6c7a779 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -113,9 +113,15 @@ <% (1..category.runs).each do |i| %> <%= r.hidden_field :parameter_id, :value => parameter.id %> <%= r.hidden_field :run, :value => i %> - - <%= r.number_field :score, step: :any, :value => 0, min: 0 , :required => true%> - + <%= r.number_field :score, step: :any, :value => 0, min: 0 , :required => true, :class=>"nontest"%> + + <%= r.number_field :score, step: :any, :value => 0, min: 0 , :required => true, :class=>"phys"%> + @@ -123,10 +129,11 @@
        - <% end %> - -
      • + + <% end %> + <%= f.submit "Verificar cantidad de granos", class:"btn btn-default btn-lg", :onclick => "alert_phys_test()" %> + +
      • visibilityt @@ -142,7 +149,7 @@

      <%= link_to "Regresar", @batch.entry_control , class: "btn btn-primary"%> - <%= f.submit "Aceptar", class:"btn btn-default btn-lg" %> + <%= f.submit "Aceptar", class:"btn btn-default btn-lg btn-submit", data: { disable_with: false } %>

      @@ -159,4 +166,20 @@ $('input.variety').on('change', function() { $('input.variety').not(this).prop('checked', false); }); + + function alert_phys_test() + { + var sum = 0; + $("input[class *= 'phys']").each(function(){ + sum += +$(this).val(); + }); + if(sum < 300 && sum >= 0){ + alert("La cantidad total de granos en el análisis físico no es de 300. Es de " + sum + " grano(s)."); + }else if(sum >300){ + alert("La cantidad total de granos en el análisis físico no es de 300. Es de " + sum + " grano(s)."); + $('#btn-submit').removeAttr('data-disable-with'); + }else{ + alert("La cantidad total de granos en el análisis físico es de 300."); + } + } diff --git a/config/application.rb b/config/application.rb index c48f5b9..74cc387 100755 --- a/config/application.rb +++ b/config/application.rb @@ -10,7 +10,6 @@ module Chocolatshalba class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults 5.1 - # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 4b828e8..8c8f829 100755 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -6,8 +6,7 @@ # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path # Add Yarn node_modules folder to the asset load path. -Rails.application.config.assets.paths << Rails.root.join('node_modules') - +Rails.application.config.assets.paths << Rails.root.join('node_modules')\ # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in the app/assets # folder are already added. From 29f98631bb9d52b38e4786d2dd741f4f10877710 Mon Sep 17 00:00:00 2001 From: LourdesZamora Date: Thu, 9 Aug 2018 10:13:18 -0600 Subject: [PATCH 035/112] Update batches code --- app/controllers/batches_controller.rb | 24 +++++------------------- app/models/batch.rb | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/app/controllers/batches_controller.rb b/app/controllers/batches_controller.rb index 278d33b..3039ae8 100644 --- a/app/controllers/batches_controller.rb +++ b/app/controllers/batches_controller.rb @@ -7,29 +7,13 @@ def new @entryControl = EntryControl.find(params[:entry_control_id]) @batch=@entryControl.batches.build end + + def create entryControl = EntryControl.find(params[:entry_control_id]) batch=entryControl.batches.build(batches_params) - - genetic=GeneticMaterial.find(batch.geneticMaterial).name - quality=CertificateType.find(batch.certificatetype).name - cocoat=CocoaType.find(batch.cocoaType).name - c = entryControl.organization.code+"0"+batch.postharvestCenter.to_s+"-"+entryControl.entryDate.strftime('%d%m%y')+"-"+quality+cocoat+genetic - code="" - if batch.ft - if quality== 'C' && cocoat == 'C' - code=c - batch.ft=false - else - code=c+"-FT" - - end - else - code= c - end - - batch.enterCode=code + batch.enterCode= "k" if batch.save createNotification redirect_to entryControl @@ -40,9 +24,11 @@ def create def edit @batch=Batch.find(params[:id]) + end def update + batch=Batch.find(params[:id]) if batch.update(batches_params) redirect_to batch.entry_control diff --git a/app/models/batch.rb b/app/models/batch.rb index b2c1375..87da188 100644 --- a/app/models/batch.rb +++ b/app/models/batch.rb @@ -16,8 +16,32 @@ class Batch < ApplicationRecord validates :entry_control, presence: true before_destroy :remove_quality_control + before_update :generateCode + before_save :generateCode def remove_quality_control QualityControl.where(batch_id: id).destroy_all end + + def generateCode + + quality=CertificateType.find(self.certificatetype).name + cocoat=CocoaType.find(self.cocoaType).name + c = entry_control.organization.code+"0"+postharvestCenter.to_s+"-"+entry_control.entryDate.strftime('%d%m%y')+"-"+quality+cocoat+GeneticMaterial.find(self.geneticMaterial).name + code="" + if ft + if quality== 'C' && cocoat == 'C' + code=c + self.ft=false + else + code=c+"-FT" + + end + else + code= c + end + self.enterCode=code + end + + end From 60e262efad04b1ed4e961e8afe2cd1f650ef4176 Mon Sep 17 00:00:00 2001 From: Esther Date: Thu, 9 Aug 2018 11:46:45 -0600 Subject: [PATCH 036/112] Minor changes to pdf report and hot fixes --- app/views/inventories/index.html.erb | 1059 ++++++++++++------------ app/views/inventories/pdf.pdf.erb | 31 +- app/views/layouts/application.html.erb | 2 +- 3 files changed, 553 insertions(+), 539 deletions(-) diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index 197daac..dabf2e7 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -3,130 +3,127 @@
      - + -
        -
      • -
        - chrome_reader_mode - FILTROS -
        -
        - <%= form_tag({:controller => "inventories", :action => "index"}, :method => :get) do %> +
          +
        • +
          + chrome_reader_mode + FILTROS +
          +
          + <%= form_tag({:controller => "inventories", :action => "index"}, :method => :get) do %> -

          Organización: <%= select_tag "searchbox", options_from_collection_for_select(Organization.all, :name, :name), :include_blank => 'TODOS' %>

          +

          Organización: <%= select_tag "searchbox", options_from_collection_for_select(Organization.all, :name, :name), :include_blank => 'TODOS' %>

          -

          Desde: <%= text_field_tag "from", params[:from], type:"date", class:"datepicker" %>

          +

          Desde: <%= text_field_tag "from", params[:from], type:"date", class:"datepicker" %>

          -

          Hasta: <%= text_field_tag "to", params[:to], type:"date", class:"datepicker" %>

          +

          Hasta: <%= text_field_tag "to", params[:to], type:"date", class:"datepicker" %>

          -

          Calidad: <%= select_tag :quality, options_for_select([["A", 1], ["B", 2] , ["C", 3]], params[:quality]), id: "different_option_value_html" ,:include_blank => 'TODOS'%>

          - -

          Certificado: <%= select_tag :certificate, options_for_select([["E", 1], ["T", 2] , ["C", 3]], params[:certificate]), id: "different_option_value_html2" ,:include_blank => 'TODOS'%>

          - -

          Variedad: <%= select_tag :variety, options_for_select([["HT", 1], ["IA", 2]], params[:variety]), id: "different_option_value_html3" ,:include_blank => 'TODOS'%>

          -
          -
          -

          - <%= check_box_tag(:ft, params[:ft]) %> - <%= label_tag(:ft, "Comercio justo") %> -

          -
          -
          -

          - <%= check_box_tag(:purchase, params[:purchase]) %> - <%= label_tag(:purchase, "Comprado") %> -

          -
          -
          -
          - <%= submit_tag "Generar", :name => nil, class:"btn btn-default btn-lg" %> - <%= button_tag "Limpiar", :name => nil, class:"btn btn-default btn-lg", id:"reset" %> - <% end %> - -
          -
        • -
        +

        Calidad: <%= select_tag :quality, options_for_select([["A", 1], ["B", 2] , ["C", 3]], params[:quality]), id: "different_option_value_html" ,:include_blank => 'TODOS'%>

        + +

        Certificado: <%= select_tag :certificate, options_for_select([["E", 1], ["T", 2] , ["C", 3]], params[:certificate]), id: "different_option_value_html2" ,:include_blank => 'TODOS'%>

        + + <%= select_tag :variety, options_for_select([["HT", 1], ["IA", 2]], params[:variety]), id: "different_option_value_html3" ,:include_blank => 'TODOS'%>

        +
        +
        +

        + <%= check_box_tag(:ft, params[:ft]) %> + <%= label_tag(:ft, "Comercio justo") %> +

        +
        +
        +

        + <%= check_box_tag(:purchase, params[:purchase]) %> + <%= label_tag(:purchase, "Comprado") %> +

        +
        +
        +
        + <%= submit_tag "Generar", :name => nil, class:"btn btn-default btn-lg" %> + <%= button_tag "Limpiar", :name => nil, class:"btn btn-default btn-lg", id:"reset" %> + <% end %> +
        +
      • +
      -

      Calidad: - <% if params[:quality]=="" %> - TODAS - <%else%> - <% if params[:quality]==nil %> - +

      Calidad: + <% if params[:quality]=="" %> + TODAS <%else%> - <%= CocoaType.find(params[:quality]).name%> - <%end%> - <%end%> -

      + <% if params[:quality]==nil %> + + <%else%> + <%= CocoaType.find(params[:quality]).name%> + <%end%> + <%end%> +

      -

      Certificado: - <% if params[:certificate]=="" %> - TODOS - <%else%> - <% if params[:certificate]==nil %> - +

      Certificado: + <% if params[:certificate]=="" %> + TODOS <%else%> - <%= CertificateType.find(params[:certificate]).name%> - <%end%> - <%end%> -

      - -

      Variedad: - <% if params[:variety]=="" %> - TODAS - <%else%> - <% if params[:variety]==nil %> + <% if params[:certificate]==nil %> - <%else%> - <%= GeneticMaterial.find(params[:variety]).name%> - <%end%> - <%end%> -

      + <%else%> + <%= CertificateType.find(params[:certificate]).name%> + <%end%> + <%end%> +

      - +

      Variedad: + <% if params[:variety]=="" %> + TODAS + <%else%> + <% if params[:variety]==nil %> + + <%else%> + <%= GeneticMaterial.find(params[:variety]).name%> + <%end%> + <%end%> +

      -

      Organización: - <% if params[:searchbox]=="" %> - TODAS - <%else%> - <% if params[:searchbox]==nil %> - +

      Organización: + <% if params[:searchbox]=="" %> + TODAS <%else%> - <%= params[:searchbox].to_s%> + <% if params[:searchbox]==nil %> + + <%else%> + <%= params[:searchbox].to_s%> + <%end%> <%end%> - <%end%> -

      +

      -

      Comercio justo: - <% if params[:ft].to_s != "on" %> - No - <%else%> - Si - <%end%> -

      +

      Comercio justo: + <% if params[:ft].to_s != "on" %> + No + <%else%> + Si + <%end%> +

      -

      Comprado: - <% if params[:purchase].to_s != "on" %> - No - <%else%> - Si - <%end%> -

      +

      Comprado: + <% if params[:purchase].to_s != "on" %> + No + <%else%> + Si + <%end%> +

      -
      +

      Cantidad de lotes en bodega: @@ -138,444 +135,448 @@

      - - - - - - - - - - - - - - - <% @entries.each do |entry| %> - <% entry.batches.each do |batch| %> - - <% if params[:purchase].to_s == "on" && batch.purchase != nil %> - <% if params[:ft].to_s == "on" && batch.ft == true %> - <% if params[:variety] == "" %> - <% if params[:quality] == "" %> - <% if params[:certificate] == "" %> - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - - <% end %> - <% end %> - <% else %> - <% if batch.cocoaType== params[:quality].to_i %> - <% if params[:certificate] == "" %> - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - - <% end %> - <% end %> - <% end %> - <% end %> - <% else %> - <% if batch.geneticMaterial== params[:variety].to_i %> - <% if params[:quality] == "" %> - <% if params[:certificate] == "" %> - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - - <% end %> - <% end %> - <% else %> - <% if batch.cocoaType== params[:quality].to_i %> - <% if params[:certificate] == "" %> - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - - <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - <% else %> - <% if !(batch.ft) %> - <% if params[:variety] == "" %> - <% if params[:quality] == "" %> - <% if params[:certificate] == "" %> - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - - <% end %> - <% end %> - <% else %> - <% if batch.cocoaType== params[:quality].to_i %> - <% if params[:certificate] == "" %> - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - - <% end %> - <% end %> - <% end %> - <% end %> - <% else %> - <% if batch.geneticMaterial== params[:variety].to_i %> - <% if params[:quality] == "" %> - <% if params[:certificate] == "" %> - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - - <% end %> - <% end %> - <% else %> - <% if batch.cocoaType== params[:quality].to_i %> - <% if params[:certificate] == "" %> - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - +
      Cantidad de sacosPeso LBPeso KGCódigo de loteTipo de cacaoVariedadCertificadoOrganización
      <%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %>
      + + + + + + + + + + + + + + <% @entries.each do |entry| %> + <% entry.batches.each do |batch| %> + + <% if params[:purchase].to_s == "on" %> + <%if batch.purchase != nil %> + <% if params[:ft].to_s == "on" %> + <% if (batch.ft) %> + <% if params[:variety] == "" %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if batch.geneticMaterial== params[:variety].to_i %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - <% else %> - <% if batch.purchase == nil %> - <% if params[:ft].to_s == "on" %> - <% if (batch.ft) %> - <% if params[:variety] == "" %> - <% if params[:quality] == "" %> - <% if params[:certificate] == "" %> - - - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - - <% end %> - <% end %> - <% else %> - <% if batch.cocoaType== params[:quality].to_i %> - <% if params[:certificate] == "" %> - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - - <% end %> - <% end %> - <% end %> - <% end %> - <% else %> - <% if batch.geneticMaterial== params[:variety].to_i %> - <% if params[:quality] == "" %> - <% if params[:certificate] == "" %> - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - - <% end %> - <% end %> - <% else %> - <% if batch.cocoaType== params[:quality].to_i %> - <% if params[:certificate] == "" %> - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - - <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - <% else %> - <% if !(batch.ft) %> - <% if params[:variety] == "" %> - <% if params[:quality] == "" %> - <% if params[:certificate] == "" %> - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - - <% end %> - <% end %> - <% else %> - <% if batch.cocoaType== params[:quality].to_i %> - <% if params[:certificate] == "" %> - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - + <% else %> + <% if !(batch.ft) %> + <% if params[:variety] == "" %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if batch.geneticMaterial== params[:variety].to_i %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> <% end %> - <% end %> - <% end %> - <% end %> - <% else %> - <% if batch.geneticMaterial== params[:variety].to_i %> - <% if params[:quality] == "" %> - <% if params[:certificate] == "" %> - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - - <% end %> - <% end %> - <% else %> - <% if batch.cocoaType== params[:quality].to_i %> - <% if params[:certificate] == "" %> - - - - - - - - - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - - - - - - - - - <% end %> - <% end %> + <% if batch.purchase == nil %> + <% if params[:ft].to_s == "on" %> + <% if (batch.ft) %> + <% if params[:variety] == "" %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if batch.geneticMaterial== params[:variety].to_i %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if !(batch.ft) %> + <% if params[:variety] == "" %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if batch.geneticMaterial== params[:variety].to_i %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + + + + + + + + + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + + + + + + + + + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> <% end %> - <% end %> + <% end %> <% end %> - <% end %> - <% end %> - <% end %> - <% end %> - - <% end %> - <% end %> - -
      Cantidad de sacosPeso LBPeso KGCódigo de loteTipo de cacaoVariedadCertificadoOrganización
      <%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= batch.enterCode %><%= CocoaType.find(batch.cocoaType).name %><%= GeneticMaterial.find(batch.geneticMaterial).name %><%= CertificateType.find(batch.certificatetype).name %><%= batch.entry_control.organization.name %>
      -
      + + +
      diff --git a/app/views/inventories/pdf.pdf.erb b/app/views/inventories/pdf.pdf.erb index ffcbd1d..54b25b0 100644 --- a/app/views/inventories/pdf.pdf.erb +++ b/app/views/inventories/pdf.pdf.erb @@ -1,31 +1,44 @@ - + Reporte de Inventario <%= wicked_pdf_stylesheet_link_tag "pdf" %>
      -

      Chocolats Halba

      + <%= wicked_pdf_image_tag 'ch.jpg',:width => "230", :height=>"120"%>

      Reporte de Inventario

      +

      Fecha: <%=Date.today%>

      + -
      - - +
      @@ -58,7 +71,7 @@


      -
      Calidad
      +
      @@ -93,7 +106,7 @@

      -
      Certificado
      +
      @@ -117,6 +130,6 @@
      Variedad
      - +
      \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index e037324..19c808d 100755 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -198,8 +198,8 @@ <% elsif Notification.where(kind: 3, read: false).count > 1 %> <%= Notification.where(kind: 3, read: false).count %> <% end %> -
    • <%= link_to 'Lista de Lotes', "/quality_controls",class:"white-text li-back"%>
    • <%= link_to 'Mover lotes', batches_moveBatches_path,class:"white-text li-back"%>
    • +
    • <%= link_to 'Lista de Lotes', "/quality_controls",class:"white-text li-back"%>
    • <%= link_to 'Inventario', inventories_path , class:"white-text li-back"%>
    • <% end %> <% if current_user.quality_manager_role %> From 62676eefea8dd0bace65fb778166d417a35ab8ac Mon Sep 17 00:00:00 2001 From: Esther Date: Thu, 9 Aug 2018 14:11:20 -0600 Subject: [PATCH 037/112] Hot fix on physical analysis --- app/views/quality_controls/new.html.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index 889a963..5f775a4 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -37,6 +37,10 @@ DATOS GENERALES
      +
      + <%= f.label :code, "Número de hoja" %> + <%= f.text_field :code , :required => true%> +
      <%= f.label :made_by, "Persona responsable" %> <%= f.text_field :made_by , :required => true%> From 78af8ae8af0fdb8c9501cf6b9867176987855edf Mon Sep 17 00:00:00 2001 From: Esther Date: Tue, 14 Aug 2018 18:02:49 -0600 Subject: [PATCH 038/112] hot fix --- app/controllers/inventories_controller.rb | 7 +++++-- app/views/inventories/{pdf.pdf.erb => pdf.html.erb} | 0 2 files changed, 5 insertions(+), 2 deletions(-) rename app/views/inventories/{pdf.pdf.erb => pdf.html.erb} (100%) diff --git a/app/controllers/inventories_controller.rb b/app/controllers/inventories_controller.rb index ef3e874..37f0e23 100644 --- a/app/controllers/inventories_controller.rb +++ b/app/controllers/inventories_controller.rb @@ -18,8 +18,11 @@ def index end respond_to do |format| format.html - format.pdf {render template: 'inventories/pdf', pdf: 'pdf'} + format.pdf do + render :pdf => "Reporte_Inventario.pdf",:template => "inventories/pdf.html.erb" + end + end end -end \ No newline at end of file +end diff --git a/app/views/inventories/pdf.pdf.erb b/app/views/inventories/pdf.html.erb similarity index 100% rename from app/views/inventories/pdf.pdf.erb rename to app/views/inventories/pdf.html.erb From c3e562ecccebb8c984afc949c49a6296e9025b48 Mon Sep 17 00:00:00 2001 From: christian-edgardo-rodriguez Date: Sun, 19 Aug 2018 21:39:15 -0600 Subject: [PATCH 039/112] numero de catadores agregado --- app/views/batches/edit.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/batches/edit.html.erb b/app/views/batches/edit.html.erb index e8a132b..56bfd28 100644 --- a/app/views/batches/edit.html.erb +++ b/app/views/batches/edit.html.erb @@ -39,7 +39,7 @@
      <% else %>
      - <%= f.label :samples, "Número de Muestras" %> + <%= f.label :samples, "Número de Catadores" %> <%= f.number_field :samples, step: :any, min: 0 %>
      <% end %> From f58114a71bc5133ef82d52bd6559dd0bbffef61a Mon Sep 17 00:00:00 2001 From: Esther Date: Mon, 20 Aug 2018 14:53:01 -0600 Subject: [PATCH 040/112] ft fitro --- app/views/inventories/index.html.erb | 117 ++++++++++++++------------- 1 file changed, 61 insertions(+), 56 deletions(-) diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index 68018eb..7690c49 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -26,14 +26,12 @@

      Certificado: <%= select_tag :certificate, options_for_select([["E", 1], ["T", 2] , ["C", 3]], params[:certificate]), id: "different_option_value_html2" ,:include_blank => 'TODOS'%>

      - <%= select_tag :variety, options_for_select([["HT", 1], ["IA", 2]], params[:variety]), id: "different_option_value_html3" ,:include_blank => 'TODOS'%>

      +

      Variedad: <%= select_tag :variety, options_for_select([["HT", 1], ["IA", 2]], params[:variety]), id: "different_option_value_html3" ,:include_blank => 'TODOS'%>

      + +

      Comercio justo: <%= select_tag :ft, options_for_select([["SI", true], ["NO", false]], params[:ft]), id: "different_option_value_html3" ,:include_blank => 'TODOS'%>

      +
      -
      -

      - <%= check_box_tag(:ft, params[:ft]) %> - <%= label_tag(:ft, "Comercio justo") %> -

      -
      +

      <%= check_box_tag(:purchase, params[:purchase]) %> @@ -42,6 +40,7 @@


      + <%= submit_tag "Generar", :name => nil, class:"btn btn-default btn-lg" %> <%= button_tag "Limpiar", :name => nil, class:"btn btn-default btn-lg", id:"reset" %> <% end %> @@ -105,11 +104,15 @@

      Comercio justo: - <% if params[:ft].to_s != "on" %> + <% if params[:ft]=="" %> + TODOS + <%else%> + <% if params[:ft] != "true" %> No <%else%> Si <%end%> + <%end%>

      Comprado: @@ -154,7 +157,7 @@ <% if params[:purchase].to_s == "on" %> <%if batch.purchase != nil %> - <% if params[:ft].to_s == "on" %> + <% if params[:ft] == "true" || params[:ft] == "" %> <% if (batch.ft) %> <% if params[:variety] == "" %> <% if params[:quality] == "" %> @@ -257,32 +260,10 @@ <% end %> <% end %> <% else %> - <% if !(batch.ft) %> - <% if params[:variety] == "" %> - <% if params[:quality] == "" %> - <% if params[:certificate] == "" %> - <%= batch.sackAmount %> - <%= number_with_precision(batch.weight, precision: 2) %> lb - <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg - <%= batch.enterCode %> - <%= CocoaType.find(batch.cocoaType).name %> - <%= GeneticMaterial.find(batch.geneticMaterial).name %> - <%= CertificateType.find(batch.certificatetype).name %> - <%= batch.entry_control.organization.name %> - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> - <%= batch.sackAmount %> - <%= number_with_precision(batch.weight, precision: 2) %> lb - <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg - <%= batch.enterCode %> - <%= CocoaType.find(batch.cocoaType).name %> - <%= GeneticMaterial.find(batch.geneticMaterial).name %> - <%= CertificateType.find(batch.certificatetype).name %> - <%= batch.entry_control.organization.name %> - <% end %> - <% end %> - <% else %> - <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:ft] == "" %> + <% if !(batch.ft) %> + <% if params[:variety] == "" %> + <% if params[:quality] == "" %> <% if params[:certificate] == "" %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb @@ -304,22 +285,9 @@ <%= batch.entry_control.organization.name %> <% end %> <% end %> - <% end %> - <% end %> - <% else %> - <% if batch.geneticMaterial== params[:variety].to_i %> - <% if params[:quality] == "" %> - <% if params[:certificate] == "" %> - <%= batch.sackAmount %> - <%= number_with_precision(batch.weight, precision: 2) %> lb - <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg - <%= batch.enterCode %> - <%= CocoaType.find(batch.cocoaType).name %> - <%= GeneticMaterial.find(batch.geneticMaterial).name %> - <%= CertificateType.find(batch.certificatetype).name %> - <%= batch.entry_control.organization.name %> - <% else %> - <% if batch.certificatetype == params[:certificate].to_i %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg @@ -328,10 +296,23 @@ <%= GeneticMaterial.find(batch.geneticMaterial).name %> <%= CertificateType.find(batch.certificatetype).name %> <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> <% end %> - <% end %> - <% else %> - <% if batch.cocoaType== params[:quality].to_i %> + <% end %> + <% end %> + <% else %> + <% if batch.geneticMaterial== params[:variety].to_i %> + <% if params[:quality] == "" %> <% if params[:certificate] == "" %> <%= batch.sackAmount %> <%= number_with_precision(batch.weight, precision: 2) %> lb @@ -353,10 +334,34 @@ <%= batch.entry_control.organization.name %> <% end %> <% end %> - <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% end %> + <% end %> <% end %> <% end %> - <% end %> + <% end %> <% end %> <% end %> <% end %> From ca642ba51aabd7406b4142ba7cb95a65e4794234 Mon Sep 17 00:00:00 2001 From: Esther Date: Mon, 20 Aug 2018 15:24:31 -0600 Subject: [PATCH 041/112] ft filter completed --- app/views/inventories/index.html.erb | 210 ++++++++++++++++++++++++++- 1 file changed, 206 insertions(+), 4 deletions(-) diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index 7690c49..8ef9119 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -107,7 +107,7 @@ <% if params[:ft]=="" %> TODOS <%else%> - <% if params[:ft] != "true" %> + <% if params[:ft] == "false" %> No <%else%> Si @@ -156,8 +156,108 @@ <% entry.batches.each do |batch| %> <% if params[:purchase].to_s == "on" %> - <%if batch.purchase != nil %> - <% if params[:ft] == "true" || params[:ft] == "" %> + <%if batch.purchase != nil %> + <% if params[:ft] == "" %> + <% if params[:variety] == "" %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if batch.geneticMaterial== params[:variety].to_i %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% elsif params[:ft] == "true" %> <% if (batch.ft) %> <% if params[:variety] == "" %> <% if params[:quality] == "" %> @@ -367,7 +467,109 @@ <% end %> <% else %> <% if batch.purchase == nil %> - <% if params[:ft].to_s == "on" %> + <% if params[:ft] == "" %> + <% if params[:variety] == "" %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% end %> + <% end %> + <% else %> + <% if batch.geneticMaterial== params[:variety].to_i %> + <% if params[:quality] == "" %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% else %> + <% if batch.cocoaType== params[:quality].to_i %> + <% if params[:certificate] == "" %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% else %> + <% if batch.certificatetype == params[:certificate].to_i %> + <%= batch.sackAmount %> + <%= number_with_precision(batch.weight, precision: 2) %> lb + <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg + <%= batch.enterCode %> + <%= CocoaType.find(batch.cocoaType).name %> + <%= GeneticMaterial.find(batch.geneticMaterial).name %> + <%= CertificateType.find(batch.certificatetype).name %> + <%= batch.entry_control.organization.name %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% end %> + <% elsif params[:ft] == "true" %> <% if (batch.ft) %> <% if params[:variety] == "" %> <% if params[:quality] == "" %> From 17713f1f900ab28d56bbdcc739faf1dfe1caa862 Mon Sep 17 00:00:00 2001 From: Esther Date: Mon, 20 Aug 2018 15:29:22 -0600 Subject: [PATCH 042/112] hot fix --- app/views/inventories/index.html.erb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index 8ef9119..a56aac6 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -360,7 +360,6 @@ <% end %> <% end %> <% else %> - <% if params[:ft] == "" %> <% if !(batch.ft) %> <% if params[:variety] == "" %> <% if params[:quality] == "" %> @@ -461,8 +460,7 @@ <% end %> <% end %> <% end %> - <% end %> - <% end %> + <% end %> <% end %> <% end %> <% else %> From 5c119cdbd984b375af86e11f7f96c1a094540c9b Mon Sep 17 00:00:00 2001 From: Esther Date: Tue, 21 Aug 2018 10:15:58 -0600 Subject: [PATCH 043/112] working on totals --- app/views/inventories/index.html.erb | 238 ++++++++++++++++----------- 1 file changed, 138 insertions(+), 100 deletions(-) diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index a56aac6..3b73098 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -137,7 +137,6 @@

    - @@ -162,8 +161,8 @@ <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - - + + @@ -172,8 +171,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -185,8 +184,8 @@ <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - - + + @@ -195,8 +194,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -211,8 +210,8 @@ <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - - + + @@ -221,8 +220,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -234,8 +233,8 @@ <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - - + + @@ -244,8 +243,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -263,8 +262,8 @@ <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - - + + @@ -273,8 +272,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -286,8 +285,8 @@ <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - - + + @@ -296,8 +295,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -312,8 +311,8 @@ <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - - + + @@ -322,8 +321,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -335,8 +334,8 @@ <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - - + + @@ -345,8 +344,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -365,8 +364,8 @@ <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - - + + @@ -375,8 +374,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -388,8 +387,8 @@ <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - - + + @@ -398,8 +397,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -414,8 +413,8 @@ <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - - + + @@ -424,8 +423,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -437,8 +436,8 @@ <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - - + + @@ -447,8 +446,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -470,10 +469,8 @@ <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - - - - + + @@ -482,8 +479,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -495,8 +492,8 @@ <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - - + + @@ -505,8 +502,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -521,8 +518,8 @@ <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - - + + @@ -531,8 +528,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -544,8 +541,8 @@ <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - - + + @@ -554,8 +551,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -573,9 +570,9 @@ <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - + - + @@ -585,8 +582,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -598,8 +595,8 @@ <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - - + + @@ -608,8 +605,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -624,8 +621,8 @@ <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - - + + @@ -634,8 +631,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -647,8 +644,8 @@ <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - - + + @@ -657,8 +654,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -677,8 +674,8 @@ <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - - + + @@ -687,8 +684,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -700,8 +697,8 @@ <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - - + + @@ -710,8 +707,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -726,8 +723,8 @@ <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - - + + @@ -736,8 +733,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -749,8 +746,8 @@ <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - - + + @@ -759,8 +756,8 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - - + + @@ -779,6 +776,16 @@ <% end %> <% end %> + + + + + + + + + +
    <%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %><%= batch.sackAmount %><%= number_with_precision(batch.weight, precision: 2) %> lb<%= number_with_precision(batch.weight/2.204623, precision: 2) %> kg<%= number_with_precision(batch.weight, precision: 2) %><%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %> <%= CocoaType.find(batch.cocoaType).name %> <%= GeneticMaterial.find(batch.geneticMaterial).name %>
    Total

    @@ -791,7 +798,8 @@ @@ -800,6 +808,7 @@ $("#different_option_value_html").val(""); $("#different_option_value_html2").val(""); $("#different_option_value_html3").val(""); + $("#different_option_value_html4").val(""); $("#from").val(""); $("#to").val(""); }); @@ -817,3 +826,32 @@ }) + + + From 870541ee8f69c20cb54235bcb6e7a41260e98a4c Mon Sep 17 00:00:00 2001 From: Esther Date: Tue, 21 Aug 2018 14:18:53 -0600 Subject: [PATCH 044/112] quick fixes --- app/views/inventories/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index a56aac6..58cf2ea 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -28,7 +28,7 @@

    Variedad: <%= select_tag :variety, options_for_select([["HT", 1], ["IA", 2]], params[:variety]), id: "different_option_value_html3" ,:include_blank => 'TODOS'%>

    -

    Comercio justo: <%= select_tag :ft, options_for_select([["SI", true], ["NO", false]], params[:ft]), id: "different_option_value_html3" ,:include_blank => 'TODOS'%>

    +

    Comercio justo: <%= select_tag :ft, options_for_select([["SI", true], ["NO", false]], params[:ft]), id: "different_option_value_html4" ,:include_blank => 'TODOS'%>

    From 53c63e38546ccafcc51f217578dd1024aa7f4786 Mon Sep 17 00:00:00 2001 From: Esther Date: Tue, 21 Aug 2018 15:40:08 -0600 Subject: [PATCH 045/112] totals on inventories --- app/views/inventories/index.html.erb | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index 3b73098..0ecd5a2 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -133,6 +133,7 @@ <%= Batch.all.count %>

    + <%= link_to "Generar Estadisticas", @new_url.to_s ,class:"btn btn-default btn-lg",target: :_blank %>
    @@ -797,8 +798,7 @@ @@ -820,6 +820,7 @@ selectYears: 15 // Creates a dropdown of 15 years to control year }); + + From dc1c4acbc89d9c285dec7d0b8fbfa42be17ab67e Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 21 Aug 2018 16:37:57 -0600 Subject: [PATCH 046/112] Verify bean count button disabling done --- app/views/entry_controls/show.html.erb | 2 +- app/views/quality_controls/new.html.erb | 22 ++++++++-------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index c3259ec..ec51d86 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -62,7 +62,7 @@ <% end %> <% if current_user.quality_role %> - <%= link_to 'Ingresar número de muestras', edit_batch_path(batch) %> + <%= link_to 'Ingresar número de catadores', edit_batch_path(batch) %> <% end %> <% if current_user.quality_role && QualityControl.where(batch_id: batch.id).blank? %> diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index 86b8262..5c1edfd 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -93,7 +93,7 @@ <% end %> <% end %> - <%= f.submit "Verificar cantidad de granos", class:"btn btn-default btn-lg", :onclick => "alert_phys_test()" %> +
  • @@ -111,7 +111,7 @@

    <%= link_to "Regresar", @batch.entry_control , class: "btn btn-primary"%> - <%= f.submit "Aceptar", class:"btn btn-default btn-lg btn-submit", data: { disable_with: false } %> + <%= f.submit "Aceptar", class:"btn btn-default btn-lg", id: "btn-submit", disabled: true%>

    @@ -121,14 +121,6 @@ From caab6e06fcd9adb1413ca365a5b4a2589ed5d476 Mon Sep 17 00:00:00 2001 From: christian-edgardo-rodriguez Date: Tue, 21 Aug 2018 22:21:59 -0600 Subject: [PATCH 047/112] hidden_field para campo observacion agregado --- app/views/quality_controls/new.html.erb | 1 + app/views/sensory_analyses/new.html.erb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index 5c1edfd..e12ea61 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -103,6 +103,7 @@
    + <%= f.hidden_field :observation, :value => "n/a" %> <%= f.label :observation, "Observación" %> <%= f.text_area :observation, class:"materialize-textarea", :required => true%>
    diff --git a/app/views/sensory_analyses/new.html.erb b/app/views/sensory_analyses/new.html.erb index 8a83d14..348bc17 100644 --- a/app/views/sensory_analyses/new.html.erb +++ b/app/views/sensory_analyses/new.html.erb @@ -77,6 +77,7 @@
    + <%= f.hidden_field :observation, :value => "n/a" %> <%= f.label :observation, "Observación" %> <%= f.text_area :observation, class:"materialize-textarea", :required => true%>
    From 482faf65e40916bee02de26b8d54b34bb9544b69 Mon Sep 17 00:00:00 2001 From: Francis Date: Wed, 22 Aug 2018 17:43:18 -0600 Subject: [PATCH 048/112] You win or you die --- app/controllers/entry_controls_controller.rb | 4 ---- app/controllers/organizations_controller.rb | 2 -- 2 files changed, 6 deletions(-) diff --git a/app/controllers/entry_controls_controller.rb b/app/controllers/entry_controls_controller.rb index 2314c86..3270985 100755 --- a/app/controllers/entry_controls_controller.rb +++ b/app/controllers/entry_controls_controller.rb @@ -26,10 +26,6 @@ def show def index @organization = Organization.all - - - - end diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index 7d5053d..45733e2 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -4,8 +4,6 @@ def index @organizations = Organization.all end - - def show organization = Organization.find(params[:id]) @entries = organization.entry_controls From 3b521f633d55f90200c8175cdd5237aa19adddf1 Mon Sep 17 00:00:00 2001 From: christian-edgardo-rodriguez Date: Wed, 22 Aug 2018 22:04:55 -0600 Subject: [PATCH 049/112] ya no se puede escribir en campo de observacion --- app/views/quality_controls/new.html.erb | 2 +- app/views/sensory_analyses/new.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index e12ea61..252cb61 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -105,7 +105,7 @@
    <%= f.hidden_field :observation, :value => "n/a" %> <%= f.label :observation, "Observación" %> - <%= f.text_area :observation, class:"materialize-textarea", :required => true%> + <%= f.text_area :observation, class:"materialize-textarea", :required => true, :disabled => true%>
  • diff --git a/app/views/sensory_analyses/new.html.erb b/app/views/sensory_analyses/new.html.erb index 348bc17..3d33fec 100644 --- a/app/views/sensory_analyses/new.html.erb +++ b/app/views/sensory_analyses/new.html.erb @@ -79,7 +79,7 @@
    <%= f.hidden_field :observation, :value => "n/a" %> <%= f.label :observation, "Observación" %> - <%= f.text_area :observation, class:"materialize-textarea", :required => true%> + <%= f.text_area :observation, class:"materialize-textarea", :required => true, :disabled => true%>
    From c47e9d4ea11293d53dd9bb6ed453218f8f6f15dd Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 23 Aug 2018 00:51:06 -0600 Subject: [PATCH 050/112] No longer able to see observation field on sensory analysis and physical analysis. Added condition for entering sampler number. --- app/views/entry_controls/show.html.erb | 2 +- app/views/quality_controls/new.html.erb | 16 +++------------- app/views/sensory_analyses/new.html.erb | 12 +----------- 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index ec51d86..c119697 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -61,7 +61,7 @@ <%= link_to 'Editar', edit_batch_path(batch) %> <% end %> - <% if current_user.quality_role %> + <% if current_user.quality_role && SensoryAnalysis.where(batch_id: batch.id).blank? %> <%= link_to 'Ingresar número de catadores', edit_batch_path(batch) %> <% end %> diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index 252cb61..faf5de5 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -96,19 +96,9 @@ -
  • -
    - visibilityt - OBSERVACIÓN -
    -
    -
    - <%= f.hidden_field :observation, :value => "n/a" %> - <%= f.label :observation, "Observación" %> - <%= f.text_area :observation, class:"materialize-textarea", :required => true, :disabled => true%> -
    -
    -
  • +
  • + <%= f.hidden_field :observation, :value => "n/a" %> +
  • <%= link_to "Regresar", @batch.entry_control , class: "btn btn-primary"%> diff --git a/app/views/sensory_analyses/new.html.erb b/app/views/sensory_analyses/new.html.erb index 3d33fec..5038898 100644 --- a/app/views/sensory_analyses/new.html.erb +++ b/app/views/sensory_analyses/new.html.erb @@ -71,17 +71,7 @@

  • -
    - visibilityt - OBSERVACIÓN -
    -
    -
    - <%= f.hidden_field :observation, :value => "n/a" %> - <%= f.label :observation, "Observación" %> - <%= f.text_area :observation, class:"materialize-textarea", :required => true, :disabled => true%> -
    -
    + <%= f.hidden_field :observation, :value => "n/a" %>
  • From f259e0d5bcbef01f45dc9c072043c501e8e533eb Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 23 Aug 2018 08:12:10 -0600 Subject: [PATCH 051/112] Option to view analyses results now available --- app/views/entry_controls/show.html.erb | 4 ++++ app/views/quality_controls/show.html.erb | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index c119697..7ae6aef 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -61,6 +61,10 @@ <%= link_to 'Editar', edit_batch_path(batch) %> <% end %> + <% if current_user.quality_role && (SensoryAnalysis.where(batch_id: batch.id).present? && QualityControl.where(batch_id: batch.id).present?)%> + <%= link_to "Ver análisis", batch.quality_control %> + <% end %> + <% if current_user.quality_role && SensoryAnalysis.where(batch_id: batch.id).blank? %> <%= link_to 'Ingresar número de catadores', edit_batch_path(batch) %> <% end %> diff --git a/app/views/quality_controls/show.html.erb b/app/views/quality_controls/show.html.erb index b650085..008ca53 100644 --- a/app/views/quality_controls/show.html.erb +++ b/app/views/quality_controls/show.html.erb @@ -182,7 +182,11 @@

    Cálidad juzgada: <%= @new_quality %>

    - <%= link_to "Regresar", revisions_path , class: "btn btn-primary"%> + <% if current_user.quality_manager_role %> + <%= link_to "Regresar", revisions_path , class: "btn btn-primary"%> + <% else %> + <%= link_to "Regresar", @batch.entry_control , class: "btn btn-primary"%> + <% end %> <% if current_user.quality_manager_role && !Revision.where(quality_control_id: @qualityControl.id).nil? %> Determinar calidad <% end %> From 12beefec34c25794fdd5c7684442a50f5da7bf0a Mon Sep 17 00:00:00 2001 From: Esther Date: Thu, 23 Aug 2018 11:16:21 -0600 Subject: [PATCH 052/112] Observation can be entered after the result --- .../quality_controls_controller.rb | 18 +++++---- app/views/quality_controls/new.html.erb | 2 +- app/views/quality_controls/show.html.erb | 40 ++++++++++++++++--- 3 files changed, 47 insertions(+), 13 deletions(-) diff --git a/app/controllers/quality_controls_controller.rb b/app/controllers/quality_controls_controller.rb index ee75833..157cfda 100644 --- a/app/controllers/quality_controls_controller.rb +++ b/app/controllers/quality_controls_controller.rb @@ -40,13 +40,13 @@ def edit def update quality_control=QualityControl.find(params[:id]) batch=quality_control.batch - if quality_control.update(quality_params) - params["results"].each do |result| - r=Result.where(:batch_id => batch.id, :parameter_id => result["parameter_id"], :run => result["run"]).first - r.score=result["score"] - r.save - end - redirect_to quality_control.batch.entry_control + if quality_control.update(quality_params_update) + ##params["results"].each do |result| + ## r=Result.where(:batch_id => batch.id, :parameter_id => result["parameter_id"], :run => result["run"]).first + ## r.score=result["score"] + ## r.save + ##end + redirect_to quality_control else render 'edit' end @@ -64,6 +64,10 @@ def quality_params params.require(:quality_control).permit(:code, :final_code, :cut_at, :f_harvest, :s_harvest, :trinitary, :outsider, :observation, :made_by, :samples) end + def quality_params_update + params.require(:quality_control).permit(:observation) + end + def defineResult(batch) batch=Batch.find(batch) diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index faf5de5..774ea19 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -97,7 +97,7 @@
  • - <%= f.hidden_field :observation, :value => "n/a" %> + <%= f.hidden_field :observation, :value => "Ninguna" %>
  • diff --git a/app/views/quality_controls/show.html.erb b/app/views/quality_controls/show.html.erb index 008ca53..313b00c 100644 --- a/app/views/quality_controls/show.html.erb +++ b/app/views/quality_controls/show.html.erb @@ -34,10 +34,10 @@ CORTE

    -

    - Número de hoja: - <%= @qualityControl.code %> -

    +

    + Número de hoja: + <%= @qualityControl.code %> +

    Fecha de corte: @@ -127,7 +127,6 @@ <% end %>

    -
  • pie_chart @@ -178,6 +177,37 @@ Ver gráfico
  • + +
  • +
    + short_text + OBSERVACIÓN +
    +
    + <% if current_user.quality_role %> + <% if @qualityControl.observation == "Ninguna" %> + <%= form_for ([@qualityControl]) do |f| %> +
    + <%= f.label :observation, "Observación" %> + <%= f.text_area :observation, class:"materialize-textarea", :required => true%> +
    + <%= f.submit 'Aceptar',class:" waves-effect waves-light btn" %> + <% end %> + <% else %> +

    + Observación: + <%= @qualityControl.observation %> +

    + <% end %> + <% else %> +

    + Observación: + <%= @qualityControl.observation %> +

    + <% end %> +
    +
  • +

    Cálidad juzgada: <%= @new_quality %> From 8bf684bdccaa7b5428213e466e882055d4af1a65 Mon Sep 17 00:00:00 2001 From: Esther Date: Thu, 23 Aug 2018 11:20:03 -0600 Subject: [PATCH 053/112] Quick fix --- app/views/quality_controls/show.html.erb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/views/quality_controls/show.html.erb b/app/views/quality_controls/show.html.erb index 313b00c..013c499 100644 --- a/app/views/quality_controls/show.html.erb +++ b/app/views/quality_controls/show.html.erb @@ -73,10 +73,7 @@ <% end %>

    -

    - Observación: - <%= @qualityControl.observation %> -

    +
  • From f6ab05458d0e35f3f81a313a5a8cf7bbdf5785c9 Mon Sep 17 00:00:00 2001 From: LourdesZamora Date: Thu, 23 Aug 2018 13:34:18 -0600 Subject: [PATCH 054/112] Generate Analysis number --- app/assets/javascripts/sequences.coffee | 3 +++ app/assets/stylesheets/sequences.scss | 3 +++ app/controllers/sequences_controller.rb | 20 +++++++++++++++++++ app/helpers/sequences_helper.rb | 2 ++ app/models/quality_control.rb | 6 ++++++ app/models/sequence.rb | 2 ++ app/views/layouts/application.html.erb | 4 ++-- app/views/quality_controls/new.html.erb | 2 +- config/routes.rb | 3 +++ db/migrate/20180823022047_create_sequences.rb | 10 ++++++++++ db/schema.rb | 9 ++++++++- test/controllers/sequences_controller_test.rb | 7 +++++++ test/fixtures/sequences.yml | 9 +++++++++ test/models/sequence_test.rb | 7 +++++++ 14 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 app/assets/javascripts/sequences.coffee create mode 100644 app/assets/stylesheets/sequences.scss create mode 100644 app/controllers/sequences_controller.rb create mode 100644 app/helpers/sequences_helper.rb create mode 100644 app/models/sequence.rb create mode 100644 db/migrate/20180823022047_create_sequences.rb create mode 100644 test/controllers/sequences_controller_test.rb create mode 100644 test/fixtures/sequences.yml create mode 100644 test/models/sequence_test.rb diff --git a/app/assets/javascripts/sequences.coffee b/app/assets/javascripts/sequences.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/sequences.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/sequences.scss b/app/assets/stylesheets/sequences.scss new file mode 100644 index 0000000..6e3ef33 --- /dev/null +++ b/app/assets/stylesheets/sequences.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Sequences controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/sequences_controller.rb b/app/controllers/sequences_controller.rb new file mode 100644 index 0000000..042d385 --- /dev/null +++ b/app/controllers/sequences_controller.rb @@ -0,0 +1,20 @@ +class SequencesController < ApplicationController + + + +def create + + @sequence = Sequence.new + @sequence.year=Time.current.year + @sequence.number=1 + if !Sequence.exists?(year: Time.current.year) + if !@sequence.save + raise "error" + end + end + + redirect_to '/quality_controls' +end + + +end diff --git a/app/helpers/sequences_helper.rb b/app/helpers/sequences_helper.rb new file mode 100644 index 0000000..2605349 --- /dev/null +++ b/app/helpers/sequences_helper.rb @@ -0,0 +1,2 @@ +module SequencesHelper +end diff --git a/app/models/quality_control.rb b/app/models/quality_control.rb index 01b35dc..261a895 100644 --- a/app/models/quality_control.rb +++ b/app/models/quality_control.rb @@ -8,9 +8,15 @@ class QualityControl < ApplicationRecord validates :observation, presence: true before_destroy :remove_results_revision + before_save :update_sequence def remove_results_revision Result.where(quality_control_id: id).destroy_all Revision.where(quality_control_id: id).destroy_all end + + def update_sequence + @sequence=(Sequence.find_by year: Time.current.year) + Sequence.update(@sequence.id, :number => @sequence.number+1) + end end diff --git a/app/models/sequence.rb b/app/models/sequence.rb new file mode 100644 index 0000000..b84a664 --- /dev/null +++ b/app/models/sequence.rb @@ -0,0 +1,2 @@ +class Sequence < ApplicationRecord +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 4edfefb..2426768 100755 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -55,7 +55,7 @@ <% elsif Notification.where(kind: 1, read: false).count > 0 %> <%= Notification.where(kind: 1, read: false).count %> <% end %> -
  • <%= link_to 'Análisis', quality_controls_path, class:"white-text li-back"%>
  • +
  • <%= link_to 'Análisis', '/sequence', class:"white-text li-back"%>
  • <%= link_to 'Unir lotes', export_batches_join_path, class:"white-text li-back"%>
  • <% end %> <% if current_user.certification_role %> @@ -218,7 +218,7 @@ <% elsif Notification.where(kind: 1, read: false).count > 0 %> <%= Notification.where(kind: 1, read: false).count %> <% end %> -
  • <%= link_to 'Análisis', quality_controls_path, class:"white-text li-back"%>
  • +
  • <%= link_to 'Análisis', sequences_path,:method => :post , class:"white-text li-back"%>
  • <%= link_to 'Unir lotes', export_batches_join_path, class:"white-text li-back"%>
  • <% end %> <% if current_user.certification_role %> diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index 1ce0408..a2043ee 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -39,7 +39,7 @@
    <%= f.label :code, "Número de hoja" %> - <%= f.text_field :code , :required => true%> + <%= f.text_field :code , :required => true, value: Time.current.year.to_s + Time.current.month.to_s+"000"+(Sequence.find_by year: Time.current.year).number.to_s, rating: 4 %>
    diff --git a/config/routes.rb b/config/routes.rb index 37950b0..c608b75 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -42,6 +42,9 @@ resources :filechecklists resources :barcodes + + resources :sequences + resources :entry_controls do resources :batches resources :reports diff --git a/db/migrate/20180823022047_create_sequences.rb b/db/migrate/20180823022047_create_sequences.rb new file mode 100644 index 0000000..52933a2 --- /dev/null +++ b/db/migrate/20180823022047_create_sequences.rb @@ -0,0 +1,10 @@ +class CreateSequences < ActiveRecord::Migration[5.1] + def change + create_table :sequences do |t| + t.integer :number + t.integer :year + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index a82ad34..3098fbc 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180627133812) do +ActiveRecord::Schema.define(version: 20180823022047) do create_table "acceptances", force: :cascade do |t| t.decimal "max_qualityA" @@ -260,6 +260,13 @@ t.index ["batch_id"], name: "index_sensory_analyses_on_batch_id" end + create_table "sequences", force: :cascade do |t| + t.integer "number" + t.integer "year" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "users", force: :cascade do |t| t.string "email", default: "", null: false t.string "encrypted_password", default: "", null: false diff --git a/test/controllers/sequences_controller_test.rb b/test/controllers/sequences_controller_test.rb new file mode 100644 index 0000000..37c89eb --- /dev/null +++ b/test/controllers/sequences_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SequencesControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/test/fixtures/sequences.yml b/test/fixtures/sequences.yml new file mode 100644 index 0000000..21e0a27 --- /dev/null +++ b/test/fixtures/sequences.yml @@ -0,0 +1,9 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +one: + number: 1 + year: 1 + +two: + number: 1 + year: 1 diff --git a/test/models/sequence_test.rb b/test/models/sequence_test.rb new file mode 100644 index 0000000..3eac4e6 --- /dev/null +++ b/test/models/sequence_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SequenceTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From 7f2c0901d212c5cc3a8becc69d0ceb80520d0805 Mon Sep 17 00:00:00 2001 From: Esther Date: Thu, 23 Aug 2018 15:21:45 -0600 Subject: [PATCH 055/112] Quick design fix --- app/views/quality_controls/new.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index 74eadb7..476d63c 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -93,7 +93,7 @@ <% end %> <% end %> - +
  • From 31a524302fdadb1e298fb61c8f6bb90e039883f4 Mon Sep 17 00:00:00 2001 From: Esther Date: Thu, 23 Aug 2018 16:42:10 -0600 Subject: [PATCH 056/112] Sprint done --- app/views/inventories/index.html.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index f9858c7..35c511f 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -109,14 +109,16 @@ <%else%> <% if params[:ft] == "false" %> No - <%else%> + <%elsif params[:ft] == "true" %> Si + <%else %> + <%end%> <%end%>

    Comprado: - <% if params[:purchase].to_s != "on" %> + <% if params[:purchase].to_s != "on" %> No <%else%> Si From 37c5ce79d7925f3cd5bcb8ca81dbf2c21611083f Mon Sep 17 00:00:00 2001 From: Francis Date: Fri, 24 Aug 2018 19:56:15 -0600 Subject: [PATCH 057/112] Added bean field to batches model --- app/controllers/batches_controller.rb | 2 +- app/views/batches/edit.html.erb | 15 +++++++++++---- app/views/batches/new.html.erb | 2 ++ app/views/entry_controls/show.html.erb | 6 ++++-- .../20180825013312_add_beancount_to_batches.rb | 5 +++++ db/schema.rb | 3 ++- 6 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 db/migrate/20180825013312_add_beancount_to_batches.rb diff --git a/app/controllers/batches_controller.rb b/app/controllers/batches_controller.rb index 3039ae8..2e067e0 100644 --- a/app/controllers/batches_controller.rb +++ b/app/controllers/batches_controller.rb @@ -57,7 +57,7 @@ def show private def batches_params - params.require(:batch).permit(:sackAmount, :weight, :enterCode, :certificatetype, :postharvestCenter, :cocoaType, :geneticMaterial, :ft, :samples) + params.require(:batch).permit(:sackAmount, :weight, :enterCode, :certificatetype, :postharvestCenter, :cocoaType, :geneticMaterial, :ft, :samples, :beans) end def createNotification diff --git a/app/views/batches/edit.html.erb b/app/views/batches/edit.html.erb index 9fbc9ed..c0d7ed6 100644 --- a/app/views/batches/edit.html.erb +++ b/app/views/batches/edit.html.erb @@ -33,10 +33,17 @@ <%= f.label 'ft', "Comercio justo" %>

  • <% else %> -
    - <%= f.label :samples, "Número de Catadores" %> - <%= f.number_field :samples, step: :any, min: 0 %> -
    + <% if QualityControl.where(batch_id: @batch.id).blank? %> +
    + <%= f.label :beans, "Número de Granos de Prueba de Corte" %> + <%= f.number_field :beans, step: :any, min: 0 %> +
    + <% else %> +
    + <%= f.label :samples, "Número de Catadores" %> + <%= f.number_field :samples, step: :any, min: 0 %> +
    + <%end%> <% end %>
    diff --git a/app/views/batches/new.html.erb b/app/views/batches/new.html.erb index 23b3d33..d4c5e1c 100644 --- a/app/views/batches/new.html.erb +++ b/app/views/batches/new.html.erb @@ -19,6 +19,8 @@ <%= f.hidden_field :samples, step: :any, :value => 1, :required => true %> + <%= f.hidden_field :beans, step: :any, :value => 300, :required => true %> +
    <%= f.label :postharvestCenter, "Centro de poscosecha" %> <%= f.text_field :postharvestCenter , :required => true %> diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index 7ae6aef..d7ad348 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -65,9 +65,11 @@ <%= link_to "Ver análisis", batch.quality_control %> <% end %> - <% if current_user.quality_role && SensoryAnalysis.where(batch_id: batch.id).blank? %> + <% if current_user.quality_role && QualityControl.where(batch_id: batch.id).blank? %> + <%= link_to 'Ingresar número de granos', edit_batch_path(batch) %> + <% elsif current_user.quality_role && SensoryAnalysis.where(batch_id: batch.id).blank?%> <%= link_to 'Ingresar número de catadores', edit_batch_path(batch) %> - <% end %> + <%end%> <% if current_user.quality_role && QualityControl.where(batch_id: batch.id).blank? %> diff --git a/db/migrate/20180825013312_add_beancount_to_batches.rb b/db/migrate/20180825013312_add_beancount_to_batches.rb new file mode 100644 index 0000000..1fa91ff --- /dev/null +++ b/db/migrate/20180825013312_add_beancount_to_batches.rb @@ -0,0 +1,5 @@ +class AddBeancountToBatches < ActiveRecord::Migration[5.1] + def change + add_column :batches, :beans, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 3098fbc..9b83de2 100755 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180823022047) do +ActiveRecord::Schema.define(version: 20180825013312) do create_table "acceptances", force: :cascade do |t| t.decimal "max_qualityA" @@ -52,6 +52,7 @@ t.string "receivedBy" t.string "deliveredBy" t.integer "samples" + t.integer "beans" t.index ["entry_control_id"], name: "index_batches_on_entry_control_id" end From 4ffc649481b7cd9557a83b2d9c313960b32ee2ba Mon Sep 17 00:00:00 2001 From: Francis Date: Fri, 24 Aug 2018 20:06:45 -0600 Subject: [PATCH 058/112] Can now check for variable amount of beans --- app/views/quality_controls/new.html.erb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index 476d63c..1d0f755 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -114,19 +114,20 @@ From 299d7e3c72f85246e887e6f636f86cd4b6425d5d Mon Sep 17 00:00:00 2001 From: Esther Date: Mon, 27 Aug 2018 18:18:18 -0600 Subject: [PATCH 059/112] Documents views fixed on administration --- app/controllers/filechecklists_controller.rb | 2 +- app/views/batches/show.html.erb | 27 +++++--------------- app/views/filechecklists/edit.html.erb | 2 +- app/views/invoices/index.html.erb | 8 +++--- 4 files changed, 14 insertions(+), 25 deletions(-) diff --git a/app/controllers/filechecklists_controller.rb b/app/controllers/filechecklists_controller.rb index 416ce04..a3f0bec 100644 --- a/app/controllers/filechecklists_controller.rb +++ b/app/controllers/filechecklists_controller.rb @@ -26,7 +26,7 @@ def edit def update checklist = Filechecklist.find(params[:id]) if checklist.update(checklist_params) - if current_user.certification_role + if current_user.certification_role | current_user.purchase_role flash[:notice] = "Guardado" else redirect_to checklist.entry_control, notice: "Guardado con éxito" diff --git a/app/views/batches/show.html.erb b/app/views/batches/show.html.erb index 6bdf333..7d39403 100644 --- a/app/views/batches/show.html.erb +++ b/app/views/batches/show.html.erb @@ -131,26 +131,13 @@
    DOCUMENTOS - - - - - - - - - <% @batch.entry_control.documents.each do |doc| %> - - - - <% end %> - -
    Nombre del archivo
    - <%=doc.title%> - - <%= link_to "Descargar archivo", doc.ec_data.url(:original, false) %> - -
    +
    + <% if @batch.entry_control.filechecklists.empty? %> + <%= link_to "Verificar documentos", new_entry_control_filechecklist_path(@batch.entry_control), class:"waves-effect waves-light btn" %> + <% else %> + <%= link_to "Verificar documentos", filechecklist_path(@batch.entry_control.filechecklists.first), class:"waves-effect waves-light btn" %> + <% end %> +
  • diff --git a/app/views/filechecklists/edit.html.erb b/app/views/filechecklists/edit.html.erb index 4d5ad7f..3235e9a 100644 --- a/app/views/filechecklists/edit.html.erb +++ b/app/views/filechecklists/edit.html.erb @@ -36,7 +36,7 @@
    - <% if current_user.certification_role %> + <% if current_user.certification_role | current_user.purchase_role %> <%= link_to "Regresar", :back , class: "btn btn-primary"%> <%= f.submit "Guardar", class:"btn btn-default btn-lg" %> <% else %> diff --git a/app/views/invoices/index.html.erb b/app/views/invoices/index.html.erb index e6166f1..6e4b454 100644 --- a/app/views/invoices/index.html.erb +++ b/app/views/invoices/index.html.erb @@ -28,9 +28,11 @@ <%= button_tag(type: 'submit', class: "btn") do %> Marcar como pagado <% end %> - <% if invoice.bills.empty? %> - <%= link_to "Agregar factura", new_invoice_bill_path(invoice), class:"waves-effect waves-light btn" %> - <% end %> + <% if invoice.batch.entry_control.filechecklists.empty? %> + <%= link_to "Agregar factura", new_entry_control_filechecklist_path(invoice.batch.entry_control), class:"waves-effect waves-light btn" %> + <% else %> + <%= link_to "Agregar factura", edit_filechecklist_path(invoice.batch.entry_control.filechecklists.first), class:"waves-effect waves-light btn" %> + <% end %> <% end %> <% end %> From ac6df9123dde2eb8e1d90116ec3052c99d8a9d8a Mon Sep 17 00:00:00 2001 From: Francis Date: Mon, 27 Aug 2018 18:30:20 -0600 Subject: [PATCH 060/112] Finished bean count task --- app/controllers/quality_controls_controller.rb | 3 ++- app/views/quality_controls/show.html.erb | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/controllers/quality_controls_controller.rb b/app/controllers/quality_controls_controller.rb index 157cfda..bf8b42b 100644 --- a/app/controllers/quality_controls_controller.rb +++ b/app/controllers/quality_controls_controller.rb @@ -75,9 +75,10 @@ def defineResult(batch) Category.all.order(:place).each do |category| category.parameters.order(:place).each do |parameter| value = -1 + div = batch.beans / 100 if parameter.acceptance != nil if category.runs > 1 - value = Result.where(parameter_id: parameter.id, batch_id: batch.id).sum(:score)/3 + value = Result.where(parameter_id: parameter.id, batch_id: batch.id).sum(:score)/(@batch.beans/100) else value = Result.where(parameter_id: parameter.id, batch_id: batch.id, run: 1).first.score end diff --git a/app/views/quality_controls/show.html.erb b/app/views/quality_controls/show.html.erb index 013c499..fb697f4 100644 --- a/app/views/quality_controls/show.html.erb +++ b/app/views/quality_controls/show.html.erb @@ -116,7 +116,13 @@ <% end %> <% if category.runs > 1 %> - <%= number_with_precision(Result.where(parameter_id: parameter.id, batch_id: @batch.id).sum(:score)/3, precision: 2) %>% + <%if @batch.beans == 300%> + <%= number_with_precision(Result.where(parameter_id: parameter.id, batch_id: @batch.id).sum(:score)/3, precision: 2) %>% + <% elsif @batch.beans == 150%> + <%= number_with_precision(Result.where(parameter_id: parameter.id, batch_id: @batch.id).sum(:score)/1.5, precision: 2) %>% + <%else%> + <%= number_with_precision(Result.where(parameter_id: parameter.id, batch_id: @batch.id).sum(:score)/(@batch.beans/100), precision: 2) %>% + <%end%> <% end %> <% end %> From 368261e02fdae4756970fe8fce7238222d3f15ce Mon Sep 17 00:00:00 2001 From: Esther Date: Mon, 27 Aug 2018 18:39:07 -0600 Subject: [PATCH 061/112] Variety available on results from analysis --- app/views/quality_controls/new.html.erb | 2 +- app/views/quality_controls/show.html.erb | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index 476d63c..888f0c4 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -39,7 +39,7 @@
    <%= f.label :code, "Número de hoja" %> - <%= f.text_field :code , :required => true, value: Time.current.year.to_s + Time.current.month.to_s+"000"+(Sequence.find_by year: Time.current.year).number.to_s, rating: 4 %> + <%= f.text_field :code , :required => true, value: Time.current.year.to_s + Time.current.month.to_s+"000"+(Sequence.find_by year: Time.current.year).number.to_s, rating: 4 %>
    <%= f.label :made_by, "Persona responsable" %> diff --git a/app/views/quality_controls/show.html.erb b/app/views/quality_controls/show.html.erb index 013c499..d6f9246 100644 --- a/app/views/quality_controls/show.html.erb +++ b/app/views/quality_controls/show.html.erb @@ -52,7 +52,8 @@

    <% if @qualityControl.f_harvest %> Cosecha: primera (agosto-febrero) - <% end %> + <% end %> +

    @@ -62,15 +63,16 @@

    - <% if @qualityControl.trinitary %> + <% if GeneticMaterial.find(@qualityControl.batch.geneticMaterial).name == "HT" %> Variedad: trinitario - <% end %> + <% end %> +

    - <% if @qualityControl.outsider %> + <% if GeneticMaterial.find(@qualityControl.batch.geneticMaterial).name == "IA" %> Variedad: forastero - <% end %> + <% end %>

    From 24bc0fcb7c296e003774e27884b36f1bd03e3f12 Mon Sep 17 00:00:00 2001 From: Esther Date: Tue, 28 Aug 2018 11:38:33 -0600 Subject: [PATCH 062/112] Quality sheet number not editable on form --- app/views/quality_controls/new.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index 888f0c4..80736f6 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -39,7 +39,7 @@
    <%= f.label :code, "Número de hoja" %> - <%= f.text_field :code , :required => true, value: Time.current.year.to_s + Time.current.month.to_s+"000"+(Sequence.find_by year: Time.current.year).number.to_s, rating: 4 %> + <%= f.text_field :code , :required => true, :readonly => true, value: Time.current.year.to_s + Time.current.month.to_s+"000"+(Sequence.find_by year: Time.current.year).number.to_s, rating: 4 %>
    <%= f.label :made_by, "Persona responsable" %> From 6fe7b81113a670918915492275912c2f9001b617 Mon Sep 17 00:00:00 2001 From: Francis Date: Tue, 28 Aug 2018 22:37:37 -0600 Subject: [PATCH 063/112] Changed sack amount for entry sheet number --- app/views/batches/moveBatches.html.erb | 4 +- app/views/entry_controls/index.html.erb | 16 +--- app/views/entry_controls/new.html.erb | 2 - app/views/entry_controls/show.html.erb | 4 +- app/views/inventories/index.html.erb | 98 ++++++++++++------------- 5 files changed, 54 insertions(+), 70 deletions(-) diff --git a/app/views/batches/moveBatches.html.erb b/app/views/batches/moveBatches.html.erb index 4c93bf8..6b27648 100644 --- a/app/views/batches/moveBatches.html.erb +++ b/app/views/batches/moveBatches.html.erb @@ -9,7 +9,7 @@ - + @@ -24,7 +24,7 @@ <% if not batch.purchase.nil? %> <% if batch.purchase.decision==1 %> - + diff --git a/app/views/entry_controls/index.html.erb b/app/views/entry_controls/index.html.erb index 7b0ce26..4b3a5bb 100644 --- a/app/views/entry_controls/index.html.erb +++ b/app/views/entry_controls/index.html.erb @@ -15,26 +15,12 @@ <%= f.label :organization_id, "Proveedor" %> <%= f.collection_select :organization_id, @organization, :id, :name, class:"dropdown-button btn" %>

    -

    <%= link_to "Regresar", organizations_path , class: "btn btn-primary"%> <%= f.submit "Aceptar", class:"btn btn-default btn-lg" %>

    - <% end %> - - - - - - - - - - - - - + <% end %> diff --git a/app/views/entry_controls/new.html.erb b/app/views/entry_controls/new.html.erb index e1dc5b6..7647b7c 100755 --- a/app/views/entry_controls/new.html.erb +++ b/app/views/entry_controls/new.html.erb @@ -10,8 +10,6 @@

    Control de ingreso

    - -
    <%= f.label :entry_number, "Número de hoja de ingreso" %> <%= f.number_field :entry_number, min: 0, :required => true %> diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index d7ad348..2765aa0 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -31,7 +31,7 @@
    Cantidad de sacosNumero de hoja de ingreso Peso Código de lote Tipo de cacao
    <%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> lb <%= batch.enterCode %> <%= CocoaType.find(batch.quality_control.revision.status).name %>
    - + @@ -43,7 +43,7 @@ <% @batches.each do |batch| %> diff --git a/app/views/inventories/index.html.erb b/app/views/inventories/index.html.erb index 35c511f..1a6f367 100644 --- a/app/views/inventories/index.html.erb +++ b/app/views/inventories/index.html.erb @@ -143,7 +143,7 @@
    Cantidad de sacosNumero de hoja de ingreso Peso en Libras Peso en Kilogramos Código de identificación
    - <%= batch.sackAmount %> + <%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> lb
    - + @@ -163,7 +163,7 @@ <% if params[:variety] == "" %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - + @@ -173,7 +173,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -186,7 +186,7 @@ <% else %> <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - + @@ -196,7 +196,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -212,7 +212,7 @@ <% if batch.geneticMaterial== params[:variety].to_i %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - + @@ -222,7 +222,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -235,7 +235,7 @@ <% else %> <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - + @@ -245,7 +245,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -264,7 +264,7 @@ <% if params[:variety] == "" %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - + @@ -274,7 +274,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -287,7 +287,7 @@ <% else %> <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - + @@ -297,7 +297,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -313,7 +313,7 @@ <% if batch.geneticMaterial== params[:variety].to_i %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - + @@ -323,7 +323,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -336,7 +336,7 @@ <% else %> <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - + @@ -346,7 +346,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -366,7 +366,7 @@ <% if params[:variety] == "" %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - + @@ -376,7 +376,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -389,7 +389,7 @@ <% else %> <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - + @@ -399,7 +399,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -415,7 +415,7 @@ <% if batch.geneticMaterial== params[:variety].to_i %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - + @@ -425,7 +425,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -438,7 +438,7 @@ <% else %> <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - + @@ -448,7 +448,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -471,7 +471,7 @@ <% if params[:variety] == "" %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - + @@ -481,7 +481,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -494,7 +494,7 @@ <% else %> <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - + @@ -504,7 +504,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -520,7 +520,7 @@ <% if batch.geneticMaterial== params[:variety].to_i %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - + @@ -530,7 +530,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -543,7 +543,7 @@ <% else %> <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - + @@ -553,7 +553,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -572,7 +572,7 @@ <% if params[:variety] == "" %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - + @@ -584,7 +584,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -597,7 +597,7 @@ <% else %> <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - + @@ -607,7 +607,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -623,7 +623,7 @@ <% if batch.geneticMaterial== params[:variety].to_i %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - + @@ -633,7 +633,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -646,7 +646,7 @@ <% else %> <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - + @@ -656,7 +656,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -676,7 +676,7 @@ <% if params[:variety] == "" %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - + @@ -686,7 +686,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -699,7 +699,7 @@ <% else %> <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - + @@ -709,7 +709,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -725,7 +725,7 @@ <% if batch.geneticMaterial== params[:variety].to_i %> <% if params[:quality] == "" %> <% if params[:certificate] == "" %> - + @@ -735,7 +735,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + @@ -748,7 +748,7 @@ <% else %> <% if batch.cocoaType== params[:quality].to_i %> <% if params[:certificate] == "" %> - + @@ -758,7 +758,7 @@ <% else %> <% if batch.certificatetype == params[:certificate].to_i %> - + From e48d401a9fb4f36c2e3955909eee4ac8db84c7a1 Mon Sep 17 00:00:00 2001 From: Francis Date: Thu, 30 Aug 2018 19:02:53 -0600 Subject: [PATCH 064/112] Fixed(?) bug within view --- app/views/entry_controls/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/entry_controls/show.html.erb b/app/views/entry_controls/show.html.erb index 2765aa0..924e3f3 100755 --- a/app/views/entry_controls/show.html.erb +++ b/app/views/entry_controls/show.html.erb @@ -43,7 +43,7 @@ <% @batches.each do |batch| %> From aebdf5e54f6960b54a9db4904d471d5bb60c0244 Mon Sep 17 00:00:00 2001 From: christian-edgardo-rodriguez Date: Wed, 5 Sep 2018 02:28:43 -0600 Subject: [PATCH 065/112] average weight shown automatically --- app/views/quality_controls/new.html.erb | 27 ++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index 476d63c..e3920d3 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -76,13 +76,24 @@ <%= r.hidden_field :parameter_id, :value => parameter.id %> <%= r.hidden_field :run, :value => i %> <% if parameter.id == 1 || parameter.id == 2 || parameter.id == 3 %> - + <% if parameter.name.start_with?("Peso de 300 granos")%> + + <% elsif !parameter.name.start_with?("Peso de 300 granos") && !parameter.name.start_with?("Humedad")%> + + <%else%> + + <%end%> <%else%> + <% end %> <% end %> <% end %> @@ -129,4 +140,14 @@ Materialize.toast('La cantidad total de granos en el análisis físico es de 300.', 4000); } } + + document.getElementById("grainWeight").addEventListener("keyup", average_weight_per_grain); + document.getElementById("averageWeight").style.color = "black"; + + function average_weight_per_grain(){ + var x = document.getElementById("grainWeight").value; + var sackAmount = <%= @batch.sackAmount.to_json %>; + var weight = <%= @batch.weight%>; + document.getElementById("averageWeight").value = ((weight*453.592)/(x*sackAmount)).toFixed(2); + } From 7a5c8da926666e586423fecb053b83630e5970b9 Mon Sep 17 00:00:00 2001 From: christian-edgardo-rodriguez Date: Wed, 5 Sep 2018 12:13:51 -0600 Subject: [PATCH 066/112] fixed formula --- app/views/quality_controls/new.html.erb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/quality_controls/new.html.erb b/app/views/quality_controls/new.html.erb index e3920d3..ed75b34 100644 --- a/app/views/quality_controls/new.html.erb +++ b/app/views/quality_controls/new.html.erb @@ -145,9 +145,7 @@ document.getElementById("averageWeight").style.color = "black"; function average_weight_per_grain(){ - var x = document.getElementById("grainWeight").value; - var sackAmount = <%= @batch.sackAmount.to_json %>; - var weight = <%= @batch.weight%>; - document.getElementById("averageWeight").value = ((weight*453.592)/(x*sackAmount)).toFixed(2); + var weight = document.getElementById("grainWeight").value; + document.getElementById("averageWeight").value = (weight/300).toFixed(2); } From c5951a594c0156417c9958eff89f741b992e422c Mon Sep 17 00:00:00 2001 From: Esther Date: Wed, 5 Sep 2018 16:33:53 -0600 Subject: [PATCH 067/112] PDF fix --- app/views/inventories/pdf.html.erb | 7 +++---- app/views/reports/pdf.pdf.erb | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/views/inventories/pdf.html.erb b/app/views/inventories/pdf.html.erb index 54b25b0..7de4e19 100644 --- a/app/views/inventories/pdf.html.erb +++ b/app/views/inventories/pdf.html.erb @@ -1,8 +1,7 @@ - + Reporte de Inventario - <%= wicked_pdf_stylesheet_link_tag "pdf" %>
    Cantidad de sacosHoja de ingreso Peso LB Peso KG Código de lote<%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %><%= batch.entry_control.organization.name %><%= batch.sackAmount %><%= EntryControl.find(batch.id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> <%= number_with_precision(batch.weight/2.204623, precision: 2) %> <%= batch.enterCode %>
    - <%= EntryControl.find(batch.id).entry_number %> + <%= EntryControl.find(batch.entry_control_id).entry_number %> <%= number_with_precision(batch.weight, precision: 2) %> lb - <%= r.number_field :score, step: :any, :value => 0, min: 0 , :required => true, :class=>"nontest"%> - + <%= r.text_field :score, step: :any, :value => 0, min: 0 ,:required => true, :class=>"nontest", :id => "grainWeight"%> + + <%= r.text_field :score, step: :any, :required => true, :disabled=>true, :class=>"nontest", :id => "averageWeight"%> + + <%= r.number_field :score, step: :any, :value => 0, min: 0 , :required => true, :class=>"nontest"%> + <%= r.number_field :score, step: :any, :value => 0, min: 0 , :required => true, :class=>"phys"%>