How can I get invoice collection filter by status paid & payment method ?

I know how to filter order collection by payment method

$orders = Mage::getModel('sales/order')->getCollection();
    array('payment' =>  $orders->getResource()->getTable('sales/order_payment')),
    'payment.parent_id = main_table.entity_id',

But I can't make it work with


where invoice status is also paid

2 Answers 2


Try this:

$collection = Mage::getResourceModel('sales/order_invoice_collection');
$collection->addFieldToFilter('state', Mage_Sales_Model_Order_Invoice::STATE_PAID);
$collection->getSelect()->join(array('P' => $collection->getResource()->getTable('sales/order_payment')),"P.parent_id = main_table.order_id",array('method'=>'P.method'));
$collection->addFieldToFilter('method', 'checkmo');
echo '<pre>';
foreach($collection as $invoice) {

As stated in Magento User Guide: "Invoice is a record of the receipt of payment for an order" there is no need to apply paid filter to invoice collection. Please refer Magento Guide for further details.

However, if you want to get invoice collection by payment method you can use below code.

$orders = Mage::getModel("sales/order_invoice")->getCollection();
    array('payment' =>  $orders->getResource()->getTable('sales/order_payment')),
    'payment.parent_id = main_table.order_id',
$orders->addFieldToFilter('method','ccsave');  // Set you payment method here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.