quickeebooks 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/Gemfile +3 -0
  2. data/Gemfile.lock +52 -0
  3. data/MIT-LICENSE +9 -0
  4. data/README.md +306 -0
  5. data/Rakefile +17 -0
  6. data/lib/quickeebooks.rb +89 -0
  7. data/lib/quickeebooks/online/model/account.rb +47 -0
  8. data/lib/quickeebooks/online/model/account_detail_type.rb +233 -0
  9. data/lib/quickeebooks/online/model/account_reference.rb +17 -0
  10. data/lib/quickeebooks/online/model/address.rb +42 -0
  11. data/lib/quickeebooks/online/model/customer.rb +66 -0
  12. data/lib/quickeebooks/online/model/customer_custom_field.rb +51 -0
  13. data/lib/quickeebooks/online/model/email.rb +24 -0
  14. data/lib/quickeebooks/online/model/intuit_type.rb +25 -0
  15. data/lib/quickeebooks/online/model/invoice.rb +50 -0
  16. data/lib/quickeebooks/online/model/invoice_header.rb +29 -0
  17. data/lib/quickeebooks/online/model/invoice_line_item.rb +22 -0
  18. data/lib/quickeebooks/online/model/item.rb +47 -0
  19. data/lib/quickeebooks/online/model/meta_data.rb +27 -0
  20. data/lib/quickeebooks/online/model/note.rb +11 -0
  21. data/lib/quickeebooks/online/model/open_balance.rb +11 -0
  22. data/lib/quickeebooks/online/model/phone.rb +12 -0
  23. data/lib/quickeebooks/online/model/price.rb +18 -0
  24. data/lib/quickeebooks/online/model/purchase_cost.rb +11 -0
  25. data/lib/quickeebooks/online/model/unit_price.rb +11 -0
  26. data/lib/quickeebooks/online/model/web_site.rb +16 -0
  27. data/lib/quickeebooks/online/service/account.rb +52 -0
  28. data/lib/quickeebooks/online/service/customer.rb +57 -0
  29. data/lib/quickeebooks/online/service/entitlement.rb +15 -0
  30. data/lib/quickeebooks/online/service/filter.rb +96 -0
  31. data/lib/quickeebooks/online/service/invoice.rb +50 -0
  32. data/lib/quickeebooks/online/service/item.rb +52 -0
  33. data/lib/quickeebooks/online/service/pagination.rb +19 -0
  34. data/lib/quickeebooks/online/service/service_base.rb +202 -0
  35. data/lib/quickeebooks/online/service/sort.rb +19 -0
  36. data/lib/quickeebooks/version.rb +5 -0
  37. data/lib/quickeebooks/windows/model/account.rb +67 -0
  38. data/lib/quickeebooks/windows/model/account_detail_type.rb +233 -0
  39. data/lib/quickeebooks/windows/model/account_reference.rb +19 -0
  40. data/lib/quickeebooks/windows/model/address.rb +36 -0
  41. data/lib/quickeebooks/windows/model/custom_field.rb +13 -0
  42. data/lib/quickeebooks/windows/model/customer.rb +109 -0
  43. data/lib/quickeebooks/windows/model/email.rb +44 -0
  44. data/lib/quickeebooks/windows/model/intuit_type.rb +17 -0
  45. data/lib/quickeebooks/windows/model/invoice.rb +44 -0
  46. data/lib/quickeebooks/windows/model/invoice_header.rb +65 -0
  47. data/lib/quickeebooks/windows/model/invoice_line_item.rb +38 -0
  48. data/lib/quickeebooks/windows/model/item.rb +84 -0
  49. data/lib/quickeebooks/windows/model/meta_data.rb +31 -0
  50. data/lib/quickeebooks/windows/model/note.rb +19 -0
  51. data/lib/quickeebooks/windows/model/open_balance.rb +11 -0
  52. data/lib/quickeebooks/windows/model/phone.rb +20 -0
  53. data/lib/quickeebooks/windows/model/price.rb +18 -0
  54. data/lib/quickeebooks/windows/model/purchase_cost.rb +12 -0
  55. data/lib/quickeebooks/windows/model/tax_line.rb +18 -0
  56. data/lib/quickeebooks/windows/model/unit_price.rb +12 -0
  57. data/lib/quickeebooks/windows/model/vendor_reference.rb +13 -0
  58. data/lib/quickeebooks/windows/model/web_site.rb +19 -0
  59. data/lib/quickeebooks/windows/service/account.rb +16 -0
  60. data/lib/quickeebooks/windows/service/customer.rb +16 -0
  61. data/lib/quickeebooks/windows/service/invoice.rb +27 -0
  62. data/lib/quickeebooks/windows/service/item.rb +18 -0
  63. data/lib/quickeebooks/windows/service/service_base.rb +176 -0
  64. data/quickeebooks.gemspec +27 -0
  65. data/spec/mocks/oauth_consumer_mock.rb +2 -0
  66. data/spec/quickeebooks/online/account_spec.rb +41 -0
  67. data/spec/quickeebooks/online/customer_spec.rb +46 -0
  68. data/spec/quickeebooks/online/invoice_spec.rb +15 -0
  69. data/spec/quickeebooks/online/services/account_spec.rb +84 -0
  70. data/spec/quickeebooks/online/services/customer_spec.rb +107 -0
  71. data/spec/quickeebooks/online/services/filter_spec.rb +43 -0
  72. data/spec/quickeebooks/online/services/service_base_spec.rb +30 -0
  73. data/spec/quickeebooks/online/services/sort_spec.rb +17 -0
  74. data/spec/quickeebooks/windows/customer_spec.rb +49 -0
  75. data/spec/quickeebooks_spec.rb +11 -0
  76. data/spec/spec_helper.rb +20 -0
  77. data/spec/xml/online/account.xml +13 -0
  78. data/spec/xml/online/accounts.xml +108 -0
  79. data/spec/xml/online/customer.xml +63 -0
  80. data/spec/xml/online/customer2.xml +63 -0
  81. data/spec/xml/online/customers.xml +125 -0
  82. data/spec/xml/online/invoice.xml +33 -0
  83. data/spec/xml/online/user.xml +11 -0
  84. data/spec/xml/windows/customer.xml +56 -0
  85. data/spec/xml/windows/customers.xml +137 -0
  86. data/spec/xml/windows/http_401.xml +8 -0
  87. metadata +229 -0
@@ -0,0 +1,5 @@
1
+ module Quickeebooks
2
+
3
+ VERSION = "0.0.2"
4
+
5
+ end
@@ -0,0 +1,67 @@
1
+ require "quickeebooks"
2
+ require "quickeebooks/windows/model/meta_data"
3
+ require "quickeebooks/windows/model/account_detail_type"
4
+
5
+ module Quickeebooks
6
+ module Windows
7
+ module Model
8
+ class Account < Quickeebooks::Windows::Model::IntuitType
9
+ include ActiveModel::Validations
10
+ xml_convention :camelcase
11
+ xml_accessor :id, :from => 'Id'
12
+ xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
13
+ xml_accessor :meta_data, :from => 'MetaData', :as => Quickeebooks::Windows::Model::MetaData
14
+ xml_accessor :external_key, :from => 'ExternalKey'
15
+ xml_accessor :synchronized, :from => 'Synchronized'
16
+ xml_accessor :custom_fields, :from => 'CustomField', :as => [Quickeebooks::Windows::Model::CustomField]
17
+ xml_accessor :draft
18
+ xml_accessor :object_state, :from => 'ObjectState'
19
+ xml_accessor :account_parent_id, :from => 'AccountParentId'
20
+ xml_accessor :account_parent_name, :from => 'AccountParentName'
21
+ xml_accessor :name, :from => 'Name'
22
+ xml_accessor :desc, :from => 'Desc'
23
+ xml_accessor :active
24
+ xml_accessor :type, :from => 'Type'
25
+ xml_accessor :sub_type, :from => 'SubType'
26
+ xml_accessor :acct_num, :from => 'AcctNum'
27
+ xml_accessor :bank_num, :from => 'BankNum'
28
+ xml_accessor :routing_num, :from => 'RoutingNum'
29
+ xml_accessor :opening_balance, :from => 'OpeningBalance', :as => Float
30
+ xml_accessor :current_balance, :from => 'CurrentBalance', :as => Float
31
+ xml_accessor :opening_balance_date, :from => 'OpeningBalanceDate', :as => Date
32
+ xml_accessor :current_balance_with_sub_accounts, :from => 'CurrentBalanceWithSubAccounts', :as => Float
33
+
34
+ validates_presence_of :name, :sub_type
35
+ validates_inclusion_of :sub_type, :in => Quickeebooks::Windows::Model::AccountDetailType::TYPES
36
+ validate :ensure_name_is_valid
37
+
38
+ def valid_for_update?
39
+ if sync_token.nil?
40
+ errors.add(:sync_token, "Missing required attribute SyncToken for update")
41
+ end
42
+ valid?
43
+ errors.empty?
44
+ end
45
+
46
+ # To delete an account Intuit requires we provide Id and SyncToken fields
47
+ def valid_for_deletion?
48
+ return false if(id.nil? || sync_token.nil?)
49
+ id.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0
50
+ end
51
+
52
+ private
53
+
54
+ def ensure_name_is_valid
55
+ if name.nil?
56
+ errors.add(:name, "Missing required attribute: name")
57
+ end
58
+ if name.is_a?(String) && name.index(':') != nil
59
+ errors.add(:name, "Attribute :name cannot contain a colon")
60
+ end
61
+ end
62
+
63
+ end
64
+
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,233 @@
1
+ module Quickeebooks
2
+ module Windows
3
+ module Model
4
+ module AccountDetailType
5
+ TYPES = ["ARRefundCreditCard", "Accepted", "AccountsPayable", "AccountsReceivable", "AccumulatedAdjustment", "AccumulatedAmortization", "AccumulatedAmortizationOfOtherAssets", "AccumulatedDepletion", "AccumulatedDepreciation", "Active", "AdvertisingPromotional", "AllowanceForBadDebts", "AmEx", "AmEx", "Amortization", "Annually", "Area", "Assembly", "Asset", "Authorization", "Auto", "Awarded", "BadDebts", "Bank", "BankCharges", "Bill", "BillPayment", "Billable", "Billable", "BillableHasBeenBilled", "BuildAssembly", "Buildings", "Capture", "CardNotPresent", "CardPresent", "CarryOver", "Cash", "CashOnHand", "CashPurchase", "Charge", "Charge", "CharitableContributions", "Check", "Check", "Checking", "Closed", "Closed", "CommonStock", "Cost of Goods Sold", "CostOfLabor", "CostOfLaborCos", "Count", "Credit", "Credit Card", "CreditCard", "CreditCardCharge", "CreditCardCredit", "CreditMemo", "Customer", "DateDriven", "Debit", "DebitCard", "DebitCard", "DepletableAssets", "Deposit", "Depreciation", "DevelopmentCosts", "DirectDepositPayable", "DiscountsRefundsGiven", "Discover", "Discover", "DividendIncome", "Draft", "DuesSubscriptions", "ECheck", "EFPLiabilityCheck", "EFTBillPayment", "EFTRefund", "Employee", "Employee", "Employee", "EmployeeCashAdvances", "Entertainment", "EntertainmentMeals", "EquipmentRental", "EquipmentRentalCos", "Equity", "Equity", "Estimate", "Expense", "Expense", "Fail", "FederalIncomeTaxPayable", "Fixed Asset", "Fixed Asset", "FurnitureAndFixtures", "GiftCard", "GiftCard", "Goodwill", "Group", "HasBeenBilled", "InProgress", "Income", "Insurance", "InsurancePayable", "IntangibleAssets", "InterestEarned", "InterestPaid", "Inventory", "Inventory", "InventoryAdjustment", "Investment_MortgageRealEstateLoans", "Investment_Other", "Investment_TaxExemptSecurities", "Investment_USGovernmentObligations", "Invoice", "ItemReceipt", "JournalEntry", "Land", "LeaseBuyout", "LeaseholdImprovements", "LegalProfessionalFees", "Length", "Liability", "LiabilityAdjustment", "Licenses", "LineOfCredit", "LoanPayable", "LoansToOfficers", "LoansToOthers", "LoansToStockholders", "Long Term Liability", "MachineryAndEquipment", "MasterCard", "MasterCard", "MoneyMarket", "Monthly", "Non-Posting", "NonProfitIncome", "None", "NotActive", "NotAvailable", "NotAwarded", "NotBillable", "NotBillable", "NotesPayable", "OfficeGeneralAdministrativeExpenses", "OpeningBalanceEquity", "OrganizationalCosts", "Other", "Other", "Other", "Other Asset", "Other Charge", "Other Current Asset", "Other Current Liability", "Other Expense", "Other Income", "OtherCostsOfServiceCos", "OtherCreditCard", "OtherCreditCard", "OtherCurrentAssets", "OtherCurrentLiabilities", "OtherFixedAssets", "OtherInvestmentIncome", "OtherLongTermAssets", "OtherLongTermLiabilities", "OtherMiscellaneousExpense", "OtherMiscellaneousIncome", "OtherMiscellaneousServiceCost", "OtherPrimaryIncome", "Overdue", "OwnersEquity", "Paid", "PaidInCapitalOrSurplus", "PartnerContributions", "PartnerDistributions", "PartnersEquity", "Pass", "Payable", "Paycheck", "Payment", "PayrollClearing", "PayrollExpenses", "PayrollLiabilityCheck", "PayrollTaxPayable", "PenaltiesSettlements", "Pending", "Pending", "Pending", "PreferredStock", "PrepaidExpenses", "PrepaidExpensesPayable", "PriorPayment", "Product", "PromotionalMeals", "PurchaseOrder", "Quarterly", "ReceivePayment", "Refund", "RefundCheck", "Rejected", "RentOrLeaseOfBuildings", "RentsHeldInTrust", "RentsInTrustLiability", "RepairMaintenance", "Retainage", "RetainedEarnings", "Revenue", "SalesOfProductIncome", "SalesOrder", "SalesReceipt", "SalesTaxPayable", "SalesTaxPaymentCheck", "Savings", "SecurityDeposits", "Service", "ServiceFeeIncome", "ShareholderNotesPayable", "ShippingFreightDelivery", "ShippingFreightDeliveryCos", "Standard", "StateLocalIncomeTaxPayable", "Subtotal", "SuppliesMaterials", "SuppliesMaterialsCogs", "TaxExemptInterest", "TaxesPaid", "Time", "TimeActivity", "Transfer", "Trash", "Travel", "TravelMeals", "TreasuryStock", "TrustAccounts", "TrustAccountsLiabilities", "UnPaid", "UndepositedFunds", "Utilities", "Vehicles", "Vendor", "Vendor", "Vendor", "VendorCredit", "Visa", "Visa", "VoiceAuthorization", "Volume", "Weight", "YTDAdjustment"]
6
+
7
+ AR_REFUND_CREDIT_CARD = 'ARRefundCreditCard'
8
+ ACCEPTED = 'Accepted'
9
+ ACCOUNTS_PAYABLE = 'AccountsPayable'
10
+ ACCOUNTS_RECEIVABLE = 'AccountsReceivable'
11
+ ACCUMULATED_ADJUSTMENT = 'AccumulatedAdjustment'
12
+ ACCUMULATED_AMORTIZATION = 'AccumulatedAmortization'
13
+ ACCUMULATED_AMORTIZATION_OF_OTHER_ASSETS = 'AccumulatedAmortizationOfOtherAssets'
14
+ ACCUMULATED_DEPLETION = 'AccumulatedDepletion'
15
+ ACCUMULATED_DEPRECIATION = 'AccumulatedDepreciation'
16
+ ACTIVE = 'Active'
17
+ ADVERTISING_PROMOTIONAL = 'AdvertisingPromotional'
18
+ ALLOWANCE_FOR_BAD_DEBTS = 'AllowanceForBadDebts'
19
+ AM_EX = 'AmEx'
20
+ AMORTIZATION = 'Amortization'
21
+ ANNUALLY = 'Annually'
22
+ AREA = 'Area'
23
+ ASSEMBLY = 'Assembly'
24
+ ASSET = 'Asset'
25
+ AUTHORIZATION = 'Authorization'
26
+ AUTO = 'Auto'
27
+ AWARDED = 'Awarded'
28
+ BAD_DEBTS = 'BadDebts'
29
+ BANK = 'Bank'
30
+ BANK_CHARGES = 'BankCharges'
31
+ BILL = 'Bill'
32
+ BILL_PAYMENT = 'BillPayment'
33
+ BILLABLE = 'Billable'
34
+ BILLABLE_HAS_BEEN_BILLED = 'BillableHasBeenBilled'
35
+ BUILD_ASSEMBLY = 'BuildAssembly'
36
+ BUILDINGS = 'Buildings'
37
+ CAPTURE = 'Capture'
38
+ CARD_NOT_PRESENT = 'CardNotPresent'
39
+ CARD_PRESENT = 'CardPresent'
40
+ CARRY_OVER = 'CarryOver'
41
+ CASH = 'Cash'
42
+ CASH_ON_HAND = 'CashOnHand'
43
+ CASH_PURCHASE = 'CashPurchase'
44
+ CHARGE = 'Charge'
45
+ CHARITABLE_CONTRIBUTIONS = 'CharitableContributions'
46
+ CHECK = 'Check'
47
+ CHECKING = 'Checking'
48
+ CLOSED = 'Closed'
49
+ COMMON_STOCK = 'CommonStock'
50
+ COST_OF_GOODS_SOLD = 'CostOfGoodsSold'
51
+ COST_OF_LABOR = 'CostOfLabor'
52
+ COST_OF_LABOR_COS = 'CostOfLaborCos'
53
+ COUNT = 'Count'
54
+ CREDIT = 'Credit'
55
+ CREDIT_CARD = 'CreditCard'
56
+ CREDIT_CARD_CHARGE = 'CreditCardCharge'
57
+ CREDIT_CARD_CREDIT = 'CreditCardCredit'
58
+ CREDIT_MEMO = 'CreditMemo'
59
+ CUSTOMER = 'Customer'
60
+ DATE_DRIVEN = 'DateDriven'
61
+ DEBIT = 'Debit'
62
+ DEBIT_CARD = 'DebitCard'
63
+ DEPLETABLE_ASSETS = 'DepletableAssets'
64
+ DEPOSIT = 'Deposit'
65
+ DEPRECIATION = 'Depreciation'
66
+ DEVELOPMENT_COSTS = 'DevelopmentCosts'
67
+ DIRECT_DEPOSIT_PAYABLE = 'DirectDepositPayable'
68
+ DISCOUNTS_REFUNDS_GIVEN = 'DiscountsRefundsGiven'
69
+ DISCOVER = 'Discover'
70
+ DIVIDEND_INCOME = 'DividendIncome'
71
+ DRAFT = 'Draft'
72
+ DUES_SUBSCRIPTIONS = 'DuesSubscriptions'
73
+ E_CHECK = 'ECheck'
74
+ EFP_LIABILITY_CHECK = 'EFPLiabilityCheck'
75
+ EFT_BILL_PAYMENT = 'EFTBillPayment'
76
+ EFT_REFUND = 'EFTRefund'
77
+ EMPLOYEE = 'Employee'
78
+ EMPLOYEE_CASH_ADVANCES = 'EmployeeCashAdvances'
79
+ ENTERTAINMENT = 'Entertainment'
80
+ ENTERTAINMENT_MEALS = 'EntertainmentMeals'
81
+ EQUIPMENT_RENTAL = 'EquipmentRental'
82
+ EQUIPMENT_RENTAL_COS = 'EquipmentRentalCos'
83
+ EQUITY = 'Equity'
84
+ ESTIMATE = 'Estimate'
85
+ EXPENSE = 'Expense'
86
+ FAIL = 'Fail'
87
+ FEDERAL_INCOME_TAX_PAYABLE = 'FederalIncomeTaxPayable'
88
+ FIXED_ASSET = 'FixedAsset'
89
+ FURNITURE_AND_FIXTURES = 'FurnitureAndFixtures'
90
+ GIFT_CARD = 'GiftCard'
91
+ GOODWILL = 'Goodwill'
92
+ GROUP = 'Group'
93
+ HAS_BEEN_BILLED = 'HasBeenBilled'
94
+ IN_PROGRESS = 'InProgress'
95
+ INCOME = 'Income'
96
+ INSURANCE = 'Insurance'
97
+ INSURANCE_PAYABLE = 'InsurancePayable'
98
+ INTANGIBLE_ASSETS = 'IntangibleAssets'
99
+ INTEREST_EARNED = 'InterestEarned'
100
+ INTEREST_PAID = 'InterestPaid'
101
+ INVENTORY = 'Inventory'
102
+ INVENTORY_ADJUSTMENT = 'InventoryAdjustment'
103
+ INVESTMENT_MORTGAGE_REAL_ESTATE_LOANS = 'Investment_MortgageRealEstateLoans'
104
+ INVESTMENT_OTHER = 'Investment_Other'
105
+ INVESTMENT_TAX_EXEMPT_SECURITIES = 'Investment_TaxExemptSecurities'
106
+ INVESTMENT_US_GOVERNMENT_OBLIGATIONS = 'Investment_USGovernmentObligations'
107
+ INVOICE = 'Invoice'
108
+ ITEM_RECEIPT = 'ItemReceipt'
109
+ JOURNAL_ENTRY = 'JournalEntry'
110
+ LAND = 'Land'
111
+ LEASE_BUYOUT = 'LeaseBuyout'
112
+ LEASEHOLD_IMPROVEMENTS = 'LeaseholdImprovements'
113
+ LEGAL_PROFESSIONAL_FEES = 'LegalProfessionalFees'
114
+ LENGTH = 'Length'
115
+ LIABILITY = 'Liability'
116
+ LIABILITY_ADJUSTMENT = 'LiabilityAdjustment'
117
+ LICENSES = 'Licenses'
118
+ LINE_OF_CREDIT = 'LineOfCredit'
119
+ LOAN_PAYABLE = 'LoanPayable'
120
+ LOANS_TO_OFFICERS = 'LoansToOfficers'
121
+ LOANS_TO_OTHERS = 'LoansToOthers'
122
+ LOANS_TO_STOCKHOLDERS = 'LoansToStockholders'
123
+ LONG_TERM_LIABILITY = 'LongTermLiability'
124
+ MACHINERY_AND_EQUIPMENT = 'MachineryAndEquipment'
125
+ MASTER_CARD = 'MasterCard'
126
+ MONEY_MARKET = 'MoneyMarket'
127
+ MONTHLY = 'Monthly'
128
+ NON_POSTING = 'Non-Posting'
129
+ NON_PROFIT_INCOME = 'NonProfitIncome'
130
+ NONE = 'None'
131
+ NOT_ACTIVE = 'NotActive'
132
+ NOT_AVAILABLE = 'NotAvailable'
133
+ NOT_AWARDED = 'NotAwarded'
134
+ NOT_BILLABLE = 'NotBillable'
135
+ NOTES_PAYABLE = 'NotesPayable'
136
+ OFFICE_GENERAL_ADMINISTRATIVE_EXPENSES = 'OfficeGeneralAdministrativeExpenses'
137
+ OPENING_BALANCE_EQUITY = 'OpeningBalanceEquity'
138
+ ORGANIZATIONAL_COSTS = 'OrganizationalCosts'
139
+ OTHER_EXPENSE = 'OtherExpense'
140
+ OTHER_INCOME = 'OtherIncome'
141
+ OTHER_COSTS_OF_SERVICE_COS = 'OtherCostsOfServiceCos'
142
+ OTHER_CREDIT_CARD = 'OtherCreditCard'
143
+ OTHER_CURRENT_ASSETS = 'OtherCurrentAssets'
144
+ OTHER_CURRENT_LIABILITIES = 'OtherCurrentLiabilities'
145
+ OTHER_FIXED_ASSETS = 'OtherFixedAssets'
146
+ OTHER_INVESTMENT_INCOME = 'OtherInvestmentIncome'
147
+ OTHER_LONG_TERM_ASSETS = 'OtherLongTermAssets'
148
+ OTHER_LONG_TERM_LIABILITIES = 'OtherLongTermLiabilities'
149
+ OTHER_MISCELLANEOUS_EXPENSE = 'OtherMiscellaneousExpense'
150
+ OTHER_MISCELLANEOUS_INCOME = 'OtherMiscellaneousIncome'
151
+ OTHER_MISCELLANEOUS_SERVICE_COST = 'OtherMiscellaneousServiceCost'
152
+ OTHER_PRIMARY_INCOME = 'OtherPrimaryIncome'
153
+ OVERDUE = 'Overdue'
154
+ OWNERS_EQUITY = 'OwnersEquity'
155
+ PAID = 'Paid'
156
+ PAID_IN_CAPITAL_OR_SURPLUS = 'PaidInCapitalOrSurplus'
157
+ PARTNER_CONTRIBUTIONS = 'PartnerContributions'
158
+ PARTNER_DISTRIBUTIONS = 'PartnerDistributions'
159
+ PARTNERS_EQUITY = 'PartnersEquity'
160
+ PASS = 'Pass'
161
+ PAYABLE = 'Payable'
162
+ PAYCHECK = 'Paycheck'
163
+ PAYMENT = 'Payment'
164
+ PAYROLL_CLEARING = 'PayrollClearing'
165
+ PAYROLL_EXPENSES = 'PayrollExpenses'
166
+ PAYROLL_LIABILITY_CHECK = 'PayrollLiabilityCheck'
167
+ PAYROLL_TAX_PAYABLE = 'PayrollTaxPayable'
168
+ PENALTIES_SETTLEMENTS = 'PenaltiesSettlements'
169
+ PENDING = 'Pending'
170
+ PREFERRED_STOCK = 'PreferredStock'
171
+ PREPAID_EXPENSES = 'PrepaidExpenses'
172
+ PREPAID_EXPENSES_PAYABLE = 'PrepaidExpensesPayable'
173
+ PRIOR_PAYMENT = 'PriorPayment'
174
+ PRODUCT = 'Product'
175
+ PROMOTIONAL_MEALS = 'PromotionalMeals'
176
+ PURCHASE_ORDER = 'PurchaseOrder'
177
+ QUARTERLY = 'Quarterly'
178
+ RECEIVE_PAYMENT = 'ReceivePayment'
179
+ REFUND = 'Refund'
180
+ REFUND_CHECK = 'RefundCheck'
181
+ REJECTED = 'Rejected'
182
+ RENT_OR_LEASE_OF_BUILDINGS = 'RentOrLeaseOfBuildings'
183
+ RENTS_HELD_IN_TRUST = 'RentsHeldInTrust'
184
+ RENTS_IN_TRUST_LIABILITY = 'RentsInTrustLiability'
185
+ REPAIR_MAINTENANCE = 'RepairMaintenance'
186
+ RETAINAGE = 'Retainage'
187
+ RETAINED_EARNINGS = 'RetainedEarnings'
188
+ REVENUE = 'Revenue'
189
+ SALES_OF_PRODUCT_INCOME = 'SalesOfProductIncome'
190
+ SALES_ORDER = 'SalesOrder'
191
+ SALES_RECEIPT = 'SalesReceipt'
192
+ SALES_TAX_PAYABLE = 'SalesTaxPayable'
193
+ SALES_TAX_PAYMENT_CHECK = 'SalesTaxPaymentCheck'
194
+ SAVINGS = 'Savings'
195
+ SECURITY_DEPOSITS = 'SecurityDeposits'
196
+ SERVICE = 'Service'
197
+ SERVICE_FEE_INCOME = 'ServiceFeeIncome'
198
+ SHAREHOLDER_NOTES_PAYABLE = 'ShareholderNotesPayable'
199
+ SHIPPING_FREIGHT_DELIVERY = 'ShippingFreightDelivery'
200
+ SHIPPING_FREIGHT_DELIVERY_COS = 'ShippingFreightDeliveryCos'
201
+ STANDARD = 'Standard'
202
+ STATE_LOCAL_INCOME_TAX_PAYABLE = 'StateLocalIncomeTaxPayable'
203
+ SUBTOTAL = 'Subtotal'
204
+ SUPPLIES_MATERIALS = 'SuppliesMaterials'
205
+ SUPPLIES_MATERIALS_COGS = 'SuppliesMaterialsCogs'
206
+ TAX_EXEMPT_INTEREST = 'TaxExemptInterest'
207
+ TAXES_PAID = 'TaxesPaid'
208
+ TIME = 'Time'
209
+ TIME_ACTIVITY = 'TimeActivity'
210
+ TRANSFER = 'Transfer'
211
+ TRASH = 'Trash'
212
+ TRAVEL = 'Travel'
213
+ TRAVEL_MEALS = 'TravelMeals'
214
+ TREASURY_STOCK = 'TreasuryStock'
215
+ TRUST_ACCOUNTS = 'TrustAccounts'
216
+ TRUST_ACCOUNTS_LIABILITIES = 'TrustAccountsLiabilities'
217
+ UN_PAID = 'UnPaid'
218
+ UNDEPOSITED_FUNDS = 'UndepositedFunds'
219
+ UTILITIES = 'Utilities'
220
+ VEHICLES = 'Vehicles'
221
+ VENDOR = 'Vendor'
222
+ VENDOR_CREDIT = 'VendorCredit'
223
+ VISA = 'Visa'
224
+ VOICE_AUTHORIZATION = 'VoiceAuthorization'
225
+ VOLUME = 'Volume'
226
+ WEIGHT = 'Weight'
227
+ YTD_ADJUSTMENT = 'YTDAdjustment'
228
+
229
+
230
+ end
231
+ end
232
+ end
233
+ end
@@ -0,0 +1,19 @@
1
+ require "quickeebooks"
2
+
3
+ module Quickeebooks
4
+ module Windows
5
+ module Model
6
+ class AccountReference < Quickeebooks::Windows::Model::IntuitType
7
+ xml_accessor :account_id, :from => 'AccountId'
8
+ xml_accessor :account_name, :from => 'AccountName'
9
+ xml_accessor :account_type, :from => 'AccountType'
10
+
11
+ def initialize(account_id = nil)
12
+ unless account_id.nil?
13
+ self.account_id = account_id
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,36 @@
1
+ require 'quickeebooks'
2
+
3
+ module Quickeebooks
4
+ module Windows
5
+ module Model
6
+ class Address < Quickeebooks::Windows::Model::IntuitType
7
+ xml_accessor :id, :from => 'Id'
8
+ xml_accessor :line1, :from => 'Line1'
9
+ xml_accessor :line2, :from => 'Line2'
10
+ xml_accessor :line3, :from => 'Line3'
11
+ xml_accessor :line4, :from => 'Line4'
12
+ xml_accessor :line5, :from => 'Line5'
13
+ xml_accessor :city, :from => 'City'
14
+ xml_accessor :country, :from => 'Country'
15
+ xml_accessor :country_sub_division_code, :from => 'CountrySubDivisionCode'
16
+ xml_accessor :postal_code, :from => 'PostalCode'
17
+ xml_accessor :postal_code_suffix, :from => 'PostalCodeSuffix'
18
+ xml_accessor :tag, :from => 'Tag'
19
+ xml_accessor :default, :from => 'Default'
20
+
21
+ def zip
22
+ postal_code
23
+ end
24
+
25
+ def to_xml_ns
26
+ to_xml
27
+ end
28
+
29
+ def default?
30
+ default == "true"
31
+ end
32
+
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,13 @@
1
+ require "quickeebooks"
2
+
3
+ module Quickeebooks
4
+ module Windows
5
+ module Model
6
+ class CustomField < Quickeebooks::Windows::Model::IntuitType
7
+ xml_accessor :definition_id, :from => 'DefinitionId'
8
+ xml_accessor :value, :from => 'Value'
9
+ xml_accessor :name, :from => 'Name'
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,109 @@
1
+ require "quickeebooks"
2
+ require "quickeebooks/windows/model/meta_data"
3
+ require "quickeebooks/windows/model/address"
4
+ require "quickeebooks/windows/model/phone"
5
+ require "quickeebooks/windows/model/web_site"
6
+ require "quickeebooks/windows/model/email"
7
+ require "quickeebooks/windows/model/note"
8
+ require "quickeebooks/windows/model/custom_field"
9
+ require "quickeebooks/windows/model/open_balance"
10
+
11
+ module Quickeebooks
12
+ module Windows
13
+ module Model
14
+ class Customer < Quickeebooks::Windows::Model::IntuitType
15
+ include ActiveModel::Validations
16
+
17
+ DEFAULT_TYPE_OF = 'Person'
18
+ XML_COLLECTION_NODE = 'Customers'
19
+ XML_NODE = 'Customer'
20
+
21
+ xml_convention :camelcase
22
+ xml_accessor :id, :from => 'Id'
23
+ xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
24
+ xml_accessor :synchronized, :from => 'Synchronized'
25
+ xml_accessor :meta_data, :from => 'MetaData', :as => Quickeebooks::Windows::Model::MetaData
26
+ xml_accessor :custom_fields, :from => 'CustomField', :as => [Quickeebooks::Windows::Model::CustomField]
27
+ xml_accessor :external_key, :from => 'ExternalKey'
28
+ xml_accessor :draft
29
+ xml_accessor :object_state, :from => 'ObjectState'
30
+ xml_accessor :party_reference_id, :from => 'PartyReferenceId'
31
+ xml_accessor :type_of, :from => 'TypeOf'
32
+ xml_accessor :name, :from => 'Name'
33
+ xml_accessor :addresses, :from => 'Address', :as => [Quickeebooks::Windows::Model::Address]
34
+ xml_accessor :email, :from => 'Email', :as => Quickeebooks::Windows::Model::Email
35
+ xml_accessor :phones, :from => 'Phone', :as => [Quickeebooks::Windows::Model::Phone]
36
+ xml_accessor :web_site, :from => 'WebSite', :as => Quickeebooks::Windows::Model::WebSite
37
+ xml_accessor :title, :from => 'Title'
38
+ xml_accessor :given_name, :from => 'GivenName'
39
+ xml_accessor :middle_name, :from => 'MiddleName'
40
+ xml_accessor :family_name, :from => 'FamilyName'
41
+ xml_accessor :suffix, :from => 'Suffix'
42
+ xml_accessor :gender, :from => 'Gender'
43
+ xml_accessor :dba_name, :from => 'DBAName'
44
+ xml_accessor :tax_identifier, :from => 'TaxIdentifier'
45
+ xml_accessor :notes, :from => 'Note', :as => [Quickeebooks::Windows::Model::Note]
46
+ xml_accessor :active, :from => 'Active'
47
+ xml_accessor :show_as, :from => 'ShowAs'
48
+ xml_accessor :customer_type_id, :from => 'CustomerTypeId'
49
+ xml_accessor :customer_type_name, :from => 'CustomerTypeName'
50
+ xml_accessor :sales_term_id, :from => 'SalesTermId'
51
+ xml_accessor :sales_term_name, :from => 'SalesTermName'
52
+ xml_accessor :sales_rep_id, :from => 'SalesRepId'
53
+ xml_accessor :sales_rep_name, :from => 'SalesRepName'
54
+ xml_accessor :sales_tax_code_id, :from => 'SalesTaxCodeId'
55
+ xml_accessor :sales_tax_code_name, :from => 'SalesTaxCodeName'
56
+ xml_accessor :tax_id, :from => 'TaxId'
57
+ xml_accessor :tax_name, :from => 'TaxName'
58
+ xml_accessor :tax_group_id, :from => 'TaxGroupId'
59
+ xml_accessor :tax_group_name, :from => 'TaxGroupName'
60
+ xml_accessor :paymethod_method_id, :from => 'PaymentMethodId'
61
+ xml_accessor :paymethod_method_name, :from => 'PaymentMethodName'
62
+ xml_accessor :price_level_id, :from => 'PriceLevelId'
63
+ xml_accessor :price_level_name, :from => 'PriceLevelName'
64
+ xml_accessor :open_balance_date, :from => 'OpenBalanceDate', :as => Time
65
+ xml_accessor :open_balance, :from => 'OpenBalance', :as => Quickeebooks::Windows::Model::Price
66
+ xml_accessor :open_balance_with_jobs, :from => 'OpenBalanceWithJobs', :as => Quickeebooks::Windows::Model::Price
67
+ xml_accessor :credit_limit, :from => 'CreditLimit', :as => Quickeebooks::Windows::Model::Price
68
+ xml_accessor :acct_num, :from => 'AcctNum'
69
+ xml_accessor :over_due_balance, :from => 'OverDueBalance', :as => Quickeebooks::Windows::Model::Price
70
+ xml_accessor :total_expense, :from => 'TotalExpense', :as => Quickeebooks::Windows::Model::Price
71
+
72
+ validates_length_of :name, :minimum => 1
73
+ validate :has_required_attributes
74
+
75
+ def active?
76
+ active == 'true'
77
+ end
78
+
79
+ def has_required_attributes
80
+ if name.is_a?(String) && name.index(':') != nil
81
+ errors.add(:name, "Attribute :name cannot contain a colon")
82
+ end
83
+ end
84
+
85
+ def valid_for_update?
86
+ if sync_token.nil?
87
+ errors.add(:sync_token, "Missing required attribute SyncToken for update")
88
+ end
89
+ errors.empty?
90
+ end
91
+
92
+ def to_xml_ns(options = {})
93
+ to_xml
94
+ end
95
+
96
+ def email_address=(email_address)
97
+ self.email = Quickeebooks::Windows::Model::Email.new(email_address)
98
+ end
99
+
100
+ # To delete an account Intuit requires we provide Id and SyncToken fields
101
+ def valid_for_deletion?
102
+ return false if(id.nil? || sync_token.nil?)
103
+ id.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0
104
+ end
105
+
106
+ end
107
+ end
108
+ end
109
+ end