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

Recurring Invoice Creation Issue #1757

Closed
kaffineaddict opened this issue Dec 6, 2017 · 6 comments
Closed

Recurring Invoice Creation Issue #1757

kaffineaddict opened this issue Dec 6, 2017 · 6 comments

Comments

@kaffineaddict
Copy link

The condition linked below causes issues. If the timezone is offset the recurring expense or invoice NEVER gets created as there is a hard return. It should be more clever and wait for the next day maybe just looking at interval + 1 day if the timezone is offset? I had an issue where only the first invoice/expense would create and then never again and I am 99% sure this bugger was the problem.

if (Carbon::now()->format('Y-m-d') != Carbon::now($timezone)->format('Y-m-d')) {

@hillelcoren
Copy link
Member

Is the cron set to run hourly?

http://docs.invoiceninja.com/en/latest/configure.html

@kaffineaddict
Copy link
Author

No, it’s set to run once daily as it should be. The example you linked for instance is set to run once daily as well. If however your cron run time and time zone are offset like mine were then the recurring stuff will never fire no matter how many days it runs. I know a lot of people that run crons late at night and can see this being a pretty big issue. If it is premature due to timezone it should process the next day it runs.

@hillelcoren
Copy link
Member

I'll update the docs, "ninja:send-invoices" should be set to run hourly.

@kaffineaddict
Copy link
Author

I guess maybe I am missing something. Running the cron hourly seems like overkill. It makes it so the output from the cron isn’t helpful as you would be inundated with cron reports if anyone actually reads them. There also isn’t really a need to run it hourly as this timezone thing is the only logic that would change between runs. Why not just fix the logic and leave it running once?

@hillelcoren
Copy link
Member

We'll look into fixing this in the future, until then running it hourly should work.

@hillelcoren hillelcoren added the bug label Dec 6, 2017
@kaffineaddict
Copy link
Author

Ah, I understand now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants