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

Edit Shippment of an Order
 
Flowreen
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2010-12-09
Übersee
 

Hello guys,

I’m trying to change the shipping methods with in the admin order view. I achieve that with an ajax call. The Order settings are in the controller, bellow the code

$shipping_amount_excl_tax round($new_rate['price']*100/119,2); // die tax rates dynamisch aus db holen                            
                            
$shipping_amount_excl_taxnumber_format((float)$shipping_amount_excl_tax4'.''');
                            
                            
$base_davor $order->getBaseShippingAmount();
                            
                            
$order->setShippingMethod($new_rate['code']);
                            
$order->setShippingDescription($new_rate['carrier_title'.' - '$new_rate['method_title']);
                            
$order->setShippingAmount($shipping_amount_excl_tax);
                            
$order->setBaseShippingAmount($shipping_amount_excl_tax);
                            
$order->setShippingTaxAmount($new_rate['price']-$shipping_amount_excl_tax);
                            
$order->setBaseShippingTaxAmount($new_rate['price']-$shipping_amount_excl_tax);                            
                            
$order->setShippingInclTax($new_rate['price']);
                            
$order->setBaseShippingInclTax($new_rate['price']);
                            
$order->setBaseGrandTotal($order->getBaseSubtotalInclTax()+$order->getBaseShippingInclTax()+$order->getCodFee());
                            
$order->setGrandTotal($order->getBaseSubtotalInclTax()+$order->getBaseShippingInclTax()+$order->getCodFee());
                            
                                    
                            try
                            
{
                                $order
->save();
                            
}
                            
catch(Exception $e)
                            
{
                                $array[
'msg'"Error updating shipping method";
                                return 
false;
                            
}

Everything works fine. The only problem what i have is that if i am invoice some of the items the base_total_due and total_due not coresponding any more to the grand_total (see the attached file). Any ideas? Thanks

Image Attachments
Bildschirmfoto 2012-10-03 um 04.27.42.png
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top