Emerging Member
Posts: 110
Registered: ‎03-05-2018
Kudos: 52

How to force invoice drafts to be sent via email

Hello

 

we noticed an odd thing today, some of our invoices were created but never sent to the client, even though the client had the billing tags enabled, and a valid email adress. Instead the invoice was simply left as a draft. 

 

Any idea on how we can force those to be sent to the user? and why would this happen? 

 

Thanks.

Regular Member
Posts: 376
Registered: ‎01-18-2017
Kudos: 123
Solutions: 13

Re: How to force invoice drafts to be sent via email

Same problem, posted also. I can send each one individually, but cannot send them all.

Emerging Member
Posts: 110
Registered: ‎03-05-2018
Kudos: 52

Re: How to force invoice drafts to be sent via email

@clarkraymond 

 

Curious, did this happen last monht as well? for us this is the first time this has happend and we have it on auto meaning the inovices are created on the first of the month. I was just curious if you were the same were it happend this month also..anyways i hope someone can give us some input.

Regular Member
Posts: 376
Registered: ‎01-18-2017
Kudos: 123
Solutions: 13

Re: How to force invoice drafts to be sent via email

Did not happen last month. I am in process of sending each individually. What a major pain. The list goes back to page one after each send. Cannot use up/dn keys, must use mouse. Wearing my hand out.

Ubiquiti Employee
Posts: 11
Registered: 3 weeks ago
Kudos: 3

Re: How to force invoice drafts to be sent via email

[ Edited ]

- Hello, are you sure you have the “Approve and sent automatically” option selected in the Service settings? If you do, could you please provide us with your UCRM settings and version? Thank you.

Screenshot_2.png

 

 

- As for the other issues where you need to send multiple invoices at the same time:

 

- When you want to approve all invoice drafts at once, you can just check the little box on the top of the page and click approve

Screenshot_7.png

 

 

Then there should be the option to send all invoices at the same time under the orange envelope on the top of the page.

Screenshot_3.png

 

Regular Member
Posts: 376
Registered: ‎01-18-2017
Kudos: 123
Solutions: 13

Re: How to force invoice drafts to be sent via email

[ Edited ]

Has been working for months, not a single invoice was released automatically. I had to release them 1 by 1 because they would not go even when I hit the button to send all unsent invoices. They were not "draft" but had not been sent. Running 2-15-0.beta7.

 

 

screenshot-ucrm.citylessinternet.com-2019.03.04-07-57-11.png
Ubiquiti Employee
Posts: 3,923
Registered: ‎12-10-2015
Kudos: 1380
Solutions: 299

Re: How to force invoice drafts to be sent via email

@clarkraymond can you please provide us with more details about your issue?

From what you mentioned, I assume:
- the invoices were correctly generated as expected (not drafts)
- though, they were not sent by email to the clients, right?
- then, when you used the button "send all unsent invoices", what happened? No invoices eligible for sending were shown in the modal window? Or there were some invoices but when you confirmed the modal window, nothing happened? or some error message?

You can also check one of the affected client - does they have an email address configured? Is there some error mentioned in the client's log?
Regular Member
Posts: 376
Registered: ‎01-18-2017
Kudos: 123
Solutions: 13

Re: How to force invoice drafts to be sent via email

In my case:
- the invoices were correctly generated as expected (not drafts) YES
- though, they were not sent by email to the clients, right? YES even though the email telling me recurring invoices had been generated and send
- then, when you used the button "send all unsent invoices", what happened? No invoices eligible for sending were shown in the modal window? Or there were some invoices but when you confirmed the modal window, nothing happened? or some error message? Invoices showed up as not sent, hit the send all unsent, it seemed happy, but none were send

You can also check one of the affected client - does they have an email address configured? Is there some error mentioned in the client's log? All clients were affected

Ubiquiti Employee
Posts: 3,923
Registered: ‎12-10-2015
Kudos: 1380
Solutions: 299

Re: How to force invoice drafts to be sent via email

@clarkraymond
> Invoices showed up as not sent, hit the send all unsent, it seemed happy, but none were send
if you got an error message when you hit "send all unset invoices", please send it to us.

 

Otherwise, please take a look into /system/logs/email - you may see a lot of email in status "Email in queue" - if the number of these emails is not getting smaller, you might restart UCRM to fix it.

 

You can also send us an export of client's log, which could help us to investigate this issue. 

Selection_021.png

Regular Member
Posts: 376
Registered: ‎01-18-2017
Kudos: 123
Solutions: 13

Re: How to force invoice drafts to be sent via email

No error message was generated.

 

No invoices were sent after picking the mail icon, these were sent 1 by 1 by me.

 

I sent a PM with a link to a backup of our system.

 

screenshot-ucrm.citylessinternet.com-2019.03.05-08-10-22.png

Emerging Member
Posts: 110
Registered: ‎03-05-2018
Kudos: 52

Re: How to force invoice drafts to be sent via email

