Class: SAPOCI::Item
Instance Attribute Summary collapse
-
#attachment ⇒ Object
Returns the value of attribute attachment.
-
#attachment_purpose ⇒ Object
Returns the value of attribute attachment_purpose.
-
#attachment_title ⇒ Object
Returns the value of attribute attachment_title.
-
#contract ⇒ Object
Returns the value of attribute contract.
-
#contract_item ⇒ Object
Returns the value of attribute contract_item.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#cust_field1 ⇒ Object
Returns the value of attribute cust_field1.
-
#cust_field10 ⇒ Object
Returns the value of attribute cust_field10.
-
#cust_field11 ⇒ Object
Returns the value of attribute cust_field11.
-
#cust_field12 ⇒ Object
Returns the value of attribute cust_field12.
-
#cust_field13 ⇒ Object
Returns the value of attribute cust_field13.
-
#cust_field14 ⇒ Object
Returns the value of attribute cust_field14.
-
#cust_field15 ⇒ Object
Returns the value of attribute cust_field15.
-
#cust_field16 ⇒ Object
Returns the value of attribute cust_field16.
-
#cust_field17 ⇒ Object
Returns the value of attribute cust_field17.
-
#cust_field18 ⇒ Object
Returns the value of attribute cust_field18.
-
#cust_field19 ⇒ Object
Returns the value of attribute cust_field19.
-
#cust_field2 ⇒ Object
Returns the value of attribute cust_field2.
-
#cust_field20 ⇒ Object
Returns the value of attribute cust_field20.
-
#cust_field21 ⇒ Object
Returns the value of attribute cust_field21.
-
#cust_field22 ⇒ Object
Returns the value of attribute cust_field22.
-
#cust_field23 ⇒ Object
Returns the value of attribute cust_field23.
-
#cust_field24 ⇒ Object
Returns the value of attribute cust_field24.
-
#cust_field25 ⇒ Object
Returns the value of attribute cust_field25.
-
#cust_field26 ⇒ Object
Returns the value of attribute cust_field26.
-
#cust_field27 ⇒ Object
Returns the value of attribute cust_field27.
-
#cust_field28 ⇒ Object
Returns the value of attribute cust_field28.
-
#cust_field29 ⇒ Object
Returns the value of attribute cust_field29.
-
#cust_field3 ⇒ Object
Returns the value of attribute cust_field3.
-
#cust_field30 ⇒ Object
Returns the value of attribute cust_field30.
-
#cust_field31 ⇒ Object
Returns the value of attribute cust_field31.
-
#cust_field32 ⇒ Object
Returns the value of attribute cust_field32.
-
#cust_field33 ⇒ Object
Returns the value of attribute cust_field33.
-
#cust_field34 ⇒ Object
Returns the value of attribute cust_field34.
-
#cust_field35 ⇒ Object
Returns the value of attribute cust_field35.
-
#cust_field36 ⇒ Object
Returns the value of attribute cust_field36.
-
#cust_field37 ⇒ Object
Returns the value of attribute cust_field37.
-
#cust_field38 ⇒ Object
Returns the value of attribute cust_field38.
-
#cust_field39 ⇒ Object
Returns the value of attribute cust_field39.
-
#cust_field4 ⇒ Object
Returns the value of attribute cust_field4.
-
#cust_field40 ⇒ Object
Returns the value of attribute cust_field40.
-
#cust_field41 ⇒ Object
Returns the value of attribute cust_field41.
-
#cust_field42 ⇒ Object
Returns the value of attribute cust_field42.
-
#cust_field43 ⇒ Object
Returns the value of attribute cust_field43.
-
#cust_field44 ⇒ Object
Returns the value of attribute cust_field44.
-
#cust_field45 ⇒ Object
Returns the value of attribute cust_field45.
-
#cust_field46 ⇒ Object
Returns the value of attribute cust_field46.
-
#cust_field47 ⇒ Object
Returns the value of attribute cust_field47.
-
#cust_field48 ⇒ Object
Returns the value of attribute cust_field48.
-
#cust_field49 ⇒ Object
Returns the value of attribute cust_field49.
-
#cust_field5 ⇒ Object
Returns the value of attribute cust_field5.
-
#cust_field50 ⇒ Object
Returns the value of attribute cust_field50.
-
#cust_field6 ⇒ Object
Returns the value of attribute cust_field6.
-
#cust_field7 ⇒ Object
Returns the value of attribute cust_field7.
-
#cust_field8 ⇒ Object
Returns the value of attribute cust_field8.
-
#cust_field9 ⇒ Object
Returns the value of attribute cust_field9.
-
#description ⇒ Object
Returns the value of attribute description.
-
#ext_category ⇒ Object
Returns the value of attribute ext_category.
-
#ext_category_id ⇒ Object
Returns the value of attribute ext_category_id.
-
#ext_product_id ⇒ Object
Returns the value of attribute ext_product_id.
-
#ext_quote_id ⇒ Object
Returns the value of attribute ext_quote_id.
-
#ext_quote_item ⇒ Object
Returns the value of attribute ext_quote_item.
-
#ext_schema_type ⇒ Object
Returns the value of attribute ext_schema_type.
-
#fulfilled_by ⇒ Object
Returns the value of attribute fulfilled_by.
-
#gtin ⇒ Object
Returns the value of attribute gtin.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#longtext ⇒ Object
Returns the value of attribute longtext.
-
#manufactcode ⇒ Object
Returns the value of attribute manufactcode.
-
#manufactmat ⇒ Object
Returns the value of attribute manufactmat.
-
#matgroup ⇒ Object
Returns the value of attribute matgroup.
-
#matnr ⇒ Object
Returns the value of attribute matnr.
-
#mps_sage_contract ⇒ Object
Returns the value of attribute mps_sage_contract.
-
#mps_sage_number ⇒ Object
Returns the value of attribute mps_sage_number.
-
#service ⇒ Object
Returns the value of attribute service.
-
#sld_sys_name ⇒ Object
Returns the value of attribute sld_sys_name.
-
#sold_by ⇒ Object
Returns the value of attribute sold_by.
-
#tax_code ⇒ Object
Returns the value of attribute tax_code.
-
#unit ⇒ Object
Returns the value of attribute unit.
-
#vendor ⇒ Object
Returns the value of attribute vendor.
-
#vendormat ⇒ Object
Returns the value of attribute vendormat.
Instance Method Summary collapse
- #decimal(s) ⇒ Object
-
#initialize(index) ⇒ Item
constructor
Initializes the item.
- #leadtime ⇒ Object
- #leadtime=(value) ⇒ Object
- #leadtime_before_type_cast ⇒ Object
- #price ⇒ Object
- #price=(value) ⇒ Object
- #price_before_type_cast ⇒ Object
- #priceunit ⇒ Object
- #priceunit=(value) ⇒ Object
- #priceunit_before_type_cast ⇒ Object
- #quantity ⇒ Object
- #quantity=(value) ⇒ Object
- #quantity_before_type_cast ⇒ Object
- #service? ⇒ Boolean
- #tax_rate ⇒ Object
- #tax_rate=(value) ⇒ Object
- #tax_rate_before_type_cast ⇒ Object
-
#to_html(options = {}) ⇒ Object
Returns the item properties as HTML hidden field tags.
Constructor Details
#initialize(index) ⇒ Item
Initializes the item.
93 94 95 |
# File 'lib/sapoci/item.rb', line 93 def initialize(index) @index = index end |
Instance Attribute Details
#attachment ⇒ Object
Returns the value of attribute attachment.
28 29 30 |
# File 'lib/sapoci/item.rb', line 28 def @attachment end |
#attachment_purpose ⇒ Object
Returns the value of attribute attachment_purpose.
30 31 32 |
# File 'lib/sapoci/item.rb', line 30 def @attachment_purpose end |
#attachment_title ⇒ Object
Returns the value of attribute attachment_title.
29 30 31 |
# File 'lib/sapoci/item.rb', line 29 def @attachment_title end |
#contract ⇒ Object
Returns the value of attribute contract.
23 24 25 |
# File 'lib/sapoci/item.rb', line 23 def contract @contract end |
#contract_item ⇒ Object
Returns the value of attribute contract_item.
24 25 26 |
# File 'lib/sapoci/item.rb', line 24 def contract_item @contract_item end |
#currency ⇒ Object
Returns the value of attribute currency.
15 16 17 |
# File 'lib/sapoci/item.rb', line 15 def currency @currency end |
#cust_field1 ⇒ Object
Returns the value of attribute cust_field1.
41 42 43 |
# File 'lib/sapoci/item.rb', line 41 def cust_field1 @cust_field1 end |
#cust_field10 ⇒ Object
Returns the value of attribute cust_field10.
50 51 52 |
# File 'lib/sapoci/item.rb', line 50 def cust_field10 @cust_field10 end |
#cust_field11 ⇒ Object
Returns the value of attribute cust_field11.
51 52 53 |
# File 'lib/sapoci/item.rb', line 51 def cust_field11 @cust_field11 end |
#cust_field12 ⇒ Object
Returns the value of attribute cust_field12.
52 53 54 |
# File 'lib/sapoci/item.rb', line 52 def cust_field12 @cust_field12 end |
#cust_field13 ⇒ Object
Returns the value of attribute cust_field13.
53 54 55 |
# File 'lib/sapoci/item.rb', line 53 def cust_field13 @cust_field13 end |
#cust_field14 ⇒ Object
Returns the value of attribute cust_field14.
54 55 56 |
# File 'lib/sapoci/item.rb', line 54 def cust_field14 @cust_field14 end |
#cust_field15 ⇒ Object
Returns the value of attribute cust_field15.
55 56 57 |
# File 'lib/sapoci/item.rb', line 55 def cust_field15 @cust_field15 end |
#cust_field16 ⇒ Object
Returns the value of attribute cust_field16.
56 57 58 |
# File 'lib/sapoci/item.rb', line 56 def cust_field16 @cust_field16 end |
#cust_field17 ⇒ Object
Returns the value of attribute cust_field17.
57 58 59 |
# File 'lib/sapoci/item.rb', line 57 def cust_field17 @cust_field17 end |
#cust_field18 ⇒ Object
Returns the value of attribute cust_field18.
58 59 60 |
# File 'lib/sapoci/item.rb', line 58 def cust_field18 @cust_field18 end |
#cust_field19 ⇒ Object
Returns the value of attribute cust_field19.
59 60 61 |
# File 'lib/sapoci/item.rb', line 59 def cust_field19 @cust_field19 end |
#cust_field2 ⇒ Object
Returns the value of attribute cust_field2.
42 43 44 |
# File 'lib/sapoci/item.rb', line 42 def cust_field2 @cust_field2 end |
#cust_field20 ⇒ Object
Returns the value of attribute cust_field20.
60 61 62 |
# File 'lib/sapoci/item.rb', line 60 def cust_field20 @cust_field20 end |
#cust_field21 ⇒ Object
Returns the value of attribute cust_field21.
61 62 63 |
# File 'lib/sapoci/item.rb', line 61 def cust_field21 @cust_field21 end |
#cust_field22 ⇒ Object
Returns the value of attribute cust_field22.
62 63 64 |
# File 'lib/sapoci/item.rb', line 62 def cust_field22 @cust_field22 end |
#cust_field23 ⇒ Object
Returns the value of attribute cust_field23.
63 64 65 |
# File 'lib/sapoci/item.rb', line 63 def cust_field23 @cust_field23 end |
#cust_field24 ⇒ Object
Returns the value of attribute cust_field24.
64 65 66 |
# File 'lib/sapoci/item.rb', line 64 def cust_field24 @cust_field24 end |
#cust_field25 ⇒ Object
Returns the value of attribute cust_field25.
65 66 67 |
# File 'lib/sapoci/item.rb', line 65 def cust_field25 @cust_field25 end |
#cust_field26 ⇒ Object
Returns the value of attribute cust_field26.
66 67 68 |
# File 'lib/sapoci/item.rb', line 66 def cust_field26 @cust_field26 end |
#cust_field27 ⇒ Object
Returns the value of attribute cust_field27.
67 68 69 |
# File 'lib/sapoci/item.rb', line 67 def cust_field27 @cust_field27 end |
#cust_field28 ⇒ Object
Returns the value of attribute cust_field28.
68 69 70 |
# File 'lib/sapoci/item.rb', line 68 def cust_field28 @cust_field28 end |
#cust_field29 ⇒ Object
Returns the value of attribute cust_field29.
69 70 71 |
# File 'lib/sapoci/item.rb', line 69 def cust_field29 @cust_field29 end |
#cust_field3 ⇒ Object
Returns the value of attribute cust_field3.
43 44 45 |
# File 'lib/sapoci/item.rb', line 43 def cust_field3 @cust_field3 end |
#cust_field30 ⇒ Object
Returns the value of attribute cust_field30.
70 71 72 |
# File 'lib/sapoci/item.rb', line 70 def cust_field30 @cust_field30 end |
#cust_field31 ⇒ Object
Returns the value of attribute cust_field31.
71 72 73 |
# File 'lib/sapoci/item.rb', line 71 def cust_field31 @cust_field31 end |
#cust_field32 ⇒ Object
Returns the value of attribute cust_field32.
72 73 74 |
# File 'lib/sapoci/item.rb', line 72 def cust_field32 @cust_field32 end |
#cust_field33 ⇒ Object
Returns the value of attribute cust_field33.
73 74 75 |
# File 'lib/sapoci/item.rb', line 73 def cust_field33 @cust_field33 end |
#cust_field34 ⇒ Object
Returns the value of attribute cust_field34.
74 75 76 |
# File 'lib/sapoci/item.rb', line 74 def cust_field34 @cust_field34 end |
#cust_field35 ⇒ Object
Returns the value of attribute cust_field35.
75 76 77 |
# File 'lib/sapoci/item.rb', line 75 def cust_field35 @cust_field35 end |
#cust_field36 ⇒ Object
Returns the value of attribute cust_field36.
76 77 78 |
# File 'lib/sapoci/item.rb', line 76 def cust_field36 @cust_field36 end |
#cust_field37 ⇒ Object
Returns the value of attribute cust_field37.
77 78 79 |
# File 'lib/sapoci/item.rb', line 77 def cust_field37 @cust_field37 end |
#cust_field38 ⇒ Object
Returns the value of attribute cust_field38.
78 79 80 |
# File 'lib/sapoci/item.rb', line 78 def cust_field38 @cust_field38 end |
#cust_field39 ⇒ Object
Returns the value of attribute cust_field39.
79 80 81 |
# File 'lib/sapoci/item.rb', line 79 def cust_field39 @cust_field39 end |
#cust_field4 ⇒ Object
Returns the value of attribute cust_field4.
44 45 46 |
# File 'lib/sapoci/item.rb', line 44 def cust_field4 @cust_field4 end |
#cust_field40 ⇒ Object
Returns the value of attribute cust_field40.
80 81 82 |
# File 'lib/sapoci/item.rb', line 80 def cust_field40 @cust_field40 end |
#cust_field41 ⇒ Object
Returns the value of attribute cust_field41.
81 82 83 |
# File 'lib/sapoci/item.rb', line 81 def cust_field41 @cust_field41 end |
#cust_field42 ⇒ Object
Returns the value of attribute cust_field42.
82 83 84 |
# File 'lib/sapoci/item.rb', line 82 def cust_field42 @cust_field42 end |
#cust_field43 ⇒ Object
Returns the value of attribute cust_field43.
83 84 85 |
# File 'lib/sapoci/item.rb', line 83 def cust_field43 @cust_field43 end |
#cust_field44 ⇒ Object
Returns the value of attribute cust_field44.
84 85 86 |
# File 'lib/sapoci/item.rb', line 84 def cust_field44 @cust_field44 end |
#cust_field45 ⇒ Object
Returns the value of attribute cust_field45.
85 86 87 |
# File 'lib/sapoci/item.rb', line 85 def cust_field45 @cust_field45 end |
#cust_field46 ⇒ Object
Returns the value of attribute cust_field46.
86 87 88 |
# File 'lib/sapoci/item.rb', line 86 def cust_field46 @cust_field46 end |
#cust_field47 ⇒ Object
Returns the value of attribute cust_field47.
87 88 89 |
# File 'lib/sapoci/item.rb', line 87 def cust_field47 @cust_field47 end |
#cust_field48 ⇒ Object
Returns the value of attribute cust_field48.
88 89 90 |
# File 'lib/sapoci/item.rb', line 88 def cust_field48 @cust_field48 end |
#cust_field49 ⇒ Object
Returns the value of attribute cust_field49.
89 90 91 |
# File 'lib/sapoci/item.rb', line 89 def cust_field49 @cust_field49 end |
#cust_field5 ⇒ Object
Returns the value of attribute cust_field5.
45 46 47 |
# File 'lib/sapoci/item.rb', line 45 def cust_field5 @cust_field5 end |
#cust_field50 ⇒ Object
Returns the value of attribute cust_field50.
90 91 92 |
# File 'lib/sapoci/item.rb', line 90 def cust_field50 @cust_field50 end |
#cust_field6 ⇒ Object
Returns the value of attribute cust_field6.
46 47 48 |
# File 'lib/sapoci/item.rb', line 46 def cust_field6 @cust_field6 end |
#cust_field7 ⇒ Object
Returns the value of attribute cust_field7.
47 48 49 |
# File 'lib/sapoci/item.rb', line 47 def cust_field7 @cust_field7 end |
#cust_field8 ⇒ Object
Returns the value of attribute cust_field8.
48 49 50 |
# File 'lib/sapoci/item.rb', line 48 def cust_field8 @cust_field8 end |
#cust_field9 ⇒ Object
Returns the value of attribute cust_field9.
49 50 51 |
# File 'lib/sapoci/item.rb', line 49 def cust_field9 @cust_field9 end |
#description ⇒ Object
Returns the value of attribute description.
12 13 14 |
# File 'lib/sapoci/item.rb', line 12 def description @description end |
#ext_category ⇒ Object
Returns the value of attribute ext_category.
33 34 35 |
# File 'lib/sapoci/item.rb', line 33 def ext_category @ext_category end |
#ext_category_id ⇒ Object
Returns the value of attribute ext_category_id.
32 33 34 |
# File 'lib/sapoci/item.rb', line 32 def ext_category_id @ext_category_id end |
#ext_product_id ⇒ Object
Returns the value of attribute ext_product_id.
27 28 29 |
# File 'lib/sapoci/item.rb', line 27 def ext_product_id @ext_product_id end |
#ext_quote_id ⇒ Object
Returns the value of attribute ext_quote_id.
25 26 27 |
# File 'lib/sapoci/item.rb', line 25 def ext_quote_id @ext_quote_id end |
#ext_quote_item ⇒ Object
Returns the value of attribute ext_quote_item.
26 27 28 |
# File 'lib/sapoci/item.rb', line 26 def ext_quote_item @ext_quote_item end |
#ext_schema_type ⇒ Object
Returns the value of attribute ext_schema_type.
31 32 33 |
# File 'lib/sapoci/item.rb', line 31 def ext_schema_type @ext_schema_type end |
#fulfilled_by ⇒ Object
Returns the value of attribute fulfilled_by.
39 40 41 |
# File 'lib/sapoci/item.rb', line 39 def fulfilled_by @fulfilled_by end |
#gtin ⇒ Object
Returns the value of attribute gtin.
40 41 42 |
# File 'lib/sapoci/item.rb', line 40 def gtin @gtin end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
11 12 13 |
# File 'lib/sapoci/item.rb', line 11 def index @index end |
#longtext ⇒ Object
Returns the value of attribute longtext.
16 17 18 |
# File 'lib/sapoci/item.rb', line 16 def longtext @longtext end |
#manufactcode ⇒ Object
Returns the value of attribute manufactcode.
19 20 21 |
# File 'lib/sapoci/item.rb', line 19 def manufactcode @manufactcode end |
#manufactmat ⇒ Object
Returns the value of attribute manufactmat.
20 21 22 |
# File 'lib/sapoci/item.rb', line 20 def manufactmat @manufactmat end |
#matgroup ⇒ Object
Returns the value of attribute matgroup.
21 22 23 |
# File 'lib/sapoci/item.rb', line 21 def matgroup @matgroup end |
#matnr ⇒ Object
Returns the value of attribute matnr.
13 14 15 |
# File 'lib/sapoci/item.rb', line 13 def matnr @matnr end |
#mps_sage_contract ⇒ Object
Returns the value of attribute mps_sage_contract.
36 37 38 |
# File 'lib/sapoci/item.rb', line 36 def mps_sage_contract @mps_sage_contract end |
#mps_sage_number ⇒ Object
Returns the value of attribute mps_sage_number.
35 36 37 |
# File 'lib/sapoci/item.rb', line 35 def mps_sage_number @mps_sage_number end |
#service ⇒ Object
Returns the value of attribute service.
22 23 24 |
# File 'lib/sapoci/item.rb', line 22 def service @service end |
#sld_sys_name ⇒ Object
Returns the value of attribute sld_sys_name.
34 35 36 |
# File 'lib/sapoci/item.rb', line 34 def sld_sys_name @sld_sys_name end |
#sold_by ⇒ Object
Returns the value of attribute sold_by.
38 39 40 |
# File 'lib/sapoci/item.rb', line 38 def sold_by @sold_by end |
#tax_code ⇒ Object
Returns the value of attribute tax_code.
37 38 39 |
# File 'lib/sapoci/item.rb', line 37 def tax_code @tax_code end |
#unit ⇒ Object
Returns the value of attribute unit.
14 15 16 |
# File 'lib/sapoci/item.rb', line 14 def unit @unit end |
#vendor ⇒ Object
Returns the value of attribute vendor.
17 18 19 |
# File 'lib/sapoci/item.rb', line 17 def vendor @vendor end |
#vendormat ⇒ Object
Returns the value of attribute vendormat.
18 19 20 |
# File 'lib/sapoci/item.rb', line 18 def vendormat @vendormat end |
Instance Method Details
#decimal(s) ⇒ Object
97 98 99 100 101 102 103 |
# File 'lib/sapoci/item.rb', line 97 def decimal(s) if RUBY_VERSION >= '2.5' BigDecimal(s) else BigDecimal.new(s) end end |
#leadtime ⇒ Object
153 154 155 156 157 158 159 |
# File 'lib/sapoci/item.rb', line 153 def leadtime if defined?(@leadtime) && @leadtime @leadtime.to_i else 0 end end |
#leadtime=(value) ⇒ Object
161 162 163 |
# File 'lib/sapoci/item.rb', line 161 def leadtime=(value) @leadtime = value end |
#leadtime_before_type_cast ⇒ Object
165 166 167 |
# File 'lib/sapoci/item.rb', line 165 def leadtime_before_type_cast @leadtime end |
#price ⇒ Object
121 122 123 124 125 126 127 |
# File 'lib/sapoci/item.rb', line 121 def price if defined?(@price) decimal("0#{@price.to_s.strip.gsub(/,/,'.')}") else decimal("0.0") end end |
#price=(value) ⇒ Object
129 130 131 |
# File 'lib/sapoci/item.rb', line 129 def price=(value) @price = value end |
#price_before_type_cast ⇒ Object
133 134 135 |
# File 'lib/sapoci/item.rb', line 133 def price_before_type_cast @price end |
#priceunit ⇒ Object
137 138 139 140 141 142 143 |
# File 'lib/sapoci/item.rb', line 137 def priceunit if defined?(@priceunit) decimal("0#{@priceunit.to_s.strip.gsub(/,/,'.')}").nonzero? || 1 else 1 end end |
#priceunit=(value) ⇒ Object
145 146 147 |
# File 'lib/sapoci/item.rb', line 145 def priceunit=(value) @priceunit = value end |
#priceunit_before_type_cast ⇒ Object
149 150 151 |
# File 'lib/sapoci/item.rb', line 149 def priceunit_before_type_cast @priceunit end |
#quantity ⇒ Object
105 106 107 108 109 110 111 |
# File 'lib/sapoci/item.rb', line 105 def quantity if defined?(@quantity) decimal("0#{@quantity.to_s.strip.gsub(/,/,'.')}") else decimal("0.0") end end |
#quantity=(value) ⇒ Object
113 114 115 |
# File 'lib/sapoci/item.rb', line 113 def quantity=(value) @quantity = value end |
#quantity_before_type_cast ⇒ Object
117 118 119 |
# File 'lib/sapoci/item.rb', line 117 def quantity_before_type_cast @quantity end |
#service? ⇒ Boolean
169 170 171 |
# File 'lib/sapoci/item.rb', line 169 def service? self.service == "X" end |
#tax_rate ⇒ Object
173 174 175 176 177 178 179 |
# File 'lib/sapoci/item.rb', line 173 def tax_rate if defined?(@tax_rate) decimal("0#{@tax_rate.to_s.strip.gsub(/,/,'.')}") else decimal("0.0") end end |
#tax_rate=(value) ⇒ Object
181 182 183 |
# File 'lib/sapoci/item.rb', line 181 def tax_rate=(value) @tax_rate = value end |
#tax_rate_before_type_cast ⇒ Object
185 186 187 |
# File 'lib/sapoci/item.rb', line 185 def tax_rate_before_type_cast @tax_rate end |
#to_html(options = {}) ⇒ Object
Returns the item properties as HTML hidden field tags.
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/sapoci/item.rb', line 190 def to_html( = {}) html = [] html << hidden_field_tag("DESCRIPTION", self.description) unless self.description.blank? html << hidden_field_tag("MATNR", self.matnr) unless self.matnr.blank? html << hidden_field_tag("QUANTITY", "%015.3f" % self.quantity) html << hidden_field_tag("UNIT", self.unit) unless self.unit.blank? html << hidden_field_tag("PRICE", "%015.3f" % self.price) html << hidden_field_tag("CURRENCY", self.currency) unless self.currency.blank? html << hidden_field_tag("PRICEUNIT", self.priceunit.to_i) if self.priceunit.to_i > 0 html << hidden_field_tag("LEADTIME", "%05d" % self.leadtime) if self.leadtime.to_i > 0 html << hidden_field_tag("VENDOR", self.vendor) unless self.vendor.blank? html << hidden_field_tag("VENDORMAT", self.vendormat) unless self.vendormat.blank? html << hidden_field_tag("MANUFACTCODE", self.manufactcode) unless self.manufactcode.blank? html << hidden_field_tag("MANUFACTMAT", self.manufactmat) unless self.manufactmat.blank? html << hidden_field_tag("MATGROUP", self.matgroup) unless self.matgroup.blank? html << hidden_field_tag("SERVICE", "X") if self.service? html << hidden_field_tag("CONTRACT", self.contract) unless self.contract.blank? html << hidden_field_tag("CONTRACT_ITEM", self.contract_item) unless self.contract_item.blank? html << hidden_field_tag("EXT_QUOTE_ID", self.ext_quote_id) unless self.ext_quote_id.blank? html << hidden_field_tag("EXT_QUOTE_ITEM", self.ext_quote_item) unless self.ext_quote_item.blank? html << hidden_field_tag("EXT_PRODUCT_ID", self.ext_product_id) unless self.ext_product_id.blank? html << hidden_field_tag("ATTACHMENT", self.) unless self..blank? html << hidden_field_tag("ATTACHMENT_TITLE", self.) unless self..blank? html << hidden_field_tag("ATTACHMENT_PURPOSE", self.) unless self..blank? html << hidden_field_tag("EXT_SCHEMA_TYPE", self.ext_schema_type) unless self.ext_schema_type.blank? html << hidden_field_tag("EXT_CATEGORY_ID", self.ext_category_id) unless self.ext_category_id.blank? html << hidden_field_tag("EXT_CATEGORY", self.ext_category) unless self.ext_category.blank? html << hidden_field_tag("SLD_SYS_NAME", self.sld_sys_name) unless self.sld_sys_name.blank? html << hidden_field_tag("MPS_SAGE_NUMBER", self.mps_sage_number) unless self.mps_sage_number.blank? html << hidden_field_tag("MPS_SAGE_CONTRACT", self.mps_sage_contract) unless self.mps_sage_contract.blank? html << hidden_field_tag("TAX_RATE", "%.5f" % self.tax_rate) if self.tax_rate.to_f > 0 html << hidden_field_tag("TAX_CODE", self.tax_code) unless self.tax_code.blank? html << hidden_field_tag("SOLD_BY", self.sold_by) unless self.sold_by.blank? html << hidden_field_tag("FULFILLED_BY", self.fulfilled_by) unless self.fulfilled_by.blank? html << hidden_field_tag("GTIN", self.gtin) unless self.gtin.blank? html << hidden_field_tag("CUST_FIELD1", self.cust_field1) unless self.cust_field1.blank? html << hidden_field_tag("CUST_FIELD2", self.cust_field2) unless self.cust_field2.blank? html << hidden_field_tag("CUST_FIELD3", self.cust_field3) unless self.cust_field3.blank? html << hidden_field_tag("CUST_FIELD4", self.cust_field4) unless self.cust_field4.blank? html << hidden_field_tag("CUST_FIELD5", self.cust_field5) unless self.cust_field5.blank? html << hidden_field_tag("CUST_FIELD6", self.cust_field6) unless self.cust_field6.blank? html << hidden_field_tag("CUST_FIELD7", self.cust_field7) unless self.cust_field7.blank? html << hidden_field_tag("CUST_FIELD8", self.cust_field8) unless self.cust_field8.blank? html << hidden_field_tag("CUST_FIELD9", self.cust_field9) unless self.cust_field9.blank? html << hidden_field_tag("CUST_FIELD10", self.cust_field10) unless self.cust_field10.blank? html << hidden_field_tag("CUST_FIELD11", self.cust_field11) unless self.cust_field11.blank? html << hidden_field_tag("CUST_FIELD12", self.cust_field12) unless self.cust_field12.blank? html << hidden_field_tag("CUST_FIELD13", self.cust_field13) unless self.cust_field13.blank? html << hidden_field_tag("CUST_FIELD14", self.cust_field14) unless self.cust_field14.blank? html << hidden_field_tag("CUST_FIELD15", self.cust_field15) unless self.cust_field15.blank? html << hidden_field_tag("CUST_FIELD16", self.cust_field16) unless self.cust_field16.blank? html << hidden_field_tag("CUST_FIELD17", self.cust_field17) unless self.cust_field17.blank? html << hidden_field_tag("CUST_FIELD18", self.cust_field18) unless self.cust_field18.blank? html << hidden_field_tag("CUST_FIELD19", self.cust_field19) unless self.cust_field19.blank? html << hidden_field_tag("CUST_FIELD20", self.cust_field20) unless self.cust_field20.blank? html << hidden_field_tag("CUST_FIELD21", self.cust_field21) unless self.cust_field21.blank? html << hidden_field_tag("CUST_FIELD22", self.cust_field22) unless self.cust_field22.blank? html << hidden_field_tag("CUST_FIELD23", self.cust_field23) unless self.cust_field23.blank? html << hidden_field_tag("CUST_FIELD24", self.cust_field24) unless self.cust_field24.blank? html << hidden_field_tag("CUST_FIELD25", self.cust_field25) unless self.cust_field25.blank? html << hidden_field_tag("CUST_FIELD26", self.cust_field26) unless self.cust_field26.blank? html << hidden_field_tag("CUST_FIELD27", self.cust_field27) unless self.cust_field27.blank? html << hidden_field_tag("CUST_FIELD28", self.cust_field28) unless self.cust_field28.blank? html << hidden_field_tag("CUST_FIELD29", self.cust_field29) unless self.cust_field29.blank? html << hidden_field_tag("CUST_FIELD30", self.cust_field30) unless self.cust_field30.blank? html << hidden_field_tag("CUST_FIELD31", self.cust_field31) unless self.cust_field31.blank? html << hidden_field_tag("CUST_FIELD32", self.cust_field32) unless self.cust_field32.blank? html << hidden_field_tag("CUST_FIELD33", self.cust_field33) unless self.cust_field33.blank? html << hidden_field_tag("CUST_FIELD34", self.cust_field34) unless self.cust_field34.blank? html << hidden_field_tag("CUST_FIELD35", self.cust_field35) unless self.cust_field35.blank? html << hidden_field_tag("CUST_FIELD36", self.cust_field36) unless self.cust_field36.blank? html << hidden_field_tag("CUST_FIELD37", self.cust_field37) unless self.cust_field37.blank? html << hidden_field_tag("CUST_FIELD38", self.cust_field38) unless self.cust_field38.blank? html << hidden_field_tag("CUST_FIELD39", self.cust_field39) unless self.cust_field39.blank? html << hidden_field_tag("CUST_FIELD40", self.cust_field40) unless self.cust_field40.blank? html << hidden_field_tag("CUST_FIELD41", self.cust_field41) unless self.cust_field41.blank? html << hidden_field_tag("CUST_FIELD42", self.cust_field42) unless self.cust_field42.blank? html << hidden_field_tag("CUST_FIELD43", self.cust_field43) unless self.cust_field43.blank? html << hidden_field_tag("CUST_FIELD44", self.cust_field44) unless self.cust_field44.blank? html << hidden_field_tag("CUST_FIELD45", self.cust_field45) unless self.cust_field45.blank? html << hidden_field_tag("CUST_FIELD46", self.cust_field46) unless self.cust_field46.blank? html << hidden_field_tag("CUST_FIELD47", self.cust_field47) unless self.cust_field47.blank? html << hidden_field_tag("CUST_FIELD48", self.cust_field48) unless self.cust_field48.blank? html << hidden_field_tag("CUST_FIELD49", self.cust_field49) unless self.cust_field49.blank? html << hidden_field_tag("CUST_FIELD50", self.cust_field50) unless self.cust_field50.blank? html << "<input type=\"hidden\" name=\"NEW_ITEM-LONGTEXT_#{index + 1}:132[]\" value=\"#{escape_html(self.longtext)}\" />" unless self.longtext.blank? html.join end |