xero-php
xero-php copied to clipboard
Error when adding `PurchaseDetails`
When using the addPurchaseDetail
method in Item.php
the purchase detail is added as a new array element. This causes an issue in the arrayToXML
method in the Helpers.php
file.
When a sequential array is passed to this method, it singularizes the key and then adds it to the XML resulting in the following XML output:
<PurchaseDetails>
<PurchaseDetail>
<COGSAccountCode>300</COGSAccountCode>
</PurchaseDetail>
</PurchaseDetails>
Which is incorrectly formatted. I made a small fix for this by removing the new array element creation in addPurchaseDetail
but wanted to know if that's required for any other methods before making a merge request.
Hmm, I'm not sure if it's required elsewhere. Open the fix for this for the time being.
See #308