_init('orange35_custominvoicesgenerator/invoice'); } public function getInvoicesByOrderId($orderId) { $this->getSelect()->where("order_id = ". $orderId . " AND payment_status = '".ucfirst(Mage_Paypal_Model_Info::PAYMENTSTATUS_COMPLETED)."'"); return $this; } }