Statement Functionality not working

Hello Folks,

Recently I have upgraded with 3.0.2 version and was very excited to see statement feature, after upgrade v3xx I can see “view statement” in client section however its not able to generate statement and not even able to download. Does anyone has face this problem and any way to resolved?

Please advice

Thanks in advance :slight_smile:

Are there any errors in your browser’s console?

Unfortunately no… just box goes blank after click on view statement and no action happen after clicking on download button.

Are there any errors in storage/logs/laravel-error.log

You may want to erase the log file then load the page

i have deleted existing files and try to relogin, tried to generate statement and also clear cache from cloudflare and browser but no lock so far…!!

I am having the same issue - The “View Statement” does not work in Chrome, firefox, Internet Explorer. But it does work in Microsoft Edge. I don’t care for Microsoft Edge. Any ideas how to get it to work in Chrome? Since that is my preferred browser. I am using Windows 10

If you’re using Docker this may help…

https://github.com/invoiceninja/invoiceninja/issues/1311#issuecomment-275883176

I installed via Softaculous. (not Docker) I find it strange that it generates a pdf on the actual invoice page just fine. But it does not generate a pdf on the view statement page.

Are there any errors in the browser console?

We’ve discovered this error can occur if ‘Embed documents’ is enabled on /settings/invoice_design#invoice_options, we’ll include a fix in our next release.

I have migrated to another sub-domain and its working now… dunno whats wrong with that but have permanent redirect to new domain and its working on same server.

Might if helps to anyone…

Cheers

Concerning the “VIEW CLIENT” console errors -

I do not have embed documents enabled in the invoice options.

1st there was three errors for missing font files - I added font files to a directory it was asking for and that fixed those three errors. There was no fonts directory installed on the server with the Softaculous install.

Below are the errors that remain in the browser (chrome) console:

Jquery.js:5600
The specified value “!” does not conform to the required format. The format is “#rrggbb” where rr, gg, bb are two-digit hexadecimal numbers.
buildFragment @ jquery.js:5600
ot.parseHTML @ jquery.js:9956
ot.fn.init @ jquery.js:2803
ot @ jquery.js:73
(anonymous) @ spectrum.js:56
(anonymous) @ spectrum.js:57
(anonymous) @ spectrum.js:2076


pdf.pdfmake.js:494
Uncaught TypeError: Cannot read property ‘length’ of undefined
at Object.NINJA.invoiceDocuments (pdf.pdfmake.js:494)
at Object.NINJA.decodeJavascript (pdf.pdfmake.js:166)
at GetPdfMake (pdf.pdfmake.js:18)
at generatePDF (script.js:32)
at getPDFString (16:500)
at refreshPDF (16:1295)
at HTMLDocument.<anonymous> (16:504)
at u (jquery.js:3148)
at Object.fireWith [as resolveWith] (jquery.js:3260)
at Function.ready (jquery.js:3472)
NINJA.invoiceDocuments @ pdf.pdfmake.js:494
NINJA.decodeJavascript @ pdf.pdfmake.js:166
GetPdfMake @ pdf.pdfmake.js:18
generatePDF @ script.js:32
getPDFString @ 16:500
refreshPDF @ 16:1295
(anonymous) @ 16:504
u @ jquery.js:3148
fireWith @ jquery.js:3260
ready @ jquery.js:3472
r @ jquery.js:3503

Hope the above helps - really would like to have this feature operational. It is what I would send my customers for their records and it would show unpaid invoices on one page with paid ones. That alone is worth a ton in a pdf format.

Thanks

I’m not sure…

I’ve checked in a fix here:

https://github.com/invoiceninja/invoiceninja/commit/4d6c0775f90b7e0d20de755879df1ea9aa9a53ab

This line in the error at Object.NINJA.invoiceDocuments (pdf.pdfmake.js:494) implies it’s trying to embed the documents in the PDF.

To clarify… there are two similar features.

  • ‘Embed Documents’ on /settings/invoice_design#invoice_options
  • ‘Attach Documents’ on /settings/email_settings

Note: we currently only show unpaid invoices on the statement.

I looked and in both those features below I am not enabled any embedding. :slight_smile:

To clarify… there are two similar features.
– ‘Embed Documents’ on /settings/invoice_design#invoice_options
– ‘Attach Documents’ on /settings/email_settings

I did have have have “Hide Paid to Date” enabled in the invoice_options. I disabled that feature and I noticed that half of the error notice on that page (from console) went away.

Uncaught TypeError: Cannot read property ‘length’ of undefined
at Object.NINJA.invoiceDocuments (pdf.pdfmake.js:494)
at Object.NINJA.decodeJavascript (pdf.pdfmake.js:166)
at GetPdfMake (pdf.pdfmake.js:18)
at generatePDF (script.js:32)
at getPDFString (3:500)
at refreshPDF (3:1293)
at HTMLDocument.<anonymous> (3:504)
at u (jquery.js:3148)
at Object.fireWith [as resolveWith] (jquery.js:3260)
at Function.ready (jquery.js:3472)

We plan to release v3.0.4 in a few days, it should hopefully help.

okay

I went ahead and made the changes from the fix that was listed above

https://github.com/invoiceninja/invoiceninja/commit/4d6c0775f90b7e0d20de755879df1ea9aa9a53ab

Now there is a different problem when you apply the fix. When customers click link to view email, it shows the first page, does not give them the choice to pay anymore and the choices like print, save and to scroll through the pdf are gone.

The only browser the pdf screen for customer that works is if viewed fire fox and the others have a problem.

I am changing my files back to what they were. I wanted to mention this in case the fix you provided is what you planned on using in the next update.

Thanks

I wouldn’t expect the change to do that, can you confirm that undoing the change fixes it.

Note: the important file is public/built.js.

It sounds like you’re using the JavaScript PDF viewer which can be disabled on /settings/account_management

Also, I’d suggest using the latest version of the file.

https://raw.githubusercontent.com/invoiceninja/invoiceninja/master/public/built.js

Another thing most of the time the wording is garbled in the pdf and you have to refresh once or twice to have it clear up. I snapped a picture of it for you. This is in Google Chrome Browser:

garbled text in pdf