Jump to content

Allow Invoices To Show Within The Browser Instead Of Forcing Download


Recommended Posts

Again not a feature request you can do it if the browser supports it. Search the forum.

 

 

Not really, you have to code in the headers to not send the header to download/stream/transfer, and insted open, to show in the browser :)

 

Its very easy to implement, for now its not a mandatory feature, but its a feature request, that I also like it :)

Link to comment
Share on other sites

This is very much a feature request.  An in-browser PDF viewer is not a solution to this.

 

+1

 

I don't use a PDF viewer plugin, I just open it on Safari. Chrome doesn't work for me but like I said it's a browser to Browser unless you use Naja7Host's Html one

Link to comment
Share on other sites

You can't reliably force the display of a PDF invoice in the browser. Some browsers will not know what to do with the PDF and prompt you to download it instead. Rather, I think the better solution is to have an HTML version of the invoice that can be viewed in the interface. Then you'd have the option "View" and "Download".. view displays the HTML invoice and perhaps allows you to pay, or links to make payment, and download sends the PDF version as it does now.

 

We have a discussion going about this, but we welcome feedback on the details of how this should look.

Link to comment
Share on other sites

You can't reliably force the display of a PDF invoice in the browser. Some browsers will not know what to do with the PDF and prompt you to download it instead. Rather, I think the better solution is to have an HTML version of the invoice that can be viewed in the interface. Then you'd have the option "View" and "Download".. view displays the HTML invoice and perhaps allows you to pay, or links to make payment, and download sends the PDF version as it does now.

 

We have a discussion going about this, but we welcome feedback on the details of how this should look.

 

That was actually my first instinct but I figured that'd be more work than just having a setting to show the PDF.

Link to comment
Share on other sites

  • 3 weeks later...

I don't know how serious the problem of "some browsers" not knowing what to do with it actually is.

Ubersmith has in-browser PDF loading and NOT ONE TIME SINCE 2004 have I ever had a problem with a staff member or customer having an issue with it!

 

Not once! Since 2004! Seriously!

Link to comment
Share on other sites

I don't know how serious the problem of "some browsers" not knowing what to do with it actually is.

Ubersmith has in-browser PDF loading and NOT ONE TIME SINCE 2004 have I ever had a problem with a staff member or customer having an issue with it!

 

Not once! Since 2004! Seriously!

 

 

for my opinion is not  priority , what i see here the blocker is the attachement pdf in the email , maybe if they force to shew it in the browser it can has a efect to attached pdf in emails .

 

the suggestion is to ad a html preview , for this i have a html invoice componnts that can be used until the staff can release thier own system .

Link to comment
Share on other sites

for my opinion is not  priority , what i see here the blocker is the attachement pdf in the email , maybe if they force to shew it in the browser it can has a efect to attached pdf in emails .

 

the suggestion is to ad a html preview , for this i have a html invoice componnts that can be used until the staff can release thier own system .

 

Tested yours in a dev environment and it wreaks havok on invoice reminders.

Link to comment
Share on other sites

And the reason that a simple option of "Enable In-Browser PDF Loading?" YES or NO

 

Cant just be added in a few minutes and satisfy those who are this adamant about wanting/requiring this feature, is.... what exactly?? *MIND BLOWN*

 

How about I pitch in a $100 USD towards "sponsored development" of this feature and we get it added to the very next Blesta patch/update?

Link to comment
Share on other sites

And the reason that a simple option of "Enable In-Browser PDF Loading?" YES or NO

 

Cant just be added in a few minutes and satisfy those who are this adamant about wanting/requiring this feature, is.... what exactly?? *MIND BLOWN*

 

How about I pitch in a $100 USD towards "sponsored development" of this feature and we get it added to the very next Blesta patch/update?

 

i give you the solution for $0 .

 

open components/invoice_delivery/invoice_delivery.php

 

change this function

public function downloadInvoices(array $invoice_ids, array $options = null) {
  $invoices = $this->getInvoices($invoice_ids, true);
  $this->buildInvoices($invoices, true, $options)->download();
}

to

public function downloadInvoices(array $invoice_ids, array $options = null) {
  $invoices = $this->getInvoices($invoice_ids, true);
  $this->buildInvoices($invoices, true, $options)->stream();
}

test and give me feedback ;)

Link to comment
Share on other sites

More sophistical solution to avoid invoice attachment in email probleme

 

open

 

app/controllers/client_invoices.php

 

if view function  change

$this->InvoiceDelivery->downloadInvoices(array($invoice->id));

to

$this->InvoiceDelivery->streamInvoices(array($invoice->id));

in components/invoice_delivery/invoice_delivery.php

 

under downloadInvoices() add the fallowing function

public function streamInvoices(array $invoice_ids, array $options = null) {
  $invoices = $this->getInvoices($invoice_ids, true);
  $this->buildInvoices($invoices, true, $options)->stream();
}

this will save the email attachement invoice in pdf .

Link to comment
Share on other sites

More sophistical solution to avoid invoice attachment in email probleme

 

open

 

app/controllers/client_invoices.php

 

if view function  change

$this->InvoiceDelivery->downloadInvoices(array($invoice->id));

to

$this->InvoiceDelivery->streamInvoices(array($invoice->id));

in components/invoice_delivery/invoice_delivery.php

 

under downloadInvoices() add the fallowing function

public function streamInvoices(array $invoice_ids, array $options = null) {
  $invoices = $this->getInvoices($invoice_ids, true);
  $this->buildInvoices($invoices, true, $options)->stream();
}

this will save the email attachement invoice in pdf .

 

Thanks! I'll be trying this out and keeping a record of the change so it can be re-implemented after each Blesta update that breaks it.

Link to comment
Share on other sites

More sophistical solution to avoid invoice attachment in email probleme

 

open

 

app/controllers/client_invoices.php

 

if view function  change

$this->InvoiceDelivery->downloadInvoices(array($invoice->id));

to

$this->InvoiceDelivery->streamInvoices(array($invoice->id));

in components/invoice_delivery/invoice_delivery.php

 

under downloadInvoices() add the fallowing function

public function streamInvoices(array $invoice_ids, array $options = null) {
  $invoices = $this->getInvoices($invoice_ids, true);
  $this->buildInvoices($invoices, true, $options)->stream();
}

this will save the email attachement invoice in pdf .

 

 

OK, i just implemented this and when I click View invoice now it loads a blank white page -- both on FireFox and Chrome...

Any ideas?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...