intuit / QuickBooks-V3-Java-SDK

Java SDK for QuickBooks REST API v3 services
Apache License 2.0
70 stars 144 forks source link

The `Received` field is missing in the `PurchaseOrder` object #206

Closed bseib closed 1 year ago

bseib commented 1 year ago

Using the QBO API, when you query for a PurchaseOrder, the JSON for its line items looks like this:

"Line": [
     {
      "Id": "1",
      "LineNum": 1,
      "Description": "Item description here",
      "Amount": 123.45,
      "Received": 4,
      "DetailType": "ItemBasedExpenseLineDetail",
      "ItemBasedExpenseLineDetail": {
       "BillableStatus": "NotBillable",
       "ItemRef": {
        "value": "1234",
        "name": "Name goes here"
       },
       "UnitPrice": 12.34,
       "Qty": 5,
       "TaxCodeRef": {
        "value": "NON"
       }
      }
     }
    ],

This looks correct for item-based line item details. However, the class com.intuit.ipp.data.PurchaseOrder does not have the Received field, so the amount received cannot be read.

I did find the Received field in the Finance.xsd file, so I'm not sure why it is not being generated.


My initial post about this bug: https://help.developer.intuit.com/s/question/0D54R00009wbSzdSAE/where-is-the-receivedquantity-field-for-a-purchase-order-line-item

bseib commented 1 year ago

Does anyone know how to invoke the code generation from the Finance.xsd file? I don't understand why the Received field isn't being generated...

bseib commented 1 year ago

/cc @sujitharamadass @diana-derose

bseib commented 1 year ago

/cc @fjolin-intuit @shweta-intuitdev @nimisha84

sujitharamadass commented 1 year ago

@bseib Will look into the issue and update you

sujitharamadass commented 1 year ago

@bseib Can you please check the minorVersion you are using? To get the "Received" attribute, you should be using minorverison 68

We are able to get the Received attribute via SDK 6.2.4 version Received attribute is returned in the response only for Closed Purchase Orders. The behaviour is the same in API explorer as well as in SDK.

image
bseib commented 1 year ago

Thank you @sujitharamadass for investigating this. I checked my lib version, and it was okay. But you got me to realize what was going on. My problem was that the received field does not exist down in the ItemBasedExpenseLine:

image

It lives one level higher, directly in the Line object (which should have been evident to me in the JSON):

image

The confusion began because the Received field is completely absent from the generated docs:

image

Maybe because Line is a list it is treated differently, so somehow the generator doesn't output its fields to the docs...?? There are other fields that belong to Line that should be documented too, and they are all missing here in the docs.

I will open a new issue regarding the missing fields in the docs.

bseib commented 1 year ago

I have opened #207 to fix the missing documentation.