Added invoicing function