solidus_bling 3.1.0 → 3.2
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 +4 -4
- data/app/models/solidus_bling/order.rb +8 -4
- data/lib/solidus_bling/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 35c7eb372c6064dce193bc26212d674fc52d640aa9a5b82e419df0c9687b5dff
|
|
4
|
+
data.tar.gz: 05d5eebd774563a202e33481f5dcf555db44c0af225aaab1a6657b46ddd35e82
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 339dd623af0910e3ddda55891b1879daa3ae7e0a5cc76e7f570afe24e151f23a20a763ab5314bfaacaa22da34f55cddce0f9c9803734bb7e3688ee9047a13de9
|
|
7
|
+
data.tar.gz: 6d82708caccccd65b6cd622f9fe89fcce74828bf495040dad9326f81d19eff00d46c1585cd362315d6eba716dfb84be27e288eb61af7a70bf5f77e865b69f8bb
|
|
@@ -15,7 +15,7 @@ module SolidusBling
|
|
|
15
15
|
observacoes_internas = internal_observations
|
|
16
16
|
transporte = shipment
|
|
17
17
|
|
|
18
|
-
BlingApi::Order.new(
|
|
18
|
+
bling_order = BlingApi::Order.new(
|
|
19
19
|
id_contato: contato.id,
|
|
20
20
|
items: items,
|
|
21
21
|
parcelas: parcelas,
|
|
@@ -26,11 +26,15 @@ module SolidusBling
|
|
|
26
26
|
id_loja: @account.external_store_id,
|
|
27
27
|
observacoes: "Número do pedido loja: #{@order.number}",
|
|
28
28
|
observacoes_internas: observacoes_internas,
|
|
29
|
-
valor_desconto: @order.adjustment_total,
|
|
29
|
+
valor_desconto: @order.adjustment_total.abs,
|
|
30
30
|
id_categoria: @account.incoming_category_id,
|
|
31
31
|
transporte: transporte,
|
|
32
32
|
id_vendedor: @account.sellers.first.external_id
|
|
33
33
|
).create
|
|
34
|
+
|
|
35
|
+
if bling_order
|
|
36
|
+
@order.update(bling_order_id: bling_order.id)
|
|
37
|
+
end
|
|
34
38
|
end
|
|
35
39
|
|
|
36
40
|
def costumer
|
|
@@ -84,7 +88,7 @@ module SolidusBling
|
|
|
84
88
|
"\n" \
|
|
85
89
|
"Forma de envio: #{@order.shipments.last.selected_shipping_rate.name}" \
|
|
86
90
|
"\n" +
|
|
87
|
-
build_cupons(@order.
|
|
91
|
+
build_cupons(@order.adjustments.where(source_type: "Spree::PromotionAction", eligible: true)).to_s +
|
|
88
92
|
"\n" +
|
|
89
93
|
build_order_url.to_s
|
|
90
94
|
end
|
|
@@ -149,7 +153,7 @@ module SolidusBling
|
|
|
149
153
|
def build_cupons cupons
|
|
150
154
|
string_cupons = ""
|
|
151
155
|
if !cupons.empty?
|
|
152
|
-
string_cupons = "Cupons utilizados: #{cupons.pluck(:
|
|
156
|
+
string_cupons = "Cupons utilizados: #{cupons.pluck(:label).join(", ")}"
|
|
153
157
|
end
|
|
154
158
|
string_cupons
|
|
155
159
|
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
|
+
version: '3.2'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hamilton Tumenas Borges
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-12-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: solidus_core
|