1- from base import Ref , QuickbooksManagedObject
1+ from base import Ref , QuickbooksManagedObject , QuickbooksTransactionEntity
22
33
4- class Item (QuickbooksManagedObject ):
4+ class Item (QuickbooksManagedObject , QuickbooksTransactionEntity ):
55 """
66 QBO definition: An item is a thing that your company buys, sells, or re-sells, such as products and services.
77 An item is shown as a line on an invoice or other sales form. The Item.Type attribute, which specifies how
@@ -18,7 +18,10 @@ class Item(QuickbooksManagedObject):
1818 class_dict = {
1919 "AssetAccountRef" : Ref ,
2020 "ExpenseAccountRef" : Ref ,
21- "IncomeAccountRef" : Ref
21+ "IncomeAccountRef" : Ref ,
22+ "ParentRef" : Ref ,
23+ "SalesTaxCodeRef" : Ref ,
24+ "PurchaseTaxCodeRef" : Ref ,
2225 }
2326
2427 qbo_object_name = "Item"
@@ -28,21 +31,41 @@ def __init__(self):
2831 self .Name = ""
2932 self .Description = ""
3033 self .Active = True
34+ self .SubItem = False
3135 self .FullyQualifiedName = ""
32- self .Taxable = ""
36+ self .Taxable = False
37+ self .SalesTaxInclusive = False
3338 self .UnitPrice = ""
34- self .Type = ""
39+ self .Type = "Inventory"
40+ self .ItemCategoryType = "Product"
41+ self .Level = 0
3542 self .PurchaseDesc = ""
43+ self .PurchaseTaxInclusive = False
3644 self .PurchaseCost = 0
37- self .TrackQtyOnHand = True
45+ self .TrackQtyOnHand = False
3846 self .QtyOnHand = 0
3947 self .InvStartDate = ""
4048
49+ self .AbatementRate = ""
50+ self .ReverseChargeRate = ""
51+ self .ServiceType = ""
52+
4153 self .AssetAccountRef = None
4254 self .ExpenseAccountRef = None
4355 self .IncomeAccountRef = None
56+ self .SalesTaxCodeRef = None
57+ self .ParentRef = None
58+ self .PurchaseTaxCodeRef = None
4459
4560 def __unicode__ (self ):
4661 return self .Name
4762
63+ def to_ref (self ):
64+ ref = Ref ()
65+
66+ ref .name = self .Name
67+ ref .type = self .qbo_object_name
68+ ref .value = self .Id
69+
70+ return ref
4871
0 commit comments