public function getInvoices($filter = null)
    {
        if (null === $filter) {
            return $this->invoices;
        }

        return $this->invoices->filter(function(InvoiceInterface $invoice) use ($filter) {
            return $filter xor InvoiceTypes::isCredit($invoice);
        });
    }