Coder Social home page Coder Social logo

quickeebooks's People

Contributors

alecnmk avatar bodagetta avatar cwoolum avatar dexterthedragon avatar epugh avatar fabioelia avatar geekoncoffee avatar joejwright avatar johnsonj avatar kdaigle avatar mattrogish avatar mcmire avatar minimul avatar nickhammond avatar peterberkenbosch avatar ruckus avatar seanxiesx avatar simonwistow avatar swanandp avatar theinventor avatar thilo avatar walter avatar whereisciao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quickeebooks's Issues

How to grep SalesTerm values from QBO to our application

screenshot from 2013-10-21 15 27 50
screenshot from 2013-10-21 15 28 52

You have not defined Term model. please let me know how to grep terms values from QBO. now i can only grep sales_term_id but i want sales_term_name.

This feature is available in windows, please make it available for online also

xml_accessor :sales_term_name, :from => 'SalesTermName'

DateTime filter results in Unparseable date error

Using a DateTime filter results in Unparseable date errors like in issue #26 (tested with versions 0.1.10, 0.1.17, ruby 1.9.3p194)

e.g.
s = Quickeebooks::Online::Service::SalesReceipt.new
s.access_token = token
s.realm_id = realm_id
f = Quickeebooks::Online::Service::Filter.new(:datetime, :field => 'CreateTime', :after => Time.mktime(2013,11,11))
s.list([f],1,100)

METHOD = post
RESOURCE = https://qbo.sbfinance.intuit.com/resource/sales-receipts/v2/739547120
BODY(String) = "Filter=CreateTime+%3AAFTER%3A+2013-11-11T00%3A00%3A00&PageNum=1&ResultsPerPage=100"
HEADERS = {"Content-Type"=>"application/x-www-form-urlencoded"}
RESPONSE CODE = 400
RESPONSE BODY = SALESRECEIPT QUERY query is invalid. Message: Unparseable date: "2013-11-11T00:0000"BAD_QUERY_REQUESTQUERY_INVALID_DATA_FORMAT
IntuitRequestException: SALESRECEIPT QUERY query is invalid. Message: Unparseable date: "2013-11-11T00:0000"

I notice DATE_TIME_FORMAT was changed to:
'%Y-%m-%dT%H:%M:%S%Z'
in commit 12daaef then subsequently changed to:
'%Y-%m-%dT%H:%M:%S'
in commit 9d649f7.

Setting DATE_TIME_FORMAT to '%Y-%m-%dT%H:%M:%S%Z' fixes the issue for me.

Getting "Unparseable date" when using filters

Strangely, since upgrading from 0.9 we're now getting "Unparseable date" errors from Quickbooks Online DateTime filters.

I checked, and what is being passed appears to be correct:

Filter=LastUpdatedTime :AFTER: 2013-01-18T01:29:38+0000

Except Intuit is responding:

CUSTOMER QUERY query is invalid. Message: Unparseable date: "2013-01-18T01:29:38 0000"

I find the error goes away if I switch to the time zone "string" format (as specified here) https://ipp.developer.intuit.com/0010_Intuit_Partner_Platform/0050_Data_Services/0400_QuickBooks_Online/0100_Calling_Data_Services/0030_Retrieving_Objects

by changing the filter date format to use a capital Z:

    `DATE_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S%Z'`

