Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoking the list() method of AccountsService class returns only the 1st page's items of paginated response. #71

Open
prantoamt opened this issue Oct 28, 2021 · 0 comments

Comments

@prantoamt
Copy link
Contributor

prantoamt commented Oct 28, 2021

Invoking the list() method of AccountsService returns only the 1st page's item of paginated response.

For instance,
if the Fortnox returns the following data:

{
    "MetaInformation": {
        "@TotalResources": 1296,
        "@TotalPages": 13,
        "@CurrentPage": 1
    },
    "Accounts": [
        {
            "@url": "someurl",
            "Active": true,
            "BalanceBroughtForward": 0,
            "CostCenter": "",
            "CostCenterSettings": "ALLOWED",
            "Description": "Utvecklingsutgifter",
            "Number": 1010,
            "Project": "",
            "ProjectSettings": "ALLOWED",
            "SRU": 7201,
            "Year": 4,
            "VATCode": null
        },
       .
       .
       .
        {
            "@url": "someurl",
            "Active": true,
            "BalanceBroughtForward": 0,
            "CostCenter": "",
            "CostCenterSettings": "ALLOWED",
            "Description": "Balanserade utgifter för forskning och utveckling",
            "Number": 1011,
            "Project": "",
            "ProjectSettings": "ALLOWED",
            "SRU": 7201,
            "Year": 4,
            "VATCode": null
        }
}

The list() function returns the current page's items (1st 100 items).

@prantoamt prantoamt changed the title Account Services List and Retrieve method Invoking the list() method of AccountsService returns only the 1st page's item of paginated response. Oct 28, 2021
@prantoamt prantoamt changed the title Invoking the list() method of AccountsService returns only the 1st page's item of paginated response. Invoking the list() method of AccountsService class returns only the 1st page's items of paginated response. Oct 28, 2021
xalien10 pushed a commit that referenced this issue Aug 12, 2022
* helper function added to collect all items of paginated response

* account services list method modified to get all paginated items

* account service retrieve method modified to fix issue #73

* param name changed to kwargs

Co-authored-by: badiuzzaman <badiuzzaman@strativ.se>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant