Magento:减税而不是增加

时间:2012-08-16 12:43:55

标签: php magento entity-attribute-value

我的不含税金额被视为含税。现在我知道你会说我的设置搞砸了但是他们正确地设置了不含税。如果我启用该行的税收设置,它确实会显示10条牛仔裤,每条牛仔裤10欧元,包括税前100欧元和119(19%荷兰税)。

示例:

Subtotal:           100
Shipping:           50
Grand Total ex:     121,5
TAX:                28,5
Grand Total In:     150

我发现另外一个案件有同样的问题,但遗憾的是没有答案...... http://www.magentocommerce.com/answers/Catalog-prices-do-not-include-tax-but-if-I-check-excluding-tax-my-prices-change

CopyPaste示例

Subtotal (Excl. Tax)    € 65,20
Subtotal (Incl. Tax)    € 77,59
Shipping Excl. Tax (Flat Rate - Fixed)  € 50,00
Shipping Incl. Tax (Flat Rate - Fixed)  € 59,50 
Totaal Excl. BTW    € 93,31
BTW € 21,89
Totaal Incl. BTW    € 115,20 

1 个答案:

答案 0 :(得分:0)

它远非漂亮,但以下作品!

19%是荷兰税额

class Mage_Sales_Model_Quote_Address_Total_Grand extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
    /**
     * Collect grand total address amount
     *
     * @param   Mage_Sales_Model_Quote_Address $address
     * @return  Mage_Sales_Model_Quote_Address_Total_Grand
     */
    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        $grandTotal     = $address->getGrandTotal();
        $baseGrandTotal = $address->getBaseGrandTotal();

        $totals     = array_sum($address->getAllTotalAmounts());
        $baseTotals = array_sum($address->getAllBaseTotalAmounts());

        $address->setGrandTotal(($grandTotal+$totals) * 1.19);
        $address->setBaseGrandTotal(($grandTotal+$totals) * 1.19);
        return $this;
    }

    /**
     * Add grand total information to address
     *
     * @param   Mage_Sales_Model_Quote_Address $address
     * @return  Mage_Sales_Model_Quote_Address_Total_Grand
     */
    public function fetch(Mage_Sales_Model_Quote_Address $address)
    {
        $address->addTotal(array(
            'code'  => $this->getCode(),
            'title' => Mage::helper('sales')->__('Grand Total'),
            'value' => $address->getGrandTotal(),
            'area'  => 'footer',
        ));
        return $this;
    }
}