Topic: Ajax Times out in Print Recurring Invoices

One of my client creates Recurring Invoices that are around 230 invoices.

When he clicks to Print Recurring Invoices the Ajax fails to show the print preview. The document is however created in the company's pdf folder but Print Preview is not shown.

HOw to resolve this issue. Any Idea?

www.boxygen.pk

Re: Ajax Times out in Print Recurring Invoices

I don't use this feature, but looking at the code, I am guessing the rotating icon come on during submit, which has a short Ajax timeout.

To use the long Ajax timeout (and display the horizontal time icon like in backup) change:

        submit_center_first('confirmed'.$id, _('Create'), _('Create recurrent invoices'), false, ICON_OK);
to:

        submit_center_first('confirmed'.$id, _('Create'), _('Create recurrent invoices'), "process", ICON_OK);

Note: this really needs to be configurable on a page by page basis rather than hard-coding it, because people keep running into this problem on various pages as their usage of FA grows.  Or the timeout needs to pop-up an alert asking the user if they want to continue or cancel.  Or ajax needs to check if progress is actually being made and eliminate the timeout.

Finally, if you get past that timeout, then php also has a timeout.

Re: Ajax Times out in Print Recurring Invoices

Others of it's ilk are:

ini_set('default_socket_timeout', 2);
// your socket based code here

// restore to the default socket timeout
ini_restore('default_socket_timeout');

ini_set('max_execution_time', 0); // unlimited and default for CLI script usage.

You can not change this setting with ini_set() when running in safe mode.
The duration of sleep() will be ignored in the execution time.

Stands Wiki-ed.

Re: Ajax Times out in Print Recurring Invoices

ini_set('max_execution_time', 300);

Worked in my case

www.boxygen.pk