QuickBooks Integrator 2020 Python Edition

Questions / Feedback?

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 on_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();

Copyright (c) 2021 /n software inc. - All rights reserved.
QuickBooks Integrator 2020 Python Edition - Version 20.0 [Build 7941]