Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

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

Open
przbadu opened this issue Sep 20, 2013 · 1 comment

Comments

@przbadu
Copy link

przbadu commented Sep 20, 2013

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?

@ruckus
Copy link
Owner

ruckus commented Sep 20, 2013

I've never worked with sub-Customers so I don't know if they have special properties (?).

According to the Online Customer docs:

https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0500_quickbooks_windows/0600_object_reference/customer

There should be a CustomerTypeName property with a colon-delimited list. However, I just created a test sub-Customer in QB Online and when I fetch it using Quickeebooks I don't see that property. So I don't know how to determine if a customer is a sub-customer unless you have your own application logic/flag to determine that.

I see there is a:

    <CustomField xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BooleanTypeCustomField">
        <DefinitionId>Bill With Parent</DefinitionId>
        <Value>true</Value>
    </CustomField>

property set. But one can still set that to false even if it IS a sub-Customer - so thats not definitive.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants