gpt4 book ai didi

magento - 从发票中去除税款 pdf

转载 作者:行者123 更新时间:2023-12-03 17:52:26 25 4
gpt4 key购买 nike

我一直在尝试从发票 pdf 中删除这一行(税:)。它不知道它会这么难,花了我 5 个小时,我仍然被困住了。

它是销售发票中的打印按钮......在管理员中
enter image description here

请帮忙!

我最后一次尝试是

放入 if($totalInfo['source_field'] == 'tax_amount') {continue;} foreach 下面()

在 Mage_Sales_Model_Order_Pdf_Abstract 的 _getTotalsList($Source) 中(稍后我将覆盖)

    protected function _getTotalsList($source)
{
$totals = Mage::getConfig()->getNode('global/pdf/totals')->asArray();
usort($totals, array($this, '_sortTotalsList'));
$totalModels = array();
foreach ($totals as $index => $totalInfo) {
if($totalInfo['source_field'] == 'tax_amount') {continue;}
        if (!empty($totalInfo['model'])) {
$totalModel = Mage::getModel($totalInfo['model']);
if ($totalModel instanceof Mage_Sales_Model_Order_Pdf_Total_Default) {
$totalInfo['model'] = $totalModel;
} else {
Mage::throwException(
Mage::helper('sales')->__('PDF total model should extend Mage_Sales_Model_Order_Pdf_Total_Default')
);
}
} else {
$totalModel = Mage::getModel($this->_defaultTotalModel);
}
$totalModel->setData($totalInfo);
$totalModels[] = $totalModel;
}

return $totalModels;
}

但它没有用。

最佳答案

要从 magento PDF 发票中删除税列 -

您需要编辑的两个文件是:

  • 要删除标题:/app/code/local/Mage/Sales/Model/Order/Pdf/Invoice.php
  • 从每个单独的行项目中移除税款/app/code/local/Mage/Sales/Model/Order/Pdf/Items/Invoice/Default.php

  • 希望能帮到你!!

    除此以外,

    请参阅此 links

    关于magento - 从发票中去除税款 pdf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17802737/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com