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

How to Create Invoice trough code? 
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

Friends,

When the store receives the payment confirmation from our gateway we add a comment on the order and put it on hold to check the fraud system before sending it to customer.

the code is like this:

$_order->addStatusToHistory(
                    
'processing',
                    
Mage::helper('Boleto')->__(htmlentities("Pagamento do Boleto Confirmado.")),true
                       
);

            
            
$_order->hold();
            
$_order->save();

please note that the order status is ‘processing’.

Now I need to know how to auto-generate invoice in this code.

here in brazil the invoice is always for the full order, so we don´t need to have more than 1 invoice per order…

reagards,

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