Open shabananavas opened 3 years ago
This is the gist of how the SalesReceipt is being built:
$invoice = new \QuickBooks_QBXML_Object_SalesReceipt();
// Build customer details here.
//....
/** @var \Drupal\commerce_order\Entity\OrderItem $item */
foreach ($order->getItems() as $item) {
$line->setItemName('My Edited Product');
$line->setDescription('Some description');
$line->setItemListID('80000006-1606821864');
$is_update ? $invoice->addListItem('SalesReceiptLineMod', $line) : $invoice->addListItem('SalesReceiptLineAdd', $line);
}
if ($is_update) {
return $invoice->asQBXML(\QUICKBOOKS_MOD_SALESRECEIPT, \QuickBooks_XML::XML_DROP, '');
}
return $invoice->asQBXML(\QUICKBOOKS_ADD_SALESRECEIPT, \QuickBooks_XML::XML_DROP, '');
I'm trying to modify an already synced Sales Receipt to Quickbooks again. Changing the values in the billing address works just fine. However, I can't seem to figure out how to update the line items in the Sales Receipt. I'm not getting any errors, but the items are not updating. The data I'm sending looks like this for the SalesReceiptLineMod call:
And the SalesReceiptLines look like this:
Item 1:
Item 2:
It appears that this is the only thing that is being included in the XML when it is sent to Quickbooks:
{ "TxnID": "A-1606904011", "EditSequence": "1606913062", "CustomerRef ListID": "80000013-1606898215", "CustomerRef FullName": "Sharon Holt-DeLapp", "TxnDate": "2007-11-16", "RefNumber": "16", "BillAddress Addr1": "PO Box 582", "BillAddress Addr2": "", "BillAddress Addr3": "", "BillAddress Addr4": "", "BillAddress Addr5": null, "BillAddress City": "Hillsboro", "BillAddress State": "OR", "BillAddress PostalCode": "97123", "BillAddress Country": "US", "BillAddress Note": "", "PaymentMethodRef FullName": "Manual" }
So, the line items seem to be removed. I've tried to do what has been mentioned here by passing a -1 for the TxnLineID. However, it's still not updating the items.
Any help would be appreciated. Thanks.