Invoice and Quote Counter Reset

Hello,

I have local host invoice ninja currently running v4.5.14 on Ubuntu 18.04 - Whitelabel. I have been using invoice ninja all 2019, and i set the options for the invoices and quotes counter to reset every annually.

I am using the “INV-{$year}-{$counter}” as the inovice number, and “Q-{$year}-{$counter}” for quotes. However i was trying to create an invoice and quote today, but the year reflects the 2020, but the counter didn’t change from the last invoice / quote.

Anyone has an idea where to start troubleshooting this, or where to get logs why the counter didn’t reset ??

NOTE: the next reset field was empty. Not sure if this was required or not.

The next reset field needs to be set to the next date the counters should be reset (also the crons need to be enabled).

How can i enable cron, i have cron running for other tasks in the same linux box, however i couldn’t find a settings that i can use to turn cron.

All i can find on the manual is to set cron to send reoccurring invoices.

You just need to enable the two crons commands listed here:

https://invoice-ninja.readthedocs.io/en/latest/configure.html

You mean the ones for daily invoices and reminders ??

Yup

ok, thanks. I just thought this is only for invoices. I have added the following lines:

0 8 * * * /usr/local/bin/php /path/to/ninja/artisan ninja:send-invoices
0 8 * * * /usr/local/bin/php /path/to/ninja/artisan ninja:send-reminders

will set the date for tomorrow. Thanks.

I have changed the time to run today, and this is the output i am getting from the cron job

Jan 4 18:13:45 websrv crontab[2721]: (root) END EDIT (root)
Jan 4 18:14:01 websrv cron[2711]: (root) RELOAD (crontabs/root)
Jan 4 18:15:01 websrv CRON[3170]: (root) CMD (/usr/local/bin/php /path/to/ninja/artisan ninja:send-reminders)
Jan 4 18:15:01 websrv CRON[3171]: (root) CMD (/usr/local/bin/php /path/to/ninja/artisan ninja:send-invoices)
Jan 4 18:15:01 websrv cron[2711]: sendmail: fatal: open /etc/postfix/main.cf: No such file or directory
Jan 4 18:15:01 websrv postfix/sendmail[3175]: fatal: open /etc/postfix/main.cf: No such file or directory
Jan 4 18:15:01 websrv postfix/sendmail[3176]: fatal: open /etc/postfix/main.cf: No such file or directory
Jan 4 18:15:01 websrv cron[2711]: sendmail: fatal: open /etc/postfix/main.cf: No such file or directory
Jan 4 18:15:01 websrv CRON[3162]: (root) MAIL (mailed 42 bytes of output but got status 0x004b from MTA#012)
Jan 4 18:15:01 websrv CRON[3161]: (root) MAIL (mailed 42 bytes of output but got status 0x004b from MTA#012)

The counter didn’t reset though

I am sorry i recognized i change the path to the artisan script, still getting the same error though:

Jan 4 19:22:01 websrv CRON[15892]: (root) CMD (/usr/local/bin/php /var/www/html/ninja/artisan ninja:send-invoices)
Jan 4 19:22:01 websrv CRON[15893]: (root) CMD (/usr/local/bin/php /var/www/html/ninja/artisan ninja:send-reminders)
Jan 4 19:22:01 websrv postfix/sendmail[15895]: fatal: open /etc/postfix/main.cf: No such file or directory
Jan 4 19:22:01 websrv cron[2711]: sendmail: fatal: open /etc/postfix/main.cf: No such file or directory
Jan 4 19:22:01 websrv CRON[15891]: (root) MAIL (mailed 42 bytes of output but got status 0x004b from MTA#012)
Jan 4 19:22:01 websrv cron[2711]: sendmail: fatal: open /etc/postfix/main.cf: No such file or directory
Jan 4 19:22:01 websrv postfix/sendmail[15897]: fatal: open /etc/postfix/main.cf: No such file or directory
Jan 4 19:22:01 websrv CRON[15890]: (root) MAIL (mailed 42 bytes of output but got status 0x004b from MTA#012)

apparently the php path for my ubuntu is /usr/bin/php instead of /usr/local/bin/php

Easiest way to be sure is to use which php, and it will give you the correct path.

Thanks for your help.