forked from whereisciao/quickeebooks
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
246 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Quickeebooks | ||
|
||
VERSION = "0.1.13" | ||
VERSION = "0.1.14" | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
describe "Quickeebooks::Windows::Service::Item" do | ||
before(:all) do | ||
FakeWeb.allow_net_connect = false | ||
qb_key = "key" | ||
qb_secret = "secreet" | ||
|
||
@realm_id = "9991111222" | ||
@base_uri = "https://qbo.intuit.com/qbo36" | ||
@oauth_consumer = OAuth::Consumer.new(qb_key, qb_key, { | ||
:site => "https://oauth.intuit.com", | ||
:request_token_path => "/oauth/v1/get_request_token", | ||
:authorize_path => "/oauth/v1/get_access_token", | ||
:access_token_path => "/oauth/v1/get_access_token" | ||
}) | ||
@oauth = OAuth::AccessToken.new(@oauth_consumer, "blah", "blah") | ||
end | ||
|
||
it "can fetch a list of Items" do | ||
xml = windowsFixture("items.xml") | ||
model = Quickeebooks::Windows::Model::Item | ||
service = Quickeebooks::Windows::Service::Item.new | ||
service.access_token = @oauth | ||
service.realm_id = @realm_id | ||
FakeWeb.register_uri(:post, service.url_for_resource(model::REST_RESOURCE), :status => ["200", "OK"], :body => xml) | ||
items = service.list | ||
items.entries.count.should == 2 | ||
gruner = items.entries.first | ||
gruner.name.should == "FGVS09" | ||
|
||
end | ||
|
||
it "can fetch an Item by ID" do | ||
xml = windowsFixture("item.xml") | ||
model = Quickeebooks::Windows::Model::Item | ||
service = Quickeebooks::Windows::Service::Item.new | ||
service.access_token = @oauth | ||
service.realm_id = @realm_id | ||
FakeWeb.register_uri(:get, "#{service.url_for_resource(model::REST_RESOURCE)}/407?idDomain=QB", :status => ["200", "OK"], :body => xml) | ||
customer = service.fetch_by_id(407) | ||
customer.name.should == "DWCSH11" | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<RestResponse xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.intuit.com/sb/cdm/v2 ../common/RestDataFilter.xsd"> | ||
<Items> | ||
<Item> | ||
<Id idDomain="QB">407</Id> | ||
<SyncToken>1</SyncToken> | ||
<MetaData> | ||
<CreatedBy>app</CreatedBy> | ||
<CreateTime>2013-05-07T21:04:22.0Z</CreateTime> | ||
<LastModifiedBy>app</LastModifiedBy> | ||
<LastUpdatedTime>2013-07-22T22:19:49.0Z</LastUpdatedTime> | ||
</MetaData> | ||
<ExternalKey idDomain="QB">407</ExternalKey> | ||
<Synchronized>true</Synchronized> | ||
<Name>DWCSH11</Name> | ||
<Desc>2011 Deovlet Wines - Solomon Hills Chardonnay 12/750ML</Desc> | ||
<Taxable>false</Taxable> | ||
<Active>true</Active> | ||
<UnitPrice> | ||
<CurrencyCode>USD</CurrencyCode> | ||
<Amount>0</Amount> | ||
</UnitPrice> | ||
<Type>Inventory</Type> | ||
<UOMId idDomain="QB">1</UOMId> | ||
<UOMAbbrv>By the Case - 12 pk</UOMAbbrv> | ||
<IncomeAccountRef> | ||
<AccountId idDomain="QB">8</AccountId> | ||
<AccountName>Sales</AccountName> | ||
<AccountType>Revenue</AccountType> | ||
</IncomeAccountRef> | ||
<PurchaseDesc>2011 Deovlet Wines - Solomon Hills Chardonnay 12/750ML</PurchaseDesc> | ||
<PurchaseCost> | ||
<CurrencyCode>USD</CurrencyCode> | ||
<Amount>210</Amount> | ||
</PurchaseCost> | ||
<COGSAccountRef> | ||
<AccountId idDomain="QB">44</AccountId> | ||
<AccountName>Wine Cost</AccountName> | ||
<AccountType>Expense</AccountType> | ||
</COGSAccountRef> | ||
<AssetAccountRef> | ||
<AccountId idDomain="QB">42</AccountId> | ||
<AccountName>Inventory Asset</AccountName> | ||
<AccountType>Asset</AccountType> | ||
</AssetAccountRef> | ||
<PrefVendorRef> | ||
<VendorId idDomain="QB">755</VendorId> | ||
<VendorName>Deovlet Wines</VendorName> | ||
</PrefVendorRef> | ||
<AvgCost> | ||
<CurrencyCode>USD</CurrencyCode> | ||
<Amount>210</Amount> | ||
</AvgCost> | ||
<QtyOnHand>2.5</QtyOnHand> | ||
<QtyOnPurchaseOrder>0</QtyOnPurchaseOrder> | ||
<QtyOnSalesOrder>0</QtyOnSalesOrder> | ||
</Item> | ||
</Items> | ||
</RestResponse> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
<RestResponse xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:xdb="http://xmlns.oracle.com/xdb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.intuit.com/sb/cdm/v2 ../common/RestDataFilter.xsd"> | ||
<Items> | ||
<Item> | ||
<Id idDomain="QB">93</Id> | ||
<SyncToken>1</SyncToken> | ||
<MetaData> | ||
<CreatedBy>app</CreatedBy> | ||
<CreateTime>2012-04-25T13:20:06.0Z</CreateTime> | ||
<LastModifiedBy>app</LastModifiedBy> | ||
<LastUpdatedTime>2013-05-08T21:58:49.0Z</LastUpdatedTime> | ||
</MetaData> | ||
<ExternalKey idDomain="QB">93</ExternalKey> | ||
<Synchronized>true</Synchronized> | ||
<CustomField xsi:type="StringTypeCustomField"> | ||
<DefinitionId idDomain="QB">0</DefinitionId> | ||
<Name>com.intuit.sb.qb.item.Producer</Name> | ||
<Value>Forstreiter</Value> | ||
</CustomField> | ||
<CustomField xsi:type="StringTypeCustomField"> | ||
<DefinitionId idDomain="QB">1</DefinitionId> | ||
<Name>com.intuit.sb.qb.item.Varietal</Name> | ||
<Value>Veltliner</Value> | ||
</CustomField> | ||
<CustomField xsi:type="StringTypeCustomField"> | ||
<DefinitionId idDomain="QB">3</DefinitionId> | ||
<Name>com.intuit.sb.qb.item.Vintage</Name> | ||
<Value>2009</Value> | ||
</CustomField> | ||
<Name>FGVS09</Name> | ||
<Desc>2009 Forstreiter - Gruner Veltliner Schiefer 12/750ML</Desc> | ||
<Taxable>false</Taxable> | ||
<Active>false</Active> | ||
<UnitPrice> | ||
<CurrencyCode>USD</CurrencyCode> | ||
<Amount>276</Amount> | ||
</UnitPrice> | ||
<Type>Inventory</Type> | ||
<UOMId idDomain="QB">1</UOMId> | ||
<UOMAbbrv>By the Case - 12 pk</UOMAbbrv> | ||
<IncomeAccountRef> | ||
<AccountId idDomain="QB">8</AccountId> | ||
<AccountName>Sales</AccountName> | ||
<AccountType>Revenue</AccountType> | ||
</IncomeAccountRef> | ||
<PurchaseDesc>2009 Forstreiter - Gruner Veltliner Schiefer 12/750ML</PurchaseDesc> | ||
<PurchaseCost> | ||
<CurrencyCode>USD</CurrencyCode> | ||
<Amount>154</Amount> | ||
</PurchaseCost> | ||
<COGSAccountRef> | ||
<AccountId idDomain="QB">44</AccountId> | ||
<AccountName>Wine Cost</AccountName> | ||
<AccountType>Expense</AccountType> | ||
</COGSAccountRef> | ||
<AssetAccountRef> | ||
<AccountId idDomain="QB">42</AccountId> | ||
<AccountName>Inventory Asset</AccountName> | ||
<AccountType>Asset</AccountType> | ||
</AssetAccountRef> | ||
<AvgCost> | ||
<CurrencyCode>USD</CurrencyCode> | ||
<Amount>154</Amount> | ||
</AvgCost> | ||
<QtyOnHand>0</QtyOnHand> | ||
<QtyOnPurchaseOrder>0</QtyOnPurchaseOrder> | ||
<QtyOnSalesOrder>0</QtyOnSalesOrder> | ||
</Item> | ||
<Item> | ||
<Id idDomain="QB">92</Id> | ||
<SyncToken>1</SyncToken> | ||
<MetaData> | ||
<CreatedBy>app</CreatedBy> | ||
<CreateTime>2012-04-25T13:17:03.0Z</CreateTime> | ||
<LastModifiedBy>app</LastModifiedBy> | ||
<LastUpdatedTime>2013-04-12T17:27:20.0Z</LastUpdatedTime> | ||
</MetaData> | ||
<ExternalKey idDomain="QB">92</ExternalKey> | ||
<Synchronized>true</Synchronized> | ||
<CustomField xsi:type="StringTypeCustomField"> | ||
<DefinitionId idDomain="QB">0</DefinitionId> | ||
<Name>com.intuit.sb.qb.item.Producer</Name> | ||
<Value>Forstreiter</Value> | ||
</CustomField> | ||
<CustomField xsi:type="StringTypeCustomField"> | ||
<DefinitionId idDomain="QB">1</DefinitionId> | ||
<Name>com.intuit.sb.qb.item.Varietal</Name> | ||
<Value>Veltliner</Value> | ||
</CustomField> | ||
<CustomField xsi:type="StringTypeCustomField"> | ||
<DefinitionId idDomain="QB">3</DefinitionId> | ||
<Name>com.intuit.sb.qb.item.Vintage</Name> | ||
<Value>2010</Value> | ||
</CustomField> | ||
<Name>FGVK10</Name> | ||
<Desc>2010 Forstreiter - Gruner Veltliner Kogl 12/750ML</Desc> | ||
<Taxable>false</Taxable> | ||
<Active>false</Active> | ||
<UnitPrice> | ||
<CurrencyCode>USD</CurrencyCode> | ||
<Amount>180</Amount> | ||
</UnitPrice> | ||
<Type>Inventory</Type> | ||
<UOMId idDomain="QB">1</UOMId> | ||
<UOMAbbrv>By the Case - 12 pk</UOMAbbrv> | ||
<IncomeAccountRef> | ||
<AccountId idDomain="QB">8</AccountId> | ||
<AccountName>Sales</AccountName> | ||
<AccountType>Revenue</AccountType> | ||
</IncomeAccountRef> | ||
<PurchaseDesc>2010 Forstreiter - Gruner Veltliner Kogl 12/750ML</PurchaseDesc> | ||
<PurchaseCost> | ||
<CurrencyCode>USD</CurrencyCode> | ||
<Amount>92</Amount> | ||
</PurchaseCost> | ||
<COGSAccountRef> | ||
<AccountId idDomain="QB">44</AccountId> | ||
<AccountName>Wine Cost</AccountName> | ||
<AccountType>Expense</AccountType> | ||
</COGSAccountRef> | ||
<AssetAccountRef> | ||
<AccountId idDomain="QB">42</AccountId> | ||
<AccountName>Inventory Asset</AccountName> | ||
<AccountType>Asset</AccountType> | ||
</AssetAccountRef> | ||
<AvgCost> | ||
<CurrencyCode>USD</CurrencyCode> | ||
<Amount>92.04</Amount> | ||
</AvgCost> | ||
<QtyOnHand>0</QtyOnHand> | ||
<QtyOnPurchaseOrder>0</QtyOnPurchaseOrder> | ||
<QtyOnSalesOrder>0</QtyOnSalesOrder> | ||
</Item> | ||
</Items> | ||
</RestResponse> |