LineItemGroups Class
Properties Methods Events Config Settings Errors
Generates a group aggregate for use in another class's Update request.
Syntax
class inqb.LineItemGroups
Remarks
There is not exposed a way to directly edit the contents of a line item group when submitting an Update request with a class from this package. You can change the quantity, but you cannot change the line items contained inside the group line. The LineItemGroups class is used to parse a line item group aggregate. You may then make changes to the individual line items, and then call the get_group_update_aggregate to return an xml aggregate containing your changes. This is then set to the Aggregate property of the line you wish to modify in your Update.
For instance, the following code changes the BillableStatus of all line items and line item groups in the Bill retrieved from QuickBooks.
Bill.Get("123456");
for (int i = 0; i < Bill1.LineItems.Count; i++) {
if (!Bill.LineItems[i].GroupName.Equals("")) { // this is a group line
LineItemGroups.GroupType = gtBill;
LineItemGroups.ParseAggregate(Bill.LineItems[0].Aggregate);
for (int j = 0; j < LineItemGroups.LineItems.Count) {
LineItemGroups.LineItems[j].BillableStatus = bsHasBeenBilled;
}
LineItemGroups.QBXMLVersion = Bill.QBXMLVersion; // so that the proper fields are included in the update aggregate.
Bill1.LineItems[i].Aggregate = LineItemGroups.GetGroupUpdateAggregate();
} else { // regular line item
Bill.LineItems[i].BillableStatus = bsHasBeenBilled;
}
}
Bill.Update();
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
description | A string description of the item group specified by GroupName or GroupId . |
group_id | Reference to a group of line items. |
group_name | Reference to a group of line items. |
group_type | The type of line item group aggregate to create. |
line_id | Identification number of the transaction line group, used for Updates. |
item_count | The number of records in the Item arrays. |
item_aggregate | Contains an XML aggregate of the line item. |
item_amount | Line item property: the total amount of this item. |
item_billable_status | Line item property: Billing status of this item. |
item_class_id | Line item property: Reference to the class of the item. |
item_class_name | Line item property: Reference to the class of the item. |
item_cost | Line item property: Unit cost for item. |
item_customer_id | Line item property: A reference to customer for whom the item was ordered. |
item_customer_name | Line item property: A reference to customer for whom the item was ordered. |
item_description | Line item property: Description of item. |
item_id | Line item property: Reference to the kind of item. |
item_name | Line item property: Reference to the kind of item. |
item_line_id | Identification number of the transaction line, used for Updates. |
item_manually_closed | Indicates if the line item has been manually closed. |
item_other1 | Standard QuickBooks Custom Field available for transaction line items. |
item_other2 | Standard QuickBooks Custom Field available for transaction line items. |
item_override_account_id | An account which will override the default account for the line item. |
item_override_account_name | An account which will override the default account for the line item. |
item_price_level_id | Line Item property: Used to specify custom pricing for specific customers. |
item_price_level_name | Line Item property: Specify custom pricing for specific customers. |
item_quantity | Line item property: Quantity of item or item group. |
item_rate | Unit rate of item. |
item_rate_percent | Line item property: A markup or discount percentage. |
item_service_date | Line item property: Date of service. |
item_tax_code_id | Line item property: Sales tax information for this item. |
item_tax_code_name | Line item property: Sales tax information for this item. |
item_unit_of_measure | Unit of measure describing the Quantity . |
print_items_in_group | Indicates whether line items will be shown on printed forms. |
qbxml_version | The version of QBXML used to generate the update aggregate. |
quantity | The quantity of this line item group. |
total_amount | The total amount of this group of line items. |
unit_of_measure | Unit of measure describing the Quantity . |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
config | Sets or retrieves a configuration setting. |
get_group_update_aggregate | Generates a group aggregate for use in another class's Update request. |
parse_aggregate | Parses the aggregate returned from another class's ItemAggregate property. |
reset | Resets this class to its default state. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
on_error | Information about errors during data delivery. |
Config Settings
The following is a list of config settings for the class with short descriptions. Click on the links for further details.
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
MaskSensitive | Whether sensitive data is masked in log messages. |
ProcessIdleEvents | Whether the class uses its internal event loop to process events when the main thread is idle. |
SelectWaitMillis | The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process. |
UseInternalSecurityAPI | Tells the class whether or not to use the system security libraries or an internal implementation. |
description Property
A string description of the item group specified by GroupName or GroupId .
Syntax
def get_description() -> str: ...
description = property(get_description, None)
Default Value
""
Remarks
This property will contain the description of the group as returned by QuickBooks.
This property is read-only.
group_id Property
Reference to a group of line items.
Syntax
def get_group_id() -> str: ... def set_group_id(value: str) -> None: ...
group_id = property(get_group_id, set_group_id)
Default Value
""
Remarks
Line item groups represent sets of items that are grouped together.
A line item group is a predefined shortcut within QuickBooks. For example, a "Cheeseburger Meal" might consist of a cheeseburger, an order of french fries, and a soft drink. To include an item group in a transaction one should simply set the value of ItemGroup, and optionally, of ItemQuantity. QuickBooks will automatically expand the group into its constituent items. This will send an ItemGroup instead of a regular Item on for this index.
When an ItemGroup is returned from QuickBooks it contains xml aggregates of all of the items in the group you specified. You may access the group's regular properties (total amount, quantity, and description), but the line items returned are not normally accessible. However, you may parse the returned line items by passing the contents of the Aggregate property to the LineItemGroups class. You may use the LineItemGroups class to view or change the contents of the line items, and then pass the xml aggregate generated by the class back to the Aggregate field of the original\ object to use in an Update transaction.
group_name Property
Reference to a group of line items.
Syntax
def get_group_name() -> str: ... def set_group_name(value: str) -> None: ...
group_name = property(get_group_name, set_group_name)
Default Value
""
Remarks
Line item groups represent sets of items that are grouped together.
A line item group is a predefined shortcut within QuickBooks. For example, a "Cheeseburger Meal" might consist of a cheeseburger, an order of french fries, and a soft drink. To include an item group in a transaction one should simply set the value of ItemGroup, and optionally, of ItemQuantity. QuickBooks will automatically expand the group into its constituent items. This will send an ItemGroup instead of a regular Item on for this index.
When an ItemGroup is returned from QuickBooks it contains xml aggregates of all of the items in the group you specified. You may access the group's regular properties (total amount, quantity, and description), but the line items returned are not normally accessible. However, you may parse the returned line items by passing the contents of the Aggregate property to the LineItemGroups class. You may use the LineItemGroups class to view or change the contents of the line items, and then pass the xml aggregate generated by the class back to the Aggregate field of the original\ object to use in an Update transaction.
group_type Property
The type of line item group aggregate to create.
Syntax
def get_group_type() -> int: ... def set_group_type(value: int) -> None: ...
group_type = property(get_group_type, set_group_type)
Default Value
0
Remarks
This property will be automatically filled after a call to parse_aggregate. The following values are permitted:
gtStandardGroup (0) | Used for the Bill, CCCharge, CCCredit, Check, VendorCredit, and ItemReceipt classs. |
gtCreditMemo (1) | Corresponds to the CreditMemo class. |
gtEstimate (2) | Corresponds to the Estimate class. |
gtInvoice (3) | Corresponds to the Invoice class. |
gtPurchaseOrder (4) | Corresponds to the PurchaseOrder class. |
gtSalesOrder (5) | Corresponds to the SalesOrder class. |
gtSalesReceipt (6) | Corresponds to the SalesReceipt class. |
line_id Property
Identification number of the transaction line group, used for Updates.
Syntax
def get_line_id() -> str: ... def set_line_id(value: str) -> None: ...
line_id = property(get_line_id, set_line_id)
Default Value
""
Remarks
If you need to add a new transaction line group in a transaction Update request, you can do so by setting the line_id to -1.
item_count Property
The number of records in the Item arrays.
Syntax
def get_item_count() -> int: ... def set_item_count(value: int) -> None: ...
item_count = property(get_item_count, set_item_count)
Default Value
0
Remarks
This property controls the size of the following arrays:
- item_aggregate
- item_amount
- item_billable_status
- item_class_id
- item_class_name
- item_cost
- item_customer_id
- item_customer_name
- item_description
- item_id
- item_line_id
- item_manually_closed
- item_name
- item_other1
- item_other2
- item_override_account_id
- item_override_account_name
- item_price_level_id
- item_price_level_name
- item_quantity
- item_rate
- item_rate_percent
- item_service_date
- item_tax_code_id
- item_tax_code_name
- item_unit_of_measure
item_aggregate Property
Contains an XML aggregate of the line item.
Syntax
def get_item_aggregate(item_index: int) -> str: ... def set_item_aggregate(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Contains an XML aggregate of the line item. If the line item has not been modified since receiving a response from QuickBooks, the exact LineRet aggregate that QuickBooks returned will be contained in this XML aggregate. However, if you have made changes to the this line item's properties the item_aggregate property will re-generate the line item XML with the new data.
If you set the other line item properties and then query the item_aggregate, a LineRet aggregate will be generated from the currently set properties.
You may set this property with raw xml. So long as you do not modify any other properties (forcing the line item to regenerate based on new changes), the xml will be sent as-is to the QuickBooks request processor. It is essential that you properly format the XML that you place in this property. When setting this property manually, the class will send exactly what you have set. You must ensure your xml is appropriate for the action you are attempting. For instance, if you are Adding an Invoice, you must ensure the outer tags are "InvoiceLineAdd". If Modifying an Invoice, the outer tags must be "InvoiceLineMod".
If you do not expressly set the item_aggregate field with your own custom XML, all of this will be taken care of you automatically by the class.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_amount Property
Line item property: the total amount of this item.
Syntax
def get_item_amount(item_index: int) -> str: ... def set_item_amount(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line item property: the total amount of this item.
This property represents the total amount of a transaction line. If item_rate, item_cost and/or item_quantity are specified the item_amount will be automatically computed by QuickBooks.
Whether item_rate or item_cost is used will depend on the transaction type. item_rate is available for CreditMemo, Estimate, Invoice, PurchaseOrder, SalesOrder, and SalesReceipt transactions while item_cost is available for Bill, CCCharge, CCCredit, Check, ItemReceipt, and VendorCredit transactions.
The amount should be formatted as a string in dollars.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_billable_status Property
Line item property: Billing status of this item.
Syntax
def get_item_billable_status(item_index: int) -> int: ... def set_item_billable_status(item_index: int, value: int) -> None: ...
Default Value
0
Remarks
Line item property: Billing status of this item.
The billing status of this line item. If the billing status is empty (that is, if no billing status appears in QuickBooks), then no item_billable_status value will be returned.
Values:
- bsEmpty (0)
- bsBillable (1)
- bsNotBillable (2)
- bsHasBeenBilled (3)
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_class_id Property
Line item property: Reference to the class of the item.
Syntax
def get_item_class_id(item_index: int) -> str: ... def set_item_class_id(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line item property: Reference to the class of the item.
A reference to the class of this item.
Id/Name Reference Properties
This property is used to reference an object that is already done within QuickBooks. This may be done with its Id (this property) or its full Name, for which a corresponding property is defined.
Using the Id is recommended when feasible, as the Id is guaranteed to never change once defined.
Setting the value of this property will set the corresponding Name property to an empty string.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_class_name Property
Line item property: Reference to the class of the item.
Syntax
def get_item_class_name(item_index: int) -> str: ... def set_item_class_name(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line item property: Reference to the class of the item.
Name/Id Reference Properties
This property is used to reference an object that is already done within QuickBooks. This may be done with its full Name (this property) or its Id, for which a corresponding property is defined. If Name is used, it must contain the full name of the object referred to, as generated by QuickBooks. For hierarchically defined objects, such as Customers, this includes the names of parent objects, and the full name can be determined by reading the FullName special field.
Setting the value of this property will set the corresponding Id property to an empty string.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_cost Property
Line item property: Unit cost for item.
Syntax
def get_item_cost(item_index: int) -> str: ... def set_item_cost(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line item property: Unit cost for item.
The unit cost for this item.
If item_amount is specified, then item_cost will be calculated automatically and should not be specified.
The amount should be formatted as a string in dollars.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_customer_id Property
Line item property: A reference to customer for whom the item was ordered.
Syntax
def get_item_customer_id(item_index: int) -> str: ... def set_item_customer_id(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line item property: A reference to customer for whom the item was ordered.
A reference to a Customer for whom this item was ordered.
If this property is set, the expense will be set as billable to the Customer referenced.
Id/Name Reference Properties
This property is used to reference an object that is already done within QuickBooks. This may be done with its Id (this property) or its full Name, for which a corresponding property is defined.
Using the Id is recommended when feasible, as the Id is guaranteed to never change once defined.
Setting the value of this property will set the corresponding Name property to an empty string.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_customer_name Property
Line item property: A reference to customer for whom the item was ordered.
Syntax
def get_item_customer_name(item_index: int) -> str: ... def set_item_customer_name(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line item property: A reference to customer for whom the item was ordered.
A reference to a Customer for whom this item was ordered.
If this property is set, the expense will be set as billable to the Customer referenced.
Name/Id Reference Properties
This property is used to reference an object that is already done within QuickBooks. This may be done with its full Name (this property) or its Id, for which a corresponding property is defined. If Name is used, it must contain the full name of the object referred to, as generated by QuickBooks. For hierarchically defined objects, such as Customers, this includes the names of parent objects, and the full name can be determined by reading the FullName special field.
Setting the value of this property will set the corresponding Id property to an empty string.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_description Property
Line item property: Description of item.
Syntax
def get_item_description(item_index: int) -> str: ... def set_item_description(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line item property: Description of item.
A string description of the Item specified by item_name or item_id.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_id Property
Line item property: Reference to the kind of item.
Syntax
def get_item_id(item_index: int) -> str: ... def set_item_id(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line item property: Reference to the kind of item.
Line items represent goods or services bought in a QuickBooks transaction.
Each line item is represented by a number of properties, each prefixed by Item (see the list of properties for individual classs for details). Properties such as item_quantity and item_description are always present; some properties are found in only certain types of transactions.
Item is a reference to a kind of item, predefined within QuickBooks. Generally items defined within QuickBooks have default values for item_description, etc., and if only Item is set when adding a record to QuickBooks, the other properties will be set automatically.
This class is used to create a single item. However, any InQB class may be set with an unlimited number of these items. For example:
Invoice.ItemCount = 3
LineItems.ItemName = "Wingnut"
LineItems.Quantity = 8
Invoice.ItemAggregate[0] = LineItems.GetAggregate()
LineItems.ItemName = "Shovel"
LineItems.Quantity = 1
Invoice.ItemAggregate[1] = LineItems.GetAggregate()
LineItems.ItemName = "Mower blade"
LineItems.Quantity = 1
Invoice.ItemAggregate[2] = LineItems.GetAggregate()
Items may also be grouped into ItemGroups, using the LineItemGroups class.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_name Property
Line item property: Reference to the kind of item.
Syntax
def get_item_name(item_index: int) -> str: ... def set_item_name(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line item property: Reference to the kind of item.
Line items represent goods or services bought in a QuickBooks transaction.
Each line item is represented by a number of properties, each prefixed by Item (see the list of properties for individual classs for details). Properties such as item_quantity and item_description are always present; some properties are found in only certain types of transactions.
Item is a reference to a kind of item, predefined within QuickBooks. Generally items defined within QuickBooks have default values for item_description, etc., and if only Item is set when adding a record to QuickBooks, the other properties will be set automatically.
This class is used to create a single item. However, any InQB class may be set with an unlimited number of these items. For example:
Invoice.ItemCount = 3
LineItems.ItemName = "Wingnut"
LineItems.Quantity = 8
Invoice.ItemAggregate[0] = LineItems.GetAggregate()
LineItems.ItemName = "Shovel"
LineItems.Quantity = 1
Invoice.ItemAggregate[1] = LineItems.GetAggregate()
LineItems.ItemName = "Mower blade"
LineItems.Quantity = 1
Invoice.ItemAggregate[2] = LineItems.GetAggregate()
Items may also be grouped into ItemGroups, using the LineItemGroups class.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_line_id Property
Identification number of the transaction line, used for Updates.
Syntax
def get_item_line_id(item_index: int) -> str: ... def set_item_line_id(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Identification number of the transaction line, used for Updates.
If you need to add a new transaction line in a transaction Update request, you can do so by setting the item_line_id to -1.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_manually_closed Property
Indicates if the line item has been manually closed.
Syntax
def get_item_manually_closed(item_index: int) -> int: ... def set_item_manually_closed(item_index: int, value: int) -> None: ...
Default Value
0
Remarks
Indicates if the line item has been manually closed.
If item_manually_closed is mcManuallyClosed, the purchase order line has been closed, even if this item has not been received or its sale canceled. If all the purchase order lines are marked as closed, the purchase order itself is marked as closed as well. You cannot change item_manually_closed to mcNotManuallyClosed after the purchase order line has been fully received. If set to mcNotSet the field is not sent in the request.
Only applicable to Update transactions.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_other1 Property
Standard QuickBooks Custom Field available for transaction line items.
Syntax
def get_item_other1(item_index: int) -> str: ... def set_item_other1(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Standard QuickBooks Custom Field available for transaction line items.
The item_other1 and item_other2 custom fields are available for immediate use: you don't need to enable these in the transaction template to be able to access them via SDK. (However, those item_other1 and item_other2 fields and their values are viewable and printable in QuickBooks only if the transaction template has these enabled!). QBXMLVersion 6.0 or higher is required to use this property.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_other2 Property
Standard QuickBooks Custom Field available for transaction line items.
Syntax
def get_item_other2(item_index: int) -> str: ... def set_item_other2(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Standard QuickBooks Custom Field available for transaction line items.
The item_other1 and item_other2 custom fields are available for immediate use: you don't need to enable these in the transaction template to be able to access them via SDK. (However, those item_other1 and item_other2 fields and their values are viewable and printable in QuickBooks only if the transaction template has these enabled!). QBXMLVersion 6.0 or higher is required to use this property.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_override_account_id Property
An account which will override the default account for the line item.
Syntax
def get_item_override_account_id(item_index: int) -> str: ... def set_item_override_account_id(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
An account which will override the default account for the line item. qbxml_version must be 2.0 or higher to use this configuration setting.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_override_account_name Property
An account which will override the default account for the line item.
Syntax
def get_item_override_account_name(item_index: int) -> str: ... def set_item_override_account_name(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
An account which will override the default account for the line item. qbxml_version must be 2.0 or higher to use this configuration setting.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_price_level_id Property
Line Item property: Used to specify custom pricing for specific customers.
Syntax
def get_item_price_level_id(item_index: int) -> str: ... def set_item_price_level_id(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line Item property: Used to specify custom pricing for specific customers.
Id for the PriceLevel selected for this transaction.
If item_price_level_id and/or item_price_level_name are specified, then item_amount will be calculated automatically and should not be specified.
Note that item_price_level_id and item_price_level_name, OR item_rate OR item_rate_percent may be specified. item_price_level_id and item_price_level_name are ONLY available for QBXMLVersions 4.0 and above.
You can use price levels to specify custom pricing for specific customers. Once you create a price level for a customer, QuickBooks will automatically use the custom price in new invoices, sales receipts, sales orders or credit memos for that customer. You can override this automatic feature, however, when you create the invoices, sales receipts, etc.)
The user can now specify a price level on line items in the following supported sales transactions: invoices, sales receipts, credit memos, and sales orders.
Notice that the response data for the affected sales transaction does not list the price level that was used. The response simply lists the item_rate, which was set using the price level.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_price_level_name Property
Line Item property: Specify custom pricing for specific customers.
Syntax
def get_item_price_level_name(item_index: int) -> str: ... def set_item_price_level_name(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line Item property: Specify custom pricing for specific customers.
Id for the PriceLevel selected for this transaction.
If item_price_level_id and/or item_price_level_name are specified, then item_amount will be calculated automatically and should not be specified.
Note that item_price_level_id and item_price_level_name, OR item_rate OR item_rate_percent may be specified. item_price_level_id and item_price_level_name are ONLY available for QBXMLVersions 4.0 and above.
You can use price levels to specify custom pricing for specific customers. Once you create a price level for a customer, QuickBooks will automatically use the custom price in new invoices, sales receipts, sales orders or credit memos for that customer. You can override this automatic feature, however, when you create the invoices, sales receipts, etc.)
The user can now specify a price level on line items in the following supported sales transactions: invoices, sales receipts, credit memos, and sales orders.
Notice that the response data for the affected sales transaction does not list the price level that was used. The response simply lists the item_rate, which was set using the price level.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_quantity Property
Line item property: Quantity of item or item group.
Syntax
def get_item_quantity(item_index: int) -> str: ... def set_item_quantity(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line item property: Quantity of item or item group.
The quantity of the Item specified in this line.
If item_quantity and only one of item_cost, item_rate, or item_amount are specified, QuickBooks will automatically calculate the other.
This property is a String type in order to allow setting fractional quantities. Setting this property with non-numeric data will cause an error. Correct usage of this property is shown below:
class.Quantity = "3.5"
Leave this property blank and no quantity will be sent to QuickBooks.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_rate Property
Unit rate of item.
Syntax
def get_item_rate(item_index: int) -> str: ... def set_item_rate(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Unit rate of item.
The unit rate charged for this item.
If item_amount is specified, then item_rate will be calculated automatically and should not be specified.
The amount should be formatted as a string in dollars.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_rate_percent Property
Line item property: A markup or discount percentage.
Syntax
def get_item_rate_percent(item_index: int) -> str: ... def set_item_rate_percent(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line item property: A markup or discount percentage.
If item_rate_percent is specified instead of item_rate, then this line item represents a percentage markup or discount, to be applied to the previous Item or Item group.
item_rate_percent should be formatted as a positive or negative integer; a positive value indicates a markup.
Only one of item_rate_percent and item_rate may be specified. If item_rate_percent is set, then item_rate will be set to its default.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_service_date Property
Line item property: Date of service.
Syntax
def get_item_service_date(item_index: int) -> str: ... def set_item_service_date(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line item property: Date of service.
For Items that represent a service, item_service_date refers to the date of service. item_service_date is only applicable for the CreditMemo, Invoice, PurchaseOrder, and SalesReceipt classs.
The standard formatting for dates is YYYY-MM-DD; i.e., September 2, 2002 is formatted as 2002-09-02. When getting the value of a date property, the date will always be in this format.
When setting the value of a date property, the formats MM-DD-YY, MM-DD-YYYY, MM/DD/YY, and MM/DD/YYYY are also acceptable. Dates in these formats will be automatically parsed and stored in YYYY-MM-DD format.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_tax_code_id Property
Line item property: Sales tax information for this item.
Syntax
def get_item_tax_code_id(item_index: int) -> str: ... def set_item_tax_code_id(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line item property: Sales tax information for this item.
This is a reference to a sales tax code predefined within QuickBooks.
By default, two standard TaxCodes exist: "TAX", or Taxable Sales, and "NON", or Non-Taxable Sales. The QuickBooks user may also define custom tax codes.
Id/Name Reference Properties
This property is used to reference an object that is already done within QuickBooks. This may be done with its Id (this property) or its full Name, for which a corresponding property is defined.
Using the Id is recommended when feasible, as the Id is guaranteed to never change once defined.
Setting the value of this property will set the corresponding Name property to an empty string.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_tax_code_name Property
Line item property: Sales tax information for this item.
Syntax
def get_item_tax_code_name(item_index: int) -> str: ... def set_item_tax_code_name(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Line item property: Sales tax information for this item.
This is a reference to a sales tax code predefined within QuickBooks.
By default, two standard TaxCodes exist: "TAX", or Taxable Sales, and "NON", or Non-Taxable Sales. The QuickBooks user may also define custom tax codes.
Name/Id Reference Properties
This property is used to reference an object that is already done within QuickBooks. This may be done with its full Name (this property) or its Id, for which a corresponding property is defined. If Name is used, it must contain the full name of the object referred to, as generated by QuickBooks. For hierarchically defined objects, such as Customers, this includes the names of parent objects, and the full name can be determined by reading the FullName special field.
Setting the value of this property will set the corresponding Id property to an empty string.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
item_unit_of_measure Property
Unit of measure describing the Quantity .
Syntax
def get_item_unit_of_measure(item_index: int) -> str: ... def set_item_unit_of_measure(item_index: int, value: str) -> None: ...
Default Value
""
Remarks
Unit of measure describing the item_quantity.
In a transaction line item, the name of the unit of measure selected from within the item's available units. If the company file is enabled only for single unit of measure per item, this must be the base unit!
This property is only available for QBXMLVersion 7.0 and higher.
The item_index parameter specifies the index of the item in the array. The size of the array is controlled by the item_count property.
print_items_in_group Property
Indicates whether line items will be shown on printed forms.
Syntax
def get_print_items_in_group() -> bool: ...
print_items_in_group = property(get_print_items_in_group, None)
Default Value
FALSE
Remarks
If true, a list of this group's individual items their amounts will appear on printed forms.
This property is read-only.
qbxml_version Property
The version of QBXML used to generate the update aggregate.
Syntax
def get_qbxml_version() -> str: ... def set_qbxml_version(value: str) -> None: ...
qbxml_version = property(get_qbxml_version, set_qbxml_version)
Default Value
"3.0"
Remarks
This should match the qbxml_version of the class you're generating a group line update aggregate for.
quantity Property
The quantity of this line item group.
Syntax
def get_quantity() -> str: ... def set_quantity(value: str) -> None: ...
quantity = property(get_quantity, set_quantity)
Default Value
""
Remarks
This property is a String type in order to allow setting fractional quantities. Setting this property with non-numeric data will cause an error. Correct usage of this property is shown below:
class.Quantity = "3"
Leave this property blank and no quantity will be sent to QuickBooks.
total_amount Property
The total amount of this group of line items.
Syntax
def get_total_amount() -> str: ...
total_amount = property(get_total_amount, None)
Default Value
""
Remarks
This property represents the total amount of all transaction lines in the group. This amount will be automatically computed by QuickBooks.
The amount should be formatted as a string in dollars.
This property is read-only.
unit_of_measure Property
Unit of measure describing the Quantity .
Syntax
def get_unit_of_measure() -> str: ... def set_unit_of_measure(value: str) -> None: ...
unit_of_measure = property(get_unit_of_measure, set_unit_of_measure)
Default Value
""
Remarks
In a transaction line item, the name of the unit of measure selected from within the item's available units. If the company file is enabled only for single unit of measure per item, this must be the base unit!
This property is only available for QBXMLVersion 7.0 and higher.
config Method
Sets or retrieves a configuration setting.
Syntax
def config(configuration_string: str) -> str: ...
Remarks
config is a generic method available in every class. It is used to set and retrieve configuration settings for the class.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the config method.
To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).
To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.
get_group_update_aggregate Method
Generates a group aggregate for use in another class's Update request.
Syntax
def get_group_update_aggregate() -> str: ...
Remarks
There is not exposed a way to directly edit the contents of a line item group when submitting an Update request with a class from this package. You can change the quantity, but you cannot change the line items contained inside the group line. The LineItemGroups class is used to parse a line item group aggregate. You may then make changes to the individual line items, and then call the get_group_update_aggregate to return an xml aggregate containing your changes. This is then set to the Aggregate property of the line you wish to modify in your Update.
For instance, the following code changes the BillableStatus of all line items and line item groups in the Bill retrieved from QuickBooks.
Bill.Get("123456");
for (int i = 0; i < Bill1.LineItems.Count; i++) {
if (!Bill.LineItems[i].GroupName.Equals("")) { // this is a group line
LineItemGroups.GroupType = gtBill;
LineItemGroups.ParseAggregate(Bill.LineItems[0].Aggregate);
for (int j = 0; j < LineItemGroups.LineItems.Count) {
LineItemGroups.LineItems[j].BillableStatus = bsHasBeenBilled;
}
LineItemGroups.QBXMLVersion = Bill.QBXMLVersion; // so that the proper fields are included in the update aggregate.
Bill1.LineItems[i].Aggregate = LineItemGroups.GetGroupUpdateAggregate();
} else { // regular line item
Bill.LineItems[i].BillableStatus = bsHasBeenBilled;
}
}
Bill.Update();
parse_aggregate Method
Parses the aggregate returned from another class's ItemAggregate property.
Syntax
def parse_aggregate(aggregate: str) -> None: ...
Remarks
This method takes the XML aggregate returned from any class's ItemAggregate property, and then fills all the properties of this class. For example:
Invoice.Add()
For (i = 0 to Invoice.ItemCount - 1)
LineItems.ParseAggregate(Invoice.ItemAggregate[0])
Debug.Print(LineItems.ItemName & VbTab & LineItems.Quantity & VbTab & LineItems.Amount)
Next
reset Method
Resets this class to its default state.
Syntax
def reset() -> None: ...
Remarks
This method clears all properties and returns the class to its default state.
on_error Event
Information about errors during data delivery.
Syntax
class LineItemGroupsErrorEventParams(object): @property def error_code() -> int: ... @property def description() -> str: ... # In class LineItemGroups: @property def on_error() -> Callable[[LineItemGroupsErrorEventParams], None]: ... @on_error.setter def on_error(event_hook: Callable[[LineItemGroupsErrorEventParams], None]) -> None: ...
Remarks
The on_error event is fired in case of exceptional conditions during message processing.
ErrorCode contains an error code and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.
LineItemGroups Config Settings
The class accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the config method.Base Config Settings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BuildInfo: Information about the product's build.When queried, this setting will return a string containing information about the product's build. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CodePage:
The system code page used for Unicode to Multibyte translations.The default code page is Unicode UTF-8 (65001).
The following is a list of valid code page identifiers:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
LicenseInfo:
Information about the current license.When queried, this setting will return a string containing information about the license this instance of a class is using. It will return the following information:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MaskSensitive:
Whether sensitive data is masked in log messages.In certain circumstances it may be beneficial to mask sensitive data, like passwords, in log messages. Set this to True to mask sensitive data. The default is True.
This setting only works on these classes: AS3Receiver, AS3Sender, Atom, Client(3DS), FTP, FTPServer, IMAP, OFTPClient, SSHClient, SCP, Server(3DS), Sexec, SFTP, SFTPServer, SSHServer, TCPClient, TCPServer. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ProcessIdleEvents: Whether the class uses its internal event loop to process events when the main thread is idle.If set to False, the class will not fire internal idle events. Set this to False to use the class in a background thread on Mac OS. By default, this setting is True. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SelectWaitMillis: The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.If there are no events to process when do_events is called, the class will wait for the amount of time specified here before returning. The default value is 20. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
UseInternalSecurityAPI:
Tells the class whether or not to use the system security libraries or an internal implementation.
When set to False, the class will use the system security libraries by default to perform cryptographic functions where applicable.
Setting this setting to True tells the class to use the internal implementation instead of using the system security libraries. On Windows, this setting is set to False by default. On Linux/macOS, this setting is set to True by default. To use the system security libraries for Linux, OpenSSL support must be enabled. For more information on how to enable OpenSSL, please refer to the OpenSSL Notes section. |
LineItemGroups Errors
LineItemGroups Errors
201 A required field was not specified. | |
421 Update is not supported for this group_type. | |
901 Unable to parse aggregate. | |
902 Invalid group_type. |