From 9ea2eb8d4279bb61e8751dc17a362ed761f004cc Mon Sep 17 00:00:00 2001 From: puppe1990 Date: Mon, 2 Sep 2024 13:32:03 -0300 Subject: [PATCH 1/4] add the translantions --- config/locales/pt-BR.models.productions.yml | 52 ++++++++++++++++++--- 1 file changed, 46 insertions(+), 6 deletions(-) diff --git a/config/locales/pt-BR.models.productions.yml b/config/locales/pt-BR.models.productions.yml index c27cc325..416afc36 100644 --- a/config/locales/pt-BR.models.productions.yml +++ b/config/locales/pt-BR.models.productions.yml @@ -2,27 +2,67 @@ pt-BR: activerecord: models: production: "Produção" + production_product: "Produto da Produção" attributes: production: tailor: "Costureiro" cut_date: "Data de Corte" - deliver_date: "Data de Entrega" + delivery_date: "Data de Entrega" + expected_delivery_date: "Data Prevista de Entrega" consider: "Considerar" + confirmed: "Confirmado" + paid: "Pago" + observation: "Observação" + pieces_delivered: "Peças Entregues" + pieces_missing: "Peças Faltando" + production_product: + product: "Produto" + quantity: "Quantidade" + pieces_delivered: "Peças Entregues" + pieces_missing: "Peças Faltando" productions: index: title: "Produções" product_summary: "Resumo da Produção" no_tailor: "Nenhum" no_products: "Nenhum produto" + show: + title: "Detalhes da Produção" + tailor_details: "Detalhes do Costureiro" + production_data: "Dados da Produção" + product_details: "Detalhes dos Produtos" + totals: "Totais" + new: + title: "Nova Produção" + new_production: "Criar Nova Produção" + products: "Produtos" + add_product: "Adicionar Produto" + edit: + title: "Editar Produção" actions: show: "Mostrar" edit: "Editar" destroy: "Excluir" confirm: "Você tem certeza?" - new: - title: "Nova Produção" - edit: - title: "Editar Produção" + create: + production_created: "Produção criada com sucesso." + creation_failed: "Falha ao criar a produção." + update: + production_updated: "Produção atualizada com sucesso." + destroy: + production_destroyed: "Produção excluída com sucesso." + destruction_failed: "Falha ao excluir a produção." helpers: + submit: + create: "Criar %{model}" + update: "Atualizar %{model}" links: - new: "Novo" + new: "Nova Produção" + back: "Voltar" + edit: "Editar" + cancel: "Cancelar" + titles: + new: "Nova %{model}" + edit: "Editar %{model}" + actions: + remove: "Remover" From 0ed079bdff7cd3002dda3288691e700b049e2b15 Mon Sep 17 00:00:00 2001 From: puppe1990 Date: Mon, 2 Sep 2024 13:32:29 -0300 Subject: [PATCH 2/4] update the package.json --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ae00fb77..b9e82a30 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "webpack-dev-server": "^4.11.1" }, "engines": { - "node": "20.9.0", - "yarn": "1.22.19" + "node": "22.2.0", + "yarn": "1.22.22" } -} +} \ No newline at end of file From 76068e6251f3653640e2e8a1b64e2c4b557e52df Mon Sep 17 00:00:00 2001 From: puppe1990 Date: Mon, 2 Sep 2024 13:47:59 -0300 Subject: [PATCH 3/4] update github workflow --- .github/workflows/main.yml | 4 ++-- app/controllers/orders_control_controller.rb | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1caa711..cd99aaa2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,10 +35,10 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: '20.9.0' + node-version: '22.2.0' cache: 'yarn' - run: | - npm install -g yarn@1.22.19 + npm install -g yarn@1.22.22 yarn install --check-files - name: Set up Ruby diff --git a/app/controllers/orders_control_controller.rb b/app/controllers/orders_control_controller.rb index bcc4723a..26ff5355 100644 --- a/app/controllers/orders_control_controller.rb +++ b/app/controllers/orders_control_controller.rb @@ -24,21 +24,24 @@ def show_orders_products_stock def show_pending_orders situation_id = params[:situation_id] store_id = params[:store_id] - + if situation_id.present? cleaned_situation_ids = situation_id.split(',').map(&:to_i) else cleaned_situation_ids = BlingOrderItem::Status::PENDING end - + pending_items = Item.includes(:bling_order_item).where(bling_order_items: { situation_id: cleaned_situation_ids }) - + if store_id.present? @pending_order_items = pending_items.where(bling_order_items: { store_id: store_id }) else @pending_order_items = pending_items end - + + @pending_order_items.each(&:mark_as_pending) + #Item.where.not(id: @pending_order_items.ids).each(&:mark_as_not_pending) + respond_to do |format| format.html # show.html.erb format.csv { send_data generate_csv(@pending_order_items), filename: "pending-orders-#{Date.today}.csv" } From 1fc1a3bbd2db6e17d07de054ab5d06e6d3e33fc9 Mon Sep 17 00:00:00 2001 From: puppe1990 Date: Mon, 2 Sep 2024 13:50:18 -0300 Subject: [PATCH 4/4] remove --- app/controllers/orders_control_controller.rb | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/controllers/orders_control_controller.rb b/app/controllers/orders_control_controller.rb index 26ff5355..bcc4723a 100644 --- a/app/controllers/orders_control_controller.rb +++ b/app/controllers/orders_control_controller.rb @@ -24,24 +24,21 @@ def show_orders_products_stock def show_pending_orders situation_id = params[:situation_id] store_id = params[:store_id] - + if situation_id.present? cleaned_situation_ids = situation_id.split(',').map(&:to_i) else cleaned_situation_ids = BlingOrderItem::Status::PENDING end - + pending_items = Item.includes(:bling_order_item).where(bling_order_items: { situation_id: cleaned_situation_ids }) - + if store_id.present? @pending_order_items = pending_items.where(bling_order_items: { store_id: store_id }) else @pending_order_items = pending_items end - - @pending_order_items.each(&:mark_as_pending) - #Item.where.not(id: @pending_order_items.ids).each(&:mark_as_not_pending) - + respond_to do |format| format.html # show.html.erb format.csv { send_data generate_csv(@pending_order_items), filename: "pending-orders-#{Date.today}.csv" }