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

Get invoices created after(since filter) not working #264

Open
gplhegde opened this issue May 14, 2019 · 1 comment
Open

Get invoices created after(since filter) not working #264

gplhegde opened this issue May 14, 2019 · 1 comment

Comments

@gplhegde
Copy link

gplhegde commented May 14, 2019

I am trying to get invoices that are created after a certain date. It does not seem to work. Below is the query I am using

invoice_page = xero.invoices.filter(page=page, since=datetime.datetime(2019, 5, 1))

This returns invoices that are created before the specified date.

However, the raw filter string seems to work

filter = 'Date >= DateTime({:d}, {:d}, {:d})'.format(
        created_after.year, created_after.month, created_after.day)
invoices = xero.invoices.filter(raw=filter)

Did anyone face this issue? Am I missing something here? Appreciate any help.

@lakbum
Copy link

lakbum commented May 21, 2019

Hmm. If you are trying to get invoices after a certain date, then you shouldn't be using the "since" argument since that is used to query based on the last updated date, not creation date. It would be possible to return invoices before the specified date if they had been updated within Xero after your specified date.

Your raw filter is correctly querying on the creation date and thus returning the correct response.

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

2 participants