Code Monkey home page Code Monkey logo

qbfc's Introduction

QBFC-Ruby

QBFC-Ruby provides a wrapper around QuickBooks’ QBFC COM object, while allowing more or less direct access to the actual COM object.

Obviously, test before using on your production data…

Find

QBFC-Ruby supports find queries with options, which utitilize QBFC’s Query Requests. See QBFC::Element.find for details and options.

QBFC::session do | qb |
  checks = qb.checks.find(:first, :conditions => {:entity => 'ABC Supplies'})
end

Relationships

QBFC-Ruby supports loading of related records. These are records represented by “*Ref” in the QBFC documentation. For example, a Check has, among others, a PayeeEntityRef and an AccountRef. These can be accessed via, respectively, check.payee and check.account.

check.payee.name returns the name of the payee.

You can also access the *ID and Name fields of referenced records. Example: for the payee of a Check, check.payee_id and check.payee_name.

General Examples

# A very simple example, finding a single Customer by name
QBFC::session do | qb |
  puts qb.customer('Customer Name').full_name
end

# Find all Customer, then return the first in the Array
# Next, find the first Customer only
QBFC::session do | qb |
  customers = qb.customers.find(:all)
  puts customers[0].full_name
  puts qb.customers.find(:first).full_name
end

# Same as previous, but not using a block
sess = QBFC::Session.new
customers = QBFC::Customer.find(sess, :all)
puts customers[0].full_name
puts QBFC::Customer.find(sess, :first).full_name
sess.close

# Use a QBFC::Session object, but access the COM object
# more directly.
QBFC::session do | qb |
  request_set = qb.CreateMsgSetRequest("US", 6, 0)
  customer_query = request_set.AppendCustomerQueryRq	
  response = qb.DoRequests(request_set)
  customer_set = response.ResponseList[0]
  first_customer = customer_set.Detail[0]
  puts first_customer.full_name
end

Alternatives

BehindLogic Quickbooks Rubygem

homepage: behindlogic.com

This gem covers the full API and does validations. I haven’t tried it out, but the code samples look straightforward. ($199 for a internal license)

QuickBooks for Ruby

(docs: quickbooks.rubyforge.org, homepage: rubyforge.org/projects/quickbooks)

This is a project with similar goals to QBFC-Ruby. I believe the approach is creating Ruby classes that mirror the QuickBooks types and generate / parse qbXML. In my opinion, this approach is more stable and flexible than what I’m doing with QBFC-Ruby, but at the cost of slower development. (As in, QBFC-Ruby was intended as a collection of quick and dirty shortcuts; QuickBooks for Ruby seems to be intended as a much more complete project)

QBFC/qbXML COM Objects

Using the SDK directly is an option. Unless you need to use QBWC (QuickBooks Web Connector) or have some other reason for wanting to us qbXML, I suggest using QBFC. The SDK documents (see developer.intuit.com/ ) are pretty easy to use and navigate.

There are some other libraries on rubyforge in early stages which I haven’t really explored.

Copyright © 2008 Jared E. Morgan, released under the MIT license

qbfc's People

Contributors

jm81 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.