sapoci 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sapoci/item.rb +19 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1874225daa64d92bae4734aaf991d43b64c58dca
|
4
|
+
data.tar.gz: ae9ba882198c07506f95e951d1e11682624a2d71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 436fe98d93a451d50ff4b0a56ed812bac323c2c3f705016c74253b839207fc537981d46f7bb2522624ec633d7907a2b1b7d8e1d16690a84314e90f30eb07fae0
|
7
|
+
data.tar.gz: 4280c1591bfba1f2cae4e1d3dc46e3cb7f6c18ffbc9f7f1d51ef4cfd00c1f656d8260b6c6aa4c19b36b32d5477b53760d08476124affcf0570938f23e98c3745
|
data/lib/sapoci/item.rb
CHANGED
@@ -34,6 +34,7 @@ module SAPOCI
|
|
34
34
|
attr_accessor :sld_sys_name
|
35
35
|
attr_accessor :mps_sage_number
|
36
36
|
attr_accessor :mps_sage_contract
|
37
|
+
attr_accessor :tax_code
|
37
38
|
attr_accessor :cust_field1
|
38
39
|
attr_accessor :cust_field2
|
39
40
|
attr_accessor :cust_field3
|
@@ -138,6 +139,22 @@ module SAPOCI
|
|
138
139
|
self.service == "X"
|
139
140
|
end
|
140
141
|
|
142
|
+
def tax_rate
|
143
|
+
if defined?(@tax_rate)
|
144
|
+
BigDecimal.new("0#{@tax_rate.to_s.strip.gsub(/,/,'.')}")
|
145
|
+
else
|
146
|
+
BigDecimal.new("0.0")
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
def tax_rate=(value)
|
151
|
+
@tax_rate = value
|
152
|
+
end
|
153
|
+
|
154
|
+
def tax_rate_before_type_cast
|
155
|
+
@tax_rate
|
156
|
+
end
|
157
|
+
|
141
158
|
# Returns the item properties as HTML hidden field tags.
|
142
159
|
def to_html(options = {})
|
143
160
|
html = []
|
@@ -169,6 +186,8 @@ module SAPOCI
|
|
169
186
|
html << hidden_field_tag("SLD_SYS_NAME", self.sld_sys_name) unless self.sld_sys_name.blank?
|
170
187
|
html << hidden_field_tag("MPS_SAGE_NUMBER", self.mps_sage_number) unless self.mps_sage_number.blank?
|
171
188
|
html << hidden_field_tag("MPS_SAGE_CONTRACT", self.mps_sage_contract) unless self.mps_sage_contract.blank?
|
189
|
+
html << hidden_field_tag("TAX_RATE", "%.5f" % self.tax_rate) if self.tax_rate.to_f > 0
|
190
|
+
html << hidden_field_tag("TAX_CODE", self.tax_code) unless self.tax_code.blank?
|
172
191
|
html << hidden_field_tag("CUST_FIELD1", self.cust_field1) unless self.cust_field1.blank?
|
173
192
|
html << hidden_field_tag("CUST_FIELD2", self.cust_field2) unless self.cust_field2.blank?
|
174
193
|
html << hidden_field_tag("CUST_FIELD3", self.cust_field3) unless self.cust_field3.blank?
|