(instead of ...%z')

which sends

Filter=LastUpdatedTime :AFTER: 2013-01-18T01:31:24UTC

Is anyone else able to reproduce my issue? Is this some sort of weird bug on Intuit's side? (the upgrade from 0.9 may have been coincidence)

Thanks,

Matt

Fetching data created after certain time

On my first request I fetch ALL data, and I find the largest meta_data.create_time, and store that as well. On subsequent requests, I would like to only fetch records created after that time.

So, for example, my largest meta_data.create_time was 2013-06-05T02:40:28 and I create a filter:

[
  StartCreatedTMS :EQUALS: 2013-06-05T02:40:29,
  EndCreatedTMS :EQUALS: 2025-01-01T00:00:00
]

When I send the request, I get two records back with the following meta_data.create_time values:

2013-06-05 02:40:28
2013-06-05 02:39:21

Notice how both times are outside of the range I requested in my filter.

I am not sure why this is happening. I wouldn't think time zone would be an issue because I am taking the meta_data.create_time, storing it, and then using that same value to generate the filter for my next request.

Do you have any idea what is going on here?

Nokogiri::XML::XPath::SyntaxError: Undefined namespace prefix: //xmlns:FaultInfo/xmlns:Message

It appears the QuickBooks Online API is returning unexpected fault error for some of our users.

Nokogiri::XML::XPath::SyntaxError: Undefined namespace prefix: //xmlns:FaultInfo/xmlns:Message
    from /app/vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.6/lib/nokogiri/xml/node.rb:159:in `evaluate'
    from /app/vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.6/lib/nokogiri/xml/node.rb:159:in `block in xpath'
    from /app/vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.6/lib/nokogiri/xml/node.rb:150:in `map'
    from /app/vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.6/lib/nokogiri/xml/node.rb:150:in `xpath'
    from /app/vendor/bundle/ruby/1.9.1/bundler/gems/quickeebooks-98d817de7f5a/lib/quickeebooks/online/service/service_base.rb:177:in `parse_intuit_error'
    from /app/vendor/bundle/ruby/1.9.1/bundler/gems/quickeebooks-98d817de7f5a/lib/quickeebooks/online/service/service_base.rb:164:in `check_response'
    from /app/vendor/bundle/ruby/1.9.1/bundler/gems/quickeebooks-98d817de7f5a/lib/quickeebooks/online/service/service_base.rb:142:in `do_http'
    from /app/vendor/bundle/ruby/1.9.1/bundler/gems/quickeebooks-98d817de7f5a/lib/quickeebooks/online/service/service_base.rb:129:in `do_http_get'
    from /app/vendor/bundle/ruby/1.9.1/bundler/gems/quickeebooks-98d817de7f5a/lib/quickeebooks/online/service/company_meta_data.rb:13:in `load'

The response, instead of being XML as specified in the docs (https://ipp.developer.intuit.com/0010_Intuit_Partner_Platform/0050_Data_Services/0400_QuickBooks_Online/0300_Error_Handling/0050_HTTP_Status_Codes), is a HTML page:

<html>
<head>
  <title>JBoss Web/2.1.12.GA-patch-03 - Error report</title>
  <style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> 
</head>
<body>
  <h1>HTTP Status 400 - message=No destination found for given partition key; errorCode=007001; statusCode=400</h1>
  <HR size="1" noshade="noshade">
    <p>
      <b>type</b> Status report
    </p>
    <p>
      <b>message</b> <u>message=No destination found for given partition key; errorCode=007001; statusCode=400</u>
    </p>
    <p>
      <b>description</b> <u>The request sent by the client was syntactically incorrect (message=No destination found for given partition key; errorCode=007001; statusCode=400).</u>
    </p>
    <HR size="1" noshade="noshade">
    <h3>JBoss Web/2.1.12.GA-patch-03</h3>
</body>
</html>

Has anyone seen this before? I'm not sure if it's something Quickeebooks ought to support, but several of our users are getting it (all API requests fail).

The base url constructed is incomplete

When I do this,

customer = Quickeebooks::Online::Service::Customer.new()
customer.access_token = access_token
customer.realm_id = params[:realm]
p customer.list

I get a 404 not found. Output sample as below:

HTTP Error Code: 404, Msg: 

<title>404 Not Found</title>
 

Not Found

The requested URL /resource/customers/v2/ was not found on this server.

Can you please help me out with this?

IntuitRequestException: cvc-datatype-valid.1.2.1

The %Z in Quickeebooks::Shared::Service::Filter::DATE_TIME_FORMAT seems to be causing the following error:

IntuitRequestException: cvc-datatype-valid.1.2.1: '2013-09-04T16:52:30UTC' is not a valid value for 'dateTime'.

When I set the constant to '%Y-%m-%dT%H:%M:%S' it works fine. This is how I build my filters:

  filters.push Quickeebooks::Windows::Service::Filter.new(:datetime, field: 'StartModifiedTMS', value: Time.mktime(2013, 1, 1))
  filters.push Quickeebooks::Windows::Service::Filter.new(:datetime, field: 'EndModifiedTMS', value: Time.mktime(2025, 1, 1))

Issue with Item creation

When trying to create an item, getting an IntuitRequestException.

It appears the only required fields in the Item model are:

:name and :account_reference => IncomeAccountRef

However on the V2 QB API reference, they don't specify IncomeAccountRef as required, rather AccountId instead.

Quickeebooks::Windows::Service::Job#list CustomFieldEnable error

The following line:

filters << Quickeebooks::Shared::Service::Filter.new(:boolean, :field => 'CustomFieldEnable', :value => true)

causes the following error:

IntuitRequestException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'CustomFieldEnable'. One of
'{
  "http://www.intuit.com/sb/cdm/v2":CustomFieldQueryParam,
  "http://www.intuit.com/sb/cdm/v2":CustomFieldFilter,
  "http://www.intuit.com/sb/cdm/v2":CustomFieldDefinitionIdSet,
  "http://www.intuit.com/sb/cdm/v2":ListIdSet,
  "http://www.intuit.com/sb/cdm/v2":StartCreatedTMS,
  "http://www.intuit.com/sb/cdm/v2":EndCreatedTMS,
  "http://www.intuit.com/sb/cdm/v2":StartModifiedTMS,
  "http://www.intuit.com/sb/cdm/v2":EndModifiedTMS,
  "http://www.intuit.com/sb/cdm/v2":CustomerIdSet,
  "http://www.intuit.com/sb/cdm/v2":IncludeFinancialIndicator
}' is expected.

I simply commented it out to avoid the issue because I am not using custom fields on jobs.

Create Vendor throws validation error

Hi There,

I'm trying to create a vendor record and my code is throwing a vendor validation error:

 Validation failed: Country can't be blank, Address 1 can't be blank, City can't be blank

The odd thing is that the vendor is actually created correctly into QBO and the address is there as well. I have tried this with several different vendors all resulting in the same error. I suppose I could work around this if quickeebooks wasn't throwing an error but since it is I don't get the vendor id back in the response and I need it for my code to function properly. Any advice on this would be greatly appreciated! Here is my Create Vendor code snippit:

   vendor_service = Quickeebooks::Online::Service::Vendor.new
    vendor_service.access_token = @access_token
    vendor_service.realm_id = @realm
    vendor_service

    v = Quickeebooks::Online::Model::Vendor.new
    v.name = affiliate_account.payee_name

    address = Quickeebooks::Online::Model::Address.new
    address.line1 = affiliate_account.address_1
    address.line2 = affiliate_account.address_2
    address.city = affiliate_account.city
    address.country_sub_division_code = affiliate_account.state
    address.postal_code = affiliate_account.postal_code
    address.country = affiliate_account.country.name
    address.tag = "Billing"
    v.address = address

    response = vendor_service.create(v)
    affiliate_account.quickbooks_vendor_id = response.id.value

Bluedot Menu displaying "We are sorry but we cannot load the menu right now"?

<script type="text/javascript" src="https://appcenter.intuit.com/Content/IA/intuit.ipp.anywhere.js"></script>

<script>
  intuit.ipp.anywhere.setup({menuProxy: '/path/to/blue-dot', grantUrl: "<%= authenticate_settings_url %>"});
</script>

<body>
  <ipp:blueDot></ipp:blueDot>
</body>

It is displaying bluedot menu on the top of my application but not displaying the companies that i am connected with. Insteed, it is displaying something like "We are sorry but we cannot load the menu right now".

I want to display the companies list that I am connected with in this blue dot menu. I think i am missing path of munuProxy :

menuProxy: '/path/to/blue-dot'

I have no idea what to do with this. If i have to give path to any bluedotMenu action than what should i write on that action to display list of companies?

[NOTE: I am using Chrome and Firefox as my browser so, i don't think it's my browser problem]

Now, How can I get menu_proxy_code_id?

How can I get menu_proxy_code_id? I have no idea.

I tried to generate menu_proxy_code_id while generating realm_id, access_token and access_secrete like:

at = session[:qb_request_token].get_access_token(:oauth_verifier => params[:oauth_verifier])
    access_token = at.token
    access_secret = at.secret
    realm_id = params['realmId']

    menu_proxy_code_id = at.menu_proxy_code_id

but it will generate something like:

NoMethodError - undefined method `menu_proxy_code_id' for #<OAuth::AccessToken:0xb4eac7c>:

What i am missing here. Please make me clear, how can I generate menu_proxy_code_id and display contents of the bluedot menu.

============= thanks in advance ===================

Error Creating Invoice

Hi Guys,

When I am creating an invoice, I get the error

undefined method `to_xml' for 2:Fixnum

Here is my stack trace

(gem) roxml-3.3.1/lib/roxml/xml/references.rb:301:in block (2 levels) in update_xml' (gem) roxml-3.3.1/lib/roxml/xml/references.rb:300:intap'
(gem) roxml-3.3.1/lib/roxml/xml/references.rb:300:in block in update_xml' (gem) roxml-3.3.1/lib/roxml/xml/references.rb:291:intap'
(gem) roxml-3.3.1/lib/roxml/xml/references.rb:291:in update_xml' (gem) quickeebooks-0.1.5/lib/quickeebooks.rb:63:inblock (2 levels) in to_xml'
(gem) quickeebooks-0.1.5/lib/quickeebooks.rb:60:in each' (gem) quickeebooks-0.1.5/lib/quickeebooks.rb:60:inblock in to_xml'
(gem) quickeebooks-0.1.5/lib/quickeebooks.rb:52:in tap' (gem) quickeebooks-0.1.5/lib/quickeebooks.rb:52:into_xml'
(gem) roxml-3.3.1/lib/roxml/xml/references.rb:298:in block in update_xml' (gem) roxml-3.3.1/lib/roxml/xml/references.rb:291:intap'
(gem) roxml-3.3.1/lib/roxml/xml/references.rb:291:in update_xml' (gem) quickeebooks-0.1.5/lib/quickeebooks.rb:63:inblock (2 levels) in to_xml'
(gem) quickeebooks-0.1.5/lib/quickeebooks.rb:60:in each' (gem) quickeebooks-0.1.5/lib/quickeebooks.rb:60:inblock in to_xml'
(gem) quickeebooks-0.1.5/lib/quickeebooks.rb:52:in tap' (gem) quickeebooks-0.1.5/lib/quickeebooks.rb:52:into_xml'
(gem) quickeebooks-0.1.5/lib/quickeebooks/online/model/intuit_type.rb:32:in to_xml_inject_ns' (gem) quickeebooks-0.1.5/lib/quickeebooks/common/online_line_item_model_methods.rb:18:into_xml_ns'
(gem) quickeebooks-0.1.5/lib/quickeebooks/online/service/invoice.rb:14:in create' app/services/quickbooks_sync.rb:82:inblock (2 levels) in export_invoices'
(gem) activerecord-3.2.11/lib/active_record/relation/delegation.rb:6:in each' (gem) activerecord-3.2.11/lib/active_record/relation/delegation.rb:6:ineach'
app/services/quickbooks_sync.rb:59:in block in export_invoices' (gem) activerecord-3.2.11/lib/active_record/associations/collection_proxy.rb:89:ineach'
(gem) activerecord-3.2.11/lib/active_record/associations/collection_proxy.rb:89:in method_missing' app/services/quickbooks_sync.rb:58:inexport_invoices'
app/controllers/quickbook_controller.rb:50:in block in sync_invoices' (gem) actionpack-3.2.11/lib/action_controller/metal/mime_responds.rb:270:incall'
(gem) actionpack-3.2.11/lib/action_controller/metal/mime_responds.rb:270:in retrieve_collector_from_mimes' (gem) actionpack-3.2.11/lib/action_controller/metal/mime_responds.rb:194:inrespond_to'
app/controllers/quickbook_controller.rb:49:in sync_invoices' (gem) actionpack-3.2.11/lib/action_controller/metal/implicit_render.rb:4:insend_action'
(gem) actionpack-3.2.11/lib/abstract_controller/base.rb:167:in process_action' (gem) actionpack-3.2.11/lib/action_controller/metal/rendering.rb:10:inprocess_action'
(gem) actionpack-3.2.11/lib/abstract_controller/callbacks.rb:18:in block in process_action' (gem) activesupport-3.2.11/lib/active_support/callbacks.rb:447:in_run__926487399__process_action__932969398__callbacks'
(gem) activesupport-3.2.11/lib/active_support/callbacks.rb:405:in __run_callback' (gem) activesupport-3.2.11/lib/active_support/callbacks.rb:385:in_run_process_action_callbacks'
(gem) activesupport-3.2.11/lib/active_support/callbacks.rb:81:in run_callbacks' (gem) actionpack-3.2.11/lib/abstract_controller/callbacks.rb:17:inprocess_action'
(gem) actionpack-3.2.11/lib/action_controller/metal/rescue.rb:29:in process_action' (gem) actionpack-3.2.11/lib/action_controller/metal/instrumentation.rb:30:inblock in process_action'
(gem) activesupport-3.2.11/lib/active_support/notifications.rb:123:in block in instrument' (gem) activesupport-3.2.11/lib/active_support/notifications/instrumenter.rb:20:ininstrument'
(gem) activesupport-3.2.11/lib/active_support/notifications.rb:123:in instrument' (gem) actionpack-3.2.11/lib/action_controller/metal/instrumentation.rb:29:inprocess_action'
(gem) actionpack-3.2.11/lib/action_controller/metal/params_wrapper.rb:207:in process_action' (gem) activerecord-3.2.11/lib/active_record/railties/controller_runtime.rb:18:inprocess_action'
(gem) newrelic_rpm-3.5.8.72/lib/new_relic/agent/instrumentation/rails3/action_controller.rb:34:in block in process_action' (gem) newrelic_rpm-3.5.8.72/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:268:inblock in perform_action_with_newrelic_trace'
(gem) newrelic_rpm-3.5.8.72/lib/new_relic/agent/method_tracer.rb:240:in trace_execution_scoped' (gem) newrelic_rpm-3.5.8.72/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:263:inperform_action_with_newrelic_trace'
(gem) newrelic_rpm-3.5.8.72/lib/new_relic/agent/instrumentation/rails3/action_controller.rb:33:in process_action' (gem) actionpack-3.2.11/lib/abstract_controller/base.rb:121:inprocess'
(gem) actionpack-3.2.11/lib/abstract_controller/rendering.rb:45:in process' (gem) actionpack-3.2.11/lib/action_controller/metal.rb:203:indispatch'
(gem) actionpack-3.2.11/lib/action_controller/metal/rack_delegation.rb:14:in dispatch' (gem) actionpack-3.2.11/lib/action_controller/metal.rb:246:inblock in action'
(gem) actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:73:in call' (gem) actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:73:indispatch'
(gem) actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:36:in call' (gem) actionpack-3.2.11/lib/action_dispatch/routing/mapper.rb:42:incall'
(gem) journey-1.0.4/lib/journey/router.rb:68:in block in call' (gem) journey-1.0.4/lib/journey/router.rb:56:ineach'
(gem) journey-1.0.4/lib/journey/router.rb:56:in call' (gem) actionpack-3.2.11/lib/action_dispatch/routing/route_set.rb:601:incall'
(gem) newrelic_rpm-3.5.8.72/lib/new_relic/rack/error_collector.rb:8:in call' (gem) newrelic_rpm-3.5.8.72/lib/new_relic/rack/agent_hooks.rb:14:incall'
(gem) newrelic_rpm-3.5.8.72/lib/new_relic/rack/browser_monitoring.rb:12:in call' (gem) newrelic_rpm-3.5.8.72/lib/new_relic/rack/developer_mode.rb:24:incall'
(gem) better_errors-0.3.2/lib/better_errors/middleware.rb:51:in app_call' (gem) better_errors-0.3.2/lib/better_errors/middleware.rb:45:incall'
(gem) bullet-4.3.1/lib/bullet/rack.rb:11:in call' (gem) warden-1.2.1/lib/warden/manager.rb:35:inblock in call'
(gem) warden-1.2.1/lib/warden/manager.rb:34:in catch' (gem) warden-1.2.1/lib/warden/manager.rb:34:incall'
(gem) actionpack-3.2.11/lib/action_dispatch/middleware/best_standards_support.rb:17:in call' (gem) rack-1.4.5/lib/rack/etag.rb:23:incall'
(gem) rack-1.4.5/lib/rack/conditionalget.rb:25:in call' (gem) actionpack-3.2.11/lib/action_dispatch/middleware/head.rb:14:incall'
(gem) actionpack-3.2.11/lib/action_dispatch/middleware/params_parser.rb:21:in call' (gem) actionpack-3.2.11/lib/action_dispatch/middleware/flash.rb:242:incall'
(gem) rack-1.4.5/lib/rack/session/abstract/id.rb:210:in context' (gem) rack-1.4.5/lib/rack/session/abstract/id.rb:205:incall'
(gem) actionpack-3.2.11/lib/action_dispatch/middleware/cookies.rb:341:in call' (gem) activerecord-3.2.11/lib/active_record/query_cache.rb:64:incall'
(gem) activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in call' (gem) actionpack-3.2.11/lib/action_dispatch/middleware/callbacks.rb:28:inblock in call'
(gem) activesupport-3.2.11/lib/active_support/callbacks.rb:405:in _run__660557959__call__829375442__callbacks' (gem) activesupport-3.2.11/lib/active_support/callbacks.rb:405:in__run_callback'
(gem) activesupport-3.2.11/lib/active_support/callbacks.rb:385:in _run_call_callbacks' (gem) activesupport-3.2.11/lib/active_support/callbacks.rb:81:inrun_callbacks'
(gem) actionpack-3.2.11/lib/action_dispatch/middleware/callbacks.rb:27:in call' (gem) rails-dev-tweaks-0.6.1/lib/rails_dev_tweaks/granular_autoload/middleware.rb:34:incall'
(gem) actionpack-3.2.11/lib/action_dispatch/middleware/remote_ip.rb:31:in call' (gem) airbrake-3.1.8/lib/airbrake/rails/middleware.rb:15:incall'
(gem) actionpack-3.2.11/lib/action_dispatch/middleware/debug_exceptions.rb:16:in call' (gem) actionpack-3.2.11/lib/action_dispatch/middleware/show_exceptions.rb:56:incall'
(gem) railties-3.2.11/lib/rails/rack/logger.rb:32:in call_app' (gem) railties-3.2.11/lib/rails/rack/logger.rb:18:incall'
(gem) actionpack-3.2.11/lib/action_dispatch/middleware/request_id.rb:22:in call' (gem) rack-1.4.5/lib/rack/methodoverride.rb:21:incall'
(gem) rack-1.4.5/lib/rack/runtime.rb:17:in call' (gem) activesupport-3.2.11/lib/active_support/cache/strategy/local_cache.rb:72:incall'
(gem) rack-1.4.5/lib/rack/lock.rb:15:in call' (gem) actionpack-3.2.11/lib/action_dispatch/middleware/static.rb:62:incall'
(gem) airbrake-3.1.8/lib/airbrake/user_informer.rb:16:in _call' (gem) airbrake-3.1.8/lib/airbrake/user_informer.rb:12:incall'
(gem) railties-3.2.11/lib/rails/engine.rb:479:in call' (gem) railties-3.2.11/lib/rails/application.rb:223:incall'
(gem) rack-1.4.5/lib/rack/content_length.rb:14:in call' (gem) railties-3.2.11/lib/rails/rack/log_tailer.rb:17:incall'
(gem) thin-1.5.0/lib/thin/connection.rb:81:in block in pre_process' (gem) thin-1.5.0/lib/thin/connection.rb:79:incatch'
(gem) thin-1.5.0/lib/thin/connection.rb:79:in pre_process' (gem) thin-1.5.0/lib/thin/connection.rb:54:inprocess'
(gem) thin-1.5.0/lib/thin/connection.rb:39:in receive_data' (gem) eventmachine-1.0.1/lib/eventmachine.rb:187:inrun_machine'
(gem) eventmachine-1.0.1/lib/eventmachine.rb:187:in run' (gem) thin-1.5.0/lib/thin/backends/base.rb:63:instart'
(gem) thin-1.5.0/lib/thin/server.rb:159:in start' (gem) rack-1.4.5/lib/rack/handler/thin.rb:13:inrun'
(gem) rack-1.4.5/lib/rack/server.rb:268:in start' (gem) railties-3.2.11/lib/rails/commands/server.rb:70:instart'
(gem) railties-3.2.11/lib/rails/commands.rb:55:in block in <top (required)>' (gem) railties-3.2.11/lib/rails/commands.rb:50:intap'
(gem) railties-3.2.11/lib/rails/commands.rb:50:in <top (required)>' script/rails:6:inrequire'
script/rails:6:in `

'

Here is my object inspected

<Quickeebooks::Online::Model::Invoice:0x11a9c2b4 @line_items=[#<Quickeebooks::Online::Model::InvoiceLineItem:0x11e860dc @desc="Gildan 2000 - White", @amount=#<BigD

ecimal:11e8608c,'0.1E1',9(18)>, @unit_price=#BigDecimal:118274ac,'0.44E1',18(18), @Taxable=true, @quantity=20>, #<Quickeebooks::Online::Model::InvoiceLineItem:0x1
1827420 @desc="Gildan 2000 - White", @amount=#BigDecimal:118273d0,'0.1E1',9(18), @unit_price=#BigDecimal:11827394,'0.44E1',18(18), @Taxable=true, @quantity=82>,
#<Quickeebooks::Online::Model::InvoiceLineItem:0x11827308 @desc="Gildan 2000 - White", @amount=#BigDecimal:118272b8,'0.1E1',9(18), @unit_price=#<BigDecimal:11827
27c,'0.44E1',18(18)>, @Taxable=true, @quantity=10>, #<Quickeebooks::Online::Model::InvoiceLineItem:0x118271f0 @desc="Gildan 2000 - White", @amount=#<BigDecimal:1182
71a0,'0.1E1',9(18)>, @unit_price=#BigDecimal:11827164,'-0.5E1',9(18), @Taxable=true, @quantity=1>], @Header=#<Quickeebooks::Online::Model::InvoiceHeader:0x11a9c27
8 @customer_id=2, @tax_rate=#BigDecimal:11a9c228,'0.8E1',9(18), @total_amount=#BigDecimal:11e88148,'0.52682E3',18(36), @sub_total_amount=#<BigDecimal:11e86e88,'
0.4878E3',18(36)>>>

What am I doing wrong??

Make the base directory for invoice PDFs an option

When asking Intuit to generate and download an invoice PDF we write it locally to ENV['TMPDIR']. This isnt guaranteed to be set so we should make the base directory a required argument to the invoice method.

Add ShowAs to Vendor Model

I realized that the show_as / ShowAs attribute on the Vendor model seems to be missing. Would it be possible to include this field? I would assume others might also benefit from this field since is used to define the name that shows up on checks when something other than the actual vendor name is needed on the check.

I believe the fix would only require one line of code in the lib/quickeebooks/common/online_entity_model.rb

xml_accessor :show_as, :from => 'ShowAs'

Thanks!

License missing from gemspec

Some companies will only use gems with a certain license.
The canonical and easy way to check is via the gemspec,

via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

Even for projects that already specify a license, including a license in your gemspec is a good practice, since it is easily
discoverable there without having to check the readme or for a license file.

For example, there is a License Finder gem to help companies ensure all gems they use
meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough
issue that even Bundler now generates gems with a default 'MIT' license.

If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file),
github has created a license picker tool.

In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally
looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :).

