quickbooks_api 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
@@ -0,0 +1,97 @@
1
+ ## About
2
+
3
+ *quickbooks_api* is a quickbooks xml parser and API inspection tool. It gives
4
+ you the ability to easilty go from qbxml to ruby and vice versa.
5
+
6
+ ### Initialization
7
+ ------------------------------------------------------------------------------
8
+
9
+ standard initialization
10
+
11
+ api = Quickbooks::API.instance(:qbpos)
12
+
13
+ shorthand initialization
14
+
15
+ api = Quickbooks::API[:qbpos]
16
+
17
+
18
+ :qb and :qbpos are the two supported init modes.
19
+
20
+ ### API Introspection
21
+ ------------------------------------------------------------------------------
22
+
23
+ return all available wrapper classes
24
+
25
+ api.qbxml_classes
26
+
27
+ return the top level wrapper class for the api
28
+
29
+ api.container
30
+
31
+ find specific qbxml class by name
32
+
33
+ api.find('customer_mod_rq')
34
+
35
+ find all qbxml classes that contain a pattern
36
+
37
+ api.grep(/_mod_rq/)
38
+
39
+ return a hash of all the data types for a wrapper class
40
+
41
+ wrapper_class.template
42
+
43
+ return the full teplate for a wrapper class (SLOOOW for top level classes)
44
+
45
+ wrapper_class.template(true)
46
+
47
+ return all the supported fields for the wrapper class
48
+
49
+ wrapper_class.attribute_names
50
+
51
+ return the qbxml template used to generate the wrapper class
52
+
53
+ wrapper_class.xml_template
54
+
55
+
56
+ ### QBXML To Ruby
57
+ ------------------------------------------------------------------------------
58
+
59
+ wrap qbxml data in a qbxml object
60
+
61
+ o = api.qbxml_to_obj(qbxml)
62
+
63
+ convert qbxml object to hash
64
+
65
+ o.inner_attributes
66
+
67
+ same as above but includes the top level containers
68
+
69
+ o.attributes
70
+
71
+ retrieves attributes from nested objects
72
+
73
+ o.attributes(true)
74
+
75
+ directly convert raw qbxml to a hash
76
+
77
+ h = api.qbxml_to_hash(qbxml)
78
+
79
+ same as above but includes the top level containers
80
+
81
+ h = api.qbxml_to_hash(qbxml, true)
82
+
83
+
84
+ ### Ruby to QBXML
85
+ ------------------------------------------------------------------------------
86
+
87
+ convert a hash to a qbxml object (automagically creates the top level containers)
88
+
89
+ o = api.hash_to_obj(data_hash)
90
+
91
+ convert a qbxml object to raw qbxml
92
+
93
+ o.to_qbxml.to_s
94
+
95
+ convert a hash directly to raw qbxml
96
+
97
+ qbxml = api.hash_to_qbxml(data_hash)
@@ -8,7 +8,7 @@ class Quickbooks::Parser::QbxmlBase
8
8
 
9
9
  FLOAT_CAST = Proc.new {|d| d ? Float(d) : 0.0}
10
10
  BOOL_CAST = Proc.new {|d| d ? (d == 'True' ? true : false) : false }
11
- DATE_CAST = Proc.new {|d| d ? Date.parse(d).xmlschema : Date.today.xmlschema }
11
+ DATE_CAST = Proc.new {|d| d ? Date.parse(d).strftime("%Y-%m-%d") : Date.today.strftime("%Y-%m-%d") }
12
12
  TIME_CAST = Proc.new {|d| d ? Time.parse(d).xmlschema : Time.now.xmlschema }
13
13
  INT_CAST = Proc.new {|d| d ? Integer(d.to_i) : 0 }
14
14
  STR_CAST = Proc.new {|d| d ? String(d) : ''}
@@ -0,0 +1,20 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'quickbooks_api'
3
+ s.version = '0.1.7'
4
+
5
+ s.summary = "QuickBooks XML API"
6
+ s.description = %{A QuickBooks QBXML wrapper for Ruby}
7
+
8
+ s.author = "Alex Skryl"
9
+ s.email = "rut216@gmail.com"
10
+ s.homepage = "http://github.com/skryl"
11
+ s.files = `git ls-files`.split($/)
12
+ s.require_paths = ["lib"]
13
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
14
+ s.require_paths = ["lib"]
15
+
16
+
17
+ s.add_dependency(%q<activesupport>, [">= 0"])
18
+ s.add_dependency(%q<nokogiri>, [">= 0"])
19
+ s.add_dependency(%q<buffered_logger>, [">= 0.1.3"])
20
+ end
@@ -0,0 +1,4 @@
1
+ --colour
2
+ --format s
3
+ --loadby mtime
4
+ --reverse
@@ -0,0 +1,57 @@
1
+ <QBPOSXML>
2
+ <QBPOSXMLMsgsRs>
3
+ <CustomerQueryRs retCount="3" statusCode="0" statusMessage="Status OK" statusSeverity="Info">
4
+ <CustomerRet>
5
+ <ListID>-7153013893932089081</ListID>
6
+ <TimeModified>2011-06-16T11:03:18-05:00</TimeModified>
7
+ <AccountBalance>0.00</AccountBalance>
8
+ <AccountLimit>0.00</AccountLimit>
9
+ <CustomerDiscPercent>0.00</CustomerDiscPercent>
10
+ <CustomerDiscType>None</CustomerDiscType>
11
+ <EMail>alex@gmail.com</EMail>
12
+ <FirstName>Alex</FirstName>
13
+ <FullName>Alex Skryl</FullName>
14
+ <IsAcceptingChecks>True</IsAcceptingChecks>
15
+ <IsUsingWithQB>False</IsUsingWithQB>
16
+ <LastName>Skryl</LastName>
17
+ <Phone>8001112345</Phone>
18
+ <PriceLevelNumber>1</PriceLevelNumber>
19
+ <StoreExchangeStatus>Modified</StoreExchangeStatus>
20
+ </CustomerRet>
21
+ <CustomerRet>
22
+ <ListID>-7153013893932089082</ListID>
23
+ <TimeModified>2011-06-16T11:03:18-05:00</TimeModified>
24
+ <AccountBalance>0.00</AccountBalance>
25
+ <AccountLimit>0.00</AccountLimit>
26
+ <CustomerDiscPercent>0.00</CustomerDiscPercent>
27
+ <CustomerDiscType>None</CustomerDiscType>
28
+ <EMail>alex@gmail.com</EMail>
29
+ <FirstName>Alex</FirstName>
30
+ <FullName>Alex Skryl</FullName>
31
+ <IsAcceptingChecks>True</IsAcceptingChecks>
32
+ <IsUsingWithQB>False</IsUsingWithQB>
33
+ <LastName>Skryl</LastName>
34
+ <Phone>8001112345</Phone>
35
+ <PriceLevelNumber>1</PriceLevelNumber>
36
+ <StoreExchangeStatus>Modified</StoreExchangeStatus>
37
+ </CustomerRet>
38
+ <CustomerRet>
39
+ <ListID>-7153013893932089083</ListID>
40
+ <TimeModified>2011-06-16T11:03:18-05:00</TimeModified>
41
+ <AccountBalance>0.00</AccountBalance>
42
+ <AccountLimit>0.00</AccountLimit>
43
+ <CustomerDiscPercent>0.00</CustomerDiscPercent>
44
+ <CustomerDiscType>None</CustomerDiscType>
45
+ <EMail>alex@gmail.com</EMail>
46
+ <FirstName>Alex</FirstName>
47
+ <FullName>Alex Skryl</FullName>
48
+ <IsAcceptingChecks>True</IsAcceptingChecks>
49
+ <IsUsingWithQB>False</IsUsingWithQB>
50
+ <LastName>Skryl</LastName>
51
+ <Phone>8001112345</Phone>
52
+ <PriceLevelNumber>1</PriceLevelNumber>
53
+ <StoreExchangeStatus>Modified</StoreExchangeStatus>
54
+ </CustomerRet>
55
+ </CustomerQueryRs>
56
+ </QBPOSXMLMsgsRs>
57
+ </QBPOSXML>
@@ -0,0 +1,23 @@
1
+ <QBPOSXML>
2
+ <QBPOSXMLMsgsRs>
3
+ <CustomerQueryRs retCount="3" statusCode="0" statusMessage="Status OK" statusSeverity="Info">
4
+ <CustomerRet>
5
+ <ListID>-7153013893932089081</ListID>
6
+ <TimeModified>2011-06-16T11:03:18-05:00</TimeModified>
7
+ <AccountBalance>0.00</AccountBalance>
8
+ <AccountLimit>0.00</AccountLimit>
9
+ <CustomerDiscPercent>0.00</CustomerDiscPercent>
10
+ <CustomerDiscType>None</CustomerDiscType>
11
+ <EMail>alex@gmail.com</EMail>
12
+ <FirstName>Alex</FirstName>
13
+ <FullName>Alex Skryl</FullName>
14
+ <IsAcceptingChecks>True</IsAcceptingChecks>
15
+ <IsUsingWithQB>False</IsUsingWithQB>
16
+ <LastName>Skryl</LastName>
17
+ <Phone>8001112345</Phone>
18
+ <PriceLevelNumber>1</PriceLevelNumber>
19
+ <StoreExchangeStatus>Modified</StoreExchangeStatus>
20
+ </CustomerRet>
21
+ </CustomerQueryRs>
22
+ </QBPOSXMLMsgsRs>
23
+ </QBPOSXML>
@@ -0,0 +1,94 @@
1
+ <QBPOSXML>
2
+ <QBPOSXMLMsgsRs>
3
+ <ItemInventoryQueryRs retCount="2" statusCode="0" statusMessage="Status OK" statusSeverity="Info">
4
+ <ItemInventoryRet>
5
+ <Color>Red</Color>
6
+ <Cost>51.00</Cost>
7
+ <DepartmentListID>-7153010144316587775</DepartmentListID>
8
+ <Desc1>Yellow Cup</Desc1>
9
+ <Desc2>A Yellow Cup</Desc2>
10
+ <IsBelowReorder>False</IsBelowReorder>
11
+ <IsEligibleForCommission>True</IsEligibleForCommission>
12
+ <IsPrintingTags>True</IsPrintingTags>
13
+ <IsUnorderable>False</IsUnorderable>
14
+ <ItemNumber>123</ItemNumber>
15
+ <ItemType>Inventory</ItemType>
16
+ <ListID>-7153010535175388927</ListID>
17
+ <MSRP>0.00</MSRP>
18
+ <MarginPercent>100</MarginPercent>
19
+ <MarkupPercent>9</MarkupPercent>
20
+ <OnHandStore01>0.00</OnHandStore01>
21
+ <OrderCost>53.00</OrderCost>
22
+ <Price1>10.00</Price1>
23
+ <Price2>9.00</Price2>
24
+ <Price3>9.00</Price3>
25
+ <Price4>9.00</Price4>
26
+ <QuantityOnHand>21.00</QuantityOnHand>
27
+ <QuantityOnOrder>22.00</QuantityOnOrder>
28
+ <ReorderPoint>555.00</ReorderPoint>
29
+ <SerialFlag>Optional</SerialFlag>
30
+ <Size>Larger</Size>
31
+ <StoreExchangeStatus>Modified</StoreExchangeStatus>
32
+ <TaxCode>Tax</TaxCode>
33
+ <TimeCreated>2011-06-16T11:04:02-05:00</TimeCreated>
34
+ <TimeModified>2011-06-16T11:04:02-05:00</TimeModified>
35
+ <UPC>1111111111111169</UPC>
36
+ <VendorListID>-7153004882964872959</VendorListID>
37
+ <VendorInfo2>
38
+ <OrderCost>0.00</OrderCost>
39
+ </VendorInfo2>
40
+ <VendorInfo3>
41
+ <OrderCost>0.00</OrderCost>
42
+ </VendorInfo3>
43
+ <VendorInfo4>
44
+ <OrderCost>0.00</OrderCost>
45
+ </VendorInfo4>
46
+ <VendorInfo5>
47
+ <OrderCost>0.00</OrderCost>
48
+ </VendorInfo5>
49
+ </ItemInventoryRet>
50
+ <ItemInventoryRet>
51
+ <Cost>0.00</Cost>
52
+ <DepartmentListID>-7153003340987727615</DepartmentListID>
53
+ <Desc1>ViewSonic Monitor</Desc1>
54
+ <IsBelowReorder>False</IsBelowReorder>
55
+ <IsEligibleForCommission>True</IsEligibleForCommission>
56
+ <IsPrintingTags>True</IsPrintingTags>
57
+ <IsUnorderable>False</IsUnorderable>
58
+ <ItemNumber>2</ItemNumber>
59
+ <ItemType>Inventory</ItemType>
60
+ <ListID>-7153004736919207679</ListID>
61
+ <MSRP>0.00</MSRP>
62
+ <MarginPercent>100</MarginPercent>
63
+ <MarkupPercent>0</MarkupPercent>
64
+ <OnHandStore01>0.00</OnHandStore01>
65
+ <OrderCost>0.00</OrderCost>
66
+ <Price1>100.00</Price1>
67
+ <Price2>90.00</Price2>
68
+ <Price3>90.00</Price3>
69
+ <Price4>90.00</Price4>
70
+ <QuantityOnHand>0.00</QuantityOnHand>
71
+ <QuantityOnOrder>0.00</QuantityOnOrder>
72
+ <ReorderPoint>0.00</ReorderPoint>
73
+ <SerialFlag>Optional</SerialFlag>
74
+ <StoreExchangeStatus>Modified</StoreExchangeStatus>
75
+ <TaxCode>Tax</TaxCode>
76
+ <TimeModified>2011-06-16T11:07:43-05:00</TimeModified>
77
+ <UPC>1111111111111112</UPC>
78
+ <VendorListID>-7153003877908971263</VendorListID>
79
+ <VendorInfo2>
80
+ <OrderCost>0.00</OrderCost>
81
+ </VendorInfo2>
82
+ <VendorInfo3>
83
+ <OrderCost>0.00</OrderCost>
84
+ </VendorInfo3>
85
+ <VendorInfo4>
86
+ <OrderCost>0.00</OrderCost>
87
+ </VendorInfo4>
88
+ <VendorInfo5>
89
+ <OrderCost>0.00</OrderCost>
90
+ </VendorInfo5>
91
+ </ItemInventoryRet>
92
+ </ItemInventoryQueryRs>
93
+ </QBPOSXMLMsgsRs>
94
+ </QBPOSXML>
@@ -0,0 +1,78 @@
1
+ <QBPOSXML>
2
+ <QBPOSXMLMsgsRs>
3
+ <SalesOrderQueryRs retCount="1" statusCode="0" statusMessage="Status OK" statusSeverity="Info">
4
+ <SalesOrderRet>
5
+ <Cashier>John</Cashier>
6
+ <CustomerListID>-7153012137256910591</CustomerListID>
7
+ <TxnID>-7134405948113780479</TxnID>
8
+ <TimeCreated>2011-06-16T11:04:02-05:00</TimeCreated>
9
+ <TimeModified>2011-06-16T11:04:02-05:00</TimeModified>
10
+ <Associate>Alex</Associate>
11
+ <BalanceDue>110.00</BalanceDue>
12
+ <DepositBalance>0.00</DepositBalance>
13
+ <Discount>5.00</Discount>
14
+ <DiscountPercent>3.00</DiscountPercent>
15
+ <ItemsCount>2</ItemsCount>
16
+ <PriceLevelNumber>1</PriceLevelNumber>
17
+ <Qty>2.00</Qty>
18
+ <SalesOrderNumber>123</SalesOrderNumber>
19
+ <SalesOrderStatusDesc>Open</SalesOrderStatusDesc>
20
+ <StoreExchangeStatus>Modified</StoreExchangeStatus>
21
+ <Subtotal>110.00</Subtotal>
22
+ <TaxAmount>15.00</TaxAmount>
23
+ <TaxCategory>Local Sales Tax</TaxCategory>
24
+ <TaxPercentage>16.00</TaxPercentage>
25
+ <Total>110.00</Total>
26
+ <TxnDate>2011-06-21</TxnDate>
27
+ <UnfilledPercent>100.00</UnfilledPercent>
28
+ <BillingInformation>
29
+ <FirstName>Alex</FirstName>
30
+ <LastName>Skryl</LastName>
31
+ </BillingInformation>
32
+ <ShippingInformation>
33
+ <Shipping>0.00</Shipping>
34
+ </ShippingInformation>
35
+ <SalesOrderItemRet>
36
+ <ListID>-7153010535175388927</ListID>
37
+ <TxnLineID>1</TxnLineID>
38
+ <Associate>Alex</Associate>
39
+ <Commission>0.00</Commission>
40
+ <Desc1>Yellow Cup</Desc1>
41
+ <Desc2>A Yellow Cup</Desc2>
42
+ <Discount>0.00</Discount>
43
+ <DiscountPercent>0.00</DiscountPercent>
44
+ <ExtendedPrice>11.00</ExtendedPrice>
45
+ <ExtendedTax>7.00</ExtendedTax>
46
+ <ItemNumber>1111</ItemNumber>
47
+ <Price>10.00</Price>
48
+ <PriceLevelNumber>1</PriceLevelNumber>
49
+ <Size>Larger</Size>
50
+ <Qty>1.00</Qty>
51
+ <TaxAmount>0.00</TaxAmount>
52
+ <TaxCode>Tax</TaxCode>
53
+ <TaxPercentage>0.00</TaxPercentage>
54
+ <UPC>1111111111111111</UPC>
55
+ </SalesOrderItemRet>
56
+ <SalesOrderItemRet>
57
+ <ListID>-7153004736919207679</ListID>
58
+ <TxnLineID>2</TxnLineID>
59
+ <Associate>Alex</Associate>
60
+ <Commission>0.00</Commission>
61
+ <Desc1>ViewSonic Monitor</Desc1>
62
+ <Discount>0.00</Discount>
63
+ <DiscountPercent>0.00</DiscountPercent>
64
+ <ExtendedPrice>100.00</ExtendedPrice>
65
+ <ExtendedTax>0.00</ExtendedTax>
66
+ <ItemNumber>2</ItemNumber>
67
+ <Price>100.00</Price>
68
+ <PriceLevelNumber>1</PriceLevelNumber>
69
+ <Qty>1.00</Qty>
70
+ <TaxAmount>0.00</TaxAmount>
71
+ <TaxCode>Tax</TaxCode>
72
+ <TaxPercentage>0.00</TaxPercentage>
73
+ <UPC>1111111111111112</UPC>
74
+ </SalesOrderItemRet>
75
+ </SalesOrderRet>
76
+ </SalesOrderQueryRs>
77
+ </QBPOSXMLMsgsRs>
78
+ </QBPOSXML>
@@ -0,0 +1,146 @@
1
+ <QBPOSXML>
2
+ <QBPOSXMLMsgsRs>
3
+ <SalesReceiptQueryRs retCount="2" statusCode="0" statusMessage="Status OK" statusSeverity="Info">
4
+ <SalesReceiptRet>
5
+ <Cashier>John</Cashier>
6
+ <TxnID>-7134401610112925439</TxnID>
7
+ <TimeCreated>2011-06-16T11:04:02-05:00</TimeCreated>
8
+ <TimeModified>2011-06-16T11:04:02-05:00</TimeModified>
9
+ <CustomerListID>-7153013893932089087</CustomerListID>
10
+ <Discount>4.00</Discount>
11
+ <DiscountPercent>5.00</DiscountPercent>
12
+ <HistoryDocStatus>Regular</HistoryDocStatus>
13
+ <ItemsCount>1</ItemsCount>
14
+ <PriceLevelNumber>1</PriceLevelNumber>
15
+ <QuickBooksFlag>NotPosted</QuickBooksFlag>
16
+ <SalesReceiptNumber>18</SalesReceiptNumber>
17
+ <SalesReceiptType>Sales</SalesReceiptType>
18
+ <StoreExchangeStatus>Modified</StoreExchangeStatus>
19
+ <StoreNumber>1</StoreNumber>
20
+ <Subtotal>50.00</Subtotal>
21
+ <TaxAmount>19.00</TaxAmount>
22
+ <TaxCategory>Local Sales Tax</TaxCategory>
23
+ <TaxPercentage>21.00</TaxPercentage>
24
+ <TenderType>Cash</TenderType>
25
+ <Total>50.00</Total>
26
+ <TxnDate>2011-06-21</TxnDate>
27
+ <Workstation>1</Workstation>
28
+ <BillingInformation>
29
+ <FirstName>Alex</FirstName>
30
+ <LastName>Skryl</LastName>
31
+ <Phone>8472932591</Phone>
32
+ </BillingInformation>
33
+ <ShippingInformation>
34
+ <Shipping>0.00</Shipping>
35
+ </ShippingInformation>
36
+ <SalesReceiptItemRet>
37
+ <ListID>-7134403723295555327</ListID>
38
+ <Commission>0.00</Commission>
39
+ <Cost>0.00</Cost>
40
+ <Desc1>Aquafina Waterbottle</Desc1>
41
+ <Discount>0.00</Discount>
42
+ <DiscountPercent>0.00</DiscountPercent>
43
+ <ExtendedPrice>50.00</ExtendedPrice>
44
+ <ExtendedTax>0.00</ExtendedTax>
45
+ <ItemNumber>3</ItemNumber>
46
+ <Price>50.00</Price>
47
+ <PriceLevelNumber>1</PriceLevelNumber>
48
+ <Qty>1.00</Qty>
49
+ <TaxAmount>0.00</TaxAmount>
50
+ <TaxCode>Tax</TaxCode>
51
+ <TaxPercentage>0.00</TaxPercentage>
52
+ <UPC>3333333333333333</UPC>
53
+ </SalesReceiptItemRet>
54
+ <TenderCashRet>
55
+ <TenderAmount>50.00</TenderAmount>
56
+ </TenderCashRet>
57
+ </SalesReceiptRet>
58
+ <SalesReceiptRet>
59
+ <TxnID>-7121131527051771647</TxnID>
60
+ <TimeModified>2011-06-25T01:15:29-05:00</TimeModified>
61
+ <CustomerListID>-7153013893932089087</CustomerListID>
62
+ <Discount>0.00</Discount>
63
+ <DiscountPercent>0.00</DiscountPercent>
64
+ <HistoryDocStatus>Regular</HistoryDocStatus>
65
+ <ItemsCount>3</ItemsCount>
66
+ <PriceLevelNumber>1</PriceLevelNumber>
67
+ <QuickBooksFlag>NotPosted</QuickBooksFlag>
68
+ <SalesReceiptNumber>2</SalesReceiptNumber>
69
+ <SalesReceiptType>Sales</SalesReceiptType>
70
+ <StoreExchangeStatus>Modified</StoreExchangeStatus>
71
+ <StoreNumber>1</StoreNumber>
72
+ <Subtotal>270.00</Subtotal>
73
+ <TaxAmount>0.00</TaxAmount>
74
+ <TaxCategory>Local Sales Tax</TaxCategory>
75
+ <TaxPercentage>0.00</TaxPercentage>
76
+ <TenderType>Cash</TenderType>
77
+ <Total>270.00</Total>
78
+ <TxnDate>2011-06-25</TxnDate>
79
+ <Workstation>1</Workstation>
80
+ <ShippingInformation>
81
+ <Shipping>0.00</Shipping>
82
+ </ShippingInformation>
83
+ <SalesReceiptItemRet>
84
+ <ListID>-7153004736919207679</ListID>
85
+ <Commission>0.00</Commission>
86
+ <Cost>0.00</Cost>
87
+ <Desc1>ViewSonic Monitor</Desc1>
88
+ <Discount>0.00</Discount>
89
+ <DiscountPercent>0.00</DiscountPercent>
90
+ <ExtendedPrice>100.00</ExtendedPrice>
91
+ <ExtendedTax>0.00</ExtendedTax>
92
+ <ItemNumber>2</ItemNumber>
93
+ <Price>100.00</Price>
94
+ <PriceLevelNumber>1</PriceLevelNumber>
95
+ <Qty>1.00</Qty>
96
+ <TaxAmount>0.00</TaxAmount>
97
+ <TaxCode>Tax</TaxCode>
98
+ <TaxPercentage>0.00</TaxPercentage>
99
+ <UPC>1111111111111112</UPC>
100
+ </SalesReceiptItemRet>
101
+ <SalesReceiptItemRet>
102
+ <ListID>-7153010535175388927</ListID>
103
+ <Commission>0.00</Commission>
104
+ <Cost>0.00</Cost>
105
+ <Desc1>Yellow Cup</Desc1>
106
+ <Desc2>A Yellow Cup</Desc2>
107
+ <Discount>0.00</Discount>
108
+ <DiscountPercent>0.00</DiscountPercent>
109
+ <ExtendedPrice>20.00</ExtendedPrice>
110
+ <ExtendedTax>0.00</ExtendedTax>
111
+ <ItemNumber>1</ItemNumber>
112
+ <Price>10.00</Price>
113
+ <PriceLevelNumber>1</PriceLevelNumber>
114
+ <Qty>2.00</Qty>
115
+ <TaxAmount>0.00</TaxAmount>
116
+ <TaxCode>Tax</TaxCode>
117
+ <TaxPercentage>0.00</TaxPercentage>
118
+ <UPC>1111111111111111</UPC>
119
+ </SalesReceiptItemRet>
120
+ <SalesReceiptItemRet>
121
+ <ListID>-7134403723295555327</ListID>
122
+ <Commission>0.00</Commission>
123
+ <Cost>0.00</Cost>
124
+ <Desc1>Aquafina Waterbottle</Desc1>
125
+ <Discount>0.00</Discount>
126
+ <DiscountPercent>0.00</DiscountPercent>
127
+ <ExtendedPrice>150.00</ExtendedPrice>
128
+ <ExtendedTax>0.00</ExtendedTax>
129
+ <ItemNumber>3</ItemNumber>
130
+ <Price>50.00</Price>
131
+ <PriceLevelNumber>1</PriceLevelNumber>
132
+ <Qty>3.00</Qty>
133
+ <TaxAmount>0.00</TaxAmount>
134
+ <TaxCode>Tax</TaxCode>
135
+ <TaxPercentage>0.00</TaxPercentage>
136
+ <UPC>3333333333333333</UPC>
137
+ </SalesReceiptItemRet>
138
+ <TenderCashRet>
139
+ <TenderAmount>270.00</TenderAmount>
140
+ </TenderCashRet>
141
+ </SalesReceiptRet>
142
+ </SalesReceiptQueryRs>
143
+ </QBPOSXMLMsgsRs>
144
+ </QBPOSXML>
145
+
146
+
@@ -0,0 +1,52 @@
1
+ <QBPOSXML>
2
+ <QBPOSXMLMsgsRs>
3
+ <VendorQueryRs retCount="4" statusCode="0" statusMessage="Status OK" statusSeverity="Info">
4
+ <VendorRet>
5
+ <ListID>-7153004882964872959</ListID>
6
+ <CompanyName>Yellow Cups Ltd</CompanyName>
7
+ <IsInactive>False</IsInactive>
8
+ <StoreExchangeStatus>Modified</StoreExchangeStatus>
9
+ <TermsDiscount>0.00</TermsDiscount>
10
+ <TermsDiscountDays>0</TermsDiscountDays>
11
+ <TermsNetDays>0</TermsNetDays>
12
+ <EMail>vendor@gmail.com</EMail>
13
+ <FirstName>James</FirstName>
14
+ <Phone>123-123-1255</Phone>
15
+ <VendorCode>AB123</VendorCode>
16
+ <TimeCreated>2011-06-16T11:04:02-05:00</TimeCreated>
17
+ <TimeModified>2011-06-16T11:04:02-05:00</TimeModified>
18
+ </VendorRet>
19
+ <VendorRet>
20
+ <ListID>-7153003877908971263</ListID>
21
+ <TimeModified>2011-06-16T11:06:49-05:00</TimeModified>
22
+ <CompanyName>ViewSonic</CompanyName>
23
+ <IsInactive>False</IsInactive>
24
+ <StoreExchangeStatus>Modified</StoreExchangeStatus>
25
+ <TermsDiscount>0.00</TermsDiscount>
26
+ <TermsDiscountDays>0</TermsDiscountDays>
27
+ <TermsNetDays>0</TermsNetDays>
28
+ </VendorRet>
29
+ <VendorRet>
30
+ <ListID>-7134402220023447295</ListID>
31
+ <TimeModified>2011-06-21T11:25:13-05:00</TimeModified>
32
+ <CompanyName>Aquafina</CompanyName>
33
+ <IsInactive>False</IsInactive>
34
+ <StoreExchangeStatus>Modified</StoreExchangeStatus>
35
+ <TermsDiscount>0.00</TermsDiscount>
36
+ <TermsDiscountDays>0</TermsDiscountDays>
37
+ <TermsNetDays>0</TermsNetDays>
38
+ </VendorRet>
39
+ <VendorRet>
40
+ <ListID>1000000002</ListID>
41
+ <TimeModified>2011-06-13T12:08:58-05:00</TimeModified>
42
+ <CompanyName>System</CompanyName>
43
+ <IsInactive>False</IsInactive>
44
+ <StoreExchangeStatus>Modified</StoreExchangeStatus>
45
+ <TermsDiscount>0.00</TermsDiscount>
46
+ <TermsDiscountDays>0</TermsDiscountDays>
47
+ <TermsNetDays>0</TermsNetDays>
48
+ <VendorCode>SYS</VendorCode>
49
+ </VendorRet>
50
+ </VendorQueryRs>
51
+ </QBPOSXMLMsgsRs>
52
+ </QBPOSXML>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quickbooks_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-04 00:00:00.000000000Z
12
+ date: 2012-11-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &70141539683320 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70141539683320
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: nokogiri
27
- requirement: &70141539682800 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70141539682800
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: buffered_logger
38
- requirement: &70141539682300 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,13 +53,22 @@ dependencies:
43
53
  version: 0.1.3
44
54
  type: :runtime
45
55
  prerelease: false
46
- version_requirements: *70141539682300
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 0.1.3
47
62
  description: A QuickBooks QBXML wrapper for Ruby
48
63
  email: rut216@gmail.com
49
64
  executables: []
50
65
  extensions: []
51
66
  extra_rdoc_files: []
52
67
  files:
68
+ - .gitignore
69
+ - README.md
70
+ - TODO
71
+ - lib/quickbooks.rb
53
72
  - lib/quickbooks/api.rb
54
73
  - lib/quickbooks/config.rb
55
74
  - lib/quickbooks/dtd_parser.rb
@@ -61,7 +80,7 @@ files:
61
80
  - lib/quickbooks/qbxml_parser.rb
62
81
  - lib/quickbooks/support/inflection.rb
63
82
  - lib/quickbooks/support/monkey_patches.rb
64
- - lib/quickbooks.rb
83
+ - quickbooks_api.gemspec
65
84
  - spec/quickbooks/api_spec.rb
66
85
  - spec/quickbooks/class_builder_spec.rb
67
86
  - spec/quickbooks/config_spec.rb
@@ -71,13 +90,18 @@ files:
71
90
  - spec/quickbooks/monkey_patches_spec.rb
72
91
  - spec/quickbooks/qbxml_base_spec.rb
