huerlisi/bookyt

Printing Accounts is not enabled / PDF Export contains only Page 1 Bookings

silvermind opened this issue · 3 comments

On the filtered account page, the printer button is missing.
/de-CH/accounts/2?by_date%5Bfrom%5D=2012-01-01&by_date%5Bto%5D=2016-12-31

using the PDF Format URL directly /de-CH/accounts/2.pdf?by_date%5Bfrom%5D=2012-01-01&by_date%5Bto%5D=2016-12-31
the missing pdf export is returned, but only contains the bookings from the first page. It seems that paging (from the html view) is also enabled in the pdf export, that's may be the reason of the disabled buttons.

the issue seems to come from this line:
https://github.com/silvermind/has_accounts_engine/blob/master/app/controllers/accounts_controller.rb#L15 will fork and try to fix it. As in the PDF Format no pagging should be used.. however I've no idea where the prawn view for the PDF is, rails & huerlisi magic :)

the problem atm is that the controller does not know if the request is a pdf or a normal page, as PDFkit Middleware is used to render the export. I've disabled pagging for the moment, so we can export the yearly reports for each account.

Sorry for the slow reaction, but some improvements have landed now. Please test and report back:-)