I hope you'll consider specifying a license in your gemspec. If not, please just close the issue and let me know. In either case, I'll follow up. Thanks!

p.s. I've written a blog post about this project

What all things are required to shift from QBO (online) v2 to v3?

I am using quickbooks Online V2 API and as quickbook is announcing V3 API and saying all developers to shift their quickbooks account from V2 to V3, Please can you help me, what all things we need to do to shift our quickbooks online V2 to V3?

As, I am using QBO V2, I think changing my version to QBO V3 will not be that much problem as for QBD developer, because I got to know about lots of deprecation in QuickbooksDesktop Version V3.

thanks

DateTime vs. Date in Filters

I was just noticing that we use @type key :date and :datetime in creating a filter, but their semantic meaning are ignored; the filter output value is passed thru formatted_time which formats based on @value.class.

However #date_time_to_s validates that the objects are Time/DateTime. There's a spec that passes a Date object directly which seems to pass only because :value doesn't do the Time/DateTime validation.

It seems it might be more consistent if the validation and the output formatting was performed based on @type (date validates/formats Date, DateTime validates/formats date and time) and not @value.class. I started doing this in a PR (it's a pretty easy refactor), but stopped when I broke that spec mentioned above.

I didn't want to accidentally break anything by this refactor, so I aborted. Thoughts? cc @ruckus Thanks!

Creating a datetime filter for a Windows service throws an error

I set up this controller based on one of the examples

class AtestController < ApplicationController
    def index
        if session[:access_token]
            filters = []

            d1 = Time.mktime(2011, 5, 1)
            d2 = Time.mktime(2011, 8, 1)
            filters << Quickeebooks::Windows::Service::Filter.new(:datetime, :field => 'CreateTime', :after => d1, :before => d2)

            customer_service = Quickeebooks::Windows::Service::Customer.new
            customer_service.access_token = session[:access_token]
            customer_service.realm_id = session[:realm_id]
            customer_service.list

            customers = customer_service.list(filters, 1, 30, nil)
        end
    end

end

And rails throws the following error

ArgumentError at /atest
Don't know how to generate a Filter for type datetime

I know that CreateTime isn't a queryable field for Customer from this page

https://ipp.developer.intuit.com/0010_Intuit_Partner_Platform/0050_Data_Services/0500_QuickBooks_Windows/0600_Object_Reference/Customer

but it appears that all the DateTime queryable fields only accept one DateTime, not ranges like are specified by the :before and :after.

Less of an issue, more of a - help me help you :)

Hi there!

I am using this in production and happy with how it's working so far.

I do have a need for a creating payments with accurate payment methods, I think I need a model/service added to support that endpoint.

I am open to adding it myself - can anyone point me at a commit or name a couple files I can use as a template?

I suppose this is what I need to get their payment methods;
https://developer.intuit.com/apiexplorer?apiname=V2QBD#PaymentMethod

How to extract the required data from the collection

I did the customer.list and I get a huge chunk of data. I see that you are parsing the xml response too.
How should I handle the collection to get the details of a particular customer?
Can you please help me out with this?

Email Address for Windows::Model::Employee

Using The following example of code does not work. Complains about null being entered on the Quickbooks Database for the email.

IntuitRequestException (cannot insert NULL into ("ESB"."EMAIL_API"."LABEL_NAME_MAP")):

Have has since ignored using email, and continued along

  • employee.type_of = "Person"
  • employee.name = "Bugs Bunny"
  • employee.given_name = "Bugs"
  • employee.family_name = "Bunny"
  • email = Quickeebooks::Windows::Model::Email.new
  • email.address = "[email protected]"
  • email.tag = "Business"
  • employee.email = email
  • address = Quickeebooks::Windows::Model::Address.new
  • address.tag = "Billing"
  • address.line1 = "123 Main St."
  • address.city = "San Francisco"
  • address.country_sub_division_code = "CA"
  • address.postal_code = "94117"
  • address.country = "USA"
  • employee.address = address

InvoiceHeader.status

Seems that the InvoiceHeader.status is always being returned empty from the Online::Service::Model

Way to push jobs in quickbook using Online models??

I have already pushed invoice and customers to the quickbook and I am also able to pull items from quickbooks to my rails app using quickeebooks gem.

Can i push Jobs to QBO using quickeebook gem? I am using Quick Book Online not Desktop version. But in Quickeebook::Online::Model job is not present. I also want to push sub-customers to the quickbook account. But, i think, that also can be done through Job model only.

Now i am really stuck in this point. Any suggestions please, to solve this problem??

Thanks in advance

Concept of 'syncing' the Desktop flavor

Hey guys - I LOVE how this project is progressing :)

We've been using the Online service in production for a couple months now, works great.

We have a concept of 'syncing' an invoice, when we add line items in our app, we have the Quickbooks Invoice_ID on our model, and we find the item and re-sync it to be sure it has all the line items.

How do you do this with the Windows/Desktop version? The create doesn't give back a record ID.

I get a success, so I can then go do a service.list and look for the invoice number - is that what everyone is doing?

It would be awesome if the online invoice.create and desktop invoice.create returned an object with similar methods/data

I Want to pull customer and sub-customers seperately and store them in seperate database tables?

Hi,

I have a customer model as well as sub-customer model.

I have two buttons named "sync customer" and "sync sub-customer". When a user click on "sync-customer " button I want to sync ONLY CUSTOMER from QBO to my customer model.

Similarly, "sync sub-customer" will sync ONLY SUB-CUSTOMER from QBO to my sub-customer model.

For now, whenever I am syncing customer from "sync customer" button it is pulling customer and sub-customers both in my same customer model.

@customers =    customer_service.list.entries
 @customers.each do |customer|
    customer.name 
 end
end

How to differentiate between them?

SubAccounts

I can't seem to ferret out how to list SubAccounts.

I would have thought that the Account service would list all accounts, but it only seems to list Parent accounts.

Using a number filter doesn't correctly set the value

When I'm using a number filter, the "value" isn't ever set in the code. Normally, the filters expect a value to be passed in as an attribute on the hash. But with gt and lt the "value" is the value of that key.

You have code to manage the switching but it still uses @value where it should be using @gt or @lt for the value.

I've cheated by also passing a :value directly in as well. For example: Quickeebooks::Online::Service::Filter.new(:number, :field => "OpenBalance", :gt => 0, :value => 0)

If I have time today, I'll pull down and make the change and offer a PR along with this. But I wanted to put this here so I wouldn't forget and so anyway else can see the "quick fix".

Cannot call 'request' method on @oauth

When I run this code:
customer_service = Quickeebooks::Online::Service::Customer.new(oauth_client, realm_id)
customer_service.list

I receive this error: undefined method `request' for nil:NilClass

It looks like when Quickeebooks::Online::Service::Customer is initialized, it is not setting the access_token to @oauth.

Has anyone else seen this issue?

Search customer by Email

Is there a way search Customer record by email. I have scoured the internet trying to find a way to do it. Since it is a child record, I haven't found a way to do it yet.

Is there a way to do it?

David

no way to create the <ItemRef> required to create an invoice

This works via the API (https://developer.intuit.com/v2/apiexplorer?apiname=V3QBO#?id=Invoice)

<Invoice xmlns="http://schema.intuit.com/finance/v3">
  <DocNumber>385</DocNumber>
  <TxnDate>2015-02-10 04:22:59 UTC</TxnDate>
  <Line>
    <Amount>100</Amount>
    <DetailType>SalesItemLineDetail</DetailType>
    <SalesItemLineDetail>
      <ItemRef>1</ItemRef>
    </SalesItemLineDetail>
  </Line>
  <CustomerRef type="Customer">99</CustomerRef>
</Invoice>

Note the use of ItemRef. If I use the QuickEEBooks API, I get something like this:

<Invoice xmlns="http://schema.intuit.com/finance/v3" sparse="false">
  <Line>
    <Amount>100</Amount>
    <DetailType>SalesItemLineDetail</DetailType>
    <SalesItemLineDetail>
      <Name>.......</Name>
      <Type>Inventory</Type>
      <IncomeAccountRef name="Services" type="Account">1</IncomeAccountRef>
    </SalesItemLineDetail>
  </Line>
  <CustomerRef type="Customer">99</CustomerRef>
</Invoice>

Which QBO hates and sends back an error like:

 <Fault type="ValidationFault"><Error code="2020" element="Line.SalesItemLineDetail">         <Message>Required param missing, need to supply the required value for the API</Message><Detail>Required parameter Line.SalesItemLineDetail is missing in the request</Detail></Error></Fault>

Using the API explorer, I can only seem to get an invoice created using the model, although I can't use quickeebooks to create it [although I will shortly attempt to hack same].

Account sub_type shouldn't accept "Asset"

The account attribute sub_type has to match an enumeration from QboAccountDetailTypeEnum for the online version. Specifying "Asset" as the sub_type raises the following exception:

"IntuitRequestException: The account type isn't valid."

Enumeration docs: http://docs.developer.intuit.com/0025_Intuit_Anywhere/0050_Data_Services/v2/0400_QuickBooks_Online/0400Enumerations_and_Codes

Online Account model docs: http://docs.developer.intuit.com/0025_Intuit_Anywhere/0050_Data_Services/v2/0400_QuickBooks_Online/Account

Desktop Account model docs:
http://docs.developer.intuit.com/0025_Intuit_Anywhere/0050_Data_Services/v2/0500_QuickBooks_Windows/0600_Object_Reference/Account

In https://github.com/ruckus/quickeebooks/blob/master/lib/quickeebooks/online/model/account_detail_type.rb "Asset" is listed as a valid account type.

Confusing on Quickbook's part because in the very first section it mentions:

Asset
Liability
Revenue (Income)
Expenses
Equity

as the 5 basic account types. It looks as though QBD has a "Type" attribute and the online version just has "SubType".

QBO:
SubType(QboAccountDetailTypeEnum)

QBD:
SubType(AccountSubtypeEnum)
Type(AccountTypeEnum)

AccountTypeEnum has "Assets" and your basic bucket account types: Asset, Equity, Expense, Liability, Revenue. In the API explorer it outputs a and node but I keep on getting 500's.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FaultInfo xmlns="http://www.intuit.com/sb/cdm/baseexceptionmodel/xsd">
    <Message>java.lang.NumberFormatException: For input string: &quot;&quot;</Message>
    <ErrorCode>INTERNAL_SERVER_ERROR</ErrorCode>
    <Cause>SERVER</Cause>
</FaultInfo>

I have to step away for a bit but I'll do some more tinkering to get some more information.

Quickbooks Desktop, new customer needs domain="NG" not "QB"

I asked intuit about this, I'm trying to get an invoice created for a new customer, with the desktop flavor.

I create a customer, I get an ID of: 849630, using charles I was able to get this;
849630

It seems attaching this ID to a new invoice results in;
p_validate_txn - unable to find MBL customer REF id = 849630 idDomain = QB

I asked support and they said I need to use NG as the domain.

Looking at lib/quickeebooks/windows/model/id.rb

It seems there is only support for querying by the QB domain, not NG - are others seeing this?

Intuit said 'for a new customer that hasn't synced, use the NG domain'

Here is their full response;
-------- from intuit ----------
Please read this information about domains (idDomain):
NG -
Records created in the cloud (via the API) have an NG domain, which is basically their unsyncronized primary key. The records which are created by apps that call data services have this NG ID

QB-
Once they get synced to QuickBooks desktop, they then get a QB domain ID value as well (the QB ID is the syncronized primary key from within QuickBooks).
Records created by QB desktop have QB ID
You should be able to refer to any record by either the NG or QB ID.

QBO -
Records created by QB Online have QBO ID.

In your invoice query, you should be referencing the customer as 849630 but you are passing 849630.

Any entity gets created in the cloud/API explorer/code will have NG domain and after a successful sync they will get ExteranlKey with IDDomain QB value too.

So, since your data is not synched, please use NG domain id for referencing customer for creating Invoice.

----------- end intuit ----------

So now, I've done some syncs.. I use the customer_service.list and I can see this customer, they show up in Quickbooks, but, they still only have an NG ID on them.

It almost seems I need to store the fact that they are 'NG' - and use that for all future queries..

This seem right???

API Token and secret

Hi,

Are you able to give me any direction on how to obtain a Quickbooks Online Access token and secret for using this gem? Much help would be appreciated.

Thanks
Tim.

Way to handle quickbooks exceptions?

Hello there,

Can you tell me the way to handle quickbooks exceptions in rails. I am getting strange errors and exceptions some times and sometime same code is working perfectly.

1. Another $$customer$$ is already using this \nname

2. The website address you entered is not valid

3.  java.lang.NumberFormatException: For input string: ""

First error rise up because I am pushing customer which is already exists in quickbooks online. Yes, there is another way to track this error, that is checking customer before pushing to the quickbooks.

I think, second error rise up because user have passed only "http://" in website field. Instead of checking these error seperately, Can I add the quickbook error message in my error message and display the current page instead of going to the error page?

Third one is an exception itself. So, I need a way to handle these exceptions and other unknown exceptions that may arise in near future. How can I fix that?

Thanks in advance

Error in Quickeebooks::Shared::Service::Filter#datetime_to_xml

I was getting a .strftime error in datetime_to_xml when trying to filter with :before or :after because @value is nil.

I implemented this fix and it works as expected now:

module Quickeebooks
module Shared
module Service
class Filter

    def datetime_to_xml
      start_time = @after || Time.mktime(2000, 1, 1)
      end_time = @before || Time.mktime(2020, 1, 1)
      if @field == "CreateTime"
        start_field = 'StartCreatedTMS'
        end_field = 'EndCreatedTMS'
      elsif @field == "UpdateTime"
        start_field = 'StartModifiedTMS'
        end_field = 'EndModifiedTMS'
      end
      "<#{start_field}>#{formatted_datetime(start_time)}</#{start_field}>" +
      "<#{end_field}>#{formatted_datetime(end_time)}</#{end_field}>"
    end

  end
end

end
end

undefined method `request' error

When I try to save my new Qb Online object using response = customer_service.create(customer) I receive the error undefined method 'request' for #<QuickbooksSync:0x007fcc47075fd8> Any idea what's up?

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.