73
92
  - spec/quickbooks/qbxml_parser_spec.rb
93
+ - spec/quickbooks/spec.opts
74
94
  - spec/quickbooks/spec_helper.rb
75
95
  - spec/quickbooks/xml_generation_spec.rb
76
96
  - spec/quickbooks/xml_parsing_spec.rb
97
+ - spec/sample_data/customer_response_multiple.xml
98
+ - spec/sample_data/customer_response_single.xml
99
+ - spec/sample_data/inventory_response.xml
100
+ - spec/sample_data/order_response.xml
101
+ - spec/sample_data/receipt_response.xml
102
+ - spec/sample_data/vendor_response.xml
77
103
  - xml_schema/qbposxmlops30.xml
78
104
  - xml_schema/qbxmlops70.xml
79
- - README
80
- - TODO
81
105
  homepage: http://github.com/skryl
82
106
  licenses: []
83
107
  post_install_message:
@@ -98,8 +122,28 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
122
  version: '0'
99
123
  requirements: []
100
124
  rubyforge_project:
101
- rubygems_version: 1.8.6
125
+ rubygems_version: 1.8.23
102
126
  signing_key:
103
127
  specification_version: 3
104
128
  summary: QuickBooks XML API
105
- test_files: []
129
+ test_files:
130
+ - spec/quickbooks/api_spec.rb
131
+ - spec/quickbooks/class_builder_spec.rb
132
+ - spec/quickbooks/config_spec.rb
133
+ - spec/quickbooks/dtd_parser_spec.rb
134
+ - spec/quickbooks/inflection_spec.rb
135
+ - spec/quickbooks/logger_spec.rb
136
+ - spec/quickbooks/monkey_patches_spec.rb
137
+ - spec/quickbooks/qbxml_base_spec.rb
138
+ - spec/quickbooks/qbxml_parser_spec.rb
139
+ - spec/quickbooks/spec.opts
140
+ - spec/quickbooks/spec_helper.rb
141
+ - spec/quickbooks/xml_generation_spec.rb
142
+ - spec/quickbooks/xml_parsing_spec.rb
143
+ - spec/sample_data/customer_response_multiple.xml
144
+ - spec/sample_data/customer_response_single.xml
145
+ - spec/sample_data/inventory_response.xml
146
+ - spec/sample_data/order_response.xml
147
+ - spec/sample_data/receipt_response.xml
148
+ - spec/sample_data/vendor_response.xml
149
+ has_rdoc:
data/README DELETED
@@ -1,74 +0,0 @@
1
- INITIALIZATION
2
- ------------------------------------------------------------------------------
3
-
4
- # supported data types are:
5
- # :qb - Quickbooks
6
- # :qbpos - Quickbooks Point Of Sale
7
-
8
- api = Quickbooks::API.instance(:qbpos)
9
-
10
- # shorthand initialization
11
- api = Quickbooks::API[:qbpos]
12
-
13
-
14
- API INTROSPECTION
15
- ------------------------------------------------------------------------------
16
-
17
- # returns all available wrapper classes
18
- api.qbxml_classes
19
-
20
- # returns the top level wrapper class for the api
21
- api.container
22
-
23
- # find specific qbxml class by name
24
- api.find('customer_mod_rq')
25
-
26
- # find all qbxml classes that contain a pattern
27
- api.grep(/_mod_rq/)
28
-
29
- # returns a hash of all the data types for a wrapper class
30
- wrapper_class.template
31
-
32
- # returns the full teplate for a wrapper class (SLOOOW for top level classes)
33
- wrapper_class.template(true)
34
-
35
- # returns all the supported fields for the wrapper class
36
- wrapper_class.attribute_names
37
-
38
- # returns the qbxml template used to generate the wrapper class
39
- wrapper_class.xml_template
40
-
41
-
42
- QBXML TO RUBY
43
- ------------------------------------------------------------------------------
44
-
45
- # wrap qbxml data in a qbxml object
46
- o = api.qbxml_to_obj(qbxml)
47
-
48
- # convert qbxml object to hash
49
- o.inner_attributes
50
-
51
- # same as above but includes the top level containers
52
- o.attributes
53
-
54
- # retrieves attributes from nested objects
55
- o.attributes(true)
56
-
57
- # directly convert raw qbxml to a hash
58
- h = api.qbxml_to_hash(qbxml)
59
-
60
- # same as above but includes the top level containers
61
- h = api.qbxml_to_hash(qbxml, true)
62
-
63
-
64
- RUBY TO QBXML
65
- ------------------------------------------------------------------------------
66
-
67
- # convert a hash to a qbxml object (automagically creates the top level containers)
68
- o = api.hash_to_obj(data_hash)
69
-
70
- # convert a qbxml object to raw qbxml
71
- o.to_qbxml.to_s
72
-
73
- # convert a hash directly to raw qbxml
74
- qbxml = api.hash_to_qbxml(data_hash)