Skip to content

Report for Profit and Loss only returns monthly report and not yearly or quarterly #167

Closed

Description

@CaptureKervin

Good day Xero,

I was trying to get the Profit and Loss report values in a yearly basis. See image below.
image

but the return I received was just a report for the whole month. See image below:
image

I checked the API documentation on https://xeroapi.github.io/xero-ruby/accounting/index.html#api-Accounting-getReportProfitAndLoss and changed "timeframe" into "time_frame", but same thing was still returned.

I made the timeframe into "QUARTER", but the same output was received. Also changing it into "time_frame" didn't do the trick.
image

Am I missing some params, or is it the API at fault?

Cheers!

Activity

  1. self-assigned this
    on May 12, 2021
  2. rjaus commented on Sep 1, 2021

    @rjaus
    Contributor

    Hey @CaptureKervin,

    Just took a look at this. I think your issue is that you're not specifying a fromDate & toDate.

    From the docs:
    https://developer.xero.com/documentation/api/accounting/reports#profit-and-loss

    fromDate | The date the report starts e.g. 2021-03-01. Defaults to the begining of the current month if not provided.
    toDate | The date the report ends e.g. 2021-03-31. Defaults to the end of the current month if not provided.
    

    If you do not specify, it retrieves the current month, and the timeframe is pretty irrelevant.

    If you specify a year of data, and then MONTH or QUARTER, you'll get the data segmented as expected.

    I haven't tried this specifically with the ruby wrapper, but that's how the API works (which I have verified). If you can try that in the wrapper and still face issues let me know and I'll take a closer look.

  3. assigned and unassigned on Sep 1, 2021
  4. locked and limited conversation to collaborators on Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions