Add get_invoice function