In my case i had the same issue were we tried everything suggested and checked our settings yet the invoices were not sent, they were just created as draf invoices and left in that state. 

 

We tried to force to resend it by clicking on the "email" icon button that was suggested but nothing happend. I'll check the UCRM logs to see if there was any errors and if so i'll post them  but this was working just fine as of last month, no settings were changed so we are not sure what tirggered this.

Emerging Member
Posts: 110
Registered: ‎03-05-2018
Kudos: 52

Re: How to force invoice drafts to be sent via email

@UBNT-Petr @UBNT-Meiv 

 

Found the following error on the UCRM prod.log for today, will check the ones from the 1st and post any anything else that i find

 

[2019-03-05 09:23:57] console.ERROR: Error thrown while running command "rabbitmq:multiple-consumer draft_generation -vv --env=prod". Message: "The EntityManager is closed." {"exception":"[object] (Doctrine\\ORM\\ORMException(code: 0): The EntityManager is closed. at /usr/src/ucrm/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php:144)","command":"rabbitmq:multiple-consumer draft_generation -vv --env=prod","message":"The EntityManager is closed."} []

[2019-03-05 09:23:57] console.DEBUG: Command "rabbitmq:multiple-consumer draft_generation -vv --env=prod" exited with code "1" {"command":"rabbitmq:multiple-consumer draft_generation -vv --env=prod","code":1} []

Emerging Member
Posts: 110
Registered: ‎03-05-2018
Kudos: 52

Re: How to force invoice drafts to be sent via email

@UBNT-Petr @UBNT-Meiv 

 

Looked at our logs for March 1st and found the following error that was thrown right after sevearl succesfull instances. 

 

[2019-03-01 05:30:22] console.ERROR: Error thrown while running command "rabbitmq:multiple-consumer draft_generation -vv --env=prod". Message: "The EntityManager is closed." {"exception":"[object] (Doctrine\\ORM\\ORMException(code: 0): The EntityManager is closed. at /usr/src/ucrm/vendor/doctrine/orm/lib/Doctrine/ORM/ORMException.php:144)","command":"rabbitmq:multiple-consumer draft_generation -vv --env=prod","message":"The EntityManager is closed."} []

 

This same error was thrown sevearl times after that.

Ubiquiti Employee
Posts: 3,923
Registered: ‎12-10-2015
Kudos: 1380
Solutions: 299

Re: How to force invoice drafts to be sent via email

@sergiov87 please which UCRM version do you have?
You have probably a corrupted invoice template. To verify this, you may try to create a single invoice manually. If this works without an issue, let us know.
Ubiquiti Employee
Posts: 1,391
Registered: ‎03-21-2016
Kudos: 226
Solutions: 155

Re: How to force invoice drafts to be sent via email

Hello @clarkraymond, thank you for the backup. We were not able to reproduce your problem, the invoice emails work correctly with your data.

Could you please send me the prod.log located at "/home/ucrm/data/ucrm/log/ucrm/app/logs/prod.log" via PM? This file is not in backup and should contain any errors that could happen while processing the invoice sending queue.

Ubiquiti Employee
Posts: 1,391
Registered: ‎03-21-2016
Kudos: 226
Solutions: 155

Re: How to force invoice drafts to be sent via email

@clarkraymond Also if the invoices were generated on a certain date (probably on the 1st), there should be an archived log in the /home/ucrm/data/ucrm/log/ucrm/app/logs/ directory with the date in filename. If you could find log with the correct date and send that it would help. Thank you for your help!

Emerging Member
Posts: 110
Registered: ‎03-05-2018
Kudos: 52

Re: How to force invoice drafts to be sent via email

@UBNT-Petr So i created an invoice manually and i just noticed right now that all the invoices that were in draft were sent out. I checked the timestamp of when they went out and it matches the same timestamp that's on the invoice i created manually.

 

I also checked the prod.log but it still shows the same error message logged that i posted earlier. 

 

I'm using UCRM version 2.14.7.

Regular Member
Posts: 376
Registered: ‎01-18-2017
Kudos: 123
Solutions: 13

Re: How to force invoice drafts to be sent via email

Just added a service for myself as a client. Then ran the generate recurring invoices. Now the invoice sits there. It sent me an email telling me invoices were created and sent, but never were sent.

 

Screenshot from 2019-03-05 10-06-51.pngScreenshot from 2019-03-05 10-07-50.pngScreenshot from 2019-03-05 10-08-33.png

 

 

Ubiquiti Employee
Posts: 1,391
Registered: ‎03-21-2016
Kudos: 226
Solutions: 155

Re: How to force invoice drafts to be sent via email

@clarkraymond Please send me the prod.log I wrote about, since it happened just now the current one is enough, no need to search for one with the date.

Ubiquiti Employee
Posts: 1,391
Registered: ‎03-21-2016
Kudos: 226
Solutions: 155

Re: How to force invoice drafts to be sent via email

@clarkraymond Could you please also send me the output of "sudo docker logs ucrm_web_app_1", there could be additional info there. Thank you.