Comments (7)
Odd. What version of Quickeebooks are you using?
In a console with 0.1.1 loaded (which is actually trailing latest of 0.1.3):
1.9.3p327 > d1 = Time.mktime(2011, 5, 1)
=> 2011-05-01 00:00:00 -0700
1.9.3p327 > d2 = Time.mktime(2011, 8, 1)
=> 2011-08-01 00:00:00 -0700
1.9.3p327 > Quickeebooks::Windows::Service::Filter.new(:datetime, :field => 'CreateTime', :after => d1, :before => d2)
=> CreateTime :BEFORE: 2011-08-01T00:00:00-0700 :AND: CreateTime :AFTER: 2011-05-01T00:00:00-0700
On Mar 21, 2013, at 1:48 PM, Michael Whitley [email protected] wrote:
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 errorArgumentError 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 pagebut it appears that all the DateTime queryable fields only accept one DateTime, not ranges like are specified by the :before and :after.
—
Reply to this email directly or view it on GitHub.
from quickeebooks.
I'm sourcing it from the repo
gem 'quickeebooks', :github => 'ruckus/quickeebooks'
so I can get the new services
I just tried that in the console and got the same response that you did
irb(main):007:0> Quickeebooks::Windows::Service::Filter.new(:datetime, :field => 'CreateTime', :after => d1, :before => d2)
=> CreateTime :BEFORE: 2011-08-01T00:00:00Central Daylight Time :AND: CreateTime :AFTER: 2011-05-01T00:00:00Central Daylight Time
I'm not sure where to go next in the debugging process.
from quickeebooks.
Weird indeed. Check out the output from your console - it includes the timezone (Central Daylight Time) which I would imagine would fail if it made it to Intuit.
What exact version of Ruby you on?
On Mar 21, 2013, at 2:03 PM, Michael Whitley [email protected] wrote:
I'm sourcing it from the repo
gem 'quickeebooks', :github => 'ruckus/quickeebooks'
so I can get the new servicesI just tried that in the console and got the same response that you did
irb(main):007:0> Quickeebooks::Windows::Service::Filter.new(:datetime, :field => 'CreateTime', :after => d1, :before => d2)
=> CreateTime :BEFORE: 2011-08-01T00:00:00Central Daylight Time :AND: CreateTime :AFTER: 2011-05-01T00:00:00Central Daylight Time
I'm not sure where to go next in the debugging process.—
Reply to this email directly or view it on GitHub.
from quickeebooks.
So here's a little more on the error, it's actually when the .list is called
irb(main):014:0> customers = customer_service.list(filters, 1, 30, nil)
ArgumentError: Don't know how to generate a Filter for type datetime
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/quickeebooks-c3fd766e575b/lib/quickeebooks/shared/service/filter.rb:49:in `t
o_xml'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/quickeebooks-c3fd766e575b/lib/quickeebooks/windows/service/service_base.rb:9
4:in `block in fetch_collection'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/quickeebooks-c3fd766e575b/lib/quickeebooks/windows/service/service_base.rb:9
4:in `collect'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/quickeebooks-c3fd766e575b/lib/quickeebooks/windows/service/service_base.rb:9
4:in `fetch_collection'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/quickeebooks-c3fd766e575b/lib/quickeebooks/windows/service/customer.rb:9:in
`list'
from (irb):14
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in `start'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands/console.rb:8:in `start'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
looks like the error is in
/lib/quickeebooks/shared/service/filter.rb
there isn't a :datetime option under the to_xml function. Should there be?
from quickeebooks.
Ah ok, this makes sense. Yes, I totally see the problem now.
Also this highlights that my request generation testing is pretty piss poor.
I'll try and get a fix out in the next day or so.
On Mar 21, 2013, at 2:16 PM, Michael Whitley [email protected] wrote:
So here's a little more on the error, it's actually when the .list is called
irb(main):014:0> customers = customer_service.list(filters, 1, 30, nil)
'
ArgumentError: Don't know how to generate a Filter for type datetime
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/quickeebooks-c3fd766e575b/lib/quickeebooks/shared/service/filter.rb:49:int o_xml' from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/quickeebooks-c3fd766e575b/lib/quickeebooks/windows/service/service_base.rb:9 4:in
block in fetch_collection'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/quickeebooks-c3fd766e575b/lib/quickeebooks/windows/service/service_base.rb:9
4:incollect' from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/quickeebooks-c3fd766e575b/lib/quickeebooks/windows/service/service_base.rb:9 4:in
fetch_collection'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/bundler/gems/quickeebooks-c3fd766e575b/lib/quickeebooks/windows/service/customer.rb:9:in
list' from (irb):14 from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in
start'
from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands/console.rb:8:instart' from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:41:in
<top (required)>'
from script/rails:6:inrequire' from script/rails:6:in
looks like the error is in/lib/quickeebooks/shared/service/filter.rb
there isn't a :datetime option under the to_xml function. Should there be?
—
Reply to this email directly or view it on GitHub.
from quickeebooks.
I implemented a datetime_to_xml function in my forked repo. I had to use @value.xmlschema to get the datetime in the right format. If i used formatted_time(@value) it was not formatted correctly. I think we saw this earlier when my system included the timezone.
I have this code in my controller
if session[:access_token]
filters = []
datetime = Time.mktime(2011, 2, 25)
filters << Quickeebooks::Shared::Service::Filter.new(:datetime, :field => 'StartCreatedTMS', :value => datetime)
#filters << Quickeebooks::Shared::Service::Filter.new(:boolean, :field => 'IncludeTimeEntryEnum', :value => true)
employees = Quickeebooks::Windows::Service::Employee.new
employees.access_token = session[:access_token]
employees.realm_id = session[:realm_id]
@all_employees = employees.list(filters, page = 1, per_page = 50, sort = nil, options = {})
end
If I only have the first filter, then I get this error
IntuitRequestException at /atest
cvc-complex-type.2.4.a: Invalid content was found starting with element 'StartPage'. One of '{"http://www.intuit.com/sb/cdm/v2":EndCreatedTMS, "http://www.intuit.com/sb/cdm/v2":SortByColumn, "http://www.intuit.com/sb/cdm/v2":FirstLastName, "http://www.intuit.com/sb/cdm/v2":FirstLastEnd, "http://www.intuit.com/sb/cdm/v2":FirstLastStart, "http://www.intuit.com/sb/cdm/v2":FirstLastInside, "http://www.intuit.com/sb/cdm/v2":IncludeTimeEntryEnum}' is expected.
So, I added in the second filter (commented in the controller code above) and now I get this error.
IntuitRequestException at /atest
cvc-complex-type.2.4.d: Invalid content was found starting with element 'StartPage'. No child element is expected at this point.
from quickeebooks.
The API is sensitive to order of the query fields. I moved the StartPage and ChunkSize fields to come before the passed through filter fields. A pull request has been issued.
from quickeebooks.
Related Issues (20)
- Now, How can I get menu_proxy_code_id? HOT 3
- Way to handle quickbooks exceptions? HOT 6
- I Want to pull customer and sub-customers seperately and store them in seperate database tables? HOT 1
- Support for Estimate service HOT 5
- How to grep SalesTerm values from QBO to our application HOT 5
- Search customer by Email HOT 3
- What all things are required to shift from QBO (online) v2 to v3? HOT 1
- IntuitRequestException: cvc-datatype-valid.1.2.1 HOT 1
- How to validate that the token is not expired HOT 9
- InvoiceHeader.status HOT 1
- Issue with Item creation HOT 3
- SubAccounts HOT 2
- no way to create the <ItemRef> required to create an invoice
- License missing from gemspec HOT 2
- Update Invoice in Windows edition HOT 3
- Quickbooks Desktop, new customer needs domain="NG" not "QB" HOT 3
- DateTime filter results in Unparseable date error
- Email Address for Windows::Model::Employee HOT 5
- Way to push jobs in quickbook using Online models?? HOT 2
- Bluedot Menu displaying "We are sorry but we cannot load the menu right now"? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quickeebooks.