Class: Quickeebooks::Windows::Service::SalesReceipt
- Inherits:
-
ServiceBase
- Object
- ServiceBase
- Quickeebooks::Windows::Service::SalesReceipt
- Defined in:
- lib/quickeebooks/windows/service/sales_receipt.rb
Constant Summary
Constants inherited from ServiceBase
Quickeebooks::Windows::Service::ServiceBase::XML_NS
Instance Attribute Summary
Attributes inherited from ServiceBase
#base_uri, #last_response_body, #last_response_xml, #oauth, #realm_id
Instance Method Summary collapse
- #create(sales_receipt) ⇒ Object
- #list(filters = [], page = 1, per_page = 20, sort = nil, options = {}) ⇒ Object
Methods inherited from ServiceBase
#access_token=, #enforce_filter_order, #initialize, #url_for_base, #url_for_resource
Methods included from Logging
Constructor Details
This class inherits a constructor from Quickeebooks::Windows::Service::ServiceBase
Instance Method Details
#create(sales_receipt) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/quickeebooks/windows/service/sales_receipt.rb', line 16 def create(sales_receipt) raise InvalidModelException unless sales_receipt.valid_for_create? # XML is a wrapped 'object' where the type is specified as an attribute # <Object xsi:type="Invoice"> xml_node = sales_receipt.to_xml(:name => 'Object') xml_node.set_attribute('xsi:type', 'SalesReceipt') xml = Quickeebooks::Shared::Service::OperationNode.new.add do |content| content << "<ExternalRealmId>#{self.realm_id}</ExternalRealmId>#{xml_node}" end perform_write(Quickeebooks::Windows::Model::SalesReceipt, xml) end |
#list(filters = [], page = 1, per_page = 20, sort = nil, options = {}) ⇒ Object
11 12 13 14 |
# File 'lib/quickeebooks/windows/service/sales_receipt.rb', line 11 def list(filters = [], page = 1, per_page = 20, sort = nil, = {}) filters << Quickeebooks::Shared::Service::Filter.new(:boolean, :field => 'CustomFieldEnable', :value => true) fetch_collection(Quickeebooks::Windows::Model::SalesReceipt, nil, filters, page, per_page, sort, ) end |