Class: Quickeebooks::Windows::Model::Item

Inherits:
IntuitType
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/quickeebooks/windows/model/item.rb

Constant Summary collapse

XML_COLLECTION_NODE =
'Items'
XML_NODE =
'Item'
REST_RESOURCE =
"item"

Instance Method Summary collapse

Methods included from Logging

#log

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/quickeebooks/windows/model/item.rb', line 67

def active?
  active == "true"
end

#draft?Boolean

Returns:

  • (Boolean)


71
72
73
# File 'lib/quickeebooks/windows/model/item.rb', line 71

def draft?
  draft == "true"
end

Returns:

  • (Boolean)


75
76
77
# File 'lib/quickeebooks/windows/model/item.rb', line 75

def print_grouped_items?
  print_grouped_items == "true"
end

#synchronized?Boolean

Returns:

  • (Boolean)


79
80
81
# File 'lib/quickeebooks/windows/model/item.rb', line 79

def synchronized?
  synchronized == "true"
end

#taxable?Boolean

Returns:

  • (Boolean)


63
64
65
# File 'lib/quickeebooks/windows/model/item.rb', line 63

def taxable?
  taxable == "true"
end

#to_xml_ns(options = {}) ⇒ Object



53
54
55
# File 'lib/quickeebooks/windows/model/item.rb', line 53

def to_xml_ns(options = {})
  to_xml(options)
end

#valid_for_deletion?Boolean

To delete a record Intuit requires we provide Id and SyncToken fields

Returns:

  • (Boolean)


58
59
60
61
# File 'lib/quickeebooks/windows/model/item.rb', line 58

def valid_for_deletion?
  return false if(id.nil? || sync_token.nil?)
  id.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0
end