Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwrite \Mage_Adminhtml_Sales_OrderController::pdfinvoicesAction to include custom invoice name #215

Closed
KR-A opened this issue Feb 15, 2015 · 16 comments

Comments

@KR-A
Copy link

KR-A commented Feb 15, 2015

Hi.
How and where can I change the file name:
From invoice to RECHNUNG or shipment to VERSAND?
Can I use the customer name to add to the file name?

thanks

@Schrank
Copy link
Member

Schrank commented Feb 15, 2015

sure, that it is for :-)

@Schrank Schrank closed this as completed Feb 15, 2015
@KR-A
Copy link
Author

KR-A commented Feb 15, 2015

Vielen Dank. :-(

@daim2k5 daim2k5 reopened this Feb 15, 2015
@daim2k5
Copy link
Member

daim2k5 commented Feb 15, 2015

Under Configuration->SALES->PDF Print-outs->Invoice "Filename Export Pattern"

@daim2k5 daim2k5 closed this as completed Feb 15, 2015
@Schrank
Copy link
Member

Schrank commented Feb 15, 2015

Oh sorry, misread the question :/ Instead of customer I read custom name and therefore I thought you asked, whether you can use this field to change the name. Thanks @daim2k5 and sorry @KR-A for seeming so rude

@KR-A
Copy link
Author

KR-A commented Feb 15, 2015

Sales -> Orders -> Order No. 123456 -> Invoice. Everything perfect. Thanks !!

Sales -> Orders -> SELECT visble order no. 12345 and select actions "Print": does not work. Here comes invoice2015-02-15_16-10-02.pdf

Is there a solution?

@Schrank Schrank reopened this Feb 15, 2015
@Schrank
Copy link
Member

Schrank commented Feb 15, 2015

I think this controller is not yet overwritten. This needs to be done by someone. You can use https://github.com/firegento/firegento-pdf/blob/development/src/app/code/community/FireGento/Pdf/controllers/Adminhtml/Sales/Order/InvoiceController.php as a starting point.

@Schrank Schrank changed the title Change the file name Overwrite Mage_Adminhtml_Sales_OrderController::pdfinvoices to include custom invoice name Feb 15, 2015
@KR-A
Copy link
Author

KR-A commented Feb 15, 2015

I have 3 Controller overwritten.
No change.
It does not.

@Schrank Schrank changed the title Overwrite Mage_Adminhtml_Sales_OrderController::pdfinvoices to include custom invoice name Overwrite \Mage_Adminhtml_Sales_OrderController::pdfinvoicesAction to include custom invoice name Feb 15, 2015
@Schrank
Copy link
Member

Schrank commented Feb 15, 2015

Do you overwrite \Mage_Adminhtml_Sales_OrderController::pdfinvoicesAction ? And are you sure, your code is called?

@KR-A
Copy link
Author

KR-A commented Feb 15, 2015

This ist the code from InvoiceController.php:

_initInvoice(); if ($invoiceId = $this->getRequest()->getParam('invoice_id')) { if ($invoice = Mage::getModel('sales/order_invoice') ->load($invoiceId) ) { $pdf = Mage::getModel('sales/order_pdf_invoice') ->getPdf(array($invoice)); $this->_prepareDownloadResponse( Mage::helper('firegento_pdf') ->getExportFilename('invoice', $invoice), $pdf->render(), 'application/pdf' ); } } else { $this->_forward('noRoute'); } } }

@Schrank
Copy link
Member

Schrank commented Feb 15, 2015

What do you mean by this?

@KR-A
Copy link
Author

KR-A commented Feb 15, 2015

Yo write: "Do you overwrite \Mage_Adminhtml_Sales_OrderController::pdfinvoicesAction ? "

What do you mean by this?

@Schrank
Copy link
Member

Schrank commented Feb 16, 2015

This is the controller action which handles the pdf printing in the order view. I don't know why, but it seems, that our module isn't overwriting this action yet. So what you want is not available as feature yet (imho). To implement this feature, someone needs to overwrite this controller action, we will. When we find some time. If you need it earlier, either you do it or find some one who does it :-) Of course we are both @sprankhub and me for hire ;-)

@KR-A
Copy link
Author

KR-A commented Feb 16, 2015

Ok. Thanks for the work.

@sprankhub
Copy link
Member

The problem is that the placeholders ({{invoice_id}}, {{order_id}}, {{customer_id}}, {{customer_name}}, {{customer_firstname}}, {{customer_lastname}}) are not applicable if there is more than one document. Hence, I vote for a new configuration field like "Filename Export Pattern for Multiple Documents".

@KR-A
Copy link
Author

KR-A commented Feb 18, 2015

Thanks for the information.
These are my placeholder. Rechnung Nr. {{}} invoice_id vom % d% m% Y {{{{}} customer_firstname customer_lastname}}

Question: An Extension for Print Order Confirmation documents. Is it possible to integrate it?

@sprankhub
Copy link
Member

I do not exactly know what you mean. But I can tell you that there is another issue #200 which handles the order PDFs.

sprankhub added a commit that referenced this issue Mar 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants