Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Änderung der Reihenfolge der Totals in PDF-Rechnungen
 
Chris52249
Member
 
Total Posts:  58
Joined:  2009-02-26
 

Guten Morgen liebe Gemeinde wink

Ich habe in der
magento/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php
die Reihenfolge für Versandkosten und Steuern geändert.
Eigentlich sollte es jetzt so aussehen:

-Zwischensumme (netto)
-Versandkosten (netto)
-Steuern
-Gesamtsumme (brutto)

Doch die PDF-Rechnungen werden nach wie vor so erstellt:

-Zwischensumme (netto)
-Steuern
-Versandkosten (netto)
-Gesamtsumme (brutto)

Was mache ich falsch ?
Hier der Code der Funktion, den ich bereits geändert habe:

protected function insertTotals(&$page$source){
        $order 
$source->getOrder();
        
$font $this->_setFontBold($page);

        
$order_subtotal Mage::helper('sales')->__('Order Subtotal:');
        
$page->drawText($order_subtotal475-$this->widthForStringUsingFontSize($order_subtotal$font7), $this->y'UTF-8');

        
$order_subtotal $order->formatPriceTxt($source->getSubtotal());
        
$page->drawText($order_subtotal565-$this->widthForStringUsingFontSize($order_subtotal$font7), $this->y'UTF-8');
        
$this->-=15;

        if ((float)
$source->getDiscountAmount()){
            $discount 
Mage::helper('sales')->__('Discount :');
            
$page->drawText($discount475-$this->widthForStringUsingFontSize($discount$font7), $this->y'UTF-8');

            
$discount $order->formatPriceTxt(0.00 $source->getDiscountAmount());
            
$page->drawText($discount565-$this->widthForStringUsingFontSize($discount$font7), $this->y'UTF-8');
            
$this->-=15;
        
}

        
if ((float)$source->getShippingAmount()){
            $order_shipping 
Mage::helper('sales')->__('Shipping & Handling:');
            
$page->drawText($order_shipping475-$this->widthForStringUsingFontSize($order_shipping$font7), $this->y'UTF-8');

            
$order_shipping $order->formatPriceTxt($source->getShippingAmount());
            
$page->drawText($order_shipping565-$this->widthForStringUsingFontSize($order_shipping$font7), $this->y'UTF-8');
            
$this->-=15;
        
}

        
if ((float)$source->getTaxAmount()){
            $order_tax 
Mage::helper('sales')->__('Tax :');
            
$page->drawText($order_tax475-$this->widthForStringUsingFontSize($order_tax$font7), $this->y'UTF-8');

            
$order_tax $order->formatPriceTxt($source->getTaxAmount());
            
$page->drawText($order_tax565-$this->widthForStringUsingFontSize($order_tax$font7), $this->y'UTF-8');
            
$this->-=15;
        
}


        
if ($source->getAdjustmentPositive()){
            $adjustment_refund 
Mage::helper('sales')->__('Adjustment Refund:');
            
$page ->drawText($adjustment_refund475-$this->widthForStringUsingFontSize($adjustment_refund$font7), $this->y'UTF-8');

            
$adjustment_refund $order->formatPriceTxt($source->getAdjustmentPositive());
            
$page ->drawText($adjustment_refund565-$this->widthForStringUsingFontSize($adjustment_refund$font7), $this->y'UTF-8');
            
$this->-=15;
        
}

        
if ((float) $source->getAdjustmentNegative()){
            $adjustment_fee 
Mage::helper('sales')->__('Adjustment Fee:');
            
$page ->drawText($adjustment_fee475-$this->widthForStringUsingFontSize($adjustment_fee$font7), $this->y'UTF-8');

            
$adjustment_fee=$order->formatPriceTxt($source->getAdjustmentNegative());
            
$page ->drawText($adjustment_fee565-$this->widthForStringUsingFontSize($adjustment_fee$font7), $this->y'UTF-8');
            
$this->-=15;
        
}

        $page
->setFont($font8);

        
$order_grandtotal Mage::helper('sales')->__('Grand Total:');
        
$page ->drawText($order_grandtotal475-$this->widthForStringUsingFontSize($order_grandtotal$font8), $this->y'UTF-8');

        
$order_grandtotal $order->formatPriceTxt($source->getGrandTotal());
        
$page ->drawText($order_grandtotal565-$this->widthForStringUsingFontSize($order_grandtotal$font8), $this->y'UTF-8');
        
$this->-=15;
    
}

Wie ihr seht, sollten die Versandkosten vor den Steuern kommen. Aber leider ist es nicht so.
Wäre super, wenn mir da jemand einen Tipp geben könnte. Danke !

Gruß
Chris

 
Magento Community Magento Community
Magento Community
Magento Community
 
vianetz
Guru
 
Avatar
Total Posts:  537
Joined:  2008-04-13
Munich, Germany
 

Hmm, sollte eigentlich so funktionieren meiner Meinung nach. Cache geleert? Keine weiteren Addons installiert?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top