gotransverse-tract-api 0.20.2 → 0.20.3
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49320d13e8447d044fb4ace43f31c516e8122545
|
4
|
+
data.tar.gz: b57e6c0569e216a1b39adaf0ca59132bd11d40d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee969b37aff87f2fa6e50d105056509bfc9e75e42f473d36ee1bbeff93becff365cbe8bc660d455742e759f9443b267dd943540a0897ed6d8190ea046ff5b374
|
7
|
+
data.tar.gz: c7bfd8ad6f868394c77f4aac7f7bb3eaef1abb6522f205da6da31da6daf155313bb9e425f8423a4607a214689e147a0f874e213e64bb92451728903db086f777
|
@@ -56,7 +56,7 @@ module GoTransverseTractApi
|
|
56
56
|
orderDate: sales_order[:order_date],
|
57
57
|
orderStatus: sales_order[:order_status]
|
58
58
|
},
|
59
|
-
customFieldValues: BillingAccount::CustomFieldValue.get_custom_field_values(sales_order[:custom_field_values]),
|
59
|
+
customFieldValues: BillingAccount::CustomFieldValue.get_custom_field_values(sales_order[:custom_field_values]),
|
60
60
|
orderItems: {
|
61
61
|
attributes: {},
|
62
62
|
orderItem: get_order_items(sales_order[:order_items][:order_item])
|
@@ -95,15 +95,33 @@ module GoTransverseTractApi
|
|
95
95
|
# @param {Hash} obj (Order or Service or Billing Account)
|
96
96
|
#
|
97
97
|
def get_custom_field_values(obj={})
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
98
|
+
return obj if obj.empty?
|
99
|
+
|
100
|
+
if obj[:custom_field_value].is_a?(Hash)
|
101
|
+
return { attributes: {}, customFieldValue: get_custom_field_value(obj[:custom_field_value]) }
|
102
|
+
end
|
103
|
+
|
104
|
+
custom_fields_struct = { attributes: {}, customFieldValue: [] }
|
105
|
+
|
106
|
+
obj[:custom_field_value].each do|item|
|
107
|
+
custom_fields_struct[:customFieldValue] << {
|
108
|
+
customFieldValue: get_custom_field_value(item)
|
109
|
+
}
|
110
|
+
end
|
111
|
+
|
112
|
+
custom_fields_struct
|
113
|
+
end
|
114
|
+
|
115
|
+
#
|
116
|
+
# @param {Hash} field (custom_field_value)
|
117
|
+
#
|
118
|
+
def get_custom_field_value(field)
|
119
|
+
custom_field_value = {
|
120
|
+
attributes: {value: field[:value]},
|
121
|
+
customField: {eid: field[:custom_field][:eid]}
|
103
122
|
}
|
104
|
-
}
|
105
123
|
|
106
|
-
|
124
|
+
custom_field_value
|
107
125
|
end
|
108
126
|
end
|
109
127
|
|
@@ -119,7 +119,7 @@ module GoTransverseTractApi
|
|
119
119
|
# @param {Long} eid
|
120
120
|
# @param {Hash} sales_order
|
121
121
|
#
|
122
|
-
def add_custom_field_value(eid, sales_order)
|
122
|
+
def add_custom_field_value(eid, sales_order, custom_field_eid=nil)
|
123
123
|
data =
|
124
124
|
{
|
125
125
|
addCustomFieldValue: {},
|
@@ -127,6 +127,8 @@ module GoTransverseTractApi
|
|
127
127
|
customFieldValue: { value: sales_order[:value] }
|
128
128
|
}
|
129
129
|
|
130
|
+
data[:customField] = { eid: custom_field_eid } if custom_field_eid
|
131
|
+
|
130
132
|
xml_data = GoTransverseTractApi.generateXML(data,'addCustomFieldValue')
|
131
133
|
GoTransverseTractApi.post_request_for(self, {eid: eid}, xml_data, "addCustomFieldValue")
|
132
134
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gotransverse-tract-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien DeFrance
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-12-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|