erp_integration 0.23.0 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2096b4545bfa5a63150bcd2886dd5deed9059053e26f47995e042b15f96bc0d
4
- data.tar.gz: deef70bcfd9f9ad467819fdc9b6668da3dd57351de17476867da5708821e78c0
3
+ metadata.gz: c712cc4dfcd1f43280c21bd1443004faba4782699f3d0aae9dcbba54ecbed6e0
4
+ data.tar.gz: 24b062f2319f76ab2ef68609ce8608a0cd8901f18221067614023af8dc88b130
5
5
  SHA512:
6
- metadata.gz: 6f81795073683f11e1ddb673bf14316f67f6e3787d76889cf389457c1d1d840cd813b8695643b0040620fb8bd06b098b4c556f3724121d8bc3f3ee39e99c13ba
7
- data.tar.gz: 416815c51a13e08b90d06d70ed2d64bd67d2505890a82cd2d81b1a1f86054eaec6a4edaf76329612ea2bed85354c845b6b0372d309dc2d4f04427c9e4dea0b07
6
+ metadata.gz: cc31e26866ebec699087586d42163b747335bbd46f0e504f88d78b68ce22bb76c914a26a6a2397e714536d2099d00d8b8f5919176eace0ee5e63a7699d8eabce
7
+ data.tar.gz: 245c31dd21124a52dbbe957307a4fd7e2267bdbde024135e0966f018c82c919828269aabf8de0989962783e9660d100453c3e9a9b58cc941f8ca121c3c2a3ea1
@@ -4,7 +4,6 @@ module ErpIntegration
4
4
  # The `ErpIntegration::ChannelListing` exposes an uniformed API for interaction with
5
5
  # third-party ERP vendors.
6
6
  class ChannelListing < Resource
7
- attr_accessor :availability_source, :bom, :id, :channel, :product,
8
- :quantity, :product_identifier
7
+ attr_accessor :id, :channel, :product, :quantity
9
8
  end
10
9
  end
@@ -28,9 +28,5 @@ module ErpIntegration
28
28
  :tpl_status, :tracking_export_status, :tracking_number, :tracking_number_blurb, :tsv,
29
29
  :ups_saturday_delivery, :warehouse, :warehouse_output, :warehouse_storage, :weight, :weight_digits,
30
30
  :weight_uom, :weight_uom_symbol, :write_date, :write_uid
31
-
32
- def generate_shipping_labels(ids)
33
- client.put('model/stock.shipment.out/generate_shipping_labels', [ids])
34
- end
35
31
  end
36
32
  end
@@ -18,5 +18,19 @@ module ErpIntegration
18
18
  :total_customs_value, :tpl_status, :tracking_number, :tsv, :warehouse, :warehouse_input,
19
19
  :warehouse_storage, :warehouse_type, :weight, :weight_digits, :weight_uom,
20
20
  :weight_uom_symbol, :write_date, :write_uid
21
+
22
+ # Generate a shipping label for a {CustomerShipmentReturn}.
23
+ #
24
+ # @param id [Integer] The ID of the {CustomerShipmentReturn}.
25
+ def generate_shipping_label(id)
26
+ self.class.adapter.generate_shipping_label(id)
27
+ end
28
+
29
+ # Generate a default package for a {CustomerShipmentReturn}.
30
+ #
31
+ # @param id [Integer] The ID of the {CustomerShipmentReturn}.
32
+ def create_default_package(id)
33
+ self.class.adapter.create_default_package(id)
34
+ end
21
35
  end
22
36
  end
@@ -7,10 +7,6 @@ module ErpIntegration
7
7
  module Resources
8
8
  class CustomerShipment < ApiResource
9
9
  self.model_name = 'stock.shipment.out'
10
-
11
- def generate_shipping_labels(ids)
12
- client.put('model/stock.shipment.out/generate_shipping_labels', ids)
13
- end
14
10
  end
15
11
  end
16
12
  end
@@ -7,6 +7,20 @@ module ErpIntegration
7
7
  module Resources
8
8
  class CustomerShipmentReturn < ApiResource
9
9
  self.model_name = 'stock.shipment.out.return'
10
+
11
+ def generate_shipping_label(id)
12
+ client.put("model/#{model_name}/#{id}/generate_shipping_labels")
13
+ true
14
+ # Workaround: Fulfil api does not return a json when status code is 200 (a.k.a. "Ok")
15
+ # and faraday is having an error when trying to parse it. Let's skip the parse error
16
+ # and move on.
17
+ rescue Faraday::ParsingError
18
+ true
19
+ end
20
+
21
+ def create_default_package(id)
22
+ client.put("model/#{model_name}/#{id}/create_default_packages")
23
+ end
10
24
  end
11
25
  end
12
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ErpIntegration
4
- VERSION = '0.23.0'
4
+ VERSION = '0.25.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erp_integration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.0
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Vermaas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-09 00:00:00.000000000 Z
11
+ date: 2023-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -342,7 +342,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
342
342
  - !ruby/object:Gem::Version
343
343
  version: '0'
344
344
  requirements: []
345
- rubygems_version: 3.3.7
345
+ rubygems_version: 3.2.22
346
346
  signing_key:
347
347
  specification_version: 4
348
348
  summary: Connects Mejuri with third-party ERP vendors