Magento - 从后台管理员添加评论到发票

时间:2011-06-08 21:29:37

标签: php magento

有没有人知道如何在管理员的magento订单管理区域中为订单添加评论,然后将它们打印在发票上?谢谢!

3 个答案:

答案 0 :(得分:4)

app/code/local/mage/sales/model/order/pdf/invoice.php

并在public function getPdf中添加以下代码 主要是在Add Total Code

之后

保存并下载PDF发票....热门发票评论将在您的pdf中显示..

/*************************** This Is The Invoice Comments ***********************************/

$this->_setFontRegular($page, 10);

// Begin table header
$page->setFillColor(new Zend_Pdf_Color_RGB(0.93, 0.92, 0.92));
$page->setLineColor(new Zend_Pdf_Color_GrayScale(0.5));
$page->setLineWidth(0.5);
$page->drawRectangle(25, $this->y, 570, $this->y -15);
$this->y -= 10;
$page->setFillColor(new Zend_Pdf_Color_RGB(0, 0, 0));
// end table header


$_tempY = $this->y;

$commentsCollection = $invoice->getCommentsCollection(true);

$internalcomments = "Internal Invoice Comments";
$page->drawText($internalcomments, 35, $this->y, 'UTF-8');

$this->y -= 15;

foreach($commentsCollection as $comm)
{
        $textChunk = wordwrap($comm->getData('comment'), 120, "\n");
        foreach(explode("\n", $textChunk) as $textLine){
                if ($textLine!=='') {
                        $page->drawText(strip_tags(ltrim($textLine)), 35, $this->y, 'UTF-8');
                        $this->y -= 15;
                }
        }

 }

/*************************** End Invoice Comments ***********************************/

答案 1 :(得分:1)

在Magento ver。 1.5.1.0.options已经可用。

转到

  

管理 - >销售 - >订单

查看订单。点击特定订单。应该是“评论历史记录”。您可以在订单中添加评论

创建发票后,转到特定发票。应该是“发票历史记录”。您可以在发票中添加评论。

然后打印发票 如果您愿意在打印输出中添加评论,article可以帮助您

一切顺利

答案 2 :(得分:1)

您需要在发票,货件或贷记凭证模板中添加 {{var comment}} 。您可以访问系统> Transactional Emails访问Magento 1.5提供的默认模板。

根据默认设置创建自己的模板后,请转到系统>配置>销售电子邮件。选择刚刚创建的模板并保存。

{{var comment}} 为您提供添加评论的选项。无论您输入什么,都会在新发票上显示。

希望这就是你所要求的。