XeroAPI / xero-php-oauth2

Xero PHP SDK for oAuth 2 generated from Xero API OpenAPI Spec 3.0
MIT License
91 stars 65 forks source link

IsDiscounted field always false when getInvoices summaryOnly true #241

Closed Youdaman closed 3 years ago

Youdaman commented 3 years ago

SDK you're using (please complete the following information):

Describe the bug When summaryOnly for getInvoices is set to false the IsDiscounted contains true when a line item has a discount applied.

When the summaryOnly is set to true, IsDiscounted always returns false regardless of whether there is a discount or not.

To Reproduce Steps to reproduce the behavior:

  1. add a discount to a line item in Xero
  2. call getInvoices with summaryOnly set to true
  3. look at the returned IsDiscounted field

Expected behavior IsDiscounted should contain a value of true.

Youdaman commented 3 years ago

Also, there is no TotalDiscount field as suggested by the docs.

I see TotalDiscount is present when you call the singular getInvoice.

SerKnight commented 3 years ago

Hey @Youdaman - yes. This is a result of doing a GET for all invoices not fetching the line items. It would seem that that derives the boolean that tells if an invoice has discounts or not. I will flag this as an API bug but considering it isn't unique to PHP I am closing this issue. I will report back to you when the team plans to address this nuance.

Get ALL

Screen Shot 2021-07-22 at 1 52 13 PM

Get Single

Screen Shot 2021-07-22 at 1 51 50 PM


Create

Screen Shot 2021-07-22 at 1 50 50 PM

Youdaman commented 2 years ago

Any update on this nuance @SerKnight ? As you mentioned it's not unique to PHP and I've also struck it using Node.

SerKnight commented 2 years ago

cc @RettBehrens