solidus_bling 3.4.4 → 3.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39972f690b188582eb90995659ea1f965d304b6739cfd1ed758f40fc667c0191
4
- data.tar.gz: 199818222481a6e2a8dc44c4eeae4e2fb7ee0fd38515d6bc1d9db9713b6519fc
3
+ metadata.gz: 86fb55a042d40aa34d5eaf3c1dc697d189a8ab9d5bdf551410871eb002b816bd
4
+ data.tar.gz: b95270aa77365172bdab967704f0ad64ee4e3b26cef5daed44a007c80fd5892e
5
5
  SHA512:
6
- metadata.gz: adca05171481ba6bd6f08aff36f050ef95ac0f30aa2233f5c660cbae4079212ed27e452a9360714b41cf4067459766885c33b47c1fb242a3ae6c017ac77e64f8
7
- data.tar.gz: 390625e14a64fb80333a4de9f9d0d9470bd528f2bd43beba00117732209b610a94b837b56f04df13e9e2fcc1dde088b659b5580d8d4672888372e3ccf5dff896
6
+ metadata.gz: 64986dd4c0f9177c8ae667c8414d6b28e4aad0c0e821f614241c29ae426ebb8325993c0c3e4943dd8b7b7a1e2ce64bffc82a069de49c0faec72aca5cf141d536
7
+ data.tar.gz: f76a22b611035be87d7a326bb67441807df7b4ef115be32454a4b93691abc14b2716f0d929ab35a02a095400fe62a0bbad4b7c857bf00944d4f44aa402fab858
@@ -74,8 +74,8 @@ module Spree
74
74
 
75
75
  def account_params
76
76
  params.require(:account).permit(
77
- :client_id, :client_secret, :refresh_token, :redirect_url, :state, :access_token, :api_key, :external_store_id, :incoming_category_id,
78
- payment_methods_attributes: [:id, :spree_payment_method_id, :external_id],
77
+ :client_id, :client_secret, :refresh_token, :redirect_url, :state, :access_token, :api_key, :external_store_id,
78
+ payment_methods_attributes: [:id, :spree_payment_method_id, :external_id, :incoming_category_id],
79
79
  shipping_methods_attributes: [:id, :spree_shipping_method_id, :alias, :company],
80
80
  sellers_attributes: [:id, :name, :external_id]
81
81
  )
@@ -15,6 +15,7 @@ module SolidusBling
15
15
  observacoes_internas = internal_observations
16
16
  transporte = shipment
17
17
  id_vendedor = seller_external_id
18
+ id_categoria_receita = @account.payment_methods.find_by(spree_payment_method_id: @order.payments.last.payment_method_id).incoming_category_id
18
19
 
19
20
  bling_order = BlingApi::Order.new(
20
21
  id_contato: contato.id,
@@ -30,7 +31,7 @@ module SolidusBling
30
31
  observacoes: "Número do pedido loja: #{@order.number}",
31
32
  observacoes_internas: observacoes_internas,
32
33
  valor_desconto: @order.adjustment_total.abs,
33
- id_categoria: @account.incoming_category_id,
34
+ id_categoria: id_categoria_receita,
34
35
  transporte: transporte,
35
36
  id_vendedor: id_vendedor
36
37
  ).create
@@ -25,13 +25,6 @@
25
25
  <%= form.text_field :external_store_id, required: true, class: 'fullwidth' %>
26
26
  <%= form.error_message_on :external_store_id %>
27
27
  <% end %>
28
-
29
- <%= form.field_container :incoming_category_id do %>
30
- <%= form.label :incoming_category_id, "ID Categoria Receita", class: 'required' %>
31
- <%= form.text_field :incoming_category_id, required: true, class: 'fullwidth' %>
32
- <%= form.error_message_on :incoming_category_id %>
33
- <% end %>
34
-
35
28
  </div>
36
29
 
37
30
  <div class="col-12 col-md-6">
@@ -76,18 +69,24 @@
76
69
  </legend>
77
70
  <%= form.fields_for :payment_methods do |payment_form| %>
78
71
  <div class="row">
79
- <div class="col-12 col-md-6">
72
+ <div class="col-12 col-md-4">
80
73
  <div class="field">
81
74
  <%= payment_form.label :spree_payment_method_id, "Método de Pagamento", class: 'required' %>
82
75
  <%= payment_form.select :spree_payment_method_id, @payment_methods, {}, { class: "custom-select fullwidth" } %>
83
76
  </div>
84
77
  </div>
85
- <div class="col-12 col-md-6">
78
+ <div class="col-12 col-md-4">
86
79
  <div class="field">
87
80
  <%= payment_form.label :external_id, "ID Forma de Pagamento", class: 'required' %>
88
81
  <%= payment_form.text_field :external_id, required: true, class:"fullwidth" %>
89
82
  </div>
90
83
  </div>
84
+ <div class="col-12 col-md-4">
85
+ <div class="field">
86
+ <%= payment_form.label :incoming_category_id, "ID Categoria Receita", class: 'required' %>
87
+ <%= payment_form.text_field :incoming_category_id, required: true, class:"fullwidth" %>
88
+ </div>
89
+ </div>
91
90
  </div>
92
91
  <% end %>
93
92
  </fieldset>
@@ -0,0 +1,5 @@
1
+ class AddIncomingCategoryIdOnPaymentMethod < ActiveRecord::Migration[7.1]
2
+ def change
3
+ add_column :solidus_bling_payment_methods, :incoming_category_id, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class RemoveIncomingCategoryIdFromAccount < ActiveRecord::Migration[7.1]
2
+ def change
3
+ remove_column :solidus_bling_accounts, :incoming_category_id, :string
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusBling
4
- VERSION = "3.4.4"
4
+ VERSION = "3.4.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_bling
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.4
4
+ version: 3.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todas Essas Coisas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-23 00:00:00.000000000 Z
11
+ date: 2024-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_core
@@ -151,6 +151,8 @@ files:
151
151
  - db/migrate/20240318171147_add_solidus_bling_seller_id_to_orders.rb
152
152
  - db/migrate/20240318180555_add_deafult_column_to_sellers.rb
153
153
  - db/migrate/20240424112257_add_active_column_to_sellers.rb
154
+ - db/migrate/20240830124253_add_incoming_category_id_on_payment_method.rb
155
+ - db/migrate/20240830124611_remove_incoming_category_id_from_account.rb
154
156
  - lib/generators/solidus_bling/install/install_generator.rb
155
157
  - lib/generators/solidus_bling/install/templates/initializer.rb
156
158
  - lib/solidus_bling.rb